You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
631 lines
334 KiB
631 lines
334 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
require({cache:{"esri/chunks/arcade":function(){define("require exports ../arcade/arcadeCompiler ../arcade/ArcadeModuleResolver ../arcade/arcadeRuntime ../arcade/executionError ../arcade/parser ../arcade/treeAnalysis ../arcade/functions/geomsync ../core/has ../core/maybe".split(" "),function(D,O,E,c,y,b,q,F,d,k,w){function C(p,L){if(!0===L.useAsync||!0===p.isAsync)return M(p,L);if(k("esri-csp-restrictions"))return function(Q){return y.executeScript(p,Q)};try{return E.compileScript(p,L)}catch(Q){if("esri.arcade.arcadeuncompilableerror"=== |
|
Q.declaredRootClass)return function(Y){return y.executeScript(p,Y)};throw Q;}}function M(p,L){if(null===P)throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.AsyncNotEnabled,null);if(k("esri-csp-restrictions"))return function(Q){return P.executeScript(p,Q)};try{return E.compileScript(p,L,!0)}catch(Q){if("esri.arcade.arcadeuncompilableerror"===Q.declaredRootClass)return function(Y){return P.executeScript(p,Y)};throw Q;}}function A(p){y.extend(p);E.extend(p,"sync");null===P?S.push(p):(E.extend(p, |
|
"async"),P.extend(p))}function f(p,L=[]){return q.parseScript(p,L)}function m(p,L,Q=[]){p=q.parseScript(p,Q);return r(p,L)}function r(p,L){if(!0===L.useAsync||!0===p.isAsync){if(null===P)throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.AsyncNotEnabled,null);return P.executeScript(p,L)}return y.executeScript(p,L)}function n(p,L){return F.referencesMember(p,L)}function g(p,L){return F.referencesFunction(p,L)}function l(p,L=!1){void 0===L&&(L=!1);return F.findFieldLiterals(p)}function z(p){return F.findExpectedFieldLiterals(p)} |
|
function G(p,L=[]){void 0===p.usesGeometry&&F.findScriptDependencies(p,L);return!0===p.usesGeometry}function a(){return V?V:V=B()}async function B(){const p=await new Promise((L,Q)=>D(["../geometry/geometryEngine"],L,Q));u=!0;d.setGeometryEngine(p);return!0}function x(){return null!==ha?ha:ha=N()}async function N(){await E.enableAsyncSupport();P=await new Promise((p,L)=>D(["../arcade/arcadeAsyncRuntime"],p,L));for(const p of S)P.extend(p),E.extend(p,"async");S=null;return!0}function e(){return J} |
|
function Z(){return P?!0:!1}function t(){return u}function H(){return qa?qa:qa=R()}async function R(){await x();const [p,L,Q,Y,aa,ka]=await Promise.all([new Promise((fa,ja)=>D(["../arcade/featureSetUtils"],fa,ja)),new Promise((fa,ja)=>D(["../arcade/functions/featuresetbase"],fa,ja)),new Promise((fa,ja)=>D(["../arcade/functions/featuresetgeom"],fa,ja)),new Promise((fa,ja)=>D(["../arcade/functions/featuresetstats"],fa,ja)),new Promise((fa,ja)=>D(["../arcade/functions/featuresetstring"],fa,ja)),new Promise((fa, |
|
ja)=>D(["../arcade/functions/knowledgegraph"],fa,ja))]);ra=p;P.extend([L,Q,Y,aa,ka]);E.extend([L,Q,Y,aa,ka],"async");return J=!0}function U(p,L=[]){void 0===p.usesFeatureSet&&F.findScriptDependencies(p,L);return!0===p.usesFeatureSet}function X(p,L=[]){void 0===p.isAsync&&F.findScriptDependencies(p,L);return!0===p.isAsync}async function W(p,L,Q=[],Y=!1,aa=null){return ca(new Set,p,L,Q,Y,aa)}async function ca(p,L,Q,Y=[],aa=!1,ka=null){L="string"===typeof L?f(L):L;const fa=[];if(L&&(!1===u&&(G(L)||aa)&& |
|
fa.push(a()),!1===Z()&&(!0===L.isAsync||Q)&&fa.push(x()),!1===J)){var ja;if(!(ja=U(L)))a:{if(Y)for(const ia of Y)if(n(L,ia)){ja=!0;break a}ja=!1}ja&&fa.push(H())}fa.length&&await Promise.all(fa);await pa(p,L,ka,Q,aa);return!0}function wa(p,L=[]){void 0===p.usesModules&&F.findScriptDependencies(p,L);return!0===p.usesModules}async function pa(p,L,Q=null,Y=!1,aa=!1){var ka=F.findModuleImports(L);null===Q&&0<ka.length&&(Q=c.ArcadeModuleResolver.getDefault());L.loadedModules={};for(const fa of ka){w.assertIsSome(Q); |
|
ka=Q.normalizeModuleUri(fa.source);if(p.has(ka.uri))throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.CircularModules,null);p.add(ka.uri);const ja=await Q.fetchModule(ka);await ca(p,ja,Y,[],aa,Q);p.delete(ka.uri);ja.isAsync&&(L.isAsync=!0);ja.usesFeatureSet&&(L.usesFeatureSet=!0);ja.usesGeometry&&(L.usesGeometry=!0);L.loadedModules[fa.libname]={uri:ka.uri,script:ja}}}function xa(p){if(G(p))return!0;p=F.findFunctionCalls(p);let L=!1;for(let Q=0;Q<p.length;Q++)if(I.has(p[Q])){L=!0;break}return L} |
|
function sa(){return ra}const I=new Set("feature angle bearing centroid envelopeintersects extent geometry isselfintersecting ringisclockwise".split(" "));let J=!1,u=!1,P=null,S=[],V=null,ha=null,qa=null,ra=null;const h=Object.freeze(Object.defineProperty({__proto__:null,_loadScriptDependenciesImpl:ca,compileScript:C,enableAsyncSupport:x,enableAsyncSupportImpl:N,enableFeatureSetSupport:H,enableFeatureSetSupportImpl:R,enableGeometrySupport:a,enableGeometrySupportImpl:B,executeScript:r,extend:A,extractExpectedFieldLiterals:z, |
|
extractFieldLiterals:l,featureSetUtils:sa,isAsyncEnabled:Z,isFeatureSetSupportEnabled:e,isGeometryEnabled:t,loadDependentModules:pa,loadScriptDependencies:W,parseAndExecuteScript:m,parseScript:f,referencesFunction:g,referencesMember:n,scriptIsAsync:X,scriptTouchesGeometry:xa,scriptUsesFeatureSet:U,scriptUsesGeometryEngine:G,scriptUsesModules:wa},Symbol.toStringTag,{value:"Module"}));O._loadScriptDependenciesImpl=ca;O.arcade=h;O.compileScript=C;O.enableAsyncSupport=x;O.enableAsyncSupportImpl=N;O.enableFeatureSetSupport= |
|
H;O.enableFeatureSetSupportImpl=R;O.enableGeometrySupport=a;O.enableGeometrySupportImpl=B;O.executeScript=r;O.extend=A;O.extractExpectedFieldLiterals=z;O.extractFieldLiterals=l;O.featureSetUtils=sa;O.isAsyncEnabled=Z;O.isFeatureSetSupportEnabled=e;O.isGeometryEnabled=t;O.loadDependentModules=pa;O.loadScriptDependencies=W;O.parseAndExecuteScript=m;O.parseScript=f;O.referencesFunction=g;O.referencesMember=n;O.scriptIsAsync=X;O.scriptTouchesGeometry=xa;O.scriptUsesFeatureSet=U;O.scriptUsesGeometryEngine= |
|
G;O.scriptUsesModules=wa})},"esri/arcade/arcadeCompiler":function(){define("require exports ./ArcadeModule ./ArcadeModuleLoader ./containerUtils ./Dictionary ./executionError ./Feature ./FunctionWrapper ../chunks/languageUtils ./treeAnalysis ../chunks/array ./functions/date ./functions/geometry ./functions/geomsync ./functions/maths ./functions/stats ./functions/string ../core/promiseUtils ../geometry/Geometry ../geometry/SpatialReference".split(" "),function(D,O,E,c,y,b,q,F,d,k,w,C,M,A,f,m,r,n,g, |
|
l,z){function G(h,p,L){try{return L(h,null,p.arguments)}catch(Q){throw Q;}}function a(h,p){try{switch(p.type){case "EmptyStatement":return"lc.voidOperation";case "VariableDeclarator":return H(h,p);case "VariableDeclaration":var L=[];for(var Q=0;Q<p.declarations.length;Q++)L.push(a(h,p.declarations[Q]));return L.join("\n")+" \n lastStatement\x3d lc.voidOperation; \n";case "BlockStatement":case "Program":return Z(h,p);case "FunctionDeclaration":{const la=p.id.name.toLowerCase();t(la);var Y="",aa=!1; |
|
void 0!==h.globalScope[la]?Y=la:void 0!==h.globalScope._SymbolsMap[la]?Y=h.globalScope._SymbolsMap[la]:h.undeclaredGlobalsInFunctions.has(la)?(Y=h.undeclaredGlobalsInFunctions.get(la).manglename,h.globalScope._SymbolsMap[la]=Y,h.mangleMap[la]=Y,h.undeclaredGlobalsInFunctions.delete(la),aa=!0):(Y=X(h),h.globalScope._SymbolsMap[la]=Y,h.mangleMap[la]=Y);Q={isAsync:h.isAsync,console:h.console,exports:h.exports,undeclaredGlobalsInFunctions:h.undeclaredGlobalsInFunctions,customfunctions:h.customfunctions, |
|
moduleFactory:h.moduleFactory,moduleFactoryMap:h.moduleFactoryMap,libraryResolver:h.libraryResolver,lrucache:h.lrucache,interceptor:h.interceptor,services:h.services,symbols:h.symbols,mangleMap:h.mangleMap,localScope:{_SymbolsMap:{}},depthCounter:h.depthCounter,globalScope:h.globalScope};var ka="new lang.UserDefinedCompiledFunction( lang.functionDepthchecker(function() { var lastStatement \x3d lc.voidOperation; \n var lscope \x3d runtimeCtx.localStack[runtimeCtx.localStack.length-1];\n";for(var fa= |
|
0;fa<p.params.length;fa++){const Da=p.params[fa].name.toLowerCase();t(Da);const Aa=X(h);Q.localScope._SymbolsMap[Da]=Aa;Q.mangleMap[Da]=Aa;ka+="lscope['"+Aa+"']\x3darguments["+fa.toString()+"];\n"}!0===h.isAsync?(ka=ka+"return lang.__awaiter(this, void 0, void 0, function* () {\n"+(Z(Q,p.body)+"\n return lastStatement; "),ka=ka+"}); }, runtimeCtx),"+(p.params.length+")")):ka+=Z(Q,p.body)+"\n return lastStatement; }, runtimeCtx),"+p.params.length+")";ka+="\n lastStatement \x3d lc.voidOperation; \n"; |
|
L=aa?"gscope[lang.setAssig('"+Y+"', runtimeCtx)]\x3d"+ka:"gscope['"+Y+"']\x3d"+ka}return L;case "ImportDeclaration":{const la=p.specifiers[0].local.name.toLowerCase();t(la);const Da=h.libraryResolver?.loadLibrary(la),Aa=X(h);void 0===h.moduleFactory[Da.uri]&&(h.moduleFactory[Da.uri]=I(Da.syntax,{interceptor:h.interceptor,services:h.services,moduleFactory:h.moduleFactory,lrucache:h.lrucache,timeZone:h.timeZone??null,libraryResolver:h.libraryResolver,customfunctions:h.customfunctions,vars:{}},h.isAsync)); |
|
h.moduleFactoryMap[Aa]=Da.uri;p="";p=h.isAsync?"(yield lang.loadModule('"+Aa+"', runtimeCtx) ); ":"lang.loadModule('"+Aa+"', runtimeCtx); ";void 0!==h.globalScope[la]?Y="gscope['"+la+"']\x3d"+p:void 0!==h.globalScope._SymbolsMap[la]?Y="gscope['"+h.globalScope._SymbolsMap[la]+"']\x3d"+p:(L="",h.undeclaredGlobalsInFunctions.has(la)?(L=h.undeclaredGlobalsInFunctions.get(la).manglename,h.undeclaredGlobalsInFunctions.delete(la)):L=X(h),h.globalScope._SymbolsMap[la]=L,h.mangleMap[la]=L,Y="gscope[lang.setAssig('"+ |
|
L+"', runtimeCtx)]\x3d"+p)}return Y;case "ExportNamedDeclaration":const Ga=a(h,p.declaration);if("FunctionDeclaration"===p.declaration.type)h.exports[p.declaration.id.name.toLowerCase()]="function";else if("VariableDeclaration"===p.declaration.type)for(const la of p.declaration.declarations)h.exports[la.id.name.toLowerCase()]="variable";return Ga;case "ReturnStatement":var ja=null===p.argument?"return lc.voidOperation":"return "+a(h,p.argument);return ja;case "IfStatement":return e(h,p);case "ExpressionStatement":var ia= |
|
"AssignmentExpression"===p.expression.type?"lastStatement \x3d lc.voidOperation; "+a(h,p.expression)+"; \n ":"lastStatement \x3d "+a(h,p.expression)+"; ";return ia;case "AssignmentExpression":return x(h,p);case "UpdateExpression":return B(h,p);case "BreakStatement":return"break";case "ContinueStatement":return"continue";case "TemplateLiteral":try{L=[];Q=0;for(const la of p.quasis)L.push(la.value?JSON.stringify(la.value.cooked):JSON.stringify("")),!1===la.tail&&(L.push(p.expressions[Q]?"lang.castString(lang.aCheck("+ |
|
a(h,p.expressions[Q])+", 'TemplateLiteral'))":""),Q++);aa="(["+L.join(",")+"]).join('')"}catch(la){throw la;}return aa;case "TemplateElement":return JSON.stringify(p.value?p.value.cooked:"");case "ForStatement":L="lastStatement \x3d lc.voidOperation; \n";null!==p.init&&(L+=a(h,p.init)+"; ");const Ia=W(h),Ha=W(h);L+="var "+Ia+" \x3d true; \n do { ";null!==p.update&&(L+=" if ("+Ia+"\x3d\x3d\x3dfalse) {\n "+a(h,p.update)+" \n}\n "+Ia+"\x3dfalse; \n");null!==p.test&&(L+="var "+Ha+" \x3d "+a(h,p.test)+ |
|
"; ",L+="if ("+Ha+"\x3d\x3d\x3dfalse) { break; } else if ("+Ha+"!\x3d\x3dtrue) { lang.error('"+q.ExecutionErrorCodes.BooleanConditionRequired+"'); }\n");L+=a(h,p.body);null!==p.update&&(L+="\n "+a(h,p.update));return L+("\n"+Ia+" \x3d true; \n} while(true); lastStatement \x3d lc.voidOperation; ");case "ForInStatement":fa=W(h);const Ba=W(h),ba=W(h);let oa="var "+fa+" \x3d "+a(h,p.right)+";\n";"VariableDeclaration"===p.left.type&&(oa+=a(h,p.left));let va="VariableDeclaration"===p.left.type?p.left.declarations[0].id.name: |
|
p.left.name;va=va.toLowerCase();t(va);L="";null!==h.localScope&&(void 0!==h.localScope[va]?L="lscope['"+va+"']":void 0!==h.localScope._SymbolsMap[va]&&(L="lscope['"+h.localScope._SymbolsMap[va]+"']"));Q="";if(""===L)if(void 0!==h.globalScope[va])L="gscope['"+va+"']";else if(void 0!==h.globalScope._SymbolsMap[va])L="gscope['"+h.globalScope._SymbolsMap[va]+"']";else if(null!==h.localScope)if(h.undeclaredGlobalsInFunctions.has(va))L="gscope['"+h.undeclaredGlobalsInFunctions.get(va).manglename+"']",Q= |
|
h.undeclaredGlobalsInFunctions.get(va).manglename;else{const la={manglename:X(h),node:p.left};h.undeclaredGlobalsInFunctions.set(va,la);L="gscope['"+la.manglename+"']";Q=la.manglename}Q&&(oa+="lang.chkAssig('"+Q+"',runtimeCtx); \n");oa=oa+("if ("+fa+"\x3d\x3d\x3dnull) { lastStatement \x3d lc.voidOperation; }\n else if (lc.isArray(")+(fa+") || lc.isString("+fa+")) {var ")+(Ba+"\x3d"+fa+".length; \nfor(var ")+(ba+"\x3d0; "+ba+"\x3c"+Ba+"; "+ba+"++) {\n");oa+=L+"\x3d"+ba+";\n";oa+=a(h,p.body);oa+="\n}\n"; |
|
oa+=" lastStatement \x3d lc.voidOperation; \n";oa+=" \n}\n";oa+="else if (lc.isImmutableArray("+fa+")) {";oa=oa+("var "+Ba+"\x3d"+fa+".length(); \nfor(var ")+(ba+"\x3d0; "+ba+"\x3c"+Ba+"; "+ba+"++) {\n");oa+=L+"\x3d"+ba+";\n";oa+=a(h,p.body);oa+="\n}\n";oa+=" lastStatement \x3d lc.voidOperation; \n";oa+=" \n}\n";oa+="else if (( "+fa+" instanceof lang.Dictionary) || ( "+fa+" instanceof lang.Feature)) {";oa=oa+("var "+Ba+"\x3d"+fa+".keys(); \nfor(var ")+(ba+"\x3d0; "+ba+"\x3c"+Ba+".length; "+ba+"++) {\n"); |
|
oa+=L+"\x3d"+Ba+"["+ba+"];\n";oa+=a(h,p.body);oa+="\n}\n";oa+=" lastStatement \x3d lc.voidOperation; \n";oa+=" \n}\n";h.isAsync&&(oa+="else if (lc.isFeatureSet("+fa+")) {",oa=oa+("var "+Ba+"\x3d"+fa+".iterator(runtimeCtx.abortSignal); \nfor(var ")+(ba+"\x3dlang. graphicToFeature( yield "+Ba+".next(),"+fa+", runtimeCtx); "+ba+"!\x3dnull; "+ba+"\x3dlang. graphicToFeature( yield "+Ba+".next(),"+fa+", runtimeCtx)) {\n")+(L+"\x3d"+ba+";\n"),oa+=a(h,p.body),oa+="\n}\n",oa+=" lastStatement \x3d lc.voidOperation; \n", |
|
oa+=" \n}\n");return oa+"else { lastStatement \x3d lc.voidOperation; } \n";case "WhileStatement":L="lastStatement \x3d lc.voidOperation; \n";const Ka=W(h);return L+=`\n var ${Ka} = true;\n do {\n ${Ka} = ${a(h,p.test)};\n if (${Ka}==false) {\n break;\n }\n if (${Ka}!==true) {\n lang.error('${q.ExecutionErrorCodes.BooleanConditionRequired}');\n }\n ${a(h,p.body)}\n }\n while (${Ka} !== false);\n lastStatement = lc.voidOperation;\n `;case "Identifier":return R(h, |
|
p);case "MemberExpression":try{let la;!0===p.computed?la=a(h,p.property):(la="'"+p.property.name+"'",t(p.property.name));var ma="lang.member("+a(h,p.object)+","+la+")"}catch(la){throw la;}return ma;case "Literal":return null===p.value||void 0===p.value?"null":JSON.stringify(p.value);case "CallExpression":return U(h,p);case "UnaryExpression":try{var ya="lang.unary("+a(h,p.argument)+",'"+p.operator+"')"}catch(la){throw la;}return ya;case "BinaryExpression":try{var ta="lang.binary("+a(h,p.left)+","+ |
|
a(h,p.right)+",'"+p.operator+"')"}catch(la){throw la;}return ta;case "LogicalExpression":try{if("AssignmentExpression"===p.left.type||"UpdateExpression"===p.left.type)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.LogicalExpressionOnlyBoolean,p);if("AssignmentExpression"===p.right.type||"UpdateExpression"===p.right.type)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.LogicalExpressionOnlyBoolean,p);if("\x26\x26"===p.operator||"||"===p.operator)var La="(lang.logicalCheck("+a(h, |
|
p.left)+") "+p.operator+" lang.logicalCheck("+a(h,p.right)+"))";else throw new q.ArcadeCompilationError(null,q.ExecutionErrorCodes.LogicExpressionOrAnd,null);}catch(la){throw la;}return La;case "ArrayExpression":try{L=[];for(Q=0;Q<p.elements.length;Q++)"Literal"===p.elements[Q].type?L.push(a(h,p.elements[Q])):L.push("lang.aCheck("+a(h,p.elements[Q])+",'ArrayExpression')");ka="["+L.join(",")+"]"}catch(la){throw la;}return ka;case "ObjectExpression":L="lang.dictionary([";for(Q=0;Q<p.properties.length;Q++){const la= |
|
p.properties[Q];t(la.key.name);const Da="Identifier"===la.key.type?"'"+la.key.name+"'":a(h,la.key),Aa=a(h,la.value);0<Q&&(L+=",");L+="lang.strCheck("+Da+",'ObjectExpression'),lang.aCheck("+Aa+", 'ObjectExpression')"}return L+"])";case "Property":throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.NeverReach,p);case "Array":throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.NeverReach,p);default:throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.Unrecognized,p);}}catch(Ga){throw Ga; |
|
}}function B(h,p){let L=null;var Q="";if("MemberExpression"===p.argument.type)return L=a(h,p.argument.object),!0===p.argument.computed?Q=a(h,p.argument.property):(Q="'"+p.argument.property.name+"'",t(p.argument.property.name)),"lang.memberupdate("+L+","+Q+",'"+p.operator+"',"+p.prefix+")";L=p.argument.name.toLowerCase();t(L);if(null!==h.localScope){if(void 0!==h.localScope[L])return"lang.update(lscope, '"+L+"','"+p.operator+"',"+p.prefix+")";if(void 0!==h.localScope._SymbolsMap[L])return"lang.update(lscope, '"+ |
|
h.localScope._SymbolsMap[L]+"','"+p.operator+"',"+p.prefix+")"}if(void 0!==h.globalScope[L])return"lang.update(gscope, '"+L+"','"+p.operator+"',"+p.prefix+")";if(void 0!==h.globalScope._SymbolsMap[L])return"lang.update(gscope, '"+h.globalScope._SymbolsMap[L]+"','"+p.operator+"',"+p.prefix+")";if(null!==h.localScope){if(h.undeclaredGlobalsInFunctions.has(L))return"lang.update(gscope,lang.chkAssig( '"+h.undeclaredGlobalsInFunctions.get(L).manglename+"',runtimeCtx),'"+p.operator+"',"+p.prefix+")";Q= |
|
{manglename:X(h),node:p.argument};h.undeclaredGlobalsInFunctions.set(L,Q);return"lang.update(gscope, lang.chkAssig('"+Q.manglename+"',runtimeCtx),'"+p.operator+"',"+p.prefix+")"}throw new q.ArcadeExecutionError(h,q.ExecutionErrorCodes.InvalidIdentifier,p);}function x(h,p){const L=a(h,p.right);let Q=null;var Y="";if("MemberExpression"===p.left.type)return Q=a(h,p.left.object),!0===p.left.computed?Y=a(h,p.left.property):(Y="'"+p.left.property.name+"'",t(p.left.property.name)),"lang.assignmember("+Q+ |
|
","+Y+",'"+p.operator+"',"+L+")";Q=p.left.name.toLowerCase();t(Q);if(null!==h.localScope){if(void 0!==h.localScope[Q])return"lscope['"+Q+"']\x3dlang.assign("+L+",'"+p.operator+"', lscope['"+Q+"'])";if(void 0!==h.localScope._SymbolsMap[Q])return"lscope['"+h.localScope._SymbolsMap[Q]+"']\x3dlang.assign("+L+",'"+p.operator+"', lscope['"+h.localScope._SymbolsMap[Q]+"'])"}if(void 0!==h.globalScope[Q])return"gscope['"+Q+"']\x3dlang.assign("+L+",'"+p.operator+"', gscope['"+Q+"'])";if(void 0!==h.globalScope._SymbolsMap[Q])return"gscope['"+ |
|
h.globalScope._SymbolsMap[Q]+"']\x3dlang.assign("+L+",'"+p.operator+"', gscope['"+h.globalScope._SymbolsMap[Q]+"'])";if(null!==h.localScope){if(h.undeclaredGlobalsInFunctions.has(Q))return"gscope[lang.chkAssig('"+h.undeclaredGlobalsInFunctions.get(Q).manglename+"',runtimeCtx)]\x3dlang.assign("+L+",'"+p.operator+"', gscope['"+h.undeclaredGlobalsInFunctions.get(Q).manglename+"'])";Y={manglename:X(h),node:p.argument};h.undeclaredGlobalsInFunctions.set(Q,Y);return"gscope[lang.chkAssig('"+Y.manglename+ |
|
"',runtimeCtx)]\x3dlang.assign("+L+",'"+p.operator+"', gscope['"+Y.manglename+"'])"}throw new q.ArcadeExecutionError(h,q.ExecutionErrorCodes.InvalidIdentifier,p);}function N(h,p){return"BlockStatement"===p.type?a(h,p):"ReturnStatement"===p.type||"BreakStatement"===p.type||"ContinueStatement"===p.type?a(h,p)+"; ":"UpdateExpression"===p.type?"lastStatement \x3d "+a(h,p)+"; ":"ExpressionStatement"===p.type?a(h,p):"ObjectExpression"===p.type?"lastStatement \x3d "+a(h,p)+"; ":a(h,p)+"; "}function e(h, |
|
p){if("AssignmentExpression"===p.test.type||"UpdateExpression"===p.test.type)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.BooleanConditionRequired,p);return`if (lang.mustBoolean(${a(h,p.test)}, runtimeCtx) === true) {\n ${N(h,p.consequent)}\n } `+(null!==p.alternate?"IfStatement"===p.alternate.type?" else "+e(h,p.alternate):` else {\n ${N(h,p.alternate)}\n }\n`:" else {\n lastStatement \x3d lc.voidOperation;\n }\n")}function Z(h,p){let L="";for(let Q=0;Q<p.body.length;Q++)"EmptyStatement"!== |
|
p.body[Q].type&&(L="ReturnStatement"===p.body[Q].type?L+(a(h,p.body[Q])+"; \n"):"BreakStatement"===p.body[Q].type?L+(a(h,p.body[Q])+"; \n"):"ContinueStatement"===p.body[Q].type?L+(a(h,p.body[Q])+"; \n"):"UpdateExpression"===p.body[Q].type?L+("lastStatement \x3d "+a(h,p.body[Q])+"; \n"):"ObjectExpression"===p.body[Q].type?L+("lastStatement \x3d "+a(h,p.body[Q])+"; \n"):L+(a(h,p.body[Q])+" \n"));return L}function t(h){if("iif"===h)throw new q.ArcadeUncompilableError;if("decode"===h)throw new q.ArcadeUncompilableError; |
|
if("when"===h)throw new q.ArcadeUncompilableError;if("defaultvalue"===h)throw new q.ArcadeUncompilableError;}function H(h,p){let L=null===p.init?null:a(h,p.init);L===k.voidOperation&&(L=null);p=p.id.name.toLowerCase();t(p);if(null!==h.localScope){if(void 0!==h.localScope[p])return"lscope['"+p+"']\x3d"+L+"; ";if(void 0!==h.localScope._SymbolsMap[p])return"lscope['"+h.localScope._SymbolsMap[p]+"']\x3d"+L+"; ";var Q=X(h);h.localScope._SymbolsMap[p]=Q;h.mangleMap[p]=Q;return"lscope['"+Q+"']\x3d"+L+"; "}if(void 0!== |
|
h.globalScope[p])return"gscope['"+p+"']\x3d"+L+"; ";if(void 0!==h.globalScope._SymbolsMap[p])return"gscope['"+h.globalScope._SymbolsMap[p]+"']\x3d"+L+"; ";if(h.undeclaredGlobalsInFunctions.has(p))return Q=h.undeclaredGlobalsInFunctions.get(p).manglename,h.globalScope._SymbolsMap[p]=Q,h.mangleMap[p]=Q,h.undeclaredGlobalsInFunctions.delete(p),"gscope[lang.setAssig('"+Q+"', runtimeCtx)]\x3d"+L+"; ";Q=X(h);h.globalScope._SymbolsMap[p]=Q;h.mangleMap[p]=Q;return"gscope['"+Q+"']\x3d"+L+"; "}function R(h, |
|
p){try{const L=p.name.toLowerCase();t(L);if(null!==h.localScope){if(void 0!==h.localScope[L])return"lscope['"+L+"']";if(void 0!==h.localScope._SymbolsMap[L])return"lscope['"+h.localScope._SymbolsMap[L]+"']"}if(void 0!==h.globalScope[L])return"gscope['"+L+"']";if(void 0!==h.globalScope._SymbolsMap[L])return"gscope['"+h.globalScope._SymbolsMap[L]+"']";if(null!==h.localScope){if(h.undeclaredGlobalsInFunctions.has(L))return"gscope[lang.chkAssig('"+h.undeclaredGlobalsInFunctions.get(L).manglename+"',runtimeCtx)]"; |
|
const Q={manglename:X(h),node:p.argument};h.undeclaredGlobalsInFunctions.set(L,Q);return"gscope[lang.chkAssig('"+Q.manglename+"',runtimeCtx)]"}throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.InvalidIdentifier,p);}catch(L){throw L;}}function U(h,p){try{if("MemberExpression"===p.callee.type){if(!0===p.callee.computed)var L=a(h,p.callee.property);else L="'"+p.callee.property.name+"'",t(p.callee.property.name);var Q="[";for(var Y=0;Y<p.arguments.length;Y++)0<Y&&(Q+=", "),Q+=a(h,p.arguments[Y]); |
|
Q+="]";return h.isAsync?"(yield lang.callModuleFunction("+a(h,p.callee.object)+","+Q+","+L+",runtimeCtx))":"lang.callModuleFunction("+a(h,p.callee.object)+","+Q+","+L+",runtimeCtx)"}if("Identifier"!==p.callee.type)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.FunctionNotFound,p);const ia=p.callee.name.toLowerCase();if("iif"===ia){try{if(3!==p.arguments.length)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.WrongNumberOfParameters,p);const ma=W(h);var aa=`${h.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {": |
|
"function() {"}\n var ${ma} = ${a(h,p.arguments[0])};\n\n if (${ma} === true) {\n return ${a(h,p.arguments[1])};\n }\n else if (${ma} === false) {\n return ${a(h,p.arguments[2])};\n }\n else {\n lang.error('ExecutionErrorCodes.BooleanConditionRequired');\n }\n ${h.isAsync?"})}()))":"}()"}`}catch(ma){throw ma;}return aa}if("when"===ia){try{if(3>p.arguments.length)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.WrongNumberOfParameters, |
|
p);if(0===p.arguments.length%2)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.WrongNumberOfParameters,p);const ma=W(h);Y="var ";for(var ka=0;ka<p.arguments.length-1;ka+=2)Y+=`${ma} = lang.mustBoolean(${a(h,p.arguments[ka])}, runtimeCtx);\n if (${ma} === true ) {\n return ${a(h,p.arguments[ka+1])}\n }\n`;Q=`${h.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n ${Y}\n return ${a(h,p.arguments[p.arguments.length- |
|
1])}\n ${h.isAsync?"})}()))":"}()"}`}catch(ma){throw ma;}return Q}if("defaultvalue"===ia){try{if(2>p.arguments.length||3<p.arguments.length)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.WrongNumberOfParameters,p);const ma=W(h),ya=W(h);var fa=3===p.arguments.length?`${h.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${ma} = ${a(h,p.arguments[0])};\n var ${ya} = ${a(h,p.arguments[1])};\n ${ma} = lang.getNestedOptionalValue(${ma}, ${ya});\n return ${ma} != null && ${ma} !== "" ? ${ma} : ${a(h, |
|
p.arguments[2])};\n ${h.isAsync?"})}()))":"}()"}`:`${h.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${ma} = ${a(h,p.arguments[0])};\n if (${ma} === null) {\n return ${a(h,p.arguments[1])};\n }\n if (${ma} === "") {\n return ${a(h,p.arguments[1])};\n }\n if (${ma} === undefined) {\n return ${a(h,p.arguments[1])};\n }\n return ${ma};\n ${h.isAsync? |
|
"})}()))":"}()"}`}catch(ma){throw ma;}return fa}if("decode"===ia){try{if(2>p.arguments.length)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.WrongNumberOfParameters,p);if(2===p.arguments.length)Y=`(${a(h,p.arguments[1])})`;else{if(0===(p.arguments.length-1)%2)throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.WrongNumberOfParameters,p);ka=W(h);var ja=W(h);Q="var ";for(L=1;L<p.arguments.length-1;L+=2)Q+=`${ja} = ${a(h,p.arguments[L])};\n if (lang.binary(${ja}, ${ka}, "==") === true ) {\n return ${a(h, |
|
p.arguments[L+1])}\n }\n`;Y=`${h.isAsync?"(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {":"function() {"}\n var ${ka} = ${a(h,p.arguments[0])};\n ${Q}\n return ${a(h,p.arguments[p.arguments.length-1])}\n ${h.isAsync?"})}()))":"}()"}`}}catch(ma){throw ma;}return Y}Q="";null!==h.localScope&&(void 0!==h.localScope[ia]?Q="lscope['"+ia+"']":void 0!==h.localScope._SymbolsMap[ia]&&(Q="lscope['"+h.localScope._SymbolsMap[ia]+"']"));if(""=== |
|
Q)if(void 0!==h.globalScope[ia])Q="gscope['"+ia+"']";else if(void 0!==h.globalScope._SymbolsMap[ia])Q="gscope['"+h.globalScope._SymbolsMap[ia]+"']";else if(null!==h.localScope)if(h.undeclaredGlobalsInFunctions.has(ia))Q="gscope[lang.chkAssig('"+h.undeclaredGlobalsInFunctions.get(ia).manglename+"',runtimeCtx)]";else{const ma={manglename:X(h),node:p.argument};h.undeclaredGlobalsInFunctions.set(ia,ma);Q="gscope[lang.chkAssig('"+ma.manglename+"',runtimeCtx)]"}if(""!==Q){Y="[";for(ka=0;ka<p.arguments.length;ka++)0< |
|
ka&&(Y+=", "),Y+=a(h,p.arguments[ka]);Y+="]";return h.isAsync?"(yield lang.callfunc("+Q+","+Y+",runtimeCtx) )":"lang.callfunc("+Q+","+Y+",runtimeCtx)"}throw new q.ArcadeCompilationError(h,q.ExecutionErrorCodes.FunctionNotFound,p);}catch(ia){throw ia;}}function X(h){h.symbols.symbolCounter++;return"_T"+h.symbols.symbolCounter.toString()}function W(h){h.symbols.symbolCounter++;return"_Tvar"+h.symbols.symbolCounter.toString()}function ca(h,p,L){const Q={};h||={};L||={};Q._SymbolsMap={};Q.textformatting= |
|
1;Q.infinity=1;Q.pi=1;for(const Y in p)Q[Y]=1;for(const Y in L)Q[Y]=1;for(const Y in h)Q[Y]=1;return Q}function wa(h,p,L,Q){L=L?new V:new S;h||={};p||={};const Y=new b({newline:"\n",tab:"\t",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});Y.immutable=!1;L._SymbolsMap={textformatting:1,infinity:1,pi:1};L.textformatting=Y;L.infinity=Number.POSITIVE_INFINITY;L.pi=Math.PI;for(const aa in p)L[aa]=p[aa],L._SymbolsMap[aa]=1;for(const aa in h)L._SymbolsMap[aa]=1,L[aa]=h[aa]&&"esri.Graphic"=== |
|
h[aa].declaredClass?F.createFromGraphic(h[aa],Q??null):h[aa];return L}function pa(h,p){const L={mode:p,compiled:!0,functions:{},signatures:[],standardFunction:G,standardFunctionAsync:G,evaluateIdentifier:xa};for(let Q=0;Q<h.length;Q++)h[Q].registerFunctions(L);if("sync"===p){for(const Q in L.functions)u[Q]=new d.NativeFunction(L.functions[Q]),S.prototype[Q]=u[Q];for(h=0;h<L.signatures.length;h++)w.addFunctionDeclaration(L.signatures[h],"sync")}else{for(const Q in L.functions)P[Q]=new d.NativeFunction(L.functions[Q]), |
|
V.prototype[Q]=P[Q];for(h=0;h<L.signatures.length;h++)w.addFunctionDeclaration(L.signatures[h],"async")}}function xa(h,p){p=p.name;if("_SymbolsMap"===p)throw new q.ArcadeExecutionError(h,q.ExecutionErrorCodes.InvalidIdentifier,null);if(0<h.localStack.length){if("_t"!==p.substr(0,2).toLowerCase()&&void 0!==h.localStack[h.localStack.length-1][p])return h.localStack[h.localStack.length-1][p];const L=h.mangleMap[p];if(void 0!==L&&void 0!==h.localStack[h.localStack.length-1][L])return h.localStack[h.localStack.length- |
|
1][L]}if("_t"!==p.substr(0,2).toLowerCase()&&void 0!==h.globalScope[p]||1===h.globalScope._SymbolsMap[p])return h.globalScope[p];p=h.mangleMap[p];if(void 0!==p)return h.globalScope[p]}function sa(h){console.log(h)}function I(h,p,L=!1){p={isAsync:L,moduleFactory:p.moduleFactory,moduleFactoryMap:{},libraryResolver:new c.ArcadeModuleLoader(null,h.loadedModules),globalScope:ca(p.vars,L?P:u,p.customfunctions),customfunctions:p.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map, |
|
depthCounter:{depth:1},exports:{},console:sa,lrucache:p.lrucache,timeZone:p.timeZone??null,interceptor:p.interceptor,services:p.services,symbols:{symbolCounter:0}};h=a(p,h);""===h&&(h="lc.voidOperation; ");const Q=p.moduleFactory,Y=p.moduleFactoryMap,aa=p.exports,ka={};for(var fa in aa)ka[fa]=void 0!==p.mangleMap[fa]?p.mangleMap[fa]:fa;fa={lc:k.lc,lang:qa,mangles:p.mangleMap,prepareModule(ja){return new ra(ja)},prepare(ja,ia){let ma=ja.spatialReference;if(null===ma||void 0===ma)ma=new z({wkid:102100}); |
|
const ya=wa(ja.vars,ja.customfunctions,ia,ja.timeZone);return{localStack:[],isAsync:ia,exports:aa,exportmangle:ka,gdefs:{},moduleFactory:Q,moduleFactoryMap:Y,moduleSingletons:ja.moduleSingletons,mangleMap:this.mangles,spatialReference:ma,globalScope:ya,abortSignal:void 0===ja.abortSignal||null===ja.abortSignal?{aborted:!1}:ja.abortSignal,localScope:null,services:ja.services,console:ja.console??sa,lrucache:ja.lrucache,timeZone:ja.timeZone??null,interceptor:ja.interceptor,symbols:{symbolCounter:0}, |
|
depthCounter:ja.depthCounter}}};return(new Function("context","spatialReference",L?"var runtimeCtx\x3dthis.prepare(context, true);\n var lc \x3d this.lc; var lang \x3d this.lang; var gscope\x3druntimeCtx.globalScope; \nreturn lang.__awaiter(this, void 0, void 0, function* () {\n\n function mainBody() {\n var lastStatement\x3dlc.voidOperation;\n return lang.__awaiter(this, void 0, void 0, function* () {\n"+h+"\n return lastStatement; }); } \n yield mainBody(); \n return this.prepareModule(runtimeCtx); }); ": |
|
"var runtimeCtx\x3dthis.prepare(context, false);\n var lc \x3d this.lc; var lang \x3d this.lang; var gscope\x3druntimeCtx.globalScope; \n function mainBody() {\n var lastStatement\x3dlc.voidOperation;\n "+h+"\n return lastStatement; } \n mainBody(); \n return this.prepareModule(runtimeCtx); ")).bind(fa)}class J extends d.ArcadeFunction{constructor(h,p){super();this.paramCount=p;this.fn=h}createFunction(h){return(...p)=>{if(p.length!==this.paramCount)throw new q.ArcadeExecutionError(h,q.ExecutionErrorCodes.WrongNumberOfParameters, |
|
null);return this.fn(...p)}}call(h,p){return this.fn(...p.arguments)}marshalledCall(h,p,L,Q){return Q(h,p,(Y,aa,ka)=>{ka=ka.map(fa=>!k.isFunctionParameter(fa)||fa instanceof d.ScopeMarshalledFunction?fa:d.wrapModuleScopedResponse(fa,h,Q));Y=this.call(L,{arguments:ka});return g.isPromiseLike(Y)?Y.then(fa=>d.wrapModuleScopedResponse(fa,L,Q)):Y})}}const u={};M.registerFunctions(u,G);n.registerFunctions(u,G);m.registerFunctions(u,G);A.registerFunctions(u,G);r.registerFunctions(u,G);u.iif=function(h,p){try{return G(h, |
|
p,(L,Q,Y)=>{throw new q.ArcadeExecutionError(h,q.ExecutionErrorCodes.Unrecognized,p);})}catch(L){throw L;}};u.decode=function(h,p){try{return G(h,p,(L,Q,Y)=>{throw new q.ArcadeExecutionError(h,q.ExecutionErrorCodes.Unrecognized,p);})}catch(L){throw L;}};u.when=function(h,p){try{return G(h,p,(L,Q,Y)=>{throw new q.ArcadeExecutionError(h,q.ExecutionErrorCodes.Unrecognized,p);})}catch(L){throw L;}};u.defaultvalue=function(h,p){try{return G(h,p,(L,Q,Y)=>{throw new q.ArcadeExecutionError(h,q.ExecutionErrorCodes.Unrecognized, |
|
p);})}catch(L){throw L;}};const P={};for(const h in u)P[h]=new d.NativeFunction(u[h]);f.registerFunctions(u,G);for(const h in u)u[h]=new d.NativeFunction(u[h]);const S=function(){};S.prototype=u;const V=function(){};V.prototype=P;M={fixSpatialReference:k.fixSpatialReference,parseArguments:function(h,p){const L=[];for(let Q=0;Q<p.arguments.length;Q++)L.push(a(h,p.arguments[Q]));return L},standardFunction:G};pa([C.ArrayFunctions],"sync");pa([C.ArrayFunctions],"async");let ha=0;const qa={isNumber(h){return k.isNumber(h)}, |
|
isArray(h){return k.isArray(h)},isImmutableArray(h){return k.isImmutableArray(h)},isFeature(h){return k.isFeature(h)},isString(h){return k.isString(h)},isDictionary(h){return k.isDictionary(h)},isGeometry(h){return k.isGeometry(h)},geometryMember(h,p,L,Q,Y=1){return y.geometryMember(h,p,L,Q,Y)},error(h){throw new q.ArcadeExecutionError(null,h,null);},__awaiter(h,p,L,Q){return new Promise((Y,aa)=>{function ka(ia){try{ja(Q.next(ia))}catch(ma){aa(ma)}}function fa(ia){try{ja(Q["throw"](ia))}catch(ma){aa(ma)}} |
|
function ja(ia){ia.done?Y(ia.value):ia.value?.then?ia.value.then(ka,fa):(ha++,0===ha%100?setTimeout(()=>{ha=0;ka(ia.value)},0):ka(ia.value))}ja((Q=Q.apply(h,p||[])).next())})},functionDepthchecker(h,p){return function(){p.depthCounter.depth++;p.localStack.push([]);if(64<p.depthCounter.depth)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.MaximumCallDepth,null);const L=h.apply(this,arguments);if(g.isPromiseLike(L))return L.then(Q=>{p.depthCounter.depth--;--p.localStack.length;return Q}); |
|
p.depthCounter.depth--;--p.localStack.length;return L}},chkAssig(h,p){if(void 0===p.gdefs[h])throw new q.ArcadeExecutionError(p,q.ExecutionErrorCodes.InvalidIdentifier,null);return h},mustBoolean(h,p){if(!0===h||!1===h)return h;throw new q.ArcadeExecutionError(p,q.ExecutionErrorCodes.BooleanConditionRequired,null);},setAssig(h,p){p.gdefs[h]=1;return h},castString(h){return k.toString(h)},aCheck(h,p){if(k.isFunctionParameter(h)){if("ArrayExpression"===p)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.NoFunctionInArray, |
|
null);if("ObjectExpression"===p)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.NoFunctionInDictionary,null);throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.NoFunctionInTemplateLiteral,null);}return h===k.voidOperation?null:h},Dictionary:b,Feature:F,UserDefinedCompiledFunction:J,dictionary(h){const p={},L=new Map;for(let Q=0;Q<h.length;Q+=2){if(k.isFunctionParameter(h[Q+1]))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.NoFunctionInDictionary,null);if(!1===k.isString(h[Q]))throw new q.ArcadeExecutionError(null, |
|
q.ExecutionErrorCodes.KeyMustBeString,null);let Y=h[Q].toString();const aa=Y.toLowerCase();L.has(aa)?Y=L.get(aa):L.set(aa,Y);p[Y]=h[Q+1]===k.voidOperation?null:h[Q+1]}h=new b(p);h.immutable=!1;return h},strCheck(h){if(!1===k.isString(h))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.KeyMustBeString,null);return h},unary(h,p){if(k.isBoolean(h)){if("!"===p)return!h;if("-"===p)return-1*k.toNumber(h);if("+"===p)return 1*k.toNumber(h);if("~"===p)return~k.toNumber(h);throw new q.ArcadeExecutionError(null, |
|
q.ExecutionErrorCodes.UnsupportedUnaryOperator,null);}if("-"===p)return-1*k.toNumber(h);if("+"===p)return 1*k.toNumber(h);if("~"===p)return~k.toNumber(h);throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.UnsupportedUnaryOperator,null);},logicalCheck(h){if(!1===k.isBoolean(h))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.LogicExpressionOrAnd,null);return h},logical(h,p,L){if(k.isBoolean(h)&&k.isBoolean(p))switch(L){case "||":return h||p;case "\x26\x26":return h&&p}throw new q.ArcadeExecutionError(null, |
|
q.ExecutionErrorCodes.LogicExpressionOrAnd,null);},binary(h,p,L){switch(L){case "|":case "\x3c\x3c":case "\x3e\x3e":case "\x3e\x3e\x3e":case "^":case "\x26":return k.binaryOperator(k.toNumber(h),k.toNumber(p),L);case "\x3d\x3d":return k.equalityTest(h,p);case "\x3d":return k.equalityTest(h,p);case "!\x3d":return!k.equalityTest(h,p);case "\x3c":return k.greaterThanLessThan(h,p,L);case "\x3e":return k.greaterThanLessThan(h,p,L);case "\x3c\x3d":return k.greaterThanLessThan(h,p,L);case "\x3e\x3d":return k.greaterThanLessThan(h, |
|
p,L);case "+":return k.isString(h)||k.isString(p)?k.toString(h)+k.toString(p):k.toNumber(h)+k.toNumber(p);case "-":return k.toNumber(h)-k.toNumber(p);case "*":return k.toNumber(h)*k.toNumber(p);case "/":return k.toNumber(h)/k.toNumber(p);case "%":return k.toNumber(h)%k.toNumber(p);default:throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.UnsupportedOperator,null);}},assign(h,p,L){switch(p){case "\x3d":return h===k.voidOperation?null:h;case "/\x3d":return k.toNumber(L)/k.toNumber(h);case "*\x3d":return k.toNumber(L)* |
|
k.toNumber(h);case "-\x3d":return k.toNumber(L)-k.toNumber(h);case "+\x3d":return k.isString(L)||k.isString(h)?k.toString(L)+k.toString(h):k.toNumber(L)+k.toNumber(h);case "%\x3d":return k.toNumber(L)%k.toNumber(h);default:throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.UnsupportedOperator,null);}},update(h,p,L,Q){const Y=k.toNumber(h[p]);h[p]="++"===L?Y+1:Y-1;return!1===Q?Y:"++"===L?Y+1:Y-1},graphicToFeature(h,p,L){return null===h?null:F.createFromGraphicLikeObject(h.geometry,h.attributes, |
|
p,L.timeZone)},memberupdate(h,p,L,Q){let Y;if(k.isArray(h))if(k.isNumber(p)){0>p&&(p=h.length+p);if(0>p||p>=h.length)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.OutOfBounds,null);Y=k.toNumber(h[p]);h[p]="++"===L?Y+1:Y-1}else throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.ArrayAccessorMustBeNumber,null);else if(h instanceof b){if(!1===k.isString(p))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.KeyAccessorMustBeString,null);if(!0===h.hasField(p))Y=k.toNumber(h.field(p)), |
|
h.setField(p,"++"===L?Y+1:Y-1);else throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.FieldNotFound,null,{key:p});}else if(k.isFeature(h)){if(!1===k.isString(p))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.KeyAccessorMustBeString,null);if(!0===h.hasField(p))Y=k.toNumber(h.field(p)),h.setField(p,"++"===L?Y+1:Y-1);else throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.FieldNotFound,null);}else{if(k.isImmutableArray(h))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.Immutable, |
|
null);if(h instanceof ra){if(!1===k.isString(p))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.ModuleAccessorMustBeString,null);if(!0===h.hasGlobal(p))Y=k.toNumber(h.global(p)),h.setGlobal(p,"++"===L?Y+1:Y-1);else throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.ModuleExportNotFound,null);}else throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.InvalidIdentifier,null);}return!1===Q?Y:"++"===L?Y+1:Y-1},assignmember(h,p,L,Q){if(k.isArray(h))if(k.isNumber(p)){0>p&&(p= |
|
h.length+p);if(0>p||p>h.length)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.OutOfBounds,null);if(p===h.length&&"\x3d"!==L)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.OutOfBounds,null);h[p]=this.assign(Q,L,h[p])}else throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.ArrayAccessorMustBeNumber,null);else if(h instanceof b){if(!1===k.isString(p))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.KeyAccessorMustBeString,null);if(!0===h.hasField(p))h.setField(p, |
|
this.assign(Q,L,h.field(p)));else{if("\x3d"!==L)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.FieldNotFound,null);h.setField(p,this.assign(Q,L,null))}}else if(k.isFeature(h)){if(!1===k.isString(p))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.KeyAccessorMustBeString,null);if(!0===h.hasField(p))h.setField(p,this.assign(Q,L,h.field(p)));else{if("\x3d"!==L)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.FieldNotFound,null);h.setField(p,this.assign(Q,L,null))}}else{if(k.isImmutableArray(h))throw new q.ArcadeExecutionError(null, |
|
q.ExecutionErrorCodes.Immutable,null);if(h instanceof ra){if(!1===k.isString(p))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.ModuleAccessorMustBeString,null);if(h.hasGlobal(p))h.setGlobal(p,this.assign(Q,L,h.global(p)));else throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.ModuleExportNotFound,null);}else throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.InvalidIdentifier,null);}},member(h,p){if(null===h)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.MemberOfNull, |
|
null);if(h instanceof b||k.isFeature(h)){if(k.isString(p))return h.field(p);throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.InvalidMemberAccessKey,null);}if(h instanceof l){if(k.isString(p))return y.geometryMember(h,p,null,null);throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.InvalidMemberAccessKey,null);}if(k.isArray(h)){if(k.isNumber(p)&&isFinite(p)&&Math.floor(p)===p){0>p&&(p=h.length+p);if(p>=h.length||0>p)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.OutOfBounds, |
|
null);return h[p]}throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.InvalidMemberAccessKey,null);}if(k.isString(h)){if(k.isNumber(p)&&isFinite(p)&&Math.floor(p)===p){0>p&&(p=h.length+p);if(p>=h.length||0>p)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.OutOfBounds,null);return h[p]}throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.InvalidMemberAccessKey,null);}if(k.isImmutableArray(h)){if(k.isNumber(p)&&isFinite(p)&&Math.floor(p)===p){0>p&&(p=h.length()+p);if(p>=h.length()|| |
|
0>p)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.OutOfBounds,null);return h.get(p)}throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.InvalidMemberAccessKey,null);}if(h instanceof ra&&k.isString(p))return h.global(p);throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.InvalidMemberAccessKey,null);},callfunc(h,p,L){return h.call(L,{arguments:p,preparsed:!0})},loadModule(h,p){h=p.moduleFactoryMap[h];if(p.moduleSingletons[h])return p.moduleSingletons[h];const L=p.moduleFactory[h]({vars:{}, |
|
moduleSingletons:p.moduleSingletons,depthCounter:p.depthCounter,console:p.console,abortSignal:p.abortSignal,isAsync:p.isAsync,services:p.services,lrucache:p.lrucache,timeZone:p.timeZone??null,interceptor:p.interceptor},p.spatialReference);return p.moduleSingletons[h]=L},callModuleFunction(h,p,L,Q){if(!(h instanceof ra))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.FunctionNotFound,null);h=h.global(L);if(!1===k.isFunctionParameter(h))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.CallNonFunction, |
|
null);return h.call(Q,{preparsed:!0,arguments:p})},getNestedOptionalValue(h,p){return y.getNestedOptionalValue(h,p)}};class ra extends E.ArcadeModule{constructor(h){super(null);this.moduleContext=h}hasGlobal(h){void 0===this.moduleContext.exports[h]&&(h=h.toLowerCase());return void 0!==this.moduleContext.exports[h]?!0:!1}setGlobal(h,p){const L=this.moduleContext.globalScope;h=h.toLowerCase();if(k.isFunctionParameter(p))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.AssignModuleFunction, |
|
null);L[this.moduleContext.exportmangle[h]]=p}global(h){const p=this.moduleContext.globalScope;h=h.toLowerCase();const L=p[this.moduleContext.exportmangle[h]];if(void 0===L)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.InvalidIdentifier,null);if(k.isFunctionParameter(L)&&!(L instanceof d.ScopeMarshalledFunction)){const Q=new d.ScopeMarshalledFunction;Q.fn=L;Q.parameterEvaluator=G;Q.context=this.moduleContext;return p[this.moduleContext.exportmangle[h]]=Q}return L}}O.UserDefinedCompiledFunction= |
|
J;O.compileScript=function(h,p,L=!1){null===p&&(p={vars:{},customfunctions:{}});var Q=null;h.usesModules&&(Q=new c.ArcadeModuleLoader(null,h.loadedModules));Q={isAsync:L,globalScope:ca(p.vars,L?P:u,p.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:p.customfunctions,libraryResolver:Q,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:sa,lrucache:p.lrucache,timeZone:p.timeZone??null,interceptor:p.interceptor,services:p.services, |
|
symbols:{symbolCounter:0}};h=a(Q,h);""===h&&(h="lc.voidOperation; ");0<Q.undeclaredGlobalsInFunctions.size&&Q.undeclaredGlobalsInFunctions.forEach(ia=>{throw new q.ArcadeCompilationError(p,q.ExecutionErrorCodes.InvalidIdentifier,ia.node);});const Y=Q.moduleFactory,aa=Q.moduleFactoryMap,ka=Q.exports,fa={};for(var ja in ka)fa[ja]=void 0!==Q.mangleMap[ja]?Q.mangleMap[ja]:ja;ja={lc:k.lc,lang:qa,mangles:Q.mangleMap,postProcess(ia){ia instanceof k.returnResult&&(ia=ia.value);ia instanceof k.implicitResult&& |
|
(ia=ia.value);ia===k.voidOperation&&(ia=null);if(ia===k.breakResult)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.IllegalResult,null);if(ia===k.continueResult)throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.IllegalResult,null);if(k.isFunctionParameter(ia))throw new q.ArcadeExecutionError(null,q.ExecutionErrorCodes.IllegalResult,null);return ia},prepare(ia,ma){let ya=ia.spatialReference;if(null===ya||void 0===ya)ya=z.WebMercator;const ta=wa(ia.vars,ia.customfunctions,ma,ia.timeZone); |
|
return{localStack:[],isAsync:ma,moduleFactory:Y,moduleFactoryMap:aa,mangleMap:this.mangles,moduleSingletons:{},exports:ka,gdefs:{},exportmangle:fa,spatialReference:ya,globalScope:ta,abortSignal:void 0===ia.abortSignal||null===ia.abortSignal?{aborted:!1}:ia.abortSignal,localScope:null,services:ia.services,console:ia.console??sa,lrucache:ia.lrucache,timeZone:ia.timeZone??null,interceptor:ia.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return(new Function("context","spatialReference", |
|
L?"var runtimeCtx\x3dthis.prepare(context, true);\n var lc \x3d this.lc; var lang \x3d this.lang; var gscope\x3druntimeCtx.globalScope; \nreturn lang.__awaiter(this, void 0, void 0, function* () {\n\n function mainBody() {\n var lastStatement\x3dlc.voidOperation;\n return lang.__awaiter(this, void 0, void 0, function* () {\n"+h+"\n return lastStatement; }); } \n return this.postProcess(yield mainBody()); }); ":"var runtimeCtx\x3dthis.prepare(context, false);\n var lc \x3d this.lc; var lang \x3d this.lang; var gscope\x3druntimeCtx.globalScope; \n function mainBody() {\n var lastStatement\x3dlc.voidOperation;\n "+ |
|
h+"\n return lastStatement; } \n return this.postProcess(mainBody()); ")).bind(ja)};O.enableAsyncSupport=async function(){const h=await new Promise((p,L)=>D(["./functions/geomasync"],p,L));pa([h],"async");return!0};O.executeScript=function(h,p){return h(p)};O.extend=pa;O.functionHelper=M;Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/ArcadeModule":function(){define(["exports"],function(D){class O{constructor(E){this.source=E}}D.ArcadeModule=O;Object.defineProperty(D, |
|
Symbol.toStringTag,{value:"Module"})})},"esri/arcade/ArcadeModuleLoader":function(){define(["exports"],function(D){class O{constructor(E,c){this._moduleSingletons=E;this._syntaxModules=c}loadLibrary(E){return null==this._syntaxModules?null:(E=this._syntaxModules[E.toLowerCase()])?{syntax:E.script,uri:E.uri}:null}}D.ArcadeModuleLoader=O;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/containerUtils":function(){define("exports ./Dictionary ./executionError ./ImmutablePathArray ./ImmutablePointArray ../chunks/languageUtils".split(" "), |
|
function(D,O,E,c,y,b){function q(d,k,w,C,M=1){k=k.toLowerCase();switch(k){case "hasz":return d=d.hasZ,void 0===d?!1:d;case "hasm":return d=d.hasM,void 0===d?!1:d;case "spatialreference":return k=d.spatialReference._arcadeCacheId,void 0===k&&(w=!0,Object.freeze&&Object.isFrozen(d.spatialReference)&&(w=!1),w&&(F++,k=d.spatialReference._arcadeCacheId=F)),d=new O({wkt:d.spatialReference.wkt,wkid:d.spatialReference.wkid}),void 0!==k&&(d._arcadeCacheId="SPREF"+k.toString()),d}switch(d.type){case "extent":switch(k){case "xmin":case "xmax":case "ymin":case "ymax":case "zmin":case "zmax":case "mmin":case "mmax":return d= |
|
d[k],void 0!==d?d:null;case "type":return"Extent"}break;case "polygon":switch(k){case "rings":return k=d.cache._arcadeCacheId,void 0===k&&(F++,k=F,d.cache._arcadeCacheId=k),new c(d.rings,d.spatialReference,!0===d.hasZ,!0===d.hasM,k);case "type":return"Polygon"}break;case "point":switch(k){case "x":case "y":case "z":case "m":return d[k]??null;case "type":return"Point"}break;case "polyline":switch(k){case "paths":return k=d.cache._arcadeCacheId,void 0===k&&(F++,k=F,d.cache._arcadeCacheId=k),new c(d.paths, |
|
d.spatialReference,!0===d.hasZ,!0===d.hasM,k);case "type":return"Polyline"}break;case "multipoint":switch(k){case "points":return k=d.cache._arcadeCacheId,void 0===k&&(F++,k=F,d.cache._arcadeCacheId=k),new y(d.points,d.spatialReference,!0===d.hasZ,!0===d.hasM,k,1);case "type":return"Multipoint"}}if(1===M)throw new E.ArcadeExecutionError(w,E.ExecutionErrorCodes.InvalidIdentifier,C);return 2===M?{keystate:"notfound"}:null}let F=0;D.geometryMember=q;D.getNestedOptionalValue=function(d,k){if(null==d)return null; |
|
if(!b.isArray(k))if(b.isImmutableArray(k))k=k.toArray();else if(null!=k)k=[k];else return null;for(const w of k){if(b.isFeature(d)){if(!1===b.isString(w)||!d.hasField(w))return null;d=d.field(w)}else if(b.isDictionary(d)){if(!1===b.isString(w)||!d.hasField(w))return null;d=d.field(w)}else if(b.isGeometry(d)){if(!1===b.isString(w))return null;d=q(d,w,null,null,0)}else if(b.isArray(d)){if(!1===b.isNumber(w))return null;d=0<=w?d[w]:d[d.length+w]}else if(b.isImmutableArray(d)){if(!1===b.isNumber(w))return null; |
|
d=0<=w?d.get(w):d.get(d.length()+w)}else return null;if(null==d)return null}return d};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/Dictionary":function(){define("./ArcadeDate ./deepClone ./executionError ./ImmutableArray ../chunks/languageUtils ../geometry/Geometry".split(" "),function(D,O,E,c,y,b){function q(d,k,w=!1,C=!1){if(null===d||void 0===d)return null;if(y.isNumber(d))return y.toNumber(d);if(y.isBoolean(d))return y.toBoolean(d);if(y.isString(d))return y.toString(d); |
|
if(y.isDate(d))return y.toDate(d,k);if(y.isDateOnly(d)||y.isTime(d))return d;if(y.isArray(d)){var M=[];for(var A of d)M.push(q(A,k,w,C));return M}if(C&&y.isGeometry(d))return d;A=new F;A.immutable=!1;for(M of Object.keys(d)){const f=d[M];void 0!==f&&A.setField(M,q(f,k,w,C))}A.immutable=w;return A}class F{constructor(d){this.declaredClass="esri.arcade.Dictionary";this.attributes=null;this.plain=!1;this.immutable=!0;this.attributes=d instanceof F?d.attributes:void 0===d?{}:null===d?{}:d}field(d){const k= |
|
d.toLowerCase(),w=this.attributes[d];if(void 0!==w)return w;for(const C in this.attributes)if(C.toLowerCase()===k)return this.attributes[C];throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.FieldNotFound,null,{key:d});}setField(d,k){if(this.immutable)throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.Immutable,null);if(y.isFunctionParameter(k))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.NoFunctionInDictionary,null);const w=d.toLowerCase();k instanceof Date&&(k=D.ArcadeDate.dateJSToArcadeDate(k)); |
|
if(void 0===this.attributes[d])for(const C in this.attributes)if(C.toLowerCase()===w){this.attributes[C]=k;return}this.attributes[d]=k}hasField(d){const k=d.toLowerCase();if(void 0!==this.attributes[d])return!0;for(const w in this.attributes)if(w.toLowerCase()===k)return!0;return!1}keys(){let d=[];for(const k in this.attributes)d.push(k);return d=d.sort()}castToText(d=!1){let k="";for(const w in this.attributes){""!==k&&(k+=",");const C=this.attributes[w];null==C?k+=JSON.stringify(w)+":null":y.isBoolean(C)|| |
|
y.isNumber(C)||y.isString(C)?k+=JSON.stringify(w)+":"+JSON.stringify(C):C instanceof b?k+=JSON.stringify(w)+":"+y.toStringExplicit(C):C instanceof c?k+=JSON.stringify(w)+":"+y.toStringExplicit(C,null,d):Array.isArray(C)?k+=JSON.stringify(w)+":"+y.toStringExplicit(C,null,d):C instanceof D.ArcadeDate?k=d?k+(JSON.stringify(w)+":"+JSON.stringify(C.getTime())):k+(JSON.stringify(w)+":"+C.stringify()):null!==C&&"object"===typeof C&&void 0!==C.castToText&&(k+=JSON.stringify(w)+":"+C.castToText(d))}return"{"+ |
|
k+"}"}static convertObjectToArcadeDictionary(d,k,w=!0,C=!1){const M=new F;M.immutable=!1;for(const A in d){const f=d[A];void 0!==f&&M.setField(A.toString(),q(f,k,w,C))}M.immutable=w;return M}static convertJsonToArcade(d,k,w=!1,C=!1){return q(d,k,w,C)}castAsJson(d=null){const k={};for(let w in this.attributes){const C=this.attributes[w];void 0!==C&&(d?.keyTranslate&&(w=d.keyTranslate(w)),k[w]=y.castAsJson(C,d))}return k}async castDictionaryValueAsJsonAsync(d,k,w,C=null,M){w=await y.castAsJsonAsync(w, |
|
C,M);return d[k]=w}async castAsJsonAsync(d=null,k=null){const w={},C=[];for(let M in this.attributes){const A=this.attributes[M];k?.keyTranslate&&(M=k.keyTranslate(M));void 0!==A&&(y.isSimpleType(A)||A instanceof b||A instanceof D.ArcadeDate?w[M]=y.castAsJson(A,k):C.push(this.castDictionaryValueAsJsonAsync(w,M,A,d,k)))}0<C.length&&await Promise.all(C);return w}deepClone(){const d=new F;d.immutable=!1;for(const k of this.keys())d.setField(k,O.deepClone(this.field(k)));return d}}return F})},"esri/arcade/ArcadeDate":function(){define(["exports", |
|
"../core/string","../core/sql/UnknownTimeZone","../chunks/datetime"],function(D,O,E,c){function y(k,w,C){return k<w?k-w:k>C?k-C:0}function b(k,w=!0){if(k instanceof c.Zone)return k;if("system"===k.toLowerCase())return"system";if("utc"===k.toLowerCase())return"UTC";if("unknown"===k.toLowerCase())return E.UnknownTimeZone.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(k)){const C=c.FixedOffsetZone.parseSpecifier("UTC"+(k.startsWith("+")||k.startsWith("-")?"":"+")+k);if(C)return C}k=c.IANAZone.create(k); |
|
if(!k.isValid){if(w)throw new F(D.ArcadeDateErrorCodes.TimeZoneNotRecognized);return null}return k}D.ArcadeDateErrorCodes=void 0;(D.ArcadeDateErrorCodes||(D.ArcadeDateErrorCodes={})).TimeZoneNotRecognized="TimeZoneNotRecognized";const q={[D.ArcadeDateErrorCodes.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class F extends Error{constructor(k,w){super(O.replace(q[k],w));this.declaredRootClass="esri.arcade.arcadedate.dateerror";Error.captureStackTrace&&Error.captureStackTrace(this, |
|
F)}}class d{constructor(k){this._date=k;this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(k=0,w=1,C=1,M=0,A=0,f=0,m=0,r){if(isNaN(k)||isNaN(w)||isNaN(C)||isNaN(M)||isNaN(A)||isNaN(f)||isNaN(m))return null;const n=c.DateTime.local(k,w).daysInMonth;k=c.DateTime.fromObject({day:1>C?1:C>n?n:C,year:k,month:1>w?1:12<w?12:w,hour:0>M?0:23<M?23:M,minute:0>A?0:59<A?59:A,second:0>f?0:59<f?59:f,millisecond:0>m?0:999<m?999:m},{zone:b(r)});k=k.plus({months:y(w,1,12),days:y(C,1,n),hours:y(M,0,23), |
|
minutes:y(A,0,59),seconds:y(f,0,59),milliseconds:y(m,0,999)});return new d(k)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(k,w){w=b(w);return k.isUnknownTimeZone||w===E.UnknownTimeZone.instance?d.fromParts(k.year,k.monthJS+1,k.day,k.hour,k.minute,k.second,k.millisecond,w):new d(k._date.setZone(w))}static dateJSToArcadeDate(k){return new d(c.DateTime.fromJSDate(k,{zone:"system"}))}static dateJSAndZoneToArcadeDate(k, |
|
w="system"){w=b(w);return new d(c.DateTime.fromJSDate(k,{zone:w}))}static unknownEpochToArcadeDate(k){return new d(c.DateTime.fromMillis(k,{zone:E.UnknownTimeZone.instance}))}static unknownDateJSToArcadeDate(k){return new d(c.DateTime.fromMillis(k.getTime(),{zone:E.UnknownTimeZone.instance}))}static epochToArcadeDate(k,w="system"){w=b(w);return new d(c.DateTime.fromMillis(k,{zone:w}))}static dateTimeToArcadeDate(k){return new d(k)}clone(){return new d(this._date)}changeTimeZone(k){k=b(k);return d.dateTimeToArcadeDate(this._date.setZone(k))}static dateTimeAndZoneToArcadeDate(k, |
|
w){w=b(w);return k.zone===E.UnknownTimeZone.instance||w===E.UnknownTimeZone.instance?d.fromParts(k.year,k.month,k.day,k.hour,k.minute,k.second,k.millisecond,w):new d(k.setZone(w))}static nowToArcadeDate(k){k=b(k);return new d(c.DateTime.fromJSDate(new Date,{zone:k}))}static nowUTCToArcadeDate(){return new d(c.DateTime.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===d.systemTimeZoneCanonicalName}equals(k){return this.isSystem&&k.isSystem?this.toNumber()===k.toNumber():this.isUnknownTimeZone!== |
|
k.isUnknownTimeZone?!1:this._date.equals(k._date)}get isUnknownTimeZone(){return this._date.zone===E.UnknownTimeZone.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let k=this._date.weekday;6<k&&(k=0);return k}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month- |
|
1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";const k=this.zone;return"fixed"===k.type?0===k.fixed?"UTC":k.formatOffset(0,"short"):k.name}stringify(){return JSON.stringify(this.toJSDate())}plus(k){return new d(this._date.plus(k))}diff(k,w="milliseconds"){return this._date.diff(k._date, |
|
w)[w]}toISODate(){return this._date.toISODate()}toISOString(k){return k?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(k,w){return this._date.toISOTime({suppressMilliseconds:k,includeOffset:w&&!this.isUnknownTimeZone})}toFormat(k,w){this.isUnknownTimeZone&&(k=k.replaceAll("Z",""));return this._date.toFormat(k,w)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new d(this._date.toUTC())}toLocal(){return new d(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(k){if(!k)return null; |
|
k=c.DateTime.fromISO(k,{setZone:!0});return new d(k)}}D.ArcadeDate=d;D.ArcadeDateError=F;D.arcadeDateErrorMessages=q;D.createDateTimeZone=b;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/deepClone":function(){define(["exports","./ArcadeModule","../chunks/languageUtils"],function(D,O,E){function c(b){if(null===b)return null;if(E.isDate(b))return b.clone();if(E.isSimpleType(b))return b;if(E.isGeometry(b))return b.clone();if(E.isImmutableArray(b))return b.toArray().map(q=> |
|
c(q));if(E.isArray(b))return b.map(q=>c(q));if(E.isFeature(b))return y.createFromArcadeFeature(b);if(E.isFeatureSetCollection(b)||E.isFeatureSet(b))return b;if(E.isDictionary(b)||"esri.arcade.Attachment"===b?.declaredClass)return b.deepClone();if("esri.arcade.Portal"===b?.declaredClass||E.isKnowledgeGraph(b)||b instanceof O.ArcadeModule)return b;E.isFunctionParameter(b);return b}let y;D.configureDeepClone=function(b){y=b};D.deepClone=c;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})}, |
|
"esri/chunks/languageUtils":function(){define("exports ../config ../kernel ../arcade/ArcadeDate ../arcade/ArcadeModule ../arcade/executionError ../arcade/FunctionWrapper ../arcade/ImmutableArray ../arcade/ImmutablePathArray ../arcade/ImmutablePointArray ../arcade/featureset/support/shared ../core/number ../core/sql/DateOnly ../core/sql/TimeOnly ../geometry/Extent ../geometry/Geometry ../geometry/Multipoint ../geometry/Point ../geometry/Polygon ../geometry/Polyline ../geometry/SpatialReference ../geometry/support/coordsUtils ../geometry/support/jsonUtils ../intl/locale ./datetime".split(" "), |
|
function(D,O,E,c,y,b,q,F,d,k,w,C,M,A,f,m,r,n,g,l,z,G,a,B,x){function N(v,K,T){return""===K||null===K||void 0===K||K===T||K===T?v:v=v.split(K).join(T)}function e(v){return v instanceof q.ArcadeFunction}function Z(v){return v instanceof y.ArcadeModule}function t(v){return U(v)||W(v)||S(v)||V(v)||ha(v)||X(v)||null===v||v===za||"number"===typeof v?!0:!1}function H(v,K){return void 0===v?K:v}function R(v){return null==v?"":pa(v)||P(v)?"Array":S(v)?"Date":ha(v)?"Time":V(v)?"DateOnly":U(v)?"String":X(v)? |
|
"Boolean":W(v)?"Number":"esri.arcade.Attachment"===v?.declaredClass?"Attachment":"esri.arcade.Portal"===v?.declaredClass?"Portal":"esri.arcade.Dictionary"===v?.declaredClass?"Dictionary":u(v)?"KnowledgeGraph":v instanceof y.ArcadeModule?"Module":xa(v)?"Feature":v instanceof n?"Point":v instanceof g?"Polygon":v instanceof l?"Polyline":v instanceof r?"Multipoint":v instanceof f?"Extent":e(v)?"Function":sa(v)?"FeatureSet":J(v)?"FeatureSetCollection":v===za?"":"number"===typeof v&&isNaN(v)?"Number":"Unrecognized Type"} |
|
function U(v){return"string"===typeof v||v instanceof String}function X(v){return"boolean"===typeof v}function W(v){return"number"===typeof v}function ca(v){return"number"===typeof v&&isFinite(v)&&Math.floor(v)===v}function wa(v){return v instanceof m}function pa(v){return Array.isArray(v)}function xa(v){return"esri.arcade.Feature"===v?.arcadeDeclaredClass?!0:!1}function sa(v){return"esri.arcade.featureset.support.FeatureSet"===v?.declaredRootClass}function I(v){return"esri.arcade.Dictionary"===v?.declaredClass} |
|
function J(v){return"esri.arcade.featureSetCollection"===v?.declaredRootClass}function u(v){return"esri.rest.knowledgeGraph.KnowledgeGraph"===v?.declaredClass}function P(v){return v instanceof F}function S(v){return v instanceof c.ArcadeDate}function V(v){return v instanceof M.DateOnly}function ha(v){return v instanceof A.TimeOnly}function qa(v){return null!=v&&"object"===typeof v}function ra(v){return v instanceof Date}function h(v,K,T,ea,da){if(v.length<K||v.length>T)throw new b.ArcadeExecutionError(ea, |
|
b.ExecutionErrorCodes.WrongNumberOfParameters,da);}function p(v){return 0>v?-Math.round(-v):Math.round(v)}function L(v,K){if(!isNaN(v)){if(void 0===K||null===K||""===K)return v.toString();K=N(K,"\u2030","");K=N(K,"\u00a4","");return C.format(v,{pattern:K})}return v.toString()}function Q(v,K){return void 0===K||null===K||""===K?v.toISOString(!0):v.toFormat(Y(K),{locale:B.getLocale(),numberingSystem:"latn"})}function Y(v,K=!1){v=v.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$\x26]");let T="";const ea=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g; |
|
for(const da of v.match(ea)||[])switch(da){case "D":T+="d";break;case "DD":T+="dd";break;case "DDD":T+="o";break;case "d":T+="c";break;case "ddd":T+="ccc";break;case "dddd":T+="cccc";break;case "M":T+="L";break;case "MM":T+="LL";break;case "MMM":T+="LLL";break;case "MMMM":T+="LLLL";break;case "YY":T+="yy";break;case "Y":case "YYYY":T+="yyyy";break;case "Q":T+="q";break;case "Z":T+="Z";break;case "ZZ":T+="ZZ";break;case "ZZZ":T+="ZZZ";break;case "ZZZZ":T=K?T+"[ZZZZ]":T+"ZZZZ";break;case "ZZZZZ":T= |
|
K?T+"[ZZZZZ]":T+"ZZZZZ";break;case "S":T+="'S'";break;case "SS":T+="'SS'";break;case "SSS":T+="u";break;case "A":case "a":T+="a";break;case "m":case "mm":case "h":case "hh":case "H":case "HH":case "s":case "ss":case "X":case "x":T+=da;break;default:T=2<=da.length&&"["===da.slice(0,1)&&"]"===da.slice(-1)?T+`'${da.slice(1,-1)}'`:T+`'${da}'`}return T}function aa(v,K,T){switch(T){case "\x3e":return v>K;case "\x3c":return v<K;case "\x3e\x3d":return v>=K;case "\x3c\x3d":return v<=K}return!1}function ka(v, |
|
K,T){if(null===v){if(null===K||K===za)return aa(null,null,T);if(W(K))return aa(0,K,T);if(U(K)||X(K))return aa(0,ta(K),T);if(S(K))return aa(0,K.toNumber(),T);if(ha(K)||V(K))return aa(v,K.toNumber(),T)}if(v===za){if(null===K||K===za)return aa(null,null,T);if(W(K))return aa(0,K,T);if(U(K)||X(K))return aa(0,ta(K),T);if(S(K))return aa(0,K.toNumber(),T);if(ha(K)||V(K))return aa(v,K.toNumber(),T)}else if(W(v)){if(W(K))return aa(v,K,T);if(X(K))return aa(v,ta(K),T);if(null===K||K===za)return aa(v,0,T);if(U(K))return aa(v, |
|
ta(K),T);if(S(K)||ha(K)||V(K))return aa(v,K.toNumber(),T)}else if(U(v)){if(U(K))return aa(ja(v),ja(K),T);if(S(K)||ha(K)||V(K))return aa(ta(v),K.toNumber(),T);if(W(K))return aa(ta(v),K,T);if(null===K||K===za)return aa(ta(v),0,T);if(X(K))return aa(ta(v),ta(K),T)}else if(S(v)){if(S(K))return v.timeZone!==K.timeZone&&(v.isUnknownTimeZone?v=c.ArcadeDate.arcadeDateAndZoneToArcadeDate(v,K.timeZone):K.isUnknownTimeZone&&(K=c.ArcadeDate.arcadeDateAndZoneToArcadeDate(K,v.timeZone))),aa(v.toNumber(),K.toNumber(), |
|
T);if(null===K||K===za)return aa(v.toNumber(),0,T);if(W(K))return aa(v.toNumber(),K,T);if(X(K)||U(K))return aa(v.toNumber(),ta(K),T);if(ha(K))throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.CannotCompareDateAndTime,null);if(V(K))return aa(v.toNumber(),K.toNumber(),T)}else if(X(v)){if(X(K))return aa(v,K,T);if(W(K))return aa(ta(v),ta(K),T);if(S(K)||ha(K)||V(K))return aa(ta(v),K.toNumber(),T);if(null===K||K===za)return aa(ta(v),0,T);if(U(K))return aa(ta(v),ta(K),T)}else if(V(v)){if(S(K))return aa(v.toNumber(), |
|
K.toNumber(),T);if(null===K||K===za)return aa(v.toNumber(),0,T);if(W(K))return aa(v.toNumber(),K,T);if(X(K)||U(K))return aa(v.toNumber(),ta(K),T);if(ha(K))throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.CannotCompareDateAndTime,null);if(V(K))return aa(v.toNumber(),K.toNumber(),T)}else if(ha(v)){if(S(K))throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.CannotCompareDateAndTime,null);if(null===K||K===za)return aa(v.toNumber(),0,T);if(W(K))return aa(v.toNumber(),K,T);if(X(K)||U(K))return aa(v.toNumber(), |
|
ta(K),T);if(ha(K))return aa(v.toNumber(),K.toNumber(),T);if(V(K))throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.CannotCompareDateAndTime,null);}return!fa(v,K)||"\x3c\x3d"!==T&&"\x3e\x3d"!==T?!1:!0}function fa(v,K){if(v===K||null===v&&K===za||null===K&&v===za)return!0;if(S(v)&&S(K)||ha(v)&&ha(K)||V(v)&&V(K))return v.equals(K);if(v instanceof d||v instanceof k)return v.equalityTest(K);if(v instanceof n&&K instanceof n){const T=v.cache._arcadeCacheId,ea=K.cache._arcadeCacheId;if(void 0!== |
|
T&&null!==T)return T===ea}return qa(v)&&qa(K)&&(v._arcadeCacheId===K._arcadeCacheId&&void 0!==v._arcadeCacheId&&null!==v._arcadeCacheId||v._underlyingGraphic===K._underlyingGraphic&&void 0!==v._underlyingGraphic&&null!==v._underlyingGraphic)?!0:!1}function ja(v,K){if(U(v))return v;if(null===v)return"";if(W(v))return L(v,K);if(X(v))return v.toString();if(S(v))return Q(v,K);if(ha(v)||V(v))return v.toFormat(K);if(v instanceof m)return JSON.stringify(v.toJSON());if(pa(v)){K=[];for(var T=0;T<v.length;T++)K[T]= |
|
ya(v[T]);return"["+K.join(",")+"]"}if(v instanceof F){K=[];for(T=0;T<v.length();T++)K[T]=ya(v.get(T));return"["+K.join(",")+"]"}return null!==v&&"object"===typeof v&&void 0!==v.castToText?v.castToText():e(v)?"object, Function":v===za?"":Z(v)?"object, Module":""}function ia(v){const K=[];if(!pa(v))return null;if(v instanceof F){for(var T=0;T<v.length();T++)K[T]=ta(v.get(T));return K}for(T=0;T<v.length;T++)K[T]=ta(v[T]);return K}function ma(v,K,T=!1){if(U(v))return v;if(null===v)return"";if(W(v))return L(v, |
|
K);if(X(v))return v.toString();if(S(v))return Q(v,K);if(ha(v)||V(v))return v.toFormat(K);if(v instanceof m)return v instanceof f?'{"xmin":'+v.xmin.toString()+',"ymin":'+v.ymin.toString()+","+(v.hasZ?'"zmin":'+v.zmin.toString()+",":"")+(v.hasM?'"mmin":'+v.mmin.toString()+",":"")+'"xmax":'+v.xmax.toString()+',"ymax":'+v.ymax.toString()+","+(v.hasZ?'"zmax":'+v.zmax.toString()+",":"")+(v.hasM?'"mmax":'+v.mmax.toString()+",":"")+'"spatialReference":'+la(v.spatialReference)+"}":la(v.toJSON(),(da,na)=>da.key=== |
|
na.key?0:"spatialReference"===da.key?1:"spatialReference"===na.key||da.key<na.key?-1:da.key>na.key?1:0);if(pa(v)){K=[];for(var ea=0;ea<v.length;ea++)K[ea]=ya(v[ea],T);return"["+K.join(",")+"]"}if(v instanceof F){K=[];for(ea=0;ea<v.length();ea++)K[ea]=ya(v.get(ea),T);return"["+K.join(",")+"]"}return null!==v&&"object"===typeof v&&void 0!==v.castToText?v.castToText(T):e(v)?"object, Function":v===za?"":Z(v)?"object, Module":""}function ya(v,K=!1){return null===v?"null":X(v)||W(v)||U(v)?JSON.stringify(v): |
|
v instanceof m||v instanceof F||Array.isArray(v)?ma(v,null,K):S(v)?K?JSON.stringify(v.getTime()):JSON.stringify(Q(v,"")):ha(v)||V(v)?JSON.stringify(v.toString()):null!==v&&"object"===typeof v&&void 0!==v.castToText?v.castToText(K):"null"}function ta(v,K){return W(v)?v:null===v||""===v?0:S(v)||V(v)||ha(v)?NaN:X(v)?v?1:0:pa(v)||""===v||void 0===v?NaN:void 0!==K&&U(v)?(K=N(K,"\u2030",""),K=N(K,"\u00a4",""),C.parse(v,{pattern:K})):v===za?0:Number(v)}function La(v,K){if(S(v))return v;if(U(v)){a:{const ea= |
|
/ (\d\d)/;var T=c.createDateTimeZone(K);T=x.DateTime.fromISO(v,{zone:T});if(T.isValid)K=T;else{if(ea.test(v)&&(v=v.replace(ea,"T$1"),T=x.DateTime.fromISO(v,{zone:K}),T.isValid)){K=T;break a}K=null}}if(K)return c.ArcadeDate.dateTimeToArcadeDate(K)}return null}function Ga(v){return X(v)?v:U(v)?(v=v.toLowerCase(),"true"===v?!0:!1):W(v)?0===v||isNaN(v)?!1:!0:!1}function Ia(v,K){(v=JSON.parse(v))&&!v.spatialReference&&(v.spatialReference=K);return a.fromJSON(v)}function Ha(v,K){if(null==v)return null; |
|
if(null===v.spatialReference||void 0===v.spatialReference)v.spatialReference=K;return v}function Ba(v){if(null===v)return null;if(v instanceof n)return"NaN"===v.x||null===v.x||isNaN(v.x)?null:v;if(v instanceof g){if(0===v.rings.length)return null;for(const K of v.rings)if(0<K.length)return v;return null}if(v instanceof l){if(0===v.paths.length)return null;for(const K of v.paths)if(0<K.length)return v;return null}return v instanceof r?0===v.points.length?null:v:v instanceof f?"NaN"===v.xmin||null=== |
|
v.xmin||isNaN(v.xmin)?null:v:null}function ba(v,K){if(!v||!v.domain)return K;let T=null,ea=null;if(S(K))T=K.toNumber();else if(V(K))T=K.toString();else if(ha(K))T=K.toStorageString();else if("string"===v.field.type||"esriFieldTypeString"===v.field.type)T=ja(K);else{if(null===K||void 0===K)return null;if(""===K)return K;T=ta(K)}for(let da=0;da<v.domain.codedValues.length;da++){const na=v.domain.codedValues[da];na.code===T&&(ea=na)}return null===ea?ja(K):ea.name}function oa(v,K){if(!v||!v.domain)return K; |
|
let T=null;const ea=ja(K);for(let da=0;da<v.domain.codedValues.length;da++){const na=v.domain.codedValues[da];na.name===ea&&(T=na)}return null===T?K:T.code}function va(v,K,T=null,ea=null){if(!K||!K.fields)return null;let da=null;for(var na=0;na<K.fields.length;na++){var ua=K.fields[na];ua.name.toLowerCase()===v.toString().toLowerCase()&&(da=ua)}if(null===da)throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.FieldNotFound,null,{key:v});let Fa,Ca;na=K.typeIdField;let Ea="id";ua=K.types;K.subtypeField&& |
|
(na=K.subtypeField,Ea="code",ua=K.subtypes??[]);if(null===ea&&T&&na)ea=T.hasField(na)?T.field(na):null;else if(na&&null!==ea){let Ja=!1;for(const Ma of ua||[])if(ea===Ma[Ea]){Ja=!0;break}if(!Ja)for(const Ma of ua||[])if(ea===Ma.name){ea=Ma[Ea];Ja=!0;break}Ja||(ea=null,T&&na&&(ea=T.hasField(na)?T.field(na):null))}null!==ea&&void 0!==ea&&ua.some(Ja=>Ja[Ea]===ea?((Fa=Ja.domains?.[da.name])&&"inherited"===Fa.type&&(Fa=Ka(da.name,K),Ca=!0),!0):!1);Ca||Fa||(Fa=Ka(v,K));return{field:da,domain:Fa}}function Ka(v, |
|
K){let T;K.fields.some(ea=>{ea.name.toLowerCase()===v.toLowerCase()&&(T=ea.domain);return!!T});return T}function la(v,K){K||={};"function"===typeof K&&(K={cmp:K});const T="boolean"===typeof K.cycles?K.cycles:!1,ea=K.cmp&&function(na){return function(ua){return function(Fa,Ca){return na({key:Fa,value:ua[Fa]},{key:Ca,value:ua[Ca]})}}}(K.cmp),da=[];return function Fa(ua){ua?.toJSON&&"function"===typeof ua.toJSON&&(ua=ua.toJSON());if(void 0!==ua){if("number"===typeof ua)return isFinite(ua)?""+ua:"null"; |
|
if("object"!==typeof ua)return JSON.stringify(ua);var Ca;if(Array.isArray(ua)){var Ea="[";for(Ca=0;Ca<ua.length;Ca++)Ca&&(Ea+=","),Ea+=Fa(ua[Ca])||"null";return Ea+"]"}if(null===ua)return"null";if(da.includes(ua)){if(T)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON");}var Ja=da.push(ua)-1,Ma=Object.keys(ua).sort(ea?.(ua));Ea="";for(Ca=0;Ca<Ma.length;Ca++){const Ua=Ma[Ca],Va=Fa(ua[Ua]);Va&&(Ea&&(Ea+=","),Ea+=JSON.stringify(Ua)+":"+Va)}da.splice(Ja,1); |
|
return"{"+Ea+"}"}}(v)}function Da(v){if(null===v)return null;const K=[];for(const T of v)T?.arcadeDeclaredClass&&"esri.arcade.Feature"===T.arcadeDeclaredClass?K.push(T.geometry()):K.push(T);return K}function Aa(v,K){if(K instanceof n)v.push(K.hasZ?K.hasM?[K.x,K.y,K.z,K.m]:[K.x,K.y,K.z]:[K.x,K.y]);else throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.InvalidParameter,null);}function Wa(v,K){if(pa(v)||P(v)){let T=!1,ea=!1,da=[];if(pa(v)){for(const na of v)Aa(da,na);0<da.length&&(K=v[0].spatialReference, |
|
T=v[0].hasZ,ea=v[0].hasM)}else if(v instanceof k)da=v._elements,0<da.length&&(T=v._hasZ,ea=v._hasM,K=v.get(0).spatialReference);else if(P(v)){for(const na of v.toArray())Aa(da,na);0<da.length&&(K=v.get(0).spatialReference,T=!0===v.get(0).hasZ,ea=!0===v.get(0).hasM)}else throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.InvalidParameter,null);if(0===da.length)return null;G.isClockwise(da)||(da=da.slice(0).reverse());return new g({rings:[da],spatialReference:K,hasZ:T,hasM:ea})}return v}function Xa(v, |
|
K){if(pa(v)||P(v)){let T=!1,ea=!1,da=[];if(pa(v)){for(const na of v)Aa(da,na);0<da.length&&(K=v[0].spatialReference,T=!0===v[0].hasZ,ea=!0===v[0].hasM)}else if(v instanceof k)da=v._elements,0<da.length&&(T=v._hasZ,ea=v._hasM,K=v.get(0).spatialReference);else if(P(v)){for(const na of v.toArray())Aa(da,na);0<da.length&&(K=v.get(0).spatialReference,T=!0===v.get(0).hasZ,ea=!0===v.get(0).hasM)}return 0===da.length?null:new l({paths:[da],spatialReference:K,hasZ:T,hasM:ea})}return v}function Ya(v,K){if(pa(v)|| |
|
P(v)){let T=!1,ea=!1,da=[];if(pa(v)){for(const na of v)Aa(da,na);0<da.length&&(K=v[0].spatialReference,T=!0===v[0].hasZ,ea=!0===v[0].hasM)}else if(v instanceof k)da=v._elements,0<da.length&&(T=v._hasZ,ea=v._hasM,K=v.get(0).spatialReference);else if(P(v)){for(const na of v.toArray())Aa(da,na);0<da.length&&(K=v.get(0).spatialReference,T=!0===v.get(0).hasZ,ea=!0===v.get(0).hasM)}return 0===da.length?null:new r({points:da,spatialReference:K,hasZ:T,hasM:ea})}return v}function Za(v,K=!1){const T=[];if(null=== |
|
v)return T;if(!0===pa(v)){for(var ea=0;ea<v.length;ea++){var da=ja(v[ea]);""===da&&!0!==K||T.push(da)}return T}if(v instanceof F){for(ea=0;ea<v.length();ea++)da=ja(v.get(ea)),""===da&&!0!==K||T.push(da);return T}return t(v)?(v=ja(v),""===v&&!0!==K||T.push(v),T):[]}function $a(v){Pa++;return 0===Pa%100?(Pa=0,new Promise(K=>{setTimeout(()=>{K(v)},0)})):v}function ab(v,K,T){switch(T){case "\x26":return v&K;case "|":return v|K;case "^":return v^K;case "\x3c\x3c":return v<<K;case "\x3e\x3e":return v>> |
|
K;case "\x3e\x3e\x3e":return v>>>K}}function Na(v,K=null){if(null!=v){if(X(v)||W(v)||U(v))return v;if(v instanceof m)return!0===K?.keepGeometryType?v:v.toJSON();if(v instanceof F)return v.toArray().map(T=>Na(T,K));if(Array.isArray(v))return v.map(T=>Na(T,K));if(ra(v))return v;if(S(v))return v.toJSDate();if(ha(v))return v.toString();if(V(v))return v.toJSDate();if(null!==v&&"object"===typeof v&&void 0!==v.castAsJson)return v.castAsJson(K)}return null}async function nb(v,K,T,ea,da){v=await Qa(v,K,T); |
|
da[ea]=v}async function Qa(v,K=null,T=null){v instanceof F&&(v=v.toArray());if(null!=v){if(t(v)||v instanceof m||ra(v)||S(v))return Na(v,T);if(Array.isArray(v)){const ea=[],da=[];for(const na of v)null===na||t(na)||na instanceof m||ra(na)||S(na)?da.push(Na(na,T)):(da.push(null),ea.push(nb(na,K,T,da.length-1,da)));0<ea.length&&await Promise.all(ea);return da}if(null!==v&&"object"===typeof v&&void 0!==v.castAsJsonAsync)return v.castAsJsonAsync(K,T)}return null}function Oa(v){return Ra(v)?v.parent:v} |
|
function Ra(v){return v&&"declaredClass"in v&&"esri.layers.support.SubtypeSublayer"===v.declaredClass}function bb(v){return v&&"declaredClass"in v&&"esri.layers.SubtypeGroupLayer"===v.declaredClass}function cb(v,K,T){const ea=Oa(v.fullSchema());return null!==ea&&ea.fields?va(K,ea,v,T):null}function db(v){v=Oa(v.fullSchema());return null!==v&&v.fields?v.subtypeField?{subtypeField:v.subtypeField,subtypes:v.subtypes?v.subtypes.map(K=>({name:K.name,code:K.code})):[]}:v.typeIdField?{subtypeField:v.typeIdField, |
|
subtypes:v.types?v.types.map(K=>({name:K.name,code:K.id})):[]}:null:null}function eb(v,K,T,ea){const da=Oa(v.fullSchema());if(null===da||!da.fields)return null;ea=va(K,da,v,ea);if(void 0===T)try{T=v.field(K)}catch(na){return null}return ba(ea,T)}function fb(v,K,T,ea){const da=Oa(v.fullSchema());if(null===da||!da.fields)return null;if(void 0===T){try{T=v.field(K)}catch(na){return null}return T}v=va(K,da,v,ea);return oa(v,T)}function gb(v){return v?.timeZone??"system"}function hb(v){v=Oa(v.fullSchema()); |
|
if(null===v||!v.fields)return null;const K=[];for(const T of v.fields)K.push(w.esriFieldToJson(T));return{objectIdField:v.objectIdField,globalIdField:v.globalIdField??"",geometryType:void 0===w.layerGeometryEsriRestConstants[v.geometryType]?"":w.layerGeometryEsriRestConstants[v.geometryType],fields:K}}function ib(v,K){"system"===v&&(v=c.ArcadeDate.systemTimeZoneCanonicalName);return{version:"1.24",engineVersion:E.version,timeZone:v,spatialReference:K instanceof z?K.toJSON():K,application:O.applicationName?? |
|
"",engine:"web",locale:B.getLocale()}}class Sa{constructor(v){this.value=v}}class Ta{constructor(v){this.value=v}}const jb=Ta,kb=Sa,za={type:"VOID"},lb={type:"BREAK"},mb={type:"CONTINUE"};let Pa=0;const ob=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResultE:Ta,ReturnResultE:Sa,absRound:p,arcadeVersion:"1.24",autoCastArrayOfPointsToMultiPoint:Ya,autoCastArrayOfPointsToPolygon:Wa,autoCastArrayOfPointsToPolyline:Xa,autoCastFeatureToGeometry:Da,binaryOperator:ab,breakResult:lb,castAsJson:Na, |
|
castAsJsonAsync:Qa,continueResult:mb,defaultExecutingContext:ib,defaultTimeZone:gb,defaultUndefined:H,equalityTest:fa,featureDomainCodeLookup:fb,featureDomainValueLookup:eb,featureFullDomain:cb,featureSchema:hb,featureSubtypes:db,fixNullGeometry:Ba,fixSpatialReference:Ha,formatDate:Q,formatNumber:L,getDomain:va,getDomainCode:oa,getDomainValue:ba,getType:R,greaterThanLessThan:ka,implicitResult:jb,isArray:pa,isBoolean:X,isDate:S,isDateOnly:V,isDictionary:I,isFeature:xa,isFeatureSet:sa,isFeatureSetCollection:J, |
|
isFunctionParameter:e,isGeometry:wa,isImmutableArray:P,isInteger:ca,isJsDate:ra,isKnowledgeGraph:u,isModule:Z,isNumber:W,isObject:qa,isSimpleType:t,isString:U,isSubtypeGrouplayer:bb,isSubtypeSublayer:Ra,isTime:ha,multiReplace:N,parseGeometryFromJson:Ia,pcCheck:h,returnResult:kb,stableStringify:la,standardiseDateFormat:Y,tick:$a,toBoolean:Ga,toDate:La,toNumber:ta,toNumberArray:ia,toString:ja,toStringArray:Za,toStringExplicit:ma,voidOperation:za},Symbol.toStringTag,{value:"Module"}));D.ImplicitResultE= |
|
Ta;D.ReturnResultE=Sa;D.absRound=p;D.arcadeVersion="1.24";D.autoCastArrayOfPointsToMultiPoint=Ya;D.autoCastArrayOfPointsToPolygon=Wa;D.autoCastArrayOfPointsToPolyline=Xa;D.autoCastFeatureToGeometry=Da;D.binaryOperator=ab;D.breakResult=lb;D.castAsJson=Na;D.castAsJsonAsync=Qa;D.continueResult=mb;D.defaultExecutingContext=ib;D.defaultTimeZone=gb;D.defaultUndefined=H;D.equalityTest=fa;D.featureDomainCodeLookup=fb;D.featureDomainValueLookup=eb;D.featureFullDomain=cb;D.featureSchema=hb;D.featureSubtypes= |
|
db;D.fixNullGeometry=Ba;D.fixSpatialReference=Ha;D.formatDate=Q;D.formatNumber=L;D.getDomain=va;D.getDomainCode=oa;D.getDomainValue=ba;D.getType=R;D.greaterThanLessThan=ka;D.implicitResult=jb;D.isArray=pa;D.isBoolean=X;D.isDate=S;D.isDateOnly=V;D.isDictionary=I;D.isFeature=xa;D.isFeatureSet=sa;D.isFeatureSetCollection=J;D.isFunctionParameter=e;D.isGeometry=wa;D.isImmutableArray=P;D.isInteger=ca;D.isJsDate=ra;D.isKnowledgeGraph=u;D.isModule=Z;D.isNumber=W;D.isObject=qa;D.isSimpleType=t;D.isString= |
|
U;D.isSubtypeGrouplayer=bb;D.isSubtypeSublayer=Ra;D.isTime=ha;D.lc=ob;D.multiReplace=N;D.parseGeometryFromJson=Ia;D.pcCheck=h;D.returnResult=kb;D.stableStringify=la;D.standardiseDateFormat=Y;D.tick=$a;D.toBoolean=Ga;D.toDate=La;D.toNumber=ta;D.toNumberArray=ia;D.toString=ja;D.toStringArray=Za;D.toStringExplicit=ma;D.voidOperation=za})},"esri/arcade/executionError":function(){define(["exports","../core/string"],function(D,O){function E(C){return C&&C.loc?`Line : ${C.loc.start?.line}, ${C.loc.start?.column}: `: |
|
""}D.ExecutionErrorCodes=void 0;(function(C){C.AsyncNotEnabled="AsyncNotEnabled";C.ModulesNotSupported="ModulesNotSupported";C.CircularModules="CircularModules";C.CannotCompareDateAndTime="CannotCompareDateAndTime";C.NeverReach="NeverReach";C.UnsupportedHashType="UnsupportedHashType";C.InvalidParameter="InvalidParameter";C.FeatureSetDoesNotHaveSubtypes="FeatureSetDoesNotHaveSubtypes";C.UnexpectedToken="UnexpectedToken";C.Unrecognized="Unrecognized";C.UnrecognizedType="UnrecognizedType";C.MaximumCallDepth= |
|
"MaximumCallDepth";C.BooleanConditionRequired="BooleanConditionRequired";C.TypeNotAllowedInFeature="TypeNotAllowedInFeature";C.KeyMustBeString="KeyMustBeString";C.WrongNumberOfParameters="WrongNumberOfParameters";C.CallNonFunction="CallNonFunction";C.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral";C.NoFunctionInDictionary="NoFunctionInDictionary";C.NoFunctionInArray="NoFunctionInArray";C.AssignModuleFunction="AssignModuleFunction";C.LogicExpressionOrAnd="LogicExpressionOrAnd";C.LogicalExpressionOnlyBoolean= |
|
"LogicalExpressionOnlyBoolean";C.FunctionNotFound="FunctionNotFound";C.InvalidMemberAccessKey="InvalidMemberAccessKey";C.UnsupportedUnaryOperator="UnsupportUnaryOperator";C.InvalidIdentifier="InvalidIdentifier";C.MemberOfNull="MemberOfNull";C.UnsupportedOperator="UnsupportedOperator";C.Cancelled="Cancelled";C.ModuleAccessorMustBeString="ModuleAccessorMustBeString";C.ModuleExportNotFound="ModuleExportNotFound";C.Immutable="Immutable";C.OutOfBounds="OutOfBounds";C.IllegalResult="IllegalResult";C.FieldNotFound= |
|
"FieldNotFound";C.PortalRequired="PortalRequired";C.LogicError="LogicError";C.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber";C.KeyAccessorMustBeString="KeyAccessorMustBeString";C.WrongSpatialReference="WrongSpatialReference";C.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime";C.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"})(D.ExecutionErrorCodes||(D.ExecutionErrorCodes={}));const c={[D.ExecutionErrorCodes.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.", |
|
[D.ExecutionErrorCodes.LogicError]:"Logic error - {reason}",[D.ExecutionErrorCodes.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[D.ExecutionErrorCodes.NeverReach]:"Encountered unreachable logic",[D.ExecutionErrorCodes.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[D.ExecutionErrorCodes.ModuleAccessorMustBeString]:"Module accessor must be a string",[D.ExecutionErrorCodes.ModuleExportNotFound]:"Module has no export with provided identifier",[D.ExecutionErrorCodes.ModulesNotSupported]:"Current profile does not support modules", |
|
[D.ExecutionErrorCodes.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[D.ExecutionErrorCodes.FunctionNotFound]:"Function not found",[D.ExecutionErrorCodes.FieldNotFound]:"Key not found - {key}",[D.ExecutionErrorCodes.CircularModules]:"Circular module dependencies are not allowed",[D.ExecutionErrorCodes.Cancelled]:"Execution cancelled",[D.ExecutionErrorCodes.UnsupportedHashType]:"Type not supported in hash function",[D.ExecutionErrorCodes.IllegalResult]:"Value is not a supported return type", |
|
[D.ExecutionErrorCodes.PortalRequired]:"Portal is required",[D.ExecutionErrorCodes.InvalidParameter]:"Invalid parameter",[D.ExecutionErrorCodes.WrongNumberOfParameters]:"Call with wrong number of parameters",[D.ExecutionErrorCodes.Unrecognized]:"Unrecognized code structure",[D.ExecutionErrorCodes.UnrecognizedType]:"Unrecognized type",[D.ExecutionErrorCodes.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[D.ExecutionErrorCodes.BooleanConditionRequired]:"Conditions must use booleans", |
|
[D.ExecutionErrorCodes.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[D.ExecutionErrorCodes.NoFunctionInArray]:"Arrays cannot contain functions.",[D.ExecutionErrorCodes.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[D.ExecutionErrorCodes.KeyAccessorMustBeString]:"Accessor must be a string",[D.ExecutionErrorCodes.KeyMustBeString]:"Object keys must be a string",[D.ExecutionErrorCodes.Immutable]:"Object is immutable",[D.ExecutionErrorCodes.UnexpectedToken]:"Unexpected token", |
|
[D.ExecutionErrorCodes.MemberOfNull]:"Cannot access property of null object",[D.ExecutionErrorCodes.MaximumCallDepth]:"Exceeded maximum function depth",[D.ExecutionErrorCodes.OutOfBounds]:"Out of bounds",[D.ExecutionErrorCodes.InvalidIdentifier]:"Identifier not recognized",[D.ExecutionErrorCodes.CallNonFunction]:"Expression is not a function",[D.ExecutionErrorCodes.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[D.ExecutionErrorCodes.AssignModuleFunction]:"Cannot assign function to module variable", |
|
[D.ExecutionErrorCodes.UnsupportedUnaryOperator]:"Unsupported unary operator",[D.ExecutionErrorCodes.UnsupportedOperator]:"Unsupported operator",[D.ExecutionErrorCodes.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[D.ExecutionErrorCodes.LogicExpressionOrAnd]:"Logical expression can only be combined with || or \x26\x26",[D.ExecutionErrorCodes.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[D.ExecutionErrorCodes.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly", |
|
[D.ExecutionErrorCodes.FeatureSetDoesNotHaveSubtypes]:"FeatureSet does not have subtypes"};class y extends Error{constructor(...C){super(...C)}}class b extends y{constructor(C,M){super(E(M)+C.message,{cause:C});this.loc=null;Error.captureStackTrace&&Error.captureStackTrace(this,b);M?.loc&&(this.loc=M.loc)}}class q extends Error{constructor(C,M,A,f){super("Execution error - "+E(A)+O.replace(c[M],f));this.loc=null;this.declaredRootClass="esri.arcade.arcadeexecutionerror";Error.captureStackTrace&&Error.captureStackTrace(this, |
|
q);A?.loc&&(this.loc=A.loc)}}class F extends Error{constructor(C,M,A,f){super("Compilation error - "+E(A)+O.replace(c[M],f));this.loc=null;this.declaredRootClass="esri.arcade.arcadecompilationerror";Error.captureStackTrace&&Error.captureStackTrace(this,F);A?.loc&&(this.loc=A.loc)}}class d extends Error{constructor(){super("Uncompilable code structures");this.declaredRootClass="esri.arcade.arcadeuncompilableerror";Error.captureStackTrace&&Error.captureStackTrace(this,d)}}D.ModuleErrorCodes=void 0; |
|
(function(C){C.UnrecognizedUri="UnrecognizedUri";C.UnsupportedUriProtocol="UnsupportedUriProtocol"})(D.ModuleErrorCodes||(D.ModuleErrorCodes={}));const k={[D.ModuleErrorCodes.UnrecognizedUri]:"Unrecognized uri - {uri}",[D.ModuleErrorCodes.UnsupportedUriProtocol]:"Unrecognized uri protocol"};class w extends Error{constructor(C,M){super(O.replace(k[C],M));this.declaredRootClass="esri.arcade.arcademoduleerror";Error.captureStackTrace&&Error.captureStackTrace(this,w)}}D.ArcadeCompilationError=F;D.ArcadeExecutionError= |
|
q;D.ArcadeUncompilableError=d;D.ErrorWithCause=y;D.LocatableArcadeExecutionError=b;D.ModuleError=w;D.ensureArcadeExecutionError=function(C,M,A){return"esri.arcade.arcadeexecutionerror"===A.declaredRootClass||"esri.arcade.arcadecompilationerror"===A.declaredRootClass?null===A.loc&&M?.loc?new b(A,{cause:A}):A:M?.loc?new b(A,{cause:A}):A};D.executionErrorMessages=c;D.moduleErrorMessages=k;D.parsingValidationMessage=function(C,M,A){return"Parsing error - "+E(C)+O.replace(c[M],A)};Object.defineProperty(D, |
|
Symbol.toStringTag,{value:"Module"})})},"esri/arcade/FunctionWrapper":function(){define(["exports","../core/promiseUtils"],function(D,O){function E(q,F,d){if(q instanceof c&&!(q instanceof b)){const k=new b;k.fn=q;k.parameterEvaluator=d;k.context=F;return k}return q}class c{constructor(){}}class y extends c{constructor(q){super();this.fn=q}createFunction(q){return(...F)=>this.fn(q,{preparsed:!0,arguments:F})}call(q,F){return this.fn(q,F)}marshalledCall(q,F,d,k){return k(q,F,(w,C,M)=>{M=M.map(A=>A instanceof |
|
c&&!(A instanceof b)?E(A,q,k):A);w=this.call(d,{args:M});return O.isPromiseLike(w)?w.then(A=>E(A,d,k)):w})}}class b extends c{constructor(){super(...arguments);this.context=this.fn=null}createFunction(q){return this.fn.createFunction(this.context)}call(q,F){return this.fn.marshalledCall(q,F,this.context,this.parameterEvaluator)}marshalledCall(q,F,d){return this.fn.marshalledCall(q,F,this.context,this.parameterEvaluator)}}D.ArcadeFunction=c;D.NativeFunction=y;D.ScopeMarshalledFunction=b;D.wrapModuleScopedResponse= |
|
E;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/ImmutableArray":function(){define(function(){class D{constructor(O=[]){this._elements=O}length(){return this._elements.length}get(O){return this._elements[O]}toArray(){return this.slice()}slice(O=0,E=this.length()){const c=[];for(;O<E;O++)c.push(this.get(O));return c}}return D})},"esri/arcade/ImmutablePathArray":function(){define(["./ImmutableArray","./ImmutablePointArray"],function(D,O){class E extends D{constructor(c, |
|
y,b,q,F){super(c);this._lazyPath=[];this._hasM=this._hasZ=!1;this._hasZ=b;this._hasM=q;this._spRef=y;this._cacheId=F}get(c){if(void 0===this._lazyPath[c]){const y=this._elements[c];if(void 0===y)return;this._lazyPath[c]=new O(y,this._spRef,this._hasZ,this._hasM,this._cacheId,c)}return this._lazyPath[c]}equalityTest(c){return c===this?!0:null===c||!1===c instanceof E?!1:c.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}return E})},"esri/arcade/ImmutablePointArray":function(){define(["./ImmutableArray", |
|
"../geometry/Point"],function(D,O){class E extends D{constructor(c,y,b,q,F,d){super(c);this._lazyPt=[];this._hasM=this._hasZ=!1;this._spRef=y;this._hasZ=b;this._hasM=q;this._cacheId=F;this._partId=d}get(c){if(void 0===this._lazyPt[c]){var y=this._elements[c];if(void 0===y)return;const b=this._hasZ,q=this._hasM;y=b&&!q?new O(y[0],y[1],y[2],void 0,this._spRef):q&&!b?new O(y[0],y[1],void 0,y[2],this._spRef):b&&q?new O(y[0],y[1],y[2],y[3],this._spRef):new O(y[0],y[1],this._spRef);y.cache._arcadeCacheId= |
|
this._cacheId.toString()+"-"+this._partId.toString()+"-"+c.toString();this._lazyPt[c]=y}return this._lazyPt[c]}equalityTest(c){return c===this?!0:null===c||!1===c instanceof E?!1:c.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}return E})},"esri/arcade/featureset/support/shared":function(){define("exports ../../ArcadeDate ../../../core/sql/DateOnly ../../../core/sql/TimeOnly ../../../geometry/Extent ../../../layers/support/Field ../../../chunks/datetime".split(" "), |
|
function(D,O,E,c,y,b,q){function F(w){return w instanceof Date}function d(w){return w instanceof O.ArcadeDate}function k(w){switch(w.type){case "catalog":case "feature":case "oriented-imagery":case "subtype-group":return!0;default:return!1}}D.FeatureServiceDatabaseType=void 0;(function(w){w[w.Standardised=0]="Standardised";w[w.StandardisedNoInterval=1]="StandardisedNoInterval";w[w.SqlServer=2]="SqlServer";w[w.Oracle=3]="Oracle";w[w.Postgres=4]="Postgres";w[w.PGDB=5]="PGDB";w[w.FILEGDB=6]="FILEGDB"; |
|
w[w.NotEvaluated=7]="NotEvaluated"})(D.FeatureServiceDatabaseType||(D.FeatureServiceDatabaseType={}));D.IdState=void 0;(function(w){w[w.InFeatureSet=0]="InFeatureSet";w[w.NotInFeatureSet=1]="NotInFeatureSet";w[w.Unknown=2]="Unknown"})(D.IdState||(D.IdState={}));D.callback=function(w,C){return function(){try{w.apply(null,arguments)}catch(M){C.reject(M)}}};D.cloneAttributes=function(w){const C={};for(const M in w)C[M]=w[M];return C};D.cloneField=function(w){return b.fromJSON(w.toJSON())};D.convertLinearUnitsToCode= |
|
function(w){if(null==w)return null;if("number"===typeof w||"number"===typeof w)return w;switch(w.toLowerCase()){case "meters":case "meter":return 9001;case "miles":case "mile":return 9093;case "kilometers":case "kilometer":case "km":return 9036}return null};D.convertSquareUnitsToCode=function(w){if(null==w)return null;if("number"===typeof w)return w;switch(w.toLowerCase()){case "meters":case "meter":return 109404;case "miles":case "mile":return 109439;case "kilometers":case "kilometer":case "km":return 109414}return null}; |
|
D.defaultMaxRecords=1E3;D.equalityTest=function(w,C){return w===C?!0:(F(w)||d(w))&&(F(C)||d(C))?w.getTime()===C.getTime():!1};D.errback=function(w){return function(C){w.reject(C)}};D.esriFieldToJson=function(w){return w.toJSON?w.toJSON():w};D.extractServiceUrl=function(w){if(void 0===w)return"";w=w.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer");w=w.replace(/\/mapserver\/[0-9]*/i,"/MapServer");return w=w.split("?")[0]};D.isArcadeDate=d;D.isArcadeDateOnly=function(w){return w instanceof E.DateOnly}; |
|
D.isArcadeTime=function(w){return w instanceof c.TimeOnly};D.isArray=function(w){return Array.isArray(w)};D.isBoolean=function(w){return"boolean"===typeof w};D.isDate=F;D.isLuxonDate=function(w){return w instanceof q.DateTime};D.isNumber=function(w){return"number"===typeof w};D.isString=function(w){return"string"===typeof w||w instanceof String};D.isSupportedLayer=function(w){switch(w.type){case "catalog-footprint":case "subtype-sublayer":return!0;default:return k(w)}};D.isSupportedSourceLayer=k; |
|
D.layerFieldEsriConstants={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate","date-only":"esriFieldTypeDateOnly","time-only":"esriFieldTypeTimeOnly","timestamp-offset":"esriFieldTypeTimestampOffset",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID", |
|
xml:"esriFieldTypeXML","big-integer":"esriFieldTypeBigInteger",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeDateOnly:"esriFieldTypeDateOnly",esriFieldTypeTimeOnly:"esriFieldTypeTimeOnly",esriFieldTypeTimestampOffset:"esriFieldTypeTimestampOffset", |
|
esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"esriFieldTypeXML",esriFieldTypeBigInteger:"esriFieldTypeBigInteger"};D.layerGeometryEsriConstants={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon", |
|
esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"};D.layerGeometryEsriRestConstants={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope", |
|
envelope:"esriGeometryEnvelope"};D.sameGeomType=function(w,C){return w===C||"point"===w&&"esriGeometryPoint"===C||"polyline"===w&&"esriGeometryPolyline"===C||"polygon"===w&&"esriGeometryPolygon"===C||"extent"===w&&"esriGeometryEnvelope"===C||"multipoint"===w&&"esriGeometryMultipoint"===C||"point"===C&&"esriGeometryPoint"===w||"polyline"===C&&"esriGeometryPolyline"===w||"polygon"===C&&"esriGeometryPolygon"===w||"extent"===C&&"esriGeometryEnvelope"===w||"multipoint"===C&&"esriGeometryMultipoint"=== |
|
w?!0:!1};D.shapeExtent=function(w){if(null==w)return null;switch(w.type){case "polygon":case "multipoint":case "polyline":return w.extent;case "point":return new y({xmin:w.x,ymin:w.y,xmax:w.x,ymax:w.y,spatialReference:w.spatialReference});case "extent":return w}return null};D.stableStringify=function(w,C){C||={};"function"===typeof C&&(C={cmp:C});const M="boolean"===typeof C.cycles?C.cycles:!1,A=C.cmp&&function(m){return function(r){return function(n,g){return m({key:n,value:r[n]},{key:g,value:r[g]})}}}(C.cmp), |
|
f=[];return function n(r){r?.toJSON&&"function"===typeof r.toJSON&&(r=r.toJSON());if(void 0!==r){if("number"===typeof r)return isFinite(r)?""+r:"null";if("object"!==typeof r)return JSON.stringify(r);var g;if(Array.isArray(r)){var l="[";for(g=0;g<r.length;g++)g&&(l+=","),l+=n(r[g])||"null";return l+"]"}if(null===r)return"null";if(f.includes(r)){if(M)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON");}var z=f.push(r)-1,G=Object.keys(r).sort(A?.(r));l=""; |
|
for(g=0;g<G.length;g++){const a=G[g],B=n(r[a]);B&&(l&&(l+=","),l+=JSON.stringify(a)+":"+B)}f.splice(z,1);return"{"+l+"}"}}(w)};D.toEsriGeometryType=function(w){switch(w){case "point":return"esriGeometryPoint";case "polygon":return"esriGeometryPolygon";case "multipoint":return"esriGeometryMultipoint";case "polyline":return"esriGeometryPolyline";default:return"esriGeometryPoint"}};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/DateOnly":function(){define(["exports","../../arcade/ArcadeDate", |
|
"../../intl/locale","../../chunks/datetime"],function(D,O,E,c){function y(q){q=q.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$\x26]");let F="";const d=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const k of q.match(d)||[])switch(k){case "D":F+="d";break;case "DD":F+="dd";break;case "DDD":F+="o";break;case "d":F+="c";break;case "ddd":F+="ccc";break;case "dddd":F+= |
|
"cccc";break;case "M":F+="L";break;case "MM":F+="LL";break;case "MMM":F+="LLL";break;case "MMMM":F+="LLLL";break;case "YY":F+="yy";break;case "Y":case "YYYY":F+="yyyy";break;case "Q":F+="q";break;case "X":case "x":F+=k;break;default:F=2<=k.length&&"["===k.slice(0,1)&&"]"===k.slice(-1)?F+`'${k.slice(1,-1)}'`:F+`'${k}'`}return F}class b{constructor(q,F,d){this._year=q;this._month=F;this._day=d;this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month- |
|
1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(q){return q instanceof b&&q.day===this.day&&q.month===this.month&&q.year===this.year}clone(){return new b(this._year,this._month,this._day)}toDateTime(q){return c.DateTime.fromObject({day:this.day,month:this.month,year:this.year},{zone:O.createDateTimeZone(q)})}toDateTimeLuxon(q){return c.DateTime.fromObject({day:this.day,month:this.month,year:this.year},{zone:O.createDateTimeZone(q)})}toString(){return`${this.year.toString().padStart(4, |
|
"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(q=null,F=!0){if(null===q||""===q)return this.toString();F&&(q=y(q));if(!q)return"";F=this.toDateTime("unknown");return O.ArcadeDate.dateTimeToArcadeDate(F).toFormat(q,{locale:E.getLocale(),numberingSystem:"latn"})}toArcadeDate(){const q=this.toDateTime("unknown");return O.ArcadeDate.dateTimeToArcadeDate(q)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd", |
|
!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(q,F){return b.fromDateTime(this.toUTCDateTime().plus({[q]:F}))}toUTCDateTime(){return c.DateTime.utc(this.year,this.month,this.day,0,0,0,0)}difference(q,F){switch(F.toLowerCase()){case "days":case "day":case "d":return this.toUTCDateTime().diff(q.toUTCDateTime(),"days").days;case "months":case "month":return this.toUTCDateTime().diff(q.toUTCDateTime(),"months").months;case "minutes":case "minute":case "m":return"M"=== |
|
F?this.toUTCDateTime().diff(q.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(q.toUTCDateTime(),"minutes").minutes;case "seconds":case "second":case "s":return this.toUTCDateTime().diff(q.toUTCDateTime(),"seconds").seconds;case "milliseconds":case "millisecond":case "ms":return this.toUTCDateTime().diff(q.toUTCDateTime(),"milliseconds").milliseconds;case "hours":case "hour":case "h":return this.toUTCDateTime().diff(q.toUTCDateTime(),"hours").hours;case "years":case "year":case "y":return this.toUTCDateTime().diff(q.toUTCDateTime(), |
|
"years").years;default:return this.toUTCDateTime().diff(q.toUTCDateTime(),"milliseconds").milliseconds}}static fromMilliseconds(q){q=c.DateTime.fromMillis(q,{zone:c.FixedOffsetZone.utcInstance});return q.isValid?b.fromParts(q.year,q.month,q.day):null}static fromSeconds(q){q=c.DateTime.fromSeconds(q,{zone:c.FixedOffsetZone.utcInstance});return q.isValid?b.fromParts(q.year,q.month,q.day):null}static fromReader(q){if(!q)return null;q=q.split("-");return 3!==q.length?null:new b(parseInt(q[0],10),parseInt(q[1], |
|
10),parseInt(q[2],10))}static fromParts(q,F,d){q=new b(q,F,d);return!1===q.isValid?null:q}static fromDateJS(q){return b.fromParts(q.getFullYear(),q.getMonth()+1,q.getDay())}static fromDateTime(q){return b.fromParts(q.year,q.month,q.day)}static fromSqlTimeStampOffset(q){return this.fromDateTime(q.toDateTime())}static fromString(q,F=null){if(""===q||null===q)return null;var d=[];if(F)(F=y(F))&&d.push(F);else if(null===F||""===F)return q=c.DateTime.fromISO(q,{setZone:!0}),q.isValid?b.fromParts(q.year, |
|
q.month,q.day):null;for(const k of d)if(d=c.DateTime.fromFormat(q,F??k),d.isValid)return new b(d.year,d.month,d.day);return null}static fromNow(q="system"){q=c.DateTime.fromJSDate(new Date).setZone(O.createDateTimeZone(q));return new b(q.year,q.month,q.day)}}D.DateOnly=b;D.standardizeDateOnlyFormat=y;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/core/sql/TimeOnly":function(){define(["exports","../../arcade/kernel","../../intl/locale","../../chunks/datetime"],function(D,O,E, |
|
c){function y(q){if(!q)return"";const F=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let d="";for(const k of q.match(F)||[])switch(k){case "SSS":d+=k;break;case "A":case "a":d+="a";break;case "m":case "mm":case "h":case "hh":case "H":case "HH":case "s":case "ss":d+=k;break;default:d+=`'${k}'`}return d}class b{constructor(q,F,d,k){this._hour=q;this._minute=F;this._second=d;this._millisecond=k;this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(q){return q instanceof |
|
b&&q.hour===this.hour&&q.minute===this.minute&&q.second===this.second&&q.millisecond===this.millisecond}clone(){return new b(this.hour,this.minute,this.second,this.millisecond)}isValid(){return O.isInteger(this.hour)&&O.isInteger(this.minute)&&O.isInteger(this.second)&&O.isInteger(this.millisecond)&&0<=this.hour&&24>this.hour&&0<=this.minute&&60>this.minute&&0<=this.second&&60>this.second&&0<=this.millisecond&&1E3>this.millisecond}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2, |
|
"0")}:${this.second.toString().padStart(2,"0")}`+(0<this.millisecond?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${0<this.millisecond?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2, |
|
"0")}`}toFormat(q=null){return null===q||""===q?this.toString():(q=y(q))?c.DateTime.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(q,{locale:E.getLocale(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1E3*this.second+6E4*this.minute+36E5*this.hour}static fromParts(q,F,d,k){q=new b(q,F,d,k);return q.isValid()?q:null}static fromReader(q){if(!q)return null;q=q.split(":");return 3!==q.length?null:new b(parseInt(q[0],10),parseInt(q[1],10),parseInt(q[2], |
|
10),0)}static fromMilliseconds(q){return 864E5<q||0>q?null:new b(Math.floor(q/36E5%24),Math.floor(q/6E4%60),Math.floor(q/1E3%60),Math.floor(q%1E3))}static fromDateJS(q){return new b(q.getHours(),q.getMinutes(),q.getSeconds(),q.getMilliseconds())}static fromDateTime(q){return new b(q.hour,q.minute,q.second,q.millisecond)}static fromSqlTimeStampOffset(q){return this.fromDateTime(q.toDateTime())}static fromString(q,F=null){if(""===q||null===q)return null;const d=[];if(F)(F=y(F))&&d.push(F);else if(null=== |
|
F||""===F)d.push("HH:mm:ss"),d.push("HH:mm:ss.SSS"),d.push("hh:mm:ss a"),d.push("hh:mm:ss.SSS a"),d.push("HH:mm"),d.push("hh:mm a"),d.push("H:mm"),d.push("h:mm a"),d.push("H:mm:ss"),d.push("h:mm:ss a"),d.push("H:mm:ss.SSS"),d.push("h:mm:ss.SSS a");for(const k of d)if(F=c.DateTime.fromFormat(q,k),F.isValid)return new b(F.hour,F.minute,F.second,F.millisecond);return null}plus(q,F){switch(q){case "days":case "years":case "months":return this.clone();case "hours":case "minutes":case "seconds":case "milliseconds":return b.fromDateTime(this.toUTCDateTime().plus({[q]:F}))}return null}toUTCDateTime(){return c.DateTime.utc(1970, |
|
1,1,this.hour,this.minute,this.second,this.millisecond)}difference(q,F){switch(F.toLowerCase()){case "days":case "day":case "d":return this.toUTCDateTime().diff(q.toUTCDateTime(),"days").days;case "months":case "month":return this.toUTCDateTime().diff(q.toUTCDateTime(),"months").months;case "minutes":case "minute":case "m":return"M"===F?this.toUTCDateTime().diff(q.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(q.toUTCDateTime(),"minutes").minutes;case "seconds":case "second":case "s":return this.toUTCDateTime().diff(q.toUTCDateTime(), |
|
"seconds").seconds;case "milliseconds":case "millisecond":case "ms":return this.toUTCDateTime().diff(q.toUTCDateTime(),"milliseconds").milliseconds;case "hours":case "hour":case "h":return this.toUTCDateTime().diff(q.toUTCDateTime(),"hours").hours;case "years":case "year":case "y":return this.toUTCDateTime().diff(q.toUTCDateTime(),"years").years;default:return this.toUTCDateTime().diff(q.toUTCDateTime(),"milliseconds").milliseconds}}}D.TimeOnly=b;D.standardizeTimeFormat=y;Object.defineProperty(D, |
|
Symbol.toStringTag,{value:"Module"})})},"esri/arcade/kernel":function(){define(["exports","../geometry/Extent"],function(D,O){D.cloneGeometry=function(E){if(null==E)return null;const c=E.clone();void 0!==E.cache._geVersion&&(c.cache._geVersion=E.cache._geVersion);return c};D.convertLinearUnitsToCode=function(E){if(null==E)return null;if("number"===typeof E)return E;E=E.toLowerCase();E=E.replaceAll(/\s/g,"");E=E.replaceAll("-","");switch(E){case "meters":case "meter":case "m":case "squaremeters":case "squaremeter":return 9001; |
|
case "miles":case "mile":case "squaremile":case "squaremiles":return 9093;case "kilometers":case "kilometer":case "squarekilometers":case "squarekilometer":case "km":return 9036;case "yard":case "yd":case "yards":case "squareyards":case "squareyard":return 9096;case "feet":case "ft":case "foot":case "squarefeet":case "squarefoot":return 9002;case "nmi":case "nauticalmile":case "nauticalmiles":case "squarenauticalmile":case "squarenauticalmiles":return 9030}return null};D.convertSquareUnitsToCode= |
|
function(E){if(null==E)return null;if("number"===typeof E)return E;E=E.toLowerCase();E=E.replaceAll(/\s/g,"");E=E.replaceAll("-","");switch(E){case "meters":case "meter":case "m":case "squaremeters":case "squaremeter":return 109404;case "miles":case "mile":case "squaremile":case "squaremiles":return 109439;case "kilometers":case "kilometer":case "squarekilometers":case "squarekilometer":case "km":return 109414;case "acres":case "acre":case "ac":return 109402;case "hectares":case "hectare":case "ha":return 109401; |
|
case "yard":case "yd":case "yards":case "squareyards":case "squareyard":return 109442;case "feet":case "ft":case "foot":case "squarefeet":case "squarefoot":return 109405;case "nmi":case "nauticalmile":case "nauticalmiles":case "squarenauticalmile":case "squarenauticalmiles":return 109409}return null};D.isInteger=function(E){return"number"===typeof E&&isFinite(E)&&Math.floor(E)===E};D.sameGeomType=function(E,c){return E===c||"point"===E&&"esriGeometryPoint"===c||"polyline"===E&&"esriGeometryPolyline"=== |
|
c||"polygon"===E&&"esriGeometryPolygon"===c||"extent"===E&&"esriGeometryEnvelope"===c||"multipoint"===E&&"esriGeometryMultipoint"===c||"point"===c&&"esriGeometryPoint"===E||"polyline"===c&&"esriGeometryPolyline"===E||"polygon"===c&&"esriGeometryPolygon"===E||"extent"===c&&"esriGeometryEnvelope"===E||"multipoint"===c&&"esriGeometryMultipoint"===E?!0:!1};D.shapeExtent=function(E){if(null==E)return null;switch(E.type){case "polygon":case "multipoint":case "polyline":return E.extent;case "point":return new O({xmin:E.x, |
|
ymin:E.y,xmax:E.x,ymax:E.y,spatialReference:E.spatialReference});case "extent":return E}return null};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/core/number":function(){define(["exports","./string","../intl/locale"],function(D,O,E){function c(w=E.getLocale()){w=w.toLowerCase();let C=w in F;if(!C){const m=w.split("-");1<m.length&&m[0]in F&&(w=m[0],C=!0);C||(w="en")}const [M,A,f="#,##0.###"]=F[w];return{decimal:M,group:A,pattern:f}}function y(w){w=w||{};var C=c(w.locale);const M= |
|
w.pattern||C.pattern,A=C.group,f=C.decimal;let m=1;if(M.includes("%"))m/=100;else if(M.includes("\u2030"))m/=1E3;else if(M.includes("\u00a4"))throw Error("currency notation not supported");C=M.split(";");1===C.length&&C.push("-"+C[0]);return{regexp:k(C,r=>{r="(?:"+O.escapeRegExpString(r,".")+")";return r.replace(d,n=>{const g={signed:!1,separator:w.strict?A:[A,""],fractional:w.fractional,decimal:f,exponent:!1};n=n.split(".");let l=w.places;1===n.length&&1!==m&&(n[1]="###");1===n.length||0===l?g.fractional= |
|
!1:(void 0===l&&(l=w.pattern?n[1].lastIndexOf("0")+1:Infinity),l&&null==w.fractional&&(g.fractional=!0),!w.places&&+l<n[1].length&&(l+=","+n[1].length),g.places=l);n=n[0].split(",");1<n.length&&(g.groupSize=n.pop().length,1<n.length&&(g.groupSize2=n.pop().length));return"("+b(g)+")"})},!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:A,decimal:f,factor:m}}function b(w){w=w||{};"places"in w||(w.places=Infinity);"string"!==typeof w.decimal&&(w.decimal=".");"fractional"in w&&!String(w.places).startsWith("0")|| |
|
(w.fractional=[!0,!1]);"exponent"in w||(w.exponent=[!0,!1]);"eSigned"in w||(w.eSigned=[!0,!1]);var C=q(w);const M=k(w.fractional,f=>{let m="";f&&0!==w.places&&(m="\\"+w.decimal,m=Infinity===w.places?"(?:"+m+"\\d+)?":m+("\\d{"+w.places+"}"));return m},!0),A=k(w.exponent,f=>f?"([eE]"+q({signed:w.eSigned})+")":"");C+=M;M&&(C="(?:(?:"+C+")|(?:"+M+"))");return C+A}function q(w){w=w||{};"signed"in w||(w.signed=[!0,!1]);"separator"in w?"groupSize"in w||(w.groupSize=3):w.separator="";const C=k(w.signed,A=> |
|
A?"[-+]":"",!0),M=k(w.separator,A=>{if(!A)return"(?:\\d+)";A=O.escapeRegExpString(A);" "===A?A="\\s":"\u00a0"===A&&(A="\\s\\xa0");const f=w.groupSize,m=w.groupSize2;return m?(A="(?:0|[1-9]\\d{0,"+(m-1)+"}(?:["+A+"]\\d{"+m+"})*["+A+"]\\d{"+f+"})",0<f-m?"(?:"+A+"|(?:0|[1-9]\\d{0,"+(f-1)+"}))":A):"(?:0|[1-9]\\d{0,"+(f-1)+"}(?:["+A+"]\\d{"+f+"})*)"},!0);return C+M}const F={ar:[".",","],bg:[",","\u00a0"],bs:[",","."],ca:[",","."],cs:[",","\u00a0"],da:[",","."],de:[",","."],"de-ch":[".","\u2019"],el:[",", |
|
"."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[",","\u00a0"],fi:[",","\u00a0"],fr:[",","\u202f"],"fr-ch":[",","\u202f"],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[",","\u00a0"],id:[",","."],it:[",","."],"it-ch":[".","\u2019"],ja:[".",","],ko:[".",","],lt:[",","\u00a0"],lv:[",","\u00a0"],mk:[",","."],nb:[",","\u00a0"],nl:[",","."],pl:[",","\u00a0"],pt:[",","."],"pt-pt":[",","\u00a0"],ro:[",","."],ru:[",","\u00a0"],sk:[",","\u00a0"],sl:[",","."],sr:[",","."],sv:[",", |
|
"\u00a0"],th:[".",","],tr:[",","."],uk:[",","\u00a0"],vi:[",","."],zh:[".",","]},d=/[#0,]*[#0](?:\.0*#*)?/,k=(w,C,M)=>{if(!Array.isArray(w))return C(w);const A=[];for(let f=0;f<w.length;f++)A.push(C(w[f]));w=A.join("|");return"("+(M?"?:":"")+w+")"};D._parseInfo=y;D.format=function(w,C){C={...C};var M=c(C.locale);C.customs=M;M=C.pattern||M.pattern;if(isNaN(w)||Infinity===Math.abs(w))return null;var A=w;var f=C||{};var m=f.customs.group,r=f.customs.decimal;M=M.split(";");w=M[0];C=M[0>A?1:0]||"-"+w; |
|
if(C.includes("%"))A*=100;else if(C.includes("\u2030"))A*=1E3;else{if(C.includes("\u00a4"))throw Error("currency notation not supported");if(C.includes("E"))throw Error("exponential notation not supported");}M=d;var n=w.match(M);if(!n)throw Error("unable to find a number expression in pattern: "+C);!1===f.fractional&&(f.places=0);w=C.replace;n=n[0];f=f={decimal:r,group:m,places:f.places,round:f.round};!0===f.places&&(f.places=0);Infinity===f.places&&(f.places=6);r=n.split(".");var g="string"===typeof f.places&& |
|
f.places.indexOf(",");n=f.places;g?n=f.places.substring(g+1):0<=+n||(n=(r[1]||[]).length);0>f.round||(A=Number(A.toFixed(Number(n))));m=String(Math.abs(A)).split(".");A=m[1]||"";r[1]||f.places?(g&&(f.places=f.places.substring(0,g)),g=void 0!==f.places?f.places:r[1]&&r[1].lastIndexOf("0")+1,+g>A.length&&(m[1]=A.padEnd(Number(g),"0")),+n<A.length&&(m[1]=A.substr(0,Number(n)))):m[1]&&m.pop();A=r[0].replace(",","");n=A.indexOf("0");-1!==n&&(n=A.length-n,n>m[0].length&&(m[0]=m[0].padStart(n,"0")),A.includes("#")|| |
|
(m[0]=m[0].substr(m[0].length-n)));A=r[0].lastIndexOf(",");let l;if(-1!==A){var z=r[0].length-A-1;r=r[0].substr(0,A);A=r.lastIndexOf(",");-1!==A&&(l=r.length-A-1)}r=[];for(A=m[0];A;)n=A.length-z,r.push(0<n?A.substr(n):A),A=0<n?A.slice(0,n):"",l&&(z=l,l=void 0);m[0]=r.reverse().join(f.group||",");z=m.join(f.decimal||".");return w.call(C,M,z)};D.getCustoms=c;D.parse=function(w,C){C=y(C);w=(new RegExp("^"+C.regexp+"$")).exec(w);if(!w)return NaN;let M=w[1];if(!w[1]){if(!w[2])return NaN;M=w[2];C.factor*= |
|
-1}M=M.replaceAll(new RegExp("["+C.group+"\\s\\xa0]","g"),"").replace(C.decimal,".");return Number(M)*C.factor};D.regexp=function(w){return y(w).regexp};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/Feature":function(){define("./ArcadeDate ./deepClone ./Dictionary ./executionError ./ImmutableArray ../chunks/languageUtils ../core/sql/DateOnly ../core/sql/TimeOnly ../geometry/Geometry ../geometry/Point ../geometry/support/jsonUtils ../layers/graphics/featureConversionUtils ../layers/support/FieldsIndex".split(" "), |
|
function(D,O,E,c,y,b,q,F,d,k,w,C,M){class A{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature";this._layer=this.attributes=this._geometry=this._optimizedGeomDefinition=null;this._fieldTypesFixed=!0;this.contextTimeZone=this.fieldsIndex=null;this.immutable=!0;this._fieldsToFixDataTypes=null;this.immutable=!0}static createFromGraphic(f,m){const r=new A;r.contextTimeZone=m??null;r._geometry=null!=f.geometry?f.geometry:null;r.attributes=void 0===f.attributes?{}:null===f.attributes?{}:f.attributes; |
|
f._sourceLayer?(r._layer=f._sourceLayer,r._fieldTypesFixed=!1):f._layer?(r._layer=f._layer,r._fieldTypesFixed=!1):f.layer&&"fields"in f.layer?(r._layer=f.layer,r._fieldTypesFixed=!1):f.sourceLayer&&"fields"in f.sourceLayer&&(r._layer=f.sourceLayer,r._fieldTypesFixed=!1);r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer));return r}static createFromArcadeFeature(f){if(f instanceof A){var m=new A;m._fieldTypesFixed=f._fieldTypesFixed;m.attributes=f.attributes;m._geometry= |
|
f._geometry;m._optimizedGeomDefinition=f._optimizedGeomDefinition;f._layer&&(m._layer=f._layer);m.fieldsIndex=f.fieldsIndex;m.contextTimeZone=f.contextTimeZone;return m}m={};for(const r of f.keys())m[r]=f.field(r);return A.createFromGraphicLikeObject(f.geometry(),m,f.fullSchema(),f.contextTimeZone)}static createFromOptimisedFeature(f,m,r){const n=new A;n._geometry=f.geometry?{geometry:f.geometry}:null;n._optimizedGeomDefinition=r;n.attributes=f.attributes||{};n._layer=m;n._fieldTypesFixed=!1;return n}static createFromArcadeDictionary(f, |
|
m){const r=new A;r.attributes=f.field("attributes");null!==r.attributes?r.attributes instanceof E?(r.attributes=r.attributes.attributes,null===r.attributes&&(r.attributes={})):r.attributes={}:r.attributes={};r._geometry=f.field("geometry");null!==r._geometry&&(r._geometry instanceof E?r._geometry=A.parseGeometryFromDictionary(r._geometry,m):r._geometry instanceof d||(r._geometry=null));return r}static createFromGraphicLikeObject(f,m,r=null,n){const g=new A;g.contextTimeZone=n??null;null===m&&(m={}); |
|
g.attributes=m;g._geometry=null!=f?f:null;g._layer=r;g._layer&&(g._fieldTypesFixed=!1,g.fieldsIndex=this.hydrateFieldsIndex(g._layer));return g}static hydrateFieldsIndex(f){return null===f?null:b.isFeatureSet(f)?f.getFieldsIndex():f.fieldsIndex?f.fieldsIndex:M.fromLayerJSON({datesInUnknownTimezone:f.datesInUnknownTimezone,fields:f.fields,timeInfo:f.timeInfo,editFieldsInfo:f.editFieldsInfo,dateFieldsTimeReference:f.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(f, |
|
m,r=null){null===m&&(m={});this.attributes=m;this._geometry=f??null;this._fieldTypesFixed=(this._layer=r)?!1:!0}castToText(f=!1){let m="";!1===this._fieldTypesFixed&&this._fixFieldTypes();for(const r in this.attributes){""!==m&&(m+=",");const n=this.attributes[r];null==n?m+=JSON.stringify(r)+":null":b.isBoolean(n)||b.isNumber(n)||b.isString(n)?m+=JSON.stringify(r)+":"+JSON.stringify(n):n instanceof d?m+=JSON.stringify(r)+":"+b.toStringExplicit(n):n instanceof F.TimeOnly||n instanceof q.DateOnly?m+= |
|
`${JSON.stringify(r)}:${JSON.stringify(n.toString())}`:n instanceof y?m+=JSON.stringify(r)+":"+b.toStringExplicit(n,null,f):Array.isArray(n)?m+=JSON.stringify(r)+":"+b.toStringExplicit(n,null,f):n instanceof D.ArcadeDate?m=f?m+(JSON.stringify(r)+":"+JSON.stringify(n.getTime())):m+(JSON.stringify(r)+":"+n.stringify()):null!==n&&"object"===typeof n&&void 0!==n.castToText&&(m+=JSON.stringify(r)+":"+n.castToText(f))}return'{"geometry":'+(null===this.geometry()?"null":b.toStringExplicit(this.geometry()))+ |
|
',"attributes":{'+m+"}}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&0<this._fieldsToFixDataTypes?.length)this._fixAllFields(this._fieldsToFixDataTypes);else{var f=[],m=this._layer.fields;for(let r=0;r<m.length;r++){const {name:n,type:g}=m[r];switch(g){case "date":case "esriFieldTypeDate":f.push({field:n,dataType:"date"});break;case "date-only":case "esriFieldTypeDateOnly":f.push({field:n,dataType:"date-only"});break;case "time-only":case "esriFieldTypeTimeOnly":f.push({field:n,dataType:"time-only"}); |
|
break;case "timestamp-offset":case "esriFieldTypeTimestampOffset":f.push({field:n,dataType:"timestamp-offset"})}}this._fieldsToFixDataTypes=f;0<f.length&&this._fixAllFields(f)}this._fieldTypesFixed=!0}isUnknownDateTimeField(f){return"unknown"===this.fieldsIndex?.getTimeZone(f)}_fixAllFields(f){this.attributes={...this.attributes};const m=this.contextTimeZone??"system";for(let g=0;g<f.length;g++){var r=f[g].field,n=f[g].dataType;let l=this.attributes[r];if(void 0===l)for(const z in this.attributes){if(z.toLowerCase()=== |
|
r.toLowerCase()){l=this.attributes[z];if(null!==l){if("time-only"===n){b.isTime(l)||(this.attributes[z]=F.TimeOnly.fromReader(l.toString()));break}if("date-only"===n){b.isDateOnly(l)||(this.attributes[z]=q.DateOnly.fromReader(l.toString()));break}if("timestamp-offset"===n){b.isDate(l)||(this.attributes[z]=D.ArcadeDate.fromReaderAsTimeStampOffset(l.toString()));break}r=this.isUnknownDateTimeField(z);l instanceof Date?this.attributes[z]=r?D.ArcadeDate.unknownDateJSToArcadeDate(l):D.ArcadeDate.dateJSAndZoneToArcadeDate(l, |
|
m):b.isDate(l)||(this.attributes[z]=r?D.ArcadeDate.unknownEpochToArcadeDate(l):D.ArcadeDate.epochToArcadeDate(l,m))}break}}else null!==l&&("time-only"===n?b.isTime(l)?this.attributes[r]=l:this.attributes[r]=F.TimeOnly.fromReader(l.toString()):"date-only"===n?b.isDateOnly(l)?this.attributes[r]=l:this.attributes[r]=q.DateOnly.fromReader(l.toString()):"timestamp-offset"===n?b.isDate(l)?this.attributes[r]=l:this.attributes[r]=D.ArcadeDate.fromReaderAsTimeStampOffset(l.toString()):(n=this.isUnknownDateTimeField(r), |
|
b.isDate(l)?this.attributes[r]=l:this.attributes[r]=l instanceof Date?n?D.ArcadeDate.unknownDateJSToArcadeDate(l):D.ArcadeDate.dateJSAndZoneToArcadeDate(l,m):n?D.ArcadeDate.unknownEpochToArcadeDate(l):D.ArcadeDate.epochToArcadeDate(l,m)))}}geometry(){if(null===this._geometry||this._geometry instanceof d)return this._geometry;this._optimizedGeomDefinition?(this._geometry=w.fromJSON(C.convertToGeometry(this._geometry,this._optimizedGeomDefinition.geometryType,this._optimizedGeomDefinition.hasZ,this._optimizedGeomDefinition.hasM)), |
|
this._geometry.spatialReference=this._optimizedGeomDefinition.spatialReference):this._geometry=w.fromJSON(this._geometry);return this._geometry}field(f){this._fieldTypesFixed||this._fixFieldTypes();var m=this.attributes[f];if(void 0!==m)return m;m=f.toLowerCase();for(const r in this.attributes)if(r.toLowerCase()===m)return this.attributes[r];if(this._hasFieldDefinition(m))return null;throw new c.ArcadeExecutionError(null,c.ExecutionErrorCodes.FieldNotFound,null,{key:f});}_hasFieldDefinition(f){if(null=== |
|
this._layer)return!1;for(let m=0;m<this._layer.fields.length;m++)if(this._layer.fields[m].name.toLowerCase()===f)return!0;return!1}setField(f,m){if(this.immutable)throw new c.ArcadeExecutionError(null,c.ExecutionErrorCodes.Immutable,null);m instanceof Date&&(m=this.isUnknownDateTimeField(f)?D.ArcadeDate.unknownDateJSToArcadeDate(m):D.ArcadeDate.dateJSToArcadeDate(m));if(!1===b.isSimpleType(m))throw new c.ArcadeExecutionError(null,c.ExecutionErrorCodes.TypeNotAllowedInFeature,null);const r=f.toLowerCase(); |
|
if(void 0===this.attributes[f])for(const n in this.attributes)if(n.toLowerCase()===r){this.attributes[n]=m;return}this.attributes[f]=m}hasField(f){const m=f.toLowerCase();if(void 0!==this.attributes[f])return!0;for(const r in this.attributes)if(r.toLowerCase()===m)return!0;return this._hasFieldDefinition(m)?!0:!1}keys(){let f=[];const m={};for(var r in this.attributes)f.push(r),m[r.toLowerCase()]=1;if(null!==this._layer)for(r=0;r<this._layer.fields.length;r++){const n=this._layer.fields[r];1!==m[n.name.toLowerCase()]&& |
|
f.push(n.name)}return f=f.sort()}static parseGeometryFromDictionary(f,m){f=A._convertDictionaryToJson(f,!0);void 0!==f.hasm&&(f.hasM=f.hasm,delete f.hasm);void 0!==f.hasz&&(f.hasZ=f.hasz,delete f.hasz);void 0!==f.spatialreference&&(f.spatialReference=f.spatialreference,delete f.spatialreference);f.spatialReference||(f.spatialReference=m);void 0!==f.rings&&(f.rings=this._fixPathArrays(f.rings,!0===f.hasZ,!0===f.hasZ));void 0!==f.paths&&(f.paths=this._fixPathArrays(f.paths,!0===f.hasZ,!0===f.hasM)); |
|
void 0!==f.points&&(f.points=this._fixPointArrays(f.points,!0===f.hasZ,!0===f.hasM));return w.fromJSON(f)}static _fixPathArrays(f,m,r){const n=[];if(Array.isArray(f))for(var g=0;g<f.length;g++)n.push(this._fixPointArrays(f[g],m,r));else if(f instanceof y)for(g=0;g<f.length();g++)n.push(this._fixPointArrays(f.get(g),m,r));return n}static _fixPointArrays(f,m,r){const n=[];if(Array.isArray(f))for(var g=0;g<f.length;g++){var l=f[g];l instanceof k?m&&r?n.push([l.x,l.y,l.z,l.m]):m?n.push([l.x,l.y,l.z]): |
|
r?n.push([l.x,l.y,l.m]):n.push([l.x,l.y]):l instanceof y?n.push(l.toArray()):n.push(l)}else if(f instanceof y)for(g=0;g<f.length();g++)l=f.get(g),l instanceof k?m&&r?n.push([l.x,l.y,l.z,l.m]):m?n.push([l.x,l.y,l.z]):r?n.push([l.x,l.y,l.m]):n.push([l.x,l.y]):l instanceof y?n.push(l.toArray()):n.push(l);return n}static _convertDictionaryToJson(f,m=!1){const r={};for(const n in f.attributes){let g=f.attributes[n];g instanceof E&&(g=A._convertDictionaryToJson(g));m?r[n.toLowerCase()]=g:r[n]=g}return r}static parseAttributesFromDictionary(f){const m= |
|
{};for(const r in f.attributes){const n=f.attributes[r];if(b.isSimpleType(n))m[r]=n;else throw new c.ArcadeExecutionError(null,c.ExecutionErrorCodes.InvalidParameter,null);}return m}static fromJson(f,m){let r=null;null!==f.geometry&&void 0!==f.geometry&&(r=w.fromJSON(f.geometry));const n={};if(null!==f.attributes&&void 0!==f.attributes)for(const g in f.attributes){const l=f.attributes[g];if(null===l)n[g]=l;else if(b.isString(l)||b.isNumber(l)||b.isBoolean(l)||b.isDate(l)||b.isTime(l)||b.isDateOnly(l))n[g]= |
|
l;else throw new c.ArcadeExecutionError(null,c.ExecutionErrorCodes.InvalidParameter,null);}return A.createFromGraphicLikeObject(r,n,null,m??null)}fullSchema(){return this._layer}gdbVersion(){if(null===this._layer)return"";const f=this._layer.gdbVersion;return void 0===f?"":""===f&&this._layer.capabilities?.isVersioned?"SDE.DEFAULT":f}castAsJson(f){const m={attributes:{},geometry:!0===f?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null};for(const r in this.attributes){const n=this.attributes[r]; |
|
void 0!==n&&(m.attributes[r]=b.castAsJson(n,f))}return m}async castAsJsonAsync(f,m){return this.castAsJson(m)}}O.configureDeepClone(A);return A})},"esri/arcade/treeAnalysis":function(){define(["exports"],function(D){function O(A){return"string"===typeof A||A instanceof String}function E(A,f){if(A)for(const m of A)c(m,f)}function c(A,f){if(A&&!1!==f(A))switch(A.type){case "ImportDeclaration":E(A.specifiers,f);c(A.source,f);break;case "ExportNamedDeclaration":c(A.declaration,f);break;case "ArrayExpression":E(A.elements, |
|
f);break;case "AssignmentExpression":case "BinaryExpression":c(A.left,f);c(A.right,f);break;case "BlockStatement":E(A.body,f);break;case "Program":E(A.body,f);break;case "CallExpression":c(A.callee,f);E(A.arguments,f);break;case "ExpressionStatement":c(A.expression,f);break;case "ForInStatement":c(A.left,f);c(A.right,f);c(A.body,f);break;case "ForStatement":c(A.init,f);c(A.test,f);c(A.update,f);c(A.body,f);break;case "WhileStatement":c(A.test,f);c(A.body,f);break;case "FunctionDeclaration":c(A.id, |
|
f);E(A.params,f);c(A.body,f);break;case "IfStatement":c(A.test,f);c(A.consequent,f);c(A.alternate,f);break;case "LogicalExpression":c(A.left,f);c(A.right,f);break;case "MemberExpression":c(A.object,f);c(A.property,f);break;case "ObjectExpression":E(A.properties,f);break;case "Property":c(A.key,f);c(A.value,f);break;case "ReturnStatement":c(A.argument,f);break;case "UnaryExpression":c(A.argument,f);break;case "UpdateExpression":c(A.argument,f);break;case "VariableDeclaration":E(A.declarations,f);break; |
|
case "VariableDeclarator":c(A.id,f);c(A.init,f);break;case "TemplateLiteral":E(A.expressions,f),E(A.quasis,f)}}function y(A,f){let m=!1;const r=f.toLowerCase();c(A,n=>{if(m)return!1;"Identifier"===n.type&&n.name&&n.name.toLowerCase()===r&&(m=!0);return!0});return m}function b(A){const f=[];c(A,m=>{"ImportDeclaration"===m.type&&m.source&&m.source.value&&f.push({libname:m.specifiers[0].local.name.toLowerCase(),source:m.source.value});return!0});return f}function q(A){const f=[];c(A,m=>{"CallExpression"=== |
|
m.type&&"Identifier"===m.callee.type&&f.push(m.callee.name.toLowerCase());return!0});return f}const F={all:{min:2,max:2},time:{min:0,max:4},dateonly:{min:0,max:3},getenvironment:{min:0,max:0},none:{min:2,max:2},any:{min:2,max:2},reduce:{min:2,max:3},map:{min:2,max:2},filter:{min:2,max:2},fromcodepoint:{min:1,max:-1},fromcharcode:{min:1,max:-1},tocodepoint:{min:1,max:2},tocharcode:{min:1,max:2},concatenate:{min:0,max:-1},expects:{min:1,max:-1},getfeatureset:{min:1,max:2},week:{min:1,max:2},fromjson:{min:1, |
|
max:1},length3d:{min:1,max:2},tohex:{min:1,max:1},hash:{min:1,max:1},timezone:{min:1,max:1},timezoneoffset:{min:1,max:1},changetimezone:{min:2,max:2},isoweek:{min:1,max:1},isoweekday:{min:1,max:1},hasvalue:{min:2,max:2},isomonth:{min:1,max:1},isoyear:{min:1,max:1},resize:{min:2,max:3},slice:{min:0,max:-1},splice:{min:0,max:-1},push:{min:2,max:2},pop:{min:1,max:1},includes:{min:2,max:2},array:{min:0,max:2},front:{min:1,max:1},back:{min:1,max:1},insert:{min:3,max:3},erase:{min:2,max:2},split:{min:2, |
|
max:4},guid:{min:0,max:1},standardizeguid:{min:2,max:2},today:{min:0,max:0},angle:{min:2,max:3},bearing:{min:2,max:3},urlencode:{min:1,max:1},now:{min:0,max:0},timestamp:{min:0,max:0},day:{min:1,max:1},month:{min:1,max:1},year:{min:1,max:1},hour:{min:1,max:1},second:{min:1,max:1},millisecond:{min:1,max:1},minute:{min:1,max:1},weekday:{min:1,max:1},toutc:{min:1,max:1},tolocal:{min:1,max:1},date:{min:0,max:8},datediff:{min:2,max:4},dateadd:{min:2,max:3},trim:{min:1,max:1},text:{min:1,max:2},left:{min:2, |
|
max:2},right:{min:2,max:2},mid:{min:2,max:3},upper:{min:1,max:1},proper:{min:1,max:2},lower:{min:1,max:1},find:{min:2,max:3},iif:{min:3,max:3},decode:{min:2,max:-1},when:{min:2,max:-1},defaultvalue:{min:2,max:3},isempty:{min:1,max:1},domaincode:{min:2,max:4},domainname:{min:2,max:4},polygon:{min:1,max:1},point:{min:1,max:1},polyline:{min:1,max:1},extent:{min:1,max:1},multipoint:{min:1,max:1},ringisclockwise:{min:1,max:1},geometry:{min:1,max:1},count:{min:0,max:-1},number:{min:1,max:2},acos:{min:1, |
|
max:1},asin:{min:1,max:1},atan:{min:1,max:1},atan2:{min:2,max:2},ceil:{min:1,max:2},floor:{min:1,max:2},round:{min:1,max:2},cos:{min:1,max:1},exp:{min:1,max:1},log:{min:1,max:1},min:{min:0,max:-1},constrain:{min:3,max:3},console:{min:0,max:-1},max:{min:0,max:-1},pow:{min:2,max:2},random:{min:0,max:0},sqrt:{min:1,max:1},sin:{min:1,max:1},tan:{min:1,max:1},abs:{min:1,max:1},isnan:{min:1,max:1},stdev:{min:0,max:-1},average:{min:0,max:-1},mean:{min:0,max:-1},sum:{min:0,max:-1},variance:{min:0,max:-1}, |
|
distinct:{min:0,max:-1},first:{min:1,max:1},top:{min:2,max:2},boolean:{min:1,max:1},dictionary:{min:0,max:-1},typeof:{min:1,max:1},reverse:{min:1,max:1},replace:{min:3,max:4},sort:{min:1,max:2},feature:{min:1,max:-1},haskey:{min:2,max:2},indexof:{min:2,max:2},disjoint:{min:2,max:2},intersects:{min:2,max:2},touches:{min:2,max:2},crosses:{min:2,max:2},within:{min:2,max:2},contains:{min:2,max:2},overlaps:{min:2,max:2},equals:{min:2,max:2},relate:{min:3,max:3},intersection:{min:2,max:2},union:{min:1, |
|
max:2},difference:{min:2,max:2},symmetricdifference:{min:2,max:2},clip:{min:2,max:2},cut:{min:2,max:2},area:{min:1,max:2},areageodetic:{min:1,max:2},length:{min:1,max:2},lengthgeodetic:{min:1,max:2},distancegeodetic:{min:2,max:3},distance:{min:2,max:3},densify:{min:2,max:3},densifygeodetic:{min:2,max:3},generalize:{min:2,max:4},buffer:{min:2,max:3},buffergeodetic:{min:2,max:3},offset:{min:2,max:6},rotate:{min:2,max:3},issimple:{min:1,max:1},simplify:{min:1,max:1},convexhull:{min:1,max:1},centroid:{min:1, |
|
max:1},nearestcoordinate:{min:2,max:2},nearestvertex:{min:2,max:2},isselfintersecting:{min:1,max:1},multiparttosinglepart:{min:1,max:1},setgeometry:{min:2,max:2},portal:{min:1,max:1},getuser:{min:0,max:2},subtypes:{min:1,max:1},subtypecode:{min:1,max:1},subtypename:{min:1,max:1},domain:{min:2,max:3},convertdirection:{min:3,max:3},sqltimestamp:{min:1,max:3},schema:{min:1,max:1},measuretocoordinate:{min:2,max:2},distancetocoordinate:{min:2,max:2},pointtocoordinate:{min:2,max:2}},d={functionDefinitions:new Map, |
|
constantDefinitions:new Map},k={functionDefinitions:new Map,constantDefinitions:new Map};for(var w of["pi","infinity"])k.constantDefinitions.set(w,{type:"constant"}),d.constantDefinitions.set(w,{type:"constant"});k.constantDefinitions.set("textformatting",{type:"namespace",key:"textformatting",members:[{key:"backwardslash",type:"constant"},{key:"doublequote",type:"constant"},{key:"forwardslash",type:"constant"},{key:"tab",type:"constant"},{key:"singlequote",type:"constant"},{key:"newline",type:"constant"}]}); |
|
d.constantDefinitions.set("textformatting",{type:"namespace",key:"textformatting",members:[{key:"backwardslash",type:"constant"},{key:"tab",type:"constant"},{key:"singlequote",type:"constant"},{key:"doublequote",type:"constant"},{key:"forwardslash",type:"constant"},{key:"newline",type:"constant"}]});for(const A in F)w=F[A],k.functionDefinitions.set(A,{overloads:[{type:"function",parametersInfo:{min:w.min,max:w.max}}]}),d.functionDefinitions.set(A,{overloads:[{type:"function",parametersInfo:{min:w.min, |
|
max:w.max}}]});const C=new Set("featureset featuresetbyid featuresetbyname featuresetbyassociation featuresetbyrelationshipname featuresetbyurl getfeatureset getuser attachments featuresetbyportalitem getfeaturesetinfo filterbysubtypecode knowledgegraphbyportalitem querygraph".split(" ")),M=new Set("disjoint intersects touches crosses within contains overlaps equals relate intersection nearestvertex nearestcoordinate union difference symmetricdifference clip cut area areageodetic length length3d lengthgeodetic distance distancegeodetic densify densifygeodetic generalize buffer buffergeodetic offset rotate issimple convexhull simplify multiparttosinglepart pointtocoordinate distancetocoordinate measuretocoordinate".split(" ")); |
|
D.addFunctionDeclaration=function(A,f){f="sync"===f?d:k;f.functionDefinitions.has(A.name.toLowerCase())?f.functionDefinitions.get(A.name.toLowerCase())?.overloads.push({type:"function",parametersInfo:{min:A.min,max:A.max}}):f.functionDefinitions.set(A.name.toLowerCase(),{overloads:[{type:"function",parametersInfo:{min:A.min,max:A.max}}]})};D.extractFunctionDeclaration=function(A,f){const m=[];if(void 0!==f.params&&null!==f.params)for(let r=0;r<f.params.length;r++)m.push("any");return{name:A,return:"any", |
|
params:m}};D.findExpectedFieldLiterals=function(A){const f=[];c(A,m=>{if("CallExpression"===m.type){if("Identifier"===m.callee.type&&"expects"===m.callee.name.toLowerCase()){var r="";for(let n=0;n<(m.arguments||[]).length;n++)0===n?"Identifier"===m.arguments[n].type&&(r=m.arguments[n].name.toLowerCase()):r&&"Literal"===m.arguments[n].type&&O(m.arguments[n].value)&&f.push(r+"."+m.arguments[n].value.toLowerCase());return!1}if("Identifier"===m.callee.type&&["domainname","domaincode","domain","haskey"].includes(m.callee.name.toLowerCase())&& |
|
2<=m.arguments.length)return r="","Identifier"===m.arguments[0].type&&(r=m.arguments[0].name.toLowerCase()),r&&"Literal"===m.arguments[1].type&&O(m.arguments[1].value)&&f.push(r+"."+m.arguments[1].value.toLowerCase()),!1}if("MemberExpression"!==m.type||"Identifier"!==m.object.type)return!0;!1===m.computed&&m.object&&m.object.name&&m.property&&"Identifier"===m.property.type&&m.property.name?f.push(m.object.name.toLowerCase()+"."+m.property.name.toLowerCase()):m.object&&m.object.name&&m.property&&"Literal"=== |
|
m.property.type&&"string"===typeof m.property.value&&f.push(m.object.name.toLowerCase()+"."+m.property.value?.toString().toLowerCase());return!1});return f};D.findFieldLiterals=function(A){const f=[];c(A,m=>{if("MemberExpression"!==m.type||"Identifier"!==m.object.type)return!0;!1===m.computed&&m.object&&m.object.name&&m.property&&"Identifier"===m.property.type&&m.property.name?f.push(m.object.name.toLowerCase()+"."+m.property.name.toLowerCase()):m.object&&m.object.name&&m.property&&"Literal"===m.property.type&& |
|
"string"===typeof m.property.value&&f.push(m.object.name.toLowerCase()+"."+m.property.value?.toString().toLowerCase());return!1});return f};D.findFunctionCalls=q;D.findModuleImports=b;D.findScriptDependencies=function(A,f=[]){let m=null;if(void 0===A.usesFeatureSet){null===m&&(m=q(A));A.usesFeatureSet=!1;for(let r=0;r<m.length;r++)C.has(m[r])&&(A.usesFeatureSet=!0,A.isAsync=!0);if(!1===A.usesFeatureSet&&f&&0<f.length)for(const r of f)if(y(A,r)){A.usesFeatureSet=!0;A.isAsync=!0;break}}void 0===A.usesModules&& |
|
(A.usesModules=!1,0<b(A).length&&(A.usesModules=!0));if(void 0===A.usesGeometry)for(A.usesGeometry=!1,null===m&&(m=q(A)),f=0;f<m.length;f++)M.has(m[f])&&(A.usesGeometry=!0)};D.fullArcadeApiAsync=k;D.fullArcadeApiSync=d;D.referencesFunction=function(A,f){let m=!1;const r=f.toLowerCase();c(A,n=>m?!1:"CallExpression"===n.type&&"Identifier"===n.callee.type&&n.callee.name&&n.callee.name.toLowerCase()===r?(m=!0,!1):!0);return m};D.referencesMember=y;D.scriptUsesFeatureSet=function(A){A=q(A);for(let f=0;f< |
|
A.length;f++)if(C.has(A[f]))return!0;return!1};D.walk=c;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/array":function(){define("exports ../arcade/deepClone ../arcade/executionError ../arcade/ImmutableArray ./languageUtils ../core/promiseUtils".split(" "),function(D,O,E,c,y,b){function q(d){function k(f,m,r){if(f instanceof c)return f.toArray();if(y.isArray(f))return f;throw new E.ArcadeExecutionError(m,E.ExecutionErrorCodes.InvalidParameter,r);}function w(f,m){var r= |
|
f.length,n=Math.floor(r/2);if(0===r)return[];if(1===r)return[f[0]];var g=w(f.slice(0,n),m);f=w(f.slice(n,r),m);for(r=[];0<g.length||0<f.length;)0<g.length&&0<f.length?(n=m(g[0],f[0]),isNaN(n)&&(n=0),0>=n?(r.push(g[0]),g=g.slice(1)):(r.push(f[0]),f=f.slice(1))):0<g.length?(r.push(g[0]),g=g.slice(1)):0<f.length&&(r.push(f[0]),f=f.slice(1));return r}async function C(f,m){const r=f.length,n=Math.floor(r/2);if(0===r)return[];if(1===r)return[f[0]];f=[await C(f.slice(0,n),m),await C(f.slice(n,r),m)];return M(f[0], |
|
f[1],m,[])}async function M(f,m,r,n){if(0<f.length||0<m.length){if(0<f.length&&0<m.length){let g=await r(f[0],m[0]);isNaN(g)&&(g=1);0>=g?(n.push(f[0]),f=f.slice(1)):(n.push(m[0]),m=m.slice(1));return M(f,m,r,n)}if(0<f.length)return n.push(f[0]),f=f.slice(1),M(f,m,r,n);n.push(m[0]);m=m.slice(1);return M(f,m,r,n)}return n}function A(f,m,r,n){y.pcCheck(r,1,2,f,m);let g=r[0];y.isImmutableArray(g)&&(g=g.toArray());if(!1===y.isArray(g))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter, |
|
m);if(1<r.length){if(!1===y.isFunctionParameter(r[1]))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);var l=g;const z=r[1].createFunction(f);return n?C(l,z):l=w(l,(G,a)=>z(G,a))}f=g;if(0===f.length)return[];r={};for(n=0;n<f.length;n++)m=y.getType(f[n]),""!==m&&(r[m]=!0);if(!0===r.Array||!0===r.Dictionary||!0===r.Feature||!0===r.Point||!0===r.Polygon||!0===r.Polyline||!0===r.Multipoint||!0===r.Extent||!0===r.Function)return f.slice(0);n=0;m="";for(l in r)n++,m=l;return f= |
|
1<n||"String"===m?w(f,(z,G)=>{if(null===z||void 0===z||z===y.voidOperation)return null===G||void 0===G||G===y.voidOperation?0:1;if(null===G||void 0===G||G===y.voidOperation)return-1;z=y.toString(z);G=y.toString(G);return z<G?-1:z===G?0:1}):"Number"===m?w(f,(z,G)=>z-G):"Boolean"===m?w(f,(z,G)=>z===G?0:G?-1:1):"Date"===m?w(f,(z,G)=>G-z):f.slice(0)}d.functions.array=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,0,2,f,m);if(0===g.length||1===g.length&&null===g[0])return[];if(y.isArray(g[0])){if(2=== |
|
g.length&&!1===y.isBoolean(g[1]))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);return!0===y.defaultUndefined(g[1],!1)?O.deepClone(g[0]):g[0].slice(0)}if(y.isImmutableArray(g[0])){if(2===g.length&&!1===y.isBoolean(g[1]))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);return!0===y.defaultUndefined(g[1],!1)?O.deepClone(g[0]):g[0].toArray().slice(0)}r=y.toNumber(g[0]);if(isNaN(r)||!1===y.isInteger(r))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter, |
|
m);g=y.defaultUndefined(g[1],null);r=Array(r);r.fill(g);return r})};d.functions.front=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,1,1,f,m);if(y.isImmutableArray(g[0])){if(0>=g[0].length())throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.OutOfBounds,m);return g[0].get(0)}if(y.isArray(g[0])){if(0>=g[0].length)throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.OutOfBounds,m);return g[0][0]}throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m); |
|
})};d.functions.back=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,1,1,f,m);if(y.isImmutableArray(g[0])){if(0>=g[0].length())throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.OutOfBounds,m);return g[0].get(g[0].length()-1)}if(y.isArray(g[0])){if(0>=g[0].length)throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.OutOfBounds,m);return g[0][g[0].length-1]}throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);})};d.functions.push=function(f,m){return d.standardFunction(f, |
|
m,(r,n,g)=>{y.pcCheck(g,1,2,f,m);if(y.isArray(g[0]))return g[0][g[0].length]=g[1],g[0].length;throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);})};d.functions.pop=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,1,1,f,m);if(y.isArray(g[0])){if(0>=g[0].length)throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.OutOfBounds,m);r=g[0][g[0].length-1];--g[0].length;return r}throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);})}; |
|
d.functions.erase=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,2,f,m);if(y.isArray(g[0])){r=y.toNumber(g[1]);if(isNaN(r)||!1===y.isInteger(r))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);g=g[0];if(0>=g.length)throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.OutOfBounds,m);0>r&&(r=g.length+r);if(0>r)throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.OutOfBounds,m);if(r>=g.length)throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.OutOfBounds, |
|
m);g.splice(r,1);return y.voidOperation}throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);})};d.functions.insert=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,3,3,f,m);if(y.isArray(g[0])){r=y.toNumber(g[1]);if(isNaN(r)||!1===y.isInteger(r))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);n=g[2];g=g[0];if(r>g.length)throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.OutOfBounds,m);if(0>r&&r<-1*g.length)throw new E.ArcadeExecutionError(f, |
|
E.ExecutionErrorCodes.OutOfBounds,m);if(r===g.length)return g[r]=n,y.voidOperation;g.splice(r,0,n);return y.voidOperation}throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);})};d.functions.resize=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,3,f,m);if(y.isArray(g[0])){n=y.toNumber(g[1]);if(isNaN(n)||!1===y.isInteger(n))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);if(0>n)throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter, |
|
m);r=y.defaultUndefined(g[2],null);g=g[0];if(g.length>=n)return g.length=n,y.voidOperation;const l=g.length;g.length=n;for(n=l;n<g.length;n++)g[n]=r;return y.voidOperation}throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);})};d.functions.includes=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,2,f,m);if(y.isArray(g[0])){const l=g[1];return-1<g[0].findIndex(z=>y.equalityTest(z,l))?!0:!1}if(y.isImmutableArray(g[0])){const l=g[1];return-1<g[0].toArray().findIndex(z=> |
|
y.equalityTest(z,l))?!0:!1}throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);})};d.functions.slice=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,1,3,f,m);if(y.isArray(g[0])){r=y.toNumber(y.defaultUndefined(g[1],0));n=y.toNumber(y.defaultUndefined(g[2],g[0].length));if(isNaN(r)||!1===y.isInteger(r))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);if(isNaN(n)||!1===y.isInteger(n))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter, |
|
m);return g[0].slice(r,n)}if(y.isImmutableArray(g[0])){r=g[0];n=y.toNumber(y.defaultUndefined(g[1],0));g=y.toNumber(y.defaultUndefined(g[2],r.length()));if(isNaN(n)||!1===y.isInteger(n))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);if(isNaN(g)||!1===y.isInteger(g))throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);return r.toArray().slice(n,g)}throw new E.ArcadeExecutionError(f,E.ExecutionErrorCodes.InvalidParameter,m);})};d.functions.splice= |
|
function(f,m){return d.standardFunction(f,m,(r,n,g)=>{r=[];for(n=0;n<g.length;n++)y.isArray(g[n])?r.push(...g[n]):y.isImmutableArray(g[n])?r.push(...g[n].toArray()):r.push(g[n]);return r})};d.functions.top=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,2,f,m);if(y.isArray(g[0]))return y.toNumber(g[1])>=g[0].length?g[0].slice(0):g[0].slice(0,y.toNumber(g[1]));if(y.isImmutableArray(g[0]))return y.toNumber(g[1])>=g[0].length()?g[0].slice(0):g[0].slice(0,y.toNumber(g[1]));throw new E.ArcadeExecutionError(f, |
|
E.ExecutionErrorCodes.InvalidParameter,m);})};d.functions.first=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,1,1,f,m);return y.isArray(g[0])?0===g[0].length?null:g[0][0]:y.isImmutableArray(g[0])?0===g[0].length()?null:g[0].get(0):null})};"sync"===d.mode&&(d.functions.sort=function(f,m){return d.standardFunction(f,m,(r,n,g)=>A(f,n,g,!1))},d.functions.any=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);n=k(g[0],f,n);for(const l of n)if(n= |
|
r(l),y.isBoolean(n)&&!0===n)return!0;return!1})},d.functions.all=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);n=k(g[0],f,n);for(const l of n)if(!0!==r(l))return!1;return!0})},d.functions.none=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);n=k(g[0],f,n);for(const l of n)if(!0===r(l))return!1;return!0})},d.functions.reduce=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,3, |
|
f,n);const l=g[1].createFunction(f);r=k(g[0],f,n);return 2===g.length?0===r.length?null:r.reduce((z,G)=>{z=l(z,G);return z=void 0!==z&&z!==y.voidOperation?z:null}):r.reduce((z,G)=>{z=l(z,G);return z=void 0!==z&&z!==y.voidOperation?z:null},g[2])})},d.functions.map=function(f,m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);g=k(g[0],f,n);n=[];for(const l of g)g=r(l),void 0!==g&&g!==y.voidOperation?n.push(g):n.push(null);return n})},d.functions.filter=function(f, |
|
m){return d.standardFunction(f,m,(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);n=k(g[0],f,n);g=[];for(const l of n)!0===r(l)&&g.push(l);return g})});"async"===d.mode&&(d.functions.sort=function(f,m){return d.standardFunctionAsync(f,m,async(r,n,g)=>A(f,n,g,!0))},d.functions.any=function(f,m){return d.standardFunctionAsync(f,m,async(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);n=k(g[0],f,n);for(const l of n)if(n=await r(l),g=null,g=b.isPromiseLike(g)?await n:n,y.isBoolean(g)&&!0=== |
|
g)return!0;return!1})},d.functions.all=function(f,m){return d.standardFunctionAsync(f,m,async(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);n=k(g[0],f,n);for(const l of n)if(n=await r(l),g=null,g=b.isPromiseLike(g)?await n:n,!0!==g)return!1;return!0})},d.functions.none=function(f,m){return d.standardFunctionAsync(f,m,async(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);n=k(g[0],f,n);for(const l of n)if(n=await r(l),g=null,g=b.isPromiseLike(g)?await n:n,!0===g)return!1;return!0})}, |
|
d.functions.filter=function(f,m){return d.standardFunctionAsync(f,m,async(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);g=k(g[0],f,n);n=[];for(const l of g){g=await r(l);let z=null;z=b.isPromiseLike(z)?await g:g;!0===z&&n.push(l)}return n})},d.functions.reduce=function(f,m){return d.standardFunctionAsync(f,m,async(r,n,g)=>{y.pcCheck(g,2,3,f,n);const l=g[1].createFunction(f);r=k(g[0],f,n);if(2<g.length)g=y.defaultUndefined(g[2],null),g=r.reduce(async(z,G)=>{z=await z;if(void 0===z||z===y.voidOperation)z= |
|
null;return l(z,G)},Promise.resolve(g));else{if(0===r.length)return null;g=r.reduce(async(z,G,a)=>{if(1>=a)return l(z,G);z=await z;if(void 0===z||z===y.voidOperation)z=null;return l(z,G)})}return g.then(z=>void 0!==z&&z!==y.voidOperation?z:null)})},d.functions.map=function(f,m){return d.standardFunctionAsync(f,m,async(r,n,g)=>{y.pcCheck(g,2,2,f,n);r=g[1].createFunction(f);g=k(g[0],f,n);n=[];for(const l of g){g=await r(l);let z=null;z=b.isPromiseLike(z)?await g:g;void 0!==z&&z!==y.voidOperation?n.push(z): |
|
n.push(null)}return n})})}const F=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:q},Symbol.toStringTag,{value:"Module"}));D.ArrayFunctions=F;D.registerFunctions=q})},"esri/arcade/functions/date":function(){define("exports ../ArcadeDate ../executionError ../../chunks/languageUtils ../../core/sql/DateOnly ../../core/sql/TimeOnly ../../intl/locale ../../chunks/datetime".split(" "),function(D,O,E,c,y,b,q,F){function d(A){return null===A?A:!1===A.isValid?null:A}function k(A,f){return""=== |
|
A||"default"===A.toLowerCase().trim()?c.defaultTimeZone(f):"z"===A||"Z"===A?"UTC":A}function w(A,f){return c.isDateOnly(A)?A.toArcadeDate():c.toDate(A,c.defaultTimeZone(f))}const C=[0,31,59,90,120,151,181,212,243,273,304,334],M=[0,31,60,91,121,152,182,213,244,274,305,335];D.registerFunctions=function(A,f){A.today=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,0,0,m,r);n=new Date;n.setHours(0,0,0,0);return O.ArcadeDate.dateJSAndZoneToArcadeDate(n,c.defaultTimeZone(m))})};A.time=function(m,r){return f(m, |
|
r,(n,g,l)=>{c.pcCheck(l,0,4,m,r);switch(l.length){case 0:return n=O.ArcadeDate.nowToArcadeDate(c.defaultTimeZone(m)),new b.TimeOnly(n.hour,n.minute,n.second,n.millisecond);case 1:if(c.isTime(l[0]))return l[0].clone();if(c.isDate(l[0]))return new b.TimeOnly(l[0].hour,l[0].minute,l[0].second,l[0].millisecond);if(c.isDateOnly(l[0]))return new b.TimeOnly(0,0,0,0);if(c.isString(l[0]))return b.TimeOnly.fromString(l[0]);n=c.toNumber(l[0]);return!1===isNaN(n)?b.TimeOnly.fromMilliseconds(n):null;case 2:return c.isString(l[0])&& |
|
c.isString(l[1])?b.TimeOnly.fromString(l[0],l[1]):b.TimeOnly.fromParts(c.toNumber(l[0]),c.toNumber(l[1]),0,0);case 3:return b.TimeOnly.fromParts(c.toNumber(l[0]),c.toNumber(l[1]),c.toNumber(l[2]),0);case 4:return b.TimeOnly.fromParts(c.toNumber(l[0]),c.toNumber(l[1]),c.toNumber(l[2]),c.toNumber(l[3]))}throw new E.ArcadeExecutionError(m,E.ExecutionErrorCodes.InvalidParameter,r);})};A.dateonly=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,0,3,m,r);if(3===l.length)return y.DateOnly.fromParts(c.toNumber(l[0]), |
|
c.toNumber(l[1])+1,c.toNumber(l[2]));if(2===l.length)return n=c.toString(l[1]),""===n?null:"X"===n?y.DateOnly.fromSeconds(c.toNumber(l[0])):"x"===n?y.DateOnly.fromMilliseconds(c.toNumber(l[0])):y.DateOnly.fromString(c.toString(l[0]),n);if(1===l.length){if(c.isString(l[0])){if(""===l[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))return null;if(!0===/^[0-9][0-9][0-9][0-9]$/.test(l[0]))return y.DateOnly.fromString(l[0]+"-01-01")}if(c.isDateOnly(l[0]))return l[0].clone();if(c.isDate(l[0]))return y.DateOnly.fromParts(l[0].year, |
|
l[0].monthJS+1,l[0].day);n=c.toNumber(l[0]);return!1===isNaN(n)?y.DateOnly.fromMilliseconds(n):c.isString(l[0])?y.DateOnly.fromString(l[0]):null}return 0===l.length?(l=O.ArcadeDate.nowToArcadeDate(c.defaultTimeZone(m)),!1===l.isValid?null:y.DateOnly.fromParts(l.year,l.monthJS+1,l.day)):null})};A.changetimezone=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,2,2,m,r);if(null===l[0])return null;if(c.isDateOnly(l[0]))throw new E.ArcadeExecutionError(m,E.ExecutionErrorCodes.CannotChangeTimeZoneDateOnly, |
|
r);if(c.isDateOnly(l[0]))throw new E.ArcadeExecutionError(m,E.ExecutionErrorCodes.CannotChangeTimeZoneTime,r);n=c.toDate(l[0],c.defaultTimeZone(m));if(null===n)throw new E.ArcadeExecutionError(m,E.ExecutionErrorCodes.InvalidParameter,r);l=O.createDateTimeZone(k(c.toString(l[1]),m),!1);if(null===l)return null;l=O.ArcadeDate.arcadeDateAndZoneToArcadeDate(n,l);return!1===l.isValid?null:l})};A.timezone=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,2,m,r);if(c.isTime(l[0])||c.isDateOnly(l[0]))return"Unknown"; |
|
n=c.toDate(l[0],c.defaultTimeZone(m));if(null===n)return null;n=n.timeZone;return"system"===n?O.ArcadeDate.systemTimeZoneCanonicalName:"utc"===n.toLowerCase()?"UTC":"unknown"===n.toLowerCase()?"Unknown":n})};A.timezoneoffset=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=c.toDate(l[0],c.defaultTimeZone(m));return null===n?null:6E4*n.timeZoneOffset})};A.now=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,0,0,m,r);n=O.ArcadeDate.nowToArcadeDate(c.defaultTimeZone(m));return!1===n.isValid? |
|
null:n})};A.timestamp=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,0,0,m,r);n=O.ArcadeDate.nowUTCToArcadeDate();return!1===n.isValid?null:n})};A.toutc=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=c.toDate(l[0],c.defaultTimeZone(m));return null===n?null:n.toUTC()})};A.tolocal=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=c.toDate(l[0],c.defaultTimeZone(m));return null===n?null:n.toLocal()})};A.day=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=w(l[0],c.defaultTimeZone(m)); |
|
return null===n?NaN:n.day})};A.month=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=w(l[0],c.defaultTimeZone(m));return null===n?NaN:n.monthJS})};A.year=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=w(l[0],c.defaultTimeZone(m));return null===n?NaN:n.year})};A.hour=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);if(c.isTime(l[0]))return l[0].hour;n=c.toDate(l[0],c.defaultTimeZone(m));return null===n?NaN:n.hour})};A.second=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l, |
|
1,1,m,r);if(c.isTime(l[0]))return l[0].second;n=c.toDate(l[0],c.defaultTimeZone(m));return null===n?NaN:n.second})};A.millisecond=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);if(c.isTime(l[0]))return l[0].millisecond;n=c.toDate(l[0],c.defaultTimeZone(m));return null===n?NaN:n.millisecond})};A.minute=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);if(c.isTime(l[0]))return l[0].minute;n=c.toDate(l[0],c.defaultTimeZone(m));return null===n?NaN:n.minute})};A.week=function(m,r){return f(m, |
|
r,(n,g,l)=>{c.pcCheck(l,1,2,m,r);g=w(l[0],c.defaultTimeZone(m));if(null===g)return NaN;l=c.toNumber(c.defaultUndefined(l[1],0));if(0>l||6<l)throw new E.ArcadeExecutionError(m,E.ExecutionErrorCodes.InvalidParameter,r);n=g.dayOfWeekJS;var z=g.year;g=g.day+(0!==z%4||0===z%100&&0!==z%400?C:M)[g.monthJS]-1;z=Math.floor(g/7);return n-l+(0>n-l?7:0)<g-7*z?z+1:z})};A.weekday=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=w(l[0],c.defaultTimeZone(m));return null===n?NaN:n.dayOfWeekJS})};A.isoweekday= |
|
function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=w(l[0],c.defaultTimeZone(m));return null===n?NaN:n.dayOfWeekISO})};A.isomonth=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=w(l[0],c.defaultTimeZone(m));return null===n?NaN:n.monthISO})};A.isoweek=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=w(l[0],c.defaultTimeZone(m));return null===n?NaN:n.weekISO})};A.isoyear=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,1,1,m,r);n=w(l[0],c.defaultTimeZone(m));return null=== |
|
n?NaN:n.yearISO})};A.date=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,0,8,m,r);if(3===l.length)return c.isDateOnly(l[0])&&c.isTime(l[1])&&c.isString(l[2])?(n=O.createDateTimeZone(k(c.toString(l[2])??"unknown",m),!1),null===n?null:d(O.ArcadeDate.fromParts(l[0].year,l[0].month,l[0].day,l[1].hour,l[1].minute,l[1].second,l[1].millisecond,n))):d(O.ArcadeDate.fromParts(c.toNumber(l[0]),c.toNumber(l[1])+1,c.toNumber(l[2]),0,0,0,0,c.defaultTimeZone(m)));if(4===l.length)return d(O.ArcadeDate.fromParts(c.toNumber(l[0]), |
|
c.toNumber(l[1])+1,c.toNumber(l[2]),c.toNumber(l[3]),0,0,0,c.defaultTimeZone(m)));if(5===l.length)return d(O.ArcadeDate.fromParts(c.toNumber(l[0]),c.toNumber(l[1])+1,c.toNumber(l[2]),c.toNumber(l[3]),c.toNumber(l[4]),0,0,c.defaultTimeZone(m)));if(6===l.length)return d(O.ArcadeDate.fromParts(c.toNumber(l[0]),c.toNumber(l[1])+1,c.toNumber(l[2]),c.toNumber(l[3]),c.toNumber(l[4]),c.toNumber(l[5]),0,c.defaultTimeZone(m)));if(7===l.length)return d(O.ArcadeDate.fromParts(c.toNumber(l[0]),c.toNumber(l[1])+ |
|
1,c.toNumber(l[2]),c.toNumber(l[3]),c.toNumber(l[4]),c.toNumber(l[5]),c.toNumber(l[6]),c.defaultTimeZone(m)));if(8===l.length)return n=O.createDateTimeZone(k(c.toString(l[7])??"unknown",m),!1),null===n?null:d(O.ArcadeDate.fromParts(c.toNumber(l[0]),c.toNumber(l[1])+1,c.toNumber(l[2]),c.toNumber(l[3]),c.toNumber(l[4]),c.toNumber(l[5]),c.toNumber(l[6]),n));if(2===l.length){if(c.isDateOnly(l[0])&&c.isString(l[1]))return n=O.createDateTimeZone(k(c.toString(l[1])??"unknown",m),!1),null===n?null:d(O.ArcadeDate.fromParts(l[0].year, |
|
l[0].month,l[0].day,0,0,0,0,n));if(c.isDateOnly(l[0])&&c.isTime(l[1]))return d(O.ArcadeDate.fromParts(l[0].year,l[0].month,l[0].day,l[1].hour,l[1].minute,l[1].second,l[1].millisecond,"unknown"));n=c.toString(l[1]);if(""===n)return null;n=c.standardiseDateFormat(n,!0);l="X"===n?F.DateTime.fromSeconds(c.toNumber(l[0])):"x"===n?F.DateTime.fromMillis(c.toNumber(l[0])):F.DateTime.fromFormat(c.toString(l[0]),n,{locale:q.getLocale(),numberingSystem:"latn"});return l.isValid?O.ArcadeDate.dateTimeToArcadeDate(l): |
|
null}if(1===l.length){if(c.isDateOnly(l[0]))return d(O.ArcadeDate.fromParts(l[0].year,l[0].month,l[0].day,0,0,0,0,"unknown"));if(c.isString(l[0])){if(""===l[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))return null;if(!0===/^[0-9][0-9][0-9][0-9]$/.test(l[0]))return c.toDate(l[0]+"-01-01",c.defaultTimeZone(m))}n=c.toNumber(l[0]);return!1===isNaN(n)?(l=F.DateTime.fromMillis(n),l.isValid?O.ArcadeDate.dateTimeAndZoneToArcadeDate(l,c.defaultTimeZone(m)):null):c.toDate(l[0],c.defaultTimeZone(m))}return 0=== |
|
l.length?O.ArcadeDate.nowToArcadeDate(c.defaultTimeZone(m)):null})};A.datediff=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,2,4,m,r);if(c.isTime(l[0]))return c.isTime(l[1])?l[0].difference(l[1],c.toString(l[2])):NaN;if(c.isTime(l[1]))return NaN;if(c.isDateOnly(l[0]))return c.isDateOnly(l[1])?l[0].difference(l[1],c.toString(l[2])):NaN;if(c.isDateOnly(l[1]))return NaN;n=c.toDate(l[0],c.defaultTimeZone(m));g=c.toDate(l[1],c.defaultTimeZone(m));if(null===n||null===g)return NaN;let z=c.defaultUndefined(l[3], |
|
"");""!==z&&null!==z?(z=k(c.toString(z),m),n=O.ArcadeDate.arcadeDateAndZoneToArcadeDate(n,z),g=O.ArcadeDate.arcadeDateAndZoneToArcadeDate(g,z)):n.timeZone!==g.timeZone&&(n.isUnknownTimeZone?n=O.ArcadeDate.arcadeDateAndZoneToArcadeDate(n,g.timeZone):g=O.ArcadeDate.arcadeDateAndZoneToArcadeDate(g,n.timeZone));switch(c.toString(l[2]).toLowerCase()){case "days":case "day":case "d":return n.diff(g,"days");case "months":case "month":return n.diff(g,"months");case "minutes":case "minute":case "m":return"M"=== |
|
l[2]?n.diff(g,"months"):n.diff(g,"minutes");case "seconds":case "second":case "s":return n.diff(g,"seconds");case "milliseconds":case "millisecond":case "ms":return n.diff(g);case "hours":case "hour":case "h":return n.diff(g,"hours");case "years":case "year":case "y":return n.diff(g,"years");default:return n.diff(g)}})};A.dateadd=function(m,r){return f(m,r,(n,g,l)=>{c.pcCheck(l,2,3,m,r);n=c.toNumber(l[1]);if(isNaN(n)||Infinity===n||-Infinity===n)return c.isTime(l[0])||c.isDateOnly(l[0])?l[0].clone(): |
|
c.toDate(l[0],c.defaultTimeZone(m));g="milliseconds";switch(c.toString(l[2]).toLowerCase()){case "days":case "day":case "d":g="days";n=c.isDateOnly(l[0])?n:c.absRound(n);break;case "months":case "month":g="months";n=c.isDateOnly(l[0])?n:c.absRound(n);break;case "minutes":case "minute":case "m":g="M"===l[2]?"months":"minutes";break;case "seconds":case "second":case "s":g="seconds";break;case "milliseconds":case "millisecond":case "ms":g="milliseconds";break;case "hours":case "hour":case "h":g="hours"; |
|
break;case "years":case "year":case "y":g="years"}if(c.isTime(l[0])||c.isDateOnly(l[0]))return l[0].plus(g,n);l=c.toDate(l[0],c.defaultTimeZone(m));return null===l?null:l.plus({[g]:n})})}};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/geometry":function(){define("exports ../containerUtils ../Dictionary ../executionError ../Feature ../ImmutablePointArray ../../chunks/languageUtils ./centroid ../../geometry/Extent ../../geometry/Geometry ../../geometry/Multipoint ../../geometry/Point ../../geometry/Polygon ../../geometry/Polyline ../../geometry/support/coordsUtils ../../geometry/support/jsonUtils".split(" "), |
|
function(D,O,E,c,y,b,q,F,d,k,w,C,M,A,f,m){D.registerFunctions=function(r,n){r.ringisclockwise=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,1,1,g,l);z=[];if(null===a[0])return!1;if(q.isArray(a[0]))for(const B of a[0])if(B instanceof C)z.push(B.hasZ?B.hasM?[B.x,B.y,B.z,B.m]:[B.x,B.y,B.z]:[B.x,B.y]);else throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);else if(a[0]instanceof b)z=a[0]._elements;else if(q.isImmutableArray(a[0]))for(const B of a[0].toArray())if(B instanceof |
|
C)z.push(B.hasZ?B.hasM?[B.x,B.y,B.z,B.m]:[B.x,B.y,B.z]:[B.x,B.y]);else throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);else throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);return 3>z.length?!1:f.isClockwise(z)})};r.polygon=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,1,1,g,l);if(a[0]instanceof E){if(z=q.fixSpatialReference(y.parseGeometryFromDictionary(a[0],g.spatialReference),g.spatialReference),!1===z instanceof M)throw new c.ArcadeExecutionError(g, |
|
c.ExecutionErrorCodes.InvalidParameter,l);}else a[0]instanceof M?z=m.fromJSON(a[0].toJSON()):((z=JSON.parse(a[0]))&&!z.spatialReference&&(z.spatialReference=g.spatialReference),z=q.fixSpatialReference(new M(z),g.spatialReference));if(null!==z&&!1===z.spatialReference.equals(g.spatialReference))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.WrongSpatialReference,l);return q.fixNullGeometry(z)})};r.polyline=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,1,1,g,l);if(a[0]instanceof E){if(z= |
|
q.fixSpatialReference(y.parseGeometryFromDictionary(a[0],g.spatialReference),g.spatialReference),!1===z instanceof A)throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);}else a[0]instanceof A?z=m.fromJSON(a[0].toJSON()):((z=JSON.parse(a[0]))&&!z.spatialReference&&(z.spatialReference=g.spatialReference),z=q.fixSpatialReference(new A(z),g.spatialReference));if(null!==z&&!1===z.spatialReference.equals(g.spatialReference))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.WrongSpatialReference, |
|
l);return q.fixNullGeometry(z)})};r.point=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,1,1,g,l);if(a[0]instanceof E){if(z=q.fixSpatialReference(y.parseGeometryFromDictionary(a[0],g.spatialReference),g.spatialReference),!1===z instanceof C)throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);}else a[0]instanceof C?z=m.fromJSON(a[0].toJSON()):((z=JSON.parse(a[0]))&&!z.spatialReference&&(z.spatialReference=g.spatialReference),z=q.fixSpatialReference(new C(z),g.spatialReference)); |
|
if(null!==z&&!1===z.spatialReference.equals(g.spatialReference))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.WrongSpatialReference,l);return q.fixNullGeometry(z)})};r.multipoint=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,1,1,g,l);if(a[0]instanceof E){if(z=q.fixSpatialReference(y.parseGeometryFromDictionary(a[0],g.spatialReference),g.spatialReference),!1===z instanceof w)throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);}else a[0]instanceof w?z=m.fromJSON(a[0].toJSON()): |
|
((z=JSON.parse(a[0]))&&!z.spatialReference&&(z.spatialReference=g.spatialReference),z=q.fixSpatialReference(new w(z),g.spatialReference));if(null!==z&&!1===z.spatialReference.equals(g.spatialReference))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.WrongSpatialReference,l);return q.fixNullGeometry(z)})};r.extent=function(g,l){return n(g,l,(z,G,a)=>{a=q.autoCastFeatureToGeometry(a);q.pcCheck(a,1,1,g,l);z=null;a[0]instanceof E?z=q.fixSpatialReference(y.parseGeometryFromDictionary(a[0],g.spatialReference), |
|
g.spatialReference):a[0]instanceof C?(z={xmin:a[0].x,ymin:a[0].y,xmax:a[0].x,ymax:a[0].y,spatialReference:a[0].spatialReference.toJSON()},a=a[0],a.hasZ?(z.zmin=a.z,z.zmax=a.z):a.hasM&&(z.mmin=a.m,z.mmax=a.m),z=m.fromJSON(z)):a[0]instanceof M?z=m.fromJSON(a[0].extent?.toJSON()):a[0]instanceof A?z=m.fromJSON(a[0].extent?.toJSON()):a[0]instanceof w?z=m.fromJSON(a[0].extent?.toJSON()):a[0]instanceof d?z=m.fromJSON(a[0].toJSON()):((a=JSON.parse(a[0]))&&!a.spatialReference&&(a.spatialReference=g.spatialReference), |
|
z=q.fixSpatialReference(new d(a),g.spatialReference));if(null!==z&&!1===z.spatialReference.equals(g.spatialReference))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.WrongSpatialReference,l);return q.fixNullGeometry(z)})};r.geometry=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,1,1,g,l);z=null;if(null===a[0])return null;q.isFeature(a[0])?z=q.fixSpatialReference(a[0].geometry(),g.spatialReference):a[0]instanceof E?z=q.fixSpatialReference(y.parseGeometryFromDictionary(a[0],g.spatialReference), |
|
g.spatialReference):((a=JSON.parse(a[0]))&&!a.spatialReference&&(a.spatialReference=g.spatialReference),z=q.fixSpatialReference(m.fromJSON(a),g.spatialReference));if(null!==z&&!1===z.spatialReference.equals(g.spatialReference))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.WrongSpatialReference,l);return q.fixNullGeometry(z)})};r.setgeometry=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,2,2,g,l);if(q.isFeature(a[0])){if(!0===a[0].immutable)throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.Immutable, |
|
l);if(a[1]instanceof k||null===a[1])a[0]._geometry=a[1];else throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);}else throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);return q.voidOperation})};r.feature=function(g,l){return n(g,l,(z,G,a)=>{if(0===a.length)throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.WrongNumberOfParameters,l);if(1===a.length)if(q.isString(a[0]))a=y.fromJson(JSON.parse(a[0]),g.timeZone);else if(q.isFeature(a[0]))a=y.createFromArcadeFeature(a[0]); |
|
else if(a[0]instanceof k)a=y.createFromGraphicLikeObject(a[0],null,null,g.timeZone);else if(a[0]instanceof E)z=a[0].hasField("geometry")?a[0].field("geometry"):null,a=a[0].hasField("attributes")?a[0].field("attributes"):null,null!==z&&z instanceof E&&(z=y.parseGeometryFromDictionary(z,g.spatialReference)),null!==a&&(a=y.parseAttributesFromDictionary(a)),a=y.createFromGraphicLikeObject(z,a,null,g.timeZone);else throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);else if(2=== |
|
a.length){G=z=null;if(null!==a[0])if(a[0]instanceof k)z=a[0];else if(z instanceof E)z=y.parseGeometryFromDictionary(a[0],g.spatialReference);else throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);if(null!==a[1])if(a[1]instanceof E)G=y.parseAttributesFromDictionary(a[1]);else throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);a=y.createFromGraphicLikeObject(z,G,null,g.timeZone)}else{z=null;G={};if(null!==a[0])if(a[0]instanceof k)z=a[0];else if(z instanceof |
|
E)z=y.parseGeometryFromDictionary(a[0],g.spatialReference);else throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);for(let B=1;B<a.length;B+=2){const x=q.toString(a[B]),N=a[B+1];if(null===N||void 0===N||q.isString(N)||isNaN(N)||q.isDate(N)||q.isNumber(N)||q.isTime(N)||q.isDateOnly(N)||q.isBoolean(N)){if(q.isFunctionParameter(N)||!1===q.isSimpleType(N))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);G[x]=N===q.voidOperation?null:N}else throw new c.ArcadeExecutionError(g, |
|
c.ExecutionErrorCodes.InvalidParameter,l);}a=y.createFromGraphicLikeObject(z,G,null,g.timeZone)}a._geometry=q.fixSpatialReference(a.geometry(),g.spatialReference);a.immutable=!1;return a})};r.dictionary=function(g,l){return n(g,l,(z,G,a)=>{if(0===a.length||1===a.length&&null===a[0])return a=new E,a.immutable=!1,a;if(1===a.length&&q.isString(a[0]))try{var B=JSON.parse(a[0]),x=E.convertObjectToArcadeDictionary(B,q.defaultTimeZone(g),!1);x.immutable=!1;return x}catch(N){throw new c.ArcadeExecutionError(g, |
|
c.ExecutionErrorCodes.InvalidParameter,l);}if(1===a.length&&a[0]instanceof k)try{const N=a[0].toJSON();N.hasZ=!0===a[0].hasZ;N.hasM=!0===a[0].hasM;const e=E.convertObjectToArcadeDictionary(N,q.defaultTimeZone(g),!1);e.immutable=!1;return e}catch(N){throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);}if(1===a.length&&q.isFeature(a[0]))try{const N=new E;N.immutable=!1;N.setField("geometry",a[0].geometry());const e=new E;e.immutable=!1;N.setField("attributes",e);for(const Z of a[0].keys())e.setField(Z, |
|
a[0].field(Z));return N}catch(N){throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);}if(1===a.length&&a[0]instanceof E)try{const N=new E;N.immutable=!1;for(const e of a[0].keys())N.setField(e,a[0].field(e));return N}catch(N){throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);}if(2===a.length&&a[0]instanceof E&&q.isBoolean(a[1]))try{if(!0!==a[1]){const N=new E;N.immutable=!1;for(const e of a[0].keys())N.setField(e,a[0].field(e));return N}return a[0].deepClone()}catch(N){throw new c.ArcadeExecutionError(g, |
|
c.ExecutionErrorCodes.InvalidParameter,l);}if(0!==a.length%2)throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.WrongNumberOfParameters,l);z={};for(G=0;G<a.length;G+=2)if(B=q.toString(a[G]),x=a[G+1],null===x||void 0===x||q.isString(x)||isNaN(x)||q.isDate(x)||q.isNumber(x)||q.isBoolean(x)||q.isDateOnly(x)||q.isTime(x)||q.isArray(x)||q.isImmutableArray(x)){if(q.isFunctionParameter(x))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);z[B]=x===q.voidOperation?null:x}else throw new c.ArcadeExecutionError(g, |
|
c.ExecutionErrorCodes.InvalidParameter,l);a=new E(z);a.immutable=!1;return a})};r.haskey=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,2,2,g,l);z=q.toString(a[1]);if(q.isFeature(a[0])||a[0]instanceof E)return a[0].hasField(z);if(a[0]instanceof k)return(a=O.geometryMember(a[0],z,null,null,2))&&"notfound"===a.keystate?!1:!0;throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);})};r.hasvalue=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,2,2,g,l);return null!=O.getNestedOptionalValue(a[0], |
|
a[1])})};r.indexof=function(g,l){return n(g,l,(z,G,a)=>{q.pcCheck(a,2,2,g,l);z=a[1];if(q.isArray(a[0])){for(G=0;G<a[0].length;G++)if(q.equalityTest(z,a[0][G]))return G;return-1}if(q.isImmutableArray(a[0])){G=a[0].length();for(let B=0;B<G;B++)if(q.equalityTest(z,a[0].get(B)))return B;return-1}throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);})};r.angle=function(g,l){return n(g,l,(z,G,a)=>{a=q.autoCastFeatureToGeometry(a);q.pcCheck(a,2,3,g,l);if(!(a[0]instanceof C))throw new c.ArcadeExecutionError(g, |
|
c.ExecutionErrorCodes.InvalidParameter,l);if(!(a[1]instanceof C))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);if(2<a.length&&!(a[2]instanceof C))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);return 2===a.length?F.angle2D(a[0],a[1]):F.angleBetween2D(a[0],a[1],a[2])})};r.bearing=function(g,l){return n(g,l,(z,G,a)=>{a=q.autoCastFeatureToGeometry(a);q.pcCheck(a,2,3,g,l);if(!(a[0]instanceof C))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter, |
|
l);if(!(a[1]instanceof C))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);if(2<a.length&&!(a[2]instanceof C))throw new c.ArcadeExecutionError(g,c.ExecutionErrorCodes.InvalidParameter,l);return 2===a.length?F.bearing2D(a[0],a[1]):F.bearingBetween2D(a[0],a[1],a[2])})};r.isselfintersecting=function(g,l){return n(g,l,(z,G,a)=>{a=q.autoCastFeatureToGeometry(a);q.pcCheck(a,1,1,g,l);z=a[0];if(z instanceof M)return z.isSelfIntersecting;if(z instanceof A)return F.pathsSelfIntersecting(z.paths); |
|
if(z instanceof w)for(G=z.points,a=0;a<G.length;a++)for(let B=0;B<G.length;B++)if(B!==a){let x=!0;for(let N=0;N<G[a].length;N++)if(G[a][N]!==G[B][N]){x=!1;break}if(!0===x)return!0}return q.isArray(z)||q.isImmutableArray(z)?(G=q.autoCastArrayOfPointsToPolyline(z,g.spatialReference),null!==G&&(z=G.paths),F.pathsSelfIntersecting(z)):!1})}};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/centroid":function(){define(["exports","../../core/mathUtils","../../geometry/Point", |
|
"../../geometry/support/intersectsBase"],function(D,O,E,c){function y(M,A,f){const m={x:0,y:0};A&&(m.z=0);f&&(m.m=0);let r=0;var n=M[0];for(let a=0;a<M.length;a++){const B=M[a];a:if(B.length!==n.length)var g=!1;else{for(g=0;g<B.length;g++)if(B[g]!==n[g]){g=!1;break a}g=!0}if(!1===g){g=b(n,B,A);var l=B,z=A,G=f;const x={x:(n[0]+l[0])/2,y:(n[1]+l[1])/2};z&&(x.z=(n[2]+l[2])/2);z&&G?x.m=(n[3]+l[3])/2:G&&(x.m=(n[2]+l[2])/2);n=x;n.x*=g;n.y*=g;m.x+=n.x;m.y+=n.y;A&&(n.z*=g,m.z+=n.z);f&&(n.m*=g,m.m+=n.m);r+= |
|
g;n=B}}0<r?(m.x/=r,m.y/=r,A&&(m.z/=r),f&&(m.m/=r)):(m.x=M[0][0],m.y=M[0][1],A&&(m.z=M[0][2]),f&&A?m.m=M[0][3]:f&&(m.m=M[0][2]));return m}function b(M,A,f){const m=A[0]-M[0];M=A[1]-M[1];return f?(A=A[2]-A[2],Math.sqrt(m*m+M*M+A*A)):Math.sqrt(m*m+M*M)}function q(M,A,f=0){for(;M<f;)M+=A;for(f+=A;M>=f;)M-=A;return M}function F(M,A){return Math.atan2(A.y-M.y,A.x-M.x)}function d(M,A,f){var m=M.x-A.x;M=M.y-A.y;var r=f.x-A.x;A=f.y-A.y;return Math.atan2(m*A-r*M,m*r+M*A)}const k=[];for(const M of[[9002,56146130, |
|
6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const A=M[0];for(let f=1;f<M.length;f++)k[M[f]]=A}const w=[];w[9002]=.3048;w[9003]=.3048006096012192;w[9095]=.3048007491;const C=[0,0];D.angle2D=function(M,A){return q(F(M,A),2*Math.PI)*(180/Math.PI)};D.angleBetween2D=function(M,A,f){return O.rad2deg(q(d(M,A,f),2*Math.PI))};D.angleBetweenRad=d;D.angleRad=F;D.bearing2D=function(M,A){return q(Math.PI/2-F(M,A),2*Math.PI)*(180/Math.PI)};D.bearingBetween2D=function(M,A,f){return O.rad2deg(q(-1* |
|
d(M,A,f),2*Math.PI))};D.centroidMultiPoint=function(M){if(0===M.points.length)return null;var A=0;let f=0,m=0,r=0;for(let n=0;n<M.points.length;n++){const g=M.getPoint(n);!0===g.hasZ&&(m+=g.z);!0===g.hasM&&(r+=g.m);A+=g.x;f+=g.y;r+=g.m}A={x:A/M.points.length,y:f/M.points.length,spatialReference:null};A.spatialReference=M.spatialReference.toJSON();!0===M.hasZ&&(A.z=m/M.points.length);!0===M.hasM&&(A.m=r/M.points.length);return new E(A)};D.centroidPolyline=function(M){const A={x:0,y:0,spatialReference:M.spatialReference.toJSON()}, |
|
f={x:0,y:0,spatialReference:M.spatialReference.toJSON()};let m=0,r=0;for(let l=0;l<M.paths.length;l++)if(0!==M.paths[l].length){a:{var n=M.paths[l];var g=!0===M.hasZ;if(1>=n.length){n=0;break a}let z=0;for(let G=1;G<n.length;G++)z+=b(n[G-1],n[G],g);n=z}0===n?(n=y(M.paths[l],!0===M.hasZ,!0===M.hasM),A.x+=n.x,A.y+=n.y,!0===M.hasZ&&(A.z+=n.z),!0===M.hasM&&(A.m+=n.m),++m):(g=y(M.paths[l],!0===M.hasZ,!0===M.hasM),f.x+=g.x*n,f.y+=g.y*n,!0===M.hasZ&&(f.z+=g.z*n),!0===M.hasM&&(f.m+=g.m*n),r+=n)}return 0< |
|
r?(f.x/=r,f.y/=r,!0===M.hasZ&&(f.z/=r),!0===M.hasM&&(f.m/=r),new E(f)):0<m?(A.x/=m,A.y/=m,!0===M.hasZ&&(f.z/=m),!0===M.hasM&&(A.m/=m),new E(A)):null};D.closestPointOnLineSegment=function(M,A,f){var m=0;m=f[0]-A[0];const r=f[1]-A[1],n=m*m+r*r;0===n?m=.5:(m=((M[0]-A[0])*m+(M[1]-A[1])*r)/n,0>m?m=0:1<m&&(m=1));return.5>=m?[A[0]+(f[0]-A[0])*m,A[1]+(f[1]-A[1])*m]:[f[0]-(f[0]-A[0])*(1-m),f[1]-(f[1]-A[1])*(1-m)]};D.closestPointOnLineSegmentWithZ=function(M,A,f){var m=[f[0]-A[0],f[1]-A[1],f[2]-A[2]];M=[M[0]- |
|
A[0],M[1]-A[1],M[2]-A[2]];m=Math.max(0,Math.min(1,(m[0]*M[0]+m[1]*M[1]+m[2]*M[2])/(m[0]*m[0]+m[1]*m[1]+m[2]*m[2])));return[A[0]+(f[0]-A[0])*m,A[1]+(f[1]-A[1])*m,A[2]+(f[2]-A[2])*m]};D.getMetersPerVerticalUnitForSR=function(M){return M.vcsWkid&&void 0!==k[M.vcsWkid]?w[k[M.vcsWkid]]:M.latestVcsWkid&&void 0!==k[M.latestVcsWkid]?w[k[M.latestVcsWkid]]:1};D.pathsSelfIntersecting=function(M){for(let z=0;z<M.length;z++){const G=M[z];for(var A=0;A<G.length-1;A++){var f=G[A],m=G[A+1];for(var r=z+1;r<M.length;r++)for(var n= |
|
0;n<M[r].length-1;n++){var g=M[r][n],l=M[r][n+1];if(c.segmentIntersects(f,m,g,l,C)&&!(C[0]===f[0]&&C[1]===f[1]||C[0]===g[0]&&C[1]===g[1]||C[0]===m[0]&&C[1]===m[1]||C[0]===l[0]&&C[1]===l[1]))return!0}}A=G.length;if(!(3>A))for(f=0;f<=A-2;f++)for(m=G[f],r=G[f+1],n=f+2;n<=A-2;n++)if(g=G[n],l=G[n+1],c.segmentIntersects(m,r,g,l,C)&&!(C[0]===m[0]&&C[1]===m[1]||C[0]===g[0]&&C[1]===g[1]||C[0]===r[0]&&C[1]===r[1]||C[0]===l[0]&&C[1]===l[1]))return!0}return!1};D.segmentLength=b;D.segmentLength3d=function(M,A, |
|
f){return Math.sqrt((M[0]-A[0])**2+(M[1]-A[1])**2+(void 0!==M[2]&&void 0!==A[2]?(M[2]*f-A[2]*f)**2:0))};D.segmentLength3dSqr=function(M,A,f){return(M[0]-A[0])**2+(M[1]-A[1])**2+(void 0!==M[2]&&void 0!==A[2]?(M[2]*f-A[2]*f)**2:0)};D.segmentLengthSqr=function(M,A,f){const m=A[0]-M[0];M=A[1]-M[1];return f?(A=A[2]-A[2],m*m+M*M+A*A):m*m+M*M};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/geomsync":function(){define("exports ../../kernel ../Dictionary ../executionError ../kernel ../../chunks/languageUtils ./centroid ./measures ../../core/unitUtils ../../geometry/Extent ../../geometry/Geometry ../../geometry/Multipoint ../../geometry/Point ../../geometry/Polygon ../../geometry/Polyline ../../geometry/support/jsonUtils".split(" "), |
|
function(D,O,E,c,y,b,q,F,d,k,w,C,M,A,f,m){function r(l){return 0===O.version.indexOf("4.")?A.fromExtent(l):new A({spatialReference:l.spatialReference,rings:[[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]]]})}function n(l,z){if("polygon"!==l.type&&"polyline"!==l.type&&"extent"!==l.type)return 0;var G=1;if(l.spatialReference.vcsWkid||l.spatialReference.latestVcsWkid){G=q.getMetersPerVerticalUnitForSR(l.spatialReference);var a=d.getMetersPerUnitForSR(l.spatialReference); |
|
G/=a}a=0;if("polyline"===l.type)for(var B of l.paths)for(var x=1;x<B.length;x++)a+=q.segmentLength3d(B[x],B[x-1],G);else if("polygon"===l.type)for(x of l.rings){for(B=1;B<x.length;B++)a+=q.segmentLength3d(x[B],x[B-1],G);if(x[0][0]!==x[x.length-1][0]||x[0][1]!==x[x.length-1][1]||void 0!==x[0][2]&&x[0][2]!==x[x.length-1][2])a+=q.segmentLength3d(x[0],x[x.length-1],G)}else"extent"===l.type&&(a+=2*q.segmentLength3d([l.xmin,l.ymin,0],[l.xmax,l.ymin,0],G),a+=2*q.segmentLength3d([l.xmin,l.ymin,0],[l.xmin, |
|
l.ymax,0],G),a=2*a+4*Math.abs(b.defaultUndefined(l.zmax,0)*G-b.defaultUndefined(l.zmin,0)*G));l=new f({hasZ:!1,hasM:!1,spatialReference:l.spatialReference,paths:[[0,0],[0,a]]});return g.planarLength(l,z)}let g=null;D.registerFunctions=function(l,z){function G(a,B,x){b.pcCheck(x,2,2,a,B);if(!(x[0]instanceof w&&x[1]instanceof w||x[0]instanceof w&&null===x[1]||x[1]instanceof w&&null===x[0]||null===x[0]&&null===x[1]))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);}l.disjoint= |
|
function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);G(a,B,e);return null===e[0]||null===e[1]?!0:g.disjoint(e[0],e[1])})};l.intersects=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);G(a,B,e);return null===e[0]||null===e[1]?!1:g.intersects(e[0],e[1])})};l.touches=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);G(a,B,e);return null===e[0]||null===e[1]?!1:g.touches(e[0],e[1])})};l.crosses=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e); |
|
G(a,B,e);return null===e[0]||null===e[1]?!1:g.crosses(e[0],e[1])})};l.within=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);G(a,B,e);return null===e[0]||null===e[1]?!1:g.within(e[0],e[1])})};l.contains=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);G(a,B,e);return null===e[0]||null===e[1]?!1:g.contains(e[0],e[1])})};l.overlaps=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);G(a,B,e);return null===e[0]||null===e[1]?!1:g.overlaps(e[0], |
|
e[1])})};l.equals=function(a,B){return z(a,B,(x,N,e)=>{b.pcCheck(e,2,2,a,B);return e[0]===e[1]?!0:e[0]instanceof w&&e[1]instanceof w?g.equals(e[0],e[1]):b.isDate(e[0])&&b.isDate(e[1])||b.isTime(e[0])&&b.isTime(e[1])||b.isDateOnly(e[0])&&b.isDateOnly(e[1])?e[0].equals(e[1]):!1})};l.relate=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,3,3,a,B);if(e[0]instanceof w&&e[1]instanceof w)return g.relate(e[0],e[1],b.toString(e[2]));if(e[0]instanceof w&&null===e[1]||e[1]instanceof |
|
w&&null===e[0]||null===e[0]&&null===e[1])return!1;throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);})};l.intersection=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);G(a,B,e);return null===e[0]||null===e[1]?null:g.intersect(e[0],e[1])})};l.union=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);x=[];if(0===e.length)throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.WrongNumberOfParameters,B);if(1===e.length)if(b.isArray(e[0]))for(e= |
|
b.autoCastFeatureToGeometry(e[0]),N=0;N<e.length;N++){if(null!==e[N]){if(!(e[N]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);x.push(e[N])}}else if(b.isImmutableArray(e[0]))for(e=b.autoCastFeatureToGeometry(e[0].toArray()),N=0;N<e.length;N++){if(null!==e[N]){if(!(e[N]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);x.push(e[N])}}else{if(e[0]instanceof w)return b.fixSpatialReference(y.cloneGeometry(e[0]),a.spatialReference); |
|
if(null===e[0])return null;throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);}else for(N=0;N<e.length;N++)if(null!==e[N]){if(!(e[N]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);x.push(e[N])}return 0===x.length?null:g.union(x)})};l.difference=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);G(a,B,e);return null===e[0]?null:null===e[1]?y.cloneGeometry(e[0]):g.difference(e[0],e[1])})};l.symmetricdifference=function(a, |
|
B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);G(a,B,e);return null===e[0]&&null===e[1]?null:null===e[0]?y.cloneGeometry(e[1]):null===e[1]?y.cloneGeometry(e[0]):g.symmetricDifference(e[0],e[1])})};l.clip=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,2,a,B);if(!(e[1]instanceof k)&&null!==e[1])throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(null===e[0])return null;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a, |
|
c.ExecutionErrorCodes.InvalidParameter,B);return null===e[1]?null:g.clip(e[0],e[1])})};l.cut=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,2,a,B);if(!(e[1]instanceof f)&&null!==e[1])throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(null===e[0])return[];if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return null===e[1]?[y.cloneGeometry(e[0])]:g.cut(e[0],e[1])})};l.area=function(a, |
|
B){return z(a,B,(x,N,e)=>{b.pcCheck(e,1,2,a,B);e=b.autoCastFeatureToGeometry(e);if(null===e[0])return 0;if(b.isArray(e[0])||b.isImmutableArray(e[0]))return x=b.autoCastArrayOfPointsToPolygon(e[0],a.spatialReference),null===x?0:g.planarArea(x,y.convertSquareUnitsToCode(b.defaultUndefined(e[1],-1)));if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return g.planarArea(e[0],y.convertSquareUnitsToCode(b.defaultUndefined(e[1],-1)))})};l.areageodetic=function(a, |
|
B){return z(a,B,(x,N,e)=>{b.pcCheck(e,1,2,a,B);e=b.autoCastFeatureToGeometry(e);if(null===e[0])return 0;if(b.isArray(e[0])||b.isImmutableArray(e[0]))return x=b.autoCastArrayOfPointsToPolygon(e[0],a.spatialReference),null===x?0:g.geodesicArea(x,y.convertSquareUnitsToCode(b.defaultUndefined(e[1],-1)));if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return g.geodesicArea(e[0],y.convertSquareUnitsToCode(b.defaultUndefined(e[1],-1)))})};l.length=function(a, |
|
B){return z(a,B,(x,N,e)=>{b.pcCheck(e,1,2,a,B);e=b.autoCastFeatureToGeometry(e);if(null===e[0])return 0;if(b.isArray(e[0])||b.isImmutableArray(e[0]))return x=b.autoCastArrayOfPointsToPolyline(e[0],a.spatialReference),null===x?0:g.planarLength(x,y.convertLinearUnitsToCode(b.defaultUndefined(e[1],-1)));if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return g.planarLength(e[0],y.convertLinearUnitsToCode(b.defaultUndefined(e[1],-1)))})};l.length3d=function(a, |
|
B){return z(a,B,(x,N,e)=>{b.pcCheck(e,1,2,a,B);e=b.autoCastFeatureToGeometry(e);if(null===e[0])return 0;if(b.isArray(e[0])||b.isImmutableArray(e[0]))return x=b.autoCastArrayOfPointsToPolyline(e[0],a.spatialReference),null===x?0:!0===x.hasZ?n(x,y.convertLinearUnitsToCode(b.defaultUndefined(e[1],-1))):g.planarLength(x,y.convertLinearUnitsToCode(b.defaultUndefined(e[1],-1)));if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return!0===e[0].hasZ?n(e[0], |
|
y.convertLinearUnitsToCode(b.defaultUndefined(e[1],-1))):g.planarLength(e[0],y.convertLinearUnitsToCode(b.defaultUndefined(e[1],-1)))})};l.lengthgeodetic=function(a,B){return z(a,B,(x,N,e)=>{b.pcCheck(e,1,2,a,B);e=b.autoCastFeatureToGeometry(e);if(null===e[0])return 0;if(b.isArray(e[0])||b.isImmutableArray(e[0]))return x=b.autoCastArrayOfPointsToPolyline(e[0],a.spatialReference),null===x?0:g.geodesicLength(x,y.convertLinearUnitsToCode(b.defaultUndefined(e[1],-1)));if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a, |
|
c.ExecutionErrorCodes.InvalidParameter,B);return g.geodesicLength(e[0],y.convertLinearUnitsToCode(b.defaultUndefined(e[1],-1)))})};l.distance=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,3,a,B);x=e[0];if(b.isArray(e[0])||b.isImmutableArray(e[0]))x=b.autoCastArrayOfPointsToMultiPoint(e[0],a.spatialReference);N=e[1];if(b.isArray(e[1])||b.isImmutableArray(e[1]))N=b.autoCastArrayOfPointsToMultiPoint(e[1],a.spatialReference);if(!(x instanceof w))throw new c.ArcadeExecutionError(a, |
|
c.ExecutionErrorCodes.InvalidParameter,B);if(!(N instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return g.distance(x,N,y.convertLinearUnitsToCode(b.defaultUndefined(e[2],-1)))})};l.distancegeodetic=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,3,a,B);x=e[0];N=e[1];if(!(x instanceof M))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(!(N instanceof M))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter, |
|
B);const Z=new f({paths:[],spatialReference:x.spatialReference});Z.addPath([x,N]);return g.geodesicLength(Z,y.convertLinearUnitsToCode(b.defaultUndefined(e[2],-1)))})};l.densify=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,3,a,B);if(null===e[0])return null;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);x=b.toNumber(e[1]);if(isNaN(x))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter, |
|
B);if(0>=x)throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return e[0]instanceof A||e[0]instanceof f?g.densify(e[0],x,y.convertLinearUnitsToCode(b.defaultUndefined(e[2],-1))):e[0]instanceof k?g.densify(r(e[0]),x,y.convertLinearUnitsToCode(b.defaultUndefined(e[2],-1))):e[0]})};l.densifygeodetic=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,3,a,B);if(null===e[0])return null;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter, |
|
B);x=b.toNumber(e[1]);if(isNaN(x))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(0>=x)throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return e[0]instanceof A||e[0]instanceof f?g.geodesicDensify(e[0],x,y.convertLinearUnitsToCode(b.defaultUndefined(e[2],-1))):e[0]instanceof k?g.geodesicDensify(r(e[0]),x,y.convertLinearUnitsToCode(b.defaultUndefined(e[2],-1))):e[0]})};l.generalize=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e); |
|
b.pcCheck(e,2,4,a,B);if(null===e[0])return null;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);x=b.toNumber(e[1]);if(isNaN(x))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return g.generalize(e[0],x,b.toBoolean(b.defaultUndefined(e[2],!0)),y.convertLinearUnitsToCode(b.defaultUndefined(e[3],-1)))})};l.buffer=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,3,a,B);if(null===e[0])return null; |
|
if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);x=b.toNumber(e[1]);if(isNaN(x))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return 0===x?y.cloneGeometry(e[0]):g.buffer(e[0],x,y.convertLinearUnitsToCode(b.defaultUndefined(e[2],-1)))})};l.buffergeodetic=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,3,a,B);if(null===e[0])return null;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a, |
|
c.ExecutionErrorCodes.InvalidParameter,B);x=b.toNumber(e[1]);if(isNaN(x))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return 0===x?y.cloneGeometry(e[0]):g.geodesicBuffer(e[0],x,y.convertLinearUnitsToCode(b.defaultUndefined(e[2],-1)))})};l.offset=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,6,a,B);if(null===e[0])return null;if(!(e[0]instanceof A||e[0]instanceof f))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter, |
|
B);x=b.toNumber(e[1]);if(isNaN(x))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);N=b.toNumber(b.defaultUndefined(e[4],10));if(isNaN(N))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);const Z=b.toNumber(b.defaultUndefined(e[5],0));if(isNaN(Z))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return g.offset(e[0],x,y.convertLinearUnitsToCode(b.defaultUndefined(e[2],-1)),b.toString(b.defaultUndefined(e[3],"round")).toLowerCase(), |
|
N,Z)})};l.rotate=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,3,a,B);if(null===e[0])return null;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);x=e[0]instanceof k?A.fromExtent(e[0]):e[0];N=b.toNumber(e[1]);if(isNaN(N))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);e=b.defaultUndefined(e[2],null);if(null===e)return g.rotate(x,N);if(e instanceof M)return g.rotate(x,N,e);throw new c.ArcadeExecutionError(a, |
|
c.ExecutionErrorCodes.InvalidParameter,B);})};l.centroid=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,1,1,a,B);if(null===e[0])return null;x=e[0];if(b.isArray(e[0])||b.isImmutableArray(e[0]))x=b.autoCastArrayOfPointsToMultiPoint(e[0],a.spatialReference);if(null===x)return null;if(!(x instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return x instanceof M?b.fixSpatialReference(y.cloneGeometry(x),a.spatialReference):x instanceof |
|
A?x.centroid:x instanceof f?q.centroidPolyline(x):x instanceof C?q.centroidMultiPoint(x):x instanceof k?x.center:null})};l.measuretocoordinate=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,2,a,B);if(null===e[0])return null;x=e[0];if(b.isArray(e[0])||b.isImmutableArray(e[0]))x=b.autoCastArrayOfPointsToPolyline(e[0],a.spatialReference);if(null===x)return null;if(!(x instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(!(x instanceof |
|
f))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(b.isNumber(!1===e[1]))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return(e=F.measureToCoordinate(x,e[1]))?E.convertObjectToArcadeDictionary(e,b.defaultTimeZone(a),!1,!0):null})};l.pointtocoordinate=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,2,a,B);if(null===e[0])return null;x=e[0];if(b.isArray(e[0])||b.isImmutableArray(e[0]))x=b.autoCastArrayOfPointsToPolyline(e[0], |
|
a.spatialReference);if(null===x)return null;if(!(x instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(!(x instanceof f))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);N=e[1];if(null===N)return null;if(!(N instanceof M))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(b.isNumber(!1===e[1]))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return(e=F.pointToCoordinate(x, |
|
N))?E.convertObjectToArcadeDictionary(e,b.defaultTimeZone(a),!1,!0):null})};l.distancetocoordinate=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,2,a,B);if(null===e[0])return null;x=e[0];if(b.isArray(e[0])||b.isImmutableArray(e[0]))x=b.autoCastArrayOfPointsToPolyline(e[0],a.spatialReference);if(null===x)return null;if(!(x instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(!(x instanceof f))throw new c.ArcadeExecutionError(a, |
|
c.ExecutionErrorCodes.InvalidParameter,B);if(b.isNumber(!1===e[1]))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return(e=F.distanceToCoordinate(x,e[1]))?E.convertObjectToArcadeDictionary(e,b.defaultTimeZone(a),!1,!0):null})};l.multiparttosinglepart=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,1,1,a,B);if(null===e[0])return null;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(e[0]instanceof |
|
M||e[0]instanceof k)return[b.fixSpatialReference(y.cloneGeometry(e[0]),a.spatialReference)];x=g.simplify(e[0]);if(x instanceof A){e=[];N=[];for(var Z=0;Z<x.rings.length;Z++)if(x.isClockwise(x.rings[Z])){const t=m.fromJSON({rings:[x.rings[Z]],hasZ:!0===x.hasZ,hasM:!0===x.hasM,spatialReference:x.spatialReference.toJSON()});e.push(t)}else N.push({ring:x.rings[Z],pt:x.getPoint(Z,0)});for(x=0;x<N.length;x++)for(Z=0;Z<e.length;Z++)if(e[Z].contains(N[x].pt)){e[Z].addRing(N[x].ring);break}return e}if(x instanceof |
|
f){e=[];for(N=0;N<x.paths.length;N++)Z=m.fromJSON({paths:[x.paths[N]],hasZ:!0===x.hasZ,hasM:!0===x.hasM,spatialReference:x.spatialReference.toJSON()}),e.push(Z);return e}if(e[0]instanceof C){x=[];e=b.fixSpatialReference(y.cloneGeometry(e[0]),a.spatialReference);for(N=0;N<e.points.length;N++)x.push(e.getPoint(N));return x}return null})};l.issimple=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,1,1,a,B);if(null===e[0])return!0;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a, |
|
c.ExecutionErrorCodes.InvalidParameter,B);return g.isSimple(e[0])})};l.simplify=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,1,1,a,B);if(null===e[0])return null;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);return g.simplify(e[0])})};l.convexhull=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,1,1,a,B);if(null===e[0])return null;if(!(e[0]instanceof w))throw new c.ArcadeExecutionError(a, |
|
c.ExecutionErrorCodes.InvalidParameter,B);return g.convexHull(e[0])})};l.nearestcoordinate=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,2,a,B);if(!(e[0]instanceof w||null===e[0]))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(!(e[1]instanceof M||null===e[1]))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(null===e[0]||null===e[1])return null;x=g.nearestCoordinate(e[0],e[1]);return null===x||x.isEmpty? |
|
null:E.convertObjectToArcadeDictionary({coordinate:x.coordinate,distance:x.distance,sideOfLine:0===x.distance?"straddle":x.isRightSide?"right":"left"},b.defaultTimeZone(a),!1,!0)})};l.nearestvertex=function(a,B){return z(a,B,(x,N,e)=>{e=b.autoCastFeatureToGeometry(e);b.pcCheck(e,2,2,a,B);if(!(e[0]instanceof w||null===e[0]))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter,B);if(!(e[1]instanceof M||null===e[1]))throw new c.ArcadeExecutionError(a,c.ExecutionErrorCodes.InvalidParameter, |
|
B);if(null===e[0]||null===e[1])return null;x=g.nearestVertex(e[0],e[1]);return null===x||x.isEmpty?null:E.convertObjectToArcadeDictionary({coordinate:x.coordinate,distance:x.distance,sideOfLine:0===x.distance?"straddle":x.isRightSide?"right":"left"},b.defaultTimeZone(a),!1,!0)})}};D.setGeometryEngine=function(l){g=l};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/measures":function(){define(["exports","./centroid","../../core/unitUtils","../../geometry/Point", |
|
"../../geometry/Polygon"],function(D,O,E,c,y){function b(d,k,w){w=k[0]-d[0];d=k[1]-d[1];return Math.sqrt(w*w+d*d)}function q(d,k,w,C){k=[k[0]-d[0],k[1]-d[1],k[2]*C-d[2]*C];C=Math.sqrt(k[0]*k[0]+k[1]*k[1]+k[2]*k[2]);k=[k[0]/C,k[1]/C,k[2]/C];return[d[0]+k[0]*w,d[1]+k[1]*w,d[2]+k[2]*w]}function F(d,k,w){let C=k[0]-d[0];k=k[1]-d[1];const M=Math.sqrt(C*C+k*k);return[d[0]+C/M*w,d[1]+k/M*w]}D.distanceToCoordinate=function(d,k){if(!d)return null;switch(d.type){case "extent":case "multipoint":case "mesh":case "point":return null}var w= |
|
"polygon"===d.type?d.rings:d.paths;if(0>k)return null;var C=1;if(d.spatialReference.vcsWkid||d.spatialReference.latestVcsWkid){var M=O.getMetersPerVerticalUnitForSR(d.spatialReference),A=E.getMetersPerUnitForSR(d.spatialReference);C=M/A}let f=0;M=d.hasZ?3:2;var m=d.hasZ?O.segmentLength3d:b;A=-1;if(0===k)return 0===w.length||0===w[0].length?null:{partId:0,coordinate:new c({hasZ:d.hasZ,hasM:d.hasM,spatialReference:d.spatialReference,x:w[0][0][0],y:w[0][0][1],...(d.hasZ?{z:w[0][0][2]}:{}),...(d.hasM? |
|
{m:w[0][0][M]}:{})}),segmentId:0};for(const r of w){A++;w=-1;for(let n=1;n<r.length;n++){w++;const g=m(r[n-1],r[n],C),l=f+g;if(l===k)return{partId:A,coordinate:new c({hasZ:d.hasZ,hasM:d.hasM,spatialReference:d.spatialReference,x:r[n][0],y:r[n][1],...(d.hasZ?{z:r[n][2]}:{}),...(d.hasM?{m:r[n][M]}:{})}),segmentId:w};if(l>k)return C=d.hasZ?q(r[n-1],r[n],k-f,C):F(r[n-1],r[n],k-f),C=[...C],m=r[n-1][M],k=m+(r[n][M]-m)/g*(k-f),C=[...C,k],{partId:A,coordinate:new c({hasZ:d.hasZ,hasM:d.hasM,spatialReference:d.spatialReference, |
|
x:C[0],y:C[1],...(d.hasZ?{z:C[2]}:{}),...(d.hasM?{m:C[M]}:{})}),segmentId:w};f=l}}return null};D.measureToCoordinate=function(d,k){if(!d)return null;switch(d.type){case "extent":case "multipoint":case "mesh":case "point":return null}var w="polygon"===d.type?d.rings:d.paths,C=1;if(d.spatialReference.vcsWkid||d.spatialReference.latestVcsWkid){C=O.getMetersPerVerticalUnitForSR(d.spatialReference);var M=E.getMetersPerUnitForSR(d.spatialReference);C/=M}if(0===w.length||0===w[0].length||!1===d.hasM)return null; |
|
M=-1;let A=0;const f=d.hasZ?O.segmentLength3d:b,m=d.hasZ?3:2;for(const n of w){M++;if(0<n.length&&n[0][m]===k)return{partId:M,distanceAlong:A,coordinate:new c({hasZ:d.hasZ,hasM:d.hasM,spatialReference:d.spatialReference,x:n[0][0],y:n[0][1],...(d.hasZ?{z:n[0][2]}:{}),...(d.hasM?{m:n[0][m]}:{})}),segmentId:0};w=-1;for(let g=1;g<n.length;g++){var r=f(n[g-1],n[g],C);w++;const l=n[g][m]-n[g-1][m],z=n[g][m];if(z===k)return{partId:M,distanceAlong:r+A,coordinate:new c({hasZ:d.hasZ,hasM:d.hasM,spatialReference:d.spatialReference, |
|
x:n[g][0],y:n[g][1],...(d.hasZ?{z:n[g][2]}:{}),...(d.hasM?{m:n[g][m]}:{})}),segmentId:w};if(z>k&&k>n[g-1][m])return r*=(k-n[g-1][m])/l,r=d.hasZ?q(n[g-1],n[g],r,C):F(n[g-1],n[g],r),r=[...r,k],d=new c({hasZ:d.hasZ,hasM:d.hasM,spatialReference:d.spatialReference,x:r[0],y:r[1],...(d.hasZ?{z:r[2]}:{}),...(d.hasM?{m:r[m]}:{})}),{partId:M,distanceAlong:A+f(n[g-1],[d.x,d.y,...(d.hasZ?[d.z]:[]),...(d.hasM?[d.m]:[])],C),coordinate:d,segmentId:w};A+=r}}return null};D.pointToCoordinate=function(d,k){if(!d||!k)return null; |
|
if("extent"===d.type){var w=d;d=new y({spatialReference:d.spatialReference,rings:[[[w.xmin,w.ymin],[w.xmin,w.ymax],[w.xmax,w.ymax],[w.xmax,w.ymin],[w.xmin,w.ymin]]]})}switch(d.type){case "point":var C=d;if(C)if(k){d=1;if(k.spatialReference.vcsWkid||k.spatialReference.latestVcsWkid)d=O.getMetersPerVerticalUnitForSR(k.spatialReference),w=E.getMetersPerUnitForSR(k.spatialReference),d/=w;w=null;var M=0;w=C;M=C.hasZ&&k.hasZ?O.segmentLength3d([k.x,k.y,k.z],[C.x,C.y,C.z],d):O.segmentLength([k.x,k.y],[C.x, |
|
C.y],!1);k={coordinate:w,distance:M}}else k=null;else k=null;return k??null;case "multipoint":if(d&&k){w=1;if(k.spatialReference.vcsWkid||k.spatialReference.latestVcsWkid)w=O.getMetersPerVerticalUnitForSR(k.spatialReference),M=E.getMetersPerUnitForSR(k.spatialReference),w/=M;M=null;var A=0;A=Number.MAX_VALUE;var f=M=-1;for(C of d.points||[]){f++;var m=d.hasZ&&k.hasZ?O.segmentLength3dSqr([C[0],C[1],C[2]],[k.x,k.y,k.z],w):O.segmentLengthSqr([C[0],C[1]],[k.x,k.y],!1);m<A&&(A=m,M=f)}0>M?k=null:(M=d.getPoint(M), |
|
k={coordinate:M,distance:Math.sqrt(A)})}else k=null;return k??null;case "polygon":case "polyline":if((C=d)&&k){d="polygon"===C.type?C.rings:C.paths;w=1;if(k.spatialReference.vcsWkid||k.spatialReference.latestVcsWkid)w=O.getMetersPerVerticalUnitForSR(k.spatialReference),M=E.getMetersPerUnitForSR(k.spatialReference),w/=M;M=Number.MAX_VALUE;var r=A=-1;f=-1;m=C.hasZ&&k.hasZ;var n=null,g=m?[k.x,k.y,k.z]:[k.x,k.y];for(var l of d){r++;for(var z=1;z<l.length;z++){var G=m?O.closestPointOnLineSegmentWithZ(g, |
|
l[z-1],l[z]):O.closestPointOnLineSegment(g,l[z-1],l[z]),a=m?O.segmentLength3dSqr(G,g,w):O.segmentLengthSqr(G,g,!1);a<M&&(M=a,n=G,f=r,A=z-1)}}if(0>A)k=null;else{g=C.hasM&&C.hasZ?3:2;l=d[f][A];r=d[f][A+1];z=z=null;G=m?n[2]:null;if(C.hasM){z=l[g];a=m?O.segmentLength3d(l,r,w):O.segmentLength(l,r,!1);var B=m?O.segmentLength3d(l,n,w):O.segmentLength(l,n,!1);z+=(r[g]-z)/a*B}C.hasZ&&!1===k.hasZ&&(g=l[2],G=m?O.segmentLength3d(l,r,w):O.segmentLength(l,r,!1),a=m?O.segmentLength3d(l,n,w):O.segmentLength(l,n, |
|
!1),G=g+(r[2]-g)/G*a);z=new c({hasZ:m,hasM:C.hasM,spatialReference:k.spatialReference,x:n[0],y:n[1],...(C.hasZ?{z:G}:{}),...(C.hasM?{m:z}:{})});k=0;for(m=0;m<=f;m++)for(n=d[m],r=m===f?A:n.length-1,g=1;g<=r;g++)k+=C.hasZ?O.segmentLength3d(n[g-1],n[g],w):O.segmentLength([n[g-1][0],n[g-1][1]],[n[g][0],n[g][1]],!1);k+=C.hasZ?O.segmentLength3d(l,[z.x,z.y,z.z],w):O.segmentLength(l,[z.x,z.y],!1);k={partId:f,segmentId:A,coordinate:z,distance:Math.sqrt(M),distanceAlong:k}}}else k=null;return k??null;default:return null}}; |
|
Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/maths":function(){define(["exports","../../chunks/languageUtils","../../core/number"],function(D,O,E){function c(y,b,q){if(void 0===q||0===+q)return Math[y](b);b=+b;q=+q;if(isNaN(b)||"number"!==typeof q||0!==q%1)return NaN;b=b.toString().split("e");b=Math[y](+(b[0]+"e"+(b[1]?+b[1]-q:-q)));b=b.toString().split("e");return+(b[0]+"e"+(b[1]?+b[1]+q:q))}D.registerFunctions=function(y,b){function q(F,d,k){F=O.toNumber(F); |
|
return isNaN(F)?F:isNaN(d)||isNaN(k)||d>k?NaN:F<d?d:F>k?k:F}y.number=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,2,F,d);k=C[0];return O.isNumber(k)?k:null===k?0:O.isDate(k)||O.isTime(k)||O.isDateOnly(k)?k.toNumber():O.isBoolean(k)?Number(k):O.isArray(k)?NaN:""===k||void 0===k?Number(k):O.isString(k)?void 0!==C[1]?(C=O.multiReplace(C[1],"\u2030",""),C=O.multiReplace(C,"\u00a4",""),E.parse(k,{pattern:C})):Number(k.trim()):Number(k)})};y.abs=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1, |
|
1,F,d);return Math.abs(O.toNumber(C[0]))})};y.acos=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return Math.acos(O.toNumber(C[0]))})};y.asin=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return Math.asin(O.toNumber(C[0]))})};y.atan=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return Math.atan(O.toNumber(C[0]))})};y.atan2=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,2,2,F,d);return Math.atan2(O.toNumber(C[0]),O.toNumber(C[1]))})};y.ceil=function(F,d){return b(F, |
|
d,(k,w,C)=>{O.pcCheck(C,1,2,F,d);return 2===C.length?(k=O.toNumber(C[1]),isNaN(k)&&(k=0),c("ceil",O.toNumber(C[0]),-1*k)):Math.ceil(O.toNumber(C[0]))})};y.round=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,2,F,d);return 2===C.length?(k=O.toNumber(C[1]),isNaN(k)&&(k=0),c("round",O.toNumber(C[0]),-1*k)):Math.round(O.toNumber(C[0]))})};y.floor=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,2,F,d);return 2===C.length?(k=O.toNumber(C[1]),isNaN(k)&&(k=0),c("floor",O.toNumber(C[0]),-1*k)):Math.floor(O.toNumber(C[0]))})}; |
|
y.cos=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return Math.cos(O.toNumber(C[0]))})};y.isnan=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return"number"===typeof C[0]&&isNaN(C[0])})};y.exp=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return Math.exp(O.toNumber(C[0]))})};y.log=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return Math.log(O.toNumber(C[0]))})};y.pow=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,2,2,F,d);return O.toNumber(C[0])** |
|
O.toNumber(C[1])})};y.random=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,0,0,F,d);return Math.random()})};y.sin=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return Math.sin(O.toNumber(C[0]))})};y.sqrt=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return Math.sqrt(O.toNumber(C[0]))})};y.tan=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return Math.tan(O.toNumber(C[0]))})};y.isempty=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return null===C[0]|| |
|
""===C[0]||void 0===C[0]||C[0]===O.voidOperation?!0:!1})};y.boolean=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,1,1,F,d);return O.toBoolean(C[0])})};y.constrain=function(F,d){return b(F,d,(k,w,C)=>{O.pcCheck(C,3,3,F,d);k=O.toNumber(C[1]);w=O.toNumber(C[2]);if(O.isArray(C[0])){var M=[];for(var A of C[0])M.push(q(A,k,w));return M}if(O.isImmutableArray(C[0])){A=[];for(M=0;M<C[0].length();M++)A.push(q(C[0].get(M),k,w));return A}return q(C[0],k,w)})}};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})}, |
|
"esri/arcade/functions/stats":function(){define(["exports","../executionError","../../chunks/languageUtils","./fieldStats"],function(D,O,E,c){function y(b,q){if(1===q.length){if(E.isArray(q[0]))return c.calculateStat(b,q[0],-1);if(E.isImmutableArray(q[0]))return c.calculateStat(b,q[0].toArray(),-1)}return c.calculateStat(b,q,-1)}D.registerFunctions=function(b,q){b.stdev=function(F,d){return q(F,d,(k,w,C)=>y("stdev",C))};b.variance=function(F,d){return q(F,d,(k,w,C)=>y("variance",C))};b.average=function(F, |
|
d){return q(F,d,(k,w,C)=>y("mean",C))};b.mean=function(F,d){return q(F,d,(k,w,C)=>y("mean",C))};b.sum=function(F,d){return q(F,d,(k,w,C)=>y("sum",C))};b.min=function(F,d){return q(F,d,(k,w,C)=>y("min",C))};b.max=function(F,d){return q(F,d,(k,w,C)=>y("max",C))};b.distinct=function(F,d){return q(F,d,(k,w,C)=>y("distinct",C))};b.count=function(F,d){return q(F,d,(k,w,C)=>{E.pcCheck(C,1,1,F,d);if(E.isArray(C[0])||E.isString(C[0]))return C[0].length;if(E.isImmutableArray(C[0]))return C[0].length();throw new O.ArcadeExecutionError(F, |
|
O.ExecutionErrorCodes.InvalidParameter,d);})}};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/fieldStats":function(){define(["exports","../../chunks/languageUtils"],function(D,O){function E(y){let b=0;for(let q=0;q<y.length;q++)b+=y[q];return b/y.length}function c(y){const b=E(y);let q=0;for(let F=0;F<y.length;F++)q+=(b-y[F])**2;return q/y.length}D.calculateStat=function(y,b,q=1E3){switch(y.toLowerCase()){case "distinct":a:{y=[];const F={},d=[];for(let k=0;k< |
|
b.length;k++){if(void 0!==b[k]&&null!==b[k]&&b[k]!==O.voidOperation){const w=b[k];if(O.isNumber(w)||O.isString(w))void 0===F[w]&&(y.push(w),F[w]=1);else{let C=!1;for(let M=0;M<d.length;M++)!0===O.equalityTest(d[M],w)&&(C=!0);!1===C&&(d.push(w),y.push(w))}}if(y.length>=q&&-1!==q){b=y;break a}}b=y}return b;case "avg":case "mean":return E(O.toNumberArray(b));case "min":return Math.min.apply(Math,O.toNumberArray(b));case "sum":b=O.toNumberArray(b);q=0;for(y=0;y<b.length;y++)q+=b[y];return q;case "max":return Math.max.apply(Math, |
|
O.toNumberArray(b));case "stdev":case "stddev":return Math.sqrt(c(O.toNumberArray(b)));case "var":case "variance":return c(O.toNumberArray(b));case "count":return b.length}return 0};D.decodeStatType=function(y){switch(y.toLowerCase()){case "distinct":return"distinct";case "avg":case "mean":return"avg";case "min":return"min";case "sum":return"sum";case "max":return"max";case "stdev":case "stddev":return"stddev";case "var":case "variance":return"var";case "count":return"count"}return""};Object.defineProperty(D, |
|
Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/string":function(){define("exports ../ArcadePortal ../Attachment ../Dictionary ../executionError ../../chunks/languageUtils ../featureset/support/shared ./convertdirection ./hash ../../core/urlUtils ../../core/uuid ../../geometry/Extent ../../geometry/Multipoint ../../geometry/Point ../../geometry/Polygon ../../geometry/Polyline ../../geometry/SpatialReference ../../portal/Portal".split(" "),function(D,O,E,c,y,b,q,F,d,k,w,C,M,A,f,m,r, |
|
n){function g(z,G){if(!z||!G)return z===G;if(z.x===G.x&&z.y===G.y){if(z.hasZ){if(z.z!==G.z)return!1}else if(G.hasZ)return!1;if(z.hasM){if(z.m!==G.m)return!1}else if(G.hasM)return!1;return!0}return!1}function l(z,G,a){if(null===z)G.updateUint8Array([0,139]);else if(b.isArray(z)){G.updateUint8Array([61]);if(a.map.has(z))z=a.map.get(z),G.updateIntArray([z^61237541]);else{a.map.set(z,a.currentLength++);for(var B of z)l(B,G,a);a.map.delete(z);a.currentLength--}G.updateUint8Array([199])}else if(b.isImmutableArray(z)){G.updateUint8Array([61]); |
|
if(a.map.has(z))z=a.map.get(z),G.updateIntArray([z^61237541]);else{a.map.set(z,a.currentLength++);for(var x of z.toArray())l(x,G,a);a.map.delete(z);a.currentLength--}G.updateUint8Array([199])}else if(b.isDate(z))G.updateIntArray([z.toNumber()]),G.updateUint8Array([241]);else if(b.isDateOnly(z))G.updateIntArray([z.toNumber()]),G.updateIntArray([257]);else if(b.isTime(z))G.updateIntArray([z.toNumber()]),G.updateIntArray([263]);else if(b.isString(z))G.updateIntArray([z.length]),G.updateWithString(z), |
|
G.updateUint8Array([41]);else if(b.isBoolean(z))G.updateUint8Array([!0===z?1:0,113]);else if(b.isNumber(z))G.updateFloatArray([z]),G.updateUint8Array([173]);else{if(z instanceof E)throw new y.ArcadeExecutionError(a.context,y.ExecutionErrorCodes.UnsupportedHashType,a.node);if(z instanceof O)throw new y.ArcadeExecutionError(a.context,y.ExecutionErrorCodes.UnsupportedHashType,a.node);if(z instanceof c){G.updateUint8Array([223]);if(a.map.has(z))z=a.map.get(z),G.updateIntArray([z^61237541]);else{a.map.set(z, |
|
a.currentLength++);for(var N of z.keys())G.updateIntArray([N.length]),G.updateWithString(N),G.updateUint8Array([251]),B=z.field(N),l(B,G,a),G.updateUint8Array([239]);a.map.delete(z);a.currentLength--}G.updateUint8Array([73])}else{if(b.isFeature(z))throw new y.ArcadeExecutionError(a.context,y.ExecutionErrorCodes.UnsupportedHashType,a.node);if(z instanceof A)G.updateIntArray([3833836621]),G.updateIntArray([0]),G.updateFloatArray([z.x]),G.updateIntArray([1]),G.updateFloatArray([z.y]),z.hasZ&&(G.updateIntArray([2]), |
|
G.updateFloatArray([z.z])),z.hasM&&(G.updateIntArray([3]),G.updateFloatArray([z.m])),G.updateIntArray([3765347959]),l(z.spatialReference.wkid,G,a);else if(z instanceof f){G.updateIntArray([1266616829]);for(N=0;N<z.rings.length;N++){x=z.rings[N];B=[];var e=null;let Z=null;for(let t=0;t<x.length;t++){const H=z.getPoint(N,t);if(0===t)e=H;else if(g(Z,H))continue;Z=H;t===x.length-1&&g(e,H)||B.push(H)}G.updateIntArray([1397116793,B.length]);for(x=0;x<B.length;x++)e=B[x],G.updateIntArray([3962308117,x]), |
|
l(e,G,a),G.updateIntArray([2716288009]);G.updateIntArray([2278822459])}G.updateIntArray([3878477243]);l(z.spatialReference.wkid,G,a)}else if(z instanceof m){G.updateIntArray([4106883559]);for(N=0;N<z.paths.length;N++){B=z.paths[N];G.updateIntArray([1397116793,B.length]);for(x=0;x<B.length;x++)G.updateIntArray([3962308117,x]),l(z.getPoint(N,x),G,a),G.updateIntArray([2716288009]);G.updateIntArray([2278822459])}G.updateIntArray([2568784753]);l(z.spatialReference.wkid,G,a)}else if(z instanceof M){G.updateIntArray([588535921, |
|
z.points.length]);for(N=0;N<z.points.length;N++)B=z.getPoint(N),G.updateIntArray([N]),l(B,G,a);G.updateIntArray([1700171621]);l(z.spatialReference.wkid,G,a)}else if(z instanceof C)G.updateIntArray([3483648373]),G.updateIntArray([0]),G.updateFloatArray([z.xmax]),G.updateIntArray([1]),G.updateFloatArray([z.xmin]),G.updateIntArray([2]),G.updateFloatArray([z.ymax]),G.updateIntArray([3]),G.updateFloatArray([z.ymin]),z.hasZ&&(G.updateIntArray([4]),G.updateFloatArray([z.zmax]),G.updateIntArray([5]),G.updateFloatArray([z.zmin])), |
|
z.hasM&&(G.updateIntArray([6]),G.updateFloatArray([z.mmax]),G.updateIntArray([7]),G.updateFloatArray([z.mmin])),G.updateIntArray([3622027469]),l(z.spatialReference.wkid,G,a);else if(z instanceof r)G.updateIntArray([14]),void 0!==z.wkid&&null!==z.wkid&&G.updateIntArray([z.wkid]),z.wkt&&G.updateWithString(z.wkt),z.wkt2&&G.updateWithString(z.wkt2);else{if(b.isFunctionParameter(z))throw new y.ArcadeExecutionError(a.context,y.ExecutionErrorCodes.UnsupportedHashType,a.node);if(b.isFeatureSet(z))throw new y.ArcadeExecutionError(a.context, |
|
y.ExecutionErrorCodes.UnsupportedHashType,a.node);b.isFeatureSetCollection(z);throw new y.ArcadeExecutionError(a.context,y.ExecutionErrorCodes.UnsupportedHashType,a.node);}}}}D.registerFunctions=function(z,G){z.portal=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);return new O(b.toString(e[0]))})};z.typeof=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);x=b.getType(e[0]);if("Unrecognized Type"===x)throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.UnrecognizedType,B);return x})}; |
|
z.trim=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);return b.toString(e[0]).trim()})};z.tohex=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);x=b.toNumber(e[0]);return isNaN(x)?x:x.toString(16)})};z.upper=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);return b.toString(e[0]).toUpperCase()})};z.proper=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,2,a,B);x=1;2===e.length&&"firstword"===b.toString(e[1]).toLowerCase()&&(x=2);N=/\s/;e=b.toString(e[0]);let Z="",t= |
|
!0;for(let H=0;H<e.length;H++){let R=e[H];N.test(R)?1===x&&(t=!0):R.toUpperCase()!==R.toLowerCase()&&(t?(R=R.toUpperCase(),t=!1):R=R.toLowerCase());Z+=R}return Z})};z.lower=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);return b.toString(e[0]).toLowerCase()})};z.guid=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,0,1,a,B);if(0<e.length)switch(b.toString(e[0]).toLowerCase()){case "digits":return w.generateUUID().replace("-","").replace("-","").replace("-","").replace("-","");case "digits-hyphen":return w.generateUUID(); |
|
case "digits-hyphen-parentheses":return"("+w.generateUUID()+")"}return"{"+w.generateUUID()+"}"})};z.standardizeguid=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,2,2,a,B);x=b.toString(e[0]);if(""===x||null===x)return"";x=/^(\{|\()?(?<partA>[0-9a-z]{8})(-?)(?<partB>[0-9a-z]{4})(-?)(?<partC>[0-9a-z]{4})(-?)(?<partD>[0-9a-z]{4})(-?)(?<partE>[0-9a-z]{12})(\}|\))?$/gim.exec(x);if(!x)return"";x=x.groups;x=x.partA+"-"+x.partB+"-"+x.partC+"-"+x.partD+"-"+x.partE;switch(b.toString(e[1]).toLowerCase()){case "digits":return x.replace("-", |
|
"").replace("-","").replace("-","").replace("-","");case "digits-hyphen":return x;case "digits-hyphen-parentheses":return"("+x+")"}return"{"+x+"}"})};z.console=function(a,B){return G(a,B,(x,N,e)=>{0!==e.length&&(1===e.length?a.console(b.toString(e[0])):a.console(b.toString(e)));return b.voidOperation})};z.mid=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,2,3,a,B);x=b.toNumber(e[1]);if(isNaN(x))return"";0>x&&(x=0);if(2===e.length)return b.toString(e[0]).substr(x);N=b.toNumber(e[2]);if(isNaN(N))return""; |
|
0>N&&(N=0);return b.toString(e[0]).substr(x,N)})};z.find=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,2,3,a,B);x=0;if(2<e.length){x=b.toNumber(b.defaultUndefined(e[2],0));if(isNaN(x))return-1;0>x&&(x=0)}return b.toString(e[1]).indexOf(b.toString(e[0]),x)})};z.left=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,2,2,a,B);x=b.toNumber(e[1]);if(isNaN(x))return"";0>x&&(x=0);return b.toString(e[0]).substr(0,x)})};z.right=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,2,2,a,B);x=b.toNumber(e[1]); |
|
if(isNaN(x))return"";0>x&&(x=0);return b.toString(e[0]).substr(-1*x,x)})};z.split=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,2,4,a,B);x=b.toNumber(b.defaultUndefined(e[2],-1));N=b.toBoolean(b.defaultUndefined(e[3],!1));-1===x||null===x||!0===N?e=b.toString(e[0]).split(b.toString(e[1])):(isNaN(x)&&(x=-1),-1>x&&(x=-1),e=b.toString(e[0]).split(b.toString(e[1]),x));if(!1===N)return e;N=[];for(let Z=0;Z<e.length&&!(-1!==x&&N.length>=x);Z++)""!==e[Z]&&void 0!==e[Z]&&N.push(e[Z]);return N})};z.text= |
|
function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,2,a,B);return b.toStringExplicit(e[0],e[1])})};z.concatenate=function(a,B){return G(a,B,(x,N,e)=>{x=[];if(1>e.length)return"";if(b.isArray(e[0])){N=b.defaultUndefined(e[2],"");for(var Z=0;Z<e[0].length;Z++)x[Z]=b.toStringExplicit(e[0][Z],N);return 1<e.length?x.join(e[1]):x.join("")}if(b.isImmutableArray(e[0])){N=b.defaultUndefined(e[2],"");for(Z=0;Z<e[0].length();Z++)x[Z]=b.toStringExplicit(e[0].get(Z),N);return 1<e.length?x.join(e[1]):x.join("")}for(N= |
|
0;N<e.length;N++)x[N]=b.toStringExplicit(e[N]);return x.join("")})};z.reverse=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);if(b.isArray(e[0]))return x=e[0].slice(0),x.reverse(),x;if(b.isImmutableArray(e[0]))return x=e[0].toArray().slice(0),x.reverse(),x;throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.InvalidParameter,B);})};z.replace=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,3,4,a,B);x=b.toString(e[0]);N=b.toString(e[1]);const Z=b.toString(e[2]);return(4===e.length?b.toBoolean(e[3]): |
|
1)?b.multiReplace(x,N,Z):x.replace(N,Z)})};z.schema=function(a,B){return G(a,B,(x,N,e)=>{if(b.isFeature(e[0]))return(x=b.featureSchema(e[0]))?c.convertObjectToArcadeDictionary(x,b.defaultTimeZone(a)):null;throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.InvalidParameter,B);})};z.subtypes=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);if(b.isFeature(e[0]))return(x=b.featureSubtypes(e[0]))?c.convertObjectToArcadeDictionary(x,b.defaultTimeZone(a)):null;throw new y.ArcadeExecutionError(a, |
|
y.ExecutionErrorCodes.InvalidParameter,B);})};z.subtypecode=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);if(b.isFeature(e[0])){x=b.featureSubtypes(e[0]);if(!x)return null;if(x.subtypeField&&e[0].hasField(x.subtypeField)){e=e[0].field(x.subtypeField);for(const Z of x.subtypes)if(Z.code===e)return Z.code}return null}throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.InvalidParameter,B);})};z.subtypename=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);if(b.isFeature(e[0])){x= |
|
b.featureSubtypes(e[0]);if(!x)return"";if(x.subtypeField&&e[0].hasField(x.subtypeField)){e=e[0].field(x.subtypeField);for(const Z of x.subtypes)if(Z.code===e)return Z.name}return""}throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.InvalidParameter,B);})};z.gdbversion=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);if(b.isFeature(e[0]))return e[0].gdbVersion();throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.InvalidParameter,B);})};z.domain=function(a,B){return G(a,B,(x,N, |
|
e)=>{b.pcCheck(e,2,3,a,B);if(b.isFeature(e[0]))return(x=b.featureFullDomain(e[0],b.toString(e[1]),void 0===e[2]?void 0:e[2]))&&x.domain?"coded-value"===x.domain.type||"codedValue"===x.domain.type?c.convertObjectToArcadeDictionary({type:"codedValue",name:x.domain.name,dataType:q.layerFieldEsriConstants[x.field.type],codedValues:x.domain.codedValues.map(Z=>({name:Z.name,code:Z.code}))},b.defaultTimeZone(a)):c.convertObjectToArcadeDictionary({type:"range",name:x.domain.name,dataType:q.layerFieldEsriConstants[x.field.type], |
|
min:x.domain.minValue,max:x.domain.maxValue},b.defaultTimeZone(a)):null;throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.InvalidParameter,B);})};z.domainname=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,2,4,a,B);if(b.isFeature(e[0]))return b.featureDomainValueLookup(e[0],b.toString(e[1]),e[2],void 0===e[3]?void 0:e[3]);throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.InvalidParameter,B);})};z.domaincode=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,2,4,a,B);if(b.isFeature(e[0]))return b.featureDomainCodeLookup(e[0], |
|
b.toString(e[1]),e[2],void 0===e[3]?void 0:e[3]);throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.InvalidParameter,B);})};z.urlencode=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);if(null===e[0])return"";if(e[0]instanceof c){x="";for(const Z of e[0].keys())N=e[0].field(Z),""!==x&&(x+="\x26"),x=null===N?x+(encodeURIComponent(Z)+"\x3d"):x+(encodeURIComponent(Z)+"\x3d"+encodeURIComponent(N));return x}return encodeURIComponent(b.toString(e[0]))})};z.hash=function(a,B){return G(a,B, |
|
(x,N,e)=>{b.pcCheck(e,1,1,a,B);x=new d.XXH(0);l(e[0],x,{context:a,node:B,map:new Map,currentLength:0});return x.digest()})};z.convertdirection=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,3,3,a,B);return F.convertDirection(e[0],e[1],e[2])})};z.fromjson=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,1,a,B);if(!1===b.isString(e[0]))throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.InvalidParameter,B);return c.convertJsonToArcade(JSON.parse(b.toString(e[0])),b.defaultTimeZone(a))})};z.expects= |
|
function(a,B){return G(a,B,(x,N,e)=>{if(1>e.length)throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.WrongNumberOfParameters,B);return b.voidOperation})};z.tocharcode=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,1,2,a,B);x=b.toNumber(b.defaultUndefined(e[1],0));N=b.toString(e[0]);if(0===N.length&&1===e.length)return null;if(N.length<=x||0>x)throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.OutOfBounds,B);return N.charCodeAt(x)})};z.tocodepoint=function(a,B){return G(a,B,(x,N,e)=> |
|
{b.pcCheck(e,1,2,a,B);x=b.toNumber(b.defaultUndefined(e[1],0));N=b.toString(e[0]);if(0===N.length&&1===e.length)return null;if(N.length<=x||0>x)throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.OutOfBounds,B);return N.codePointAt(x)})};z.fromcharcode=function(a,B){return G(a,B,(x,N,e)=>{if(1>e.length)throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.WrongNumberOfParameters,B);x=e.map(Z=>Math.trunc(b.toNumber(Z))).filter(Z=>0<=Z&&65535>=Z);return 0===x.length?null:String.fromCharCode.apply(null, |
|
x)})};z.fromcodepoint=function(a,B){return G(a,B,(x,N,e)=>{if(1>e.length)throw new y.ArcadeExecutionError(a,y.ExecutionErrorCodes.WrongNumberOfParameters,B);let Z;try{Z=e.map(t=>Math.trunc(b.toNumber(t))).filter(t=>1114111>=t&&t>>>0===t)}catch(t){return null}return 0===Z.length?null:String.fromCodePoint.apply(null,Z)})};z.getuser=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,0,2,a,B);x=b.defaultUndefined(e[1],"");x=!0===x||!1===x?"":b.toString(x);if(null!==x&&""!==x)return null;if(0===e.length|| |
|
e[0]instanceof O){N=null;N=a.services?.portal?a.services.portal:n.getDefault();if(0<e.length&&(e=e[0].field("url"),e=e?k.hasSamePortal(e,N?.restUrl||""):!1,!e)||!N)return null;if(""===x&&(e="loaded"===N.loadStatus&&N.user?.sourceJSON?N.user.sourceJSON:null,e)){e=JSON.parse(JSON.stringify(e));for(const Z of["lastLogin","created","modified"])void 0!==e[Z]&&null!==e[Z]&&(e[Z]=new Date(e[Z]));return c.convertObjectToArcadeDictionary(e,b.defaultTimeZone(a))}return null}throw new y.ArcadeExecutionError(a, |
|
y.ExecutionErrorCodes.InvalidParameter,B);})};z.getenvironment=function(a,B){return G(a,B,(x,N,e)=>{b.pcCheck(e,0,0,a,B);return c.convertObjectToArcadeDictionary(b.defaultExecutingContext(b.defaultTimeZone(a),a.spatialReference),b.defaultTimeZone(a),!0)})}};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/ArcadePortal":function(){define(["./Dictionary"],function(D){class O extends D{constructor(E){super();this.declaredClass="esri.arcade.Portal";this.immutable=!1;this.setField("url", |
|
E);this.immutable=!0}}return O})},"esri/arcade/Attachment":function(){define(["./Dictionary"],function(D){class O extends D{constructor(E,c,y,b,q,F,d){super();this.attachmentUrl=q;this.declaredClass="esri.arcade.Attachment";this.immutable=!1;this.setField("id",E);this.setField("name",c);this.setField("contenttype",y);this.setField("size",b);this.setField("exifinfo",F);this.setField("keywords",d);this.immutable=!0}deepClone(){return new O(this.field("id"),this.field("name"),this.field("contenttype"), |
|
this.field("size"),this.attachmentUrl,this.field("exifinfo")?.deepClone()??null,this.field("keywords"))}}return O})},"esri/arcade/functions/convertdirection":function(){define(["exports","../Dictionary","../executionError","../../chunks/languageUtils","../../core/maybe"],function(D,O,E,c,y){function b(u){if(!1===c.isString(u))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.InvalidParameter,null);return u}function q(u,P){P=10**P;return Math.round(u*P)/P}function F(u){const P=parseFloat(u.toString().replace(Math.trunc(u).toString(), |
|
"0"))*Math.sign(u);return 0>u?{fraction:P,integer:Math.ceil(u)}:{fraction:P,integer:Math.floor(u)}}function d(u,P){switch(u){case X.north:return"SHORT"===P?"N":"North";case X.east:return"SHORT"===P?"E":"East";case X.south:return"SHORT"===P?"S":"South";case X.west:return"SHORT"===P?"W":"West"}}function k(u,P){return u-Math.floor(u/P)*P}function w(u){switch(u){case W.truncated_degrees:case W.decimal_degrees:return 360;case W.radians:return H;case W.gradians:return 400;case W.seconds:return 1296E3;case W.fractional_degree_minutes:return 60; |
|
case W.fractional_minute_seconds:return 60;default:throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"unsupported evaluations"});}}function C(u){switch(u.toUpperCase().trim()){case "NORTH":case "NORTHAZIMUTH":case "NORTH AZIMUTH":return ca.north_azimuth;case "POLAR":return ca.polar;case "QUADRANT":return ca.quadrant;case "SOUTH":case "SOUTHAZIMUTH":case "SOUTH AZIMUTH":return ca.south_azimuth}throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError, |
|
null,{reason:"unsupported directionType"});}function M(u){switch(u.toUpperCase().trim()){case "D":case "DD":case "DECIMALDEGREE":case "DECIMAL DEGREE":case "DEGREE":case "DECIMALDEGREES":case "DECIMAL DEGREES":case "DEGREES":return W.decimal_degrees;case "DMS":case "DEGREESMINUTESSECONDS":case "DEGREES MINUTES SECONDS":return W.degrees_minutes_seconds;case "R":case "RAD":case "RADS":case "RADIAN":case "RADIANS":return W.radians;case "G":case "GON":case "GONS":case "GRAD":case "GRADS":case "GRADIAN":case "GRADIANS":return W.gradians}throw new E.ArcadeExecutionError(null, |
|
E.ExecutionErrorCodes.LogicError,null,{reason:"unsupported units"});}function A(u,P,S){let V=null;switch(P){case W.decimal_degrees:V=Z(u,3600);break;case W.seconds:V=u;break;case W.gradians:V=Z(u,3240);break;case W.radians:V=Z(u,R);break;default:throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"unexpected evaluation"});}switch(S){case W.decimal_degrees:return t(V,3600);case W.seconds:return V;case W.gradians:return t(V,3240);case W.radians:return V/R;default:throw new E.ArcadeExecutionError(null, |
|
E.ExecutionErrorCodes.LogicError,null,{reason:"unexpected evaluation"});}}function f(u){y.assertIsSome(u);switch(u){case W.decimal_degrees:case W.truncated_degrees:case W.degrees_minutes_seconds:return W.decimal_degrees;case W.gradians:return W.gradians;case W.fractional_degree_minutes:return W.fractional_degree_minutes;case W.radians:return W.radians;case W.seconds:case W.fractional_minute_seconds:return W.seconds}}function m(u){switch(c.toNumber(u)){case 1:return{first:X.north,second:X.east};case 2:return{first:X.south, |
|
second:X.east};case 3:return{first:X.south,second:X.west};case 4:return{first:X.north,second:X.west}}return null}function r(u){switch(u.toUpperCase().trim()){case "N":case "NORTH":return X.north;case "E":case "EAST":return X.east;case "S":case "SOUTH":return X.south;case "W":case "WEST":return X.west}return null}function n(u){u=parseFloat(u);if(c.isNumber(u)){if(isNaN(u))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"invalid conversion"});return u}throw new E.ArcadeExecutionError(null, |
|
E.ExecutionErrorCodes.LogicError,null,{reason:"invalid conversion"});}function g(u,P,S){const V=S===ca.quadrant;let ha=null;var qa=null;let ra=0;var h=0;h=0;if(V){if(2>u.length)throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"conversion error"});h=1;(qa=m(c.toString(u[u.length-1])))?(ha=qa.first,qa=qa.second):(ra=1,ha=r(c.toString(u[0])),qa=r(c.toString(u[u.length-1])));if(null===ha||null===qa)throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError, |
|
null,{reason:"invalid conversion"});}switch(P){case W.decimal_degrees:case W.radians:case W.gradians:if(0===u.length)break;return V?sa.createFromAngleMeridianAndDirection(I.createFromAngleAndUnits(n(u[ra]),f(P)),ha,qa):sa.createFromAngleAndDirection(I.createFromAngleAndUnits(n(u[ra]),f(P)),S);case W.degrees_minutes_seconds:h=u.length-h-ra;if(3===h)return u=I.createFromDegreesMinutesSeconds(n(u[ra]),n(u[ra+1]),n(u[ra+2])),V?sa.createFromAngleMeridianAndDirection(u,ha,qa):sa.createFromAngleAndDirection(u, |
|
S);if(1===h)return u=n(u[ra]),u=pa.numberToDms(u),u=I.createFromDegreesMinutesSeconds(u.m_degrees,u.m_minutes,u.m_seconds),V?sa.createFromAngleMeridianAndDirection(u,ha,qa):sa.createFromAngleAndDirection(u,S)}throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"invalid conversion"});}function l(u){const P=new Set([" ","-","/","'",'"',"\\","^","\u00b0",U,"\t","\r","\n","*"]);let S="";for(let V=0;V<u.length;V++){const ha=u.charAt(V);S=P.has(ha)?S+"RRSPLITRRSPLITRR":S+ |
|
ha}return S.split("RRSPLITRRSPLITRR").filter(V=>""!==V)}function z(u,P,S){const V={padding:0,rounding:0,newpos:P};let ha=!1;for(;P<u.length;){const qa=u[P];if(qa===S)ha?V.rounding++:V.padding++,P++;else if("."===qa)ha=!0,P++;else break}V.newpos=P-1;return V}const G=u=>(P,S,V)=>{V=V||14;return+u(P,S).toFixed(V)},a=(u,P)=>u+P,B=(u,P)=>u-P,x=(u,P)=>u*P,N=(u,P)=>u/P,e=(u,P,S)=>G(a)(u,P,S),Z=(u,P,S)=>G(x)(u,P,S),t=(u,P,S)=>G(N)(u,P,S),H=2*Math.PI,R=648E3/Math.PI,U=String.fromCharCode(7501);var X;(function(u){u[u.north= |
|
0]="north";u[u.east=1]="east";u[u.south=2]="south";u[u.west=3]="west"})(X||={});var W;(function(u){u[u.decimal_degrees=1]="decimal_degrees";u[u.seconds=2]="seconds";u[u.degrees_minutes_seconds=3]="degrees_minutes_seconds";u[u.radians=4]="radians";u[u.gradians=5]="gradians";u[u.truncated_degrees=6]="truncated_degrees";u[u.fractional_degree_minutes=7]="fractional_degree_minutes";u[u.fractional_minute_seconds=8]="fractional_minute_seconds"})(W||={});var ca;(function(u){u[u.north_azimuth=1]="north_azimuth"; |
|
u[u.polar=2]="polar";u[u.quadrant=3]="quadrant";u[u.south_azimuth=4]="south_azimuth"})(ca||={});var wa;(function(u){u[u.meridian=0]="meridian";u[u.direction=1]="direction"})(wa||={});class pa{constructor(u,P,S){this.m_degrees=u;this.m_minutes=P;this.m_seconds=S}getField(u){switch(u){case W.decimal_degrees:case W.truncated_degrees:return this.m_degrees;case W.fractional_degree_minutes:return this.m_minutes;case W.seconds:case W.fractional_minute_seconds:return this.m_seconds;default:throw new E.ArcadeExecutionError(null, |
|
E.ExecutionErrorCodes.LogicError,null,{reason:"unexpected evaluation"});}}static secondsToDMS(u){const P=F(u).fraction;u=F(u).integer;const S=Math.floor(u/3600);u-=3600*S;const V=Math.floor(u/60);return new pa(S,V,u-60*V+P)}static numberToDms(u){var P=F(u).fraction;u=F(u).integer;const S=Z(F(100*P).fraction,100);P=F(100*P).integer;return new pa(u,P,S)}format(u,P){P=q(this.m_seconds,P);let S=this.m_minutes,V=this.m_degrees;if(u===W.seconds||u===W.fractional_minute_seconds)60<=P&&(P-=60,++S),60<=S&& |
|
(S=0,++V),360<=V&&(V=0);else if(u===W.fractional_degree_minutes)P=0,S=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,V=this.m_degrees,60<=S&&(S=0,++V),360<=V&&(V=0);else if(u===W.decimal_degrees||u===W.truncated_degrees)u=t(this.m_seconds,3600),P=t(this.m_minutes,60),V=Math.round(this.m_degrees+P+u),P=S=0;return new pa(V,S,P)}static dmsToSeconds(u,P,S){return 3600*u+60*P+S}}class xa{constructor(u,P,S){this.meridian=u;this.angle=P;this.direction=S}fetchAzimuth(u){return u===wa.meridian?this.meridian: |
|
this.direction}}class sa{constructor(u){this._angle=u}static createFromAngleAndDirection(u,P){return new sa(new I(sa._convertDirectionFormat(u.extractAngularUnits(W.seconds),P,ca.north_azimuth)))}getAngle(u){const P=this._angle.extractAngularUnits(W.seconds);switch(u){case ca.north_azimuth:case ca.south_azimuth:case ca.polar:return new I(sa._convertDirectionFormat(P,ca.north_azimuth,u));case ca.quadrant:return u=sa.secondsNorthAzimuthToQuadrant(P),new I(u.angle)}}getMeridian(u){const P=this._angle.extractAngularUnits(W.seconds); |
|
switch(u){case ca.north_azimuth:return X.north;case ca.south_azimuth:return X.south;case ca.polar:return X.east;case ca.quadrant:return sa.secondsNorthAzimuthToQuadrant(P).meridian}}getDirection(u){const P=this._angle.extractAngularUnits(W.seconds);switch(u){case ca.north_azimuth:return X.east;case ca.south_azimuth:return X.west;case ca.polar:return X.north;case ca.quadrant:return sa.secondsNorthAzimuthToQuadrant(P).direction}}static secondsNorthAzimuthToQuadrant(u){const P=324E3>=u||972E3<=u?X.north: |
|
X.south;return new xa(P,P===X.north?Math.min(1296E3-u,u):Math.abs(u-648E3),648E3<u?X.west:X.east)}static createFromAngleMeridianAndDirection(u,P,S){return new sa(new I(sa.secondsQuadrantToNorthAzimuth(u.extractAngularUnits(W.seconds),P,S)))}static secondsQuadrantToNorthAzimuth(u,P,S){return P===X.north?S===X.east?u:1296E3-u:S===X.east?648E3-u:648E3+u}static _convertDirectionFormat(u,P,S){let V=0;switch(P){case ca.north_azimuth:V=u;break;case ca.polar:V=324E3-u;break;case ca.quadrant:throw new E.ArcadeExecutionError(null, |
|
E.ExecutionErrorCodes.LogicError,null,{reason:"unexpected evaluation"});case ca.south_azimuth:V=u+648E3}u=0;switch(S){case ca.north_azimuth:u=V;break;case ca.polar:u=324E3-V;break;case ca.quadrant:throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"unexpected evaluation"});case ca.south_azimuth:u=V-648E3}u%=1296E3;return 0>u?1296E3+u:u}}class I{constructor(u){this._seconds=u}static createFromAngleAndUnits(u,P){return new I(A(u,P,W.seconds))}extractAngularUnits(u){return A(this._seconds, |
|
W.seconds,f(u))}static createFromDegreesMinutesSeconds(u,P,S){return new I(e(e(Z(u,3600),Z(P,60)),S))}}class J{constructor(u,P,S,V){this.view=u;this.angle=P;this.merdian=S;this.direction=V;this._formattedDms=this._dms=null}static createFromStringAndBearing(u,P,S){return new J(u,P.getAngle(S),P.getMeridian(S),P.getDirection(S))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){null===this._dms&&this._calculateDms(); |
|
return this._dms}fetchFormattedDms(){null===this._formattedDms&&this._calculateDms();return this._formattedDms}_calculateDms(){var u=null;let P=W.truncated_degrees,S=0;for(u=0;u<this.view.length;u++){const V=this.view[u];switch(V){case "m":u=z(this.view,u,V);P=P===W.truncated_degrees?W.fractional_degree_minutes:P;u=u.newpos;continue;case "s":u=z(this.view,u,V),P=W.fractional_minute_seconds,S=S<u.rounding?u.rounding:S,u=u.newpos}}this._dms=pa.secondsToDMS(this.angle.extractAngularUnits(W.seconds)); |
|
this._formattedDms=pa.secondsToDMS(this.angle.extractAngularUnits(W.seconds)).format(P,S)}}D.convertDirection=function(u,P,S){if(!(P instanceof O))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.InvalidParameter,null);if(!1===P.hasField("directionType"))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"missing directionType"});if(!1===P.hasField("angleType"))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"missing angleType"}); |
|
var V=C(b(P.field("directiontype")));P=M(b(P.field("angletype")));if(c.isNumber(u)){u=c.toNumber(u);if(V===ca.quadrant)throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"conversion error"});P===W.degrees_minutes_seconds?(u=pa.numberToDms(u),V=sa.createFromAngleAndDirection(I.createFromDegreesMinutesSeconds(u.m_degrees,u.m_minutes,u.m_seconds),V)):V=sa.createFromAngleAndDirection(I.createFromAngleAndUnits(u,f(P)),V)}else if(c.isString(u))V=g(l(u),P,V);else if(c.isArray(u))V= |
|
g(u,P,V);else if(c.isImmutableArray(u))V=g(u.toArray(),P,V);else throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"conversion error"});if(!(S instanceof O))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.InvalidParameter,null);if(!1===S.hasField("directionType"))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"missing directionType"});if(!1===S.hasField("outputType"))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError, |
|
null,{reason:"missing angleType"});u=C(b(S.field("directiontype")));P=S.hasField("angleType")?M(b(S.field("angletype"))):null;var ha=b(S.field("outputType")).toUpperCase().trim();if(!u||!ha)throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"conversion error"});if(!(P||"TEXT"===ha&&S.hasField("format")))throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"invalid unit"});switch(ha){case "VALUE":if(u===ca.quadrant||P===W.degrees_minutes_seconds)return S= |
|
V.getAngle(u),u===ca.quadrant&&P===W.degrees_minutes_seconds?(S=pa.secondsToDMS(S.extractAngularUnits(W.seconds)),V=[d(V.getMeridian(u),"SHORT"),S.m_degrees,S.m_minutes,S.m_seconds,d(V.getDirection(u),"SHORT")]):P===W.degrees_minutes_seconds?(V=pa.secondsToDMS(S.extractAngularUnits(W.seconds)),V=[V.m_degrees,V.m_minutes,V.m_seconds]):V=u===ca.quadrant?[d(V.getMeridian(u),"SHORT"),S.extractAngularUnits(P),d(V.getDirection(u),"SHORT")]:[S.extractAngularUnits(P)],V;if((S=f(P))&&P!==W.degrees_minutes_seconds)V= |
|
V.getAngle(u).extractAngularUnits(S);else throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"conversion error"});return V;case "TEXT":ha="";S.hasField("format")&&(ha=c.toString(S.field("format")));if(null===ha||""===ha){S="";switch(P){case W.decimal_degrees:S=u===ca.quadrant?"DD.DD\u00b0":"DDD.DD\u00b0";break;case W.degrees_minutes_seconds:S=u===ca.quadrant?"dd\u00b0 mm' ss\"":"ddd\u00b0 mm' ss.ss\"";break;case W.radians:S="R.RR";break;case W.gradians:S="GGG.GG"+ |
|
U;break;default:throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"conversion error"});}u===ca.quadrant&&(S="p "+S+" b");ha=S}S=ha;var qa="",ra=null,h=null;P=J.createFromStringAndBearing(S,V,u);ha={D:W.decimal_degrees,d:W.truncated_degrees,m:W.fractional_degree_minutes,s:W.fractional_minute_seconds,R:W.radians,G:W.gradians};for(h=0;h<S.length;h++){var p=S[h];switch(p){case "[":ra=S;p={escaped:"",newpos:h};for(h++;h<ra.length;){var L=ra[h];h++;if("]"===L)break;p.escaped+= |
|
L}p.newpos=h-1;ra=p;qa+=ra.escaped;h=ra.newpos;continue;case "D":case "d":case "m":case "s":case "R":case "G":ra=z(S,h,p);h=V.getAngle(u);a:{p=ha[p];L=ra.padding;var Q=ra.rounding,Y=P;let aa=null;switch(p){case W.decimal_degrees:case W.radians:case W.gradians:aa=k(q(h.extractAngularUnits(p),Q),w(p));h=aa.toFixed(Q).padStart(L+Q+(0<Q?1:0),"0");break a;case W.truncated_degrees:case W.fractional_degree_minutes:aa=k(Y.fetchFormattedDms().getField(p),w(p));h=aa.toFixed(Q).padStart(L+Q+(0<Q?1:0),"0");break a; |
|
case W.fractional_minute_seconds:aa=k(q(Y.fetchDms().getField(p),Q),w(p));h=aa.toFixed(Q).padStart(L+Q+(0<Q?1:0),"0");break a;default:throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.LogicError,null,{reason:"unexpected evaluation"});}}qa+=h;h=ra.newpos;continue;case "P":case "p":qa+=d(P.fetchMeridian(),"p"===p?"SHORT":"LONG");continue;case "B":case "b":qa+=d(P.fetchDirection(),"b"===p?"SHORT":"LONG");continue;default:qa+=p}}return qa;default:throw new E.ArcadeExecutionError(null,E.ExecutionErrorCodes.InvalidParameter, |
|
null);}};D.preciseAdd=e;D.preciseDivide=t;D.preciseMinus=(u,P,S)=>G(B)(u,P,S);D.preciseMultiply=Z;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/functions/hash":function(){define(["exports"],function(D){function O(c){const y=[];for(let b=0,q=c.length;b<q;b++){let F=c.charCodeAt(b);128>F?y.push(F):2048>F?y.push(192|F>>6,128|F&63):55296>F||57344<=F?y.push(224|F>>12,128|F>>6&63,128|F&63):(b++,F=65536+((F&1023)<<10|c.charCodeAt(b)&1023),y.push(240|F>>18,128|F>>12&63,128| |
|
F>>6&63,128|F&63))}return new Uint8Array(y)}class E{constructor(c){this._seed=c;this._totallen=0;this._bufs=[];this.init()}init(){this._bufs=[];this._totallen=0;return this}updateFloatArray(c){const y=[];for(const b of c)isNaN(b)?y.push("NaN"):Infinity===b?y.push("Infinity"):-Infinity===b?y.push("-Infinity"):0===b?y.push("0"):y.push(b.toString(16));this.update(O(y.join("")))}updateIntArray(c){c=Int32Array.from(c);this.update(new Uint8Array(c.buffer))}updateUint8Array(c){this.update(Uint8Array.from(c))}updateWithString(c){return this.update(O(c))}update(c){this._bufs.push(c); |
|
this._totallen+=c.length;return this}digest(){const c=new Uint8Array(this._totallen);let y=0;for(const b of this._bufs)c.set(b,y),y+=b.length;this.init();return this._xxHash32(c,this._seed)}_xxHash32(c,y=0){var b=y+374761393&4294967295;let q=0;if(16<=c.length){b=[y+2654435761+2246822519&4294967295,y+2246822519&4294967295,y+0&4294967295,y-2654435761&4294967295];y=c.length-16;var F=0;for(q=0;(q&4294967280)<=y;q+=4){var d=q;d=b[F]+(2246822519*(c[d]+(c[d+1]<<8))+(2246822519*(c[d+2]+(c[d+3]<<8))<<16))& |
|
4294967295;d=d<<13|d>>>19;b[F]=2654435761*(d&65535)+(2654435761*(d>>>16)<<16)&4294967295;F=F+1&3}b=(b[0]<<1|b[0]>>>31)+(b[1]<<7|b[1]>>>25)+(b[2]<<12|b[2]>>>20)+(b[3]<<18|b[3]>>>14)&4294967295}b=b+c.length&4294967295;for(y=c.length-4;q<=y;q+=4)F=q,b=b+(3266489917*(c[F]+(c[F+1]<<8))+(3266489917*(c[F+2]+(c[F+3]<<8))<<16))&4294967295,b=b<<17|b>>>15,b=668265263*(b&65535)+(668265263*(b>>>16)<<16)&4294967295;for(;q<c.length;++q)b+=374761393*c[q],b=b<<11|b>>>21,b=2654435761*(b&65535)+(2654435761*(b>>>16)<< |
|
16)&4294967295;b^=b>>>15;b=(2246822519*(b&65535)&4294967295)+(2246822519*(b>>>16)<<16);b^=b>>>13;b=(3266489917*(b&65535)&4294967295)+(3266489917*(b>>>16)<<16);b^=b>>>16;return 0>b?b+4294967296:b}}D.XXH=E;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/ArcadeModuleResolver":function(){define("exports ../request ./executionError ./parser ./featureset/support/RecentlyUsedCache ../portal/Portal".split(" "),function(D,O,E,c,y,b){class q{constructor(F){this.portalUri=F}normalizeModuleUri(F){const d= |
|
/^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([?|/].*)?$/gi;var k=/(?<portalurl>.+)\/home\/item\.html\?id=(?<itemid>.+)$/gi;const w=/(?<portalurl>.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?<itemid>.+)$/gi,C=/(?<portalurl>.+)\/sharing\/rest\/content\/items\/(?<itemid>.+)$/gi;var M=/(?<itemid>.*)@(?<versionstring>[0-9]+\.[0-9]+\.[0-9]+)([?|/].*)?$/gi;if(F.startsWith("portal+")){let m=F.substring(7);var A="",f=m;let r=!1;for(const n of[k,C,w])if(k=n.exec(m),null!==k){A=k.groups;f=A.itemid; |
|
A=A.portalurl;r=!0;break}if(!1===r)if(d.test(m))f=m,A=this.portalUri;else throw new E.ModuleError(E.ModuleErrorCodes.UnsupportedUriProtocol,{uri:F});f.includes("/")&&(f=f.split("/")[0]);f.includes("?")&&(f=f.split("?")[0]);F="current";M=M.exec(f);null!==M&&(F=M.groups,f=F.itemid,F=F.versionstring);m=(new b({url:A})).restUrl+"/content/items/"+f+"/resources/"+F+".arc";return{url:m,scheme:"portal",uri:"PO:"+m}}if(F.startsWith("mock")){if("mock"===F)return{url:"",scheme:"mock",data:'\n export var hello \x3d 1;\n export function helloWorld() {\n return "Hello World " + hello;\n }\n ', |
|
uri:"mock"};f=F.replace("mock:","");if(void 0!==q.mocks[f])return{url:"",scheme:"mock",data:q.mocks[f],uri:F}}throw new E.ModuleError(E.ModuleErrorCodes.UnrecognizedUri,{uri:F});}async fetchModule(F){var d=q.cachedModules.getFromCache(F.uri);if(d)return d;d=this.fetchSource(F);q.cachedModules.addToCache(F.uri,d);let k=null;try{k=await d}catch(w){throw q.cachedModules.removeFromCache(F.uri),w;}return k}async fetchSource(F){if("portal"===F.scheme){const d=await O(F.url,{responseType:"text",query:{}}); |
|
if(d.data)return c.parseScript(d.data,[])}if("mock"===F.scheme)return c.parseScript(F.data??"",[]);throw new E.ModuleError(E.ModuleErrorCodes.UnsupportedUriProtocol);}static create(F){return new q(F)}static getDefault(){return this._default??(q._default=q._moduleResolverFactory())}static set moduleResolverClass(F){this._moduleResolverFactory=F;this._default=null}}q.mocks={};q.cachedModules=new y(30);q._default=null;q._moduleResolverFactory=()=>{const F=b.getDefault();return new q(F.url)};D.ArcadeModuleResolver= |
|
q;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/arcade/parser":function(){define(["exports","../chunks/index","./treeAnalysis"],function(D,O,E){D.parseScript=function(c,y=[]){c=O.rt(c);if(null===c.body||void 0===c.body)throw new O.T({index:0,line:0,column:0,data:null,description:"",code:O.o.InvalidExpression});c.loadedModules={};E.findScriptDependencies(c,y);return c};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/index":function(){define(["exports"], |
|
function(D){function O(t){return!!t&&"object"==typeof t&&"type"in t&&t.type===k.BlockStatement}function E(t){return!!t&&"object"==typeof t&&"type"in t&&t.type===k.EmptyStatement}function c(t,H){return H.loc.end.line===t.loc.start.line&&H.loc.end.column<=t.loc.start.column}function y(t,H){t=n[t];return H?t.replace(z,(R,U)=>H[U]?.toString()??""):t}function b(t,H=0){let R=t.start-t.lineStart,U=t.lineNumber;return 0>R&&(R+=H,--U),{index:t.start,line:U,column:R}}function q(t){return[{index:t.range[0], |
|
...t.loc.start},{index:t.range[1],...t.loc.end}]}function F(t){return t in f?f[t]:0}var d={Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},k={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression", |
|
ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression", |
|
MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},w=["++","--"],C=["-","+","!","~"],M="\x3d /\x3d *\x3d %\x3d +\x3d -\x3d".split(" "),A=["||","\x26\x26"], |
|
f={"||":1,"\x26\x26":2,"|":3,"^":4,"\x26":5,"\x3d\x3d":6,"!\x3d":6,"\x3c":7,"\x3e":7,"\x3c\x3d":7,"\x3e\x3d":7,"\x3c\x3c":8,"\x3e\x3e":8,"\x3e\x3e\x3e":8,"+":9,"-":9,"*":10,"/":10,"%":10},m="Unknown Boolean \x3cend\x3e Identifier Keyword Null Numeric Punctuator String RegularExpression Template".split(" "),r={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentiferExpected:"IdentiferExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression", |
|
InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly", |
|
PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},n={[r.InvalidModuleUri]:"Module uri must be a text literal.", |
|
[r.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[r.IdentiferExpected]:"'${value}' is an invalid identifier.",[r.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[r.InvalidExpression]:"Invalid expression.",[r.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[r.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[r.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[r.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.", |
|
[r.InvalidTemplateHead]:"Invalid template structure.",[r.InvalidVariableAssignment]:"Invalid variable assignment.",[r.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[r.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[r.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[r.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[r.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.", |
|
[r.PunctuatorExpected]:"'${value}' expected.",[r.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[r.UnexpectedBoolean]:"Unexpected boolean literal.",[r.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[r.UnexpectedIdentifier]:"Unexpected identifier.",[r.UnexpectedKeyword]:"Unexpected keyword.",[r.UnexpectedNull]:"Unexpected null literal.",[r.UnexpectedNumber]:"Unexpected number.",[r.UnexpectedPunctuator]:"Unexpected ponctuator.",[r.UnexpectedString]:"Unexpected text literal.", |
|
[r.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[r.UnexpectedToken]:"Unexpected token '${value}'."},g=class t extends Error{constructor({code:H,index:R,line:U,column:X,len:W=0,description:ca,data:wa}){super(ca??H);this.declaredRootClass="esri.arcade.lib.diagnostic";this.name="ParsingError";this.code=H;this.index=R;this.line=U;this.column=X;this.len=W;this.data=wa;this.description=ca;this.range={start:{line:U,column:X-1},end:{line:U,column:X+W}};Error.captureStackTrace?.(this,t)}},l=class{constructor(){this.comments= |
|
[];this._nodeStack=[];this._newComments=[]}insertInnerComments(t){if(O(t)&&0===t.body.length){var H=[];for(let R=this._newComments.length-1;0<=R;R--){let U=this._newComments[R];t.range[1]>=U.range[0]&&(H.unshift(U),this._newComments.splice(R,1))}H.length&&(t.innerComments=H)}}attachTrailingComments(t){let H=this._nodeStack.at(-1);if(H){if(O(t)&&H.range[0]>=t.range[0]&&H.range[1]<=t.range[1])for(var R=this._newComments.length-1;0<=R;R--){var U=this._newComments[R];U.range[0]>=t.range[0]&&U.range[1]<= |
|
t.range[1]&&(H.trailingComments=[...(H.trailingComments??[]),U],this._newComments.splice(R,1))}R=[];if(0<this._newComments.length)for(U=this._newComments.length-1;0<=U;U--){let X=this._newComments[U];c(X,H)?(H.trailingComments=[...(H.trailingComments??[]),X],this._newComments.splice(U,1)):c(X,t)&&(R.unshift(X),this._newComments.splice(U,1))}H.trailingComments&&c(H.trailingComments[0],t)&&(R=[...R,...H.trailingComments],delete H.trailingComments);0<R.length&&(t.trailingComments=R)}}attachLeadingComments(t){for(var H;0< |
|
this._nodeStack.length;){var R=this._nodeStack[this._nodeStack.length-1];if(t.range[0]<=R.range[0])H=R,this._nodeStack.pop();else break}R=[];var U=[];if(null!=H){if(H.leadingComments){for(let X=H.leadingComments.length-1;0<=X;X--){let W=H.leadingComments[X];t.range[0]>=W.range[1]?(R.unshift(W),H.leadingComments.splice(X,1)):t&&"object"==typeof t&&"type"in t&&t.type===k.VariableDeclarator&&!(W&&"object"==typeof W&&"type"in W&&W.type===k.BlockComment)&&(U.unshift(W),H.leadingComments.splice(X,1))}0=== |
|
H.leadingComments.length&&delete H.leadingComments;R.length&&(t.leadingComments=R);U.length&&(t.trailingComments=[...U,...(t.trailingComments??[])])}}else{for(H=this._newComments.length-1;0<=H;H--)U=this._newComments[H],t.range[0]>=U.range[0]&&(R.unshift(U),this._newComments.splice(H,1));R.length&&(t.leadingComments=R)}}attachComments(t){if(t&&"object"==typeof t&&"type"in t&&t.type===k.Program&&0<t.body.length){let H=this._nodeStack.at(-1);H?(H.trailingComments=[...(H.trailingComments??[]),...this._newComments], |
|
this._newComments.length=0,this._nodeStack.pop()):(t.trailingComments=[...this._newComments],this._newComments.length=0)}else this.attachTrailingComments(t),this.attachLeadingComments(t),this.insertInnerComments(t),this._nodeStack.push(t)}collectComment(t){this.comments.push(t);this._newComments.push(t)}},z=/\$\{(.*?)\}/gu,G=class{constructor(t=!1){this.tolerant=t;this.errors=[]}recordError(t){this.errors.push(t)}tolerate(t){if(this.tolerant)this.recordError(t);else throw t;}throwError(t){throw t.description?? |
|
(t.description=y(t.code,t.data)),new g(t);}tolerateError(t){t.description??(t.description=y(t.code,t.data));t=new g(t);if(this.tolerant)this.recordError(t);else throw t;}},a=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/u, |
|
B=/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/u, |
|
x={fromCodePoint(t){return 65536>t?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10))+String.fromCharCode(56320+(t-65536&1023))},isWhiteSpace(t){return 32===t||9===t||11===t||12===t||160===t||5760<=t&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)},isLineTerminator(t){return 10===t||13===t||8232===t||8233===t},isIdentifierStart(t){return 36===t||95===t||65<=t&&90>=t||97<=t&&122>=t||92===t||128<=t&&a.test(x.fromCodePoint(t))},isIdentifierPart(t){return 36=== |
|
t||95===t||65<=t&&90>=t||97<=t&&122>=t||48<=t&&57>=t||92===t||128<=t&&B.test(x.fromCodePoint(t))},isDecimalDigit(t){return 48<=t&&57>=t},isHexDigit(t){return 48<=t&&57>=t||65<=t&&70>=t||97<=t&&102>=t},isOctalDigit(t){return 48<=t&&55>=t}},N=[[],[],[]];w.forEach(t=>N[t.length-1]?.push(t));C.forEach(t=>N[t.length-1]?.push(t));A.forEach(t=>N[t.length-1]?.push(t));M.forEach(t=>N[t.length-1]?.push(t));"| \x26 \x3e\x3e \x3c\x3c \x3e\x3e\x3e ^ \x3d\x3d !\x3d \x3c \x3c\x3d \x3e \x3e\x3d + - * / %".split(" ").forEach(t=> |
|
N[t.length-1]?.push(t));var e=class{constructor(t,H){this.source=t;this.errorHandler=H;this._length=t.length;this.index=0;this.lineNumber=1;this.lineStart=0;this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(t){this.index=t.index;this.lineNumber=t.lineNumber;this.lineStart=t.lineStart;this.curlyStack=t.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(t=r.UnexpectedToken){this.errorHandler.throwError({code:t, |
|
index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1,data:{value:this.source.charAt(this.index)}})}tolerateUnexpectedToken(t=r.UnexpectedToken){this.errorHandler.tolerateError({code:t,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(t){let H=[],R=this.index-t,U={start:{line:this.lineNumber,column:this.index-this.lineStart-t},end:{line:0,column:0}};for(;!this.eof();){let X=this.source.charCodeAt(this.index);if(this.index+=1,x.isLineTerminator(X))return U.end= |
|
{line:this.lineNumber,column:this.index-this.lineStart-1},H.push({multiLine:!1,start:R+t,end:this.index-1,range:[R,this.index-1],loc:U}),13===X&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index,H}U.end={line:this.lineNumber,column:this.index-this.lineStart};return H.push({multiLine:!1,start:R+t,end:this.index,range:[R,this.index],loc:U}),H}skipMultiLineComment(){let t=[],H=this.index-2,R={start:{line:this.lineNumber,column:this.index-this.lineStart- |
|
2},end:{line:0,column:0}};for(;!this.eof();){let U=this.source.charCodeAt(this.index);if(x.isLineTerminator(U))13===U&&10===this.source.charCodeAt(this.index+1)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index+=1;else{if(42===U&&47===this.source.charCodeAt(this.index+1))return this.index+=2,R.end={line:this.lineNumber,column:this.index-this.lineStart},t.push({multiLine:!0,start:H+2,end:this.index-2,range:[H,this.index],loc:R}),t;this.index+=1}}R.end={line:this.lineNumber,column:this.index- |
|
this.lineStart};return t.push({multiLine:!0,start:H+2,end:this.index,range:[H,this.index],loc:R}),this.tolerateUnexpectedToken(),t}scanComments(){let t=[];for(;!this.eof();){var H=this.source.charCodeAt(this.index);if(x.isWhiteSpace(H))this.index+=1;else if(x.isLineTerminator(H))this.index+=1,13===H&&10===this.source.charCodeAt(this.index)&&(this.index+=1),this.lineNumber+=1,this.lineStart=this.index;else if(47===H)if(H=this.source.charCodeAt(this.index+1),47===H)this.index+=2,H=this.skipSingleLineComment(2), |
|
t=[...t,...H];else if(42===H)this.index+=2,H=this.skipMultiLineComment(),t=[...t,...H];else break;else break}return t}isKeyword(t){switch(t=t.toLowerCase(),t.length){case 2:return t===d.If||t===d.In;case 3:return t===d.Var||t===d.For;case 4:return t===d.Else;case 5:return t===d.Break||t===d.While;case 6:return t===d.Return||t===d.Import||t===d.Export;case 8:return t===d.Function||t===d.Continue;default:return!1}}codePointAt(t){let H=this.source.charCodeAt(t);55296<=H&&56319>=H&&(t=this.source.charCodeAt(t+ |
|
1),56320<=t&&57343>=t&&(H=1024*(H-55296)+t-56320+65536));return H}scanHexEscape(t){t="u"===t?4:2;let H=0;for(let R=0;R<t;R++)if(!this.eof()&&x.isHexDigit(this.source.charCodeAt(this.index)))H=16*H+"0123456789abcdef".indexOf((this.source[this.index]??"").toLowerCase()),this.index+=1;else return null;return String.fromCharCode(H)}scanUnicodeCodePointEscape(){let t=this.source[this.index],H=0;for("}"===t&&this.throwUnexpectedToken();!this.eof()&&(t=this.source[this.index]??"",this.index+=1,x.isHexDigit(t.charCodeAt(0)));)H= |
|
16*H+"0123456789abcdef".indexOf(t.toLowerCase());return(1114111<H||"}"!==t)&&this.throwUnexpectedToken(),x.fromCodePoint(H)}getIdentifier(){let t=this.index;for(this.index+=1;!this.eof();){let H=this.source.charCodeAt(this.index);if(92===H||55296<=H&&57343>H)return this.index=t,this.getComplexIdentifier();if(x.isIdentifierPart(H))this.index+=1;else break}return this.source.slice(t,this.index)}getComplexIdentifier(){let t=this.codePointAt(this.index),H=x.fromCodePoint(t);this.index+=H.length;let R; |
|
for(92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),this.index+=1,"{"===this.source[this.index]?(this.index+=1,R=this.scanUnicodeCodePointEscape()):(R=this.scanHexEscape("u"),(null===R||"\\"===R||!x.isIdentifierStart(R.charCodeAt(0)))&&this.throwUnexpectedToken()),H=R);!this.eof()&&(t=this.codePointAt(this.index),x.isIdentifierPart(t));)R=x.fromCodePoint(t),H+=R,this.index+=R.length,92===t&&(H=H.substring(0,H.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(), |
|
this.index+=1,"{"===this.source[this.index]?(this.index+=1,R=this.scanUnicodeCodePointEscape()):(R=this.scanHexEscape("u"),(null===R||"\\"===R||!x.isIdentifierPart(R.charCodeAt(0)))&&this.throwUnexpectedToken()),H+=R);return H}octalToDecimal(t){let H="0"!==t,R="01234567".indexOf(t);return!this.eof()&&x.isOctalDigit(this.source.charCodeAt(this.index))&&(H=!0,R=8*R+"01234567".indexOf(this.source[this.index]??""),this.index+=1,"0123".includes(t)&&!this.eof()&&x.isOctalDigit(this.source.charCodeAt(this.index))&& |
|
(R=8*R+"01234567".indexOf(this.source[this.index]??""),this.index+=1)),{code:R,octal:H}}scanIdentifier(){let t,H=this.index,R=92===this.source.charCodeAt(H)?this.getComplexIdentifier():this.getIdentifier();if(1===R.length?t=3:this.isKeyword(R)?t=4:"null"===R.toLowerCase()?t=5:"true"===R.toLowerCase()||"false"===R.toLowerCase()?t=1:t=3,3!==t&&H+R.length!==this.index){let U=this.index;this.index=H;this.tolerateUnexpectedToken(r.InvalidEscapedReservedWord);this.index=U}return{type:t,value:R,lineNumber:this.lineNumber, |
|
lineStart:this.lineStart,start:H,end:this.index}}scanPunctuator(){let t=this.index,H=this.source[this.index]??"";switch(H){case "(":case "{":"{"===H&&this.curlyStack.push("{");this.index+=1;break;case ".":this.index+=1;break;case "}":this.index+=1;this.curlyStack.pop();break;case ")":case ";":case ",":case "[":case "]":case ":":case "?":case "~":this.index+=1;break;default:for(let R=N.length;0<R;R--)if(H=this.source.substring(this.index,this.index+R),N[R-1]?.includes(H)){this.index+=R;break}}return this.index=== |
|
t&&this.throwUnexpectedToken(),{type:7,value:H,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanHexLiteral(t){let H="";for(;!this.eof()&&x.isHexDigit(this.source.charCodeAt(this.index));)H+=this.source[this.index],this.index+=1;return 0===H.length&&this.throwUnexpectedToken(),x.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:Number.parseInt(`0x${H}`,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanBinaryLiteral(t){let H= |
|
"";for(;!this.eof();){var R=this.source[this.index];if("0"!==R&&"1"!==R)break;H+=this.source[this.index];this.index+=1}(0===H.length&&this.throwUnexpectedToken(),this.eof())||(R=this.source.charCodeAt(this.index),(x.isIdentifierStart(R)||x.isDecimalDigit(R))&&this.throwUnexpectedToken());return{type:6,value:Number.parseInt(H,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanOctalLiteral(t,H){let R="",U=!1;x.isOctalDigit(t.charCodeAt(0))&&(U=!0,R=`0${this.source[this.index]}`); |
|
for(this.index+=1;!this.eof()&&x.isOctalDigit(this.source.charCodeAt(this.index));)R+=this.source[this.index],this.index+=1;return!U&&0===R.length&&this.throwUnexpectedToken(),(x.isIdentifierStart(this.source.charCodeAt(this.index))||x.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:Number.parseInt(R,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:H,end:this.index}}scanNumericLiteral(){let t=this.index,H=this.source[t]??"";if(!x.isDecimalDigit(H.charCodeAt(0))&& |
|
"."!==H)throw Error("ASSERT: Numeric literal must start with a decimal digit or a decimal point");let R="";if("."!==H){if(R=this.source[this.index]??"",this.index+=1,H=this.source[this.index]??"","0"===R){if("x"===H||"X"===H)return this.index+=1,this.scanHexLiteral(t);if("b"===H||"B"===H)return this.index+=1,this.scanBinaryLiteral(t);if("o"===H||"O"===H)return this.scanOctalLiteral(H,t)}for(;x.isDecimalDigit(this.source.charCodeAt(this.index));)R+=this.source[this.index],this.index+=1;H=this.source[this.index]?? |
|
""}if("."===H){R+=this.source[this.index];for(this.index+=1;x.isDecimalDigit(this.source.charCodeAt(this.index));)R+=this.source[this.index],this.index+=1;H=this.source[this.index]??""}if("e"===H||"E"===H)if(R+=this.source[this.index],this.index+=1,H=this.source[this.index]??"",("+"===H||"-"===H)&&(R+=this.source[this.index],this.index+=1),x.isDecimalDigit(this.source.charCodeAt(this.index)))for(;x.isDecimalDigit(this.source.charCodeAt(this.index));)R+=this.source[this.index],this.index+=1;else this.throwUnexpectedToken(); |
|
return x.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:Number.parseFloat(R),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanStringLiteral(){let t=this.index,H=this.source[t];if("'"!==H&&'"'!==H)throw Error("ASSERT: String literal must starts with a quote");this.index+=1;let R="";for(;!this.eof();){var U=this.source[this.index]??"";if(this.index+=1,U===H){H="";break}if("\\"===U)if(U=this.source[this.index]??"",this.index+= |
|
1,U&&x.isLineTerminator(U.charCodeAt(0)))this.lineNumber+=1,"\r"===U&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(U){case "u":"{"===this.source[this.index]?(this.index+=1,R+=this.scanUnicodeCodePointEscape()):(U=this.scanHexEscape(U),null===U&&this.throwUnexpectedToken(),R+=U);break;case "x":U=this.scanHexEscape(U);null===U&&this.throwUnexpectedToken(r.InvalidHexEscapeSequence);R+=U;break;case "n":R+="\n";break;case "r":R+="\r";break;case "t":R+="\t";break; |
|
case "b":R+="\b";break;case "f":R+="\f";break;case "v":R+="\v";break;case "8":case "9":R+=U;this.tolerateUnexpectedToken();break;default:U&&x.isOctalDigit(U.charCodeAt(0))?(U=this.octalToDecimal(U),R+=String.fromCharCode(U.code)):R+=U}else{if(x.isLineTerminator(U.charCodeAt(0)))break;R+=U}}return""!==H&&(this.index=t,this.throwUnexpectedToken()),{type:8,value:R,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanTemplate(){let t="",H=!1,R=this.index,U="`"===this.source[R], |
|
X=!1,W=2;for(this.index+=1;!this.eof();){var ca=this.source[this.index]??"";if(this.index+=1,"`"===ca){W=1;H=X=!0;break}if("$"===ca){if("{"===this.source[this.index]){this.curlyStack.push("${");this.index+=1;H=!0;break}t+=ca}else if("\\"===ca)if(ca=this.source[this.index]??"",this.index+=1,x.isLineTerminator(ca.charCodeAt(0)))this.lineNumber+=1,"\r"===ca&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index;else switch(ca){case "n":t+="\n";break;case "r":t+="\r";break;case "t":t+= |
|
"\t";break;case "u":if("{"===this.source[this.index])this.index+=1,t+=this.scanUnicodeCodePointEscape();else{let wa=this.index,pa=this.scanHexEscape(ca);null!==pa?t+=pa:(this.index=wa,t+=ca)}break;case "x":ca=this.scanHexEscape(ca);null===ca&&this.throwUnexpectedToken(r.InvalidHexEscapeSequence);t+=ca;break;case "b":t+="\b";break;case "f":t+="\f";break;case "v":t+="\v";break;default:"0"===ca?(x.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(r.TemplateOctalLiteral),t+= |
|
"\x00"):x.isOctalDigit(ca.charCodeAt(0))?this.throwUnexpectedToken(r.TemplateOctalLiteral):t+=ca}else x.isLineTerminator(ca.charCodeAt(0))?(this.lineNumber+=1,"\r"===ca&&"\n"===this.source[this.index]&&(this.index+=1),this.lineStart=this.index,t+="\n"):t+=ca}return H||this.throwUnexpectedToken(),U||this.curlyStack.pop(),{type:10,value:this.source.slice(R+1,this.index-W),cooked:t,head:U,tail:X,lineNumber:this.lineNumber,lineStart:this.lineStart,start:R,end:this.index}}lex(){if(this.eof())return{type:2, |
|
value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};let t=this.source.charCodeAt(this.index);return x.isIdentifierStart(t)?this.scanIdentifier():40===t||41===t||59===t?this.scanPunctuator():39===t||34===t?this.scanStringLiteral():46===t?x.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():x.isDecimalDigit(t)?this.scanNumericLiteral():96===t||125===t&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate(): |
|
55296<=t&&57343>t&&x.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}},Z=class{constructor(t,H={},R){this.delegate=R;this.hasLineTerminator=!1;this.options={tokens:"boolean"==typeof H.tokens&&H.tokens,comments:"boolean"==typeof H.comments&&H.comments,tolerant:"boolean"==typeof H.tolerant&&H.tolerant};this.options.comments&&(this.commentHandler=new l);this.errorHandler=new G(this.options.tolerant);this.scanner=new e(t,this.errorHandler);this.context={isAssignmentTarget:!1, |
|
blockContext:0,curlyParsingType:0};this.rawToken={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0};this.tokens=[];this.startMarker={index:0,line:this.scanner.lineNumber,column:0};this.endMarker={index:0,line:this.scanner.lineNumber,column:0};this.readNextRawToken();this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(t,H,{validTypes:R,invalidTypes:U}){R?.some(X=>t.type===X)||U?.some(X=> |
|
t.type===X)&&this.throwError(r.InvalidExpression,H)}throwError(t,H,R=this.endMarker){let {index:U,line:X,column:W}=H;this.errorHandler.throwError({code:t,index:U,line:X,column:W+1,len:R.index-U-1})}tolerateError(t,H){throw Error("######################################### !!!");}unexpectedTokenError(t={}){let {rawToken:H}=t,{code:R,data:U}=t;if(H){if(!R)switch(H.type){case 2:R=r.UnexpectedEndOfScript;break;case 3:R=r.UnexpectedIdentifier;break;case 6:R=r.UnexpectedNumber;break;case 8:R=r.UnexpectedString; |
|
break;case 10:R=r.UnexpectedTemplate}t=H.value.toString()}else t="ILLEGAL";R??=r.UnexpectedToken;U||={value:t};t=y(R,U);if(H)return new g({code:R,index:H.start,line:H.lineNumber,column:H.start-H.lineStart+1,len:H.end-H.start-1,data:U,description:t});let {index:X,line:W}=this.endMarker;return new g({code:R,index:X,line:W,column:this.endMarker.column+1,data:U,description:t})}throwUnexpectedToken(t={}){throw t.rawToken??(t.rawToken=this.rawToken),this.unexpectedTokenError(t);}collectComments(t){let {commentHandler:H}= |
|
this;H&&t.length&&t.forEach(R=>{R={type:R.multiLine?k.BlockComment:k.LineComment,value:this.getSourceValue(R),range:R.range,loc:R.loc};H.collectComment(R)})}peekAhead(t){let H=this.scanner.saveState();t=t.call(this,()=>(this.scanner.scanComments(),this.scanner.lex()));return this.scanner.restoreState(H),t}getSourceValue(t){return this.scanner.source.slice(t.start,t.end)}convertToToken(t){return{type:m[t.type],value:this.getSourceValue(t),range:[t.start,t.end],loc:{start:{line:this.startMarker.line, |
|
column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index;this.endMarker.line=this.scanner.lineNumber;this.endMarker.column=this.scanner.index-this.scanner.lineStart;let t=this.rawToken;this.collectComments(this.scanner.scanComments());this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column= |
|
this.scanner.index-this.scanner.lineStart);this.rawToken=this.scanner.lex();this.hasLineTerminator=t.lineNumber!==this.rawToken.lineNumber;this.options.tokens&&2!==this.rawToken.type&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(t){return{range:[t.index,this.endMarker.index],loc:{start:{line:t.line,column:t.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(t){return(this.delegate?? |
|
this.commentHandler)&&(this.commentHandler?.attachComments(t),this.delegate?.(t)),t}expectPunctuator(t){let H=this.rawToken;this.matchPunctuator(t)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:H,code:r.PunctuatorExpected,data:{value:t}})}expectKeyword(t){4===this.rawToken.type&&this.rawToken.value.toLowerCase()===t.toString()?this.readNextRawToken():this.throwUnexpectedToken({rawToken:this.rawToken})}expectContextualKeyword(t){3===this.rawToken.type&&this.rawToken.value.toLowerCase()=== |
|
t?this.readNextRawToken():this.throwUnexpectedToken({rawToken:this.rawToken})}matchKeyword(t){return 4===this.rawToken.type&&this.rawToken.value.toLowerCase()===t}matchContextualKeyword(t){return 3===this.rawToken.type&&this.rawToken.value===t}matchPunctuator(t){return 7===this.rawToken.type&&this.rawToken.value===t}getMatchingPunctuator(t){if("string"==typeof t&&(t=t.split("")),7===this.rawToken.type&&t.length)return t.find(this.matchPunctuator.bind(this))}isolateCoverGrammar(t){let H=this.context.isAssignmentTarget; |
|
this.context.isAssignmentTarget=!0;t=t.call(this);return this.context.isAssignmentTarget=H,t}inheritCoverGrammar(t){var H;let R=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;t=t.call(this);return(H=this.context).isAssignmentTarget&&(H.isAssignmentTarget=R),t}withBlockContext(t,H){let R=this.context.blockContext;this.context.blockContext|=t;t=this.context.curlyParsingType;this.context.curlyParsingType=1;H=H.call(this);return this.context.blockContext=R,this.context.curlyParsingType= |
|
t,H}consumeSemicolon(){this.matchPunctuator(";")?this.readNextRawToken():this.hasLineTerminator||(2===this.rawToken.type||this.matchPunctuator("}")?(this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,this.endMarker.column=this.startMarker.column):this.throwUnexpectedToken({rawToken:this.rawToken}))}parsePrimaryExpression(){let t=this.captureStartMarker(),H=this.rawToken;switch(H.type){case 3:return this.readNextRawToken(),this.finalize({type:k.Identifier,name:H.value, |
|
...this.getItemLocation(t)});case 6:case 8:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:k.Literal,value:H.value,raw:this.getSourceValue(H),isString:"string"==typeof H.value,...this.getItemLocation(t)});case 1:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:k.Literal,value:"true"===H.value.toLowerCase(),raw:this.getSourceValue(H),isString:!1,...this.getItemLocation(t)});case 5:return this.context.isAssignmentTarget=!1,this.readNextRawToken(), |
|
this.finalize({type:k.Literal,value:null,raw:this.getSourceValue(H),isString:!1,...this.getItemLocation(t)});case 10:return this.parseTemplateLiteral();case 7:switch(H.value){case "(":return this.inheritCoverGrammar(this.parseGroupExpression.bind(this));case "[":return this.inheritCoverGrammar(this.parseArrayInitializer.bind(this));case "{":return this.inheritCoverGrammar(this.parseObjectExpression.bind(this));default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case 4:return this.context.isAssignmentTarget= |
|
!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){let t=this.captureStartMarker();this.expectPunctuator("[");let H=[];for(;!this.matchPunctuator("]");){let R=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(r.InvalidExpression,R)):(H.push(this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"), |
|
this.finalize({type:k.ArrayExpression,elements:H,...this.getItemLocation(t)})}parseObjectPropertyKey(){let t=this.captureStartMarker(),H=this.rawToken;switch(H.type){case 8:return this.readNextRawToken(),this.finalize({type:k.Literal,value:H.value,raw:this.getSourceValue(H),isString:!0,...this.getItemLocation(t)});case 3:case 1:case 5:case 4:return this.readNextRawToken(),this.finalize({type:k.Identifier,name:H.value,...this.getItemLocation(t)});default:this.throwError(r.KeyMustBeString,t)}}parseObjectProperty(){let t= |
|
this.rawToken,H=this.captureStartMarker(),R=this.parseObjectPropertyKey(),U=!1,X=null;return this.matchPunctuator(":")?(this.readNextRawToken(),X=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this))):3===t.type?(U=!0,X=this.finalize({type:k.Identifier,name:t.value,...this.getItemLocation(H)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:k.Property,kind:"init",key:R,value:X,shorthand:U,...this.getItemLocation(H)})}parseObjectExpression(){let t=this.captureStartMarker(); |
|
this.expectPunctuator("{");let H=[];for(;!this.matchPunctuator("}");)H.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:k.ObjectExpression,properties:H,...this.getItemLocation(t)})}parseTemplateElement(t=!1){var H=this.rawToken;10!==H.type&&this.throwUnexpectedToken({rawToken:H});t&&!H.head&&this.throwUnexpectedToken({code:r.InvalidTemplateHead,rawToken:H});t=this.captureStartMarker();this.readNextRawToken(); |
|
let {value:R,cooked:U,tail:X}=H;H=this.finalize({type:k.TemplateElement,value:{raw:R,cooked:U},tail:X,...this.getItemLocation(t)});return H.loc.start.column+=1,H.loc.end.column-=X?1:2,H}parseTemplateLiteral(){let t=this.captureStartMarker(),H=[],R=[],U=this.parseTemplateElement(!0);for(R.push(U);!U.tail;)H.push(this.parseExpression()),U=this.parseTemplateElement(),R.push(U);return this.finalize({type:k.TemplateLiteral,quasis:R,expressions:H,...this.getItemLocation(t)})}parseGroupExpression(){this.expectPunctuator("("); |
|
let t=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this));return this.expectPunctuator(")"),t}parseArguments(){this.expectPunctuator("(");let t=[];if(!this.matchPunctuator(")"))for(;;){let H=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));if(t.push(H),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),t}parseMemberName(){let t=this.rawToken,H=this.captureStartMarker();return this.readNextRawToken(), |
|
5!==t.type&&3!==t.type&&4!==t.type&&1!==t.type&&this.throwUnexpectedToken({rawToken:t}),this.finalize({type:k.Identifier,name:t.value,...this.getItemLocation(H)})}parseLeftHandSideExpression(){let t=this.captureStartMarker(),H=this.inheritCoverGrammar(this.parsePrimaryExpression.bind(this)),R=this.captureStartMarker();for(var U;U=this.getMatchingPunctuator("([.");)switch(U){case "(":this.context.isAssignmentTarget=!1;H.type!==k.Identifier&&H.type!==k.MemberExpression&&this.throwError(r.IdentiferExpected, |
|
t,R);U=this.parseArguments();H=this.finalize({type:k.CallExpression,callee:H,arguments:U,...this.getItemLocation(t)});continue;case "[":this.context.isAssignmentTarget=!0;this.expectPunctuator("[");U=this.isolateCoverGrammar(()=>this.parseExpression());this.expectPunctuator("]");H=this.finalize({type:k.MemberExpression,computed:!0,object:H,property:U,...this.getItemLocation(t)});continue;case ".":this.context.isAssignmentTarget=!0,this.expectPunctuator("."),U=this.parseMemberName(),H=this.finalize({type:k.MemberExpression, |
|
computed:!1,object:H,property:U,...this.getItemLocation(t)})}return H}parseUpdateExpression(){let t=this.captureStartMarker(),H=this.getMatchingPunctuator(w);if(H){this.readNextRawToken();var R=this.captureStartMarker(),U=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return U.type!==k.Identifier&&U.type!==k.MemberExpression&&U.type!==k.CallExpression&&this.throwError(r.InvalidExpression,R),this.context.isAssignmentTarget||this.tolerateError(r.InvalidLeftHandSideInAssignment,t),this.context.isAssignmentTarget= |
|
!1,this.finalize({type:k.UpdateExpression,operator:H,argument:U,prefix:!0,...this.getItemLocation(t)})}R=this.captureStartMarker();U=this.inheritCoverGrammar(this.parseLeftHandSideExpression.bind(this));let X=this.captureStartMarker();return this.hasLineTerminator||(H=this.getMatchingPunctuator(w),!H)?U:(U.type!==k.Identifier&&U.type!==k.MemberExpression&&this.throwError(r.InvalidExpression,R,X),this.context.isAssignmentTarget||this.tolerateError(r.InvalidLeftHandSideInAssignment,t),this.readNextRawToken(), |
|
this.context.isAssignmentTarget=!1,this.finalize({type:k.UpdateExpression,operator:H,argument:U,prefix:!1,...this.getItemLocation(t)}))}parseUnaryExpression(){let t=this.getMatchingPunctuator(C);if(t){let H=this.captureStartMarker();this.readNextRawToken();let R=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));return this.context.isAssignmentTarget=!1,this.finalize({type:k.UnaryExpression,operator:t,argument:R,prefix:!0,...this.getItemLocation(H)})}return this.parseUpdateExpression()}parseBinaryExpression(){var t= |
|
this.rawToken,H=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));if(7!==this.rawToken.type)return H;var R=this.rawToken.value,U=F(R);if(0===U)return H;this.readNextRawToken();this.context.isAssignmentTarget=!1;t=[t,this.rawToken];var X=this.inheritCoverGrammar(this.parseUnaryExpression.bind(this));R=[H,R,X];for(var W=[U];7===this.rawToken.type&&0<(U=F(this.rawToken.value));){for(;2<R.length&&U<=W[W.length-1];){X=R.pop();let wa=R.pop();W.pop();H=R.pop();t.pop();var ca=t[t.length-1];ca= |
|
b(ca,ca.lineStart);R.push(this.finalize(this.createBinaryOrLogicalExpression(ca,wa,H,X)))}R.push(this.rawToken.value);W.push(U);t.push(this.rawToken);this.readNextRawToken();R.push(this.inheritCoverGrammar(this.parseUnaryExpression.bind(this)))}U=R.length-1;H=R[U];for(W=t.pop();1<U;){X=t.pop();if(!X)break;W=b(X,W?.lineStart);H=this.finalize(this.createBinaryOrLogicalExpression(W,R[U-1],R[U-2],H));U-=2;W=X}return H}createBinaryOrLogicalExpression(t,H,R,U){let X=A.includes(H)?k.LogicalExpression:k.BinaryExpression; |
|
return X===k.BinaryExpression?{type:X,operator:H,left:R,right:U,...this.getItemLocation(t)}:((R.type===k.AssignmentExpression||R.type===k.UpdateExpression)&&this.throwError(r.InvalidExpression,...q(R)),(U.type===k.AssignmentExpression||U.type===k.UpdateExpression)&&this.throwError(r.InvalidExpression,...q(R)),{type:X,operator:H,left:R,right:U,...this.getItemLocation(t)})}parseAssignmentExpression(){let t=this.captureStartMarker(),H=this.inheritCoverGrammar(this.parseBinaryExpression.bind(this));var R= |
|
this.captureStartMarker();let U=this.getMatchingPunctuator(M);if(!U)return H;H.type!==k.Identifier&&H.type!==k.MemberExpression&&this.throwError(r.InvalidExpression,t,R);this.context.isAssignmentTarget||this.tolerateError(r.InvalidLeftHandSideInAssignment,t);this.matchPunctuator("\x3d")||(this.context.isAssignmentTarget=!1);this.readNextRawToken();R=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this));return this.finalize({type:k.AssignmentExpression,left:H,operator:U,right:R,...this.getItemLocation(t)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}parseStatements(t){let H= |
|
[];for(;2!==this.rawToken.type&&!this.matchPunctuator(t);){let R=this.parseStatementListItem();E(R)||H.push(R)}return H}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(d.Function)?this.parseFunctionDeclaration():this.matchKeyword(d.Export)?this.parseExportDeclaration():this.matchKeyword(d.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){let t=this.captureStartMarker();this.expectPunctuator("{");let H=this.parseStatements("}");return this.expectPunctuator("}"), |
|
this.finalize({type:k.BlockStatement,body:H,...this.getItemLocation(t)})}parseObjectStatement(){let t=this.captureStartMarker(),H=this.parseObjectExpression();return this.finalize({type:k.ExpressionStatement,expression:H,...this.getItemLocation(t)})}parseBlockOrObjectStatement(){return 0===this.context.curlyParsingType?this.parseObjectStatement():this.peekAhead(t=>{let H=t();return!(3!==H.type&&8!==H.type||(H=t(),7!==H.type||":"!==H.value))})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){let t= |
|
this.rawToken;if(3!==t.type)return null;let H=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:k.Identifier,name:t.value,...this.getItemLocation(H)})}parseVariableDeclarator(){let t=this.captureStartMarker(),H=this.parseIdentifier();H||this.throwUnexpectedToken({code:r.IdentiferExpected});let R=null;if(this.matchPunctuator("\x3d")){this.readNextRawToken();let U=this.rawToken;try{R=this.isolateCoverGrammar(this.parseAssignmentExpression.bind(this))}catch{this.throwUnexpectedToken({rawToken:U, |
|
code:r.InvalidVariableAssignment})}}return this.finalize({type:k.VariableDeclarator,id:H,init:R,...this.getItemLocation(t)})}parseVariableDeclarationList(){let t=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),t.push(this.parseVariableDeclarator());return t}parseVariableDeclaration(){let t=this.captureStartMarker();this.expectKeyword(d.Var);let H=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:k.VariableDeclaration,declarations:H, |
|
kind:"var",...this.getItemLocation(t)})}parseEmptyStatement(){let t=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:k.EmptyStatement,...this.getItemLocation(t)})}parseExpressionStatement(){let t=this.captureStartMarker(),H=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:k.ExpressionStatement,expression:H,...this.getItemLocation(t)})}parseIfClause(){return this.withBlockContext(2,this.parseStatement.bind(this))}parseIfStatement(){let t=this.captureStartMarker(); |
|
this.expectKeyword(d.If);this.expectPunctuator("(");var H=this.captureStartMarker();let R=this.parseExpression();var U=this.captureStartMarker();this.expectPunctuator(")");R.type!==k.AssignmentExpression&&R.type!==k.UpdateExpression||this.throwError(r.InvalidExpression,H,U);H=this.parseIfClause();U=null;return this.matchKeyword(d.Else)&&(this.readNextRawToken(),U=this.parseIfClause()),this.finalize({type:k.IfStatement,test:R,consequent:H,alternate:U,...this.getItemLocation(t)})}parseWhileStatement(){let t= |
|
this.captureStartMarker();this.expectKeyword(d.While);this.expectPunctuator("(");var H=this.captureStartMarker();let R=this.parseExpression(),U=this.captureStartMarker();this.expectPunctuator(")");R.type!==k.AssignmentExpression&&R.type!==k.UpdateExpression||this.throwError(r.InvalidExpression,H,U);H=this.withBlockContext(8,this.parseStatement.bind(this));return this.finalize({type:k.WhileStatement,test:R,body:H,...this.getItemLocation(t)})}parseForStatement(){let t=null,H=null,R=null,U=null,X=null, |
|
W=this.captureStartMarker();if(this.expectKeyword(d.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(d.Var)){var ca=this.captureStartMarker();this.readNextRawToken();var wa=this.parseVariableDeclarationList();1===wa.length&&this.matchKeyword(d.In)?(wa[0].init&&this.throwError(r.ForInOfLoopInitializer,ca),U=this.finalize({type:k.VariableDeclaration,declarations:wa,kind:"var",...this.getItemLocation(ca)}),this.readNextRawToken(),X=this.parseExpression()): |
|
(this.matchKeyword(d.In)&&this.throwError(r.InvalidLeftHandSideInForIn,ca),t=this.finalize({type:k.VariableDeclaration,declarations:wa,kind:"var",...this.getItemLocation(ca)}),this.expectPunctuator(";"))}else ca=this.context.isAssignmentTarget,wa=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseAssignmentExpression.bind(this)),this.matchKeyword(d.In)?(this.context.isAssignmentTarget||this.tolerateError(r.InvalidLeftHandSideInForIn,wa),t.type!==k.Identifier&&this.throwError(r.InvalidLeftHandSideInForIn, |
|
wa),this.readNextRawToken(),U=t,X=this.parseExpression(),t=null):(this.context.isAssignmentTarget=ca,this.expectPunctuator(";"));U||(this.matchPunctuator(";")||(H=this.isolateCoverGrammar(this.parseExpression.bind(this))),this.expectPunctuator(";"),this.matchPunctuator(")")||(R=this.isolateCoverGrammar(this.parseExpression.bind(this))));this.expectPunctuator(")");ca=this.withBlockContext(4,()=>this.isolateCoverGrammar(this.parseStatement.bind(this)));return U&&X?this.finalize({type:k.ForInStatement, |
|
left:U,right:X,body:ca,...this.getItemLocation(W)}):this.finalize({type:k.ForStatement,init:t,test:H,update:R,body:ca,...this.getItemLocation(W)})}parseContinueStatement(){let t=this.captureStartMarker();return this.expectKeyword(d.Continue),this.consumeSemicolon(),this.finalize({type:k.ContinueStatement,...this.getItemLocation(t)})}parseBreakStatement(){let t=this.captureStartMarker();return this.expectKeyword(d.Break),this.consumeSemicolon(),this.finalize({type:k.BreakStatement,...this.getItemLocation(t)})}parseReturnStatement(){let t= |
|
this.captureStartMarker();this.expectKeyword(d.Return);let H=(this.matchPunctuator(";")||this.matchPunctuator("}")||this.hasLineTerminator||2===this.rawToken.type)&&8!==this.rawToken.type&&10!==this.rawToken.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize({type:k.ReturnStatement,argument:H,...this.getItemLocation(t)})}parseStatement(){switch(this.rawToken.type){case 1:case 5:case 6:case 8:case 10:case 3:return this.parseExpressionStatement();case 7:return"{"===this.rawToken.value? |
|
this.parseBlockOrObjectStatement():"("===this.rawToken.value?this.parseExpressionStatement():";"===this.rawToken.value?this.parseEmptyStatement():this.parseExpressionStatement();case 4:switch(this.rawToken.value.toLowerCase()){case d.Break:return this.parseBreakStatement();case d.Continue:return this.parseContinueStatement();case d.For:return this.parseForStatement();case d.Function:return this.parseFunctionDeclaration();case d.If:return this.parseIfStatement();case d.Return:return this.parseReturnStatement(); |
|
case d.Var:return this.parseVariableDeclaration();case d.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){let t=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;2!==this.rawToken.type;){let H=this.parseIdentifier();if(H||this.throwUnexpectedToken({rawToken:this.rawToken,code:r.IdentiferExpected}),t.push(H),this.matchPunctuator(")")||(this.expectPunctuator(","), |
|
this.matchPunctuator(")")))break}return this.expectPunctuator(")"),t}parseFunctionDeclaration(){1===(this.context.blockContext&1)&&this.throwUnexpectedToken({code:r.NoFunctionInsideFunction});8!==(this.context.blockContext&8)&&2!==(this.context.blockContext&2)||this.throwUnexpectedToken({code:r.NoFunctionInsideBlock});let t=this.captureStartMarker();this.expectKeyword(d.Function);let H=this.parseIdentifier();H||this.throwUnexpectedToken({code:r.InvalidFunctionIdentifier});let R=this.parseFormalParameters(), |
|
U=this.context.blockContext;this.context.blockContext|=1;let X=this.parseBlock();return this.context.blockContext=U,this.finalize({type:k.FunctionDeclaration,id:H,params:R,body:X,...this.getItemLocation(t)})}parseScript(){var t=this.captureStartMarker();let H=this.parseStatements();t=this.finalize({type:k.Program,body:H,...this.getItemLocation(t)});return this.options.tokens&&(t.tokens=this.tokens),this.options.tolerant&&(t.errors=this.errorHandler.errors),t}parseExportDeclaration(){0!==this.context.blockContext&& |
|
this.throwUnexpectedToken({code:r.ModuleExportRootOnly});let t=null,H=this.captureStartMarker();return this.expectKeyword(d.Export),this.matchKeyword(d.Var)?t=this.parseVariableDeclaration():this.matchKeyword("function")?t=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:r.InvalidExpression}),this.finalize({type:k.ExportNamedDeclaration,declaration:t,specifiers:[],source:null,...this.getItemLocation(H)})}parseModuleSpecifier(){let t=this.captureStartMarker(),H=this.rawToken;if(8=== |
|
H.type)return this.readNextRawToken(),this.finalize({type:k.Literal,value:H.value,raw:this.getSourceValue(H),isString:!0,...this.getItemLocation(t)});this.throwError(r.InvalidModuleUri,t)}parseDefaultSpecifier(){let t=this.captureStartMarker(),H=this.parseIdentifier();return H||this.throwUnexpectedToken({code:r.IdentiferExpected}),this.finalize({type:k.ImportDefaultSpecifier,local:H,...this.getItemLocation(t)})}parseImportDeclaration(){0!==this.context.blockContext&&this.throwUnexpectedToken({code:r.ModuleImportRootOnly}); |
|
let t=this.captureStartMarker();this.expectKeyword(d.Import);let H=this.parseDefaultSpecifier();this.expectContextualKeyword(d.From);let R=this.parseModuleSpecifier();return this.finalize({type:k.ImportDeclaration,specifiers:[H],source:R,...this.getItemLocation(t)})}};D.Ee=function(t){return!!t&&"object"==typeof t&&"type"in t&&t.type===k.VariableDeclaration};D.Q=E;D.T=g;D.i=k;D.j=O;D.ke=function(t){return!!t&&"object"==typeof t&&"type"in t&&t.type===k.Identifier};D.l=d;D.o=r;D.q=n;D.rt=function(t, |
|
H,R){return(new Z(t,H,R)).parseScript()}})},"esri/arcade/featureset/support/RecentlyUsedCache":function(){define(function(){class D{constructor(c){const y=this;y._keys=[];y._values=[];y.length=0;c&&c.forEach(b=>{y.set(b[0],b[1])})}entries(){return[].slice.call(this.keys().map((c,y)=>[c,this._values[y]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(c){return this._keys.includes(c)}get(c){c=this._keys.indexOf(c);return-1<c?this._values[c]:null}deepGet(c){if(!c?.length)return null; |
|
const y=(b,q)=>null==b?null:q.length?y(b instanceof D?b.get(q[0]):b[q[0]],q.slice(1)):b;return y(this.get(c[0]),c.slice(1))}set(c,y){const b=this._keys.indexOf(c);-1<b?this._values[b]=y:(this._keys.push(c),this._values.push(y),this.length=this._values.length);return this}sortedSet(c,y,b,q){var F=this._keys.length;b=b||0;q=void 0!==q?q:F-1;if(0===F)return this._keys.push(c),this._values.push(y),this;if(c===this._keys[b])return this._values.splice(b,0,y),this;if(c===this._keys[q])return this._values.splice(q, |
|
0,y),this;if(c>this._keys[q])return this._keys.splice(q+1,0,c),this._values.splice(q+1,0,y),this;if(c<this._keys[b])return this._values.splice(b,0,y),this._keys.splice(b,0,c),this;if(b>=q)return this;F=b+Math.floor((q-b)/2);return c<this._keys[F]?this.sortedSet(c,y,b,F-1):c>this._keys[F]?this.sortedSet(c,y,F+1,q):this}size(){return this.length}clear(){this._keys.length=this.length=this._values.length=0;return this}delete(c){c=this._keys.indexOf(c);return-1<c?(this._keys.splice(c,1),this._values.splice(c, |
|
1),this.length=this._keys.length,!0):!1}forEach(c){this._keys.forEach((y,b)=>{c(this._values[b],y,b)})}map(c){return this.keys().map((y,b)=>c(this._values[b],y,b))}filter(c){const y=this;y._keys.forEach((b,q)=>{!1===c(y._values[q],b,q)&&y.delete(b)});return this}clone(){return new D(this.entries())}}class O{constructor(c=20){this._maxEntries=c;this._values=new D}delete(c){this._values.has(c)&&this._values.delete(c)}get(c){let y=null;this._values.has(c)&&(y=this._values.get(c),this._values.delete(c), |
|
this._values.set(c,y));return y}put(c,y){if(this._values.size()>=this._maxEntries){const b=this._values.keys()[0];this._values.delete(b)}this._values.set(c,y)}}class E{constructor(c=20){this._maxEntries=c;this._cache=new O(this._maxEntries);this._layerMetadata=new O(this._maxEntries);this._serviceMetadata=new O(this._maxEntries);this._portalItems=new O(this._maxEntries)}clear(){this._cache=new O(this._maxEntries);this._layerMetadata=new O(this._maxEntries);this._serviceMetadata=new O(this._maxEntries); |
|
this._portalItems=new O(this._maxEntries)}addToCache(c,y){this._cache.put(c,y)}removeFromCache(c){this._cache.delete(c)}getFromCache(c){return this._cache.get(c)}getCachedLayerMetadata(c){return this._layerMetadata.get(c)}setCachedLayerMetadata(c,y){this._layerMetadata.put(c,y)}removeCachedLayerMetadata(c,y){this._layerMetadata.get(c)===y&&this._layerMetadata.delete(c)}getCachedServiceMetadata(c){return this._serviceMetadata.get(c)}setCachedServiceMetadata(c,y){this._serviceMetadata.put(c,y)}removeCachedServiceMetadata(c, |
|
y){this._serviceMetadata.get(c)===y&&this._serviceMetadata.delete(c)}getCachedPortalItem(c,y){return this._portalItems.get(`${y}:${c}`)}setCachedPortalItem(c,y,b){this._portalItems.put(`${y}:${c}`,b)}removeCachedPortalItem(c,y,b){c=`${y}:${c}`;this._portalItems.get(c)===b&&this._portalItems.delete(c)}}return E})},"esri/arcade/arcadeRuntime":function(){define("exports ./ArcadeModule ./ArcadeModuleLoader ./containerUtils ./Dictionary ./executionError ./Feature ./FunctionWrapper ../chunks/languageUtils ./treeAnalysis ../chunks/array ./functions/date ./functions/geometry ./functions/geomsync ./functions/maths ./functions/stats ./functions/string ../geometry/Geometry ../geometry/SpatialReference".split(" "), |
|
function(D,O,E,c,y,b,q,F,d,k,w,C,M,A,f,m,r,n,g){function l(I,J){const u=[];for(let P=0;P<J.arguments.length;P++)u.push(G(I,J.arguments[P]));return u}function z(I,J,u){try{return!0===J.preparsed?u(I,null,J.arguments):u(I,J,l(I,J))}catch(P){throw P;}}function G(I,J){try{switch(J?.type){case "EmptyStatement":return d.voidOperation;case "VariableDeclarator":let ya=null===J.init?null:G(I,J.init);ya===d.voidOperation&&(ya=null);if("Identifier"!==J.id.type)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidIdentifier, |
|
J);const ta=J.id.name.toLowerCase();null!=I.localScope?I.localScope[ta]={value:ya,valueset:!0,node:J.init}:I.globalScope[ta]={value:ya,valueset:!0,node:J.init};return d.voidOperation;case "VariableDeclaration":for(var u=0;u<J.declarations.length;u++)G(I,J.declarations[u]);return d.voidOperation;case "ImportDeclaration":const La=J.specifiers[0].local.name.toLowerCase(),Ga=I.libraryResolver.loadLibrary(La);u=null;I.libraryResolver._moduleSingletons?.has(Ga.uri)?u=I.libraryResolver._moduleSingletons.get(Ga.uri): |
|
(u=new pa(Ga),u.loadModule(I),I.libraryResolver._moduleSingletons?.set(Ga.uri,u));I.globalScope[La]={value:u,valueset:!0,node:J};return d.voidOperation;case "ExportNamedDeclaration":G(I,J.declaration);if("FunctionDeclaration"===J.declaration.type)I.exports[J.declaration.id.name.toLowerCase()]="function";else if("VariableDeclaration"===J.declaration.type)for(const ba of J.declaration.declarations)I.exports[ba.id.name.toLowerCase()]="variable";return d.voidOperation;case "BlockStatement":case "Program":a:{let ba= |
|
d.voidOperation;for(u=0;u<J.body.length;u++)if(ba=G(I,J.body[u]),ba instanceof d.returnResult||ba===d.breakResult||ba===d.continueResult){var P=ba;break a}P=ba}return P;case "FunctionDeclaration":const Ia=J.id.name.toLowerCase();I.globalScope[Ia]={valueset:!0,node:null,value:new wa(J,I)};return d.voidOperation;case "ReturnStatement":if(null===J.argument)var S=new d.returnResult(d.voidOperation);else{var V=G(I,J.argument);S=new d.returnResult(V)}return S;case "IfStatement":{const ba=G(I,J.test);if(!0=== |
|
ba)var ha=G(I,J.consequent);else if(!1===ba)ha=null!==J.alternate?G(I,J.alternate):d.voidOperation;else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.BooleanConditionRequired,J);}return ha;case "ExpressionStatement":if("AssignmentExpression"===J.expression.type||"UpdateExpression"===J.expression.type)var qa=G(I,J.expression);else if("CallExpression"===J.expression.type){const ba=G(I,J.expression);qa=ba===d.voidOperation?d.voidOperation:new d.implicitResult(ba)}else{var ra=G(I,J.expression); |
|
qa=ra===d.voidOperation?d.voidOperation:new d.implicitResult(ra)}return qa;case "AssignmentExpression":u=null;var h="";if("MemberExpression"===J.left.type){u=G(I,J.left.object);if(!0===J.left.computed)h=G(I,J.left.property);else if("Identifier"===J.left.property.type)h=J.left.property.name;else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidIdentifier,J);const ba=G(I,J.right);if(d.isArray(u))if(d.isNumber(h)){0>h&&(h=u.length+h);if(0>h||h>u.length)throw new b.ArcadeExecutionError(I, |
|
b.ExecutionErrorCodes.OutOfBounds,J);if(h===u.length&&"\x3d"!==J.operator)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.OutOfBounds,J);u[h]=B(ba,J.operator,u[h],J,I)}else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.ArrayAccessorMustBeNumber,J);else if(u instanceof y){if(!1===d.isString(h))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.KeyAccessorMustBeString,J);if(!0===u.hasField(h))u.setField(h,B(ba,J.operator,u.field(h),J,I));else{if("\x3d"!==J.operator)throw new b.ArcadeExecutionError(I, |
|
b.ExecutionErrorCodes.FieldNotFound,J,{key:h});u.setField(h,B(ba,J.operator,null,J,I))}}else if(d.isFeature(u)){if(!1===d.isString(h))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.KeyAccessorMustBeString,J);if(!0===u.hasField(h))u.setField(h,B(ba,J.operator,u.field(h),J,I));else{if("\x3d"!==J.operator)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.FieldNotFound,J,{key:h});u.setField(h,B(ba,J.operator,null,J,I))}}else{if(d.isImmutableArray(u))throw new b.ArcadeExecutionError(I, |
|
b.ExecutionErrorCodes.Immutable,J);if(u instanceof pa){if(!1===d.isString(h))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.ModuleAccessorMustBeString,J);if(!0===u.hasGlobal(h))u.setGlobal(h,B(ba,J.operator,u.global(h),J,I));else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.ModuleExportNotFound,J);}else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidIdentifier,J);}var p=d.voidOperation}else{u=J.left.name.toLowerCase();var L=G(I,J.right);if(null!=I.localScope&& |
|
void 0!==I.localScope[u])I.localScope[u]={value:B(L,J.operator,I.localScope[u].value,J,I),valueset:!0,node:J.right},p=d.voidOperation;else if(void 0!==I.globalScope[u])I.globalScope[u]={value:B(L,J.operator,I.globalScope[u].value,J,I),valueset:!0,node:J.right},p=d.voidOperation;else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidIdentifier,J);}return p;case "UpdateExpression":{let ba;u=null;h="";if("MemberExpression"===J.argument.type){u=G(I,J.argument.object);!0===J.argument.computed? |
|
h=G(I,J.argument.property):"Identifier"===J.argument.property.type&&(h=J.argument.property.name);if(d.isArray(u))if(d.isNumber(h)){0>h&&(h=u.length+h);if(0>h||h>=u.length)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.OutOfBounds,J);ba=d.toNumber(u[h]);u[h]="++"===J.operator?ba+1:ba-1}else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.ArrayAccessorMustBeNumber,J);else if(u instanceof y){if(!1===d.isString(h))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.KeyAccessorMustBeString, |
|
J);if(!0===u.hasField(h))ba=d.toNumber(u.field(h)),u.setField(h,"++"===J.operator?ba+1:ba-1);else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.FieldNotFound,J);}else if(d.isFeature(u)){if(!1===d.isString(h))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.KeyAccessorMustBeString,J);if(!0===u.hasField(h))ba=d.toNumber(u.field(h)),u.setField(h,"++"===J.operator?ba+1:ba-1);else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.FieldNotFound,J);}else{if(d.isImmutableArray(u))throw new b.ArcadeExecutionError(I, |
|
b.ExecutionErrorCodes.Immutable,J);if(u instanceof pa){if(!1===d.isString(h))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.ModuleAccessorMustBeString,J);if(!0===u.hasGlobal(h))ba=d.toNumber(u.global(h)),u.setGlobal(h,"++"===J.operator?ba+1:ba-1);else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.ModuleExportNotFound,J);}else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidParameter,J);}var Q=!1===J.prefix?ba:"++"===J.operator?ba+1:ba-1}else{u="Identifier"===J.argument.type? |
|
J.argument.name.toLowerCase():"";if(!u)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidIdentifier,J);if(null!=I.localScope&&void 0!==I.localScope[u])ba=d.toNumber(I.localScope[u].value),I.localScope[u]={value:"++"===J.operator?ba+1:ba-1,valueset:!0,node:J},Q=!1===J.prefix?ba:"++"===J.operator?ba+1:ba-1;else if(void 0!==I.globalScope[u])ba=d.toNumber(I.globalScope[u].value),I.globalScope[u]={value:"++"===J.operator?ba+1:ba-1,valueset:!0,node:J},Q=!1===J.prefix?ba:"++"===J.operator? |
|
ba+1:ba-1;else throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidIdentifier,J);}}return Q;case "BreakStatement":return d.breakResult;case "ContinueStatement":return d.continueResult;case "TemplateElement":return J.value?J.value.cooked:"";case "TemplateLiteral":L="";Q=0;for(const ba of J.quasis)if(L+=ba.value?ba.value.cooked:"",!1===ba.tail){if(J.expressions[Q]){var Y=d;h=Y.toString;var aa=G(I,J.expressions[Q]),ka=I;p=J;if(d.isFunctionParameter(aa))throw new b.ArcadeExecutionError(ka, |
|
b.ExecutionErrorCodes.NoFunctionInTemplateLiteral,p);u=h.call(Y,aa)}else u="";L+=u;Q++}return L;case "ForStatement":null!==J.init&&G(I,J.init);ka={testResult:!0,lastAction:d.voidOperation};do b:{u=I;h=J;aa=ka;if(null!==h.test){aa.testResult=G(u,h.test);if(!1===aa.testResult)break b;if(!0!==aa.testResult)throw new b.ArcadeExecutionError(u,b.ExecutionErrorCodes.BooleanConditionRequired,h);}aa.lastAction=G(u,h.body);aa.lastAction===d.breakResult?aa.testResult=!1:aa.lastAction instanceof d.returnResult? |
|
aa.testResult=!1:null!==h.update&&G(u,h.update)}while(!0===ka.testResult);Y=ka.lastAction instanceof d.returnResult?ka.lastAction:d.voidOperation;return Y;case "ForInStatement":return a(I,J);case "WhileStatement":u=!0;var fa=d.voidOperation;u=G(I,J.test);if(!1===u)var ja=d.voidOperation;else{if(!0!==u)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.BooleanConditionRequired,J);for(;!0===u;){fa=G(I,J.body);if(fa===d.breakResult)break;if(fa instanceof d.returnResult)break;u=G(I,J.test);if(!0!== |
|
u&&!1!==u)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.BooleanConditionRequired,J);}ja=fa instanceof d.returnResult?fa:d.voidOperation}return ja;case "Identifier":return t(I,J);case "MemberExpression":return x(I,J);case "Literal":return J.value;case "CallExpression":a:try{if("MemberExpression"===J.callee.type){const ba=G(I,J.callee.object);if(!(ba instanceof pa))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.FunctionNotFound,J);const oa=!1===J.callee.computed?J.callee.property.name: |
|
G(I,J.callee.property);if(!ba.hasGlobal(oa))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.FunctionNotFound,J);const va=ba.global(oa);if(!d.isFunctionParameter(va))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.CallNonFunction,J);var ia=va.call(I,J)}else{if("Identifier"!==J.callee.type)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.FunctionNotFound,J);if(null!=I.localScope&&void 0!==I.localScope[J.callee.name.toLowerCase()]){const ba=I.localScope[J.callee.name.toLowerCase()]; |
|
if(d.isFunctionParameter(ba.value)){ia=ba.value.call(I,J);break a}throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.CallNonFunction,J);}if(void 0!==I.globalScope[J.callee.name.toLowerCase()]){const ba=I.globalScope[J.callee.name.toLowerCase()];if(d.isFunctionParameter(ba.value)){ia=ba.value.call(I,J);break a}throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.CallNonFunction,J);}throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.FunctionNotFound,J);}}catch(ba){throw ba;}return ia; |
|
case "UnaryExpression":return N(I,J);case "BinaryExpression":return e(I,J);case "LogicalExpression":return Z(I,J);case "ArrayExpression":try{u=[];for(h=0;h<J.elements.length;h++){const ba=G(I,J.elements[h]);if(d.isFunctionParameter(ba))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.NoFunctionInArray,J);ba===d.voidOperation?u.push(null):u.push(ba)}var ma=u}catch(ba){throw ba;}return ma;case "ObjectExpression":u={};const Ha=new Map;for(h=0;h<J.properties.length;h++){const ba=G(I,J.properties[h]); |
|
if(d.isFunctionParameter(ba.value))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.NoFunctionInDictionary,J);if(!1===d.isString(ba.key))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.KeyMustBeString,J);let oa=ba.key.toString();const va=oa.toLowerCase();Ha.has(va)?oa=Ha.get(va):Ha.set(va,oa);u[oa]=ba.value===d.voidOperation?null:ba.value}const Ba=new y(u);Ba.immutable=!1;return Ba;case "Property":return{key:"Identifier"===J.key.type?J.key.name:G(I,J.key),value:G(I,J.value)};default:throw new b.ArcadeExecutionError(I, |
|
b.ExecutionErrorCodes.Unrecognized,J);}}catch(ya){throw b.ensureArcadeExecutionError(I,J,ya);}}function a(I,J){var u=G(I,J.right);"VariableDeclaration"===J.left.type&&G(I,J.left);let P=null;var S="";if("VariableDeclaration"===J.left.type){var V=J.left.declarations[0].id;"Identifier"===V.type&&(S=V.name)}else"Identifier"===J.left.type&&(S=J.left.name);if(!S)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidIdentifier,J);S=S.toLowerCase();null!=I.localScope&&void 0!==I.localScope[S]&& |
|
(P=I.localScope[S]);null===P&&void 0!==I.globalScope[S]&&(P=I.globalScope[S]);if(null===P)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidIdentifier,J);if(d.isArray(u)||d.isString(u)){u=u.length;for(S=0;S<u;S++){P.value=S;V=G(I,J.body);if(V===d.breakResult)break;if(V instanceof d.returnResult)return V}return d.voidOperation}if(d.isImmutableArray(u)){for(S=0;S<u.length();S++){P.value=S;V=G(I,J.body);if(V===d.breakResult)break;if(V instanceof d.returnResult)return V}return d.voidOperation}if(u instanceof |
|
y||d.isFeature(u))for(u=u.keys(),S=0;S<u.length;S++){P.value=u[S];V=G(I,J.body);if(V===d.breakResult)break;if(V instanceof d.returnResult)return V}else return d.voidOperation}function B(I,J,u,P,S){switch(J){case "\x3d":return I===d.voidOperation?null:I;case "/\x3d":return d.toNumber(u)/d.toNumber(I);case "*\x3d":return d.toNumber(u)*d.toNumber(I);case "-\x3d":return d.toNumber(u)-d.toNumber(I);case "+\x3d":return d.isString(u)||d.isString(I)?d.toString(u)+d.toString(I):d.toNumber(u)+d.toNumber(I); |
|
case "%\x3d":return d.toNumber(u)%d.toNumber(I);default:throw new b.ArcadeExecutionError(S,b.ExecutionErrorCodes.UnsupportedOperator,P);}}function x(I,J){try{const u=G(I,J.object);if(null===u)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.MemberOfNull,J);if(!1===J.computed){if("Identifier"===J.property.type){if(u instanceof y||d.isFeature(u))return u.field(J.property.name);if(u instanceof n)return c.geometryMember(u,J.property.name,I,J);if(u instanceof pa){if(!u.hasGlobal(J.property.name))throw new b.ArcadeExecutionError(I, |
|
b.ExecutionErrorCodes.InvalidIdentifier,J);return u.global(J.property.name)}}throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidMemberAccessKey,J);}let P=G(I,J.property);if(u instanceof y||d.isFeature(u)){if(d.isString(P))return u.field(P);throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidMemberAccessKey,J);}if(u instanceof pa){if(d.isString(P))return u.global(P);throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidMemberAccessKey,J);}if(u instanceof n){if(d.isString(P))return c.geometryMember(u, |
|
P,I,J);throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidMemberAccessKey,J);}if(d.isArray(u)){if(d.isNumber(P)&&isFinite(P)&&Math.floor(P)===P){0>P&&(P=u.length+P);if(P>=u.length||0>P)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.OutOfBounds,J);return u[P]}throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidMemberAccessKey,J);}if(d.isString(u)){if(d.isNumber(P)&&isFinite(P)&&Math.floor(P)===P){0>P&&(P=u.length+P);if(P>=u.length||0>P)throw new b.ArcadeExecutionError(I, |
|
b.ExecutionErrorCodes.OutOfBounds,J);return u[P]}throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidMemberAccessKey,J);}if(d.isImmutableArray(u)&&d.isNumber(P)&&isFinite(P)&&Math.floor(P)===P){0>P&&(P=u.length()+P);if(P>=u.length()||0>P)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.OutOfBounds,J);return u.get(P)}throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidMemberAccessKey,J);}catch(u){throw u;}}function N(I,J){try{const u=G(I,J.argument);if(d.isBoolean(u)){if("!"=== |
|
J.operator)return!u;if("-"===J.operator)return-1*d.toNumber(u);if("+"===J.operator)return 1*d.toNumber(u);if("~"===J.operator)return~d.toNumber(u);throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.UnsupportedUnaryOperator,J);}if("~"===J.operator)return~d.toNumber(u);if("-"===J.operator)return-1*d.toNumber(u);if("+"===J.operator)return 1*d.toNumber(u);throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.UnsupportedUnaryOperator,J);}catch(u){throw u;}}function e(I,J){try{const u=[G(I,J.left), |
|
G(I,J.right)],P=u[0],S=u[1];switch(J.operator){case "|":case "\x3c\x3c":case "\x3e\x3e":case "\x3e\x3e\x3e":case "^":case "\x26":return d.binaryOperator(d.toNumber(P),d.toNumber(S),J.operator);case "\x3d\x3d":return d.equalityTest(P,S);case "!\x3d":return!d.equalityTest(P,S);case "\x3c":return d.greaterThanLessThan(P,S,J.operator);case "\x3e":return d.greaterThanLessThan(P,S,J.operator);case "\x3c\x3d":return d.greaterThanLessThan(P,S,J.operator);case "\x3e\x3d":return d.greaterThanLessThan(P,S,J.operator); |
|
case "+":return d.isString(P)||d.isString(S)?d.toString(P)+d.toString(S):d.toNumber(P)+d.toNumber(S);case "-":return d.toNumber(P)-d.toNumber(S);case "*":return d.toNumber(P)*d.toNumber(S);case "/":return d.toNumber(P)/d.toNumber(S);case "%":return d.toNumber(P)%d.toNumber(S);default:throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.UnsupportedOperator,J);}}catch(u){throw u;}}function Z(I,J){try{const u=G(I,J.left);if(d.isBoolean(u))switch(J.operator){case "||":if(!0===u)return u;const P=G(I, |
|
J.right);if(d.isBoolean(P))return P;throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.LogicExpressionOrAnd,J);case "\x26\x26":if(!1===u)return u;const S=G(I,J.right);if(d.isBoolean(S))return S;throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.LogicExpressionOrAnd,J);default:throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.LogicExpressionOrAnd,J);}throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.LogicalExpressionOnlyBoolean,J);}catch(u){throw u;}}function t(I,J){let u; |
|
try{const P=J.name.toLowerCase();if(null!=I.localScope&&void 0!==I.localScope[P]){u=I.localScope[P];if(!0===u.valueset)return u.value;u.value=G(I,u.node);u.valueset=!0;return u.value}if(void 0!==I.globalScope[P]){u=I.globalScope[P];if(!0===u.valueset)return u.value;u.value=G(I,u.node);u.valueset=!0;return u.value}throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.InvalidIdentifier,J);}catch(P){throw P;}}function H(I,J,u,P){try{const S=J.arguments,V=G(I,S[u]);if(d.equalityTest(V,P))return G(I, |
|
S[u+1]);const ha=S.length-u;return 1===ha?G(I,S[u]):2===ha?null:3===ha?G(I,S[u+2]):H(I,J,u+2,P)}catch(S){throw S;}}function R(I,J,u,P){try{const S=J.arguments;if(!0===P)return G(I,S[u+1]);if(3===S.length-u)return G(I,S[u+2]);const V=G(I,S[u+2]);if(!1===d.isBoolean(V))throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.BooleanConditionRequired,S[u+2]);return R(I,J,u+2,V)}catch(S){throw S;}}function U(I,J,u,P){try{const S=I.body;if(u.length!==I.params.length)throw new b.ArcadeExecutionError(J, |
|
b.ExecutionErrorCodes.WrongNumberOfParameters,P);if(null!=J.localScope)for(let ha=0;ha<u.length;ha++)J.localScope[I.params[ha].name.toLowerCase()]={value:u[ha],valueset:!0,node:null};const V=G(J,S);if(V instanceof d.returnResult)return V.value;if(V===d.breakResult)throw new b.ArcadeExecutionError(J,b.ExecutionErrorCodes.UnexpectedToken,P);if(V===d.continueResult)throw new b.ArcadeExecutionError(J,b.ExecutionErrorCodes.UnexpectedToken,P);return V instanceof d.implicitResult?V.value:V}catch(S){throw S; |
|
}}function X(I,J,u){const P=new sa;I||={};J||={};const S=new y({newline:"\n",tab:"\t",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});S.immutable=!1;P.textformatting={value:S,valueset:!0,node:null};for(const V in J)P[V]={value:new F.NativeFunction(J[V]),native:!0,valueset:!0,node:null};for(const V in I)P[V]=I[V]&&"esri.Graphic"===I[V].declaredClass?{value:q.createFromGraphic(I[V],u),valueset:!0,node:null}:{value:I[V],valueset:!0,node:null};return P}function W(I){console.log(I)} |
|
function ca(I){const J={mode:"sync",compiled:!1,functions:{},signatures:[],standardFunction:z,evaluateIdentifier:t};for(let u=0;u<I.length;u++)I[u].registerFunctions(J);for(const u in J.functions)xa[u]={value:new F.NativeFunction(J.functions[u]),valueset:!0,node:null},sa.prototype[u]=xa[u];for(I=0;I<J.signatures.length;I++)k.addFunctionDeclaration(J.signatures[I],"sync")}class wa extends F.ArcadeFunction{constructor(I,J){super();this.context=this.definition=null;this.definition=I;this.context=J}createFunction(I){return(...J)=> |
|
{const u={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:I.depthCounter.depth+1},globalScope:this.context.globalScope};if(64<u.depthCounter.depth)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.MaximumCallDepth,null);return U(this.definition, |
|
u,J,null)}}call(I,J){return z(I,J,(u,P,S)=>{u={spatialReference:I.spatialReference,services:I.services,globalScope:I.globalScope,depthCounter:{depth:I.depthCounter.depth+1},libraryResolver:I.libraryResolver,exports:I.exports,timeZone:I.timeZone??null,console:I.console,lrucache:I.lrucache,interceptor:I.interceptor,localScope:{}};if(64<u.depthCounter.depth)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.MaximumCallDepth,J);return U(this.definition,u,S,J)})}marshalledCall(I,J,u,P){return P(I, |
|
J,(S,V,ha)=>{S={spatialReference:I.spatialReference,globalScope:u.globalScope,services:I.services,depthCounter:{depth:I.depthCounter.depth+1},libraryResolver:I.libraryResolver,exports:I.exports,console:I.console,timeZone:I.timeZone??null,lrucache:I.lrucache,interceptor:I.interceptor,localScope:{}};ha=ha.map(qa=>!d.isFunctionParameter(qa)||qa instanceof F.ScopeMarshalledFunction?qa:F.wrapModuleScopedResponse(qa,I,P));return F.wrapModuleScopedResponse(U(this.definition,S,ha,J),u,P)})}}class pa extends O.ArcadeModule{constructor(I){super(I)}global(I){I= |
|
this.executingContext.globalScope[I.toLowerCase()];I.valueset||(I.value=G(this.executingContext,I.node),I.valueset=!0);if(d.isFunctionParameter(I.value)&&!(I.value instanceof F.ScopeMarshalledFunction)){const J=new F.ScopeMarshalledFunction;J.fn=I.value;J.parameterEvaluator=z;J.context=this.executingContext;I.value=J}return I.value}setGlobal(I,J){if(d.isFunctionParameter(J))throw new b.ArcadeExecutionError(null,b.ExecutionErrorCodes.AssignModuleFunction,null);this.executingContext.globalScope[I.toLowerCase()]= |
|
{value:J,valueset:!0,node:null}}hasGlobal(I){void 0===this.executingContext.exports[I]&&(I=I.toLowerCase());return void 0!==this.executingContext.exports[I]?!0:!1}loadModule(I){let J=I.spatialReference;if(null===J||void 0===J)J=new g({wkid:102100});this.moduleScope=X({},I.customfunctions,I.timeZone);this.executingContext={spatialReference:J,globalScope:this.moduleScope,localScope:null,libraryResolver:new E.ArcadeModuleLoader(I.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{}, |
|
services:I.services,console:I.console??W,timeZone:I.timeZone??null,lrucache:I.lrucache,interceptor:I.interceptor,depthCounter:{depth:1}};G(this.executingContext,this.source.syntax)}}const xa={};C.registerFunctions(xa,z);r.registerFunctions(xa,z);f.registerFunctions(xa,z);M.registerFunctions(xa,z);m.registerFunctions(xa,z);A.registerFunctions(xa,z);xa.iif=function(I,J){try{const u=J.arguments;d.pcCheck(null===u?[]:u,3,3,I,J);const P=G(I,u[0]);if(!1===d.isBoolean(P))throw new b.ArcadeExecutionError(I, |
|
b.ExecutionErrorCodes.BooleanConditionRequired,J);return!0===P?G(I,u[1]):G(I,u[2])}catch(u){throw u;}};xa.defaultvalue=function(I,J){try{const u=J.arguments;d.pcCheck(null===u?[]:u,2,3,I,J);const P=G(I,u[0]);if(3===u.length){const S=G(I,u[1]),V=c.getNestedOptionalValue(P,S);return null!=V&&""!==V?V:G(I,u[2])}return null===P||""===P||void 0===P?G(I,u[1]):P}catch(u){throw u;}};xa.decode=function(I,J){try{const u=J.arguments;if(2>u.length)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.WrongNumberOfParameters, |
|
J);if(2===u.length)return G(I,u[1]);if(0===(u.length-1)%2)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.WrongNumberOfParameters,J);const P=G(I,u[0]);return H(I,J,1,P)}catch(u){throw u;}};xa.when=function(I,J){try{const u=J.arguments;if(3>u.length)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.WrongNumberOfParameters,J);if(0===u.length%2)throw new b.ArcadeExecutionError(I,b.ExecutionErrorCodes.WrongNumberOfParameters,J);const P=G(I,u[0]);if(!1===d.isBoolean(P))throw new b.ArcadeExecutionError(I, |
|
b.ExecutionErrorCodes.BooleanConditionRequired,u[0]);return R(I,J,0,P)}catch(u){throw u;}};for(const I in xa)xa[I]={value:new F.NativeFunction(xa[I]),valueset:!0,node:null};const sa=function(){};sa.prototype=xa;sa.prototype.infinity={value:Number.POSITIVE_INFINITY,valueset:!0,node:null};sa.prototype.pi={value:Math.PI,valueset:!0,node:null};O={fixSpatialReference:d.fixSpatialReference,parseArguments:l,standardFunction:z};ca([w.ArrayFunctions]);D.executeScript=function(I,J){let u=J.spatialReference; |
|
if(null===u||void 0===u)u=new g({wkid:102100});let P=null;I.usesModules&&(P=new E.ArcadeModuleLoader(new Map,I.loadedModules));const S=X(J.vars,J.customfunctions,J.timeZone);J={spatialReference:u,globalScope:S,localScope:null,services:J.services??null,exports:{},libraryResolver:P,console:J.console??W,timeZone:J.timeZone??null,lrucache:J.lrucache,interceptor:J.interceptor,depthCounter:{depth:1}};I=G(J,I);I instanceof d.returnResult&&(I=I.value);I instanceof d.implicitResult&&(I=I.value);I===d.voidOperation&& |
|
(I=null);if(I===d.breakResult)throw new b.ArcadeExecutionError(J,b.ExecutionErrorCodes.IllegalResult,null);if(I===d.continueResult)throw new b.ArcadeExecutionError(J,b.ExecutionErrorCodes.IllegalResult,null);if(d.isFunctionParameter(I))throw new b.ArcadeExecutionError(J,b.ExecutionErrorCodes.IllegalResult,null);return I};D.extend=ca;D.functionHelper=O;Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})})},"*noref":1}}); |
|
define("exports ../geometry ../chunks/arcade ../arcade/Dictionary ../arcade/Feature ../chunks/languageUtils ../core/lang ../core/sql/DateOnly ../core/sql/TimeOnly ../geometry/Point ../geometry/Polygon ../geometry/Polyline ../geometry/Multipoint ../geometry/Extent".split(" "),function(D,O,E,c,y,b,q,F,d,k,w,C,M,A){function f(a){return a.replaceAll(/[|\\{}()[\]^$+*?.]/g,"\\$\x26")}function m(a){if(!a)return null;try{return E.parseScript(a)}catch(B){}return null}function r(a,B){if(!a)return!1;if("string"=== |
|
typeof a)return B(a);if("simple"===a.type||"class-breaks"===a.type||"unique-value"===a.type||"dot-density"===a.type||"dictionary"===a.type||"pie-chart"===a.type){if("dot-density"===a.type){var x=a.attributes?.some(N=>B(N.valueExpression));if(x)return x}x=a.visualVariables;x=!!x&&x.some(N=>{let e=B(N.valueExpression);"size"===N.type&&(l(N.minSize)&&(e=e||B(N.minSize.valueExpression)),l(N.maxSize)&&(e=e||B(N.maxSize.valueExpression)));return e});return"valueExpression"in a&&B(a.valueExpression)?!0: |
|
x}return"esri.layers.support.LabelClass"===a.declaredClass?(a=a.labelExpressionInfo?.expression,!(!a||!B(a))||!1):"esri.PopupTemplate"===a.declaredClass?!!a.expressionInfos&&a.expressionInfos.some(N=>B(N.expression))||Array.isArray(a.content)&&a.content.some(N=>"expression"===N.type&&B(N.expressionInfo?.expression)):!1}function n(a){a=m(a);return!!a&&E.scriptTouchesGeometry(a)}function g(a){a=m(a);return!!a&&E.scriptUsesGeometryEngine(a)}function l(a){return a&&"esri.renderers.visualVariables.SizeVariable"=== |
|
a.declaredClass}const z=/^\$(feature|aggregatedFeatures)\./i,G={vars:{$feature:"any",$view:"any"},spatialReference:null};D.arcade=E.arcade;D.Dictionary=c;D.arcadeFeature=y;D.convertFeatureLayerToFeatureSet=function({layer:a,spatialReference:B,outFields:x,returnGeometry:N,lrucache:e,interceptor:Z}){if(null===a)return null;const t=E.featureSetUtils();return t?t.constructFeatureSet(a,B,x,N??!0,e,Z):null};D.convertJsonToArcade=function(a,B){return c.convertJsonToArcade(a,B)};D.convertMapToFeatureSetCollection= |
|
function(a){if(null===a?.map)return null;const B=E.featureSetUtils();return B?B.createFeatureSetCollectionFromMap(a.map,a.spatialReference,a.lrucache,a.interceptor):null};D.convertServiceUrlToWorkspace=function({url:a,spatialReference:B,lrucache:x,interceptor:N}){const e=E.featureSetUtils();return e?e.createFeatureSetCollectionFromService(a,B,x,N):null};D.createExecContext=function(a,B,x){return{vars:{$feature:null==a?new y:y.createFromGraphic(a,x),$view:B?.view},spatialReference:B?.sr,timeZone:x?? |
|
null}};D.createFeature=function(a,B,x){return y.createFromGraphicLikeObject(B,a,x,null)};D.createFunction=function(a,B){a="string"===typeof a?m(a):a;if(!a)return null;try{return B=B||q.clone(G),E.compileScript(a,B)}catch(x){}return null};D.createSyntaxTree=m;D.dependsOnView=function(a){return E.referencesMember(a,"$view")};D.enableFeatureSetOperations=function(){return E.enableFeatureSetSupport()};D.enableGeometryOperations=function(){return E.enableGeometrySupport()};D.evalSyntaxTree=function(a, |
|
B){let x;try{x=E.executeScript(a,B)}catch(N){x=null}return x};D.executeAsyncFunction=function(a,B){try{return a?a(B):Promise.resolve(null)}catch(x){return Promise.resolve(null)}};D.executeFunction=function(a,B){let x;try{x=a?a(B):null}catch(N){x=null}return x};D.extractFieldNames=function(a,B){if(!a)return[];a="string"===typeof a?m(a):a;if(!a)return[];let x=[];E.extractExpectedFieldLiterals(a).forEach(e=>{z.test(e)&&(e=e.replace(z,""),x.push(e))});const N=x.filter(e=>e.includes("*"));x=x.filter(e=> |
|
!N.includes(e));B&&N.forEach(e=>{const Z=new RegExp(`^${e.split(/\*+/).map(f).join(".*")}$`,"i");B.forEach(t=>Z.test(t)?x.push(t):null)});return[...(new Set(x.sort()))]};D.getArcadeType=function(a){return null==a?null:b.isArray(a)||b.isImmutableArray(a)?"array":b.isDate(a)?"date":b.isString(a)?"text":b.isBoolean(a)?"boolean":b.isNumber(a)?"number":a instanceof c?"dictionary":b.isFeature(a)?"feature":a instanceof k?"point":a instanceof w?"polygon":a instanceof C?"polyline":a instanceof M?"multipoint": |
|
a instanceof A?"extent":a instanceof F.DateOnly?"dateOnly":a instanceof d.TimeOnly?"time":b.isFeatureSet(a)?"featureSet":b.isFeatureSetCollection(a)?"featureSetCollection":null};D.getViewInfo=function(a){if(a&&(null!=a.spatialReference||null!=a.scale&&null!=a.viewingMode))return{view:a.viewingMode&&null!=a.scale?new c({viewingMode:a.viewingMode,scale:a.scale}):null,sr:a.spatialReference}};D.hasGeometryFunctions=function(a){return r(a,n)};D.hasGeometryOperations=function(a){return r(a,g)};D.hasVariable= |
|
function(a,B){return a?E.referencesMember(a,B):!1};D.loadScriptDependencies=function(a,B,x=[]){return E.loadScriptDependencies(a,B,x)};D.updateExecContext=function(a,B){null!=a.vars&&(a.vars.$feature=B)};Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}); |