@arcgis/coding-components 5.1.0-next.94 → 5.1.0-next.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cdn/{ODCW355N.js → 363GMMQ6.js} +1 -1
  2. package/dist/cdn/{C2NTBAZK.js → 55EKVOZS.js} +1 -1
  3. package/dist/cdn/{NZDJGAT2.js → 64X4ILDM.js} +1 -1
  4. package/dist/cdn/{6BS5M2LA.js → 7NI24N24.js} +1 -1
  5. package/dist/cdn/{XDBYQYMN.js → 7Z4V2ZOD.js} +1 -1
  6. package/dist/cdn/{JHCVXLYB.js → AEHKSYEZ.js} +1 -1
  7. package/dist/cdn/{27MWFBRL.js → CHTL74L2.js} +1 -1
  8. package/dist/cdn/{W7UVGDPL.js → E3VATROF.js} +1 -1
  9. package/dist/cdn/{PNIRJAMR.js → GPIFJKPY.js} +1 -1
  10. package/dist/cdn/{MTIHPCIF.js → GS2ISVXJ.js} +1 -1
  11. package/dist/cdn/{QVWSOD3N.js → GZ6HZKQZ.js} +1 -1
  12. package/dist/cdn/{OI3DH7N2.js → JLF32ABD.js} +1 -1
  13. package/dist/cdn/JQQBQXPD.js +2 -0
  14. package/dist/cdn/{MJ7MJPGA.js → KCU2C44H.js} +1 -1
  15. package/dist/cdn/{NK5J27LM.js → N33AALGQ.js} +1 -1
  16. package/dist/cdn/{VUZOZLS3.js → NOHSS7JG.js} +1 -1
  17. package/dist/cdn/{EOGGHL44.js → NWLOXWV6.js} +1 -1
  18. package/dist/cdn/{UQ6UIXTY.js → OGS4AWC2.js} +1 -1
  19. package/dist/cdn/{AHFU2DJA.js → P7I5ATMN.js} +1 -1
  20. package/dist/cdn/{SM3MA3KP.js → REL6OK2I.js} +1 -1
  21. package/dist/cdn/{MR5ZGLNC.js → SATQDL5P.js} +1 -1
  22. package/dist/cdn/{BA546EMZ.js → SB3MM5EM.js} +1 -1
  23. package/dist/cdn/{G3BWRHPC.js → SKTKTWIV.js} +1 -1
  24. package/dist/cdn/{TQNCGG32.js → TCLNQ7Z6.js} +1 -1
  25. package/dist/cdn/{CMZFQA5X.js → TNA5F36E.js} +1 -1
  26. package/dist/cdn/{UFDDEHND.js → TSZHSRGH.js} +1 -1
  27. package/dist/cdn/{FEYQMPLI.js → UCX6WHKQ.js} +1 -1
  28. package/dist/cdn/{R5QVN7GZ.js → WL2QW4SI.js} +1 -1
  29. package/dist/cdn/{Q376WIX4.js → WN4UL6U4.js} +1 -1
  30. package/dist/cdn/{UB7TEPYB.js → XN56YGFQ.js} +1 -1
  31. package/dist/cdn/Y3KOWWO5.js +2 -0
  32. package/dist/cdn/{KLNTCPWU.js → YE7HDVYS.js} +1 -1
  33. package/dist/cdn/{FZHOCYLK.js → YJW6NUWX.js} +1 -1
  34. package/dist/cdn/{VJG7CIFY.js → YTQ4K7PQ.js} +1 -1
  35. package/dist/cdn/assets/code-editor/sql-expr.worker.js +1 -1
  36. package/dist/cdn/index.js +1 -1
  37. package/dist/docs/api.json +1 -1
  38. package/dist/docs/docs.json +1 -1
  39. package/dist/docs/web-types.json +1 -1
  40. package/package.json +6 -6
  41. package/dist/cdn/BCUUVBXH.js +0 -2
  42. package/dist/cdn/XSXXLPXK.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import a from"./FZHOCYLK.js";import{a as h}from"./ER2MKLVA.js";import{a as I}from"./MP6Z45SA.js";import{b as l}from"./BCUUVBXH.js";import{Qk as T,al as u}from"./LLPQEURF.js";export default $arcgis.t(([{a:g,b:f}])=>{var m=Promise.withResolvers(),p=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _getClientProxy(){let e=await h();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Expression workers.");this._worker=e.createWebWorker({worker:o("SqlExprWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},L=["AND","AS","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","DOY","DOW","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INT","INTEGER","INTERVAL","LEADING","LIKE","MINUTE","MONTH","POSITION","REAL","SECOND","SMALLINT","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WEEK","WHEN","WITH","YEAR","ZONE"],M=["AND","BETWEEN","LIKE","NOT","OR","IS","NULL"],b=["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","MOD","NULLIF","POWER","ROUND","SIGN","SIN","TAN","TRUNCATE","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","SUBSTRING","TRIM","UPPER"],O={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},D={defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:L,operators:M,builtinFunctions:b,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}},_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),r=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},c=this._defaults.getApiContextForModel(e.uri);return await o.doComplete(e.uri.toString(),n,t,c)}catch(o){return l("SqlExprCompletionProvider")(o),{suggestions:[]}}}},k=class{constructor(e,t,{defaults:o,diagnosticService:r}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=r,this._defaults=o,h().then(n=>{let c=i=>{let s=i.getLanguageId();if(s!==this._languageId)return;let d=I(()=>{this._doValidate(i,s).catch(R=>{throw R})}),S=i.onDidChangeContent(d),A=i.onDidChangeAttached(d);this._modelListeners.set(i.uri.toString(),[S,A]),this._doValidate(i,s).catch(l("SqlExprDiagnosticsAdapter"))},E=i=>{let s=i.uri.toString();n.setModelMarkers(i,this._languageId,[]);let d=this._modelListeners.get(s);if(d){for(;d.length;)d.pop()?.dispose();this._modelListeners.delete(s)}};this._disposables.push(n.onDidCreateModel(c)),this._disposables.push(n.onWillDisposeModel(i=>E(i))),this._disposables.push(n.onDidChangeModelLanguage(i=>{E(i.model),c(i.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(i=>{i.getLanguageId()===this._languageId&&(E(i),c(i))})})),this._disposables.push(o.onModelContextDidChange(i=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&s.uri.toString()===i&&this._doValidate(s,this._languageId).catch(l("SqlExprDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(i=>i.forEach(s=>s.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(c)})}async _doValidate(e,t){let o=await h();if(e.isAttachedToEditor())try{let r=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),c=await r.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,c),o.setModelMarkers(e,t,c)}catch(r){l("SqlExprDiagnosticsAdapter")(r)}}},w;async function Z(...a){return await p.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("sql expression worker not registered!"));return}e(w(...a))})}var C=class{constructor(){this._onDiagnosticsChange=new T}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},N=new C;async function K(){return await f(),N}function X(a){let e=new p(a),t=async(...r)=>await e.getLanguageServiceWorker(...r);w=t,u.setMonarchTokensProvider(g.languageId,D),u.setLanguageConfiguration(g.languageId,O);let o=new _(t,g);u.registerCompletionItemProvider(g.languageId,o),new k(a.languageId,t,{defaults:a,diagnosticService:N})}return{a:Z,b:K,c:X}},a)
2
+ import a from"./YJW6NUWX.js";import{a as h}from"./ER2MKLVA.js";import{a as I}from"./MP6Z45SA.js";import{b as l}from"./Y3KOWWO5.js";import{Qk as T,al as u}from"./LLPQEURF.js";export default $arcgis.t(([{a:g,b:f}])=>{var m=Promise.withResolvers(),p=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _getClientProxy(){let e=await h();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Expression workers.");this._worker=e.createWebWorker({worker:o("SqlExprWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},L=["AND","AS","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","DOY","DOW","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INT","INTEGER","INTERVAL","LEADING","LIKE","MINUTE","MONTH","POSITION","REAL","SECOND","SMALLINT","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WEEK","WHEN","WITH","YEAR","ZONE"],M=["AND","BETWEEN","LIKE","NOT","OR","IS","NULL"],b=["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","MOD","NULLIF","POWER","ROUND","SIGN","SIN","TAN","TRUNCATE","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","SUBSTRING","TRIM","UPPER"],O={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},D={defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:L,operators:M,builtinFunctions:b,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}},_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),r=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},c=this._defaults.getApiContextForModel(e.uri);return await o.doComplete(e.uri.toString(),n,t,c)}catch(o){return l("SqlExprCompletionProvider")(o),{suggestions:[]}}}},k=class{constructor(e,t,{defaults:o,diagnosticService:r}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=r,this._defaults=o,h().then(n=>{let c=i=>{let s=i.getLanguageId();if(s!==this._languageId)return;let d=I(()=>{this._doValidate(i,s).catch(R=>{throw R})}),S=i.onDidChangeContent(d),A=i.onDidChangeAttached(d);this._modelListeners.set(i.uri.toString(),[S,A]),this._doValidate(i,s).catch(l("SqlExprDiagnosticsAdapter"))},E=i=>{let s=i.uri.toString();n.setModelMarkers(i,this._languageId,[]);let d=this._modelListeners.get(s);if(d){for(;d.length;)d.pop()?.dispose();this._modelListeners.delete(s)}};this._disposables.push(n.onDidCreateModel(c)),this._disposables.push(n.onWillDisposeModel(i=>E(i))),this._disposables.push(n.onDidChangeModelLanguage(i=>{E(i.model),c(i.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(i=>{i.getLanguageId()===this._languageId&&(E(i),c(i))})})),this._disposables.push(o.onModelContextDidChange(i=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&s.uri.toString()===i&&this._doValidate(s,this._languageId).catch(l("SqlExprDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(i=>i.forEach(s=>s.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(c)})}async _doValidate(e,t){let o=await h();if(e.isAttachedToEditor())try{let r=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),c=await r.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,c),o.setModelMarkers(e,t,c)}catch(r){l("SqlExprDiagnosticsAdapter")(r)}}},w;async function Z(...a){return await p.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("sql expression worker not registered!"));return}e(w(...a))})}var C=class{constructor(){this._onDiagnosticsChange=new T}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},N=new C;async function K(){return await f(),N}function X(a){let e=new p(a),t=async(...r)=>await e.getLanguageServiceWorker(...r);w=t,u.setMonarchTokensProvider(g.languageId,D),u.setLanguageConfiguration(g.languageId,O);let o=new _(t,g);u.registerCompletionItemProvider(g.languageId,o),new k(a.languageId,t,{defaults:a,diagnosticService:N})}return{a:Z,b:K,c:X}},a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import f from"./VUZOZLS3.js";import e from"./PNIRJAMR.js";import d from"./QVWSOD3N.js";import c from"./ZHZFKZA7.js";import{e as J}from"./AHFU2DJA.js";import b from"./4B64NBIM.js";import"./G56LJGLK.js";import{a as ee}from"./ER2MKLVA.js";import"./IFNCCZ7O.js";import a from"./GLJQQLP2.js";import{a as Y}from"./BA546EMZ.js";import{a as K}from"./MJ7MJPGA.js";import"./MTIHPCIF.js";import"./6G5URSC7.js";import"./6C52UOYL.js";import{E as V,F as H,G as Q,H as x,K as W,L as X,h as j,j as l,l as I,n as L,t as G}from"./SM3MA3KP.js";import{a as q,b as u}from"./BCUUVBXH.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import{Rk as Z,Uk as T}from"./LLPQEURF.js";import"./3TTFCHAA.js";export default $arcgis.t(([ne,{watch:F},m,{property:o,subclass:S},{a:te,h:y,i:B},{b:M},,,P,{a:se,b:ie}])=>{var ce=j`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.bottom-action-bar.is-collapsed{border-bottom:0}`,ae="https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0",p=(t,e)=>q(t,"Arcade Assistant",e),le=t=>{let{aiAssistantsEnabled:e}=t;return e===void 0?(p("warn","`areAiAssistantsEnabled` is not defined in the organizations settings."),!1):e},de=t=>!(!t||!("id"in t)),ue=async t=>(await ne.getCredential(t,{oAuthPopupConfirmation:!1})).token,he=async t=>{try{return!!await ne.checkSignInStatus(t)}catch{return p("warn","User is not signed in."),!1}};async function ge({portalUrl:t,profile:e}){if(!de(e))return p("warn","Addon initialization failed. Reason: unsupported profile."),{shouldRender:!1};let s=t.replace(/\/sharing\/rest(\/.*)?$/iu,"").replace(/\/$/u,"");if(!await he(s))return{shouldRender:!1};let i=await ue(t),a=`${s}/sharing/rest/portals/self?f=json&token=${i}`,r=`${s}/sharing/rest/portals/self/settings?f=json&token=${i}`,n=`${s}/sharing/rest/portals/self/signinSettings?f=json&token=${i}`,d=await Promise.allSettled([fetch(a,{credentials:"include"}).then($=>$.json()),fetch(r,{credentials:"include"}).then($=>$.json()),fetch(n,{credentials:"include"}).then($=>$.json())]),[f,C,R]=d,A=f.status==="fulfilled"?f.value:(p("warn",`Failed to fetch selfUrl. Reason: ${f.reason}.`),{}),O=C.status==="fulfilled"?C.value:(p("warn",`Failed to fetch settingsUrl. Reason: ${C.reason}.`),{}),re=R.status==="fulfilled"?R.value:(p("warn",`Failed to fetch signinSettingsUrl. Reason: ${R.reason}.`),{});if(A.isPortal)return{shouldRender:!1};let U=A.helpBase||"";if(!O)return p("warn","Settings response is not available."),{shouldRender:!1};let k=le(O);re.blockBetaApps===!0&&(p("warn","Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."),k=!1),A?.user?.privileges?.includes("portal:user:useAIAssistants")||(p("warn","User does not have the required privileges to use AI Assistants."),k=!1);let z=A?.helperServices?.aiAssistantServices?.url;return z?{shouldRender:!0,serviceUrl:z,helpBase:U,assistantsEnabled:k,feedbackServiceUrl:ae}:{shouldRender:!0,assistantsEnabled:!1,helpBase:U,feedbackServiceUrl:ae}}var pe=Object.defineProperty,be=Object.getOwnPropertyDescriptor,_=(t,e,s,i)=>{for(var a=i>1?void 0:i?be(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(a=(i?n(e,s,a):n(a))||a);return i&&a&&pe(e,s,a),a},oe=100,h=class extends m{constructor(t){super(t),this.collectionItems=[],this.errorMessage="",this.expanded=!1,this.requestId=0,this.status="idle",this.visibleChildCount=oe}};_([o()],h.prototype,"collectionItems",2);_([o()],h.prototype,"errorMessage",2);_([o()],h.prototype,"expanded",2);_([o()],h.prototype,"requestId",2);_([o()],h.prototype,"schemaValue",2);_([o()],h.prototype,"status",2);_([o()],h.prototype,"visibleChildCount",2);h=_([S("ArcadeDebuggerLazyTreeNodeState")],h);var w=class extends m{constructor(t){super(t),this.generation=0,this.nodes=new Map}reset(){this.generation+=1,this.destroyNodes()}ensureNode(t,e=!1,s){let i=this.nodes.get(t);if(i)return i;let a=new h;return a.expanded=e,this.nodes.set(t,a),e&&s&&this.loadNode(t,s),a}setExpanded(t,e,s){let i=this.ensureNode(t,e,s);if(i.expanded===e){e&&s&&this.loadNode(t,s);return}i.expanded=e,e&&s&&this.loadNode(t,s)}showMore(t,e){let s=this.ensureNode(t);s.visibleChildCount>=e||(s.visibleChildCount=Math.min(e,s.visibleChildCount+oe))}loadNode(t,e){switch(e.kind){case"collection":this.runLoad(t,e.load,(s,i)=>{s.collectionItems=i});return;case"schema":this.runLoad(t,e.load,(s,i)=>{s.schemaValue=i});return}}runLoad(t,e,s){let i=this.nodes.get(t);if(!i||i.status==="loading"||i.status==="loaded")return;let a=this.generation,r=i.requestId+1;i.requestId=r,i.status="loading",i.errorMessage="",i.schemaValue=void 0,i.collectionItems=[],e().then(n=>{let d=this.nodes.get(t);!d||this.generation!==a||d.requestId!==r||(s(d,n),d.status="loaded")}).catch(()=>{let n=this.nodes.get(t);!n||this.generation!==a||n.requestId!==r||(n.status="error")})}destroyNodes(){for(let t of this.nodes.values())t.destroy();this.nodes.clear()}};w=_([S("ArcadeDebuggerLazyTreeState")],w);var _e=Object.defineProperty,me=Object.getOwnPropertyDescriptor,c=(t,e,s,i)=>{for(var a=i>1?void 0:i?me(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(a=(i?n(e,s,a):n(a))||a);return i&&a&&_e(e,s,a),a},b=class extends m{constructor(t){super(t),this.phase="idle",this.sessionId=0,this.consoleLogs=[],this.hasExecuted=!1}get isExecuting(){return this.phase==="running"||this.phase==="debug-running"||this.phase==="debug-paused"}get isDebugging(){return this.phase==="debug-running"||this.phase==="debug-paused"}get isPaused(){return this.phase==="debug-paused"}get runResult(){return this.result?.resultType==="run"?this.result.result:void 0}get debugResult(){return this.result?.resultType==="debug"?this.result.result:void 0}addConsoleLog(t){this.consoleLogs=[...this.consoleLogs,t]}};c([o()],b.prototype,"phase",2);c([o()],b.prototype,"mode",2);c([o()],b.prototype,"sessionId",2);c([o()],b.prototype,"result",2);c([o()],b.prototype,"consoleLogs",2);c([o()],b.prototype,"hasExecuted",2);b=c([S("ArcadeDebuggerExecutionModel")],b);var E=class extends m{constructor(t){super(t),this.breakpoints=[]}setBreakpoints(t){this.breakpoints=Array.from(new Set(t)).sort((e,s)=>e-s)}toggleBreakpoint(t){let e=new Set(this.breakpoints);e.has(t)?e.delete(t):e.add(t),this.setBreakpoints(e)}clearBreakpoints(){this.breakpoints=[]}};c([o()],E.prototype,"breakpoints",2);E=c([S("ArcadeDebuggerSessionModel")],E);var v=class extends m{constructor(t){super(t),this.openedPanel="output",this.showPanel=!1}};c([o()],v.prototype,"openedPanel",2);c([o()],v.prototype,"showPanel",2);v=c([S("ArcadeDebuggerUiModel")],v);var D=class extends m{constructor(t){super(t)}get line(){return this.pausedState?.line}clearPausedState(){this.lastPausedState=this.pausedState,this.pausedState=void 0}reset(){this.pausedState=void 0,this.lastPausedState=void 0}setPausedState(t){this.pausedState=t,this.lastPausedState=t}};c([o()],D.prototype,"pausedState",2);c([o()],D.prototype,"lastPausedState",2);D=c([S("ArcadeDebuggerPausedFrameModel")],D);var g=class extends m{constructor(t){super(t),this.execution=new b,this.lazyTreeState=new w,this.pausedFrame=new D,this.previewTabsState=new M,this.session=new E,this.ui=new v}get breakpoints(){return this.session.breakpoints}get debuggerBreakpoints(){return this.session.breakpoints.map(t=>({line:t}))}get consoleLogs(){return this.execution.consoleLogs}get debug(){if(!(!this.pausedFrame.pausedState&&!this.pausedFrame.lastPausedState))return{pausedState:this.pausedFrame.pausedState,lastPausedState:this.pausedFrame.lastPausedState}}get debugResult(){return this.execution.debugResult}get debuggerLine(){return this.pausedFrame.pausedState?.line}get executionState(){return this.pausedFrame.pausedState}get hasExecuted(){return this.execution.hasExecuted}get isDebugging(){return this.execution.isDebugging}get isExecuting(){return this.execution.isExecuting}get isPaused(){return this.execution.isPaused}get mode(){return this.execution.mode}get openedPanel(){return this.ui.openedPanel}get outputRenderer(){if(this.execution.result)return this.execution.result.resultType==="debug"?"debugger":"legacy"}get phase(){return this.execution.phase}get result(){return this.execution.result}get runResult(){return this.execution.runResult}get sessionId(){return this.execution.sessionId}get showPanel(){return this.ui.showPanel}addConsoleLog(t){this.execution.addConsoleLog(t)}clearBreakpoints(){this.session.clearBreakpoints()}clearForMissingTestData(){this.stopDebug({hidePanel:!0}),this.execution.hasExecuted=!1,this.execution.result=void 0}closePanel(){this.ui.showPanel=!1}completeDebug(t){this.execution.mode="debug",this.execution.result={resultType:"debug",result:t},this.execution.phase="completed",this.ui.openedPanel="output",this.pausedFrame.reset(),this.resetTransientDebuggerState()}completeRun(t){this.execution.mode="run",this.execution.result={resultType:"run",result:t},this.execution.phase="completed",this.pausedFrame.reset(),this.resetTransientDebuggerState()}continueDebug(){let t=this.pausedFrame.pausedState?.continue;t&&(this.execution.phase="debug-running",this.pausedFrame.clearPausedState(),t.resolve())}disableDebugger(){this.stopDebug({hidePanel:!0}),this.clearBreakpoints()}fail(t){this.completeRun(t)}pauseDebug(t){let e=this.pausedFrame.pausedState??this.pausedFrame.lastPausedState;this.syncPausedState(e,t),this.pausedFrame.setPausedState(t),this.execution.phase="debug-paused"}reset(){this.execution.phase="idle",this.execution.mode=void 0,this.execution.result=void 0,this.execution.consoleLogs=[],this.execution.hasExecuted=!1,this.execution.sessionId=0,this.ui.openedPanel="output",this.ui.showPanel=!1,this.pausedFrame.reset(),this.session.clearBreakpoints(),this.replaceTransientDebuggerState()}resetDebug(){this.stopDebug({hidePanel:!1}),this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="debug-console"}disconnect(){this.stopDebug({hidePanel:!0})}setBreakpoints(t){this.session.setBreakpoints(t)}setPanel(t){this.execution.hasExecuted&&(this.ui.openedPanel=t,this.ui.showPanel=!0)}startDebug(){return this.execution.mode="debug",this.execution.phase="debug-running",this.execution.hasExecuted=!0,this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="debug-console",this.ui.showPanel=!0,this.execution.sessionId+=1,this.pausedFrame.reset(),this.replaceTransientDebuggerState(),this.execution.sessionId}startRun(){return this.execution.mode="run",this.execution.phase="running",this.execution.hasExecuted=!0,this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="output",this.ui.showPanel=!0,this.execution.sessionId+=1,this.pausedFrame.reset(),this.replaceTransientDebuggerState(),this.execution.sessionId}stopDebug({hidePanel:t=!0,invalidateSession:e=!0}={}){let s=this.pausedFrame.pausedState?.continue;e&&(this.execution.sessionId+=1),this.execution.phase=this.execution.hasExecuted?"completed":"idle",this.pausedFrame.reset(),this.resetTransientDebuggerState(),t&&(this.ui.showPanel=!1),this.ui.openedPanel==="debug-console"&&(this.ui.openedPanel="output"),s?.resolve()}syncPausedState(t,e){this.lazyTreeState.reset(),t&&e&&t!==e&&this.previewTabsState.invalidateAll(),this.pausedLine=e?.line}toggleBreakpoint(t){this.session.toggleBreakpoint(t)}togglePanel(t){if(this.execution.hasExecuted){if(t==null){this.ui.showPanel=!this.ui.showPanel;return}if(this.ui.openedPanel===t&&this.ui.showPanel){this.ui.showPanel=!1;return}this.setPanel(t)}}resetTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState.reset(),this.previewTabsState.clear()}replaceTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState=new w,this.previewTabsState=new M}};c([o()],g.prototype,"execution",2);c([o()],g.prototype,"lazyTreeState",2);c([o()],g.prototype,"pausedLine",2);c([o()],g.prototype,"pausedFrame",2);c([o()],g.prototype,"previewTabsState",2);c([o()],g.prototype,"session",2);c([o()],g.prototype,"ui",2);g=c([S("ArcadeDebuggerStore")],g);var Se={glyphMargin:!0,lineNumbersMinChars:1},N=class extends Q{constructor(){super(...arguments),this._codeEditorElt=V(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this._debuggerState=new g,this.messages=Y(),this._modelId=G(),this._openArcadeHelp=()=>{window.open(te,"Arcade Help")},this._decorations=void 0,this._monacoEditor=K(ee),this._editorOptions={},this._toggleSidePanel=e=>{e.currentTarget instanceof HTMLElement&&this._setOpenedSidePanel(e.currentTarget.dataset.panelName??"none")},this._closeSidePanel=()=>{this._setOpenedSidePanel("none")},this._updateBreakpointsDecorations=()=>{let e=this.editorInstance;if(!e)return;let s=this._debuggerState.breakpoints.map(i=>({range:new T(i,1,i,1),options:{isWholeLine:!0,glyphMarginClassName:"arcgis-code-editor__breakpoint-glyph"}}));this._decorations?.clear(),this._decorations=e.createDecorationsCollection(s)},this._clearDebuggerDecorations=()=>{this._decorations?.clear(),this._decorations=void 0,this._debuggerPausedLineDecoration?.clear(),this._debuggerPausedLineDecoration=void 0},this._debuggerPausedLineDecoration=void 0,this._preparingArcade=!1,this._arcadeAssistantRemoteState={shouldRender:!1},this.enableDebugger=!1,this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.arcgisDiagnosticsChange=L({bubbles:!1}),this.arcgisScriptChange=L({bubbles:!1})}static{this.properties={_apiLibrary:16,_editorProfile:16,_preparingArcade:16,_arcadeAssistantRemoteState:16,editorInstance:32,editorOptions:0,enableDebugger:5,hideDocumentationActions:5,hideSideBar:5,messageOverrides:0,openedSidePanel:3,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0,customPanels:0,arcadeAssistant:0}}static{this.styles=[ce]}get _usesBottomExecutionDrawer(){return this.enableDebugger&&!!this.testData}get editorInstance(){return this._codeEditorElt.value?.editorInstance}get editorOptions(){return{...Se,...this._editorOptions}}set editorOptions(e){this._editorOptions=e??{}}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let s=this._codeEditorElt.value?.value,i=await B(e.definition,s,this.testData,{mode:"run"});return y(i)?i:{type:"error",value:"Unexpected debug result",error:null}}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=X("./assets");se(e),await this._updateDataModelDeps(),await this._updateArcadeAssistantRemoteState(),this.manager.onLifecycle(()=>(this.hasUpdated&&this._connectMonacoCustomizations().catch(u(this)),()=>{for(;this._disposables.length;)this._disposables.pop()?.dispose();this._connectMonacoCustomizationsPromise=void 0,this._executeScriptAction=void 0,this._clearDebuggerDecorations(),this._debuggerState.disconnect()}))}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("enableDebugger")&&!this.enableDebugger&&this._debuggerState.disableDebugger(),e.has("snippets")&&P.updateApiContextForModel(this._modelId,{snippets:this.snippets}),e.has("arcadeAssistant")&&this._updateArcadeAssistantRemoteState()}async loaded(){this._componentReadyDefer.resolve(),await this._updateApiLibrary(),await this._connectMonacoCustomizations(),await this._codeEditorElt.value?.setFocus()}_setOpenedSidePanel(e){this.openedSidePanel=e===this.openedSidePanel?"none":e}async _connectMonacoCustomizations(){if(this._disposables.length||this._connectMonacoCustomizationsPromise)return await this._connectMonacoCustomizationsPromise;this._connectMonacoCustomizationsPromise=(async()=>{if(await this.updateComplete,!this.isConnected||this._disposables.length)return;let e=await ie();if(!this.isConnected||this._disposables.length)return;this._disposables.push(e.onDiagnosticsChange(d=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(d.diagnostics))),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction();let s=F(()=>this._debuggerState.breakpoints,()=>this._updateBreakpointsDecorations(),{sync:!0}),i=F(()=>this._debuggerState.debuggerLine,()=>this._updateDebuggerPausedLineDecoration(),{sync:!0}),a=F(()=>this._debuggerState.consoleLogs.length,()=>this.requestUpdate(),{sync:!0});this._disposables.push({dispose:()=>s.remove()},{dispose:()=>i.remove()},{dispose:()=>a.remove()});let r=this.editorInstance?.onMouseDown(d=>this._onEditorMouseDown(d));r&&this._disposables.push(r);let n=this.editorInstance?.onDidChangeModelContent(d=>this._onEditorModelContentChange(d));n&&this._disposables.push(n),this._updateBreakpointsDecorations(),this._updateDebuggerPausedLineDecoration()})();try{await this._connectMonacoCustomizationsPromise}finally{this._connectMonacoCustomizationsPromise=void 0}}_onEditorMouseDown(e){if(!this.enableDebugger||![this._monacoEditor.MouseTargetType.GUTTER_GLYPH_MARGIN,this._monacoEditor.MouseTargetType.GUTTER_LINE_NUMBERS,this._monacoEditor.MouseTargetType.GUTTER_LINE_DECORATIONS].includes(e.target.type))return;let s=e.target.position?.lineNumber;s&&this._debuggerState.toggleBreakpoint(s)}_onEditorModelContentChange(e){if(!this.enableDebugger||!this._debuggerState.breakpoints.length||e.isFlush)return;let s=J(this._debuggerState.breakpoints,e.changes);s.length===this._debuggerState.breakpoints.length&&s.every((i,a)=>i===this._debuggerState.breakpoints[a])||this._debuggerState.setBreakpoints(s)}_updateDebuggerPausedLineDecoration(){let e=this.editorInstance;if(!e)return;this._debuggerPausedLineDecoration?.clear();let s=this._debuggerState.debuggerLine;s!=null?this._debuggerPausedLineDecoration=e.createDecorationsCollection([{range:new T(s,1,s,1),options:{isWholeLine:!0,className:"arcgis-code-editor__debugger-paused-line",glyphMarginClassName:"arcgis-code-editor__debugger-paused-glyph",marginClassName:"arcgis-code-editor__debugger-paused-line arcgis-code-editor__debugger-paused-margin"}}]):this._debuggerPausedLineDecoration=void 0}_continueDebugSession(){this._debuggerState.continueDebug()}_stopDebugSession({hideExecutionPanel:e=!0}={}){this._debuggerState.stopDebug({hidePanel:e})}_resetDebugSession(){this._debuggerState.resetDebug(),this._executeScript("debug").catch(u(this))}async _handleDebugPause(e,s,i){if(!this._debuggerState.isDebugging||e!==this._debuggerState.sessionId)return;let a=Promise.withResolvers();return this._debuggerState.pauseDebug({line:s.line,result:i,continue:a}),await a.promise}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_testDataChanged(){!this.testData&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),!this.testData&&this.enableDebugger&&this._debuggerState.clearForMissingTestData(),this._debuggerState.showPanel&&this._executeScript("run").catch(u(this))}async _updateEditorProfile(){this._preparingArcade=!0;try{await P.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=P.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await P.getApiLibraryForModel(this._modelId)}_setExecutionPanel(e){this._debuggerState.togglePanel(e)}async _executeScript(e){let s=this.testData;if(!this._codeEditorElt.value||!s)return;let i=e==="debug"?this._debuggerState.startDebug():this._debuggerState.startRun(),a=await this._editorProfilePromise;if(!a){this._debuggerState.fail({type:"error",value:"Missing editor profile",error:null});return}setTimeout(()=>{(async()=>{let r=this._codeEditorElt.value?.value,n={mode:e,console:f=>this._debuggerState.addConsoleLog(f),breakpoints:e==="debug"?this._debuggerState.debuggerBreakpoints:void 0};e==="debug"&&(n.onDebugPause=this._handleDebugPause.bind(this,i));let d=await B(a.definition,r,s,n);if(i===this._debuggerState.sessionId){if(e==="debug"){if(y(d)){this._debuggerState.fail(d);return}this._debuggerState.completeDebug(d);return}y(d)?this._debuggerState.completeRun(d):this._debuggerState.fail({type:"error",value:"Unexpected debug result",error:null})}})()},0)}_toggleShowExecutionPanel(){this._debuggerState.togglePanel()}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(u(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(u(this))}_onResultPanelChange(e){let s=e.currentTarget;this._debuggerState.setPanel(s.openedResultPanel)}_onExecutionPanelClose(){this._debuggerState.closePanel()}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[Z.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript("run").catch(u(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let s=this._disposables.indexOf(e);s!==-1&&this._disposables.splice(s,1),e.dispose()}async _updateArcadeAssistantRemoteState(){this.arcadeAssistant&&(this._arcadeAssistantRemoteState=await ge({...this.arcadeAssistant,profile:this.profile}))}renderMainActionBar(){return this.enableDebugger||!this.testData?null:l`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled slot=top-action-bar><calcite-action-group scale=s><calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${()=>{this._executeScript("run").catch(u(this))}}></calcite-action>${this._debuggerState.result?l`<calcite-action .text=${this.messages.lastresults??""} .active=${this._debuggerState.showPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>`:null}</calcite-action-group></calcite-action-bar>`}renderMainPanel(){return l`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${P.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${H(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:s,icon:i,active:a,panelName:r,iconFlipRtl:n=!1,onClick:d=this._toggleSidePanel}){return l`<calcite-action id=${e??I} .text=${s} .textEnabled=${this.sideActionBarExpanded} .icon=${i} .active=${a} @click=${d} data-panel-name=${r??I} .iconFlipRtl=${n}></calcite-action>${!this.sideActionBarExpanded&&l`<calcite-tooltip .referenceElement=${e}><span>${s}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:l`<calcite-action-bar slot=side-action-bar class="side-action-bar" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this._arcadeAssistantRemoteState.shouldRender&&this.renderAction({id:"arcade-assistant-action",label:this.messages.arcadeassistant??"Arcade assistant",icon:"effects",active:this.openedSidePanel==="arcade-assistant",panelName:"arcade-assistant"})||""}${this.customPanels?.map(e=>e.enabled===!1?null:this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;let{openedSidePanel:e}=this;return l`<arcgis-language-api-panel slot=side-panel class=${x(e==="api"?"":"hidden")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .closed=${e!=="api"}></arcgis-language-api-panel><arcgis-editor-variables slot=side-panel class=${x(e==="variables"?"":"hidden")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e!=="variables"} .messageOverrides=${{profileempty:this.messages.profileempty}}></arcgis-editor-variables>${this.suggestions?.length&&l`<arcgis-arcade-suggestions slot=side-panel class=${x(e==="suggestions"?"":"hidden")} .closed=${e!=="suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`||""}${this.arcadeAssistant&&this._arcadeAssistantRemoteState.shouldRender&&l`<arcgis-arcade-coding-assistant slot=side-panel class=${x(e==="arcade-assistant"?"":"hidden")} .closed=${e!=="arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._closeSidePanel} .portalUrl=${this.arcadeAssistant.portalUrl} .serviceUrl=${"serviceUrl"in this._arcadeAssistantRemoteState?this._arcadeAssistantRemoteState.serviceUrl:void 0} .helpBase=${this._arcadeAssistantRemoteState.helpBase} .assistantsEnabled=${this._arcadeAssistantRemoteState.assistantsEnabled} .feedbackServiceUrl=${this._arcadeAssistantRemoteState.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant.disableQuestionAnswerLogging}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(s=>l`<calcite-flow slot=side-panel class=${x(e===s.id?"":"hidden")}>${s?.useFlows?s.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==s.id,editorRef:this.el}):l`<calcite-flow-item .heading=${s.name} heading-level=2 closable .closed=${e!==s.id} @calciteFlowItemClose=${this._toggleSidePanel} .description=${s.description}>${s.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==s.id,editorRef:this.el})}</calcite-flow-item>`}</calcite-flow>`)}`}renderResultsPanel(){if(this._usesBottomExecutionDrawer)return this.renderBottomExecutionBody();if(!this._debuggerState.showPanel)return null;let e=this._debuggerState.openedPanel==="debug-console"?"output":this._debuggerState.openedPanel;return l`<arcgis-arcade-results slot=results-panel .openedResultPanel=${e} .loading=${this._debuggerState.isExecuting} .result=${this._debuggerState.runResult} .consoleLogs=${this._debuggerState.consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>`}renderBottomExecutionBody(){let{showPanel:e,openedPanel:s,debugResult:i,isExecuting:a,mode:r}=this._debuggerState;return e?s==="debug-console"?l`<arcgis-arcade-debugger-console slot=results-panel .modelId=${this._modelId} .debuggerStore=${this._debuggerState}></arcgis-arcade-debugger-console>`:s==="output"&&r==="debug"?l`<arcgis-arcade-debugger-output slot=results-panel .debuggerStore=${this._debuggerState} .result=${i}></arcgis-arcade-debugger-output>`:l`<arcgis-arcade-results slot=results-panel class="bottom-results" .openedResultPanel=${s} .loading=${s==="console"&&this._debuggerState.isPaused?!1:a} .result=${this._debuggerState.runResult} .consoleLogs=${this._debuggerState.consoleLogs} hide-header @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange}></arcgis-arcade-results>`:null}renderBottomActionBar(){if(!this._usesBottomExecutionDrawer)return null;let{showPanel:e,hasExecuted:s,openedPanel:i,isDebugging:a,isPaused:r,isExecuting:n}=this._debuggerState;return l`<calcite-action-bar slot=bottom-action-bar class=${`main-action-bar bottom-action-bar ${e?"":"is-collapsed"}`} layout=horizontal scale=s expand-disabled><calcite-action-group scale=s>${a?l`<calcite-action .text=${this.messages.continue??"Continue"} icon=forward scale=s .disabled=${!r} @click=${this._continueDebugSession}></calcite-action><calcite-action .text=${this.messages.reset??"Reset"} icon=reset scale=s @click=${this._resetDebugSession}></calcite-action><calcite-action .text=${this.messages.stop??"Stop"} icon=circle-stop scale=s @click=${()=>this._stopDebugSession()}></calcite-action>`:l`<calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade||n} @click=${()=>{this._executeScript("run").catch(u(this))}}></calcite-action><calcite-action .text=${this.messages.runanddebug??"Run and Debug"} text-enabled icon=debug-script scale=s .loading=${this._preparingArcade||n} @click=${()=>{this._executeScript("debug").catch(u(this))}}></calcite-action>`}</calcite-action-group>${s?l`<calcite-action-group scale=s><calcite-action .active=${i==="output"&&e} .text=${this.messages.output??"Output"} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${()=>this._setExecutionPanel("output")}></calcite-action><calcite-action .active=${i==="console"&&e} .text=${this.messages.console??"Console"} text-enabled scale=s icon=console icon-flip-rtl @click=${()=>this._setExecutionPanel("console")}></calcite-action><calcite-action .active=${i==="log"&&e} .text=${this.messages.log??"Log"} text-enabled scale=s icon=list icon-flip-rtl @click=${()=>this._setExecutionPanel("log")}></calcite-action><calcite-action .active=${i==="debug-console"&&e} .text=${this.messages.debugconsole??"Debug Console"} text-enabled scale=s icon=debug-script icon-flip-rtl .disabled=${this._debuggerState.mode!=="debug"} @click=${()=>this._setExecutionPanel("debug-console")}></calcite-action></calcite-action-group>`:null}${e?l`<calcite-action-group scale=s><calcite-action .text=${this.messages.close??"Close"} scale=s icon=x icon-flip-rtl @click=${this._onExecutionPanelClose}></calcite-action></calcite-action-group>`:null}</calcite-action-bar>`}render(){return l`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderBottomActionBar()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`}};W("arcgis-arcade-editor",N);return N},"identity/IdentityManager","core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,b,c,d,e,f)
2
+ import f from"./NOHSS7JG.js";import e from"./GPIFJKPY.js";import d from"./GZ6HZKQZ.js";import c from"./ZHZFKZA7.js";import{e as J}from"./P7I5ATMN.js";import b from"./4B64NBIM.js";import"./G56LJGLK.js";import{a as ee}from"./ER2MKLVA.js";import"./IFNCCZ7O.js";import a from"./GLJQQLP2.js";import{a as Y}from"./SB3MM5EM.js";import{a as K}from"./KCU2C44H.js";import"./GS2ISVXJ.js";import"./6G5URSC7.js";import"./6C52UOYL.js";import{E as V,F as H,G as Q,H as x,K as W,L as X,h as j,j as l,l as I,n as L,t as G}from"./REL6OK2I.js";import{a as q,b as u}from"./Y3KOWWO5.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import{Rk as Z,Uk as T}from"./LLPQEURF.js";import"./3TTFCHAA.js";export default $arcgis.t(([ne,{watch:F},m,{property:o,subclass:S},{a:te,h:y,i:B},{b:M},,,P,{a:se,b:ie}])=>{var ce=j`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.bottom-action-bar.is-collapsed{border-bottom:0}`,ae="https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0",p=(t,e)=>q(t,"Arcade Assistant",e),le=t=>{let{aiAssistantsEnabled:e}=t;return e===void 0?(p("warn","`areAiAssistantsEnabled` is not defined in the organizations settings."),!1):e},de=t=>!(!t||!("id"in t)),ue=async t=>(await ne.getCredential(t,{oAuthPopupConfirmation:!1})).token,he=async t=>{try{return!!await ne.checkSignInStatus(t)}catch{return p("warn","User is not signed in."),!1}};async function ge({portalUrl:t,profile:e}){if(!de(e))return p("warn","Addon initialization failed. Reason: unsupported profile."),{shouldRender:!1};let s=t.replace(/\/sharing\/rest(\/.*)?$/iu,"").replace(/\/$/u,"");if(!await he(s))return{shouldRender:!1};let i=await ue(t),a=`${s}/sharing/rest/portals/self?f=json&token=${i}`,r=`${s}/sharing/rest/portals/self/settings?f=json&token=${i}`,n=`${s}/sharing/rest/portals/self/signinSettings?f=json&token=${i}`,d=await Promise.allSettled([fetch(a,{credentials:"include"}).then($=>$.json()),fetch(r,{credentials:"include"}).then($=>$.json()),fetch(n,{credentials:"include"}).then($=>$.json())]),[f,C,R]=d,A=f.status==="fulfilled"?f.value:(p("warn",`Failed to fetch selfUrl. Reason: ${f.reason}.`),{}),O=C.status==="fulfilled"?C.value:(p("warn",`Failed to fetch settingsUrl. Reason: ${C.reason}.`),{}),re=R.status==="fulfilled"?R.value:(p("warn",`Failed to fetch signinSettingsUrl. Reason: ${R.reason}.`),{});if(A.isPortal)return{shouldRender:!1};let U=A.helpBase||"";if(!O)return p("warn","Settings response is not available."),{shouldRender:!1};let k=le(O);re.blockBetaApps===!0&&(p("warn","Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."),k=!1),A?.user?.privileges?.includes("portal:user:useAIAssistants")||(p("warn","User does not have the required privileges to use AI Assistants."),k=!1);let z=A?.helperServices?.aiAssistantServices?.url;return z?{shouldRender:!0,serviceUrl:z,helpBase:U,assistantsEnabled:k,feedbackServiceUrl:ae}:{shouldRender:!0,assistantsEnabled:!1,helpBase:U,feedbackServiceUrl:ae}}var pe=Object.defineProperty,be=Object.getOwnPropertyDescriptor,_=(t,e,s,i)=>{for(var a=i>1?void 0:i?be(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(a=(i?n(e,s,a):n(a))||a);return i&&a&&pe(e,s,a),a},oe=100,h=class extends m{constructor(t){super(t),this.collectionItems=[],this.errorMessage="",this.expanded=!1,this.requestId=0,this.status="idle",this.visibleChildCount=oe}};_([o()],h.prototype,"collectionItems",2);_([o()],h.prototype,"errorMessage",2);_([o()],h.prototype,"expanded",2);_([o()],h.prototype,"requestId",2);_([o()],h.prototype,"schemaValue",2);_([o()],h.prototype,"status",2);_([o()],h.prototype,"visibleChildCount",2);h=_([S("ArcadeDebuggerLazyTreeNodeState")],h);var w=class extends m{constructor(t){super(t),this.generation=0,this.nodes=new Map}reset(){this.generation+=1,this.destroyNodes()}ensureNode(t,e=!1,s){let i=this.nodes.get(t);if(i)return i;let a=new h;return a.expanded=e,this.nodes.set(t,a),e&&s&&this.loadNode(t,s),a}setExpanded(t,e,s){let i=this.ensureNode(t,e,s);if(i.expanded===e){e&&s&&this.loadNode(t,s);return}i.expanded=e,e&&s&&this.loadNode(t,s)}showMore(t,e){let s=this.ensureNode(t);s.visibleChildCount>=e||(s.visibleChildCount=Math.min(e,s.visibleChildCount+oe))}loadNode(t,e){switch(e.kind){case"collection":this.runLoad(t,e.load,(s,i)=>{s.collectionItems=i});return;case"schema":this.runLoad(t,e.load,(s,i)=>{s.schemaValue=i});return}}runLoad(t,e,s){let i=this.nodes.get(t);if(!i||i.status==="loading"||i.status==="loaded")return;let a=this.generation,r=i.requestId+1;i.requestId=r,i.status="loading",i.errorMessage="",i.schemaValue=void 0,i.collectionItems=[],e().then(n=>{let d=this.nodes.get(t);!d||this.generation!==a||d.requestId!==r||(s(d,n),d.status="loaded")}).catch(()=>{let n=this.nodes.get(t);!n||this.generation!==a||n.requestId!==r||(n.status="error")})}destroyNodes(){for(let t of this.nodes.values())t.destroy();this.nodes.clear()}};w=_([S("ArcadeDebuggerLazyTreeState")],w);var _e=Object.defineProperty,me=Object.getOwnPropertyDescriptor,c=(t,e,s,i)=>{for(var a=i>1?void 0:i?me(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(a=(i?n(e,s,a):n(a))||a);return i&&a&&_e(e,s,a),a},b=class extends m{constructor(t){super(t),this.phase="idle",this.sessionId=0,this.consoleLogs=[],this.hasExecuted=!1}get isExecuting(){return this.phase==="running"||this.phase==="debug-running"||this.phase==="debug-paused"}get isDebugging(){return this.phase==="debug-running"||this.phase==="debug-paused"}get isPaused(){return this.phase==="debug-paused"}get runResult(){return this.result?.resultType==="run"?this.result.result:void 0}get debugResult(){return this.result?.resultType==="debug"?this.result.result:void 0}addConsoleLog(t){this.consoleLogs=[...this.consoleLogs,t]}};c([o()],b.prototype,"phase",2);c([o()],b.prototype,"mode",2);c([o()],b.prototype,"sessionId",2);c([o()],b.prototype,"result",2);c([o()],b.prototype,"consoleLogs",2);c([o()],b.prototype,"hasExecuted",2);b=c([S("ArcadeDebuggerExecutionModel")],b);var E=class extends m{constructor(t){super(t),this.breakpoints=[]}setBreakpoints(t){this.breakpoints=Array.from(new Set(t)).sort((e,s)=>e-s)}toggleBreakpoint(t){let e=new Set(this.breakpoints);e.has(t)?e.delete(t):e.add(t),this.setBreakpoints(e)}clearBreakpoints(){this.breakpoints=[]}};c([o()],E.prototype,"breakpoints",2);E=c([S("ArcadeDebuggerSessionModel")],E);var v=class extends m{constructor(t){super(t),this.openedPanel="output",this.showPanel=!1}};c([o()],v.prototype,"openedPanel",2);c([o()],v.prototype,"showPanel",2);v=c([S("ArcadeDebuggerUiModel")],v);var D=class extends m{constructor(t){super(t)}get line(){return this.pausedState?.line}clearPausedState(){this.lastPausedState=this.pausedState,this.pausedState=void 0}reset(){this.pausedState=void 0,this.lastPausedState=void 0}setPausedState(t){this.pausedState=t,this.lastPausedState=t}};c([o()],D.prototype,"pausedState",2);c([o()],D.prototype,"lastPausedState",2);D=c([S("ArcadeDebuggerPausedFrameModel")],D);var g=class extends m{constructor(t){super(t),this.execution=new b,this.lazyTreeState=new w,this.pausedFrame=new D,this.previewTabsState=new M,this.session=new E,this.ui=new v}get breakpoints(){return this.session.breakpoints}get debuggerBreakpoints(){return this.session.breakpoints.map(t=>({line:t}))}get consoleLogs(){return this.execution.consoleLogs}get debug(){if(!(!this.pausedFrame.pausedState&&!this.pausedFrame.lastPausedState))return{pausedState:this.pausedFrame.pausedState,lastPausedState:this.pausedFrame.lastPausedState}}get debugResult(){return this.execution.debugResult}get debuggerLine(){return this.pausedFrame.pausedState?.line}get executionState(){return this.pausedFrame.pausedState}get hasExecuted(){return this.execution.hasExecuted}get isDebugging(){return this.execution.isDebugging}get isExecuting(){return this.execution.isExecuting}get isPaused(){return this.execution.isPaused}get mode(){return this.execution.mode}get openedPanel(){return this.ui.openedPanel}get outputRenderer(){if(this.execution.result)return this.execution.result.resultType==="debug"?"debugger":"legacy"}get phase(){return this.execution.phase}get result(){return this.execution.result}get runResult(){return this.execution.runResult}get sessionId(){return this.execution.sessionId}get showPanel(){return this.ui.showPanel}addConsoleLog(t){this.execution.addConsoleLog(t)}clearBreakpoints(){this.session.clearBreakpoints()}clearForMissingTestData(){this.stopDebug({hidePanel:!0}),this.execution.hasExecuted=!1,this.execution.result=void 0}closePanel(){this.ui.showPanel=!1}completeDebug(t){this.execution.mode="debug",this.execution.result={resultType:"debug",result:t},this.execution.phase="completed",this.ui.openedPanel="output",this.pausedFrame.reset(),this.resetTransientDebuggerState()}completeRun(t){this.execution.mode="run",this.execution.result={resultType:"run",result:t},this.execution.phase="completed",this.pausedFrame.reset(),this.resetTransientDebuggerState()}continueDebug(){let t=this.pausedFrame.pausedState?.continue;t&&(this.execution.phase="debug-running",this.pausedFrame.clearPausedState(),t.resolve())}disableDebugger(){this.stopDebug({hidePanel:!0}),this.clearBreakpoints()}fail(t){this.completeRun(t)}pauseDebug(t){let e=this.pausedFrame.pausedState??this.pausedFrame.lastPausedState;this.syncPausedState(e,t),this.pausedFrame.setPausedState(t),this.execution.phase="debug-paused"}reset(){this.execution.phase="idle",this.execution.mode=void 0,this.execution.result=void 0,this.execution.consoleLogs=[],this.execution.hasExecuted=!1,this.execution.sessionId=0,this.ui.openedPanel="output",this.ui.showPanel=!1,this.pausedFrame.reset(),this.session.clearBreakpoints(),this.replaceTransientDebuggerState()}resetDebug(){this.stopDebug({hidePanel:!1}),this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="debug-console"}disconnect(){this.stopDebug({hidePanel:!0})}setBreakpoints(t){this.session.setBreakpoints(t)}setPanel(t){this.execution.hasExecuted&&(this.ui.openedPanel=t,this.ui.showPanel=!0)}startDebug(){return this.execution.mode="debug",this.execution.phase="debug-running",this.execution.hasExecuted=!0,this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="debug-console",this.ui.showPanel=!0,this.execution.sessionId+=1,this.pausedFrame.reset(),this.replaceTransientDebuggerState(),this.execution.sessionId}startRun(){return this.execution.mode="run",this.execution.phase="running",this.execution.hasExecuted=!0,this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="output",this.ui.showPanel=!0,this.execution.sessionId+=1,this.pausedFrame.reset(),this.replaceTransientDebuggerState(),this.execution.sessionId}stopDebug({hidePanel:t=!0,invalidateSession:e=!0}={}){let s=this.pausedFrame.pausedState?.continue;e&&(this.execution.sessionId+=1),this.execution.phase=this.execution.hasExecuted?"completed":"idle",this.pausedFrame.reset(),this.resetTransientDebuggerState(),t&&(this.ui.showPanel=!1),this.ui.openedPanel==="debug-console"&&(this.ui.openedPanel="output"),s?.resolve()}syncPausedState(t,e){this.lazyTreeState.reset(),t&&e&&t!==e&&this.previewTabsState.invalidateAll(),this.pausedLine=e?.line}toggleBreakpoint(t){this.session.toggleBreakpoint(t)}togglePanel(t){if(this.execution.hasExecuted){if(t==null){this.ui.showPanel=!this.ui.showPanel;return}if(this.ui.openedPanel===t&&this.ui.showPanel){this.ui.showPanel=!1;return}this.setPanel(t)}}resetTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState.reset(),this.previewTabsState.clear()}replaceTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState=new w,this.previewTabsState=new M}};c([o()],g.prototype,"execution",2);c([o()],g.prototype,"lazyTreeState",2);c([o()],g.prototype,"pausedLine",2);c([o()],g.prototype,"pausedFrame",2);c([o()],g.prototype,"previewTabsState",2);c([o()],g.prototype,"session",2);c([o()],g.prototype,"ui",2);g=c([S("ArcadeDebuggerStore")],g);var Se={glyphMargin:!0,lineNumbersMinChars:1},N=class extends Q{constructor(){super(...arguments),this._codeEditorElt=V(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this._debuggerState=new g,this.messages=Y(),this._modelId=G(),this._openArcadeHelp=()=>{window.open(te,"Arcade Help")},this._decorations=void 0,this._monacoEditor=K(ee),this._editorOptions={},this._toggleSidePanel=e=>{e.currentTarget instanceof HTMLElement&&this._setOpenedSidePanel(e.currentTarget.dataset.panelName??"none")},this._closeSidePanel=()=>{this._setOpenedSidePanel("none")},this._updateBreakpointsDecorations=()=>{let e=this.editorInstance;if(!e)return;let s=this._debuggerState.breakpoints.map(i=>({range:new T(i,1,i,1),options:{isWholeLine:!0,glyphMarginClassName:"arcgis-code-editor__breakpoint-glyph"}}));this._decorations?.clear(),this._decorations=e.createDecorationsCollection(s)},this._clearDebuggerDecorations=()=>{this._decorations?.clear(),this._decorations=void 0,this._debuggerPausedLineDecoration?.clear(),this._debuggerPausedLineDecoration=void 0},this._debuggerPausedLineDecoration=void 0,this._preparingArcade=!1,this._arcadeAssistantRemoteState={shouldRender:!1},this.enableDebugger=!1,this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.arcgisDiagnosticsChange=L({bubbles:!1}),this.arcgisScriptChange=L({bubbles:!1})}static{this.properties={_apiLibrary:16,_editorProfile:16,_preparingArcade:16,_arcadeAssistantRemoteState:16,editorInstance:32,editorOptions:0,enableDebugger:5,hideDocumentationActions:5,hideSideBar:5,messageOverrides:0,openedSidePanel:3,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0,customPanels:0,arcadeAssistant:0}}static{this.styles=[ce]}get _usesBottomExecutionDrawer(){return this.enableDebugger&&!!this.testData}get editorInstance(){return this._codeEditorElt.value?.editorInstance}get editorOptions(){return{...Se,...this._editorOptions}}set editorOptions(e){this._editorOptions=e??{}}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let s=this._codeEditorElt.value?.value,i=await B(e.definition,s,this.testData,{mode:"run"});return y(i)?i:{type:"error",value:"Unexpected debug result",error:null}}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=X("./assets");se(e),await this._updateDataModelDeps(),await this._updateArcadeAssistantRemoteState(),this.manager.onLifecycle(()=>(this.hasUpdated&&this._connectMonacoCustomizations().catch(u(this)),()=>{for(;this._disposables.length;)this._disposables.pop()?.dispose();this._connectMonacoCustomizationsPromise=void 0,this._executeScriptAction=void 0,this._clearDebuggerDecorations(),this._debuggerState.disconnect()}))}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("enableDebugger")&&!this.enableDebugger&&this._debuggerState.disableDebugger(),e.has("snippets")&&P.updateApiContextForModel(this._modelId,{snippets:this.snippets}),e.has("arcadeAssistant")&&this._updateArcadeAssistantRemoteState()}async loaded(){this._componentReadyDefer.resolve(),await this._updateApiLibrary(),await this._connectMonacoCustomizations(),await this._codeEditorElt.value?.setFocus()}_setOpenedSidePanel(e){this.openedSidePanel=e===this.openedSidePanel?"none":e}async _connectMonacoCustomizations(){if(this._disposables.length||this._connectMonacoCustomizationsPromise)return await this._connectMonacoCustomizationsPromise;this._connectMonacoCustomizationsPromise=(async()=>{if(await this.updateComplete,!this.isConnected||this._disposables.length)return;let e=await ie();if(!this.isConnected||this._disposables.length)return;this._disposables.push(e.onDiagnosticsChange(d=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(d.diagnostics))),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction();let s=F(()=>this._debuggerState.breakpoints,()=>this._updateBreakpointsDecorations(),{sync:!0}),i=F(()=>this._debuggerState.debuggerLine,()=>this._updateDebuggerPausedLineDecoration(),{sync:!0}),a=F(()=>this._debuggerState.consoleLogs.length,()=>this.requestUpdate(),{sync:!0});this._disposables.push({dispose:()=>s.remove()},{dispose:()=>i.remove()},{dispose:()=>a.remove()});let r=this.editorInstance?.onMouseDown(d=>this._onEditorMouseDown(d));r&&this._disposables.push(r);let n=this.editorInstance?.onDidChangeModelContent(d=>this._onEditorModelContentChange(d));n&&this._disposables.push(n),this._updateBreakpointsDecorations(),this._updateDebuggerPausedLineDecoration()})();try{await this._connectMonacoCustomizationsPromise}finally{this._connectMonacoCustomizationsPromise=void 0}}_onEditorMouseDown(e){if(!this.enableDebugger||![this._monacoEditor.MouseTargetType.GUTTER_GLYPH_MARGIN,this._monacoEditor.MouseTargetType.GUTTER_LINE_NUMBERS,this._monacoEditor.MouseTargetType.GUTTER_LINE_DECORATIONS].includes(e.target.type))return;let s=e.target.position?.lineNumber;s&&this._debuggerState.toggleBreakpoint(s)}_onEditorModelContentChange(e){if(!this.enableDebugger||!this._debuggerState.breakpoints.length||e.isFlush)return;let s=J(this._debuggerState.breakpoints,e.changes);s.length===this._debuggerState.breakpoints.length&&s.every((i,a)=>i===this._debuggerState.breakpoints[a])||this._debuggerState.setBreakpoints(s)}_updateDebuggerPausedLineDecoration(){let e=this.editorInstance;if(!e)return;this._debuggerPausedLineDecoration?.clear();let s=this._debuggerState.debuggerLine;s!=null?this._debuggerPausedLineDecoration=e.createDecorationsCollection([{range:new T(s,1,s,1),options:{isWholeLine:!0,className:"arcgis-code-editor__debugger-paused-line",glyphMarginClassName:"arcgis-code-editor__debugger-paused-glyph",marginClassName:"arcgis-code-editor__debugger-paused-line arcgis-code-editor__debugger-paused-margin"}}]):this._debuggerPausedLineDecoration=void 0}_continueDebugSession(){this._debuggerState.continueDebug()}_stopDebugSession({hideExecutionPanel:e=!0}={}){this._debuggerState.stopDebug({hidePanel:e})}_resetDebugSession(){this._debuggerState.resetDebug(),this._executeScript("debug").catch(u(this))}async _handleDebugPause(e,s,i){if(!this._debuggerState.isDebugging||e!==this._debuggerState.sessionId)return;let a=Promise.withResolvers();return this._debuggerState.pauseDebug({line:s.line,result:i,continue:a}),await a.promise}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_testDataChanged(){!this.testData&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),!this.testData&&this.enableDebugger&&this._debuggerState.clearForMissingTestData(),this._debuggerState.showPanel&&this._executeScript("run").catch(u(this))}async _updateEditorProfile(){this._preparingArcade=!0;try{await P.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=P.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await P.getApiLibraryForModel(this._modelId)}_setExecutionPanel(e){this._debuggerState.togglePanel(e)}async _executeScript(e){let s=this.testData;if(!this._codeEditorElt.value||!s)return;let i=e==="debug"?this._debuggerState.startDebug():this._debuggerState.startRun(),a=await this._editorProfilePromise;if(!a){this._debuggerState.fail({type:"error",value:"Missing editor profile",error:null});return}setTimeout(()=>{(async()=>{let r=this._codeEditorElt.value?.value,n={mode:e,console:f=>this._debuggerState.addConsoleLog(f),breakpoints:e==="debug"?this._debuggerState.debuggerBreakpoints:void 0};e==="debug"&&(n.onDebugPause=this._handleDebugPause.bind(this,i));let d=await B(a.definition,r,s,n);if(i===this._debuggerState.sessionId){if(e==="debug"){if(y(d)){this._debuggerState.fail(d);return}this._debuggerState.completeDebug(d);return}y(d)?this._debuggerState.completeRun(d):this._debuggerState.fail({type:"error",value:"Unexpected debug result",error:null})}})()},0)}_toggleShowExecutionPanel(){this._debuggerState.togglePanel()}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(u(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(u(this))}_onResultPanelChange(e){let s=e.currentTarget;this._debuggerState.setPanel(s.openedResultPanel)}_onExecutionPanelClose(){this._debuggerState.closePanel()}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[Z.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript("run").catch(u(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let s=this._disposables.indexOf(e);s!==-1&&this._disposables.splice(s,1),e.dispose()}async _updateArcadeAssistantRemoteState(){this.arcadeAssistant&&(this._arcadeAssistantRemoteState=await ge({...this.arcadeAssistant,profile:this.profile}))}renderMainActionBar(){return this.enableDebugger||!this.testData?null:l`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled slot=top-action-bar><calcite-action-group scale=s><calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${()=>{this._executeScript("run").catch(u(this))}}></calcite-action>${this._debuggerState.result?l`<calcite-action .text=${this.messages.lastresults??""} .active=${this._debuggerState.showPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>`:null}</calcite-action-group></calcite-action-bar>`}renderMainPanel(){return l`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${P.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${H(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:s,icon:i,active:a,panelName:r,iconFlipRtl:n=!1,onClick:d=this._toggleSidePanel}){return l`<calcite-action id=${e??I} .text=${s} .textEnabled=${this.sideActionBarExpanded} .icon=${i} .active=${a} @click=${d} data-panel-name=${r??I} .iconFlipRtl=${n}></calcite-action>${!this.sideActionBarExpanded&&l`<calcite-tooltip .referenceElement=${e}><span>${s}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:l`<calcite-action-bar slot=side-action-bar class="side-action-bar" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this._arcadeAssistantRemoteState.shouldRender&&this.renderAction({id:"arcade-assistant-action",label:this.messages.arcadeassistant??"Arcade assistant",icon:"effects",active:this.openedSidePanel==="arcade-assistant",panelName:"arcade-assistant"})||""}${this.customPanels?.map(e=>e.enabled===!1?null:this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;let{openedSidePanel:e}=this;return l`<arcgis-language-api-panel slot=side-panel class=${x(e==="api"?"":"hidden")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .closed=${e!=="api"}></arcgis-language-api-panel><arcgis-editor-variables slot=side-panel class=${x(e==="variables"?"":"hidden")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e!=="variables"} .messageOverrides=${{profileempty:this.messages.profileempty}}></arcgis-editor-variables>${this.suggestions?.length&&l`<arcgis-arcade-suggestions slot=side-panel class=${x(e==="suggestions"?"":"hidden")} .closed=${e!=="suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`||""}${this.arcadeAssistant&&this._arcadeAssistantRemoteState.shouldRender&&l`<arcgis-arcade-coding-assistant slot=side-panel class=${x(e==="arcade-assistant"?"":"hidden")} .closed=${e!=="arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._closeSidePanel} .portalUrl=${this.arcadeAssistant.portalUrl} .serviceUrl=${"serviceUrl"in this._arcadeAssistantRemoteState?this._arcadeAssistantRemoteState.serviceUrl:void 0} .helpBase=${this._arcadeAssistantRemoteState.helpBase} .assistantsEnabled=${this._arcadeAssistantRemoteState.assistantsEnabled} .feedbackServiceUrl=${this._arcadeAssistantRemoteState.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant.disableQuestionAnswerLogging}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(s=>l`<calcite-flow slot=side-panel class=${x(e===s.id?"":"hidden")}>${s?.useFlows?s.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==s.id,editorRef:this.el}):l`<calcite-flow-item .heading=${s.name} heading-level=2 closable .closed=${e!==s.id} @calciteFlowItemClose=${this._toggleSidePanel} .description=${s.description}>${s.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==s.id,editorRef:this.el})}</calcite-flow-item>`}</calcite-flow>`)}`}renderResultsPanel(){if(this._usesBottomExecutionDrawer)return this.renderBottomExecutionBody();if(!this._debuggerState.showPanel)return null;let e=this._debuggerState.openedPanel==="debug-console"?"output":this._debuggerState.openedPanel;return l`<arcgis-arcade-results slot=results-panel .openedResultPanel=${e} .loading=${this._debuggerState.isExecuting} .result=${this._debuggerState.runResult} .consoleLogs=${this._debuggerState.consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>`}renderBottomExecutionBody(){let{showPanel:e,openedPanel:s,debugResult:i,isExecuting:a,mode:r}=this._debuggerState;return e?s==="debug-console"?l`<arcgis-arcade-debugger-console slot=results-panel .modelId=${this._modelId} .debuggerStore=${this._debuggerState}></arcgis-arcade-debugger-console>`:s==="output"&&r==="debug"?l`<arcgis-arcade-debugger-output slot=results-panel .debuggerStore=${this._debuggerState} .result=${i}></arcgis-arcade-debugger-output>`:l`<arcgis-arcade-results slot=results-panel class="bottom-results" .openedResultPanel=${s} .loading=${s==="console"&&this._debuggerState.isPaused?!1:a} .result=${this._debuggerState.runResult} .consoleLogs=${this._debuggerState.consoleLogs} hide-header @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange}></arcgis-arcade-results>`:null}renderBottomActionBar(){if(!this._usesBottomExecutionDrawer)return null;let{showPanel:e,hasExecuted:s,openedPanel:i,isDebugging:a,isPaused:r,isExecuting:n}=this._debuggerState;return l`<calcite-action-bar slot=bottom-action-bar class=${`main-action-bar bottom-action-bar ${e?"":"is-collapsed"}`} layout=horizontal scale=s expand-disabled><calcite-action-group scale=s>${a?l`<calcite-action .text=${this.messages.continue??"Continue"} icon=forward scale=s .disabled=${!r} @click=${this._continueDebugSession}></calcite-action><calcite-action .text=${this.messages.reset??"Reset"} icon=reset scale=s @click=${this._resetDebugSession}></calcite-action><calcite-action .text=${this.messages.stop??"Stop"} icon=circle-stop scale=s @click=${()=>this._stopDebugSession()}></calcite-action>`:l`<calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade||n} @click=${()=>{this._executeScript("run").catch(u(this))}}></calcite-action><calcite-action .text=${this.messages.runanddebug??"Run and Debug"} text-enabled icon=debug-script scale=s .loading=${this._preparingArcade||n} @click=${()=>{this._executeScript("debug").catch(u(this))}}></calcite-action>`}</calcite-action-group>${s?l`<calcite-action-group scale=s><calcite-action .active=${i==="output"&&e} .text=${this.messages.output??"Output"} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${()=>this._setExecutionPanel("output")}></calcite-action><calcite-action .active=${i==="console"&&e} .text=${this.messages.console??"Console"} text-enabled scale=s icon=console icon-flip-rtl @click=${()=>this._setExecutionPanel("console")}></calcite-action><calcite-action .active=${i==="log"&&e} .text=${this.messages.log??"Log"} text-enabled scale=s icon=list icon-flip-rtl @click=${()=>this._setExecutionPanel("log")}></calcite-action><calcite-action .active=${i==="debug-console"&&e} .text=${this.messages.debugconsole??"Debug Console"} text-enabled scale=s icon=debug-script icon-flip-rtl .disabled=${this._debuggerState.mode!=="debug"} @click=${()=>this._setExecutionPanel("debug-console")}></calcite-action></calcite-action-group>`:null}${e?l`<calcite-action-group scale=s><calcite-action .text=${this.messages.close??"Close"} scale=s icon=x icon-flip-rtl @click=${this._onExecutionPanelClose}></calcite-action></calcite-action-group>`:null}</calcite-action-bar>`}render(){return l`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderBottomActionBar()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`}};W("arcgis-arcade-editor",N);return N},"identity/IdentityManager","core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,b,c,d,e,f)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import b from"./QVWSOD3N.js";import a from"./ZHZFKZA7.js";import{b as f,c as p,d as c}from"./G56LJGLK.js";import{a as v,b as T}from"./MTIHPCIF.js";import{L as m}from"./SM3MA3KP.js";export default $arcgis.t(([{getDeclaredPixelMembers:$},{G:w,f:M,g:F,h:P,i:k,j:A,n:b},{k:I,l:L,m:V,o:C,p:D}])=>{async function K(e){let{apiVersion:i,bundles:t,hiddenApiItems:n}=e.toEditorProfileDefinition(),o=await j(e.dictionaryVariables.filter(w));return{apiVersion:i,bundles:t,variables:o,hiddenApiItems:n?.map(s=>s.toLowerCase())}}async function j(e,i=f.Variable){return await Promise.all(e.map(async t=>{switch(t.type){case"dictionary":return await q(t,i);case"pixel":return await O(t,i);case"voxel":case"feature":return await B(t,i);default:return _(t,i)}}))}function _(e,i){let{name:t,type:n}=e,o=e.getDescription(),s=i===f.Field?I(t,!1):t;return{name:t,description:o,type:n,completion:{label:t,detail:t,insertText:s,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i,documentation:{kind:"markdown",value:o}}}}async function B(e,i){let t=await e.loadSource(),{name:n}=e,o=e.getDescription(),s={label:n,detail:n,insertText:n,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i},a={name:n,description:o,type:"dictionary",properties:[],completion:s};if(!t)return a;let[r,l]=L(t.fields,o,!0);return a.properties=r,s.documentation={kind:"markdown",value:l},a}async function O(e,i){let t=await e.loadSource(),n=e.toProfileVariableDefinition();if(n.type!=="pixel")throw new Error("Incorrect definition passed to pixel variable");let{name:o}=e,s=e.getDescription(),a={label:o,detail:o,insertText:o,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i},r={name:o,description:s,type:"dictionary",properties:[],completion:a};if(!t||!n.definition)return r;let l=await $(t),[d,u]=V(l,s);return r.properties=d,a.documentation={kind:"markdown",value:u},r}async function q(e,i){let{name:t,dictionaryVariables:n}=e,o=e.getDescription(),s=n.reduce((a,r)=>{a!==""&&(a+=`
2
+ import b from"./GZ6HZKQZ.js";import a from"./ZHZFKZA7.js";import{b as f,c as p,d as c}from"./G56LJGLK.js";import{a as v,b as T}from"./GS2ISVXJ.js";import{L as m}from"./REL6OK2I.js";export default $arcgis.t(([{getDeclaredPixelMembers:$},{G:w,f:M,g:F,h:P,i:k,j:A,n:b},{k:I,l:L,m:V,o:C,p:D}])=>{async function K(e){let{apiVersion:i,bundles:t,hiddenApiItems:n}=e.toEditorProfileDefinition(),o=await j(e.dictionaryVariables.filter(w));return{apiVersion:i,bundles:t,variables:o,hiddenApiItems:n?.map(s=>s.toLowerCase())}}async function j(e,i=f.Variable){return await Promise.all(e.map(async t=>{switch(t.type){case"dictionary":return await q(t,i);case"pixel":return await O(t,i);case"voxel":case"feature":return await B(t,i);default:return _(t,i)}}))}function _(e,i){let{name:t,type:n}=e,o=e.getDescription(),s=i===f.Field?I(t,!1):t;return{name:t,description:o,type:n,completion:{label:t,detail:t,insertText:s,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i,documentation:{kind:"markdown",value:o}}}}async function B(e,i){let t=await e.loadSource(),{name:n}=e,o=e.getDescription(),s={label:n,detail:n,insertText:n,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i},a={name:n,description:o,type:"dictionary",properties:[],completion:s};if(!t)return a;let[r,l]=L(t.fields,o,!0);return a.properties=r,s.documentation={kind:"markdown",value:l},a}async function O(e,i){let t=await e.loadSource(),n=e.toProfileVariableDefinition();if(n.type!=="pixel")throw new Error("Incorrect definition passed to pixel variable");let{name:o}=e,s=e.getDescription(),a={label:o,detail:o,insertText:o,insertTextMode:c.asIs,insertTextFormat:p.PlainText,kind:i},r={name:o,description:s,type:"dictionary",properties:[],completion:a};if(!t||!n.definition)return r;let l=await $(t),[d,u]=V(l,s);return r.properties=d,a.documentation={kind:"markdown",value:u},r}async function q(e,i){let{name:t,dictionaryVariables:n}=e,o=e.getDescription(),s=n.reduce((a,r)=>{a!==""&&(a+=`
3
3
 
4
4
  `),a+=`**${r.name}**
5
5
  ${r.type}`;let l=r.getDescription();return l&&(a+=`
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{c as g,f as u}from"./6G5URSC7.js";import{a as c}from"./BCUUVBXH.js";var f="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),L=new Set(f),i="en",$={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},b=async(n,o,r="")=>{let e=`${o}/${r}`,t=`${e}${n}.json`;return l[t]??(l[t]=p(n,e)),await l[t]},l={},p=async(n,o)=>{let r=`${o}${n}.json`;try{let e=await fetch(r);if(e.ok)return await e.json()}catch(e){return c("error","intl",`An unknown error occurred while fetching localization strings at ${r}`,{detail:{error:e}}),{}}return n===i?{}:await p(i,o)},k=n=>{let o=u(n,"lang",globalThis.navigator?.language||i);return{lang:o,t9nLocale:h(o)}},h=n=>{let[o,r]=n.split("-"),e=o.toLowerCase(),t=e;return r&&(t=`${e}-${r.toUpperCase()}`),t=$[t]??t,L.has(t)?t:r?h(e):i},C=(n,o,r,e)=>{let t,s=()=>v(n,o(),e).then(a=>{(t?.lang!==a.lang||t.t9nLocale!==a.t9nLocale||t.t9nStrings!==a.t9nStrings)&&r(a),t=a}).catch(a=>{c("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(s),g(n,["lang"],s)},v=async(n,o,r=n.localName.split("-").slice(1).join("-"))=>{let{lang:e,t9nLocale:t}=k(n),s=`${o}/${r}/t9n`,d=r===null?{}:await b(t,s,"messages.");return{lang:e,t9nLocale:t,t9nStrings:d}};export{L as a,b,k as c,h as d,C as e};
2
+ import{c as g,f as u}from"./6G5URSC7.js";import{a as c}from"./Y3KOWWO5.js";var f="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),L=new Set(f),i="en",$={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},b=async(n,o,r="")=>{let e=`${o}/${r}`,t=`${e}${n}.json`;return l[t]??(l[t]=p(n,e)),await l[t]},l={},p=async(n,o)=>{let r=`${o}${n}.json`;try{let e=await fetch(r);if(e.ok)return await e.json()}catch(e){return c("error","intl",`An unknown error occurred while fetching localization strings at ${r}`,{detail:{error:e}}),{}}return n===i?{}:await p(i,o)},k=n=>{let o=u(n,"lang",globalThis.navigator?.language||i);return{lang:o,t9nLocale:h(o)}},h=n=>{let[o,r]=n.split("-"),e=o.toLowerCase(),t=e;return r&&(t=`${e}-${r.toUpperCase()}`),t=$[t]??t,L.has(t)?t:r?h(e):i},C=(n,o,r,e)=>{let t,s=()=>v(n,o(),e).then(a=>{(t?.lang!==a.lang||t.t9nLocale!==a.t9nLocale||t.t9nStrings!==a.t9nStrings)&&r(a),t=a}).catch(a=>{c("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(s),g(n,["lang"],s)},v=async(n,o,r=n.localName.split("-").slice(1).join("-"))=>{let{lang:e,t9nLocale:t}=k(n),s=`${o}/${r}/t9n`,d=r===null?{}:await b(t,s,"messages.");return{lang:e,t9nLocale:t,t9nStrings:d}};export{L as a,b,k as c,h as d,C as e};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import a from"./ZHZFKZA7.js";import{b as De}from"./AHFU2DJA.js";import{b as P,c as M,d as $,e as we}from"./G56LJGLK.js";import{a as ve}from"./ER2MKLVA.js";import{a as R,b as Se,c as k,d as b,e as g}from"./IFNCCZ7O.js";import{d as ae}from"./MTIHPCIF.js";import{L as se,s as re,u as A}from"./SM3MA3KP.js";import{a as c}from"./BCUUVBXH.js";import{Qk as G,Zk as W}from"./LLPQEURF.js";export default $arcgis.t(([Ee,Ae,Le,B,{getDeclaredVoxelMembers:Ue,getDeclaredPixelMembers:Ne},qe,Oe,{A:q,B:y,F:be,H:O,I:ge,a:L,b:ne,c:oe,d:le,e:pe,k:U,l:T,m:ce,o:u,p:he,q:ue,r:x,s:N,t:m,u:de,v:fe,w:_e,y:me,z:ye}])=>{var w=s=>s!==void 0,_=s=>s!==null;function Re(s){switch(s){case"esriFieldTypeOID":return"oid";case"esriFieldTypeSmallInteger":return"small-integer";case"esriFieldTypeInteger":return"integer";case"esriFieldTypeBigInteger":return"big-integer";case"esriFieldTypeSingle":return"single";case"esriFieldTypeDouble":return"double";case"esriFieldTypeDate":return"date";case"esriFieldTypeDateOnly":return"date-only";case"esriFieldTypeTimeOnly":return"time-only";case"esriFieldTypeTimestampOffset":return"timestamp-offset";case"esriFieldTypeGUID":return"guid";case"esriFieldTypeGlobalID":return"global-id";case"esriFieldTypeString":return"string";case"esriFieldTypeGeometry":return"geometry";case"esriFieldTypeBlob":return"blob";case"esriFieldTypeRaster":return"raster";case"esriFieldTypeXML":return"xml";default:return"string"}}function ke(s){return{fields:s.fields.map(e=>({name:e.name,type:Re(e.type),serverType:e.type,nullable:e.nullable}))}}function Ce(s){return typeof s?.query=="object"&&s.query?s.query:{}}var H=class{constructor(e){this.itemId=e.itemId,this.portal=e.portal,this.serviceUrl=e.serviceUrl,this._requestOptions=e.requestOptions}fetchInfo(e){return this.portal.request(this._datastoreUrl,this._createRequestOptions(e))}async fetchDatasets(e){return(await this.portal.request(z(this._datastoreUrl,"datasets"),this._createRequestOptions(e))).datasets}async fetchTableDescription(e,t){if(!e)throw new qe("portal:invalid-parameter",'The "tableName" parameter must be provided.');let i=await this.portal.request(z(this._datastoreUrl,"tableDescription"),{...this._createRequestOptions(t),query:{...Ce(this._requestOptions),...Ce(t),tableName:e}});return ke(i)}get _datastoreUrl(){return z(this.serviceUrl,"datastores",encodeURIComponent(this.itemId))}_createRequestOptions(e){return{...this._requestOptions,...e}}};function z(s,...e){let t=s.replaceAll(/\/+$/gu,""),i=e.filter(r=>!!r).map(r=>r.replaceAll(/^\/+|\/+$/gu,""));return[t,...i].join("/")}var Ge={id:"ansi",keywords:[],functions:[],operators:[],specialChars:{likeWildcardAny:"%",likeWildcardOne:"_",identifierQuote:{start:'"',end:'"'},escapeKey:{start:null,end:null},escapeClause:{keyword:"ESCAPE",suffix:null}}},Fe=new Map,We={ansi:async()=>await Promise.resolve(Ge),bigquery:async()=>(await import("./FLNLMLTL.js")).bigqueryDialect,postgres:async()=>(await import("./VPP77CFW.js")).postgresDialect,sqlServer:async()=>(await import("./DGFH2WPL.js")).sqlServerDialect};async function ze(s){let e=Fe.get(s);if(e)return await e;let t=We[s]();return Fe.set(s,t),await t}var Be=["SELECT","FROM","WHERE","GROUP","BY","HAVING","ORDER","LIMIT","DISTINCT","AS","JOIN","LEFT","RIGHT","FULL","INNER","OUTER","CROSS","ON","USING","AND","OR","NOT","IN","IS","LIKE","BETWEEN","NULL","TRUE","FALSE","ASC","DESC"],He=["<=",">=","<>","!=","=","<",">","+","-","*","/","%","||"],Ke=(s,e={})=>{let t=new Set(e.baseKeywords??Be);for(let r of s.keywords)t.add(r.toUpperCase());let i=new Set(e.baseOperators??He);for(let r of s.operators)i.add(r);return{keywords:Array.from(t),functions:s.functions,operators:Array.from(i),specialChars:s.specialChars}},D={sqlServer:"sql-layer-sql-server",postgres:"sql-layer-postgres",bigquery:"sql-layer-bigquery"},Ie=D.postgres,je={[D.sqlServer]:"sqlServer",[D.postgres]:"postgres",[D.bigquery]:"bigquery"};function Qe(s){return je[s]}async function Je(s){return Ke(await ze(Qe(s)))}var Ze=/^[A-Za-z_][A-Za-z0-9_$]*$/u;function Xe(s){return s==="esriDBMS_PostgreSQL"?Ie:s==="esriDBMS_SQLServer"?D.sqlServer:Ie}function It(s){return s.trim().toLowerCase()}function Ye(s){return s.specialChars.identifierQuote}function et(s,e){let t=s.trim();return t?Ze.test(t)?e.keywords.includes(t.toUpperCase()):!0:!1}function $e(s,e){let t=s.trim();if(!t||!et(t,e))return t;let i=Ye(e),r=t.replaceAll(i.end,`${i.end}${i.end}`);return`${i.start}${r}${i.end}`}function tt(s,e){return s.split(".").map(t=>$e(t,e)).join(".")}function Tt(s){return s.split(".").at(-1)??s}function it(s){return Je(Xe(s))}async function rt(s,e){let t=new B({url:`${s.url}/${e.relatedTableId}`});return await t.load(),t}function ee(s){return(e,t)=>{if(e.type==="oid")return-1;if(t.type==="oid")return 1;if(m(s)){if(e.name===s.subtypeField)return-1;if(t.name===s.subtypeField)return 1}if(x(s)){if(e.name===s.typeIdField)return-1;if(t.name===s.typeIdField)return 1}return e.name.localeCompare(t.name,"en",{sensitivity:"base"})}}function Te(s,e){return s?.every(t=>t.domains?.[e.name]?.type==="inherited")??!1}var st=/^[a-z_$][a-z0-9_$]*$/giu;function te(s,e=!0){return s.match(st)?`${e?".":""}${s}`:`["${s}"]`}function Ve(s,e){return s?`${s}${te(e)}`:e}function xe(s){return fe(s)?s.portalItem:null}function xt(s,e,t=!1){let i=e,r=[],n=[];return b(s).forEach(a=>{i&&(i+=`
2
+ import a from"./ZHZFKZA7.js";import{b as De}from"./P7I5ATMN.js";import{b as P,c as M,d as $,e as we}from"./G56LJGLK.js";import{a as ve}from"./ER2MKLVA.js";import{a as R,b as Se,c as k,d as b,e as g}from"./IFNCCZ7O.js";import{d as ae}from"./GS2ISVXJ.js";import{L as se,s as re,u as A}from"./REL6OK2I.js";import{a as c}from"./Y3KOWWO5.js";import{Qk as G,Zk as W}from"./LLPQEURF.js";export default $arcgis.t(([Ee,Ae,Le,B,{getDeclaredVoxelMembers:Ue,getDeclaredPixelMembers:Ne},qe,Oe,{A:q,B:y,F:be,H:O,I:ge,a:L,b:ne,c:oe,d:le,e:pe,k:U,l:T,m:ce,o:u,p:he,q:ue,r:x,s:N,t:m,u:de,v:fe,w:_e,y:me,z:ye}])=>{var w=s=>s!==void 0,_=s=>s!==null;function Re(s){switch(s){case"esriFieldTypeOID":return"oid";case"esriFieldTypeSmallInteger":return"small-integer";case"esriFieldTypeInteger":return"integer";case"esriFieldTypeBigInteger":return"big-integer";case"esriFieldTypeSingle":return"single";case"esriFieldTypeDouble":return"double";case"esriFieldTypeDate":return"date";case"esriFieldTypeDateOnly":return"date-only";case"esriFieldTypeTimeOnly":return"time-only";case"esriFieldTypeTimestampOffset":return"timestamp-offset";case"esriFieldTypeGUID":return"guid";case"esriFieldTypeGlobalID":return"global-id";case"esriFieldTypeString":return"string";case"esriFieldTypeGeometry":return"geometry";case"esriFieldTypeBlob":return"blob";case"esriFieldTypeRaster":return"raster";case"esriFieldTypeXML":return"xml";default:return"string"}}function ke(s){return{fields:s.fields.map(e=>({name:e.name,type:Re(e.type),serverType:e.type,nullable:e.nullable}))}}function Ce(s){return typeof s?.query=="object"&&s.query?s.query:{}}var H=class{constructor(e){this.itemId=e.itemId,this.portal=e.portal,this.serviceUrl=e.serviceUrl,this._requestOptions=e.requestOptions}fetchInfo(e){return this.portal.request(this._datastoreUrl,this._createRequestOptions(e))}async fetchDatasets(e){return(await this.portal.request(z(this._datastoreUrl,"datasets"),this._createRequestOptions(e))).datasets}async fetchTableDescription(e,t){if(!e)throw new qe("portal:invalid-parameter",'The "tableName" parameter must be provided.');let i=await this.portal.request(z(this._datastoreUrl,"tableDescription"),{...this._createRequestOptions(t),query:{...Ce(this._requestOptions),...Ce(t),tableName:e}});return ke(i)}get _datastoreUrl(){return z(this.serviceUrl,"datastores",encodeURIComponent(this.itemId))}_createRequestOptions(e){return{...this._requestOptions,...e}}};function z(s,...e){let t=s.replaceAll(/\/+$/gu,""),i=e.filter(r=>!!r).map(r=>r.replaceAll(/^\/+|\/+$/gu,""));return[t,...i].join("/")}var Ge={id:"ansi",keywords:[],functions:[],operators:[],specialChars:{likeWildcardAny:"%",likeWildcardOne:"_",identifierQuote:{start:'"',end:'"'},escapeKey:{start:null,end:null},escapeClause:{keyword:"ESCAPE",suffix:null}}},Fe=new Map,We={ansi:async()=>await Promise.resolve(Ge),bigquery:async()=>(await import("./FLNLMLTL.js")).bigqueryDialect,postgres:async()=>(await import("./VPP77CFW.js")).postgresDialect,sqlServer:async()=>(await import("./DGFH2WPL.js")).sqlServerDialect};async function ze(s){let e=Fe.get(s);if(e)return await e;let t=We[s]();return Fe.set(s,t),await t}var Be=["SELECT","FROM","WHERE","GROUP","BY","HAVING","ORDER","LIMIT","DISTINCT","AS","JOIN","LEFT","RIGHT","FULL","INNER","OUTER","CROSS","ON","USING","AND","OR","NOT","IN","IS","LIKE","BETWEEN","NULL","TRUE","FALSE","ASC","DESC"],He=["<=",">=","<>","!=","=","<",">","+","-","*","/","%","||"],Ke=(s,e={})=>{let t=new Set(e.baseKeywords??Be);for(let r of s.keywords)t.add(r.toUpperCase());let i=new Set(e.baseOperators??He);for(let r of s.operators)i.add(r);return{keywords:Array.from(t),functions:s.functions,operators:Array.from(i),specialChars:s.specialChars}},D={sqlServer:"sql-layer-sql-server",postgres:"sql-layer-postgres",bigquery:"sql-layer-bigquery"},Ie=D.postgres,je={[D.sqlServer]:"sqlServer",[D.postgres]:"postgres",[D.bigquery]:"bigquery"};function Qe(s){return je[s]}async function Je(s){return Ke(await ze(Qe(s)))}var Ze=/^[A-Za-z_][A-Za-z0-9_$]*$/u;function Xe(s){return s==="esriDBMS_PostgreSQL"?Ie:s==="esriDBMS_SQLServer"?D.sqlServer:Ie}function It(s){return s.trim().toLowerCase()}function Ye(s){return s.specialChars.identifierQuote}function et(s,e){let t=s.trim();return t?Ze.test(t)?e.keywords.includes(t.toUpperCase()):!0:!1}function $e(s,e){let t=s.trim();if(!t||!et(t,e))return t;let i=Ye(e),r=t.replaceAll(i.end,`${i.end}${i.end}`);return`${i.start}${r}${i.end}`}function tt(s,e){return s.split(".").map(t=>$e(t,e)).join(".")}function Tt(s){return s.split(".").at(-1)??s}function it(s){return Je(Xe(s))}async function rt(s,e){let t=new B({url:`${s.url}/${e.relatedTableId}`});return await t.load(),t}function ee(s){return(e,t)=>{if(e.type==="oid")return-1;if(t.type==="oid")return 1;if(m(s)){if(e.name===s.subtypeField)return-1;if(t.name===s.subtypeField)return 1}if(x(s)){if(e.name===s.typeIdField)return-1;if(t.name===s.typeIdField)return 1}return e.name.localeCompare(t.name,"en",{sensitivity:"base"})}}function Te(s,e){return s?.every(t=>t.domains?.[e.name]?.type==="inherited")??!1}var st=/^[a-z_$][a-z0-9_$]*$/giu;function te(s,e=!0){return s.match(st)?`${e?".":""}${s}`:`["${s}"]`}function Ve(s,e){return s?`${s}${te(e)}`:e}function xe(s){return fe(s)?s.portalItem:null}function xt(s,e,t=!1){let i=e,r=[],n=[];return b(s).forEach(a=>{i&&(i+=`
3
3
 
4
4
  `),i+=`**${a.name}** (${a.alias})
5
5
  ${a.type}`,a.description&&(i+=`
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as l}from"./ER2MKLVA.js";import{a as L}from"./MP6Z45SA.js";import{b as g}from"./BCUUVBXH.js";import{Qk as C,al as h}from"./LLPQEURF.js";var m=Promise.withResolvers(),u=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._modelLifecycleListeners=[],this._isDisposed=!1,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker()),this._modelContextChangeListener=this._defaults.onModelContextDidChange(()=>{this._stopWorkerIfUnused()}),this._registerModelLifecycleListeners()}dispose(){for(this._isDisposed=!0,this._configChangeListener.dispose(),this._modelContextChangeListener.dispose();this._modelLifecycleListeners.length;)this._modelLifecycleListeners.pop()?.dispose();this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _registerModelLifecycleListeners(){let e=await l();this._isDisposed||this._modelLifecycleListeners.push(e.onWillDisposeModel(()=>{this._stopWorkerIfUnused()}),e.onDidChangeModelLanguage(()=>{this._stopWorkerIfUnused()}))}async _stopWorkerIfUnused(){this._worker&&((await l()).getModels().some(e=>e.getLanguageId()===this._defaults.languageId)||this.stopWorker())}async _getClientProxy(){let e=await l();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Layer workers.");this._worker=e.createWebWorker({worker:o("SqlLayerWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},D=i=>{let e=y(i.start),t=y(i.end);return{startRegex:new RegExp(e),contentRegex:new RegExp(`[^${t}]+`),escapedRegex:new RegExp(`${t}${t}`),endRegex:new RegExp(t)}},S=i=>{let e=i.specialChars.identifierQuote;return{comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:e.start,close:e.end}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:e.start,close:e.end}]}},E=i=>{let e=D(i.specialChars.identifierQuote);return{defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:i.keywords,operators:i.operators,builtinFunctions:i.functions,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[e.startRegex,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[e.contentRegex,"identifier"],[e.escapedRegex,"identifier"],[e.endRegex,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}}},y=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),a=this._defaults.getApiContextForModel(e.uri),n=e.getWordUntilPosition(t),d={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:n.startColumn,endColumn:n.endColumn};return await o.doComplete(e.uri.toString(),d,t,a)}catch(o){return g("SqlLayerCompletionProvider")(o),{suggestions:[]}}}},f=class{constructor(e,t,{defaults:o,diagnosticService:a}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._defaults=o,this._diagnosticsService=a,l().then(n=>{let d=s=>{let r=s.getLanguageId();if(r!==this._languageId)return;let c=L(()=>{this._doValidate(s,r).catch(M=>{throw M})}),x=s.onDidChangeContent(c),I=s.onDidChangeAttached(c);this._modelListeners.set(s.uri.toString(),[x,I]),this._doValidate(s,r).catch(g("SqlLayerDiagnosticsAdapter"))},p=s=>{let r=s.uri.toString();n.setModelMarkers(s,this._languageId,[]);let c=this._modelListeners.get(r);if(c){for(;c.length;)c.pop()?.dispose();this._modelListeners.delete(r)}};this._disposables.push(n.onDidCreateModel(d)),this._disposables.push(n.onWillDisposeModel(s=>p(s))),this._disposables.push(n.onDidChangeModelLanguage(s=>{p(s.model),d(s.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(p(s),d(s))})})),this._disposables.push(o.onModelContextDidChange(s=>{n.getModels().forEach(r=>{r.getLanguageId()===this._languageId&&r.uri.toString()===s&&this._doValidate(r,this._languageId).catch(g("SqlLayerDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(s=>s.forEach(r=>r.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(d)})}async _doValidate(e,t){let o=await l();if(e.isAttachedToEditor())try{let a=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),d=await a.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,d),o.setModelMarkers(e,t,d)}catch(a){g("SqlLayerDiagnosticsAdapter")(a)}}},w;async function T(...i){return await u.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("SQL layer worker not registered!"));return}e(w(...i))})}var k=class{constructor(){this._onDiagnosticsChange=new C}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},b=new k;function H(){return b}async function Q(i){let e=new u(i),t=async(...a)=>await e.getLanguageServiceWorker(...a);w=t;let o=await i.getDialectSpec();h.setMonarchTokensProvider(i.languageId,E(o)),h.setLanguageConfiguration(i.languageId,S(o)),h.registerCompletionItemProvider(i.languageId,new _(t,i)),new f(i.languageId,t,{defaults:i,diagnosticService:b})}export{T as a,H as b,Q as c};
2
+ import{a as l}from"./ER2MKLVA.js";import{a as L}from"./MP6Z45SA.js";import{b as g}from"./Y3KOWWO5.js";import{Qk as C,al as h}from"./LLPQEURF.js";var m=Promise.withResolvers(),u=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._modelLifecycleListeners=[],this._isDisposed=!1,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker()),this._modelContextChangeListener=this._defaults.onModelContextDidChange(()=>{this._stopWorkerIfUnused()}),this._registerModelLifecycleListeners()}dispose(){for(this._isDisposed=!0,this._configChangeListener.dispose(),this._modelContextChangeListener.dispose();this._modelLifecycleListeners.length;)this._modelLifecycleListeners.pop()?.dispose();this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _registerModelLifecycleListeners(){let e=await l();this._isDisposed||this._modelLifecycleListeners.push(e.onWillDisposeModel(()=>{this._stopWorkerIfUnused()}),e.onDidChangeModelLanguage(()=>{this._stopWorkerIfUnused()}))}async _stopWorkerIfUnused(){this._worker&&((await l()).getModels().some(e=>e.getLanguageId()===this._defaults.languageId)||this.stopWorker())}async _getClientProxy(){let e=await l();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Layer workers.");this._worker=e.createWebWorker({worker:o("SqlLayerWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},D=i=>{let e=y(i.start),t=y(i.end);return{startRegex:new RegExp(e),contentRegex:new RegExp(`[^${t}]+`),escapedRegex:new RegExp(`${t}${t}`),endRegex:new RegExp(t)}},S=i=>{let e=i.specialChars.identifierQuote;return{comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:e.start,close:e.end}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:e.start,close:e.end}]}},E=i=>{let e=D(i.specialChars.identifierQuote);return{defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:i.keywords,operators:i.operators,builtinFunctions:i.functions,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[e.startRegex,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[e.contentRegex,"identifier"],[e.escapedRegex,"identifier"],[e.endRegex,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}}},y=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),a=this._defaults.getApiContextForModel(e.uri),n=e.getWordUntilPosition(t),d={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:n.startColumn,endColumn:n.endColumn};return await o.doComplete(e.uri.toString(),d,t,a)}catch(o){return g("SqlLayerCompletionProvider")(o),{suggestions:[]}}}},f=class{constructor(e,t,{defaults:o,diagnosticService:a}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._defaults=o,this._diagnosticsService=a,l().then(n=>{let d=s=>{let r=s.getLanguageId();if(r!==this._languageId)return;let c=L(()=>{this._doValidate(s,r).catch(M=>{throw M})}),x=s.onDidChangeContent(c),I=s.onDidChangeAttached(c);this._modelListeners.set(s.uri.toString(),[x,I]),this._doValidate(s,r).catch(g("SqlLayerDiagnosticsAdapter"))},p=s=>{let r=s.uri.toString();n.setModelMarkers(s,this._languageId,[]);let c=this._modelListeners.get(r);if(c){for(;c.length;)c.pop()?.dispose();this._modelListeners.delete(r)}};this._disposables.push(n.onDidCreateModel(d)),this._disposables.push(n.onWillDisposeModel(s=>p(s))),this._disposables.push(n.onDidChangeModelLanguage(s=>{p(s.model),d(s.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(p(s),d(s))})})),this._disposables.push(o.onModelContextDidChange(s=>{n.getModels().forEach(r=>{r.getLanguageId()===this._languageId&&r.uri.toString()===s&&this._doValidate(r,this._languageId).catch(g("SqlLayerDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(s=>s.forEach(r=>r.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(d)})}async _doValidate(e,t){let o=await l();if(e.isAttachedToEditor())try{let a=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),d=await a.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,d),o.setModelMarkers(e,t,d)}catch(a){g("SqlLayerDiagnosticsAdapter")(a)}}},w;async function T(...i){return await u.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("SQL layer worker not registered!"));return}e(w(...i))})}var k=class{constructor(){this._onDiagnosticsChange=new C}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},b=new k;function H(){return b}async function Q(i){let e=new u(i),t=async(...a)=>await e.getLanguageServiceWorker(...a);w=t;let o=await i.getDialectSpec();h.setMonarchTokensProvider(i.languageId,E(o)),h.setLanguageConfiguration(i.languageId,S(o)),h.registerCompletionItemProvider(i.languageId,new _(t,i)),new f(i.languageId,t,{defaults:i,diagnosticService:b})}export{T as a,H as b,Q as c};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import d from"./CHTL74L2.js";import c from"./YJW6NUWX.js";import b from"./GZ6HZKQZ.js";import a from"./ZHZFKZA7.js";import"./P7I5ATMN.js";import"./G56LJGLK.js";import"./ER2MKLVA.js";import"./MP6Z45SA.js";import"./IFNCCZ7O.js";import"./GS2ISVXJ.js";import"./6G5URSC7.js";import"./6C52UOYL.js";import"./REL6OK2I.js";import"./Y3KOWWO5.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import"./LLPQEURF.js";import"./3TTFCHAA.js";export default $arcgis.t(([,,,{a:a,b:b,c:c}])=>{return{getSqlExprDiagnosticService:b,getSqlExprWorker:a,setupMode:c}},a,b,c,d)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{c as P,e as O}from"./MTIHPCIF.js";import{a as b,b as y,c as u,d as m,e as E,f as x,m as f,o as C}from"./SM3MA3KP.js";var w=e=>(...n)=>{let t=m(),o=new e(...n),s=o.exports;u(t.at(-1));let r=o.component.manager;r.W(o,s),o.watchExports(r.W.bind(r,o)),E(o);let a=[o.component,...t].reverse();return f(a,i=>i===void 0?void 0:A(o,i,s),s)},A=(e,{host:n,key:t,isReactive:o},s)=>{let r=n,a=r[t]!==e.exports,i=r[t]!==s,c=s!==e.exports;if(a&&!i&&c&&(r[t]=e.exports),n===e.component){if(o){let p=e.component.manager;i&&p.W(e,r[t]),e.onUpdate(h=>{if(h.has(t)){let g=r[t];g!==e.exports&&p.W(e,g)}})}e.O=o?void 0:t}let d=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{r[t]!==e.exports&&(d?x(()=>{r[t]=e.exports}):r[t]=e.exports)})};var L=e=>D(void 0,e);var v=class extends C{constructor(n,t){super(n);let o=this.exports;try{y(this.component);let s=t(this.component,this),r=this.exports!==o;if(b(s)){r||this.setProvisionalExports(s);let a=s.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!r||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s)}}catchUpLifecycle(){}},D=w(v);var G=L;var $=e=>(n={})=>L((t,o)=>{let s=P(t.el),r={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},a=t;o.onLifecycle(()=>O(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:l,lang:d})=>{let p={...l,_lang:d,_t9nLocale:c,_loading:!1};o.exports=p;let h=l.componentLabel;typeof h=="string"&&"label"in t&&t.label==null&&(t.label??=h),i(a.messageOverrides)},n.name));let i=c=>{let l=o.exports,d=l._original??l,p=_(d,c);c&&(p._original=d),o.exports=p};return"messageOverrides"in a&&o.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),n.blocking?(o.setProvisionalExports(r,!1),o.ready):r}),_=(e,n)=>{if(!n)return e;let t={...e};return Object.entries(n).forEach(([o,s])=>{e[o]!==void 0&&(typeof s=="object"?t[o]=_(e[o],s):t[o]=s??e[o])}),t};export{G as a,$ as b};
2
+ import{c as P,e as O}from"./GS2ISVXJ.js";import{a as b,b as y,c as u,d as m,e as E,f as x,m as f,o as C}from"./REL6OK2I.js";var w=e=>(...n)=>{let t=m(),o=new e(...n),s=o.exports;u(t.at(-1));let r=o.component.manager;r.W(o,s),o.watchExports(r.W.bind(r,o)),E(o);let a=[o.component,...t].reverse();return f(a,i=>i===void 0?void 0:A(o,i,s),s)},A=(e,{host:n,key:t,isReactive:o},s)=>{let r=n,a=r[t]!==e.exports,i=r[t]!==s,c=s!==e.exports;if(a&&!i&&c&&(r[t]=e.exports),n===e.component){if(o){let p=e.component.manager;i&&p.W(e,r[t]),e.onUpdate(h=>{if(h.has(t)){let g=r[t];g!==e.exports&&p.W(e,g)}})}e.O=o?void 0:t}let d=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{r[t]!==e.exports&&(d?x(()=>{r[t]=e.exports}):r[t]=e.exports)})};var L=e=>D(void 0,e);var v=class extends C{constructor(n,t){super(n);let o=this.exports;try{y(this.component);let s=t(this.component,this),r=this.exports!==o;if(b(s)){r||this.setProvisionalExports(s);let a=s.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!r||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s)}}catchUpLifecycle(){}},D=w(v);var G=L;var $=e=>(n={})=>L((t,o)=>{let s=P(t.el),r={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},a=t;o.onLifecycle(()=>O(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:l,lang:d})=>{let p={...l,_lang:d,_t9nLocale:c,_loading:!1};o.exports=p;let h=l.componentLabel;typeof h=="string"&&"label"in t&&t.label==null&&(t.label??=h),i(a.messageOverrides)},n.name));let i=c=>{let l=o.exports,d=l._original??l,p=_(d,c);c&&(p._original=d),o.exports=p};return"messageOverrides"in a&&o.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),n.blocking?(o.setProvisionalExports(r,!1),o.ready):r}),_=(e,n)=>{if(!n)return e;let t={...e};return Object.entries(n).forEach(([o,s])=>{e[o]!==void 0&&(typeof s=="object"?t[o]=_(e[o],s):t[o]=s??e[o])}),t};export{G as a,$ as b};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a,b,c}from"./OI3DH7N2.js";import"./ER2MKLVA.js";import"./MP6Z45SA.js";import"./6C52UOYL.js";import"./BCUUVBXH.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import"./LLPQEURF.js";import"./3TTFCHAA.js";export{b as getSqlLayerDiagnosticService,a as getSqlLayerWorker,c as setupMode};
2
+ import{a,b,c}from"./JLF32ABD.js";import"./ER2MKLVA.js";import"./MP6Z45SA.js";import"./6C52UOYL.js";import"./Y3KOWWO5.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import"./LLPQEURF.js";import"./3TTFCHAA.js";export{b as getSqlLayerDiagnosticService,a as getSqlLayerWorker,c as setupMode};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{Ok as i,aj as l}from"./LLPQEURF.js";export default $arcgis.t(([d])=>{function m(){return!!window.MonacoEnvironment?.getWorker}var c="",f=new Map,u=!1;async function p(t,r,e){if(e)return r?r():new Worker(t);let s=window.location.origin;if(new URL(t,window.location.href).origin!==s){let o=await d(t,{responseType:"text"});return new Worker(URL.createObjectURL(new Blob([o.data],{type:"text/javascript"})),{type:"module"})}return new Worker(t,{type:"module"})}function E(t){if(m())return;g(),c=t;let r=`${c}/code-editor`,e={arcade:`${r}/arcade.worker.js`,"arcgis-sql-expression":`${r}/sql-expr.worker.js`,"sql-layer-sql-server":`${r}/sql-layer.worker.js`,"sql-layer-postgres":`${r}/sql-layer.worker.js`,"sql-layer-bigquery":`${r}/sql-layer.worker.js`,html:`${r}/html.worker.js`,css:`${r}/css.worker.js`,typescript:`${r}/ts.worker.js`,json:`${r}/json.worker.js`,default:`${r}/editor.worker.js`},s={arcade:{url:e.arcade},"arcgis-sql-expression":{url:e["arcgis-sql-expression"]},"sql-layer-sql-server":{url:e["sql-layer-sql-server"]},"sql-layer-postgres":{url:e["sql-layer-postgres"]},"sql-layer-bigquery":{url:e["sql-layer-bigquery"]},html:{url:e.html},css:{url:e.css},typescript:{url:e.typescript},javascript:{url:e.typescript},json:{url:e.json},default:{url:e.default}};window.MonacoEnvironment={getWorker:async(o,a)=>{let n=f.get(a);if(n)return await p(n,void 0,u);let{url:y,localWorker:q}=s[a]||s.default;return await p(y,q,u)}}}var w=!1;function g(){w||(i.get(l),w=!0)}async function L(){return(await j()).getArcadeDiagnosticService()}async function j(){return await import("./G3BWRHPC.js")}return{a:E,b:L,c:j}},"request")
2
+ import{Ok as i,aj as l}from"./LLPQEURF.js";export default $arcgis.t(([d])=>{function m(){return!!window.MonacoEnvironment?.getWorker}var c="",f=new Map,u=!1;async function p(t,r,e){if(e)return r?r():new Worker(t);let s=window.location.origin;if(new URL(t,window.location.href).origin!==s){let o=await d(t,{responseType:"text"});return new Worker(URL.createObjectURL(new Blob([o.data],{type:"text/javascript"})),{type:"module"})}return new Worker(t,{type:"module"})}function E(t){if(m())return;g(),c=t;let r=`${c}/code-editor`,e={arcade:`${r}/arcade.worker.js`,"arcgis-sql-expression":`${r}/sql-expr.worker.js`,"sql-layer-sql-server":`${r}/sql-layer.worker.js`,"sql-layer-postgres":`${r}/sql-layer.worker.js`,"sql-layer-bigquery":`${r}/sql-layer.worker.js`,html:`${r}/html.worker.js`,css:`${r}/css.worker.js`,typescript:`${r}/ts.worker.js`,json:`${r}/json.worker.js`,default:`${r}/editor.worker.js`},s={arcade:{url:e.arcade},"arcgis-sql-expression":{url:e["arcgis-sql-expression"]},"sql-layer-sql-server":{url:e["sql-layer-sql-server"]},"sql-layer-postgres":{url:e["sql-layer-postgres"]},"sql-layer-bigquery":{url:e["sql-layer-bigquery"]},html:{url:e.html},css:{url:e.css},typescript:{url:e.typescript},javascript:{url:e.typescript},json:{url:e.json},default:{url:e.default}};window.MonacoEnvironment={getWorker:async(o,a)=>{let n=f.get(a);if(n)return await p(n,void 0,u);let{url:y,localWorker:q}=s[a]||s.default;return await p(y,q,u)}}}var w=!1;function g(){w||(i.get(l),w=!0)}async function L(){return(await j()).getArcadeDiagnosticService()}async function j(){return await import("./SKTKTWIV.js")}return{a:E,b:L,c:j}},"request")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as n}from"./6TBGTZVD.js";import{a as g}from"./AHFU2DJA.js";import"./G56LJGLK.js";import{a as f}from"./BA546EMZ.js";import"./MJ7MJPGA.js";import"./MTIHPCIF.js";import{g as p,h as u}from"./6G5URSC7.js";import{F as a,G as d,K as h,h as m,j as s,n as c,s as o}from"./SM3MA3KP.js";import"./BCUUVBXH.js";import"./3TTFCHAA.js";var b=m`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,r=class extends d{constructor(){super(...arguments),this.messages=f(),this._unselectItem=async()=>{this._selectedApiItem=void 0},this._filterValue="",this.languageId="arcade",this.hideDocumentationActions=!1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=c({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=c({bubbles:!1,composed:!1})}static{this.properties={_filterValue:16,_selectedApiItem:16,languageId:1,apiLibrary:0,hideDocumentationActions:5,loading:5,closed:5}}static{this.styles=b}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let i of this.apiLibrary??[])for(let t of i.items)if(t.name===this._selectedApiItem.name){this._selectedApiItem=t;return}this._selectedApiItem=void 0}}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{u(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,i){if(!i)return;let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_emitClose(){this.arcgisInternalClosePanel.emit()}_emitItemSelectedAndClose(e,i){let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_selectItem(e,i){e.stopPropagation(),this._selectedApiItem=i}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}_elementToMarkdown(e){e!==void 0&&(e.innerHTML=n(this._selectedApiItem.examples))}renderApiCategory(e){let i=g(e.items,"name",this._filterValue);return i.length?s`<calcite-list-item-group .heading=${e.title}>${i.map(t=>s`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${l=>this._emitItemSelected(l,t)} @keydown=${l=>this._emitItemSelected(l,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${l=>this._selectItem(l,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:s`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions?"full":"half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${i=>this._emitItemSelectedAndClose(i,e)} ${a(p)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${o(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation)??""}></div>${e.examples?s`<div ${a(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){if(this.closed)return null;let e=(this.apiLibrary??[]).map(t=>this.renderApiCategory(t)),i=e.every(t=>!t);return s`<calcite-flow ${a(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading?s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:s`<calcite-list .label=${this.messages.api??"API"}>${i?s`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};h("arcgis-language-api-panel",r);export{r as ArcgisLanguageApiPanel};
2
+ import{a as n}from"./6TBGTZVD.js";import{a as g}from"./P7I5ATMN.js";import"./G56LJGLK.js";import{a as f}from"./SB3MM5EM.js";import"./KCU2C44H.js";import"./GS2ISVXJ.js";import{g as p,h as u}from"./6G5URSC7.js";import{F as a,G as d,K as h,h as m,j as s,n as c,s as o}from"./REL6OK2I.js";import"./Y3KOWWO5.js";import"./3TTFCHAA.js";var b=m`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,r=class extends d{constructor(){super(...arguments),this.messages=f(),this._unselectItem=async()=>{this._selectedApiItem=void 0},this._filterValue="",this.languageId="arcade",this.hideDocumentationActions=!1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=c({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=c({bubbles:!1,composed:!1})}static{this.properties={_filterValue:16,_selectedApiItem:16,languageId:1,apiLibrary:0,hideDocumentationActions:5,loading:5,closed:5}}static{this.styles=b}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let i of this.apiLibrary??[])for(let t of i.items)if(t.name===this._selectedApiItem.name){this._selectedApiItem=t;return}this._selectedApiItem=void 0}}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{u(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,i){if(!i)return;let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_emitClose(){this.arcgisInternalClosePanel.emit()}_emitItemSelectedAndClose(e,i){let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_selectItem(e,i){e.stopPropagation(),this._selectedApiItem=i}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}_elementToMarkdown(e){e!==void 0&&(e.innerHTML=n(this._selectedApiItem.examples))}renderApiCategory(e){let i=g(e.items,"name",this._filterValue);return i.length?s`<calcite-list-item-group .heading=${e.title}>${i.map(t=>s`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${l=>this._emitItemSelected(l,t)} @keydown=${l=>this._emitItemSelected(l,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${l=>this._selectItem(l,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:s`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions?"full":"half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${i=>this._emitItemSelectedAndClose(i,e)} ${a(p)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${o(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation)??""}></div>${e.examples?s`<div ${a(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){if(this.closed)return null;let e=(this.apiLibrary??[]).map(t=>this.renderApiCategory(t)),i=e.every(t=>!t);return s`<calcite-flow ${a(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading?s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:s`<calcite-list .label=${this.messages.api??"API"}>${i?s`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};h("arcgis-language-api-panel",r);export{r as ArcgisLanguageApiPanel};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"./FZHOCYLK.js";import b from"./VUZOZLS3.js";import a from"./PNIRJAMR.js";import{a as t}from"./ER2MKLVA.js";import{a as c}from"./HPZZVB4X.js";import{Zk as d,al as n}from"./LLPQEURF.js";export default $arcgis.t(([s,{c:m},{a:a,b:p}])=>{var k=["arcade","arcgis-sql-expression","sql-layer-sql-server","sql-layer-postgres","sql-layer-bigquery"],i=new Set,u=new Map;function l(e){let r=u.get(e);return r||(r=Promise.withResolvers(),u.set(e,r)),r}function f(e){l(e).resolve()}function T(e){return k.includes(e)?l(e).promise:Promise.resolve()}function h(e,r){return()=>{i.has(e)||i.add(e),r()}}async function U(e){i.has(e)||(await t()).createModel("",e,d.parse("")).dispose()}n.register({id:s.languageId,aliases:["Arcade","arcade"],extensions:[".arc"],mimetypes:["application/arcade"]});n.onLanguage(s.languageId,h(s.languageId,()=>{m().then(e=>{e.setupMode(s),f(s.languageId)}).catch(e=>{throw e})}));n.register({id:a.languageId,aliases:["EsiSqlExpression","sql-expression"],extensions:[".sql-expression"],mimetypes:["application/sql-expression"]});n.onLanguage(a.languageId,h(a.languageId,()=>{p().then(e=>{e.setupMode(a),f(a.languageId)}).catch(e=>{throw e})}));q();function q(){t().then(e=>{["light","dark"].forEach(r=>{let g=r==="light"?"vs":"vs-dark",o=c[`${r}-theme`];e.defineTheme(g,{base:g,inherit:!0,rules:[{token:"comment.arcgis",foreground:o.comment},{token:"constant.arcgis",foreground:o.constant},{token:"keyword.arcgis",foreground:o.keyword},{token:"identifier.arcgis",foreground:o.identifier},{token:"number.arcgis",foreground:o.number},{token:"string.arcgis",foreground:o.string},{token:"operator.arcgis",foreground:o.operator},{token:"predefined.arcgis",foreground:o.predefined},{token:"date.arcgis",foreground:o.date}],colors:{}})})})}return{a:f,b:T,c:h,d:U}},a,b,e)
2
+ import e from"./YJW6NUWX.js";import b from"./NOHSS7JG.js";import a from"./GPIFJKPY.js";import{a as t}from"./ER2MKLVA.js";import{a as c}from"./HPZZVB4X.js";import{Zk as d,al as n}from"./LLPQEURF.js";export default $arcgis.t(([s,{c:m},{a:a,b:p}])=>{var k=["arcade","arcgis-sql-expression","sql-layer-sql-server","sql-layer-postgres","sql-layer-bigquery"],i=new Set,u=new Map;function l(e){let r=u.get(e);return r||(r=Promise.withResolvers(),u.set(e,r)),r}function f(e){l(e).resolve()}function T(e){return k.includes(e)?l(e).promise:Promise.resolve()}function h(e,r){return()=>{i.has(e)||i.add(e),r()}}async function U(e){i.has(e)||(await t()).createModel("",e,d.parse("")).dispose()}n.register({id:s.languageId,aliases:["Arcade","arcade"],extensions:[".arc"],mimetypes:["application/arcade"]});n.onLanguage(s.languageId,h(s.languageId,()=>{m().then(e=>{e.setupMode(s),f(s.languageId)}).catch(e=>{throw e})}));n.register({id:a.languageId,aliases:["EsiSqlExpression","sql-expression"],extensions:[".sql-expression"],mimetypes:["application/sql-expression"]});n.onLanguage(a.languageId,h(a.languageId,()=>{p().then(e=>{e.setupMode(a),f(a.languageId)}).catch(e=>{throw e})}));q();function q(){t().then(e=>{["light","dark"].forEach(r=>{let g=r==="light"?"vs":"vs-dark",o=c[`${r}-theme`];e.defineTheme(g,{base:g,inherit:!0,rules:[{token:"comment.arcgis",foreground:o.comment},{token:"constant.arcgis",foreground:o.constant},{token:"keyword.arcgis",foreground:o.keyword},{token:"identifier.arcgis",foreground:o.identifier},{token:"number.arcgis",foreground:o.number},{token:"string.arcgis",foreground:o.string},{token:"operator.arcgis",foreground:o.operator},{token:"predefined.arcgis",foreground:o.predefined},{token:"date.arcgis",foreground:o.date}],colors:{}})})})}return{a:f,b:T,c:h,d:U}},a,b,e)
@@ -1,4 +1,4 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{f as d}from"./G56LJGLK.js";import{r as c}from"./SM3MA3KP.js";function p(t,u,a,r){if(!u)return[];let e=Array.isArray(u)?u:[u];if(!e.length)return[];let m=c(a);return t.filter(s=>e.some(i=>m.test(String(s[i]??""))))}function f(t){return t?`${t.portal.url}/home/item.html?id=${t.id}`:""}function C(t,u,a="add",r){if(!t)return;let e=t.getSelection(),m=e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),s=[],i=t.getValue()??"";if(a==="replace"){let n=r?`${r}
2
+ import{f as d}from"./G56LJGLK.js";import{r as c}from"./REL6OK2I.js";function p(t,u,a,r){if(!u)return[];let e=Array.isArray(u)?u:[u];if(!e.length)return[];let m=c(a);return t.filter(s=>e.some(i=>m.test(String(s[i]??""))))}function f(t){return t?`${t.portal.url}/home/item.html?id=${t.id}`:""}function C(t,u,a="add",r){if(!t)return;let e=t.getSelection(),m=e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),s=[],i=t.getValue()??"";if(a==="replace"){let n=r?`${r}
3
3
  ${u}`:u,l=t.getModel(),o=l?.getLineCount()??1,g=l?.getLineMaxColumn(o)??1;s=[{range:{startLineNumber:1,startColumn:1,endLineNumber:o,endColumn:g},text:n}]}else{let n=m?{startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn}:(()=>{let o=t.getPosition();return{startLineNumber:o?.lineNumber??1,startColumn:o?.column??1,endLineNumber:o?.lineNumber??1,endColumn:o?.column??1}})(),l=!1;if(r){let o=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");l=!new RegExp(`^\\s*${o}\\s*$`,"mu").test(i)}l&&s.push({range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1},text:`${r}
4
4
  `}),s.push({range:n,text:u})}try{t.pushUndoStop(),t.executeEdits("insertText",s),t.pushUndoStop(),t.focus()}catch(n){console.error("Failed to edit model:",n)}}function x(t){try{return d(t)}catch{return t}}var L=t=>t.split(/\r\n|\r|\n/u).length-1,h=(t,u)=>[...u].sort((a,r)=>r.range.startLineNumber-a.range.startLineNumber||r.range.startColumn-a.range.startColumn).reduce((a,r)=>{let e=r.range.startLineNumber,m=r.range.endLineNumber,s=m-e,i=L(r.text)-s;return a.flatMap(n=>n<e?[n]:s===0?[n>=e?n+i:n]:n>m?[n+i]:n===e?[n]:[])},[...t]);export{p as a,f as b,C as c,x as d,h as e};
@@ -1,4 +1,4 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{b as Mt}from"./BCUUVBXH.js";var Y=globalThis,Z=Y.ShadowRoot&&(Y.ShadyCSS===void 0||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),kt=new WeakMap,M=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let o=e!==void 0&&e.length===1;o&&(t=kt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&kt.set(e,t))}return t}toString(){return this.cssText}},jt=s=>new M(typeof s=="string"?s:s+"",void 0,gt),be=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((o,n,r)=>o+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[r+1],s[0]);return new M(e,s,gt)},Ht=(s,t)=>{if(Z)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let o=document.createElement("style"),n=Y.litNonce;n!==void 0&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o)}},vt=Z?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let o of t.cssRules)e+=o.cssText;return jt(e)})(s):s;var{is:Ae,defineProperty:_e,getOwnPropertyDescriptor:Ce,getOwnPropertyNames:we,getOwnPropertySymbols:Oe,getPrototypeOf:Te}=Object,tt=globalThis,zt=tt.trustedTypes,Se=zt?zt.emptyScript:"",Pe=tt.reactiveElementPolyfillSupport,k=(s,t)=>s,X={toAttribute(s,t){switch(t){case Boolean:s=s?Se:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},j=(s,t)=>!Ae(s,t),Vt={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:j};Symbol.metadata??=Symbol("metadata"),tt.litPropertyMetadata??=new WeakMap;var A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Vt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let o=Symbol(),n=this.getPropertyDescriptor(t,o,e);n!==void 0&&_e(this.prototype,t,n)}}static getPropertyDescriptor(t,e,o){let{get:n,set:r}=Ce(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:n,set(i){let a=n?.call(this);r?.call(this,i),this.requestUpdate(t,a,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Vt}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let t=Te(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let e=this.properties,o=[...we(e),...Oe(e)];for(let n of o)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[o,n]of e)this.elementProperties.set(o,n)}this._$Eh=new Map;for(let[e,o]of this.elementProperties){let n=this._$Eu(e,o);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let o=new Set(t.flat(1/0).reverse());for(let n of o)e.unshift(vt(n))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let o=e.attribute;return o===!1?void 0:typeof o=="string"?o:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ht(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$ET(t,e){let o=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,o);if(n!==void 0&&o.reflect===!0){let r=(o.converter?.toAttribute!==void 0?o.converter:X).toAttribute(e,o.type);this._$Em=t,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){let o=this.constructor,n=o._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let r=o.getPropertyOptions(n),i=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:X;this._$Em=n;let a=i.fromAttribute(e,r.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,e,o,n=!1,r){if(t!==void 0){let i=this.constructor;if(n===!1&&(r=this[t]),o??=i.getPropertyOptions(t),!((o.hasChanged??j)(r,e)||o.useDefault&&o.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,o))))return;this.C(t,e,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:o,reflect:n,wrapped:r},i){o&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),r!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,r]of o){let{wrapped:i}=r,a=this[n];i!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(e)):this._$EM()}catch(o){throw t=!1,this._$EM(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[k("elementProperties")]=new Map,A[k("finalized")]=new Map,Pe?.({ReactiveElement:A}),(tt.reactiveElementVersions??=[]).push("2.1.2");var $t=globalThis,Bt=s=>s,et=$t.trustedTypes,Wt=et?et.createPolicy("lit-html",{createHTML:s=>s}):void 0,bt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,At="?"+_,Ne=`<${At}>`,T=document,z=()=>T.createComment(""),V=s=>s===null||typeof s!="object"&&typeof s!="function",_t=Array.isArray,Jt=s=>_t(s)||typeof s?.[Symbol.iterator]=="function",Et=`[
2
+ import{b as Mt}from"./Y3KOWWO5.js";var Y=globalThis,Z=Y.ShadowRoot&&(Y.ShadyCSS===void 0||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),kt=new WeakMap,M=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let o=e!==void 0&&e.length===1;o&&(t=kt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&kt.set(e,t))}return t}toString(){return this.cssText}},jt=s=>new M(typeof s=="string"?s:s+"",void 0,gt),be=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((o,n,r)=>o+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[r+1],s[0]);return new M(e,s,gt)},Ht=(s,t)=>{if(Z)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let o=document.createElement("style"),n=Y.litNonce;n!==void 0&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o)}},vt=Z?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let o of t.cssRules)e+=o.cssText;return jt(e)})(s):s;var{is:Ae,defineProperty:_e,getOwnPropertyDescriptor:Ce,getOwnPropertyNames:we,getOwnPropertySymbols:Oe,getPrototypeOf:Te}=Object,tt=globalThis,zt=tt.trustedTypes,Se=zt?zt.emptyScript:"",Pe=tt.reactiveElementPolyfillSupport,k=(s,t)=>s,X={toAttribute(s,t){switch(t){case Boolean:s=s?Se:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},j=(s,t)=>!Ae(s,t),Vt={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:j};Symbol.metadata??=Symbol("metadata"),tt.litPropertyMetadata??=new WeakMap;var A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Vt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let o=Symbol(),n=this.getPropertyDescriptor(t,o,e);n!==void 0&&_e(this.prototype,t,n)}}static getPropertyDescriptor(t,e,o){let{get:n,set:r}=Ce(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:n,set(i){let a=n?.call(this);r?.call(this,i),this.requestUpdate(t,a,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Vt}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let t=Te(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let e=this.properties,o=[...we(e),...Oe(e)];for(let n of o)this.createProperty(n,e[n])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[o,n]of e)this.elementProperties.set(o,n)}this._$Eh=new Map;for(let[e,o]of this.elementProperties){let n=this._$Eu(e,o);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let o=new Set(t.flat(1/0).reverse());for(let n of o)e.unshift(vt(n))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let o=e.attribute;return o===!1?void 0:typeof o=="string"?o:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ht(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$ET(t,e){let o=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,o);if(n!==void 0&&o.reflect===!0){let r=(o.converter?.toAttribute!==void 0?o.converter:X).toAttribute(e,o.type);this._$Em=t,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){let o=this.constructor,n=o._$Eh.get(t);if(n!==void 0&&this._$Em!==n){let r=o.getPropertyOptions(n),i=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:X;this._$Em=n;let a=i.fromAttribute(e,r.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,e,o,n=!1,r){if(t!==void 0){let i=this.constructor;if(n===!1&&(r=this[t]),o??=i.getPropertyOptions(t),!((o.hasChanged??j)(r,e)||o.useDefault&&o.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,o))))return;this.C(t,e,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:o,reflect:n,wrapped:r},i){o&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),r!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[n,r]of o){let{wrapped:i}=r,a=this[n];i!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(e)):this._$EM()}catch(o){throw t=!1,this._$EM(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[k("elementProperties")]=new Map,A[k("finalized")]=new Map,Pe?.({ReactiveElement:A}),(tt.reactiveElementVersions??=[]).push("2.1.2");var $t=globalThis,Bt=s=>s,et=$t.trustedTypes,Wt=et?et.createPolicy("lit-html",{createHTML:s=>s}):void 0,bt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,At="?"+_,Ne=`<${At}>`,T=document,z=()=>T.createComment(""),V=s=>s===null||typeof s!="object"&&typeof s!="function",_t=Array.isArray,Jt=s=>_t(s)||typeof s?.[Symbol.iterator]=="function",Et=`[
3
3
  \f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ft=/-->/g,qt=/>/g,w=RegExp(`>|${Et}(?:([^\\s"'>=/]+)(${Et}*=${Et}*(?:[^
4
4
  \f\r"'\`<>=]|("|')|))|$)`,"g"),Gt=/'/g,Kt=/"/g,Yt=/^(?:script|style|textarea|title)$/i,Ct=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),fs=Ct(1),ms=Ct(2),ys=Ct(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Qt=new WeakMap,O=T.createTreeWalker(T,129);function Zt(s,t){if(!_t(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wt!==void 0?Wt.createHTML(t):t}var Xt=(s,t)=>{let e=s.length-1,o=[],n,r=t===2?"<svg>":t===3?"<math>":"",i=H;for(let a=0;a<e;a++){let c=s[a],l,u,h=-1,m=0;for(;m<c.length&&(i.lastIndex=m,u=i.exec(c),u!==null);)m=i.lastIndex,i===H?u[1]==="!--"?i=Ft:u[1]!==void 0?i=qt:u[2]!==void 0?(Yt.test(u[2])&&(n=RegExp("</"+u[2],"g")),i=w):u[3]!==void 0&&(i=w):i===w?u[0]===">"?(i=n??H,h=-1):u[1]===void 0?h=-2:(h=i.lastIndex-u[2].length,l=u[1],i=u[3]===void 0?w:u[3]==='"'?Kt:Gt):i===Kt||i===Gt?i=w:i===Ft||i===qt?i=H:(i=w,n=void 0);let v=i===w&&s[a+1].startsWith("/>")?" ":"";r+=i===H?c+Ne:h>=0?(o.push(l),c.slice(0,h)+bt+c.slice(h)+_+v):c+_+(h===-2?a:v)}return[Zt(s,r+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},B=class s{constructor({strings:t,_$litType$:e},o){let n;this.parts=[];let r=0,i=0,a=t.length-1,c=this.parts,[l,u]=Xt(t,e);if(this.el=s.createElement(l,o),O.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=O.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(bt)){let m=u[i++],v=n.getAttribute(h).split(_),C=/([.?@])?(.*)/.exec(m);c.push({type:1,index:r,name:C[2],strings:v,ctor:C[1]==="."?ot:C[1]==="?"?nt:C[1]==="@"?rt:P}),n.removeAttribute(h)}else h.startsWith(_)&&(c.push({type:6,index:r}),n.removeAttribute(h));if(Yt.test(n.tagName)){let h=n.textContent.split(_),m=h.length-1;if(m>0){n.textContent=et?et.emptyScript:"";for(let v=0;v<m;v++)n.append(h[v],z()),O.nextNode(),c.push({type:2,index:++r});n.append(h[m],z())}}}else if(n.nodeType===8)if(n.data===At)c.push({type:2,index:r});else{let h=-1;for(;(h=n.data.indexOf(_,h+1))!==-1;)c.push({type:7,index:r}),h+=_.length-1}r++}}static createElement(t,e){let o=T.createElement("template");return o.innerHTML=t,o}};function S(s,t,e=s,o){if(t===f)return t;let n=o!==void 0?e._$Co?.[o]:e._$Cl,r=V(t)?void 0:t._$litDirective$;return n?.constructor!==r&&(n?._$AO?.(!1),r===void 0?n=void 0:(n=new r(s),n._$AT(s,e,o)),o!==void 0?(e._$Co??=[])[o]=n:e._$Cl=n),n!==void 0&&(t=S(s,n._$AS(s,t.values),n,o)),t}var st=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:o}=this._$AD,n=(t?.creationScope??T).importNode(e,!0);O.currentNode=n;let r=O.nextNode(),i=0,a=0,c=o[0];for(;c!==void 0;){if(i===c.index){let l;c.type===2?l=new L(r,r.nextSibling,this,t):c.type===1?l=new c.ctor(r,c.name,c.strings,this,t):c.type===6&&(l=new it(r,this,t)),this._$AV.push(l),c=o[++a]}i!==c?.index&&(r=O.nextNode(),i++)}return O.currentNode=T,n}p(t){let e=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,e),e+=o.strings.length-2):o._$AI(t[e])),e++}},L=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,o,n){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=o,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),V(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Jt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&V(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:o}=t,n=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=B.createElement(Zt(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===n)this._$AH.p(e);else{let r=new st(n,this),i=r.u(this.options);r.p(e),this.T(i),this._$AH=r}}_$AC(t){let e=Qt.get(t.strings);return e===void 0&&Qt.set(t.strings,e=new B(t)),e}k(t){_t(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,o,n=0;for(let r of t)n===e.length?e.push(o=new s(this.O(z()),this.O(z()),this,this.options)):o=e[n],o._$AI(r),n++;n<e.length&&(this._$AR(o&&o._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let o=Bt(t).nextSibling;Bt(t).remove(),t=o}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,o,n,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=d}_$AI(t,e=this,o,n){let r=this.strings,i=!1;if(r===void 0)t=S(this,t,e,0),i=!V(t)||t!==this._$AH&&t!==f,i&&(this._$AH=t);else{let a=t,c,l;for(t=r[0],c=0;c<r.length-1;c++)l=S(this,a[o+c],e,c),l===f&&(l=this._$AH[c]),i||=!V(l)||l!==this._$AH[c],l===d?t=d:t!==d&&(t+=(l??"")+r[c+1]),this._$AH[c]=l}i&&!n&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ot=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},nt=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},rt=class extends P{constructor(t,e,o,n,r){super(t,e,o,n,r),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===f)return;let o=this._$AH,n=t===d&&o!==d||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==d&&(o===d||n);n&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},it=class{constructor(t,e,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},te={M:bt,P:_,A:At,C:1,L:Xt,R:st,D:Jt,V:S,I:L,H:P,N:nt,U:rt,B:ot,F:it},xe=$t.litHtmlPolyfillSupport;xe?.(B,L),($t.litHtmlVersions??=[]).push("3.3.2");var wt=(s,t,e)=>{let o=e?.renderBefore??t,n=o._$litPart$;if(n===void 0){let r=e?.renderBefore??null;o._$litPart$=n=new L(t.insertBefore(z(),r),r,void 0,e??{})}return n._$AI(s),n};var Ot=globalThis,E=class extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=wt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};E._$litElement$=!0,E.finalized=!0,Ot.litElementHydrateSupport?.({LitElement:E});var De=Ot.litElementPolyfillSupport;De?.({LitElement:E});(Ot.litElementVersions??=[]).push("4.2.2");var p=(s,t,...e)=>{try{return s?.call(t,...e)}catch(o){console.error(o,s)}},W=async(s,t,...e)=>{try{return await s?.call(t,...e)}catch(o){console.error(o,s)}};var q=Symbol.for("controller"),Le=s=>typeof s=="object"&&s!==null&&(q in s||"hostConnected"in s||"hostDisconnected"in s||"hostUpdate"in s||"hostUpdated"in s),Ns=s=>typeof s?.then=="function";var F,x=s=>{F!==s&&(F=s,queueMicrotask(()=>F===s?F=void 0:0))},G=s=>F,N=[],ee=s=>{if(s===void 0){N=[];return}let t=N.indexOf(s);N=t===-1?[...N,s]:N.slice(0,t+1),queueMicrotask(()=>N=[])},se=()=>N,U,xs=s=>{U!==s&&(U=s,queueMicrotask(()=>U===s?U=void 0:0))},Ue=()=>{let s=U;return U=void 0,s},oe=async(s,t)=>{let e=ct(s);if(e===void 0)return s;if(await e.ready,typeof t=="function"){let o=e.watchExports(n=>t(n,o))}return e.exports},ne=async s=>{let t=ct(s);return await t.ready,t},ct=s=>{let e=G().manager.X(s);if(e!==void 0)return e;if(Le(s))return s;let o=Ue();if(o!==void 0)return o},at=!1,Ds=s=>{at=!0;try{return s()}finally{at=!1}};var b=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}};var re=(s,t)=>{let e=t>Re?Ie:t/Me,o=0,n=setInterval(()=>{o+=e,o>=t&&(clearInterval(n),s())},e);return n},Re=4e3,Ie=2e3,Me=4;var ke=(s,t,e)=>{let o=Object.keys(s),n=o.length;R===void 0&&queueMicrotask(I),R??=new Map;let r=R.get(s);return r===void 0&&(r={callbacks:[],keyCount:n},R.set(s,r)),r.keyCount!==n&&(r.callbacks.forEach(i=>i(o)),r.callbacks=[],r.keyCount=n),r.callbacks.push(i=>{let a=l=>p(t,null,l),c=i[n];c===void 0?a(void 0):s[c]===e?a(c):a(void 0)}),e},R,I=()=>{R?.forEach(({callbacks:s},t)=>{let e=Object.keys(t);s.forEach(o=>o(e))}),R=void 0},je=(s,t,e)=>{let o=s.manager;return o.V!==d&&o.V!==e&&o.S(void 0,void 0),o.T.length===0&&queueMicrotask(()=>o.S(void 0,void 0)),o.V=e,o.T.push((n,r)=>p(t,void 0,e===r?n:void 0)),e},He=(s=[G(),...se()],t,e)=>{let o=Array.isArray(s)?s:[s],n=o.length+1,r=i=>{n-=1,i!==void 0&&(n=Math.min(n,0)),n===0&&t(i)};o.forEach(i=>ke(i,a=>r(a===void 0?void 0:{key:a,host:i,isReactive:!1}),e));for(let i of o)if("manager"in i&&i.manager.component===i){je(i,a=>r(a===void 0?void 0:{key:a,host:i,isReactive:!0}),e);break}return e},ze=(s="",t={},e=G())=>{let o={emit:n=>{s===""&&I();let r=new CustomEvent(s,{detail:n,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(r),r}};return s===""&&He(void 0,n=>s=n.key,o),o},Ve=ze.bind(null,""),ce;ce=q;var Tt=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#n=[],this.#r=[],this.#c=[],this.#l=[],this.#d=[],this.#i=[],this.#p=!1,this.P=new b,this.connectedCalled=!1,this.loadedCalled=!1,this[ce]=!0,this.#h=[];let e=this,o=t??G(new.target.name);e.#o=o,e.ready=e.P.promise,e.#a=ae(e),e.component=o,e.#o.addController(e),e.#o.manager===void 0||(ee(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#n;#r;#c;#l;#d;#i;#p;#o;catchUpLifecycle(){let{manager:t}=this.#o;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#p&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(Mt(this.#o))}#a;get exports(){return this.#a}set exports(t){let e=this.#a;e!==t&&(this.#a=t,this.#h.forEach(p),this.connectedCalled&&this.O!==!1&&this.#o.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#a=e?ae(t):t,this.#h.forEach(p)}#h;watchExports(t){let e=()=>t(this.#a);return this.#h.push(e),()=>{this.#h.splice(this.#h.indexOf(e),1)}}get use(){return x(this.#o),oe}get useRef(){return x(this.#o),ne}get useRefSync(){return x(this.#o),ct}controllerRemoved(){this.#o.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#n.push(t)}onUpdate(t){this.#r.push(t)}onUpdated(t){this.#c.push(t)}onDestroy(t){this.#l.push(t)}onLifecycle(t){this.#d.push(t),this.connectedCalled&&this.#o.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#i.forEach(p),t.#i=[]}async triggerLoad(){if(this.#p)return;this.#p=!0;let t=this;t.hostLoad&&await W(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(W)),this.P.resolve(this.#a)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#n.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#r.forEach(ie,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#c.forEach(ie,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#l.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#d.forEach(this.#u,this)}#u(t){x(this.#o);let e=p(t);(Array.isArray(e)?e:[e]).forEach(n=>{typeof n=="function"?this.#i.push(n):typeof n=="object"&&typeof n.remove=="function"&&this.#i.push(n.remove)})}};function ie(s){p(s,void 0,this)}var le=Tt,ae=s=>{if(typeof s!="object"&&typeof s!="function"||s===null)return s;let t={get(o,n,r){if(!((n==="exports"||n==="_exports")&&n in o&&o[n]===e)&&(n in o||n in Promise.prototype||typeof n=="symbol"))return typeof o=="function"?o[n]:Reflect.get(o,n,r)}},e=new Proxy(s,t);return e};var lt=s=>s.replace(Be,(t,e)=>`${e===0?"":"-"}${t.toLowerCase()}`),Be=/[A-Z]+(?![a-z])|[A-Z]/gu;var Vs=s=>s.charAt(0).toLowerCase()+s.slice(1);var he=(s,t)=>new Array(t+1).join(s),Bs=s=>{let t='"',e="'";s.includes(t)&&!s.includes(e)&&(e='"',t="'");let n=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${e})+)`,"gu");s=s.replace(n,(i,a,c,l)=>a+c+he(e,l.length/2));let r=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${t}+)`,"gu");return s=s.replace(r,(i,a,c,l)=>a+c+he(`\\${t}`,l.length)),t+s+t},Ws=s=>{let t=s?s.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu,"\\$&"):"^.*$";return new RegExp(t,"i")},Fs=s=>`\u200E${s??""}\u200E`,We="randomUUID"in crypto,qs=()=>{if(We)return crypto.randomUUID();let s=crypto.getRandomValues(new Uint16Array(8));s[3]=s[3]&4095|16384,s[4]=s[4]&16383|32768;let t=e=>s[e].toString(16).padStart(4,"0");return`${t(0)+t(1)}-${t(2)}-${t(3)}-${t(4)}-${t(5)}${t(6)}${t(7)}`};var Gs=(s,t={})=>(s??"").replace(/\{(?<valueName>.*?)\}/gu,(e,o)=>t[o]??e);var{I:Fe}=te,de=s=>s;var ht=s=>s.strings===void 0,pe=()=>document.createComment(""),Js=(s,t,e)=>{let o=s._$AA.parentNode,n=t===void 0?s._$AB:t._$AA;if(e===void 0){let r=o.insertBefore(pe(),n),i=o.insertBefore(pe(),n);e=new Fe(r,i,s,s.options)}else{let r=e._$AB.nextSibling,i=e._$AM,a=i!==s;if(a){let c;e._$AQ?.(s),e._$AM=s,e._$AP!==void 0&&(c=s._$AU)!==i._$AU&&e._$AP(c)}if(r!==n||a){let c=e._$AA;for(;c!==r;){let l=de(c).nextSibling;de(o).insertBefore(c,n),c=l}}}return e},Ys=(s,t,e=s)=>(s._$AI(t,e),s),qe={},ue=(s,t=qe)=>s._$AH=t,Zs=s=>s._$AH,Xs=s=>{s._$AR(),s._$AA.remove()};var y={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},$=s=>(...t)=>({_$litDirective$:s,values:t}),g=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=(s,t)=>{let e=s._$AN;if(e===void 0)return!1;for(let o of e)o._$AO?.(t,!1),K(o,t);return!0},dt=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while(e?.size===0)},fe=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),Qe(t)}};function Ge(s){this._$AN!==void 0?(dt(this),this._$AM=s,fe(this)):this._$AM=s}function Ke(s,t=!1,e=0){let o=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(o))for(let r=e;r<o.length;r++)K(o[r],!1),dt(o[r]);else o!=null&&(K(o,!1),dt(o));else K(this,s)}var Qe=s=>{s.type==y.CHILD&&(s._$AP??=Ke,s._$AQ??=Ge)},pt=class extends g{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,o){super._$AT(t,e,o),fe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(K(this,t),dt(this))}setValue(t){if(ht(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var lo=()=>new Pt,Pt=class{},St=new WeakMap,Nt=$(class extends pt{render(s){return d}update(s,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=s.options?.host,this.rt(this.ct=s.element)),d}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=St.get(t);e===void 0&&(e=new WeakMap,St.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){return typeof this.G=="function"?St.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Dt=s=>{let t=s;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(s),(e.I??e._postLoad).promise}return!1},Lt={};function Ut(){}function Rt(s){for(let t of["Associated","Disabled","Reset","StateRestore"]){let e=`orm${t}Callback`;s.prototype["f"+e]=async function(...o){await this.componentOnReady(),(this.el??this).dispatchEvent(new CustomEvent(`luminaF${e}`,{detail:o}))}}}var Ye=(s,t)=>function(o,n){if(!globalThis.customElements)return;let i=(n??o??{}).resourcesUrl;i&&s.setAssetPath(i);for(let[a,[c,l="",u=0]]of Object.entries(t)){if(customElements.get(a))continue;let[h,m,v]=l.split(";"),C=h?h?.split(",").map(Ze):void 0,yt=C?.map(([D])=>D),J=class extends xt{static{this.formAssociated=u===1}static{this.observedAttributes=C?.map(([,D])=>D).filter(D=>D!=="")}static{this.C=yt}static{this.E=m?m?.split(","):void 0}static{this.D=v?.split(",")}static{this.L=a}static{this.K=s}constructor(){!J.B&&(J.B=c(),J.F()),super()}};customElements.define(a,J)}},ut=Object.defineProperty,Ze=s=>{let t=s.split(":");return t.length===1?[t[0],lt(t[0])]:t},Xe=globalThis.HTMLElement??Ut,xt=class extends Xe{constructor(){super(),this.#e={},this.#s=[],this.I=new b,this.H=new b,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(o=>{Object.hasOwn(t,o)&&(t.#e[o]=t[o],delete t[o])}),e.A?t.#n({a:e.A}):e.B.then(async o=>{await e.K.p,t.#n(await(o.default?.then(n=>typeof n=="function"?{a:n}:n)??o))}).catch(o=>{t.H.reject(o),setTimeout(()=>{throw o})})}static{this.lumina=!0}static F(){for(let t of this.C??[])ut(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])ut(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])ut(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}static{Rt(this)}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,o){this.#t?.attributeChangedCallback(t,e,o),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=Dt(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#n(t){let e=this.constructor,o=e.L,n=this.#e,r=Object.values(t).find(h=>h.L===o),i=`${o}--lazy`,a=r;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);es(a),!e.A&&(e.A=r,customElements.define(i,r)),r.N=this;let l=document.createElement(i);r.N=void 0,this.#t=l,this.#e=l,this.#s.forEach(h=>l.attributeChangedCallback(h,null,this.getAttribute(h))),Object.entries(n).forEach(ts,l);let u=this.isConnected;(u||this.G)&&(l.connectedCallback?.(),u||l.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function ts([s,t]){this[s]=t}var es=s=>{let t=s.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(n,r){e.setAttribute.call(this.el,n,r)},t.removeAttribute=function(n){e.removeAttribute.call(this.el,n)},t.hasAttribute=function(n){return e.hasAttribute.call(this.el,n)},ut(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var ft=class extends le{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=mt in t&&typeof t.destroy=="function",E.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${mt} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),I();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),x(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>{this.#e.destroy()};this.#t=re(t,ss)}}S(t,e){let o=this.T;this.V=d,this.T=[],o.forEach(n=>n(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},ss=1e3,mt="autoDestroyDisabled";var ye=$(class extends g{constructor(s){if(super(s),s.type!==y.ATTRIBUTE||s.name!=="class"||s.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(let o in t)t[o]&&!this.nt?.has(o)&&this.st.add(o);return this.render(t)}let e=s.element.classList;for(let o of this.st)o in t||(e.remove(o),this.st.delete(o));for(let o in t){let n=!!t[o];n===this.st.has(o)||this.nt?.has(o)||(n?(e.add(o),this.st.add(o)):(e.remove(o),this.st.delete(o)))}return f}});var ge="important",os=" !"+ge,ns=$(class extends g{constructor(s){if(super(s),s.type!==y.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((t,e)=>{let o=s[e];return o==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(s,[t]){let{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let o of this.ft)t[o]==null&&(this.ft.delete(o),o.includes("-")?e.removeProperty(o):e[o]=null);for(let o in t){let n=t[o];if(n!=null){this.ft.add(o);let r=typeof n=="string"&&n.endsWith(os);o.includes("-")||r?e.setProperty(o,r?n.slice(0,-11):n,r?ge:""):e[o]=n}}return f}});var rs=$(class extends g{constructor(s){if(super(s),s.type!==y.PROPERTY&&s.type!==y.ATTRIBUTE&&s.type!==y.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ht(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[t]){if(t===f||t===d)return t;let e=s.element,o=s.name;if(s.type===y.PROPERTY){if(t===e[o])return f}else if(s.type===y.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(o))return f}else if(s.type===y.ATTRIBUTE&&e.getAttribute(o)===t+"")return f;return ue(s),t}});var ve=class s extends E{constructor(){super(),this.M=[],this.manager=new ft(this);let t=this,e=t.constructor,o=e.N,n=e.K.o,r=s.prototype.shouldUpdate;t.#n=o?.H??new b,t.I=o?.I??new b,t.J=o?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=o??t,t.#s=t.enableUpdating,t.enableUpdating=Ut,t.shouldUpdate!==r&&(t.#e=t.shouldUpdate,t.shouldUpdate=r),n&&(t.#t=new Map,e.elementProperties.forEach((i,a)=>t.#t.set(a,n()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),o=this.shadowRootOptions===Lt;return this.K?.commonStyles===void 0||o?e:[this.K.commonStyles,...e]}static createProperty(t,e){let o=typeof e=="number"?e:Array.isArray(e)?e[0]:0,n=Array.isArray(e)?e[1]:void 0,r=n?.hasChanged??j,i={attribute:o&1&&typeof t=="string"?lt(t):!1,reflect:!!(o&2),type:o&4?Boolean:o&8?Number:void 0,state:!!(o&16),readOnly:!!(o&32),noAccessor:!!(o&64),useDefault:!!(o&128),c:!1,...n,hasChanged(a,c){let l=r(a,c);return i.c=l,l}};super.createProperty(t,i)}static getPropertyDescriptor(t,e,o){let n=this.K,r=super.getPropertyDescriptor(t,e,o);return o.d=r,{...r,get(){return n.t?.(this.#t.get(t)),r.get?.call(this)},set(i){let a=this.manager;if(o.readOnly&&!at&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${i}"`);r.set.call(this,i??void 0),o.c&&this.#t?.get(t)?.notify(),a.T.length>0&&(I(),a?.S(t,i))}}}static{this.lumina=!0}static{Rt(this)}#t;#e;#s;#n;#r;#c;get elementInternals(){return this.#c??=this.el.attachInternals(),this.#c}connectedCallback(){this.hasAttribute("defer-hydration")||this.#l(!0)}#l(t){let e=this.constructor.K.c?.(()=>this.requestUpdate());this.#r=e;let o=!this.manager.connectedCalled;t&&super.connectedCallback(),o?queueMicrotask(()=>this.#i().catch(n=>{this.#n.reject(n),setTimeout(()=>{throw n})})):e&&this.requestUpdate()}#d(t){try{this.#r.clear(),this.constructor.K.r(this.#r,()=>super.update(t))}catch(e){throw this.#r.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#r?.destroy(),this.#r=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,o=e.shadowRootOptions,r=t??(o===Lt?this.el:this.el.attachShadow(o));if(t)return this.manager.connectedCalled||this.#l(!1),E.prototype.createRenderRoot.call(this),t;if(this.isConnected){let i=r.getRootNode();i.adoptedStyleSheets=[...i.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return r}async#i(){let t=this.el.G??Dt(this.el);t&&await t;let e=[];for(let n of this.M)"triggerLoad"in n?e.push(n.triggerLoad()):e.push(W(n.hostLoad,n));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(n=>n.has(mt)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await 0;let o=this.J.filter(n=>!n.manager?.loadedCalled);o.length&&await Promise.allSettled(o.map(async n=>await n.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let n of this.M)"triggerLoaded"in n?n.triggerLoaded():p(n.hostLoaded,n);this.loaded?.(),this.#n.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#r?this.#d(t):super.update(t)}listen(t,e,o){let n=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,n,o),()=>this.el.removeEventListener(t,n,o)))}listenOn(t,e,o,n){let r=o?.bind(this)??o;this.manager.onLifecycle(()=>(t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)))}async componentOnReady(){return await this.#n.promise,this}addController(t){this.M.push(t),!(q in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}};var $e=s=>{let t,e=n=>{t=new URL(n,globalThis.location?.href||void 0).href},o={...s,getAssetPath(n){let r=new URL(n,t);return r.origin!==globalThis.location?.origin?r.href:r.pathname},setAssetPath:e,customElement(n,r){r.K=o,r.L=n,customElements.get(n)||customElements.define(n,r)}};return e(s.defaultAssetPath),o};var Dn=s=>typeof s=="object"&&s!=null?ye(s):s;var It=class extends g{#t;#e;constructor(t){super(t);let e=this;this.#e=function(n){return e.#t.call(this,n)}}render(t){return typeof t=="function"?(this.#t=t,Nt(this.#e)):Nt(t)}},Ln=$(It);var Un=d;var Q=$e({defaultAssetPath:"https://jsdev.arcgis.com/5.1.0-next/coding-components/",hydratedAttribute:"hydrated"}),{customElement:jn,getAssetPath:Hn,setAssetPath:zn}=Q;Q.t=void 0;Q.o=void 0;Q.c=void 0;Q.r=void 0;export{Ns as a,x as b,ee as c,se as d,xs as e,Ds as f,jt as g,be as h,j as i,fs as j,f as k,d as l,He as m,Ve as n,Tt as o,Vs as p,Bs as q,Ws as r,Fs as s,qs as t,Gs as u,Ye as v,y as w,$ as x,g as y,Js as z,Ys as A,ue as B,Zs as C,Xs as D,lo as E,Nt as F,ve as G,Dn as H,Un as I,Q as J,jn as K,Hn as L};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import j from"./27MWFBRL.js";import i from"./FZHOCYLK.js";import f from"./QVWSOD3N.js";import b from"./ZHZFKZA7.js";import"./AHFU2DJA.js";import"./G56LJGLK.js";import"./ER2MKLVA.js";import"./MP6Z45SA.js";import"./IFNCCZ7O.js";import{a as _}from"./BA546EMZ.js";import"./MJ7MJPGA.js";import"./MTIHPCIF.js";import"./6G5URSC7.js";import"./6C52UOYL.js";import{E as l,F as h,G as p,H as r,K as g,h as c,j as e,n as o,t as d}from"./SM3MA3KP.js";import{b as a}from"./BCUUVBXH.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import"./LLPQEURF.js";import"./3TTFCHAA.js";export default $arcgis.t(([,,{a:s},{b:m}])=>{var f=c`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,n=class extends p{constructor(){super(...arguments),this._codeEditorElt=l(),this._disposables=[],this.messages=_(),this._modelId=d(),this._preparing=!1,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.arcgisDiagnosticsChange=o({bubbles:!1}),this.arcgisScriptChange=o({bubbles:!1})}static{this.properties={_activeAction:16,_apiLibrary:16,_editorProfile:16,_preparing:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5,messageOverrides:0}}static{this.styles=[f]}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateEditorProfile().catch(a(this))}willUpdate(i){(i.has("messages")||i.has("profile"))&&this._updateDataModelDeps()}async loaded(){let i=await m();this._disposables.push(i.onDiagnosticsChange(t=>!this._preparing&&this.arcgisDiagnosticsChange.emit(t.diagnostics)))}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _updateEditorProfile(){this._preparing=!0;try{await s.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=s.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._preparing=!1}}_setActiveAction(i){if(this._activeAction===i){this._activeAction=void 0;return}this._activeAction=i}_handleActionClick(i){let t=i.target;this._setActiveAction(t.dataset.panelName)}_insertAsSnippet(i){this._codeEditorElt.value?.insertSnippet(i.detail).catch(a(this))}_insertAsText(i){this._codeEditorElt.value?.insertText(i.detail.replaceAll('"',"'")).catch(a(this))}async _updateApiLibrary(){this._apiLibrary=await s.getApiLibraryForModel(this._modelId)}_onCodeEditorValueChange(i){i.stopPropagation(),this.script=i.detail,this.arcgisScriptChange.emit(i.detail)}_getFeatureSetVariable(){let i,t=s.getEditorProfileForModel(this._modelId);return t?.variables?.length&&t?.variables?.[0]?.type!=="featureSet"?a(this)("Encountered unexpected editor profile"):i=t?.variables?.[0],i}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}render(){let i=this._getFeatureSetVariable();return e`<arcgis-code-editor-shell><arcgis-code-editor slot=editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} ${h(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar&&i&&e`<arcgis-editor-variables slot=side-panel .variable=${i} .closed=${this._activeAction!=="fields"} class=${r(this._activeAction==="fields"?"":"hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} data-panel-name=none .messageOverrides=${{profileempty:this.messages.profileempty}}></arcgis-editor-variables>`||""}${!this.hideSideBar&&e`<arcgis-language-api-panel slot=side-panel class=${r(this._activeAction==="functions"?"":"hidden")} .closed=${this._activeAction!=="functions"} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${s.languageId}></arcgis-language-api-panel>`||""}${!this.hideSideBar&&e`<calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}>${i&&e`<calcite-action id=fields-action .text=${this.messages.fields??"Fields"} icon=profile-variables .active=${this._activeAction==="fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>`||""}${i&&!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields??"Fields"}</span></calcite-tooltip>`||""}<calcite-action id=functions-action .text=${this.messages.functions??"Functions"} icon=function .active=${this._activeAction==="functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions??"Functions"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</arcgis-code-editor-shell>`}};g("arcgis-sql-expression-editor",n);return n},b,f,i,j)
2
+ import j from"./CHTL74L2.js";import i from"./YJW6NUWX.js";import f from"./GZ6HZKQZ.js";import b from"./ZHZFKZA7.js";import"./P7I5ATMN.js";import"./G56LJGLK.js";import"./ER2MKLVA.js";import"./MP6Z45SA.js";import"./IFNCCZ7O.js";import{a as _}from"./SB3MM5EM.js";import"./KCU2C44H.js";import"./GS2ISVXJ.js";import"./6G5URSC7.js";import"./6C52UOYL.js";import{E as l,F as h,G as p,H as r,K as g,h as c,j as e,n as o,t as d}from"./REL6OK2I.js";import{b as a}from"./Y3KOWWO5.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import"./LLPQEURF.js";import"./3TTFCHAA.js";export default $arcgis.t(([,,{a:s},{b:m}])=>{var f=c`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,n=class extends p{constructor(){super(...arguments),this._codeEditorElt=l(),this._disposables=[],this.messages=_(),this._modelId=d(),this._preparing=!1,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.arcgisDiagnosticsChange=o({bubbles:!1}),this.arcgisScriptChange=o({bubbles:!1})}static{this.properties={_activeAction:16,_apiLibrary:16,_editorProfile:16,_preparing:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5,messageOverrides:0}}static{this.styles=[f]}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateEditorProfile().catch(a(this))}willUpdate(i){(i.has("messages")||i.has("profile"))&&this._updateDataModelDeps()}async loaded(){let i=await m();this._disposables.push(i.onDiagnosticsChange(t=>!this._preparing&&this.arcgisDiagnosticsChange.emit(t.diagnostics)))}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _updateEditorProfile(){this._preparing=!0;try{await s.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=s.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._preparing=!1}}_setActiveAction(i){if(this._activeAction===i){this._activeAction=void 0;return}this._activeAction=i}_handleActionClick(i){let t=i.target;this._setActiveAction(t.dataset.panelName)}_insertAsSnippet(i){this._codeEditorElt.value?.insertSnippet(i.detail).catch(a(this))}_insertAsText(i){this._codeEditorElt.value?.insertText(i.detail.replaceAll('"',"'")).catch(a(this))}async _updateApiLibrary(){this._apiLibrary=await s.getApiLibraryForModel(this._modelId)}_onCodeEditorValueChange(i){i.stopPropagation(),this.script=i.detail,this.arcgisScriptChange.emit(i.detail)}_getFeatureSetVariable(){let i,t=s.getEditorProfileForModel(this._modelId);return t?.variables?.length&&t?.variables?.[0]?.type!=="featureSet"?a(this)("Encountered unexpected editor profile"):i=t?.variables?.[0],i}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}render(){let i=this._getFeatureSetVariable();return e`<arcgis-code-editor-shell><arcgis-code-editor slot=editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} ${h(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar&&i&&e`<arcgis-editor-variables slot=side-panel .variable=${i} .closed=${this._activeAction!=="fields"} class=${r(this._activeAction==="fields"?"":"hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} data-panel-name=none .messageOverrides=${{profileempty:this.messages.profileempty}}></arcgis-editor-variables>`||""}${!this.hideSideBar&&e`<arcgis-language-api-panel slot=side-panel class=${r(this._activeAction==="functions"?"":"hidden")} .closed=${this._activeAction!=="functions"} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${s.languageId}></arcgis-language-api-panel>`||""}${!this.hideSideBar&&e`<calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}>${i&&e`<calcite-action id=fields-action .text=${this.messages.fields??"Fields"} icon=profile-variables .active=${this._activeAction==="fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>`||""}${i&&!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields??"Fields"}</span></calcite-tooltip>`||""}<calcite-action id=functions-action .text=${this.messages.functions??"Functions"} icon=function .active=${this._activeAction==="functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions??"Functions"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</arcgis-code-editor-shell>`}};g("arcgis-sql-expression-editor",n);return n},b,f,i,j)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{b as r}from"./MJ7MJPGA.js";import{L as o}from"./SM3MA3KP.js";var s=r(o);export{s as a};
2
+ import{b as r}from"./KCU2C44H.js";import{L as o}from"./REL6OK2I.js";var s=r(o);export{s as a};