1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598 |
- import {
- B,
- C as C2,
- M,
- N as N2,
- W,
- c as c3,
- d,
- f,
- l as l2,
- m as m2,
- o,
- p as p3,
- s as s4,
- u as u3,
- x,
- y as y2
- } from "./chunk-NS7TRIN4.js";
- import {
- g
- } from "./chunk-WGHU7NSM.js";
- import "./chunk-KD6NQDSX.js";
- import "./chunk-AXIWHIDY.js";
- import {
- J as J2
- } from "./chunk-PLCWBBQ4.js";
- import {
- q
- } from "./chunk-J3K5NYLA.js";
- import "./chunk-C3UFAVPF.js";
- import "./chunk-BJT4XIGU.js";
- import {
- A,
- D2 as D,
- E,
- F2 as F,
- G,
- J,
- K,
- N,
- Ne,
- P2 as P,
- Q,
- V,
- X,
- Y,
- Z,
- _,
- c as c2,
- e,
- e2,
- j,
- k as k2,
- l,
- n,
- p as p2,
- r,
- re,
- s,
- s2,
- s3,
- t,
- u as u2,
- ve,
- w as w3,
- z
- } from "./chunk-FT2BCPUP.js";
- import "./chunk-5JZ72JAQ.js";
- import "./chunk-JKFWEHNK.js";
- import "./chunk-EDHROVWI.js";
- import "./chunk-3IRT3YKJ.js";
- import {
- e as e3
- } from "./chunk-PK4W65H4.js";
- import "./chunk-JGBXYDGB.js";
- import "./chunk-QEWF7QPH.js";
- import "./chunk-3RSFVUKZ.js";
- import "./chunk-5N7JLUJJ.js";
- import {
- j as j2
- } from "./chunk-LU5IJZB4.js";
- import "./chunk-7IBV2TRE.js";
- import "./chunk-5UVJ64RB.js";
- import "./chunk-SFEFRQCL.js";
- import "./chunk-ETGAZ7LF.js";
- import "./chunk-75U5LM2V.js";
- import "./chunk-RMDDCMKS.js";
- import {
- m2 as m,
- u,
- v2 as v
- } from "./chunk-VCH45Q2I.js";
- import "./chunk-YFSLJIO4.js";
- import "./chunk-55RWC67C.js";
- import "./chunk-HZRKBTHJ.js";
- import {
- U
- } from "./chunk-DVUG3KID.js";
- import "./chunk-FWSQEIAR.js";
- import "./chunk-VEGAOVMY.js";
- import {
- p,
- w,
- w2
- } from "./chunk-6T6G6LCQ.js";
- import "./chunk-YEJL5NEF.js";
- import {
- k2 as k
- } from "./chunk-PQFTYGF5.js";
- import "./chunk-2Z2TG5CU.js";
- import "./chunk-6KZ2LTDA.js";
- import "./chunk-U2XHEJM7.js";
- import "./chunk-SQOPWYIT.js";
- import {
- C
- } from "./chunk-V6P2MAQQ.js";
- import "./chunk-E5O6P5I2.js";
- import {
- has,
- y
- } from "./chunk-SPWQ3AWG.js";
- import "./chunk-2TIUKVZN.js";
- import {
- c
- } from "./chunk-YXWMMD76.js";
- import "./chunk-S5KM4IGW.js";
- // node_modules/@arcgis/core/arcade/arcadeCompiler.js
- var T = class extends r {
- constructor(e7, n3) {
- super(), this.paramCount = n3, this.fn = e7;
- }
- createFunction(e7) {
- return (...n3) => {
- if (n3.length !== this.paramCount)
- throw new t(e7, e.WrongNumberOfParameters, null);
- return this.fn(...n3);
- };
- }
- call(e7, n3) {
- return this.fn(...n3.arguments);
- }
- marshalledCall(e7, n3, o5, l6) {
- return l6(e7, n3, (n4, r4, a3) => {
- a3 = a3.map((n5) => !F(n5) || n5 instanceof s2 ? n5 : n(n5, e7, l6));
- const s9 = this.call(o5, { arguments: a3 });
- return C(s9) ? s9.then((e8) => n(e8, o5, l6)) : s9;
- });
- }
- };
- function W2(e7, n3, t4) {
- try {
- return t4(e7, null, n3.arguments);
- } catch (o5) {
- throw o5;
- }
- }
- function V2(e7, n3) {
- try {
- switch (n3.type) {
- case "EmptyStatement":
- return "lc.voidOperation";
- case "VariableDeclarator":
- return ue(e7, n3);
- case "VariableDeclaration":
- return ce(e7, n3);
- case "BlockStatement":
- case "Program":
- return oe(e7, n3);
- case "FunctionDeclaration":
- return ie(e7, n3);
- case "ImportDeclaration":
- return re2(e7, n3);
- case "ExportNamedDeclaration":
- return ae(e7, n3);
- case "ReturnStatement":
- return le(e7, n3);
- case "IfStatement":
- return te(e7, n3);
- case "ExpressionStatement":
- return ee(e7, n3);
- case "AssignmentExpression":
- return Z2(e7, n3);
- case "UpdateExpression":
- return Q2(e7, n3);
- case "BreakStatement":
- return "break";
- case "ContinueStatement":
- return "continue";
- case "TemplateLiteral":
- return de(e7, n3);
- case "TemplateElement":
- return JSON.stringify(n3.value ? n3.value.cooked : "");
- case "ForStatement":
- return H(e7, n3);
- case "ForInStatement":
- return Y2(e7, n3);
- case "WhileStatement":
- return X2(e7, n3);
- case "Identifier":
- return ye(e7, n3);
- case "MemberExpression":
- return pe(e7, n3);
- case "Literal":
- return null === n3.value || void 0 === n3.value ? "null" : JSON.stringify(n3.value);
- case "CallExpression":
- return be(e7, n3);
- case "UnaryExpression":
- return me(e7, n3);
- case "BinaryExpression":
- return fe(e7, n3);
- case "LogicalExpression":
- return he(e7, n3);
- case "ArrayExpression":
- return ge(e7, n3);
- case "ObjectExpression":
- return J3(e7, n3);
- case "Property":
- return z2(e7, n3);
- case "Array":
- throw new s(e7, e.NeverReach, n3);
- default:
- throw new s(e7, e.Unrecognised, n3);
- }
- } catch (t4) {
- throw t4;
- }
- }
- function J3(e7, n3) {
- let t4 = "lang.dictionary([";
- for (let o5 = 0; o5 < n3.properties.length; o5++) {
- const l6 = n3.properties[o5];
- se2(l6.key.name);
- o5 > 0 && (t4 += ","), t4 += "lang.strCheck(" + ("Identifier" === l6.key.type ? "'" + l6.key.name + "'" : V2(e7, l6.key)) + ",'ObjectExpression'),lang.aCheck(" + V2(e7, l6.value) + ", 'ObjectExpression')";
- }
- return t4 += "])", t4;
- }
- function z2(e7, n3) {
- throw new s(e7, e.NeverReach, n3);
- }
- function Y2(e7, n3) {
- const t4 = Fe(e7), o5 = Fe(e7), l6 = Fe(e7);
- let r4 = "var " + t4 + " = " + V2(e7, n3.right) + ";\n";
- "VariableDeclaration" === n3.left.type && (r4 += V2(e7, n3.left));
- let a3 = "VariableDeclaration" === n3.left.type ? n3.left.declarations[0].id.name : n3.left.name;
- a3 = a3.toLowerCase(), se2(a3);
- let s9 = "";
- null !== e7.localScope && (void 0 !== e7.localScope[a3] ? s9 = "lscope['" + a3 + "']" : void 0 !== e7.localScope._SymbolsMap[a3] && (s9 = "lscope['" + e7.localScope._SymbolsMap[a3] + "']"));
- let i3 = "";
- if ("" === s9) {
- if (void 0 !== e7.globalScope[a3])
- s9 = "gscope['" + a3 + "']";
- else if (void 0 !== e7.globalScope._SymbolsMap[a3])
- s9 = "gscope['" + e7.globalScope._SymbolsMap[a3] + "']";
- else if (null !== e7.localScope)
- if (e7.undeclaredGlobalsInFunctions.has(a3))
- s9 = "gscope['" + e7.undeclaredGlobalsInFunctions.get(a3).manglename + "']", i3 = e7.undeclaredGlobalsInFunctions.get(a3).manglename;
- else {
- const t5 = { manglename: Me(e7), node: n3.left };
- e7.undeclaredGlobalsInFunctions.set(a3, t5), s9 = "gscope['" + t5.manglename + "']", i3 = t5.manglename;
- }
- }
- return i3 && (r4 += "lang.chkAssig('" + i3 + "',runtimeCtx); \n"), r4 += "if (" + t4 + "===null) { lastStatement = lc.voidOperation; }\n ", r4 += "else if (lc.isArray(" + t4 + ") || lc.isString(" + t4 + ")) {", r4 += "var " + o5 + "=" + t4 + ".length; \n", r4 += "for(var " + l6 + "=0; " + l6 + "<" + o5 + "; " + l6 + "++) {\n", r4 += s9 + "=" + l6 + ";\n", r4 += V2(e7, n3.body), r4 += "\n}\n", r4 += " lastStatement = lc.voidOperation; \n", r4 += " \n}\n", r4 += "else if (lc.isImmutableArray(" + t4 + ")) {", r4 += "var " + o5 + "=" + t4 + ".length(); \n", r4 += "for(var " + l6 + "=0; " + l6 + "<" + o5 + "; " + l6 + "++) {\n", r4 += s9 + "=" + l6 + ";\n", r4 += V2(e7, n3.body), r4 += "\n}\n", r4 += " lastStatement = lc.voidOperation; \n", r4 += " \n}\n", r4 += "else if (( " + t4 + " instanceof lang.Dictionary) || ( " + t4 + " instanceof lang.Feature)) {", r4 += "var " + o5 + "=" + t4 + ".keys(); \n", r4 += "for(var " + l6 + "=0; " + l6 + "<" + o5 + ".length; " + l6 + "++) {\n", r4 += s9 + "=" + o5 + "[" + l6 + "];\n", r4 += V2(e7, n3.body), r4 += "\n}\n", r4 += " lastStatement = lc.voidOperation; \n", r4 += " \n}\n", e7.isAsync && (r4 += "else if (lc.isFeatureSet(" + t4 + ")) {", r4 += "var " + o5 + "=" + t4 + ".iterator(runtimeCtx.abortSignal); \n", r4 += "for(var " + l6 + "=lang. graphicToFeature( yield " + o5 + ".next()," + t4 + "); " + l6 + "!=null; " + l6 + "=lang. graphicToFeature( yield " + o5 + ".next()," + t4 + ")) {\n", r4 += s9 + "=" + l6 + ";\n", r4 += V2(e7, n3.body), r4 += "\n}\n", r4 += " lastStatement = lc.voidOperation; \n", r4 += " \n}\n"), r4 += "else { lastStatement = lc.voidOperation; } \n", r4;
- }
- function H(e7, n3) {
- let t4 = "lastStatement = lc.voidOperation; \n";
- null !== n3.init && (t4 += V2(e7, n3.init) + "; ");
- const o5 = Fe(e7), l6 = Fe(e7);
- return t4 += "var " + o5 + " = true; ", t4 += "\n do { ", null !== n3.update && (t4 += " if (" + o5 + "===false) {\n " + V2(e7, n3.update) + " \n}\n " + o5 + "=false; \n"), null !== n3.test && (t4 += "var " + l6 + " = " + V2(e7, n3.test) + "; ", t4 += "if (" + l6 + "===false) { break; } else if (" + l6 + "!==true) { lang.error('" + e.BooleanConditionRequired + "'); }\n"), t4 += V2(e7, n3.body), null !== n3.update && (t4 += "\n " + V2(e7, n3.update)), t4 += "\n" + o5 + " = true; \n} while(true); lastStatement = lc.voidOperation; ", t4;
- }
- function Q2(e7, n3) {
- let t4 = null, o5 = "";
- if ("MemberExpression" === n3.argument.type)
- return t4 = V2(e7, n3.argument.object), true === n3.argument.computed ? o5 = V2(e7, n3.argument.property) : (o5 = "'" + n3.argument.property.name + "'", se2(n3.argument.property.name)), "lang.memberupdate(" + t4 + "," + o5 + ",'" + n3.operator + "'," + n3.prefix + ")";
- if (t4 = n3.argument.name.toLowerCase(), se2(t4), null !== e7.localScope) {
- if (void 0 !== e7.localScope[t4])
- return "lang.update(lscope, '" + t4 + "','" + n3.operator + "'," + n3.prefix + ")";
- if (void 0 !== e7.localScope._SymbolsMap[t4])
- return "lang.update(lscope, '" + e7.localScope._SymbolsMap[t4] + "','" + n3.operator + "'," + n3.prefix + ")";
- }
- if (void 0 !== e7.globalScope[t4])
- return "lang.update(gscope, '" + t4 + "','" + n3.operator + "'," + n3.prefix + ")";
- if (void 0 !== e7.globalScope._SymbolsMap[t4])
- return "lang.update(gscope, '" + e7.globalScope._SymbolsMap[t4] + "','" + n3.operator + "'," + n3.prefix + ")";
- if (null !== e7.localScope) {
- if (e7.undeclaredGlobalsInFunctions.has(t4))
- return "lang.update(gscope,lang.chkAssig( '" + e7.undeclaredGlobalsInFunctions.get(t4).manglename + "',runtimeCtx),'" + n3.operator + "'," + n3.prefix + ")";
- const o6 = { manglename: Me(e7), node: n3.argument };
- return e7.undeclaredGlobalsInFunctions.set(t4, o6), "lang.update(gscope, lang.chkAssig('" + o6.manglename + "',runtimeCtx),'" + n3.operator + "'," + n3.prefix + ")";
- }
- throw new t(e7, e.InvalidIdentifier, n3);
- }
- function X2(e7, n3) {
- let t4 = "lastStatement = lc.voidOperation; \n";
- const o5 = Fe(e7);
- return t4 += `
- var ${o5} = true;
- do {
- ${o5} = ${V2(e7, n3.test)};
- if (${o5}==false) {
- break;
- }
- if (${o5}!==true) {
- lang.error('${e.BooleanConditionRequired}');
- }
- ${V2(e7, n3.body)}
- }
- while (${o5} !== false);
- lastStatement = lc.voidOperation;
- `, t4;
- }
- function Z2(e7, n3) {
- const t4 = V2(e7, n3.right);
- let o5 = null, l6 = "";
- if ("MemberExpression" === n3.left.type)
- return o5 = V2(e7, n3.left.object), true === n3.left.computed ? l6 = V2(e7, n3.left.property) : (l6 = "'" + n3.left.property.name + "'", se2(n3.left.property.name)), "lang.assignmember(" + o5 + "," + l6 + ",'" + n3.operator + "'," + t4 + ")";
- if (o5 = n3.left.name.toLowerCase(), se2(o5), null !== e7.localScope) {
- if (void 0 !== e7.localScope[o5])
- return "lscope['" + o5 + "']=lang.assign(" + t4 + ",'" + n3.operator + "', lscope['" + o5 + "'])";
- if (void 0 !== e7.localScope._SymbolsMap[o5])
- return "lscope['" + e7.localScope._SymbolsMap[o5] + "']=lang.assign(" + t4 + ",'" + n3.operator + "', lscope['" + e7.localScope._SymbolsMap[o5] + "'])";
- }
- if (void 0 !== e7.globalScope[o5])
- return "gscope['" + o5 + "']=lang.assign(" + t4 + ",'" + n3.operator + "', gscope['" + o5 + "'])";
- if (void 0 !== e7.globalScope._SymbolsMap[o5])
- return "gscope['" + e7.globalScope._SymbolsMap[o5] + "']=lang.assign(" + t4 + ",'" + n3.operator + "', gscope['" + e7.globalScope._SymbolsMap[o5] + "'])";
- if (null !== e7.localScope) {
- if (e7.undeclaredGlobalsInFunctions.has(o5))
- return "gscope[lang.chkAssig('" + e7.undeclaredGlobalsInFunctions.get(o5).manglename + "',runtimeCtx)]=lang.assign(" + t4 + ",'" + n3.operator + "', gscope['" + e7.undeclaredGlobalsInFunctions.get(o5).manglename + "'])";
- const l7 = { manglename: Me(e7), node: n3.argument };
- return e7.undeclaredGlobalsInFunctions.set(o5, l7), "gscope[lang.chkAssig('" + l7.manglename + "',runtimeCtx)]=lang.assign(" + t4 + ",'" + n3.operator + "', gscope['" + l7.manglename + "'])";
- }
- throw new t(e7, e.InvalidIdentifier, n3);
- }
- function ee(e7, n3) {
- return "AssignmentExpression" === n3.expression.type ? "lastStatement = lc.voidOperation; " + V2(e7, n3.expression) + "; \n " : (n3.expression.type, "lastStatement = " + V2(e7, n3.expression) + "; ");
- }
- function ne(e7, n3) {
- return "BlockStatement" === n3.type ? V2(e7, n3) : "ReturnStatement" === n3.type || "BreakStatement" === n3.type || "ContinueStatement" === n3.type ? V2(e7, n3) + "; " : "UpdateExpression" === n3.type ? "lastStatement = " + V2(e7, n3) + "; " : "ExpressionStatement" === n3.type ? V2(e7, n3) : "ObjectExpression" === n3.type ? "lastStatement = " + V2(e7, n3) + "; " : V2(e7, n3) + "; ";
- }
- function te(e7, n3) {
- if ("AssignmentExpression" === n3.test.type || "UpdateExpression" === n3.test.type)
- throw new s(e7, e.BooleanConditionRequired, n3);
- return `if (lang.mustBoolean(${V2(e7, n3.test)}, runtimeCtx) === true) {
- ${ne(e7, n3.consequent)}
- } ` + (null !== n3.alternate ? "IfStatement" === n3.alternate.type ? " else " + te(e7, n3.alternate) : ` else {
- ${ne(e7, n3.alternate)}
- }
- ` : " else {\n lastStatement = lc.voidOperation;\n }\n");
- }
- function oe(e7, n3) {
- let t4 = "";
- for (let o5 = 0; o5 < n3.body.length; o5++)
- "EmptyStatement" !== n3.body[o5].type && ("ReturnStatement" === n3.body[o5].type || "BreakStatement" === n3.body[o5].type || "ContinueStatement" === n3.body[o5].type ? t4 += V2(e7, n3.body[o5]) + "; \n" : "UpdateExpression" === n3.body[o5].type || "ObjectExpression" === n3.body[o5].type ? t4 += "lastStatement = " + V2(e7, n3.body[o5]) + "; \n" : t4 += V2(e7, n3.body[o5]) + " \n");
- return t4;
- }
- function le(e7, n3) {
- if (null === n3.argument)
- return "return lc.voidOperation";
- return "return " + V2(e7, n3.argument);
- }
- function re2(e7, n3) {
- var _a;
- const t4 = n3.specifiers[0].local.name.toLowerCase();
- se2(t4);
- const o5 = (_a = e7.libraryResolver) == null ? void 0 : _a.loadLibrary(t4), l6 = Me(e7);
- void 0 === e7.moduleFactory[o5.uri] && (e7.moduleFactory[o5.uri] = De(o5.syntax, { interceptor: e7.interceptor, services: e7.services, moduleFactory: e7.moduleFactory, lrucache: e7.lrucache, libraryResolver: e7.libraryResolver, customfunctions: e7.customfunctions, vars: {} }, e7.isAsync)), e7.moduleFactoryMap[l6] = o5.uri;
- let r4 = "";
- if (r4 = e7.isAsync ? "(yield lang.loadModule('" + l6 + "', runtimeCtx) ); " : "lang.loadModule('" + l6 + "', runtimeCtx); ", void 0 !== e7.globalScope[t4])
- return "gscope['" + t4 + "']=" + r4;
- if (void 0 !== e7.globalScope._SymbolsMap[t4])
- return "gscope['" + e7.globalScope._SymbolsMap[t4] + "']=" + r4;
- let a3 = "";
- return e7.undeclaredGlobalsInFunctions.has(t4) ? (a3 = e7.undeclaredGlobalsInFunctions.get(t4).manglename, e7.undeclaredGlobalsInFunctions.delete(t4)) : a3 = Me(e7), e7.globalScope._SymbolsMap[t4] = a3, e7.mangleMap[t4] = a3, "gscope[lang.setAssig('" + a3 + "', runtimeCtx)]=" + r4;
- }
- function ae(e7, n3) {
- const t4 = V2(e7, n3.declaration);
- if ("FunctionDeclaration" === n3.declaration.type)
- e7.exports[n3.declaration.id.name.toLowerCase()] = "function";
- else if ("VariableDeclaration" === n3.declaration.type)
- for (const o5 of n3.declaration.declarations)
- e7.exports[o5.id.name.toLowerCase()] = "variable";
- return t4;
- }
- function se2(e7) {
- if ("iif" === e7)
- throw new c2();
- if ("decode" === e7)
- throw new c2();
- if ("when" === e7)
- throw new c2();
- }
- function ie(e7, n3) {
- const t4 = n3.id.name.toLowerCase();
- se2(t4);
- let o5 = "", l6 = false;
- void 0 !== e7.globalScope[t4] ? o5 = t4 : void 0 !== e7.globalScope._SymbolsMap[t4] ? o5 = e7.globalScope._SymbolsMap[t4] : e7.undeclaredGlobalsInFunctions.has(t4) ? (o5 = e7.undeclaredGlobalsInFunctions.get(t4).manglename, e7.globalScope._SymbolsMap[t4] = o5, e7.mangleMap[t4] = o5, e7.undeclaredGlobalsInFunctions.delete(t4), l6 = true) : (o5 = Me(e7), e7.globalScope._SymbolsMap[t4] = o5, e7.mangleMap[t4] = o5);
- const r4 = { isAsync: e7.isAsync, console: e7.console, exports: e7.exports, undeclaredGlobalsInFunctions: e7.undeclaredGlobalsInFunctions, customfunctions: e7.customfunctions, moduleFactory: e7.moduleFactory, moduleFactoryMap: e7.moduleFactoryMap, libraryResolver: e7.libraryResolver, lrucache: e7.lrucache, interceptor: e7.interceptor, services: e7.services, symbols: e7.symbols, mangleMap: e7.mangleMap, localScope: { _SymbolsMap: {} }, depthCounter: e7.depthCounter, globalScope: e7.globalScope };
- let a3 = "new lang.UserDefinedCompiledFunction( lang.functionDepthchecker(function() { var lastStatement = lc.voidOperation; \n var lscope = runtimeCtx.localStack[runtimeCtx.localStack.length-1];\n";
- for (let s9 = 0; s9 < n3.params.length; s9++) {
- const t5 = n3.params[s9].name.toLowerCase();
- se2(t5);
- const o6 = Me(e7);
- r4.localScope._SymbolsMap[t5] = o6, r4.mangleMap[t5] = o6, a3 += "lscope['" + o6 + "']=arguments[" + s9.toString() + "];\n";
- }
- return true === e7.isAsync ? (a3 += "return lang.__awaiter(this, void 0, void 0, function* () {\n", a3 += oe(r4, n3.body) + "\n return lastStatement; ", a3 += "}); }", a3 += ", runtimeCtx)," + n3.params.length + ")", a3 += "\n lastStatement = lc.voidOperation; \n") : (a3 += oe(r4, n3.body) + "\n return lastStatement; }, runtimeCtx)," + n3.params.length + ")", a3 += "\n lastStatement = lc.voidOperation; \n"), l6 ? "gscope[lang.setAssig('" + o5 + "', runtimeCtx)]=" + a3 : "gscope['" + o5 + "']=" + a3;
- }
- function ce(e7, n3) {
- const t4 = [];
- for (let o5 = 0; o5 < n3.declarations.length; o5++)
- t4.push(V2(e7, n3.declarations[o5]));
- return t4.join("\n") + " \n lastStatement= lc.voidOperation; \n";
- }
- function ue(e7, n3) {
- let t4 = null === n3.init ? null : V2(e7, n3.init);
- t4 === k2 && (t4 = null);
- const o5 = n3.id.name.toLowerCase();
- if (se2(o5), null !== e7.localScope) {
- if (void 0 !== e7.localScope[o5])
- return "lscope['" + o5 + "']=" + t4 + "; ";
- if (void 0 !== e7.localScope._SymbolsMap[o5])
- return "lscope['" + e7.localScope._SymbolsMap[o5] + "']=" + t4 + "; ";
- {
- const n4 = Me(e7);
- return e7.localScope._SymbolsMap[o5] = n4, e7.mangleMap[o5] = n4, "lscope['" + n4 + "']=" + t4 + "; ";
- }
- }
- if (void 0 !== e7.globalScope[o5])
- return "gscope['" + o5 + "']=" + t4 + "; ";
- if (void 0 !== e7.globalScope._SymbolsMap[o5])
- return "gscope['" + e7.globalScope._SymbolsMap[o5] + "']=" + t4 + "; ";
- if (e7.undeclaredGlobalsInFunctions.has(o5)) {
- const n4 = e7.undeclaredGlobalsInFunctions.get(o5).manglename;
- return e7.globalScope._SymbolsMap[o5] = n4, e7.mangleMap[o5] = n4, e7.undeclaredGlobalsInFunctions.delete(o5), "gscope[lang.setAssig('" + n4 + "', runtimeCtx)]=" + t4 + "; ";
- }
- const l6 = Me(e7);
- return e7.globalScope._SymbolsMap[o5] = l6, e7.mangleMap[o5] = l6, "gscope['" + l6 + "']=" + t4 + "; ";
- }
- function pe(e7, n3) {
- try {
- let t4;
- return true === n3.computed ? t4 = V2(e7, n3.property) : (t4 = "'" + n3.property.name + "'", se2(n3.property.name)), "lang.member(" + V2(e7, n3.object) + "," + t4 + ")";
- } catch (t4) {
- throw t4;
- }
- }
- function me(e7, n3) {
- try {
- return "lang.unary(" + V2(e7, n3.argument) + ",'" + n3.operator + "')";
- } catch (t4) {
- throw t4;
- }
- }
- function ge(e7, n3) {
- try {
- const t4 = [];
- for (let o5 = 0; o5 < n3.elements.length; o5++)
- "Literal" === n3.elements[o5].type ? t4.push(V2(e7, n3.elements[o5])) : t4.push("lang.aCheck(" + V2(e7, n3.elements[o5]) + ",'ArrayExpression')");
- return "[" + t4.join(",") + "]";
- } catch (t4) {
- throw t4;
- }
- }
- function de(e7, n3) {
- try {
- const t4 = [];
- let o5 = 0;
- for (const l6 of n3.quasis)
- t4.push(l6.value ? JSON.stringify(l6.value.cooked) : JSON.stringify("")), false === l6.tail && (t4.push(n3.expressions[o5] ? "lang.castString(lang.aCheck(" + V2(e7, n3.expressions[o5]) + ", 'TemplateLiteral'))" : ""), o5++);
- return "([" + t4.join(",") + "]).join('')";
- } catch (t4) {
- throw t4;
- }
- }
- function fe(e7, n3) {
- try {
- return "lang.binary(" + V2(e7, n3.left) + "," + V2(e7, n3.right) + ",'" + n3.operator + "')";
- } catch (t4) {
- throw t4;
- }
- }
- function he(e7, n3) {
- try {
- if ("AssignmentExpression" === n3.left.type || "UpdateExpression" === n3.left.type)
- throw new s(e7, e.LogicalExpressionOnlyBoolean, n3);
- if ("AssignmentExpression" === n3.right.type || "UpdateExpression" === n3.right.type)
- throw new s(e7, e.LogicalExpressionOnlyBoolean, n3);
- if ("&&" === n3.operator || "||" === n3.operator)
- return "(lang.logicalCheck(" + V2(e7, n3.left) + ") " + n3.operator + " lang.logicalCheck(" + V2(e7, n3.right) + "))";
- throw new s(null, e.LogicExpressionOrAnd, null);
- } catch (t4) {
- throw t4;
- }
- }
- function ye(e7, n3) {
- try {
- const t4 = n3.name.toLowerCase();
- if (se2(t4), null !== e7.localScope) {
- if (void 0 !== e7.localScope[t4])
- return "lscope['" + t4 + "']";
- if (void 0 !== e7.localScope._SymbolsMap[t4])
- return "lscope['" + e7.localScope._SymbolsMap[t4] + "']";
- }
- if (void 0 !== e7.globalScope[t4])
- return "gscope['" + t4 + "']";
- if (void 0 !== e7.globalScope._SymbolsMap[t4])
- return "gscope['" + e7.globalScope._SymbolsMap[t4] + "']";
- if (null !== e7.localScope) {
- if (e7.undeclaredGlobalsInFunctions.has(t4))
- return "gscope[lang.chkAssig('" + e7.undeclaredGlobalsInFunctions.get(t4).manglename + "',runtimeCtx)]";
- const o5 = { manglename: Me(e7), node: n3.argument };
- return e7.undeclaredGlobalsInFunctions.set(t4, o5), "gscope[lang.chkAssig('" + o5.manglename + "',runtimeCtx)]";
- }
- throw new s(e7, e.InvalidIdentifier, n3);
- } catch (t4) {
- throw t4;
- }
- }
- function be(e7, n3) {
- try {
- if ("MemberExpression" === n3.callee.type) {
- let t5;
- true === n3.callee.computed ? t5 = V2(e7, n3.callee.property) : (t5 = "'" + n3.callee.property.name + "'", se2(n3.callee.property.name));
- let o6 = "[";
- for (let l6 = 0; l6 < n3.arguments.length; l6++)
- l6 > 0 && (o6 += ", "), o6 += V2(e7, n3.arguments[l6]);
- return o6 += "]", e7.isAsync ? "(yield lang.callModuleFunction(" + V2(e7, n3.callee.object) + "," + o6 + "," + t5 + ",runtimeCtx))" : "lang.callModuleFunction(" + V2(e7, n3.callee.object) + "," + o6 + "," + t5 + ",runtimeCtx)";
- }
- if ("Identifier" !== n3.callee.type)
- throw new s(e7, e.FuncionNotFound, n3);
- const t4 = n3.callee.name.toLowerCase();
- if ("iif" === t4)
- return we(e7, n3);
- if ("when" === t4)
- return Se(e7, n3);
- if ("decode" === t4)
- return ve2(e7, n3);
- let o5 = "";
- if (null !== e7.localScope && (void 0 !== e7.localScope[t4] ? o5 = "lscope['" + t4 + "']" : void 0 !== e7.localScope._SymbolsMap[t4] && (o5 = "lscope['" + e7.localScope._SymbolsMap[t4] + "']")), "" === o5) {
- if (void 0 !== e7.globalScope[t4])
- o5 = "gscope['" + t4 + "']";
- else if (void 0 !== e7.globalScope._SymbolsMap[t4])
- o5 = "gscope['" + e7.globalScope._SymbolsMap[t4] + "']";
- else if (null !== e7.localScope)
- if (e7.undeclaredGlobalsInFunctions.has(t4))
- o5 = "gscope[lang.chkAssig('" + e7.undeclaredGlobalsInFunctions.get(t4).manglename + "',runtimeCtx)]";
- else {
- const l6 = { manglename: Me(e7), node: n3.argument };
- e7.undeclaredGlobalsInFunctions.set(t4, l6), o5 = "gscope[lang.chkAssig('" + l6.manglename + "',runtimeCtx)]";
- }
- }
- if ("" !== o5) {
- let t5 = "[";
- for (let o6 = 0; o6 < n3.arguments.length; o6++)
- o6 > 0 && (t5 += ", "), t5 += V2(e7, n3.arguments[o6]);
- return t5 += "]", e7.isAsync ? "(yield lang.callfunc(" + o5 + "," + t5 + ",runtimeCtx) )" : "lang.callfunc(" + o5 + "," + t5 + ",runtimeCtx)";
- }
- throw new s(e7, e.FuncionNotFound, n3);
- } catch (t4) {
- throw t4;
- }
- }
- function we(e7, n3) {
- try {
- if (3 !== n3.arguments.length)
- throw new s(e7, e.WrongNumberOfParameters, n3);
- const t4 = Fe(e7);
- return `${e7.isAsync ? "(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {" : "function() {"}
- var ${t4} = ${V2(e7, n3.arguments[0])};
-
- if (${t4} === true) {
- return ${V2(e7, n3.arguments[1])};
- }
- else if (${t4} === false) {
- return ${V2(e7, n3.arguments[2])};
- }
- else {
- lang.error('ExecutionErrorCodes.BooleanConditionRequired');
- }
- ${e7.isAsync ? "})}()))" : "}()"}`;
- } catch (t4) {
- throw t4;
- }
- }
- function Se(e7, n3) {
- try {
- if (n3.arguments.length < 3)
- throw new s(e7, e.WrongNumberOfParameters, n3);
- if (n3.arguments.length % 2 == 0)
- throw new s(e7, e.WrongNumberOfParameters, n3);
- const t4 = Fe(e7);
- let o5 = "var ";
- for (let l6 = 0; l6 < n3.arguments.length - 1; l6 += 2)
- o5 += `${t4} = lang.mustBoolean(${V2(e7, n3.arguments[l6])}, runtimeCtx);
- if (${t4} === true ) {
- return ${V2(e7, n3.arguments[l6 + 1])}
- }
- `;
- return `${e7.isAsync ? "(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {" : "function() {"}
- ${o5}
- return ${V2(e7, n3.arguments[n3.arguments.length - 1])}
- ${e7.isAsync ? "})}()))" : "}()"}`;
- } catch (t4) {
- throw t4;
- }
- }
- function ve2(e7, n3) {
- try {
- if (n3.arguments.length < 2)
- throw new s(e7, e.WrongNumberOfParameters, n3);
- if (2 === n3.arguments.length)
- return `(${V2(e7, n3.arguments[1])})`;
- if ((n3.arguments.length - 1) % 2 == 0)
- throw new s(e7, e.WrongNumberOfParameters, n3);
- const t4 = Fe(e7), o5 = Fe(e7);
- let l6 = "var ";
- for (let r4 = 1; r4 < n3.arguments.length - 1; r4 += 2)
- l6 += `${o5} = ${V2(e7, n3.arguments[r4])};
- if (lang.binary(${o5}, ${t4}, "==") === true ) {
- return ${V2(e7, n3.arguments[r4 + 1])}
- }
- `;
- return `${e7.isAsync ? "(yield (function() { \n return lang.__awaiter(this, void 0, void 0, function* () {" : "function() {"}
- var ${t4} = ${V2(e7, n3.arguments[0])};
- ${l6}
- return ${V2(e7, n3.arguments[n3.arguments.length - 1])}
- ${e7.isAsync ? "})}()))" : "}()"}`;
- } catch (t4) {
- throw t4;
- }
- }
- var xe = {};
- function Me(e7) {
- return e7.symbols.symbolCounter++, "_T" + e7.symbols.symbolCounter.toString();
- }
- function Fe(e7) {
- return e7.symbols.symbolCounter++, "_Tvar" + e7.symbols.symbolCounter.toString();
- }
- M(xe, W2), B(xe, W2), N2(xe, W2), C2(xe, W2), f(xe, W2), xe.iif = function(e7, n3) {
- try {
- return W2(e7, n3, (t4, o5, l6) => {
- throw new t(e7, e.Unrecognised, n3);
- });
- } catch (t4) {
- throw t4;
- }
- }, xe.decode = function(e7, n3) {
- try {
- return W2(e7, n3, (t4, o5, l6) => {
- throw new t(e7, e.Unrecognised, n3);
- });
- } catch (t4) {
- throw t4;
- }
- }, xe.when = function(e7, n3) {
- try {
- return W2(e7, n3, (t4, o5, l6) => {
- throw new t(e7, e.Unrecognised, n3);
- });
- } catch (t4) {
- throw t4;
- }
- };
- var Ce = {};
- for (const Pe in xe)
- Ce[Pe] = new e2(xe[Pe]);
- q(xe, W2);
- for (const Pe in xe)
- xe[Pe] = new e2(xe[Pe]);
- var Ie = function() {
- };
- Ie.prototype = xe;
- var Ae = function() {
- };
- function _e(e7, n3, t4) {
- const o5 = {};
- e7 || (e7 = {}), t4 || (t4 = {}), o5._SymbolsMap = {}, o5.textformatting = 1, o5.infinity = 1, o5.pi = 1;
- for (const l6 in n3)
- o5[l6] = 1;
- for (const l6 in t4)
- o5[l6] = 1;
- for (const l6 in e7)
- o5[l6] = 1;
- return o5;
- }
- function Oe(t4, o5, l6) {
- const r4 = l6 ? new Ae() : new Ie();
- t4 || (t4 = {}), o5 || (o5 = {});
- const a3 = new J2({ newline: "\n", tab: " ", singlequote: "'", doublequote: '"', forwardslash: "/", backwardslash: "\\" });
- a3.immutable = false, r4._SymbolsMap = { textformatting: 1, infinity: 1, pi: 1 }, r4.textformatting = a3, r4.infinity = Number.POSITIVE_INFINITY, r4.pi = Math.PI;
- for (const e7 in o5)
- r4[e7] = o5[e7], r4._SymbolsMap[e7] = 1;
- for (const e7 in t4)
- r4._SymbolsMap[e7] = 1, t4[e7] && "esri.Graphic" === t4[e7].declaredClass ? r4[e7] = g.createFromGraphic(t4[e7]) : r4[e7] = t4[e7];
- return r4;
- }
- Ae.prototype = Ce;
- function Ee(e7, n3) {
- const t4 = { mode: n3, compiled: true, functions: {}, signatures: [], standardFunction: W2, standardFunctionAsync: W2, evaluateIdentifier: Be };
- for (let o5 = 0; o5 < e7.length; o5++)
- e7[o5].registerFunctions(t4);
- if ("sync" === n3) {
- for (const e8 in t4.functions)
- xe[e8] = new e2(t4.functions[e8]), Ie.prototype[e8] = xe[e8];
- for (let e8 = 0; e8 < t4.signatures.length; e8++)
- o(t4.signatures[e8], "sync");
- } else {
- for (const e8 in t4.functions)
- Ce[e8] = new e2(t4.functions[e8]), Ae.prototype[e8] = Ce[e8];
- for (let e8 = 0; e8 < t4.signatures.length; e8++)
- o(t4.signatures[e8], "async");
- }
- }
- function Be(e7, n3) {
- const t4 = n3.name;
- if ("_SymbolsMap" === t4)
- throw new t(e7, e.InvalidIdentifier, null);
- if (e7.localStack.length > 0) {
- if ("_t" !== t4.substr(0, 2).toLowerCase() && void 0 !== e7.localStack[e7.localStack.length - 1][t4])
- return e7.localStack[e7.localStack.length - 1][t4];
- const n4 = e7.mangleMap[t4];
- if (void 0 !== n4 && void 0 !== e7.localStack[e7.localStack.length - 1][n4])
- return e7.localStack[e7.localStack.length - 1][n4];
- }
- if ("_t" !== t4.substr(0, 2).toLowerCase() && void 0 !== e7.globalScope[t4])
- return e7.globalScope[t4];
- if (1 === e7.globalScope._SymbolsMap[t4])
- return e7.globalScope[t4];
- const o5 = e7.mangleMap[t4];
- return void 0 !== o5 ? e7.globalScope[o5] : void 0;
- }
- Ee([m2], "sync"), Ee([m2], "async");
- var $e = 0;
- var je = { error(e7) {
- throw new t(null, e7, null);
- }, __awaiter: (e7, n3, t4, o5) => new Promise((t5, l6) => {
- function r4(e8) {
- try {
- s9(o5.next(e8));
- } catch (n4) {
- l6(n4);
- }
- }
- function a3(e8) {
- try {
- s9(o5.throw(e8));
- } catch (n4) {
- l6(n4);
- }
- }
- function s9(e8) {
- e8.done ? t5(e8.value) : e8.value && e8.value.then ? e8.value.then(r4, a3) : ($e++, $e % 100 == 0 ? setTimeout(() => {
- $e = 0, r4(e8.value);
- }, 0) : r4(e8.value));
- }
- s9((o5 = o5.apply(e7, n3 || [])).next());
- }), functionDepthchecker: (e7, n3) => function() {
- if (n3.depthCounter.depth++, n3.localStack.push([]), n3.depthCounter.depth > 64)
- throw new t(null, e.MaximumCallDepth, null);
- const t4 = e7.apply(this, arguments);
- return C(t4) ? t4.then((e8) => (n3.depthCounter.depth--, n3.localStack.length = n3.localStack.length - 1, e8)) : (n3.depthCounter.depth--, n3.localStack.length = n3.localStack.length - 1, t4);
- }, chkAssig(e7, n3) {
- if (void 0 === n3.gdefs[e7])
- throw new t(n3, e.InvalidIdentifier, null);
- return e7;
- }, mustBoolean(e7, n3) {
- if (true === e7 || false === e7)
- return e7;
- throw new t(n3, e.BooleanConditionRequired, null);
- }, setAssig: (e7, n3) => (n3.gdefs[e7] = 1, e7), castString: (e7) => K(e7), aCheck(e7, n3) {
- if (F(e7)) {
- if ("ArrayExpression" === n3)
- throw new t(null, e.NoFunctionInArray, null);
- if ("ObjectExpression" === n3)
- throw new t(null, e.NoFunctionInDictionary, null);
- throw new t(null, e.NoFunctionInTemplateLiteral, null);
- }
- return e7 === k2 ? null : e7;
- }, Dictionary: J2, Feature: g, UserDefinedCompiledFunction: T, dictionary(n3) {
- const o5 = {}, l6 = /* @__PURE__ */ new Map();
- for (let e7 = 0; e7 < n3.length; e7 += 2) {
- if (F(n3[e7 + 1]))
- throw new t(null, e.NoFunctionInDictionary, null);
- if (false === w3(n3[e7]))
- throw new t(null, e.KeyMustBeString, null);
- let r5 = n3[e7].toString();
- const s9 = r5.toLowerCase();
- l6.has(s9) ? r5 = l6.get(s9) : l6.set(s9, r5), n3[e7 + 1] === k2 ? o5[r5] = null : o5[r5] = n3[e7 + 1];
- }
- const r4 = new J2(o5);
- return r4.immutable = false, r4;
- }, strCheck(e7) {
- if (false === w3(e7))
- throw new t(null, e.KeyMustBeString, null);
- return e7;
- }, unary(e7, n3) {
- if (_(e7)) {
- if ("!" === n3)
- return !e7;
- if ("-" === n3)
- return -1 * re(e7);
- if ("+" === n3)
- return 1 * re(e7);
- if ("~" === n3)
- return ~re(e7);
- throw new t(null, e.UnsupportedUnaryOperator, null);
- }
- if ("-" === n3)
- return -1 * re(e7);
- if ("+" === n3)
- return 1 * re(e7);
- if ("~" === n3)
- return ~re(e7);
- throw new t(null, e.UnsupportedUnaryOperator, null);
- }, logicalCheck(e7) {
- if (false === _(e7))
- throw new t(null, e.LogicExpressionOrAnd, null);
- return e7;
- }, logical(e7, n3, t4) {
- if (_(e7) && _(n3))
- switch (t4) {
- case "||":
- return e7 || n3;
- case "&&":
- return e7 && n3;
- default:
- throw new t(null, e.LogicExpressionOrAnd, null);
- }
- throw new t(null, e.LogicExpressionOrAnd, null);
- }, binary(e7, n3, t4) {
- switch (t4) {
- case "|":
- case "<<":
- case ">>":
- case ">>>":
- case "^":
- case "&":
- return Ne(re(e7), re(n3), t4);
- case "==":
- case "=":
- return X(e7, n3);
- case "!=":
- return !X(e7, n3);
- case "<":
- case ">":
- case "<=":
- case ">=":
- return Q(e7, n3, t4);
- case "+":
- return w3(e7) || w3(n3) ? K(e7) + K(n3) : re(e7) + re(n3);
- case "-":
- return re(e7) - re(n3);
- case "*":
- return re(e7) * re(n3);
- case "/":
- return re(e7) / re(n3);
- case "%":
- return re(e7) % re(n3);
- default:
- throw new t(null, e.UnsupportedOperator, null);
- }
- }, assign(e7, n3, t4) {
- switch (n3) {
- case "=":
- return e7 === k2 ? null : e7;
- case "/=":
- return re(t4) / re(e7);
- case "*=":
- return re(t4) * re(e7);
- case "-=":
- return re(t4) - re(e7);
- case "+=":
- return w3(t4) || w3(e7) ? K(t4) + K(e7) : re(t4) + re(e7);
- case "%=":
- return re(t4) % re(e7);
- default:
- throw new t(null, e.UnsupportedOperator, null);
- }
- }, update(e7, n3, t4, o5) {
- const l6 = re(e7[n3]);
- return e7[n3] = "++" === t4 ? l6 + 1 : l6 - 1, false === o5 ? l6 : "++" === t4 ? l6 + 1 : l6 - 1;
- }, graphicToFeature: (e7, t4) => null === e7 ? null : g.createFromGraphicLikeObject(e7.geometry, e7.attributes, t4), memberupdate(n3, t4, o5, l6) {
- let r4;
- if (Y(n3)) {
- if (!Z(t4))
- throw new t(null, e.ArrayAccessorMustBeNumber, null);
- if (t4 < 0 && (t4 = n3.length + t4), t4 < 0 || t4 >= n3.length)
- throw new t(null, e.OutOfBounds, null);
- r4 = re(n3[t4]), n3[t4] = "++" === o5 ? r4 + 1 : r4 - 1;
- } else if (n3 instanceof J2) {
- if (false === w3(t4))
- throw new t(null, e.KeyAccessorMustBeString, null);
- if (true !== n3.hasField(t4))
- throw new t(null, e.FieldNotFound, null, { key: t4 });
- r4 = re(n3.field(t4)), n3.setField(t4, "++" === o5 ? r4 + 1 : r4 - 1);
- } else if (J(n3)) {
- if (false === w3(t4))
- throw new t(null, e.KeyAccessorMustBeString, null);
- if (true !== n3.hasField(t4))
- throw new t(null, e.FieldNotFound, null);
- r4 = re(n3.field(t4)), n3.setField(t4, "++" === o5 ? r4 + 1 : r4 - 1);
- } else {
- if (E(n3))
- throw new t(null, e.Immutable, null);
- if (!(n3 instanceof Ue))
- throw new t(null, e.InvalidIdentifier, null);
- if (false === w3(t4))
- throw new t(null, e.ModuleAccessorMustBeString, null);
- if (true !== n3.hasGlobal(t4))
- throw new t(null, e.ModuleExportNotFound, null);
- r4 = re(n3.global(t4)), n3.setGlobal(t4, "++" === o5 ? r4 + 1 : r4 - 1);
- }
- return false === l6 ? r4 : "++" === o5 ? r4 + 1 : r4 - 1;
- }, assignmember(n3, t4, o5, l6) {
- if (Y(n3)) {
- if (!Z(t4))
- throw new t(null, e.ArrayAccessorMustBeNumber, null);
- if (t4 < 0 && (t4 = n3.length + t4), t4 < 0 || t4 > n3.length)
- throw new t(null, e.OutOfBounds, null);
- if (t4 === n3.length) {
- if ("=" !== o5)
- throw new t(null, e.OutOfBounds, null);
- n3[t4] = this.assign(l6, o5, n3[t4]);
- } else
- n3[t4] = this.assign(l6, o5, n3[t4]);
- } else if (n3 instanceof J2) {
- if (false === w3(t4))
- throw new t(null, e.KeyAccessorMustBeString, null);
- if (true === n3.hasField(t4))
- n3.setField(t4, this.assign(l6, o5, n3.field(t4)));
- else {
- if ("=" !== o5)
- throw new t(null, e.FieldNotFound, null);
- n3.setField(t4, this.assign(l6, o5, null));
- }
- } else if (J(n3)) {
- if (false === w3(t4))
- throw new t(null, e.KeyAccessorMustBeString, null);
- if (true === n3.hasField(t4))
- n3.setField(t4, this.assign(l6, o5, n3.field(t4)));
- else {
- if ("=" !== o5)
- throw new t(null, e.FieldNotFound, null);
- n3.setField(t4, this.assign(l6, o5, null));
- }
- } else {
- if (E(n3))
- throw new t(null, e.Immutable, null);
- if (!(n3 instanceof Ue))
- throw new t(null, e.InvalidIdentifier, null);
- if (false === w3(t4))
- throw new t(null, e.ModuleAccessorMustBeString, null);
- if (!n3.hasGlobal(t4))
- throw new t(null, e.ModuleExportNotFound, null);
- n3.setGlobal(t4, this.assign(l6, o5, n3.global(t4)));
- }
- }, member(n3, t4) {
- if (null === n3)
- throw new t(null, e.MemberOfNull, null);
- if (n3 instanceof J2 || J(n3)) {
- if (w3(t4))
- return n3.field(t4);
- throw new t(null, e.InvalidMemberAccessKey, null);
- }
- if (n3 instanceof p) {
- if (w3(t4))
- return W(n3, t4, null, null);
- throw new t(null, e.InvalidMemberAccessKey, null);
- }
- if (Y(n3)) {
- if (Z(t4) && isFinite(t4) && Math.floor(t4) === t4) {
- if (t4 < 0 && (t4 = n3.length + t4), t4 >= n3.length || t4 < 0)
- throw new t(null, e.OutOfBounds, null);
- return n3[t4];
- }
- throw new t(null, e.InvalidMemberAccessKey, null);
- }
- if (w3(n3)) {
- if (Z(t4) && isFinite(t4) && Math.floor(t4) === t4) {
- if (t4 < 0 && (t4 = n3.length + t4), t4 >= n3.length || t4 < 0)
- throw new t(null, e.OutOfBounds, null);
- return n3[t4];
- }
- throw new t(null, e.InvalidMemberAccessKey, null);
- }
- if (E(n3)) {
- if (Z(t4) && isFinite(t4) && Math.floor(t4) === t4) {
- if (t4 < 0 && (t4 = n3.length() + t4), t4 >= n3.length() || t4 < 0)
- throw new t(null, e.OutOfBounds, null);
- return n3.get(t4);
- }
- throw new t(null, e.InvalidMemberAccessKey, null);
- }
- if (n3 instanceof Ue) {
- if (w3(t4))
- return n3.global(t4);
- throw new t(null, e.InvalidMemberAccessKey, null);
- }
- throw new t(null, e.InvalidMemberAccessKey, null);
- }, callfunc: (e7, n3, t4) => e7.call(t4, { arguments: n3, preparsed: true }), loadModule(e7, n3) {
- const t4 = n3.moduleFactoryMap[e7];
- if (n3.moduleSingletons[t4])
- return n3.moduleSingletons[t4];
- const o5 = n3.moduleFactory[t4]({ vars: {}, moduleSingletons: n3.moduleSingletons, depthCounter: n3.depthCounter, console: n3.console, abortSignal: n3.abortSignal, isAsync: n3.isAsync, services: n3.services, lrucache: n3.lrucache, interceptor: n3.interceptor }, n3.spatialReference);
- return n3.moduleSingletons[t4] = o5, o5;
- }, callModuleFunction(e7, n3, o5, l6) {
- if (!(e7 instanceof Ue))
- throw new t(null, e.FuncionNotFound, null);
- const r4 = e7.global(o5);
- if (false === F(r4))
- throw new t(null, e.CallNonFunction, null);
- return r4.call(l6, { preparsed: true, arguments: n3 });
- } };
- function Ne2(e7) {
- console.log(e7);
- }
- function Le(e7, n3, c5 = false) {
- null === n3 && (n3 = { vars: {}, customfunctions: {} });
- let u7 = null;
- e7.usesModules && (u7 = new s4(null, e7.loadedModules));
- const p5 = { isAsync: c5, globalScope: _e(n3.vars, c5 ? Ce : xe, n3.customfunctions), moduleFactory: {}, moduleFactoryMap: {}, undeclaredGlobalsInFunctions: /* @__PURE__ */ new Map(), customfunctions: n3.customfunctions, libraryResolver: u7, localScope: null, mangleMap: {}, depthCounter: { depth: 1 }, exports: {}, console: Ne2, lrucache: n3.lrucache, interceptor: n3.interceptor, services: n3.services, symbols: { symbolCounter: 0 } };
- let m5 = V2(p5, e7);
- "" === m5 && (m5 = "lc.voidOperation; "), p5.undeclaredGlobalsInFunctions.size > 0 && p5.undeclaredGlobalsInFunctions.forEach((e8) => {
- throw new s(n3, e.InvalidIdentifier, e8.node);
- });
- let g5 = "";
- g5 = c5 ? "var runtimeCtx=this.prepare(context, true);\n var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; \nreturn lang.__awaiter(this, void 0, void 0, function* () {\n\n function mainBody() {\n var lastStatement=lc.voidOperation;\n return lang.__awaiter(this, void 0, void 0, function* () {\n" + m5 + "\n return lastStatement; }); } \n return this.postProcess(yield mainBody()); }); " : "var runtimeCtx=this.prepare(context, false);\n var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; \n function mainBody() {\n var lastStatement=lc.voidOperation;\n " + m5 + "\n return lastStatement; } \n return this.postProcess(mainBody()); ";
- const d5 = p5.moduleFactory, f3 = p5.moduleFactoryMap, h3 = p5.exports, y5 = {};
- for (const t4 in h3)
- y5[t4] = void 0 !== p5.mangleMap[t4] ? p5.mangleMap[t4] : t4;
- const b3 = { lc: ve, lang: je, mangles: p5.mangleMap, postProcess(e8) {
- if (e8 instanceof D && (e8 = e8.value), e8 instanceof N && (e8 = e8.value), e8 === k2 && (e8 = null), e8 === j)
- throw new t(null, e.IllegalResult, null);
- if (e8 === A)
- throw new t(null, e.IllegalResult, null);
- if (F(e8))
- throw new t(null, e.IllegalResult, null);
- return e8;
- }, prepare(e8, n4) {
- let t4 = e8.spatialReference;
- null == t4 && (t4 = k.WebMercator);
- const o5 = Oe(e8.vars, e8.customfunctions, n4);
- return { localStack: [], isAsync: n4, moduleFactory: d5, moduleFactoryMap: f3, mangleMap: this.mangles, moduleSingletons: {}, exports: h3, gdefs: {}, exportmangle: y5, spatialReference: t4, globalScope: o5, abortSignal: void 0 === e8.abortSignal || null === e8.abortSignal ? { aborted: false } : e8.abortSignal, localScope: null, services: e8.services, console: e8.console ? e8.console : Ne2, lrucache: e8.lrucache, interceptor: e8.interceptor, symbols: { symbolCounter: 0 }, depthCounter: { depth: 1 } };
- } };
- return new Function("context", "spatialReference", g5).bind(b3);
- }
- async function Re() {
- return Ee([await import("./geomasync-CXA76SKZ.js")], "async"), true;
- }
- var Ue = class extends s3 {
- constructor(e7) {
- super(null), this.moduleContext = e7;
- }
- hasGlobal(e7) {
- return void 0 === this.moduleContext.exports[e7] && (e7 = e7.toLowerCase()), void 0 !== this.moduleContext.exports[e7];
- }
- setGlobal(e7, n3) {
- const o5 = this.moduleContext.globalScope, l6 = e7.toLowerCase();
- if (F(n3))
- throw new t(null, e.AssignModuleFunction, null);
- o5[this.moduleContext.exportmangle[l6]] = n3;
- }
- global(e7) {
- const n3 = this.moduleContext.globalScope;
- e7 = e7.toLowerCase();
- const o5 = n3[this.moduleContext.exportmangle[e7]];
- if (void 0 === o5)
- throw new t(null, e.InvalidIdentifier, null);
- if (F(o5) && !(o5 instanceof s2)) {
- const t4 = new s2();
- return t4.fn = o5, t4.parameterEvaluator = W2, t4.context = this.moduleContext, n3[this.moduleContext.exportmangle[e7]] = t4, t4;
- }
- return o5;
- }
- };
- function De(e7, n3, t4 = false) {
- const l6 = { isAsync: t4, moduleFactory: n3.moduleFactory, moduleFactoryMap: {}, libraryResolver: new s4(null, e7.loadedModules), globalScope: _e(n3.vars, t4 ? Ce : xe, n3.customfunctions), customfunctions: n3.customfunctions, localScope: null, mangleMap: {}, undeclaredGlobalsInFunctions: /* @__PURE__ */ new Map(), depthCounter: { depth: 1 }, exports: {}, console: Ne2, lrucache: n3.lrucache, interceptor: n3.interceptor, services: n3.services, symbols: { symbolCounter: 0 } };
- let r4 = V2(l6, e7);
- "" === r4 && (r4 = "lc.voidOperation; ");
- let a3 = "";
- a3 = t4 ? "var runtimeCtx=this.prepare(context, true);\n var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; \nreturn lang.__awaiter(this, void 0, void 0, function* () {\n\n function mainBody() {\n var lastStatement=lc.voidOperation;\n return lang.__awaiter(this, void 0, void 0, function* () {\n" + r4 + "\n return lastStatement; }); } \n yield mainBody(); \n return this.prepareModule(runtimeCtx); }); " : "var runtimeCtx=this.prepare(context, false);\n var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; \n function mainBody() {\n var lastStatement=lc.voidOperation;\n " + r4 + "\n return lastStatement; } \n mainBody(); \n return this.prepareModule(runtimeCtx); ";
- const s9 = l6.moduleFactory, i3 = l6.moduleFactoryMap, c5 = l6.exports, u7 = {};
- for (const o5 in c5)
- u7[o5] = void 0 !== l6.mangleMap[o5] ? l6.mangleMap[o5] : o5;
- const p5 = { lc: ve, lang: je, mangles: l6.mangleMap, prepareModule: (e8) => new Ue(e8), prepare(e8, n4) {
- let t5 = e8.spatialReference;
- null == t5 && (t5 = new k({ wkid: 102100 }));
- const o5 = Oe(e8.vars, e8.customfunctions, n4);
- return { localStack: [], isAsync: n4, exports: c5, exportmangle: u7, gdefs: {}, moduleFactory: s9, moduleFactoryMap: i3, moduleSingletons: e8.moduleSingletons, mangleMap: this.mangles, spatialReference: t5, globalScope: o5, abortSignal: void 0 === e8.abortSignal || null === e8.abortSignal ? { aborted: false } : e8.abortSignal, localScope: null, services: e8.services, console: e8.console ? e8.console : Ne2, lrucache: e8.lrucache, interceptor: e8.interceptor, symbols: { symbolCounter: 0 }, depthCounter: e8.depthCounter };
- } };
- return new Function("context", "spatialReference", a3).bind(p5);
- }
- // node_modules/@arcgis/core/arcade/lib/types.js
- var e4;
- !function(e7) {
- e7.AssignmentExpression = "AssignmentExpression", e7.ArrayExpression = "ArrayExpression", e7.BlockComment = "BlockComment", e7.BlockStatement = "BlockStatement", e7.BinaryExpression = "BinaryExpression", e7.BreakStatement = "BreakStatement", e7.CallExpression = "CallExpression", e7.ContinueStatement = "ContinueStatement", e7.EmptyStatement = "EmptyStatement", e7.ExpressionStatement = "ExpressionStatement", e7.ExportNamedDeclaration = "ExportNamedDeclaration", e7.ExportSpecifier = "ExportSpecifier", e7.ForStatement = "ForStatement", e7.ForInStatement = "ForInStatement", e7.FunctionDeclaration = "FunctionDeclaration", e7.Identifier = "Identifier", e7.IfStatement = "IfStatement", e7.ImportDeclaration = "ImportDeclaration", e7.ImportDefaultSpecifier = "ImportDefaultSpecifier", e7.LineComment = "LineComment", e7.Literal = "Literal", e7.LogicalExpression = "LogicalExpression", e7.MemberExpression = "MemberExpression", e7.ObjectExpression = "ObjectExpression", e7.Program = "Program", e7.Property = "Property", e7.ReturnStatement = "ReturnStatement", e7.TemplateElement = "TemplateElement", e7.TemplateLiteral = "TemplateLiteral", e7.UnaryExpression = "UnaryExpression", e7.UpdateExpression = "UpdateExpression", e7.VariableDeclaration = "VariableDeclaration", e7.VariableDeclarator = "VariableDeclarator", e7.WhileStatement = "WhileStatement";
- }(e4 || (e4 = {}));
- var t2 = ["++", "--"];
- var n2 = ["-", "+", "!", "~"];
- var i = ["=", "/=", "*=", "%=", "+=", "-="];
- var r2 = ["||", "&&"];
- var a = ["|", "&", ">>", "<<", ">>>", "^", "==", "!=", "<", "<=", ">", ">=", "+", "-", "*", "/", "%"];
- var o2 = { "||": 1, "&&": 2, "|": 3, "^": 4, "&": 5, "==": 6, "!=": 6, "<": 7, ">": 7, "<=": 7, ">=": 7, "<<": 8, ">>": 8, ">>>": 8, "+": 9, "-": 9, "*": 10, "/": 10, "%": 10 };
- var c4;
- !function(e7) {
- e7[e7.Unknown = 0] = "Unknown", e7[e7.BooleanLiteral = 1] = "BooleanLiteral", e7[e7.EOF = 2] = "EOF", e7[e7.Identifier = 3] = "Identifier", e7[e7.Keyword = 4] = "Keyword", e7[e7.NullLiteral = 5] = "NullLiteral", e7[e7.NumericLiteral = 6] = "NumericLiteral", e7[e7.Punctuator = 7] = "Punctuator", e7[e7.StringLiteral = 8] = "StringLiteral", e7[e7.Template = 10] = "Template";
- }(c4 || (c4 = {}));
- var s5 = ["Unknown", "Boolean", "<end>", "Identifier", "Keyword", "Null", "Numeric", "Punctuator", "String", "RegularExpression", "Template"];
- var l3;
- !function(e7) {
- e7.InvalidModuleUri = "InvalidModuleUri", e7.ForInOfLoopInitializer = "ForInOfLoopInitializer", e7.IdentiferExpected = "IdentiferExpected", e7.InvalidEscapedReservedWord = "InvalidEscapedReservedWord", e7.InvalidExpression = "InvalidExpression", e7.InvalidFunctionIdentifier = "InvalidFunctionIdentifier", e7.InvalidHexEscapeSequence = "InvalidHexEscapeSequence", e7.InvalidLeftHandSideInAssignment = "InvalidLeftHandSideInAssignment", e7.InvalidLeftHandSideInForIn = "InvalidLeftHandSideInForIn", e7.InvalidTemplateHead = "InvalidTemplateHead", e7.InvalidVariableAssignment = "InvalidVariableAssignment", e7.KeyMustBeString = "KeyMustBeString", e7.NoFunctionInsideBlock = "NoFunctionInsideBlock", e7.NoFunctionInsideFunction = "NoFunctionInsideFunction", e7.ModuleExportRootOnly = "ModuleExportRootOnly", e7.ModuleImportRootOnly = "ModuleImportRootOnly", e7.PunctuatorExpected = "PunctuatorExpected", e7.TemplateOctalLiteral = "TemplateOctalLiteral", e7.UnexpectedEndOfScript = "UnexpectedEndOfScript", e7.UnexpectedIdentifier = "UnexpectedIdentifier", e7.UnexpectedNumber = "UnexpectedNumber", e7.UnexpectedString = "UnexpectedString", e7.UnexpectedTemplate = "UnexpectedTemplate", e7.UnexpectedToken = "UnexpectedToken";
- }(l3 || (l3 = {}));
- var p4 = { [l3.InvalidModuleUri]: "Module uri must be a string literal", [l3.ForInOfLoopInitializer]: "for-in loop variable declaration may not have an initializer", [l3.IdentiferExpected]: "Identifier expected", [l3.InvalidEscapedReservedWord]: "Keyword cannot contain escaped characters", [l3.InvalidExpression]: "Invalid expression", [l3.InvalidFunctionIdentifier]: "Invalid function identifier", [l3.InvalidHexEscapeSequence]: "Invalid hexadecimal escape sequence", [l3.InvalidLeftHandSideInAssignment]: "Invalid left-hand side in assignment", [l3.InvalidLeftHandSideInForIn]: "Invalid left-hand side in for-in", [l3.InvalidTemplateHead]: "Invalid template structure", [l3.InvalidVariableAssignment]: "Invalid variable assignment", [l3.KeyMustBeString]: "Object keys must be a string", [l3.NoFunctionInsideBlock]: "Functions cannot be declared inside of code blocks", [l3.NoFunctionInsideFunction]: "Functions cannot be declared inside another function", [l3.ModuleExportRootOnly]: "Module exports cannot be declared inside of code blocks", [l3.ModuleImportRootOnly]: "Module import cannot be declared inside of code blocks", [l3.PunctuatorExpected]: "'${value}' expected", [l3.TemplateOctalLiteral]: "Octal literals are not allowed in template strings.", [l3.UnexpectedEndOfScript]: "Unexpected end of script", [l3.UnexpectedIdentifier]: "Unexpected identifier", [l3.UnexpectedNumber]: "Unexpected number", [l3.UnexpectedString]: "Unexpected string", [l3.UnexpectedTemplate]: "Unexpected quasi '${value}'", [l3.UnexpectedToken]: "Unexpected token" };
- var d2 = class extends Error {
- constructor({ code: e7, index: t4, line: n3, column: i3, len: r4 = 0, description: a3, data: o5 }) {
- var _a;
- super(`${a3 != null ? a3 : e7}`), this.declaredRootClass = "esri.arcade.lib.parsingerror", this.name = "ParsingError", this.code = e7, this.index = t4, this.line = n3, this.column = i3, this.len = r4, this.data = o5, this.description = a3, this.range = { start: { line: n3, column: i3 - 1 }, end: { line: n3, column: i3 + r4 } }, (_a = Error.captureStackTrace) == null ? void 0 : _a.call(Error, this, d2);
- }
- };
- function u4(t4) {
- return (t4 == null ? void 0 : t4.type) === e4.Program;
- }
- function x2(t4) {
- return (t4 == null ? void 0 : t4.type) === e4.BlockStatement;
- }
- function I(t4) {
- return (t4 == null ? void 0 : t4.type) === e4.BlockComment;
- }
- function y3(t4) {
- return (t4 == null ? void 0 : t4.type) === e4.EmptyStatement;
- }
- function w4(t4) {
- return (t4 == null ? void 0 : t4.type) === e4.VariableDeclarator;
- }
- // node_modules/@arcgis/core/arcade/lib/comment-handler.js
- function i2(t4, n3) {
- return !!n3 && (n3.loc.end.line === t4.loc.start.line && n3.loc.end.column <= t4.loc.start.column);
- }
- function m3(t4, n3) {
- return t4.range[0] >= n3.range[0] && t4.range[1] <= n3.range[1];
- }
- var o3 = class {
- constructor() {
- this.comments = [], this._nodeStack = [], this._newComments = [];
- }
- insertInnerComments(n3) {
- if (!x2(n3) || 0 !== n3.body.length)
- return;
- const e7 = [];
- for (let t4 = this._newComments.length - 1; t4 >= 0; --t4) {
- const s9 = this._newComments[t4];
- n3.range[1] >= s9.range[0] && (e7.unshift(s9), this._newComments.splice(t4, 1));
- }
- e7.length && (n3.innerComments = e7);
- }
- attachTrailingComments(n3) {
- var _a, _b;
- if (!n3)
- return;
- const e7 = this._nodeStack[this._nodeStack.length - 1];
- if (x2(n3) && m3(e7, n3))
- for (let t4 = this._newComments.length - 1; t4 >= 0; --t4) {
- const s10 = this._newComments[t4];
- m3(s10, n3) && (e7.trailingComments = [...(_a = e7.trailingComments) != null ? _a : [], s10], this._newComments.splice(t4, 1));
- }
- let s9 = [];
- if (this._newComments.length > 0)
- for (let t4 = this._newComments.length - 1; t4 >= 0; --t4) {
- const m5 = this._newComments[t4];
- i2(m5, e7) ? (e7.trailingComments = [...(_b = e7.trailingComments) != null ? _b : [], m5], this._newComments.splice(t4, 1)) : i2(m5, n3) && (s9.unshift(m5), this._newComments.splice(t4, 1));
- }
- if (e7 == null ? void 0 : e7.trailingComments) {
- i2(e7.trailingComments[0], n3) && (s9 = [...s9, ...e7.trailingComments], delete e7.trailingComments);
- }
- s9.length > 0 && (n3.trailingComments = s9);
- }
- attachLeadingComments(t4) {
- var _a, _b, _c, _d;
- if (!t4)
- return;
- let s9;
- for (; this._nodeStack.length > 0; ) {
- const n3 = this._nodeStack[this._nodeStack.length - 1];
- if (!(t4.range[0] <= n3.range[0]))
- break;
- s9 = n3, this._nodeStack.pop();
- }
- const i3 = [], m5 = [];
- if (s9) {
- for (let o5 = ((_b = (_a = s9.leadingComments) == null ? void 0 : _a.length) != null ? _b : 0) - 1; o5 >= 0; --o5) {
- const l6 = s9.leadingComments[o5];
- t4.range[0] >= l6.range[1] ? (i3.unshift(l6), s9.leadingComments.splice(o5, 1)) : w4(t4) && !I(l6) && (m5.unshift(l6), s9.leadingComments.splice(o5, 1));
- }
- return 0 === ((_c = s9.leadingComments) == null ? void 0 : _c.length) && delete s9.leadingComments, i3.length && (t4.leadingComments = i3), void (m5.length && (t4.trailingComments = [...m5, ...(_d = t4.trailingComments) != null ? _d : []]));
- }
- for (let n3 = this._newComments.length - 1; n3 >= 0; --n3) {
- const e7 = this._newComments[n3];
- t4.range[0] >= e7.range[0] && (i3.unshift(e7), this._newComments.splice(n3, 1));
- }
- i3.length && (t4.leadingComments = i3);
- }
- attachComments(t4) {
- var _a;
- if (u4(t4) && t4.body.length > 0) {
- const n3 = this._nodeStack[this._nodeStack.length - 1];
- return n3 ? (n3.trailingComments = [...(_a = n3.trailingComments) != null ? _a : [], ...this._newComments], this._newComments.length = 0, void this._nodeStack.pop()) : (t4.trailingComments = [...this._newComments], void (this._newComments.length = 0));
- }
- this.attachTrailingComments(t4), this.attachLeadingComments(t4), this.insertInnerComments(t4), this._nodeStack.push(t4);
- }
- collectComment(t4) {
- this.comments.push(t4), this._newComments.push(t4);
- }
- };
- // node_modules/@arcgis/core/arcade/lib/error-handler.js
- function o4(t4, o5) {
- const e7 = p4[t4];
- return o5 ? e7.replace(/\${(.*?)}/g, (r4, t5) => {
- var _a, _b;
- return (_b = (_a = o5[t5]) == null ? void 0 : _a.toString()) != null ? _b : "";
- }) : e7;
- }
- var e5 = class {
- constructor(r4 = false) {
- this.tolerant = r4, this.errors = [];
- }
- recordError(r4) {
- this.errors.push(r4);
- }
- tolerate(r4) {
- if (!this.tolerant)
- throw r4;
- this.recordError(r4);
- }
- throwError(r4) {
- var _a;
- throw r4.description = (_a = r4.description) != null ? _a : o4(r4.code, r4.data), new d2(r4);
- }
- tolerateError(r4) {
- var _a;
- r4.description = (_a = r4.description) != null ? _a : o4(r4.code, r4.data);
- const e7 = new d2(r4);
- if (!this.tolerant)
- throw e7;
- this.recordError(e7);
- }
- };
- // node_modules/@arcgis/core/arcade/lib/assert.js
- function r3(r4, o5) {
- if (!r4)
- throw new Error("ASSERT: " + o5);
- }
- // node_modules/@arcgis/core/arcade/lib/character.js
- var u5 = { NonAsciiIdentifierStart: /[\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]/, NonAsciiIdentifierPart: /[\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]/ };
- var D2 = { fromCodePoint: (u7) => u7 < 65536 ? String.fromCharCode(u7) : String.fromCharCode(55296 + (u7 - 65536 >> 10)) + String.fromCharCode(56320 + (u7 - 65536 & 1023)), isWhiteSpace: (u7) => 32 === u7 || 9 === u7 || 11 === u7 || 12 === u7 || 160 === u7 || u7 >= 5760 && [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].includes(u7), isLineTerminator: (u7) => 10 === u7 || 13 === u7 || 8232 === u7 || 8233 === u7, isIdentifierStart: (F4) => 36 === F4 || 95 === F4 || F4 >= 65 && F4 <= 90 || F4 >= 97 && F4 <= 122 || 92 === F4 || F4 >= 128 && u5.NonAsciiIdentifierStart.test(D2.fromCodePoint(F4)), isIdentifierPart: (F4) => 36 === F4 || 95 === F4 || F4 >= 65 && F4 <= 90 || F4 >= 97 && F4 <= 122 || F4 >= 48 && F4 <= 57 || 92 === F4 || F4 >= 128 && u5.NonAsciiIdentifierPart.test(D2.fromCodePoint(F4)), isDecimalDigit: (u7) => u7 >= 48 && u7 <= 57, isHexDigit: (u7) => u7 >= 48 && u7 <= 57 || u7 >= 65 && u7 <= 70 || u7 >= 97 && u7 <= 102, isOctalDigit: (u7) => u7 >= 48 && u7 <= 55 };
- // node_modules/@arcgis/core/arcade/lib/scanner.js
- function a2(e7) {
- return "0123456789abcdef".indexOf(e7.toLowerCase());
- }
- function d3(e7) {
- return "01234567".indexOf(e7);
- }
- var l4 = [[], [], []];
- t2.forEach((e7) => l4[e7.length - 1].push(e7)), n2.forEach((e7) => l4[e7.length - 1].push(e7)), r2.forEach((e7) => l4[e7.length - 1].push(e7)), i.forEach((e7) => l4[e7.length - 1].push(e7)), a.forEach((e7) => l4[e7.length - 1].push(e7));
- var u6 = class {
- constructor(e7, t4) {
- this.source = e7, this.errorHandler = t4, this._length = e7.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(e7) {
- this.index = e7.index, this.lineNumber = e7.lineNumber, this.lineStart = e7.lineStart, this.curlyStack = e7.curlyStack;
- }
- eof() {
- return this.index >= this._length;
- }
- throwUnexpectedToken(e7 = l3.UnexpectedToken) {
- this.errorHandler.throwError({ code: e7, index: this.index, line: this.lineNumber, column: this.index - this.lineStart + 1 });
- }
- tolerateUnexpectedToken(e7 = l3.UnexpectedToken) {
- this.errorHandler.tolerateError({ code: e7, index: this.index, line: this.lineNumber, column: this.index - this.lineStart + 1 });
- }
- skipSingleLineComment(e7) {
- const i3 = [], s9 = this.index - e7, n3 = { start: { line: this.lineNumber, column: this.index - this.lineStart - e7 }, end: { line: 0, column: 0 } };
- for (; !this.eof(); ) {
- const r4 = this.source.charCodeAt(this.index);
- if (++this.index, D2.isLineTerminator(r4)) {
- if (n3) {
- n3.end = { line: this.lineNumber, column: this.index - this.lineStart - 1 };
- const t4 = { multiLine: false, start: s9 + e7, end: this.index - 1, range: [s9, this.index - 1], loc: n3 };
- i3.push(t4);
- }
- return 13 === r4 && 10 === this.source.charCodeAt(this.index) && ++this.index, ++this.lineNumber, this.lineStart = this.index, i3;
- }
- }
- if (n3) {
- n3.end = { line: this.lineNumber, column: this.index - this.lineStart };
- const t4 = { multiLine: false, start: s9 + e7, end: this.index, range: [s9, this.index], loc: n3 };
- i3.push(t4);
- }
- return i3;
- }
- skipMultiLineComment() {
- const e7 = [], i3 = this.index - 2, s9 = { start: { line: this.lineNumber, column: this.index - this.lineStart - 2 }, end: { line: 0, column: 0 } };
- for (; !this.eof(); ) {
- const n3 = this.source.charCodeAt(this.index);
- if (D2.isLineTerminator(n3))
- 13 === n3 && 10 === this.source.charCodeAt(this.index + 1) && ++this.index, ++this.lineNumber, ++this.index, this.lineStart = this.index;
- else if (42 === n3) {
- if (47 === this.source.charCodeAt(this.index + 1)) {
- if (this.index += 2, s9) {
- s9.end = { line: this.lineNumber, column: this.index - this.lineStart };
- const t4 = { multiLine: true, start: i3 + 2, end: this.index - 2, range: [i3, this.index], loc: s9 };
- e7.push(t4);
- }
- return e7;
- }
- ++this.index;
- } else
- ++this.index;
- }
- if (s9) {
- s9.end = { line: this.lineNumber, column: this.index - this.lineStart };
- const t4 = { multiLine: true, start: i3 + 2, end: this.index, range: [i3, this.index], loc: s9 };
- e7.push(t4);
- }
- return this.tolerateUnexpectedToken(), e7;
- }
- scanComments() {
- let e7 = [];
- for (; !this.eof(); ) {
- let i3 = this.source.charCodeAt(this.index);
- if (D2.isWhiteSpace(i3))
- ++this.index;
- else if (D2.isLineTerminator(i3))
- ++this.index, 13 === i3 && 10 === this.source.charCodeAt(this.index) && ++this.index, ++this.lineNumber, this.lineStart = this.index;
- else {
- if (47 !== i3)
- break;
- if (i3 = this.source.charCodeAt(this.index + 1), 47 === i3) {
- this.index += 2;
- const t4 = this.skipSingleLineComment(2);
- e7 = [...e7, ...t4];
- } else {
- if (42 !== i3)
- break;
- {
- this.index += 2;
- const t4 = this.skipMultiLineComment();
- e7 = [...e7, ...t4];
- }
- }
- }
- }
- return e7;
- }
- isKeyword(e7) {
- switch ((e7 = e7.toLowerCase()).length) {
- case 2:
- return "if" === e7 || "in" === e7;
- case 3:
- return "var" === e7 || "for" === e7;
- case 4:
- return "else" === e7;
- case 5:
- return "break" === e7 || "while" === e7;
- case 6:
- return "return" === e7 || "import" === e7 || "export" === e7;
- case 8:
- return "function" === e7 || "continue" === e7;
- default:
- return false;
- }
- }
- codePointAt(e7) {
- let t4 = this.source.charCodeAt(e7);
- if (t4 >= 55296 && t4 <= 56319) {
- const i3 = this.source.charCodeAt(e7 + 1);
- if (i3 >= 56320 && i3 <= 57343) {
- t4 = 1024 * (t4 - 55296) + i3 - 56320 + 65536;
- }
- }
- return t4;
- }
- scanHexEscape(e7) {
- const i3 = "u" === e7 ? 4 : 2;
- let s9 = 0;
- for (let n3 = 0; n3 < i3; ++n3) {
- if (this.eof() || !D2.isHexDigit(this.source.charCodeAt(this.index)))
- return null;
- s9 = 16 * s9 + a2(this.source[this.index++]);
- }
- return String.fromCharCode(s9);
- }
- scanUnicodeCodePointEscape() {
- let e7 = this.source[this.index], i3 = 0;
- for ("}" === e7 && this.throwUnexpectedToken(); !this.eof() && (e7 = this.source[this.index++], D2.isHexDigit(e7.charCodeAt(0))); )
- i3 = 16 * i3 + a2(e7);
- return (i3 > 1114111 || "}" !== e7) && this.throwUnexpectedToken(), D2.fromCodePoint(i3);
- }
- getIdentifier() {
- const e7 = this.index++;
- for (; !this.eof(); ) {
- const i3 = this.source.charCodeAt(this.index);
- if (92 === i3)
- return this.index = e7, this.getComplexIdentifier();
- if (i3 >= 55296 && i3 < 57343)
- return this.index = e7, this.getComplexIdentifier();
- if (!D2.isIdentifierPart(i3))
- break;
- ++this.index;
- }
- return this.source.slice(e7, this.index);
- }
- getComplexIdentifier() {
- let e7, i3 = this.codePointAt(this.index), s9 = D2.fromCodePoint(i3);
- for (this.index += s9.length, 92 === i3 && (117 !== this.source.charCodeAt(this.index) && this.throwUnexpectedToken(), ++this.index, "{" === this.source[this.index] ? (++this.index, e7 = this.scanUnicodeCodePointEscape()) : (e7 = this.scanHexEscape("u"), null !== e7 && "\\" !== e7 && D2.isIdentifierStart(e7.charCodeAt(0)) || this.throwUnexpectedToken()), s9 = e7); !this.eof() && (i3 = this.codePointAt(this.index), D2.isIdentifierPart(i3)); )
- e7 = D2.fromCodePoint(i3), s9 += e7, this.index += e7.length, 92 === i3 && (s9 = s9.substring(0, s9.length - 1), 117 !== this.source.charCodeAt(this.index) && this.throwUnexpectedToken(), ++this.index, "{" === this.source[this.index] ? (++this.index, e7 = this.scanUnicodeCodePointEscape()) : (e7 = this.scanHexEscape("u"), null !== e7 && "\\" !== e7 && D2.isIdentifierPart(e7.charCodeAt(0)) || this.throwUnexpectedToken()), s9 += e7);
- return s9;
- }
- octalToDecimal(e7) {
- let i3 = "0" !== e7, s9 = d3(e7);
- return !this.eof() && D2.isOctalDigit(this.source.charCodeAt(this.index)) && (i3 = true, s9 = 8 * s9 + d3(this.source[this.index++]), "0123".includes(e7) && !this.eof() && D2.isOctalDigit(this.source.charCodeAt(this.index)) && (s9 = 8 * s9 + d3(this.source[this.index++]))), { code: s9, octal: i3 };
- }
- scanIdentifier() {
- let e7;
- const t4 = this.index, i3 = 92 === this.source.charCodeAt(t4) ? this.getComplexIdentifier() : this.getIdentifier();
- if (e7 = 1 === i3.length ? c4.Identifier : this.isKeyword(i3) ? c4.Keyword : "null" === i3.toLowerCase() ? c4.NullLiteral : "true" === i3.toLowerCase() || "false" === i3.toLowerCase() ? c4.BooleanLiteral : c4.Identifier, e7 !== c4.Identifier && t4 + i3.length !== this.index) {
- const e8 = this.index;
- this.index = t4, this.tolerateUnexpectedToken(l3.InvalidEscapedReservedWord), this.index = e8;
- }
- return { type: e7, value: i3, lineNumber: this.lineNumber, lineStart: this.lineStart, start: t4, end: this.index };
- }
- scanPunctuator() {
- const e7 = this.index;
- let t4 = this.source[this.index];
- switch (t4) {
- case "(":
- case "{":
- "{" === t4 && this.curlyStack.push("{"), ++this.index;
- break;
- case ".":
- case ")":
- case ";":
- case ",":
- case "[":
- case "]":
- case ":":
- case "?":
- case "~":
- ++this.index;
- break;
- case "}":
- ++this.index, this.curlyStack.pop();
- break;
- default:
- for (let e8 = l4.length; e8 > 0; e8--)
- if (t4 = this.source.substring(this.index, this.index + e8), l4[e8 - 1].includes(t4)) {
- this.index += e8;
- break;
- }
- }
- return this.index === e7 && this.throwUnexpectedToken(), { type: c4.Punctuator, value: t4, lineNumber: this.lineNumber, lineStart: this.lineStart, start: e7, end: this.index };
- }
- scanHexLiteral(e7) {
- let i3 = "";
- for (; !this.eof() && D2.isHexDigit(this.source.charCodeAt(this.index)); )
- i3 += this.source[this.index++];
- return 0 === i3.length && this.throwUnexpectedToken(), D2.isIdentifierStart(this.source.charCodeAt(this.index)) && this.throwUnexpectedToken(), { type: c4.NumericLiteral, value: parseInt("0x" + i3, 16), lineNumber: this.lineNumber, lineStart: this.lineStart, start: e7, end: this.index };
- }
- scanBinaryLiteral(e7) {
- let i3 = "";
- for (; !this.eof(); ) {
- const e8 = this.source[this.index];
- if ("0" !== e8 && "1" !== e8)
- break;
- i3 += this.source[this.index++];
- }
- if (0 === i3.length && this.throwUnexpectedToken(), !this.eof()) {
- const e8 = this.source.charCodeAt(this.index);
- (D2.isIdentifierStart(e8) || D2.isDecimalDigit(e8)) && this.throwUnexpectedToken();
- }
- return { type: c4.NumericLiteral, value: parseInt(i3, 2), lineNumber: this.lineNumber, lineStart: this.lineStart, start: e7, end: this.index };
- }
- scanOctalLiteral(e7, i3) {
- let s9 = "", n3 = false;
- for (D2.isOctalDigit(e7.charCodeAt(0)) ? (n3 = true, s9 = "0" + this.source[this.index++]) : ++this.index; !this.eof() && D2.isOctalDigit(this.source.charCodeAt(this.index)); )
- s9 += this.source[this.index++];
- return n3 || 0 !== s9.length || this.throwUnexpectedToken(), (D2.isIdentifierStart(this.source.charCodeAt(this.index)) || D2.isDecimalDigit(this.source.charCodeAt(this.index))) && this.throwUnexpectedToken(), { type: c4.NumericLiteral, value: parseInt(s9, 8), lineNumber: this.lineNumber, lineStart: this.lineStart, start: i3, end: this.index };
- }
- scanNumericLiteral() {
- const i3 = this.index;
- let s9 = this.source[i3];
- r3(D2.isDecimalDigit(s9.charCodeAt(0)) || "." === s9, "Numeric literal must start with a decimal digit or a decimal point");
- let n3 = "";
- if ("." !== s9) {
- if (n3 = this.source[this.index++], s9 = this.source[this.index], "0" === n3) {
- if ("x" === s9 || "X" === s9)
- return ++this.index, this.scanHexLiteral(i3);
- if ("b" === s9 || "B" === s9)
- return ++this.index, this.scanBinaryLiteral(i3);
- if ("o" === s9 || "O" === s9)
- return this.scanOctalLiteral(s9, i3);
- }
- for (; D2.isDecimalDigit(this.source.charCodeAt(this.index)); )
- n3 += this.source[this.index++];
- s9 = this.source[this.index];
- }
- if ("." === s9) {
- for (n3 += this.source[this.index++]; D2.isDecimalDigit(this.source.charCodeAt(this.index)); )
- n3 += this.source[this.index++];
- s9 = this.source[this.index];
- }
- if ("e" === s9 || "E" === s9)
- if (n3 += this.source[this.index++], s9 = this.source[this.index], "+" !== s9 && "-" !== s9 || (n3 += this.source[this.index++]), D2.isDecimalDigit(this.source.charCodeAt(this.index)))
- for (; D2.isDecimalDigit(this.source.charCodeAt(this.index)); )
- n3 += this.source[this.index++];
- else
- this.throwUnexpectedToken();
- return D2.isIdentifierStart(this.source.charCodeAt(this.index)) && this.throwUnexpectedToken(), { type: c4.NumericLiteral, value: parseFloat(n3), lineNumber: this.lineNumber, lineStart: this.lineStart, start: i3, end: this.index };
- }
- scanStringLiteral() {
- const i3 = this.index;
- let s9 = this.source[i3];
- r3("'" === s9 || '"' === s9, "String literal must starts with a quote"), ++this.index;
- let n3 = false, r4 = "";
- for (; !this.eof(); ) {
- let e7 = this.source[this.index++];
- if (e7 === s9) {
- s9 = "";
- break;
- }
- if ("\\" === e7)
- if (e7 = this.source[this.index++], e7 && D2.isLineTerminator(e7.charCodeAt(0)))
- ++this.lineNumber, "\r" === e7 && "\n" === this.source[this.index] && ++this.index, this.lineStart = this.index;
- else
- switch (e7) {
- case "u":
- if ("{" === this.source[this.index])
- ++this.index, r4 += this.scanUnicodeCodePointEscape();
- else {
- const t4 = this.scanHexEscape(e7);
- null === t4 && this.throwUnexpectedToken(), r4 += t4;
- }
- break;
- case "x": {
- const t4 = this.scanHexEscape(e7);
- null === t4 && this.throwUnexpectedToken(l3.InvalidHexEscapeSequence), r4 += t4;
- break;
- }
- case "n":
- r4 += "\n";
- break;
- case "r":
- r4 += "\r";
- break;
- case "t":
- r4 += " ";
- break;
- case "b":
- r4 += "\b";
- break;
- case "f":
- r4 += "\f";
- break;
- case "v":
- r4 += "\v";
- break;
- case "8":
- case "9":
- r4 += e7, this.tolerateUnexpectedToken();
- break;
- default:
- if (e7 && D2.isOctalDigit(e7.charCodeAt(0))) {
- const t4 = this.octalToDecimal(e7);
- n3 = t4.octal || n3, r4 += String.fromCharCode(t4.code);
- } else
- r4 += e7;
- }
- else {
- if (D2.isLineTerminator(e7.charCodeAt(0)))
- break;
- r4 += e7;
- }
- }
- return "" !== s9 && (this.index = i3, this.throwUnexpectedToken()), { type: c4.StringLiteral, value: r4, lineNumber: this.lineNumber, lineStart: this.lineStart, start: i3, end: this.index };
- }
- scanTemplate() {
- let e7 = "", i3 = false;
- const s9 = this.index, n3 = "`" === this.source[s9];
- let r4 = false, h3 = 2;
- for (++this.index; !this.eof(); ) {
- let s10 = this.source[this.index++];
- if ("`" === s10) {
- h3 = 1, r4 = true, i3 = true;
- break;
- }
- if ("$" !== s10)
- if ("\\" !== s10)
- D2.isLineTerminator(s10.charCodeAt(0)) ? (++this.lineNumber, "\r" === s10 && "\n" === this.source[this.index] && ++this.index, this.lineStart = this.index, e7 += "\n") : e7 += s10;
- else if (s10 = this.source[this.index++], D2.isLineTerminator(s10.charCodeAt(0)))
- ++this.lineNumber, "\r" === s10 && "\n" === this.source[this.index] && ++this.index, this.lineStart = this.index;
- else
- switch (s10) {
- case "n":
- e7 += "\n";
- break;
- case "r":
- e7 += "\r";
- break;
- case "t":
- e7 += " ";
- break;
- case "u":
- if ("{" === this.source[this.index])
- ++this.index, e7 += this.scanUnicodeCodePointEscape();
- else {
- const t4 = this.index, i4 = this.scanHexEscape(s10);
- null !== i4 ? e7 += i4 : (this.index = t4, e7 += s10);
- }
- break;
- case "x": {
- const t4 = this.scanHexEscape(s10);
- null === t4 && this.throwUnexpectedToken(l3.InvalidHexEscapeSequence), e7 += t4;
- break;
- }
- case "b":
- e7 += "\b";
- break;
- case "f":
- e7 += "\f";
- break;
- case "v":
- e7 += "\v";
- break;
- default:
- "0" === s10 ? (D2.isDecimalDigit(this.source.charCodeAt(this.index)) && this.throwUnexpectedToken(l3.TemplateOctalLiteral), e7 += "\0") : D2.isOctalDigit(s10.charCodeAt(0)) ? this.throwUnexpectedToken(l3.TemplateOctalLiteral) : e7 += s10;
- }
- else {
- if ("{" === this.source[this.index]) {
- this.curlyStack.push("${"), ++this.index, i3 = true;
- break;
- }
- e7 += s10;
- }
- }
- return i3 || this.throwUnexpectedToken(), n3 || this.curlyStack.pop(), { type: c4.Template, value: this.source.slice(s9 + 1, this.index - h3), cooked: e7, head: n3, tail: r4, lineNumber: this.lineNumber, lineStart: this.lineStart, start: s9, end: this.index };
- }
- lex() {
- if (this.eof())
- return { type: c4.EOF, value: "", lineNumber: this.lineNumber, lineStart: this.lineStart, start: this.index, end: this.index };
- const e7 = this.source.charCodeAt(this.index);
- return D2.isIdentifierStart(e7) ? this.scanIdentifier() : 40 === e7 || 41 === e7 || 59 === e7 ? this.scanPunctuator() : 39 === e7 || 34 === e7 ? this.scanStringLiteral() : 46 === e7 ? D2.isDecimalDigit(this.source.charCodeAt(this.index + 1)) ? this.scanNumericLiteral() : this.scanPunctuator() : D2.isDecimalDigit(e7) ? this.scanNumericLiteral() : 96 === e7 || 125 === e7 && "${" === this.curlyStack[this.curlyStack.length - 1] ? this.scanTemplate() : e7 >= 55296 && e7 < 57343 && D2.isIdentifierStart(this.codePointAt(this.index)) ? this.scanIdentifier() : this.scanPunctuator();
- }
- };
- // node_modules/@arcgis/core/arcade/lib/parser.js
- var x3;
- var k3;
- function w5(t4, e7 = 0) {
- let r4 = t4.start - t4.lineStart, i3 = t4.lineNumber;
- return r4 < 0 && (r4 += e7, i3--), { index: t4.start, line: i3, column: r4 };
- }
- function g2(t4) {
- return [{ index: t4.range[0], ...t4.loc.start }, { index: t4.range[1], ...t4.loc.end }];
- }
- function y4(t4) {
- var _a;
- return (_a = o2[t4]) != null ? _a : 0;
- }
- !function(t4) {
- t4[t4.None = 0] = "None", t4[t4.Function = 1] = "Function", t4[t4.IfClause = 2] = "IfClause", t4[t4.ForLoop = 4] = "ForLoop", t4[t4.WhileLoop = 8] = "WhileLoop";
- }(x3 || (x3 = {})), function(t4) {
- t4[t4.AsObject = 0] = "AsObject", t4[t4.Automatic = 1] = "Automatic";
- }(k3 || (k3 = {}));
- var T2 = class {
- constructor(r4, n3 = {}, a3) {
- this.delegate = a3, this.hasLineTerminator = false, this.options = { tokens: "boolean" == typeof n3.tokens && n3.tokens, comments: "boolean" == typeof n3.comments && n3.comments, tolerant: "boolean" == typeof n3.tolerant && n3.tolerant }, this.options.comments && (this.commentHandler = new o3()), this.errorHandler = new e5(this.options.tolerant), this.scanner = new u6(r4, this.errorHandler), this.context = { isAssignmentTarget: false, blockContext: x3.None, curlyParsingType: k3.AsObject }, this.rawToken = { type: c4.EOF, 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(t4, e7, { validTypes: r4, invalidTypes: i3 }) {
- (r4 == null ? void 0 : r4.some((e8) => t4.type === e8)) || (i3 == null ? void 0 : i3.some((e8) => t4.type === e8)) && this.throwError(l3.InvalidExpression, e7);
- }
- throwError(t4, e7, r4 = this.endMarker) {
- const { index: i3, line: n3, column: s9 } = e7, a3 = r4.index - i3 - 1;
- this.errorHandler.throwError({ code: t4, index: i3, line: n3, column: s9 + 1, len: a3 });
- }
- tolerateError(t4, e7) {
- throw new Error("######################################### !!!");
- }
- unexpectedTokenError(t4 = {}) {
- const { rawToken: e7 } = t4;
- let i3, { code: n3, data: h3 } = t4;
- if (e7) {
- if (!n3)
- switch (e7.type) {
- case c4.EOF:
- n3 = l3.UnexpectedEndOfScript;
- break;
- case c4.Identifier:
- n3 = l3.UnexpectedIdentifier;
- break;
- case c4.NumericLiteral:
- n3 = l3.UnexpectedNumber;
- break;
- case c4.StringLiteral:
- n3 = l3.UnexpectedString;
- break;
- case c4.Template:
- n3 = l3.UnexpectedTemplate;
- }
- i3 = e7.value.toString();
- } else
- i3 = "ILLEGAL";
- n3 = n3 != null ? n3 : l3.UnexpectedToken, h3 || (h3 = { value: i3 });
- const c5 = o4(n3, h3);
- if (e7) {
- const t5 = e7.start, r4 = e7.lineNumber, i4 = e7.start - e7.lineStart + 1;
- return new d2({ code: n3, index: t5, line: r4, column: i4, len: e7.end - e7.start - 1, data: h3, description: c5 });
- }
- const { index: p5, line: l6 } = this.endMarker;
- return new d2({ code: n3, index: p5, line: l6, column: this.endMarker.column + 1, data: h3, description: c5 });
- }
- throwUnexpectedToken(t4 = {}) {
- var _a;
- throw t4.rawToken = (_a = t4.rawToken) != null ? _a : this.rawToken, this.unexpectedTokenError(t4);
- }
- collectComments(t4) {
- const { commentHandler: e7 } = this;
- e7 && (t4 == null ? void 0 : t4.length) && t4.forEach((t5) => {
- const r4 = { type: t5.multiLine ? e4.BlockComment : e4.LineComment, value: this.getSourceValue(t5), range: t5.range, loc: t5.loc };
- e7.collectComment(r4);
- });
- }
- peekAhead(t4) {
- const e7 = () => (this.scanner.scanComments(), this.scanner.lex()), r4 = this.scanner.saveState(), i3 = t4.call(this, e7);
- return this.scanner.restoreState(r4), i3;
- }
- getSourceValue(t4) {
- return this.scanner.source.slice(t4.start, t4.end);
- }
- convertToToken(t4) {
- return { type: s5[t4.type], value: this.getSourceValue(t4), range: [t4.start, t4.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;
- const t4 = 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 = t4.lineNumber !== this.rawToken.lineNumber, this.options.tokens && this.rawToken.type !== c4.EOF && this.tokens.push(this.convertToToken(this.rawToken));
- }
- captureStartMarker() {
- return { index: this.startMarker.index, line: this.startMarker.line, column: this.startMarker.column };
- }
- getItemLocation(t4) {
- return { range: [t4.index, this.endMarker.index], loc: { start: { line: t4.line, column: t4.column }, end: { line: this.endMarker.line, column: this.endMarker.column } } };
- }
- finalize(t4) {
- var _a, _b;
- return (this.delegate || this.commentHandler) && ((_a = this.commentHandler) == null ? void 0 : _a.attachComments(t4), (_b = this.delegate) == null ? void 0 : _b.call(this, t4)), t4;
- }
- expectPunctuator(t4) {
- const e7 = this.rawToken;
- this.matchPunctuator(t4) ? this.readNextRawToken() : this.throwUnexpectedToken({ rawToken: e7, code: l3.PunctuatorExpected, data: { value: t4 } });
- }
- expectKeyword(t4) {
- this.rawToken.type !== c4.Keyword || this.rawToken.value.toLowerCase() !== t4 ? this.throwUnexpectedToken({ rawToken: this.rawToken }) : this.readNextRawToken();
- }
- expectContextualKeyword(t4) {
- this.rawToken.type !== c4.Identifier || this.rawToken.value.toLowerCase() !== t4 ? this.throwUnexpectedToken({ rawToken: this.rawToken }) : this.readNextRawToken();
- }
- matchKeyword(t4) {
- return this.rawToken.type === c4.Keyword && this.rawToken.value.toLowerCase() === t4;
- }
- matchContextualKeyword(t4) {
- return this.rawToken.type === c4.Identifier && this.rawToken.value === t4;
- }
- matchPunctuator(t4) {
- return this.rawToken.type === c4.Punctuator && this.rawToken.value === t4;
- }
- getMatchingPunctuator(t4) {
- if ("string" == typeof t4 && (t4 = t4.split("")), this.rawToken.type === c4.Punctuator && (t4 == null ? void 0 : t4.length))
- return t4.find(this.matchPunctuator, this);
- }
- isolateCoverGrammar(t4) {
- const e7 = this.context.isAssignmentTarget;
- this.context.isAssignmentTarget = true;
- const r4 = t4.call(this);
- return this.context.isAssignmentTarget = e7, r4;
- }
- inheritCoverGrammar(t4) {
- const e7 = this.context.isAssignmentTarget;
- this.context.isAssignmentTarget = true;
- const r4 = t4.call(this);
- return this.context.isAssignmentTarget = this.context.isAssignmentTarget && e7, r4;
- }
- withBlockContext(t4, e7) {
- const r4 = this.context.blockContext;
- this.context.blockContext = this.context.blockContext | t4;
- const i3 = this.context.curlyParsingType;
- this.context.curlyParsingType = k3.Automatic;
- const n3 = e7.call(this);
- return this.context.blockContext = r4, this.context.curlyParsingType = i3, n3;
- }
- consumeSemicolon() {
- if (this.matchPunctuator(";"))
- this.readNextRawToken();
- else if (!this.hasLineTerminator)
- return this.rawToken.type === c4.EOF || this.matchPunctuator("}") ? (this.endMarker.index = this.startMarker.index, this.endMarker.line = this.startMarker.line, void (this.endMarker.column = this.startMarker.column)) : void this.throwUnexpectedToken({ rawToken: this.rawToken });
- }
- parsePrimaryExpression() {
- const t4 = this.captureStartMarker(), e7 = this.rawToken;
- switch (e7.type) {
- case c4.Identifier:
- return this.readNextRawToken(), this.finalize({ type: e4.Identifier, name: e7.value, ...this.getItemLocation(t4) });
- case c4.NumericLiteral:
- case c4.StringLiteral:
- return this.context.isAssignmentTarget = false, this.readNextRawToken(), this.finalize({ type: e4.Literal, value: e7.value, raw: this.getSourceValue(e7), isString: "string" == typeof e7.value, ...this.getItemLocation(t4) });
- case c4.BooleanLiteral:
- return this.context.isAssignmentTarget = false, this.readNextRawToken(), this.finalize({ type: e4.Literal, value: "true" === e7.value.toLowerCase(), raw: this.getSourceValue(e7), isString: false, ...this.getItemLocation(t4) });
- case c4.NullLiteral:
- return this.context.isAssignmentTarget = false, this.readNextRawToken(), this.finalize({ type: e4.Literal, value: null, raw: this.getSourceValue(e7), isString: false, ...this.getItemLocation(t4) });
- case c4.Template:
- return this.parseTemplateLiteral();
- case c4.Punctuator:
- switch (e7.value) {
- case "(":
- return this.inheritCoverGrammar(this.parseGroupExpression);
- case "[":
- return this.inheritCoverGrammar(this.parseArrayInitializer);
- case "{":
- return this.inheritCoverGrammar(this.parseObjectExpression);
- default:
- return this.throwUnexpectedToken({ rawToken: this.rawToken });
- }
- case c4.Keyword:
- return this.context.isAssignmentTarget = false, this.throwUnexpectedToken({ rawToken: this.rawToken });
- default:
- return this.throwUnexpectedToken({ rawToken: this.rawToken });
- }
- }
- parseArrayInitializer() {
- const t4 = this.captureStartMarker();
- this.expectPunctuator("[");
- const e7 = [];
- for (; !this.matchPunctuator("]"); )
- this.matchPunctuator(",") ? (this.readNextRawToken(), e7.push(null)) : (e7.push(this.inheritCoverGrammar(this.parseAssignmentExpression)), this.matchPunctuator("]") || this.expectPunctuator(","));
- return this.expectPunctuator("]"), this.finalize({ type: e4.ArrayExpression, elements: e7, ...this.getItemLocation(t4) });
- }
- parseObjectPropertyKey() {
- const t4 = this.captureStartMarker(), e7 = this.rawToken;
- switch (e7.type) {
- case c4.StringLiteral:
- return this.readNextRawToken(), this.finalize({ type: e4.Literal, value: e7.value, raw: this.getSourceValue(e7), isString: true, ...this.getItemLocation(t4) });
- case c4.Identifier:
- case c4.BooleanLiteral:
- case c4.NullLiteral:
- case c4.Keyword:
- return this.readNextRawToken(), this.finalize({ type: e4.Identifier, name: e7.value, ...this.getItemLocation(t4) });
- default:
- this.throwError(l3.KeyMustBeString, t4);
- }
- }
- parseObjectProperty() {
- const t4 = this.rawToken, e7 = this.captureStartMarker(), r4 = this.parseObjectPropertyKey();
- let i3 = false, n3 = null;
- return this.matchPunctuator(":") ? (this.readNextRawToken(), n3 = this.inheritCoverGrammar(this.parseAssignmentExpression)) : t4.type === c4.Identifier ? (i3 = true, n3 = this.finalize({ type: e4.Identifier, name: t4.value, ...this.getItemLocation(e7) })) : this.throwUnexpectedToken({ rawToken: this.rawToken }), this.finalize({ type: e4.Property, kind: "init", key: r4, value: n3, shorthand: i3, ...this.getItemLocation(e7) });
- }
- parseObjectExpression() {
- const t4 = this.captureStartMarker();
- this.expectPunctuator("{");
- const e7 = [];
- for (; !this.matchPunctuator("}"); )
- e7.push(this.parseObjectProperty()), this.matchPunctuator("}") || this.expectPunctuator(",");
- return this.expectPunctuator("}"), this.finalize({ type: e4.ObjectExpression, properties: e7, ...this.getItemLocation(t4) });
- }
- parseTemplateElement(t4 = false) {
- const e7 = this.rawToken;
- e7.type !== c4.Template && this.throwUnexpectedToken({ rawToken: e7 }), t4 && !e7.head && this.throwUnexpectedToken({ code: l3.InvalidTemplateHead, rawToken: e7 });
- const r4 = this.captureStartMarker();
- this.readNextRawToken();
- const { value: i3, cooked: n3, tail: o5 } = e7, c5 = this.finalize({ type: e4.TemplateElement, value: { raw: i3, cooked: n3 }, tail: o5, ...this.getItemLocation(r4) });
- return c5.loc.start.column++, c5.loc.end.column = c5.loc.end.column - (o5 ? 1 : 2), c5;
- }
- parseTemplateLiteral() {
- const t4 = this.captureStartMarker(), e7 = [], r4 = [];
- let i3 = this.parseTemplateElement(true);
- for (r4.push(i3); !i3.tail; )
- e7.push(this.parseExpression()), i3 = this.parseTemplateElement(), r4.push(i3);
- return this.finalize({ type: e4.TemplateLiteral, quasis: r4, expressions: e7, ...this.getItemLocation(t4) });
- }
- parseGroupExpression() {
- this.expectPunctuator("(");
- const t4 = this.inheritCoverGrammar(this.parseAssignmentExpression);
- return this.expectPunctuator(")"), t4;
- }
- parseArguments() {
- this.expectPunctuator("(");
- const t4 = [];
- if (!this.matchPunctuator(")"))
- for (; ; ) {
- const e7 = this.isolateCoverGrammar(this.parseAssignmentExpression);
- if (t4.push(e7), this.matchPunctuator(")"))
- break;
- if (this.expectPunctuator(","), this.matchPunctuator(")"))
- break;
- }
- return this.expectPunctuator(")"), t4;
- }
- parseMemberName() {
- const t4 = this.rawToken, e7 = this.captureStartMarker();
- return this.readNextRawToken(), t4.type !== c4.NullLiteral && t4.type !== c4.Identifier && t4.type !== c4.Keyword && t4.type !== c4.BooleanLiteral && this.throwUnexpectedToken({ rawToken: t4 }), this.finalize({ type: e4.Identifier, name: t4.value, ...this.getItemLocation(e7) });
- }
- parseLeftHandSideExpression() {
- const t4 = this.captureStartMarker();
- let e7 = this.inheritCoverGrammar(this.parsePrimaryExpression);
- const r4 = this.captureStartMarker();
- let i3;
- for (; i3 = this.getMatchingPunctuator("([."); )
- switch (i3) {
- case "(": {
- this.context.isAssignmentTarget = false, e7.type !== e4.Identifier && e7.type !== e4.MemberExpression && this.throwError(l3.IdentiferExpected, t4, r4);
- const i4 = this.parseArguments();
- e7 = this.finalize({ type: e4.CallExpression, callee: e7, arguments: i4, ...this.getItemLocation(t4) });
- continue;
- }
- case "[": {
- this.context.isAssignmentTarget = true, this.expectPunctuator("[");
- const r5 = this.isolateCoverGrammar(this.parseExpression);
- this.expectPunctuator("]"), e7 = this.finalize({ type: e4.MemberExpression, computed: true, object: e7, property: r5, ...this.getItemLocation(t4) });
- continue;
- }
- case ".": {
- this.context.isAssignmentTarget = true, this.expectPunctuator(".");
- const r5 = this.parseMemberName();
- e7 = this.finalize({ type: e4.MemberExpression, computed: false, object: e7, property: r5, ...this.getItemLocation(t4) });
- continue;
- }
- }
- return e7;
- }
- parseUpdateExpression() {
- const t4 = this.captureStartMarker();
- let e7 = this.getMatchingPunctuator(t2);
- if (e7) {
- this.readNextRawToken();
- const r5 = this.captureStartMarker(), i4 = this.inheritCoverGrammar(this.parseUnaryExpression);
- return i4.type !== e4.Identifier && i4.type !== e4.MemberExpression && i4.type !== e4.CallExpression && this.throwError(l3.InvalidExpression, r5), this.context.isAssignmentTarget || this.tolerateError(l3.InvalidLeftHandSideInAssignment, t4), this.context.isAssignmentTarget = false, this.finalize({ type: e4.UpdateExpression, operator: e7, argument: i4, prefix: true, ...this.getItemLocation(t4) });
- }
- const r4 = this.captureStartMarker(), i3 = this.inheritCoverGrammar(this.parseLeftHandSideExpression), n3 = this.captureStartMarker();
- return this.hasLineTerminator ? i3 : (e7 = this.getMatchingPunctuator(t2), e7 ? (i3.type !== e4.Identifier && i3.type !== e4.MemberExpression && this.throwError(l3.InvalidExpression, r4, n3), this.context.isAssignmentTarget || this.tolerateError(l3.InvalidLeftHandSideInAssignment, t4), this.readNextRawToken(), this.context.isAssignmentTarget = false, this.finalize({ type: e4.UpdateExpression, operator: e7, argument: i3, prefix: false, ...this.getItemLocation(t4) })) : i3);
- }
- parseUnaryExpression() {
- const t4 = this.getMatchingPunctuator(n2);
- if (t4) {
- const e7 = this.captureStartMarker();
- this.readNextRawToken();
- const r4 = this.inheritCoverGrammar(this.parseUnaryExpression);
- return this.context.isAssignmentTarget = false, this.finalize({ type: e4.UnaryExpression, operator: t4, argument: r4, prefix: true, ...this.getItemLocation(e7) });
- }
- return this.parseUpdateExpression();
- }
- parseBinaryExpression() {
- const t4 = this.rawToken;
- let e7 = this.inheritCoverGrammar(this.parseUnaryExpression);
- if (this.rawToken.type !== c4.Punctuator)
- return e7;
- const r4 = this.rawToken.value;
- let i3 = y4(r4);
- if (0 === i3)
- return e7;
- this.readNextRawToken(), this.context.isAssignmentTarget = false;
- const n3 = [t4, this.rawToken];
- let a3 = e7, o5 = this.inheritCoverGrammar(this.parseUnaryExpression);
- const h3 = [a3, r4, o5], c5 = [i3];
- for (; this.rawToken.type === c4.Punctuator && (i3 = y4(this.rawToken.value)) > 0; ) {
- for (; h3.length > 2 && i3 <= c5[c5.length - 1]; ) {
- o5 = h3.pop();
- const t5 = h3.pop();
- c5.pop(), a3 = h3.pop(), n3.pop();
- const e8 = n3[n3.length - 1], r5 = w5(e8, e8.lineStart);
- h3.push(this.finalize(this.createBinaryOrLogicalExpression(r5, t5, a3, o5)));
- }
- h3.push(this.rawToken.value), c5.push(i3), n3.push(this.rawToken), this.readNextRawToken(), h3.push(this.inheritCoverGrammar(this.parseUnaryExpression));
- }
- let p5 = h3.length - 1;
- e7 = h3[p5];
- let l6 = n3.pop();
- for (; p5 > 1; ) {
- const t5 = n3.pop();
- if (!t5)
- break;
- const r5 = l6 == null ? void 0 : l6.lineStart, i4 = w5(t5, r5), s9 = h3[p5 - 1];
- e7 = this.finalize(this.createBinaryOrLogicalExpression(i4, s9, h3[p5 - 2], e7)), p5 -= 2, l6 = t5;
- }
- return e7;
- }
- createBinaryOrLogicalExpression(t4, e7, r4, i3) {
- const n3 = r2.includes(e7) ? e4.LogicalExpression : e4.BinaryExpression;
- return n3 === e4.BinaryExpression || (r4.type !== e4.AssignmentExpression && r4.type !== e4.UpdateExpression || this.throwError(l3.InvalidExpression, ...g2(r4)), i3.type !== e4.AssignmentExpression && i3.type !== e4.UpdateExpression || this.throwError(l3.InvalidExpression, ...g2(r4))), { type: n3, operator: e7, left: r4, right: i3, ...this.getItemLocation(t4) };
- }
- parseAssignmentExpression() {
- const t4 = this.captureStartMarker(), e7 = this.inheritCoverGrammar(this.parseBinaryExpression), r4 = this.captureStartMarker(), i3 = this.getMatchingPunctuator(i);
- if (!i3)
- return e7;
- e7.type !== e4.Identifier && e7.type !== e4.MemberExpression && this.throwError(l3.InvalidExpression, t4, r4), this.context.isAssignmentTarget || this.tolerateError(l3.InvalidLeftHandSideInAssignment, t4), this.matchPunctuator("=") || (this.context.isAssignmentTarget = false), this.readNextRawToken();
- const n3 = this.isolateCoverGrammar(this.parseAssignmentExpression);
- return this.finalize({ type: e4.AssignmentExpression, left: e7, operator: i3, right: n3, ...this.getItemLocation(t4) });
- }
- parseExpression() {
- return this.isolateCoverGrammar(this.parseAssignmentExpression);
- }
- parseStatements(t4 = null) {
- const e7 = [];
- for (; this.rawToken.type !== c4.EOF && !this.matchPunctuator(t4); ) {
- const t5 = this.parseStatementListItem();
- y3(t5) || e7.push(t5);
- }
- return e7;
- }
- parseStatementListItem() {
- return this.context.isAssignmentTarget = true, this.matchKeyword("function") ? this.parseFunctionDeclaration() : this.matchKeyword("export") ? this.parseExportDeclaration() : this.matchKeyword("import") ? this.parseImportDeclaration() : this.parseStatement();
- }
- parseBlock() {
- const t4 = this.captureStartMarker();
- this.expectPunctuator("{");
- const e7 = this.parseStatements("}");
- return this.expectPunctuator("}"), this.finalize({ type: e4.BlockStatement, body: e7, ...this.getItemLocation(t4) });
- }
- parseObjectStatement() {
- const t4 = this.captureStartMarker(), e7 = this.parseObjectExpression();
- return this.finalize({ type: e4.ExpressionStatement, expression: e7, ...this.getItemLocation(t4) });
- }
- parseBlockOrObjectStatement() {
- if (this.context.curlyParsingType === k3.AsObject)
- return this.parseObjectStatement();
- return this.peekAhead((t4) => {
- let e7 = t4();
- return (e7.type === c4.Identifier || e7.type === c4.StringLiteral) && (e7 = t4(), e7.type === c4.Punctuator && ":" === e7.value);
- }) ? this.parseObjectStatement() : this.parseBlock();
- }
- parseIdentifier() {
- const t4 = this.rawToken;
- if (t4.type !== c4.Identifier)
- return null;
- const e7 = this.captureStartMarker();
- return this.readNextRawToken(), this.finalize({ type: e4.Identifier, name: t4.value, ...this.getItemLocation(e7) });
- }
- parseVariableDeclarator() {
- const t4 = this.captureStartMarker(), e7 = this.parseIdentifier();
- e7 || this.throwUnexpectedToken({ code: l3.IdentiferExpected });
- let r4 = null;
- if (this.matchPunctuator("=")) {
- this.readNextRawToken();
- const t5 = this.rawToken;
- try {
- r4 = this.isolateCoverGrammar(this.parseAssignmentExpression);
- } catch (i3) {
- this.throwUnexpectedToken({ rawToken: t5, code: l3.InvalidVariableAssignment });
- }
- }
- return this.finalize({ type: e4.VariableDeclarator, id: e7, init: r4, ...this.getItemLocation(t4) });
- }
- parseVariableDeclarationList() {
- const t4 = [this.parseVariableDeclarator()];
- for (; this.matchPunctuator(","); )
- this.readNextRawToken(), t4.push(this.parseVariableDeclarator());
- return t4;
- }
- parseVariableDeclaration() {
- const t4 = this.captureStartMarker();
- this.expectKeyword("var");
- const e7 = this.parseVariableDeclarationList();
- return this.consumeSemicolon(), this.finalize({ type: e4.VariableDeclaration, declarations: e7, kind: "var", ...this.getItemLocation(t4) });
- }
- parseEmptyStatement() {
- const t4 = this.captureStartMarker();
- return this.expectPunctuator(";"), this.finalize({ type: e4.EmptyStatement, ...this.getItemLocation(t4) });
- }
- parseExpressionStatement() {
- const t4 = this.captureStartMarker(), e7 = this.parseExpression();
- return this.consumeSemicolon(), this.finalize({ type: e4.ExpressionStatement, expression: e7, ...this.getItemLocation(t4) });
- }
- parseIfClause() {
- return this.withBlockContext(x3.IfClause, this.parseStatement);
- }
- parseIfStatement() {
- const t4 = this.captureStartMarker();
- this.expectKeyword("if"), this.expectPunctuator("(");
- const e7 = this.captureStartMarker(), r4 = this.parseExpression(), i3 = this.captureStartMarker();
- this.expectPunctuator(")"), r4.type !== e4.AssignmentExpression && r4.type !== e4.UpdateExpression || this.throwError(l3.InvalidExpression, e7, i3);
- const n3 = this.parseIfClause();
- let s9 = null;
- return this.matchKeyword("else") && (this.readNextRawToken(), s9 = this.parseIfClause()), this.finalize({ type: e4.IfStatement, test: r4, consequent: n3, alternate: s9, ...this.getItemLocation(t4) });
- }
- parseWhileStatement() {
- const t4 = this.captureStartMarker();
- this.expectKeyword("while"), this.expectPunctuator("(");
- const e7 = this.captureStartMarker(), r4 = this.parseExpression(), i3 = this.captureStartMarker();
- this.expectPunctuator(")"), r4.type !== e4.AssignmentExpression && r4.type !== e4.UpdateExpression || this.throwError(l3.InvalidExpression, e7, i3);
- const n3 = this.withBlockContext(x3.WhileLoop, this.parseStatement);
- return this.finalize({ type: e4.WhileStatement, test: r4, body: n3, ...this.getItemLocation(t4) });
- }
- parseForStatement() {
- let t4 = null, e7 = null, r4 = null, i3 = null, n3 = null;
- const s9 = this.captureStartMarker();
- if (this.expectKeyword("for"), this.expectPunctuator("("), this.matchPunctuator(";"))
- this.readNextRawToken();
- else if (this.matchKeyword("var")) {
- const e8 = this.captureStartMarker();
- this.readNextRawToken();
- const r5 = this.parseVariableDeclarationList();
- if (1 === r5.length && this.matchKeyword("in")) {
- r5[0].init && this.throwError(l3.ForInOfLoopInitializer, e8), i3 = this.finalize({ type: e4.VariableDeclaration, declarations: r5, kind: "var", ...this.getItemLocation(e8) }), this.readNextRawToken(), n3 = this.parseExpression();
- } else
- this.matchKeyword("in") && this.throwError(l3.InvalidLeftHandSideInForIn, e8), t4 = this.finalize({ type: e4.VariableDeclaration, declarations: r5, kind: "var", ...this.getItemLocation(e8) }), this.expectPunctuator(";");
- } else {
- const e8 = this.context.isAssignmentTarget, r5 = this.captureStartMarker();
- t4 = this.inheritCoverGrammar(this.parseAssignmentExpression), this.matchKeyword("in") ? (this.context.isAssignmentTarget || this.tolerateError(l3.InvalidLeftHandSideInForIn, r5), t4.type !== e4.Identifier && this.throwError(l3.InvalidLeftHandSideInForIn, r5), this.readNextRawToken(), i3 = t4, n3 = this.parseExpression(), t4 = null) : (this.context.isAssignmentTarget = e8, this.expectPunctuator(";"));
- }
- i3 || (this.matchPunctuator(";") || (e7 = this.isolateCoverGrammar(this.parseExpression)), this.expectPunctuator(";"), this.matchPunctuator(")") || (r4 = this.isolateCoverGrammar(this.parseExpression))), this.expectPunctuator(")");
- const o5 = this.withBlockContext(x3.ForLoop, () => this.isolateCoverGrammar(this.parseStatement));
- return i3 && n3 ? this.finalize({ type: e4.ForInStatement, left: i3, right: n3, body: o5, ...this.getItemLocation(s9) }) : this.finalize({ type: e4.ForStatement, init: t4, test: e7, update: r4, body: o5, ...this.getItemLocation(s9) });
- }
- parseContinueStatement() {
- const t4 = this.captureStartMarker();
- return this.expectKeyword("continue"), this.consumeSemicolon(), this.finalize({ type: e4.ContinueStatement, ...this.getItemLocation(t4) });
- }
- parseBreakStatement() {
- const t4 = this.captureStartMarker();
- return this.expectKeyword("break"), this.consumeSemicolon(), this.finalize({ type: e4.BreakStatement, ...this.getItemLocation(t4) });
- }
- parseReturnStatement() {
- const t4 = this.captureStartMarker();
- this.expectKeyword("return");
- const e7 = !this.matchPunctuator(";") && !this.matchPunctuator("}") && !this.hasLineTerminator && this.rawToken.type !== c4.EOF || this.rawToken.type === c4.StringLiteral || this.rawToken.type === c4.Template ? this.parseExpression() : null;
- return this.consumeSemicolon(), this.finalize({ type: e4.ReturnStatement, argument: e7, ...this.getItemLocation(t4) });
- }
- parseStatement() {
- switch (this.rawToken.type) {
- case c4.BooleanLiteral:
- case c4.NullLiteral:
- case c4.NumericLiteral:
- case c4.StringLiteral:
- case c4.Template:
- case c4.Identifier:
- return this.parseExpressionStatement();
- case c4.Punctuator:
- return "{" === this.rawToken.value ? this.parseBlockOrObjectStatement() : "(" === this.rawToken.value ? this.parseExpressionStatement() : ";" === this.rawToken.value ? this.parseEmptyStatement() : this.parseExpressionStatement();
- case c4.Keyword:
- switch (this.rawToken.value.toLowerCase()) {
- case "break":
- return this.parseBreakStatement();
- case "continue":
- return this.parseContinueStatement();
- case "for":
- return this.parseForStatement();
- case "function":
- return this.parseFunctionDeclaration();
- case "if":
- return this.parseIfStatement();
- case "return":
- return this.parseReturnStatement();
- case "var":
- return this.parseVariableDeclaration();
- case "while":
- return this.parseWhileStatement();
- default:
- return this.parseExpressionStatement();
- }
- default:
- return this.throwUnexpectedToken({ rawToken: this.rawToken });
- }
- }
- parseFormalParameters() {
- const t4 = [];
- if (this.expectPunctuator("("), !this.matchPunctuator(")"))
- for (; this.rawToken.type !== c4.EOF; ) {
- const e7 = this.parseIdentifier();
- if (e7 || this.throwUnexpectedToken({ rawToken: this.rawToken, code: l3.IdentiferExpected }), t4.push(e7), this.matchPunctuator(")"))
- break;
- if (this.expectPunctuator(","), this.matchPunctuator(")"))
- break;
- }
- return this.expectPunctuator(")"), t4;
- }
- parseFunctionDeclaration() {
- (this.context.blockContext & x3.Function) === x3.Function && this.throwUnexpectedToken({ code: l3.NoFunctionInsideFunction }), (this.context.blockContext & x3.WhileLoop) !== x3.WhileLoop && (this.context.blockContext & x3.IfClause) !== x3.IfClause || this.throwUnexpectedToken({ code: l3.NoFunctionInsideBlock });
- const t4 = this.captureStartMarker();
- this.expectKeyword("function");
- const e7 = this.parseIdentifier();
- e7 || this.throwUnexpectedToken({ code: l3.InvalidFunctionIdentifier });
- const r4 = this.parseFormalParameters(), i3 = this.context.blockContext;
- this.context.blockContext = this.context.blockContext | x3.Function;
- const n3 = this.parseBlock();
- return this.context.blockContext = i3, this.finalize({ type: e4.FunctionDeclaration, id: e7, params: r4, body: n3, ...this.getItemLocation(t4) });
- }
- parseScript() {
- const t4 = this.captureStartMarker(), e7 = this.parseStatements(), r4 = this.finalize({ type: e4.Program, body: e7, ...this.getItemLocation(t4) });
- return this.options.tokens && (r4.tokens = this.tokens), this.options.tolerant && (r4.errors = this.errorHandler.errors), r4;
- }
- parseExportDeclaration() {
- this.context.blockContext !== x3.None && this.throwUnexpectedToken({ code: l3.ModuleExportRootOnly });
- let t4 = null;
- const e7 = this.captureStartMarker();
- return this.expectKeyword("export"), this.matchKeyword("var") ? t4 = this.parseVariableDeclaration() : this.matchKeyword("function") ? t4 = this.parseFunctionDeclaration() : this.throwUnexpectedToken({ code: l3.InvalidExpression }), this.finalize({ type: e4.ExportNamedDeclaration, declaration: t4, specifiers: [], source: null, ...this.getItemLocation(e7) });
- }
- parseModuleSpecifier() {
- const t4 = this.captureStartMarker(), e7 = this.rawToken;
- if (e7.type === c4.StringLiteral)
- return this.readNextRawToken(), this.finalize({ type: e4.Literal, value: e7.value, raw: this.getSourceValue(e7), isString: true, ...this.getItemLocation(t4) });
- this.throwError(l3.InvalidModuleUri, t4);
- }
- parseDefaultSpecifier() {
- const t4 = this.captureStartMarker(), e7 = this.parseIdentifier();
- return e7 || this.throwUnexpectedToken({ code: l3.InvalidFunctionIdentifier }), this.finalize({ type: e4.ImportDefaultSpecifier, local: e7, ...this.getItemLocation(t4) });
- }
- parseImportDeclaration() {
- this.context.blockContext !== x3.None && this.throwUnexpectedToken({ code: l3.ModuleImportRootOnly });
- const t4 = this.captureStartMarker();
- this.expectKeyword("import");
- const e7 = this.parseDefaultSpecifier();
- this.expectContextualKeyword("from");
- const r4 = this.parseModuleSpecifier();
- return this.finalize({ type: e4.ImportDeclaration, specifiers: [e7], source: r4, ...this.getItemLocation(t4) });
- }
- };
- // node_modules/@arcgis/core/arcade/lib/arcade-parser.js
- function s7(r4, s9, t4) {
- return new T2(r4, s9, t4).parseScript();
- }
- // node_modules/@arcgis/core/arcade/parser.js
- function d4(d5, l6 = []) {
- const r4 = s7(d5);
- if (null === r4.body || void 0 === r4.body)
- throw new d2({ index: 0, line: 0, column: 0, data: null, description: "", code: l3.InvalidExpression });
- if (0 === r4.body.length)
- throw new d2({ index: 0, line: 0, column: 0, data: null, description: "", code: l3.InvalidExpression });
- if (0 === r4.body.length)
- throw new d2({ index: 0, line: 0, column: 0, data: null, description: "", code: l3.InvalidExpression });
- return r4.loadedModules = {}, d(r4, l6), r4;
- }
- // node_modules/@arcgis/core/arcade/featureset/support/RecentlyUsedCache.js
- var e6 = class {
- constructor(e7) {
- const s9 = this;
- s9._keys = [], s9._values = [], s9.length = 0, e7 && e7.forEach((e8) => {
- s9.set(e8[0], e8[1]);
- });
- }
- entries() {
- return [].slice.call(this.keys().map((e7, s9) => [e7, this._values[s9]]));
- }
- keys() {
- return [].slice.call(this._keys);
- }
- values() {
- return [].slice.call(this._values);
- }
- has(e7) {
- return this._keys.includes(e7);
- }
- get(e7) {
- const s9 = this._keys.indexOf(e7);
- return s9 > -1 ? this._values[s9] : null;
- }
- deepGet(s9) {
- if (!s9 || !s9.length)
- return null;
- const t4 = (s10, i3) => null == s10 ? null : i3.length ? t4(s10 instanceof e6 ? s10.get(i3[0]) : s10[i3[0]], i3.slice(1)) : s10;
- return t4(this.get(s9[0]), s9.slice(1));
- }
- set(e7, s9) {
- const t4 = this, i3 = this._keys.indexOf(e7);
- return i3 > -1 ? t4._values[i3] = s9 : (t4._keys.push(e7), t4._values.push(s9), t4.length = t4._values.length), this;
- }
- sortedSet(e7, s9, t4, i3) {
- const h3 = this, l6 = this._keys.length, r4 = t4 || 0, n3 = void 0 !== i3 ? i3 : l6 - 1;
- if (0 === l6)
- return h3._keys.push(e7), h3._values.push(s9), h3;
- if (e7 === this._keys[r4])
- return this._values.splice(r4, 0, s9), this;
- if (e7 === this._keys[n3])
- return this._values.splice(n3, 0, s9), this;
- if (e7 > this._keys[n3])
- return this._keys.splice(n3 + 1, 0, e7), this._values.splice(n3 + 1, 0, s9), this;
- if (e7 < this._keys[r4])
- return this._values.splice(r4, 0, s9), this._keys.splice(r4, 0, e7), this;
- if (r4 >= n3)
- return this;
- const u7 = r4 + Math.floor((n3 - r4) / 2);
- return e7 < this._keys[u7] ? this.sortedSet(e7, s9, r4, u7 - 1) : e7 > this._keys[u7] ? this.sortedSet(e7, s9, u7 + 1, n3) : this;
- }
- size() {
- return this.length;
- }
- clear() {
- const e7 = this;
- return e7._keys.length = e7.length = e7._values.length = 0, this;
- }
- delete(e7) {
- const s9 = this, t4 = s9._keys.indexOf(e7);
- return t4 > -1 && (s9._keys.splice(t4, 1), s9._values.splice(t4, 1), s9.length = s9._keys.length, true);
- }
- forEach(e7) {
- this._keys.forEach((s9, t4) => {
- e7(this._values[t4], s9, t4);
- });
- }
- map(e7) {
- return this.keys().map((s9, t4) => e7(this._values[t4], s9, t4));
- }
- filter(e7) {
- const s9 = this;
- return s9._keys.forEach((t4, i3) => {
- false === e7(s9._values[i3], t4, i3) && s9.delete(t4);
- }), this;
- }
- clone() {
- return new e6(this.entries());
- }
- };
- var s8 = class {
- constructor(s9 = 20) {
- this._maxEntries = s9, this._values = new e6();
- }
- delete(e7) {
- this._values.has(e7) && this._values.delete(e7);
- }
- get(e7) {
- let s9 = null;
- return this._values.has(e7) && (s9 = this._values.get(e7), this._values.delete(e7), this._values.set(e7, s9)), s9;
- }
- put(e7, s9) {
- if (this._values.size() >= this._maxEntries) {
- const e8 = this._values.keys()[0];
- this._values.delete(e8);
- }
- this._values.set(e7, s9);
- }
- };
- var t3 = class {
- constructor(e7 = 20) {
- this._maxEntries = e7, this._cache = new s8(this._maxEntries);
- }
- clear() {
- this._cache = new s8(this._maxEntries);
- }
- addToCache(e7, s9) {
- this._cache.put(e7, s9);
- }
- removeFromCache(e7) {
- this._cache.delete(e7);
- }
- getFromCache(e7) {
- return this._cache.get(e7);
- }
- };
- // node_modules/@arcgis/core/arcade/ArcadeModuleResolver.js
- var l5 = class {
- constructor(e7) {
- this.portalUri = e7;
- }
- normalizeModuleUri(e7) {
- const r4 = /^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([\?|\/].*)?$/gi, o5 = /(?<portalurl>.+)\/home\/item\.html\?id\=(?<itemid>.+)$/gi, c5 = /(?<portalurl>.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?<itemid>.+)$/gi, u7 = /(?<portalurl>.+)\/sharing\/rest\/content\/items\/(?<itemid>.+)$/gi, n3 = /(?<itemid>.*)@(?<versionstring>[0-9]+\.[0-9]+\.[0-9]+)([\?|\/].*)?$/gi;
- if (e7.startsWith("portal+")) {
- let l6 = e7.substring(7), a3 = "", m5 = l6, d5 = false;
- for (const e8 of [o5, u7, c5]) {
- const t4 = e8.exec(l6);
- if (null !== t4) {
- const e9 = t4.groups;
- m5 = e9.itemid, a3 = e9.portalurl, d5 = true;
- break;
- }
- }
- if (false === d5) {
- if (!r4.test(l6))
- throw new p2(l.UnsupportedUriProtocol, { uri: e7 });
- m5 = l6, a3 = this.portalUri;
- }
- m5.includes("/") && (m5 = m5.split("/")[0]), m5.includes("?") && (m5 = m5.split("?")[0]);
- let h3 = "current";
- const p5 = n3.exec(m5);
- if (null !== p5) {
- const e8 = p5.groups;
- m5 = e8.itemid, h3 = e8.versionstring;
- }
- return l6 = new j2({ url: a3 }).restUrl + "/content/items/" + m5 + "/resources/" + h3 + ".arc", { url: l6, scheme: "portal", uri: "PO:" + l6 };
- }
- if (e7.startsWith("mock")) {
- if ("mock" === e7) {
- return { url: "", scheme: "mock", data: '\n export var hello = 1;\n export function helloWorld() {\n return "Hello World " + hello;\n }\n ', uri: "mock" };
- }
- const t4 = e7.replace("mock:", "");
- if (void 0 !== l5.mocks[t4])
- return { url: "", scheme: "mock", data: l5.mocks[t4], uri: e7 };
- }
- throw new p2(l.UnrecognisedUri, { uri: e7 });
- }
- async fetchModule(e7) {
- const t4 = l5.cachedModules.getFromCache(e7.uri);
- if (t4)
- return t4;
- const r4 = this.fetchSource(e7);
- l5.cachedModules.addToCache(e7.uri, r4);
- let o5 = null;
- try {
- o5 = await r4;
- } catch (s9) {
- throw l5.cachedModules.removeFromCache(e7.uri), s9;
- }
- return o5;
- }
- async fetchSource(t4) {
- var _a;
- if ("portal" === t4.scheme) {
- const o5 = await U(t4.url, { responseType: "text", query: {} });
- if (o5.data)
- return d4(o5.data, []);
- }
- if ("mock" === t4.scheme)
- return d4((_a = t4.data) != null ? _a : "", []);
- throw new p2(l.UnsupportedUriProtocol);
- }
- static create(e7) {
- return new l5(e7);
- }
- static getDefault() {
- var _a;
- return (_a = this._default) != null ? _a : l5._default = l5._moduleResolverFactory();
- }
- static set moduleResolverClass(e7) {
- this._moduleResolverFactory = e7, this._default = null;
- }
- };
- l5.mocks = {}, l5.cachedModules = new t3(30), l5._default = null, l5._moduleResolverFactory = () => {
- const e7 = j2.getDefault();
- return new l5(e7.url);
- };
- // node_modules/@arcgis/core/arcade/arcadeRuntime.js
- var P3 = class extends r {
- constructor(e7, t4) {
- super(), this.definition = null, this.context = null, this.definition = e7, this.context = t4;
- }
- createFunction(e7) {
- return (...t4) => {
- const n3 = { spatialReference: this.context.spatialReference, console: this.context.console, lrucache: this.context.lrucache, exports: this.context.exports, libraryResolver: this.context.libraryResolver, interceptor: this.context.interceptor, localScope: {}, depthCounter: { depth: e7.depthCounter.depth + 1 }, globalScope: this.context.globalScope };
- if (n3.depthCounter.depth > 64)
- throw new t(e7, e.MaximumCallDepth, null);
- return Ie2(this.definition, n3, t4, null);
- };
- }
- call(e7, t4) {
- return V4(e7, t4, (n3, l6, a3) => {
- const i3 = { spatialReference: e7.spatialReference, globalScope: e7.globalScope, depthCounter: { depth: e7.depthCounter.depth + 1 }, libraryResolver: e7.libraryResolver, exports: e7.exports, console: e7.console, lrucache: e7.lrucache, interceptor: e7.interceptor, localScope: {} };
- if (i3.depthCounter.depth > 64)
- throw new t(e7, e.MaximumCallDepth, t4);
- return Ie2(this.definition, i3, a3, t4);
- });
- }
- marshalledCall(e7, t4, n3, r4) {
- return r4(e7, t4, (o5, l6, a3) => {
- const i3 = { spatialReference: e7.spatialReference, globalScope: n3.globalScope, depthCounter: { depth: e7.depthCounter.depth + 1 }, libraryResolver: e7.libraryResolver, exports: e7.exports, console: e7.console, lrucache: e7.lrucache, interceptor: e7.interceptor, localScope: {} };
- return a3 = a3.map((t5) => !F(t5) || t5 instanceof s2 ? t5 : n(t5, e7, r4)), n(Ie2(this.definition, i3, a3, t4), n3, r4);
- });
- }
- };
- var T4 = class extends s3 {
- constructor(e7) {
- super(e7);
- }
- global(e7) {
- const t4 = this.executingContext.globalScope[e7.toLowerCase()];
- if (t4.valueset || (t4.value = _2(this.executingContext, t4.node), t4.valueset = true), F(t4.value) && !(t4.value instanceof s2)) {
- const e8 = new s2();
- e8.fn = t4.value, e8.parameterEvaluator = V4, e8.context = this.executingContext, t4.value = e8;
- }
- return t4.value;
- }
- setGlobal(e7, t4) {
- if (F(t4))
- throw new t(null, e.AssignModuleFunction, null);
- this.executingContext.globalScope[e7.toLowerCase()] = { value: t4, valueset: true, node: null };
- }
- hasGlobal(e7) {
- return void 0 === this.executingContext.exports[e7] && (e7 = e7.toLowerCase()), void 0 !== this.executingContext.exports[e7];
- }
- loadModule(e7) {
- let n3 = e7.spatialReference;
- null == n3 && (n3 = new k({ wkid: 102100 })), this.moduleScope = Ce2({}, e7.customfunctions), this.executingContext = { spatialReference: n3, globalScope: this.moduleScope, localScope: null, libraryResolver: new s4(e7.libraryResolver._moduleSingletons, this.source.syntax.loadedModules), exports: {}, console: e7.console ? e7.console : Ae2, lrucache: e7.lrucache, interceptor: e7.interceptor, depthCounter: { depth: 1 } }, _2(this.executingContext, this.source.syntax);
- }
- };
- function W3(e7, t4) {
- const n3 = [];
- for (let r4 = 0; r4 < t4.arguments.length; r4++)
- n3.push(_2(e7, t4.arguments[r4]));
- return n3;
- }
- function V4(e7, t4, n3) {
- try {
- return true === t4.preparsed ? n3(e7, null, t4.arguments) : n3(e7, t4, W3(e7, t4));
- } catch (r4) {
- throw r4;
- }
- }
- function _2(e7, t4) {
- try {
- switch (t4 == null ? void 0 : t4.type) {
- case "EmptyStatement":
- return k2;
- case "VariableDeclarator":
- return ue2(e7, t4);
- case "VariableDeclaration":
- return se3(e7, t4);
- case "ImportDeclaration":
- return ae2(e7, t4);
- case "ExportNamedDeclaration":
- return ie2(e7, t4);
- case "BlockStatement":
- case "Program":
- return re3(e7, t4);
- case "FunctionDeclaration":
- return le2(e7, t4);
- case "ReturnStatement":
- return oe2(e7, t4);
- case "IfStatement":
- return ne2(e7, t4);
- case "ExpressionStatement":
- return te2(e7, t4);
- case "AssignmentExpression":
- return ee2(e7, t4);
- case "UpdateExpression":
- return Z3(e7, t4);
- case "BreakStatement":
- return j;
- case "ContinueStatement":
- return A;
- case "TemplateElement":
- return we2(e7, t4);
- case "TemplateLiteral":
- return ge2(e7, t4);
- case "ForStatement":
- return J4(e7, t4);
- case "ForInStatement":
- return H3(e7, t4);
- case "WhileStatement":
- return Q3(e7, t4);
- case "Identifier":
- return ve3(e7, t4);
- case "MemberExpression":
- return ce2(e7, t4);
- case "Literal":
- return t4.value;
- case "CallExpression":
- return ye2(e7, t4);
- case "UnaryExpression":
- return fe2(e7, t4);
- case "BinaryExpression":
- return de2(e7, t4);
- case "LogicalExpression":
- return he2(e7, t4);
- case "ArrayExpression":
- return pe2(e7, t4);
- case "ObjectExpression":
- return Y3(e7, t4);
- case "Property":
- return z3(e7, t4);
- default:
- throw new t(e7, e.Unrecognised, t4);
- }
- } catch (n3) {
- throw u2(e7, t4, n3);
- }
- }
- function Y3(e7, t4) {
- const l6 = {}, a3 = /* @__PURE__ */ new Map();
- for (let n3 = 0; n3 < t4.properties.length; n3++) {
- const i4 = _2(e7, t4.properties[n3]);
- if (F(i4.value))
- throw new t(e7, e.NoFunctionInDictionary, t4);
- if (false === w3(i4.key))
- throw new t(e7, e.KeyMustBeString, t4);
- let s9 = i4.key.toString();
- const u7 = s9.toLowerCase();
- a3.has(u7) ? s9 = a3.get(u7) : a3.set(u7, s9), i4.value === k2 ? l6[s9] = null : l6[s9] = i4.value;
- }
- const i3 = new J2(l6);
- return i3.immutable = false, i3;
- }
- function z3(e7, t4) {
- return { key: "Identifier" === t4.key.type ? t4.key.name : _2(e7, t4.key), value: _2(e7, t4.value) };
- }
- function H3(e7, t4) {
- const l6 = _2(e7, t4.right);
- "VariableDeclaration" === t4.left.type && _2(e7, t4.left);
- let a3 = null, i3 = "";
- if ("VariableDeclaration" === t4.left.type) {
- const e8 = t4.left.declarations[0].id;
- "Identifier" === e8.type && (i3 = e8.name);
- } else
- "Identifier" === t4.left.type && (i3 = t4.left.name);
- if (!i3)
- throw new t(e7, e.InvalidIdentifier, t4);
- if (i3 = i3.toLowerCase(), null != e7.localScope && void 0 !== e7.localScope[i3] && (a3 = e7.localScope[i3]), null === a3 && void 0 !== e7.globalScope[i3] && (a3 = e7.globalScope[i3]), null === a3)
- throw new t(e7, e.InvalidIdentifier, t4);
- if (Y(l6) || w3(l6)) {
- const n3 = l6.length;
- for (let r4 = 0; r4 < n3; r4++) {
- a3.value = r4;
- const n4 = _2(e7, t4.body);
- if (n4 === j)
- break;
- if (n4 instanceof D)
- return n4;
- }
- return k2;
- }
- if (E(l6)) {
- for (let n3 = 0; n3 < l6.length(); n3++) {
- a3.value = n3;
- const r4 = _2(e7, t4.body);
- if (r4 === j)
- break;
- if (r4 instanceof D)
- return r4;
- }
- return k2;
- }
- if (!(l6 instanceof J2 || J(l6)))
- return k2;
- {
- const n3 = l6.keys();
- for (let r4 = 0; r4 < n3.length; r4++) {
- a3.value = n3[r4];
- const o5 = _2(e7, t4.body);
- if (o5 === j)
- break;
- if (o5 instanceof D)
- return o5;
- }
- }
- }
- function J4(e7, t4) {
- null !== t4.init && _2(e7, t4.init);
- const n3 = { testResult: true, lastAction: k2 };
- do {
- X3(e7, t4, n3);
- } while (true === n3.testResult);
- return n3.lastAction instanceof D ? n3.lastAction : k2;
- }
- function Q3(e7, t4) {
- const n3 = { testResult: true, lastAction: k2 };
- if (n3.testResult = _2(e7, t4.test), false === n3.testResult)
- return k2;
- if (true !== n3.testResult)
- throw new t(e7, e.BooleanConditionRequired, t4);
- for (; true === n3.testResult && (n3.lastAction = _2(e7, t4.body), n3.lastAction !== j) && !(n3.lastAction instanceof D); )
- if (n3.testResult = _2(e7, t4.test), true !== n3.testResult && false !== n3.testResult)
- throw new t(e7, e.BooleanConditionRequired, t4);
- return n3.lastAction instanceof D ? n3.lastAction : k2;
- }
- function X3(e7, t4, n3) {
- if (null !== t4.test) {
- if (n3.testResult = _2(e7, t4.test), false === n3.testResult)
- return;
- if (true !== n3.testResult)
- throw new t(e7, e.BooleanConditionRequired, t4);
- }
- n3.lastAction = _2(e7, t4.body), n3.lastAction !== j ? n3.lastAction instanceof D ? n3.testResult = false : null !== t4.update && _2(e7, t4.update) : n3.testResult = false;
- }
- function Z3(e7, t4) {
- let l6, a3 = null, i3 = "";
- if ("MemberExpression" === t4.argument.type) {
- if (a3 = _2(e7, t4.argument.object), true === t4.argument.computed ? i3 = _2(e7, t4.argument.property) : "Identifier" === t4.argument.property.type && (i3 = t4.argument.property.name), Y(a3)) {
- if (!Z(i3))
- throw new t(e7, e.ArrayAccessorMustBeNumber, t4);
- if (i3 < 0 && (i3 = a3.length + i3), i3 < 0 || i3 >= a3.length)
- throw new t(e7, e.OutOfBounds, t4);
- l6 = re(a3[i3]), a3[i3] = "++" === t4.operator ? l6 + 1 : l6 - 1;
- } else if (a3 instanceof J2) {
- if (false === w3(i3))
- throw new t(e7, e.KeyAccessorMustBeString, t4);
- if (true !== a3.hasField(i3))
- throw new t(e7, e.FieldNotFound, t4);
- l6 = re(a3.field(i3)), a3.setField(i3, "++" === t4.operator ? l6 + 1 : l6 - 1);
- } else if (J(a3)) {
- if (false === w3(i3))
- throw new t(e7, e.KeyAccessorMustBeString, t4);
- if (true !== a3.hasField(i3))
- throw new t(e7, e.FieldNotFound, t4);
- l6 = re(a3.field(i3)), a3.setField(i3, "++" === t4.operator ? l6 + 1 : l6 - 1);
- } else {
- if (E(a3))
- throw new t(e7, e.Immutable, t4);
- if (!(a3 instanceof T4))
- throw new t(e7, e.InvalidParameter, t4);
- if (false === w3(i3))
- throw new t(e7, e.ModuleAccessorMustBeString, t4);
- if (true !== a3.hasGlobal(i3))
- throw new t(e7, e.ModuleExportNotFound, t4);
- l6 = re(a3.global(i3)), a3.setGlobal(i3, "++" === t4.operator ? l6 + 1 : l6 - 1);
- }
- return false === t4.prefix ? l6 : "++" === t4.operator ? l6 + 1 : l6 - 1;
- }
- if (a3 = "Identifier" === t4.argument.type ? t4.argument.name.toLowerCase() : "", !a3)
- throw new t(e7, e.InvalidIdentifier, t4);
- if (null != e7.localScope && void 0 !== e7.localScope[a3])
- return l6 = re(e7.localScope[a3].value), e7.localScope[a3] = { value: "++" === t4.operator ? l6 + 1 : l6 - 1, valueset: true, node: t4 }, false === t4.prefix ? l6 : "++" === t4.operator ? l6 + 1 : l6 - 1;
- if (void 0 !== e7.globalScope[a3])
- return l6 = re(e7.globalScope[a3].value), e7.globalScope[a3] = { value: "++" === t4.operator ? l6 + 1 : l6 - 1, valueset: true, node: t4 }, false === t4.prefix ? l6 : "++" === t4.operator ? l6 + 1 : l6 - 1;
- throw new t(e7, e.InvalidIdentifier, t4);
- }
- function $(e7, t4, n3, l6, a3) {
- switch (t4) {
- case "=":
- return e7 === k2 ? null : e7;
- case "/=":
- return re(n3) / re(e7);
- case "*=":
- return re(n3) * re(e7);
- case "-=":
- return re(n3) - re(e7);
- case "+=":
- return w3(n3) || w3(e7) ? K(n3) + K(e7) : re(n3) + re(e7);
- case "%=":
- return re(n3) % re(e7);
- default:
- throw new t(a3, e.UnsupportedOperator, l6);
- }
- }
- function ee2(e7, t4) {
- const l6 = _2(e7, t4.right);
- let a3 = null, i3 = "";
- if ("MemberExpression" === t4.left.type) {
- if (a3 = _2(e7, t4.left.object), true === t4.left.computed)
- i3 = _2(e7, t4.left.property);
- else {
- if ("Identifier" !== t4.left.property.type)
- throw new t(e7, e.InvalidIdentifier, t4);
- i3 = t4.left.property.name;
- }
- if (Y(a3)) {
- if (!Z(i3))
- throw new t(e7, e.ArrayAccessorMustBeNumber, t4);
- if (i3 < 0 && (i3 = a3.length + i3), i3 < 0 || i3 > a3.length)
- throw new t(e7, e.OutOfBounds, t4);
- if (i3 === a3.length) {
- if ("=" !== t4.operator)
- throw new t(e7, e.OutOfBounds, t4);
- a3[i3] = $(l6, t4.operator, a3[i3], t4, e7);
- } else
- a3[i3] = $(l6, t4.operator, a3[i3], t4, e7);
- } else if (a3 instanceof J2) {
- if (false === w3(i3))
- throw new t(e7, e.KeyAccessorMustBeString, t4);
- if (true === a3.hasField(i3))
- a3.setField(i3, $(l6, t4.operator, a3.field(i3), t4, e7));
- else {
- if ("=" !== t4.operator)
- throw new t(e7, e.FieldNotFound, t4, { key: i3 });
- a3.setField(i3, $(l6, t4.operator, null, t4, e7));
- }
- } else if (J(a3)) {
- if (false === w3(i3))
- throw new t(e7, e.KeyAccessorMustBeString, t4);
- if (true === a3.hasField(i3))
- a3.setField(i3, $(l6, t4.operator, a3.field(i3), t4, e7));
- else {
- if ("=" !== t4.operator)
- throw new t(e7, e.FieldNotFound, t4, { key: i3 });
- a3.setField(i3, $(l6, t4.operator, null, t4, e7));
- }
- } else {
- if (E(a3))
- throw new t(e7, e.Immutable, t4);
- if (!(a3 instanceof T4))
- throw new t(e7, e.InvalidIdentifier, t4);
- if (false === w3(i3))
- throw new t(e7, e.ModuleAccessorMustBeString, t4);
- if (true !== a3.hasGlobal(i3))
- throw new t(e7, e.ModuleExportNotFound, t4);
- a3.setGlobal(i3, $(l6, t4.operator, a3.global(i3), t4, e7));
- }
- return k2;
- }
- if (a3 = t4.left.name.toLowerCase(), null != e7.localScope && void 0 !== e7.localScope[a3])
- return e7.localScope[a3] = { value: $(l6, t4.operator, e7.localScope[a3].value, t4, e7), valueset: true, node: t4.right }, k2;
- if (void 0 !== e7.globalScope[a3])
- return e7.globalScope[a3] = { value: $(l6, t4.operator, e7.globalScope[a3].value, t4, e7), valueset: true, node: t4.right }, k2;
- throw new t(e7, e.InvalidIdentifier, t4);
- }
- function te2(e7, t4) {
- if ("AssignmentExpression" === t4.expression.type || "UpdateExpression" === t4.expression.type)
- return _2(e7, t4.expression);
- if ("CallExpression" === t4.expression.type) {
- const n3 = _2(e7, t4.expression);
- return n3 === k2 ? k2 : new N(n3);
- }
- {
- const n3 = _2(e7, t4.expression);
- return n3 === k2 ? k2 : new N(n3);
- }
- }
- function ne2(e7, t4) {
- const n3 = _2(e7, t4.test);
- if (true === n3)
- return _2(e7, t4.consequent);
- if (false === n3)
- return null !== t4.alternate ? _2(e7, t4.alternate) : k2;
- throw new t(e7, e.BooleanConditionRequired, t4);
- }
- function re3(e7, t4) {
- let n3 = k2;
- for (let r4 = 0; r4 < t4.body.length; r4++)
- if (n3 = _2(e7, t4.body[r4]), n3 instanceof D || n3 === j || n3 === A)
- return n3;
- return n3;
- }
- function oe2(e7, t4) {
- if (null === t4.argument)
- return new D(k2);
- const n3 = _2(e7, t4.argument);
- return new D(n3);
- }
- function le2(e7, t4) {
- const n3 = t4.id.name.toLowerCase();
- return e7.globalScope[n3] = { valueset: true, node: null, value: new P3(t4, e7) }, k2;
- }
- function ae2(e7, t4) {
- var _a, _b;
- const n3 = t4.specifiers[0].local.name.toLowerCase(), r4 = e7.libraryResolver.loadLibrary(n3);
- let o5 = null;
- return ((_a = e7.libraryResolver._moduleSingletons) == null ? void 0 : _a.has(r4.uri)) ? o5 = e7.libraryResolver._moduleSingletons.get(r4.uri) : (o5 = new T4(r4), o5.loadModule(e7), (_b = e7.libraryResolver._moduleSingletons) == null ? void 0 : _b.set(r4.uri, o5)), e7.globalScope[n3] = { value: o5, valueset: true, node: t4 }, k2;
- }
- function ie2(e7, t4) {
- if (_2(e7, t4.declaration), "FunctionDeclaration" === t4.declaration.type)
- e7.exports[t4.declaration.id.name.toLowerCase()] = "function";
- else if ("VariableDeclaration" === t4.declaration.type)
- for (const n3 of t4.declaration.declarations)
- e7.exports[n3.id.name.toLowerCase()] = "variable";
- return k2;
- }
- function se3(e7, t4) {
- for (let n3 = 0; n3 < t4.declarations.length; n3++)
- _2(e7, t4.declarations[n3]);
- return k2;
- }
- function ue2(e7, t4) {
- let n3 = null === t4.init ? null : _2(e7, t4.init);
- if (n3 === k2 && (n3 = null), "Identifier" !== t4.id.type)
- throw new t(e7, e.InvalidIdentifier, t4);
- const l6 = t4.id.name.toLowerCase();
- return null != e7.localScope ? e7.localScope[l6] = { value: n3, valueset: true, node: t4.init } : e7.globalScope[l6] = { value: n3, valueset: true, node: t4.init }, k2;
- }
- function ce2(e7, t4) {
- try {
- const l6 = _2(e7, t4.object);
- if (null === l6)
- throw new t(e7, e.MemberOfNull, t4);
- if (false === t4.computed) {
- if ("Identifier" === t4.property.type) {
- if (l6 instanceof J2 || J(l6))
- return l6.field(t4.property.name);
- if (l6 instanceof p)
- return W(l6, t4.property.name, t4, e7);
- if (l6 instanceof T4) {
- if (!l6.hasGlobal(t4.property.name))
- throw new t(e7, e.InvalidIdentifier, t4);
- return l6.global(t4.property.name);
- }
- }
- throw new t(e7, e.InvalidMemberAccessKey, t4);
- }
- {
- let a3 = _2(e7, t4.property);
- if (l6 instanceof J2 || J(l6)) {
- if (w3(a3))
- return l6.field(a3);
- throw new t(e7, e.InvalidMemberAccessKey, t4);
- }
- if (l6 instanceof T4) {
- if (w3(a3))
- return l6.global(a3);
- throw new t(e7, e.InvalidMemberAccessKey, t4);
- }
- if (l6 instanceof p) {
- if (w3(a3))
- return W(l6, a3, t4, e7);
- throw new t(e7, e.InvalidMemberAccessKey, t4);
- }
- if (Y(l6)) {
- if (Z(a3) && isFinite(a3) && Math.floor(a3) === a3) {
- if (a3 < 0 && (a3 = l6.length + a3), a3 >= l6.length || a3 < 0)
- throw new t(e7, e.OutOfBounds, t4);
- return l6[a3];
- }
- throw new t(e7, e.InvalidMemberAccessKey, t4);
- }
- if (w3(l6)) {
- if (Z(a3) && isFinite(a3) && Math.floor(a3) === a3) {
- if (a3 < 0 && (a3 = l6.length + a3), a3 >= l6.length || a3 < 0)
- throw new t(e7, e.OutOfBounds, t4);
- return l6[a3];
- }
- throw new t(e7, e.InvalidMemberAccessKey, t4);
- }
- if (E(l6)) {
- if (Z(a3) && isFinite(a3) && Math.floor(a3) === a3) {
- if (a3 < 0 && (a3 = l6.length() + a3), a3 >= l6.length() || a3 < 0)
- throw new t(e7, e.OutOfBounds, t4);
- return l6.get(a3);
- }
- throw new t(e7, e.InvalidMemberAccessKey, t4);
- }
- throw new t(e7, e.InvalidMemberAccessKey, t4);
- }
- } catch (l6) {
- throw l6;
- }
- }
- function fe2(e7, t4) {
- try {
- const n3 = _2(e7, t4.argument);
- if (_(n3)) {
- if ("!" === t4.operator)
- return !n3;
- if ("-" === t4.operator)
- return -1 * re(n3);
- if ("+" === t4.operator)
- return 1 * re(n3);
- if ("~" === t4.operator)
- return ~re(n3);
- throw new t(e7, e.UnsupportedUnaryOperator, t4);
- }
- if ("~" === t4.operator)
- return ~re(n3);
- if ("-" === t4.operator)
- return -1 * re(n3);
- if ("+" === t4.operator)
- return 1 * re(n3);
- throw new t(e7, e.UnsupportedUnaryOperator, t4);
- } catch (n3) {
- throw n3;
- }
- }
- function pe2(e7, t4) {
- try {
- const n3 = [];
- for (let l6 = 0; l6 < t4.elements.length; l6++) {
- const a3 = _2(e7, t4.elements[l6]);
- if (F(a3))
- throw new t(e7, e.NoFunctionInArray, t4);
- a3 === k2 ? n3.push(null) : n3.push(a3);
- }
- return n3;
- } catch (n3) {
- throw n3;
- }
- }
- function de2(e7, t4) {
- try {
- const n3 = [_2(e7, t4.left), _2(e7, t4.right)], l6 = n3[0], a3 = n3[1];
- switch (t4.operator) {
- case "|":
- case "<<":
- case ">>":
- case ">>>":
- case "^":
- case "&":
- return Ne(re(l6), re(a3), t4.operator);
- case "==":
- return X(l6, a3);
- case "!=":
- return !X(l6, a3);
- case "<":
- case ">":
- case "<=":
- case ">=":
- return Q(l6, a3, t4.operator);
- case "+":
- return w3(l6) || w3(a3) ? K(l6) + K(a3) : re(l6) + re(a3);
- case "-":
- return re(l6) - re(a3);
- case "*":
- return re(l6) * re(a3);
- case "/":
- return re(l6) / re(a3);
- case "%":
- return re(l6) % re(a3);
- default:
- throw new t(e7, e.UnsupportedOperator, t4);
- }
- } catch (n3) {
- throw n3;
- }
- }
- function he2(e7, t4) {
- try {
- const n3 = _2(e7, t4.left);
- if (_(n3))
- switch (t4.operator) {
- case "||":
- if (true === n3)
- return n3;
- {
- const n4 = _2(e7, t4.right);
- if (_(n4))
- return n4;
- throw new t(e7, e.LogicExpressionOrAnd, t4);
- }
- case "&&":
- if (false === n3)
- return n3;
- {
- const n4 = _2(e7, t4.right);
- if (_(n4))
- return n4;
- throw new t(e7, e.LogicExpressionOrAnd, t4);
- }
- default:
- throw new t(e7, e.LogicExpressionOrAnd, t4);
- }
- throw new t(e7, e.LogicalExpressionOnlyBoolean, t4);
- } catch (n3) {
- throw n3;
- }
- }
- function we2(e7, t4) {
- return t4.value ? t4.value.cooked : "";
- }
- function me2(e7, t4, n3) {
- if (F(e7))
- throw new t(t4, e.NoFunctionInTemplateLiteral, n3);
- return e7;
- }
- function ge2(e7, t4) {
- let n3 = "", r4 = 0;
- for (const o5 of t4.quasis)
- if (n3 += o5.value ? o5.value.cooked : "", false === o5.tail) {
- n3 += t4.expressions[r4] ? K(me2(_2(e7, t4.expressions[r4]), e7, t4)) : "", r4++;
- }
- return n3;
- }
- function ve3(e7, t4) {
- let n3;
- try {
- const l6 = t4.name.toLowerCase();
- if (null != e7.localScope && void 0 !== e7.localScope[l6])
- return n3 = e7.localScope[l6], true === n3.valueset || (n3.value = _2(e7, n3.node), n3.valueset = true), n3.value;
- if (void 0 !== e7.globalScope[l6])
- return n3 = e7.globalScope[l6], true === n3.valueset || (n3.value = _2(e7, n3.node), n3.valueset = true), n3.value;
- throw new t(e7, e.InvalidIdentifier, t4);
- } catch (l6) {
- throw l6;
- }
- }
- function ye2(e7, t4) {
- try {
- if ("MemberExpression" === t4.callee.type) {
- const n3 = _2(e7, t4.callee.object);
- if (!(n3 instanceof T4))
- throw new t(e7, e.FuncionNotFound, t4);
- const l6 = false === t4.callee.computed ? t4.callee.property.name : _2(e7, t4.callee.property);
- if (!n3.hasGlobal(l6))
- throw new t(e7, e.FuncionNotFound, t4);
- const a3 = n3.global(l6);
- if (!F(a3))
- throw new t(e7, e.CallNonFunction, t4);
- return a3.call(e7, t4);
- }
- if ("Identifier" !== t4.callee.type)
- throw new t(e7, e.FuncionNotFound, t4);
- if (null != e7.localScope && void 0 !== e7.localScope[t4.callee.name.toLowerCase()]) {
- const n3 = e7.localScope[t4.callee.name.toLowerCase()];
- if (F(n3.value))
- return n3.value.call(e7, t4);
- throw new t(e7, e.CallNonFunction, t4);
- }
- if (void 0 !== e7.globalScope[t4.callee.name.toLowerCase()]) {
- const n3 = e7.globalScope[t4.callee.name.toLowerCase()];
- if (F(n3.value))
- return n3.value.call(e7, t4);
- throw new t(e7, e.CallNonFunction, t4);
- }
- throw new t(e7, e.FuncionNotFound, t4);
- } catch (n3) {
- throw n3;
- }
- }
- var be2 = {};
- function xe2(e7, t4, n3, r4) {
- try {
- const o5 = _2(e7, t4.arguments[n3]);
- if (X(o5, r4))
- return _2(e7, t4.arguments[n3 + 1]);
- {
- const o6 = t4.arguments.length - n3;
- return 1 === o6 ? _2(e7, t4.arguments[n3]) : 2 === o6 ? null : 3 === o6 ? _2(e7, t4.arguments[n3 + 2]) : xe2(e7, t4, n3 + 2, r4);
- }
- } catch (o5) {
- throw o5;
- }
- }
- function Se2(e7, t4, n3, l6) {
- try {
- if (true === l6)
- return _2(e7, t4.arguments[n3 + 1]);
- if (3 === t4.arguments.length - n3)
- return _2(e7, t4.arguments[n3 + 2]);
- {
- const l7 = _2(e7, t4.arguments[n3 + 2]);
- if (false === _(l7))
- throw new t(e7, e.BooleanConditionRequired, t4.arguments[n3 + 2]);
- return Se2(e7, t4, n3 + 2, l7);
- }
- } catch (a3) {
- throw a3;
- }
- }
- function Ie2(e7, t4, n3, l6) {
- try {
- const a3 = e7.body;
- if (n3.length !== e7.params.length)
- throw new t(t4, e.WrongNumberOfParameters, l6);
- if (null != t4.localScope)
- for (let r4 = 0; r4 < n3.length; r4++)
- t4.localScope[e7.params[r4].name.toLowerCase()] = { value: n3[r4], valueset: true, node: null };
- const i3 = _2(t4, a3);
- if (i3 instanceof D)
- return i3.value;
- if (i3 === j)
- throw new t(t4, e.UnexpectedToken, l6);
- if (i3 === A)
- throw new t(t4, e.UnexpectedToken, l6);
- return i3 instanceof N ? i3.value : i3;
- } catch (a3) {
- throw a3;
- }
- }
- M(be2, V4), B(be2, V4), N2(be2, V4), C2(be2, V4), f(be2, V4), q(be2, V4), be2.iif = function(e7, t4) {
- try {
- V(null === t4.arguments ? [] : t4.arguments, 3, 3, e7, t4);
- const n3 = _2(e7, t4.arguments[0]);
- if (false === _(n3))
- throw new t(e7, e.BooleanConditionRequired, t4);
- return _2(e7, true === n3 ? t4.arguments[1] : t4.arguments[2]);
- } catch (n3) {
- throw n3;
- }
- }, be2.decode = function(e7, t4) {
- try {
- if (t4.arguments.length < 2)
- throw new t(e7, e.WrongNumberOfParameters, t4);
- if (2 === t4.arguments.length)
- return _2(e7, t4.arguments[1]);
- {
- if ((t4.arguments.length - 1) % 2 == 0)
- throw new t(e7, e.WrongNumberOfParameters, t4);
- const n3 = _2(e7, t4.arguments[0]);
- return xe2(e7, t4, 1, n3);
- }
- } catch (n3) {
- throw n3;
- }
- }, be2.when = function(e7, t4) {
- try {
- if (t4.arguments.length < 3)
- throw new t(e7, e.WrongNumberOfParameters, t4);
- if (t4.arguments.length % 2 == 0)
- throw new t(e7, e.WrongNumberOfParameters, t4);
- const n3 = _2(e7, t4.arguments[0]);
- if (false === _(n3))
- throw new t(e7, e.BooleanConditionRequired, t4.arguments[0]);
- return Se2(e7, t4, 0, n3);
- } catch (n3) {
- throw n3;
- }
- };
- for (const Le2 in be2)
- be2[Le2] = { value: new e2(be2[Le2]), valueset: true, node: null };
- var Fe2 = function() {
- };
- function Ce2(e7, t4) {
- const r4 = new Fe2();
- e7 || (e7 = {}), t4 || (t4 = {});
- const o5 = new J2({ newline: "\n", tab: " ", singlequote: "'", doublequote: '"', forwardslash: "/", backwardslash: "\\" });
- o5.immutable = false, r4.textformatting = { value: o5, valueset: true, node: null };
- for (const n3 in t4)
- r4[n3] = { value: new e2(t4[n3]), native: true, valueset: true, node: null };
- for (const n3 in e7)
- e7[n3] && "esri.Graphic" === e7[n3].declaredClass ? r4[n3] = { value: g.createFromGraphic(e7[n3]), valueset: true, node: null } : r4[n3] = { value: e7[n3], valueset: true, node: null };
- return r4;
- }
- Fe2.prototype = be2, Fe2.prototype.infinity = { value: Number.POSITIVE_INFINITY, valueset: true, node: null }, Fe2.prototype.pi = { value: Math.PI, valueset: true, node: null };
- function Ae2(e7) {
- console.log(e7);
- }
- function Me2(e7) {
- const t4 = { mode: "sync", compiled: false, functions: {}, signatures: [], standardFunction: V4, evaluateIdentifier: ve3 };
- for (let n3 = 0; n3 < e7.length; n3++)
- e7[n3].registerFunctions(t4);
- for (const n3 in t4.functions)
- be2[n3] = { value: new e2(t4.functions[n3]), valueset: true, node: null }, Fe2.prototype[n3] = be2[n3];
- for (let n3 = 0; n3 < t4.signatures.length; n3++)
- o(t4.signatures[n3], "sync");
- }
- function Ee2(e7, n3) {
- let l6 = n3.spatialReference;
- null == l6 && (l6 = new k({ wkid: 102100 }));
- let a3 = null;
- e7.usesModules && (a3 = new s4(/* @__PURE__ */ new Map(), e7.loadedModules));
- const i3 = { spatialReference: l6, globalScope: Ce2(n3.vars, n3.customfunctions), localScope: null, exports: {}, libraryResolver: a3, console: n3.console ? n3.console : Ae2, lrucache: n3.lrucache, interceptor: n3.interceptor, depthCounter: { depth: 1 } };
- let s9 = _2(i3, e7);
- if (s9 instanceof D && (s9 = s9.value), s9 instanceof N && (s9 = s9.value), s9 === k2 && (s9 = null), s9 === j)
- throw new t(i3, e.IllegalResult, null);
- if (s9 === A)
- throw new t(i3, e.IllegalResult, null);
- if (F(s9))
- throw new t(i3, e.IllegalResult, null);
- return s9;
- }
- Me2([m2]);
- // node_modules/@arcgis/core/chunks/arcade.js
- var b2 = ["feature", "angle", "bearing", "centroid", "envelopeintersects", "extent", "geometry", "isselfintersecting", "ringisclockwise"];
- function g4() {
- return true;
- }
- var A3 = g4();
- var w6 = false;
- var h2 = false;
- var j3 = null;
- var x4 = [];
- function M3(t4, r4) {
- if (true === r4.useAsync || true === t4.isAsync)
- return F3(t4, r4);
- if (has("esri-csp-restrictions")) {
- return function(e7) {
- return Ee2(t4, e7);
- };
- }
- try {
- return Le(t4, r4);
- } catch (n3) {
- if ("esri.arcade.arcadeuncompilableerror" === n3.declaredRootClass)
- return function(e7) {
- return Ee2(t4, e7);
- };
- throw n3;
- }
- }
- function F3(t4, r4) {
- if (null === j3)
- throw new t(null, e.AsyncNotEnabled, null);
- if (has("esri-csp-restrictions") || false === A3) {
- return function(e7) {
- return j3.executeScript(t4, e7);
- };
- }
- try {
- return Le(t4, r4, true);
- } catch (n3) {
- if ("esri.arcade.arcadeuncompilableerror" === n3.declaredRootClass)
- return function(e7) {
- return j3.executeScript(t4, e7);
- };
- throw n3;
- }
- }
- function E3(e7) {
- Me2(e7), Ee(e7, "sync"), null === j3 ? x4.push(e7) : (Ee(e7, "async"), j3.extend(e7));
- }
- function G2(e7, t4 = []) {
- return d4(e7, t4);
- }
- function v3(e7, t4, r4 = []) {
- return U3(d4(e7, r4), t4);
- }
- function U3(e7, t4) {
- if (true === t4.useAsync || true === e7.isAsync) {
- if (null === j3)
- throw new t(null, e.AsyncNotEnabled, null);
- return j3.executeScript(e7, t4);
- }
- return Ee2(e7, t4);
- }
- function _3(e7, t4) {
- return c3(e7, t4);
- }
- function I2(e7, t4) {
- return p3(e7, t4);
- }
- function R2(e7, t4 = false) {
- return void 0 === t4 && (t4 = false), l2(e7);
- }
- function C4(e7) {
- return u3(e7);
- }
- function D4(e7, t4 = []) {
- return void 0 === e7.usesGeometry && d(e7, t4), true === e7.usesGeometry;
- }
- var P4 = null;
- function k5() {
- return P4 || (P4 = z4(), P4);
- }
- async function z4() {
- const [e7, t4] = await Promise.all([import("./geometryEngine-3QP2OBVR.js"), import("./geomsync-6KPFLG3M.js")]);
- return h2 = true, t4.setGeometryEngine(e7), true;
- }
- var L2 = null;
- function N4() {
- return null !== L2 || (L2 = O2()), L2;
- }
- async function O2() {
- await Re(), j3 = await import("./arcadeAsyncRuntime-FS2QAHI6.js");
- for (const e7 of x4)
- j3.extend(e7), Ee(e7, "async");
- return x4 = null, true;
- }
- function T5() {
- return w6;
- }
- function q2() {
- return !!j3;
- }
- function B3() {
- return h2;
- }
- var H4 = null;
- function J5() {
- return H4 || (H4 = K3(), H4);
- }
- async function K3() {
- await N4();
- const [e7, r4, n3, s9, u7] = await Promise.all([import("./featureSetUtils-A7XW72XL.js"), import("./featuresetbase-U2SCLWM5.js"), import("./featuresetgeom-OU6XV5EY.js"), import("./featuresetstats-5WAP4HO2.js"), import("./featuresetstring-6A7U67BI.js")]);
- return te3 = e7, j3.extend([r4, n3, s9, u7]), Ee([r4, n3, s9, u7], "async"), w6 = true, true;
- }
- function Q4(e7, t4 = []) {
- return void 0 === e7.usesFeatureSet && d(e7, t4), true === e7.usesFeatureSet;
- }
- function V5(e7, t4 = []) {
- return void 0 === e7.isAsync && d(e7, t4), true === e7.isAsync;
- }
- function W4(e7, t4) {
- if (t4) {
- for (const r4 of t4)
- if (_3(e7, r4))
- return true;
- return false;
- }
- return false;
- }
- async function X4(e7, t4, r4 = [], n3 = false, s9 = null) {
- return Y4(/* @__PURE__ */ new Set(), e7, t4, r4, n3, s9);
- }
- async function Y4(e7, t4, r4, n3 = [], s9 = false, u7 = null) {
- const a3 = "string" == typeof t4 ? G2(t4) : t4, o5 = [];
- return a3 && (false === B3() && (D4(a3) || s9) && o5.push(k5()), false === q2() && (true === a3.isAsync || r4) && o5.push(N4()), false === T5() && (Q4(a3) || W4(a3, n3)) && o5.push(J5())), o5.length && await Promise.all(o5), await $2(e7, a3, u7, r4, s9), true;
- }
- function Z4(e7, t4 = []) {
- return void 0 === e7.usesModules && d(e7, t4), true === e7.usesModules;
- }
- async function $2(e7, t4, r4 = null, s9 = false, u7 = false) {
- const i3 = x(t4);
- null === r4 && i3.length > 0 && (r4 = l5.getDefault()), t4.loadedModules = {};
- for (const n3 of i3) {
- c(r4);
- const i4 = r4.normalizeModuleUri(n3.source);
- if (e7.has(i4.uri))
- throw new t(null, e.CircularModules, null);
- e7.add(i4.uri);
- const c5 = await r4.fetchModule(i4);
- await Y4(e7, c5, s9, [], u7, r4), e7.delete(i4.uri), c5.isAsync && (t4.isAsync = true), c5.usesFeatureSet && (t4.usesFeatureSet = true), c5.usesGeometry && (t4.usesGeometry = true), t4.loadedModules[n3.libname] = { uri: i4.uri, script: c5 };
- }
- }
- function ee3(e7) {
- if (D4(e7))
- return true;
- const t4 = y2(e7);
- let r4 = false;
- for (let n3 = 0; n3 < t4.length; n3++)
- if (b2.includes(t4[n3])) {
- r4 = true;
- break;
- }
- return r4;
- }
- var te3 = null;
- function re4() {
- return te3;
- }
- var ne3 = Object.freeze(Object.defineProperty({ __proto__: null, compileScript: M3, extend: E3, parseScript: G2, parseAndExecuteScript: v3, executeScript: U3, referencesMember: _3, referencesFunction: I2, extractFieldLiterals: R2, extractExpectedFieldLiterals: C4, scriptUsesGeometryEngine: D4, enableGeometrySupport: k5, enableGeometrySupportImpl: z4, enableAsyncSupport: N4, enableAsyncSupportImpl: O2, isFeatureSetSupportEnabled: T5, isAsyncEnabled: q2, isGeometryEnabled: B3, enableFeatureSetSupport: J5, enableFeatureSetSupportImpl: K3, scriptUsesFeatureSet: Q4, scriptIsAsync: V5, loadScriptDependencies: X4, _loadScriptDependenciesImpl: Y4, scriptUsesModules: Z4, loadDependentModules: $2, scriptTouchesGeometry: ee3, featureSetUtils: re4 }, Symbol.toStringTag, { value: "Module" }));
- // node_modules/@arcgis/core/support/arcadeUtils.js
- var C5 = /^\$(feature|aggregatedFeatures)\./i;
- var M4 = { vars: { $feature: "any", $view: "any" }, spatialReference: null };
- function P5(e7) {
- return e7.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
- }
- function I3(e7) {
- return null == e7 ? null : Y(e7) || E(e7) ? "array" : z(e7) ? "date" : w3(e7) ? "text" : _(e7) ? "boolean" : Z(e7) ? "number" : e7 instanceof J2 ? "dictionary" : J(e7) ? "feature" : e7 instanceof w ? "point" : e7 instanceof v ? "polygon" : e7 instanceof m ? "polyline" : e7 instanceof u ? "multipoint" : e7 instanceof w2 ? "extent" : P(e7) ? "featureSet" : G(e7) ? "featureSetCollection" : null;
- }
- function A4(r4) {
- if (!r4)
- return null;
- try {
- return G2(r4);
- } catch (n3) {
- }
- return null;
- }
- function D5(e7, n3) {
- const t4 = "string" == typeof e7 ? A4(e7) : e7;
- if (!t4)
- return null;
- try {
- return n3 = n3 || y(M4), M3(t4, n3);
- } catch (o5) {
- }
- return null;
- }
- function G3(e7, r4) {
- return { vars: { $feature: null == e7 ? new g() : g.createFromGraphic(e7), $view: r4 && r4.view }, spatialReference: r4 && r4.sr };
- }
- function T6(e7, r4, n3) {
- return g.createFromGraphicLikeObject(r4, e7, n3);
- }
- function U4(e7, r4) {
- null != e7.vars && (e7.vars.$feature = r4);
- }
- function V6(e7, r4) {
- let t4;
- try {
- t4 = U3(e7, r4);
- } catch (o5) {
- t4 = null;
- }
- return t4;
- }
- function L3(e7, r4) {
- let n3;
- try {
- n3 = e7 ? e7(r4) : null;
- } catch (t4) {
- n3 = null;
- }
- return n3;
- }
- function q3(e7, r4) {
- try {
- return e7 ? e7(r4) : Promise.resolve(null);
- } catch (n3) {
- return Promise.resolve(null);
- }
- }
- function J6(e7, r4) {
- if (!e7)
- return [];
- const n3 = "string" == typeof e7 ? A4(e7) : e7;
- if (!n3)
- return [];
- const o5 = C4(n3);
- let s9 = new Array();
- o5.forEach((e8) => {
- C5.test(e8) && (e8 = e8.replace(C5, ""), s9.push(e8));
- });
- const i3 = s9.filter((e8) => e8.includes("*"));
- return s9 = s9.filter((e8) => !i3.includes(e8)), r4 && i3.forEach((e8) => {
- const n4 = new RegExp(`^${e8.split(/\*+/).map(P5).join(".*")}$`, "i");
- r4.forEach((e9) => n4.test(e9) ? s9.push(e9) : null);
- }), [...new Set(s9.sort())];
- }
- function O3(e7) {
- return _3(e7, "$view");
- }
- function B4(e7, r4) {
- return !!e7 && _3(e7, r4);
- }
- function H5(e7) {
- if (!e7 || null == e7.spatialReference && (null == e7.scale || null == e7.viewingMode))
- return;
- return { view: e7.viewingMode && null != e7.scale ? new J2({ viewingMode: e7.viewingMode, scale: e7.scale }) : null, sr: e7.spatialReference };
- }
- function K4({ url: e7, spatialReference: r4, lrucache: n3, interceptor: t4 }) {
- const o5 = re4();
- return o5 ? o5.createFeatureSetCollectionFromService(e7, r4, n3, t4) : null;
- }
- function N5({ layer: e7, spatialReference: r4, outFields: n3, returnGeometry: t4, lrucache: o5, interceptor: s9 }) {
- if (null === e7)
- return null;
- const i3 = re4();
- return i3 ? i3.constructFeatureSet(e7, r4, n3, t4 != null ? t4 : true, o5, s9) : null;
- }
- function Q5(e7) {
- if (null === (e7 == null ? void 0 : e7.map))
- return null;
- const r4 = re4();
- return r4 ? r4.createFeatureSetCollectionFromMap(e7.map, e7.spatialReference, e7.lrucache, e7.interceptor) : null;
- }
- function W5(e7) {
- return J2.convertJsonToArcade(e7);
- }
- function X5(e7, r4, n3 = []) {
- return X4(e7, r4, n3);
- }
- function Y5() {
- return k5();
- }
- function Z5() {
- return J5();
- }
- function _4(e7) {
- return "simple" === e7.type || "class-breaks" === e7.type || "unique-value" === e7.type || "dot-density" === e7.type || "dictionary" === e7.type || "pie-chart" === e7.type;
- }
- function ee4(e7) {
- return "esri.layers.support.LabelClass" === e7.declaredClass;
- }
- function re5(e7) {
- return "esri.PopupTemplate" === e7.declaredClass;
- }
- function ne4(e7, r4) {
- var _a;
- if (!e7)
- return false;
- if ("string" == typeof e7)
- return r4(e7);
- const n3 = e7;
- if (_4(n3)) {
- if ("dot-density" === n3.type) {
- const e9 = (_a = n3.attributes) == null ? void 0 : _a.some((e10) => r4(e10.valueExpression));
- if (e9)
- return e9;
- }
- const e8 = n3.visualVariables, t4 = !!e8 && e8.some((e9) => {
- let n4 = r4(e9.valueExpression);
- return "size" === e9.type && (e3(e9.minSize) && (n4 = n4 || r4(e9.minSize.valueExpression)), e3(e9.maxSize) && (n4 = n4 || r4(e9.maxSize.valueExpression))), n4;
- });
- return !(!("valueExpression" in n3) || !r4(n3.valueExpression)) || t4;
- }
- if (ee4(n3)) {
- const e8 = n3.labelExpressionInfo && n3.labelExpressionInfo.expression;
- return !(!e8 || !r4(e8)) || false;
- }
- return !!re5(n3) && (!!n3.expressionInfos && n3.expressionInfos.some((e8) => r4(e8.expression)) || Array.isArray(n3.content) && n3.content.some((e8) => {
- var _a2;
- return "expression" === e8.type && r4((_a2 = e8.expressionInfo) == null ? void 0 : _a2.expression);
- }));
- }
- function te4(e7) {
- const r4 = A4(e7);
- return !!r4 && ee3(r4);
- }
- function oe3(e7) {
- return ne4(e7, te4);
- }
- function se4(e7) {
- const r4 = A4(e7);
- return !!r4 && D4(r4);
- }
- function ie3(e7) {
- return ne4(e7, se4);
- }
- export {
- J2 as Dictionary,
- ne3 as arcade,
- g as arcadeFeature,
- N5 as convertFeatureLayerToFeatureSet,
- W5 as convertJsonToArcade,
- Q5 as convertMapToFeatureSetCollection,
- K4 as convertServiceUrlToWorkspace,
- G3 as createExecContext,
- T6 as createFeature,
- D5 as createFunction,
- A4 as createSyntaxTree,
- O3 as dependsOnView,
- Z5 as enableFeatureSetOperations,
- Y5 as enableGeometryOperations,
- V6 as evalSyntaxTree,
- q3 as executeAsyncFunction,
- L3 as executeFunction,
- J6 as extractFieldNames,
- I3 as getArcadeType,
- H5 as getViewInfo,
- oe3 as hasGeometryFunctions,
- ie3 as hasGeometryOperations,
- B4 as hasVariable,
- X5 as loadScriptDependencies,
- U4 as updateExecContext
- };
- //# sourceMappingURL=arcadeUtils-Y4XBISY2.js.map
|