@arcgis/coding-components 4.31.0-next.56 → 4.31.0-next.57
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.
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +1 -1
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-47da1193.entry.js → p-093e8e6b.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-dbc5c2e8.js → p-185b723d.js} +1 -1
- package/dist/arcgis-coding-components/{p-529e06e1.js → p-2c054356.js} +2 -2
- package/dist/arcgis-coding-components/{p-5285c444.js → p-31933b07.js} +2 -2
- package/dist/arcgis-coding-components/{p-8afe732b.js → p-4bf08a57.js} +2 -2
- package/dist/arcgis-coding-components/{p-b620b06c.js → p-6d6bdb0f.js} +2 -2
- package/dist/arcgis-coding-components/{p-9e8d27e9.js → p-89a2def9.js} +2 -2
- package/dist/arcgis-coding-components/{p-605de796.js → p-a2f6c223.js} +9 -9
- package/dist/arcgis-coding-components/{p-e36a3779.js → p-a481de5e.js} +2 -2
- package/dist/arcgis-coding-components/{p-f2a42428.entry.js → p-aabceafe.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-515abc51.js → p-c6b40018.js} +1 -1
- package/dist/arcgis-coding-components/{p-bf988dbf.js → p-dc8c3ed4.js} +2 -2
- package/dist/arcgis-coding-components/{p-4d8c4601.js → p-dd450f49.js} +2 -2
- package/dist/arcgis-coding-components/{p-4afbb375.js → p-de81b06b.js} +1 -1
- package/dist/arcgis-coding-components/{p-3966b909.entry.js → p-df7aeeab.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-0048c7be.js → p-e35aef92.js} +2 -2
- package/dist/arcgis-coding-components/{p-4d15b7fb.js → p-f24b7fdd.js} +2 -2
- package/dist/arcgis-coding-components/{p-d6a50105.js → p-fa0c2419.js} +2 -2
- package/dist/cjs/{app-globals-0b20f844.js → app-globals-e4d2224b.js} +1 -1
- package/dist/cjs/{arcade-defaults-d588ea90.js → arcade-defaults-6022060e.js} +4 -4
- package/dist/cjs/{arcade-mode-23964e19.js → arcade-mode-7d42dff8.js} +2 -2
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +5 -5
- package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +4 -4
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +4 -4
- package/dist/cjs/{css-1527ad06.js → css-e6ce760c.js} +1 -1
- package/dist/cjs/{cssMode-266600eb.js → cssMode-3904a320.js} +2 -2
- package/dist/cjs/{html-c79594b0.js → html-56932f45.js} +2 -2
- package/dist/cjs/{htmlMode-9f7c4794.js → htmlMode-9830568d.js} +2 -2
- package/dist/cjs/{index-a6a79883.js → index-28677ffe.js} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{javascript-f757ee11.js → javascript-d3890594.js} +3 -3
- package/dist/cjs/{jsonMode-730c12d6.js → jsonMode-da5a29f5.js} +2 -2
- package/dist/cjs/{language-defaults-base-f992e8fd.js → language-defaults-base-57c26be3.js} +9 -9
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{sql-expr-defaults-14e3c0f4.js → sql-expr-defaults-cc815f92.js} +5 -6
- package/dist/cjs/{sql-expr-mode-5cf780b5.js → sql-expr-mode-a9a51ba2.js} +4 -4
- package/dist/cjs/{tsMode-f009817f.js → tsMode-fe223daf.js} +2 -2
- package/dist/cjs/{typescript-b067d8ea.js → typescript-8041f8d3.js} +2 -2
- package/dist/components/arcade-defaults.js +1 -1
- package/dist/components/arcade-mode.js +1 -1
- package/dist/components/arcade-results.js +2 -2
- package/dist/components/arcade-suggestions.js +2 -2
- package/dist/components/arcade-variables.js +2 -2
- package/dist/components/arcgis-arcade-editor.js +2 -2
- package/dist/components/arcgis-arcade-results.js +1 -1
- package/dist/components/arcgis-arcade-suggestions.js +1 -1
- package/dist/components/arcgis-arcade-variables.js +1 -1
- package/dist/components/arcgis-assets.d.ts +1 -1
- package/dist/components/arcgis-assets.js +1 -1
- package/dist/components/arcgis-code-editor.js +1 -1
- package/dist/components/arcgis-language-api-panel.js +1 -1
- package/dist/components/arcgis-sql-expression-editor.js +2 -2
- package/dist/components/arcgis-sql-expression-fields.js +1 -1
- package/dist/components/{chunk-W77CUVCX.js → chunk-HOKLTU7K.js} +2 -3
- package/dist/components/code-editor.js +2 -2
- package/dist/components/fields.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/language-api-panel.js +2 -2
- package/dist/components/language-defaults-base.js +1 -1
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +1 -1
- package/dist/components/sql-expr-mode.js +1 -1
- package/dist/components/sql-expression-fields.js +2 -2
- package/dist/components/useT9n.js +2 -2
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-68a9d20e.js → app-globals-f06ee385.js} +1 -1
- package/dist/esm/{arcade-defaults-06fa8817.js → arcade-defaults-642cfe51.js} +4 -4
- package/dist/esm/{arcade-mode-e2e247bd.js → arcade-mode-630fff19.js} +2 -2
- package/dist/esm/arcgis-arcade-editor_6.entry.js +5 -5
- package/dist/esm/arcgis-coding-components.js +4 -4
- package/dist/esm/arcgis-sql-expression-editor.entry.js +4 -4
- package/dist/esm/arcgis-sql-expression-fields.entry.js +4 -4
- package/dist/esm/{css-9bd3c065.js → css-189e8735.js} +1 -1
- package/dist/esm/{cssMode-b0760052.js → cssMode-816f9678.js} +2 -2
- package/dist/esm/{html-bccc0bb4.js → html-6b4525a8.js} +2 -2
- package/dist/esm/{htmlMode-d49b807b.js → htmlMode-5f53ddd5.js} +2 -2
- package/dist/esm/{index-b5d43ca7.js → index-e16d3c00.js} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/{javascript-56c5dd2a.js → javascript-a41eb9e8.js} +3 -3
- package/dist/esm/{jsonMode-5e5edb97.js → jsonMode-532dad15.js} +2 -2
- package/dist/esm/{language-defaults-base-307b77e5.js → language-defaults-base-68fbc270.js} +9 -9
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{sql-expr-defaults-c2608671.js → sql-expr-defaults-6e670d95.js} +5 -6
- package/dist/esm/{sql-expr-mode-a76dd370.js → sql-expr-mode-bac6ca53.js} +4 -4
- package/dist/esm/{tsMode-81f755f4.js → tsMode-87437826.js} +2 -2
- package/dist/esm/{typescript-63767e00.js → typescript-c147296b.js} +2 -2
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/package.json +12 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.57
|
|
5
5
|
*/
|
|
6
6
|
var e=Object.defineProperty,t=new WeakMap,n=e=>t.get(e),l=(e,n)=>t.set(n.t=e,n),o=(e,t)=>t in e,r=(e,t)=>(0,console.error)(e,t),s=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="http://www.w3.org/1999/xlink",a="undefined"!=typeof window?window:{},f=a.document||{head:{}},h={l:0,o:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},d=e=>Promise.resolve(e),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),m=!1,y=[],v=[],w=(e,t)=>n=>{e.push(n),m||(m=!0,t&&4&h.l?g(b):h.raf(b))},$=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){r(e)}e.length=0},b=()=>{$(y),$(v),(m=y.length>0)&&h.raf(b)},g=e=>d().then(e),S=w(v,!0),k=e=>{const t=new URL(e,h.o);return t.origin!==a.location.origin?t.href:t.pathname},j={},O=e=>"object"==(e=typeof e)||"function"===e;function E(e){var t,n,l;return null!=(l=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?l:void 0}((t,n)=>{for(var l in n)e(t,l,{get:n[l],enumerable:!0})})({},{err:()=>x,map:()=>M,ok:()=>C,unwrap:()=>L,unwrapErr:()=>R});var C=e=>({isOk:!0,isErr:!1,value:e}),x=e=>({isOk:!1,isErr:!0,value:e});function M(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>C(e))):C(n)}if(e.isErr)return x(e.value);throw"should never get here"}var P,U,L=e=>{if(e.isOk)return e.value;throw e.value},R=e=>{if(e.isErr)return e.value;throw e.value},T=(e,t,...n)=>{let l=null,o=null,r=!1,s=!1;const i=[],c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((r="function"!=typeof e&&!O(l))&&(l+=""),r&&s?i[i.length-1].i+=l:i.push(r?W(null,l):l),s=r)};if(c(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,i,D);const u=W(e,null);return u.u=t,i.length>0&&(u.h=i),u.p=o,u},W=(e,t)=>({l:0,m:e,i:t,v:null,h:null,u:null,p:null}),A={},D={forEach:(e,t)=>e.map(F).forEach(t),map:(e,t)=>e.map(F).map(t).map(H)},F=e=>({vattrs:e.u,vchildren:e.h,vkey:e.p,vname:e.$,vtag:e.m,vtext:e.i}),H=e=>{if("function"==typeof e.vtag){const t={...e.vattrs};return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),T(e.vtag,t,...e.vchildren||[])}const t=W(e.vtag,e.vtext);return t.u=e.vattrs,t.h=e.vchildren,t.p=e.vkey,t.$=e.vname,t},N=e=>n(e).$hostElement$,q=(e,t,n)=>{const l=N(e);return{emit:e=>G(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},G=(e,t,n)=>{const l=h.ce(t,n);return e.dispatchEvent(l),l},V=new WeakMap,_=e=>"sc-"+e.S,z=(e,t,n,l,r,s)=>{if(n!==l){let i=o(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=I(n),r=I(l);t.remove(...o.filter((e=>e&&!r.includes(e)))),t.add(...r.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const o=O(l);if((i||o&&null!==l)&&!r)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}let a=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,a=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(a?e.removeAttributeNS(u,t):e.removeAttribute(t)):(!i||4&s||r)&&!o&&(l=!0===l?"":l,a?e.setAttributeNS(u,t,l):e.setAttribute(t,l))}else if(t="-"===t[2]?t.slice(3):o(a,c)?c.slice(2):c[2]+t.slice(3),n||l){const o=t.endsWith(J);t=t.replace(K,""),n&&h.rel(e,t,n,o),l&&h.ael(e,t,l,o)}}},B=/\s/,I=e=>e?e.split(B):[],J="Capture",K=RegExp(J+"$"),Q=(e,t,n)=>{const l=11===t.v.nodeType&&t.v.host?t.v.host:t.v,o=e&&e.u||j,r=t.u||j;for(const e of X(Object.keys(o)))e in r||z(l,e,o[e],void 0,n,t.l);for(const e of X(Object.keys(r)))z(l,e,o[e],r[e],n,t.l)};function X(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var Y=!1,Z=(e,t,n)=>{const l=t.h[n];let o,r,s=0;if(null!==l.i)o=l.v=f.createTextNode(l.i);else if(o=l.v=f.createElement(l.m),Q(null,l,Y),null!=P&&o["s-si"]!==P&&o.classList.add(o["s-si"]=P),l.h)for(s=0;s<l.h.length;++s)r=Z(e,l,s),r&&o.appendChild(r);return o["s-hn"]=U,o},ee=(e,t,n,l,o,r)=>{let s,i=e;for(i.shadowRoot&&i.tagName===U&&(i=i.shadowRoot);o<=r;++o)l[o]&&(s=Z(null,n,o),s&&(l[o].v=s,re(i,s,t)))},te=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.v;oe(t),e&&e.remove()}}},ne=(e,t,n=!1)=>e.m===t.m&&(!!n||e.p===t.p),le=(e,t,n=!1)=>{const l=t.v=e.v,o=e.h,r=t.h,s=t.i;null===s?(Q(e,t,Y),null!==o&&null!==r?((e,t,n,l,o=!1)=>{let r,s,i=0,c=0,u=0,a=0,f=t.length-1,h=t[0],d=t[f],p=l.length-1,m=l[0],y=l[p];for(;i<=f&&c<=p;)if(null==h)h=t[++i];else if(null==d)d=t[--f];else if(null==m)m=l[++c];else if(null==y)y=l[--p];else if(ne(h,m,o))le(h,m,o),h=t[++i],m=l[++c];else if(ne(d,y,o))le(d,y,o),d=t[--f],y=l[--p];else if(ne(h,y,o))le(h,y,o),re(e,h.v,d.v.nextSibling),h=t[++i],y=l[--p];else if(ne(d,m,o))le(d,m,o),re(e,d.v,h.v),d=t[--f],m=l[++c];else{for(u=-1,a=i;a<=f;++a)if(t[a]&&null!==t[a].p&&t[a].p===m.p){u=a;break}u>=0?(s=t[u],s.m!==m.m?r=Z(t&&t[c],n,u):(le(s,m,o),t[u]=void 0,r=s.v),m=l[++c]):(r=Z(t&&t[c],n,c),m=l[++c]),r&&re(h.v.parentNode,r,h.v)}i>f?ee(e,null==l[p+1]?null:l[p+1].v,n,l,c,p):c>p&&te(t,i,f)})(l,o,t,r,n):null!==r?(null!==e.i&&(l.textContent=""),ee(l,null,t,r,0,r.length-1)):null!==o&&te(o,0,o.length-1)):e.i!==s&&(l.data=s)},oe=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(oe)},re=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),se=(e,t)=>{t&&!e.k&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.k=t)))},ie=(e,t)=>{if(e.l|=16,!(4&e.l))return se(e,e.j),S((()=>ce(e,t)));e.l|=512},ce=(e,t)=>{const n=e.t;if(!n)throw Error(`Can't render component <${e.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=ye(n,t?"componentWillLoad":"componentWillUpdate"),ue(l,(()=>fe(e,n,t)))},ue=(e,t)=>ae(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),ae=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,fe=async(e,t,n)=>{var l;const o=e.$hostElement$,r=o["s-rc"];n&&(e=>{const t=e.O,n=e.$hostElement$,l=t.l,o=((e,t)=>{var n;const l=_(t),o=i.get(l);if(e=11===e.nodeType?e:f,o)if("string"==typeof o){let r,s=V.get(e=e.head||e);if(s||V.set(e,s=new Set),!s.has(l)){{r=f.createElement("style"),r.innerHTML=o;const t=null!=(n=h.C)?n:E(f);null!=t&&r.setAttribute("nonce",t),e.insertBefore(r,e.querySelector("link"))}4&t.l&&(r.innerHTML+=c),s&&s.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);he(e,t,o,n),r&&(r.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>de(e);0===t.length?n():(Promise.all(t).then(n),e.l|=4,t.length=0)}},he=(e,t,n,l)=>{try{t=t.render(),e.l&=-17,e.l|=2,((e,t,n=!1)=>{const l=e.$hostElement$,o=e.O,r=e.M||W(null,null),s=(e=>e&&e.m===A)(t)?t:T(null,null,t);if(U=l.tagName,o.P&&(s.u=s.u||{},o.P.map((([e,t])=>s.u[t]=l[e]))),n&&s.u)for(const e of Object.keys(s.u))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(s.u[e]=l[e]);s.m=null,s.l|=4,e.M=s,s.v=r.v=l.shadowRoot||l,P=l["s-sc"],le(r,s,n)})(e,t,l)}catch(t){r(t,e.$hostElement$)}return null},de=e=>{const t=e.$hostElement$,n=e.t,l=e.j;64&e.l?ye(n,"componentDidUpdate"):(e.l|=64,ve(t),ye(n,"componentDidLoad"),e.U(t),l||me()),e.L(t),e.k&&(e.k(),e.k=void 0),512&e.l&&g((()=>ie(e,!1))),e.l&=-517},pe=e=>{{const t=n(e),l=t.$hostElement$.isConnected;return l&&2==(18&t.l)&&ie(t,!1),l}},me=()=>{ve(f.documentElement),g((()=>G(a,"appload",{detail:{namespace:"arcgis-coding-components"}})))},ye=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){r(e)}},ve=e=>e.setAttribute("hydrated",""),we=(e,t,l)=>{var o,s;const i=e.prototype;if(t.R||t.T||e.watchers){e.watchers&&!t.T&&(t.T=e.watchers);const c=Object.entries(null!=(o=t.R)?o:{});if(c.map((([e,[o]])=>{31&o||2&l&&32&o?Object.defineProperty(i,e,{get(){return((e,t)=>n(this).W.get(t))(0,e)},set(l){((e,t,l,o)=>{const s=n(e);if(!s)throw Error(`Couldn't find host element for "${o.S}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const i=s.$hostElement$,c=s.W.get(t),u=s.l,a=s.t;if(l=((e,t)=>null==e||O(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(l,o.R[t][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(s.W.set(t,l),a)){if(o.T&&128&u){const e=o.T[t];e&&e.map((e=>{try{a[e](l,c,t)}catch(e){r(e,i)}}))}if(2==(18&u)){if(a.componentShouldUpdate&&!1===a.componentShouldUpdate(l,c,t))return;ie(s,!1)}}})(this,e,l,t)},configurable:!0,enumerable:!0}):1&l&&64&o&&Object.defineProperty(i,e,{value(...t){var l;const o=n(this);return null==(l=null==o?void 0:o.A)?void 0:l.then((()=>{var n;return null==(n=o.t)?void 0:n[e](...t)}))}})})),1&l){const l=new Map;i.attributeChangedCallback=function(e,o,r){h.jmp((()=>{var s;const c=l.get(e);if(this.hasOwnProperty(c))r=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==r)return;if(null==c){const l=n(this),i=null==l?void 0:l.l;if(i&&!(8&i)&&128&i&&r!==o){const n=l.t,i=null==(s=t.T)?void 0:s[e];null==i||i.forEach((t=>{null!=n[t]&&n[t].call(n,r,o,e)}))}return}}this[c]=(null!==r||"boolean"!=typeof this[c])&&r}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=t.T)?s:{}),...c.filter((([e,t])=>15&t[0])).map((([e,n])=>{var o;const r=n[1]||e;return l.set(r,e),512&n[0]&&(null==(o=t.P)||o.push([e,r])),r}))]))}}return e},$e=e=>{ye(e,"connectedCallback")},be=e=>{ye(e,"disconnectedCallback")},ge=(e,o={})=>{var u;const d=[],m=o.exclude||[],y=a.customElements,v=f.head,w=v.querySelector("meta[charset]"),$=f.createElement("style"),b=[];let g,S=!0;Object.assign(h,o),h.o=new URL(o.resourcesUrl||"./",f.baseURI).href;let k=!1;if(e.map((e=>{e[1].map((o=>{var c;const u={l:o[0],S:o[1],R:o[2],D:o[3]};4&u.l&&(k=!0),u.R=o[2],u.P=[],u.T=null!=(c=o[4])?c:{};const a=u.S,f=class extends HTMLElement{constructor(e){if(super(e),this.hasRegisteredEventListeners=!1,((e,n)=>{const l={l:0,$hostElement$:e,O:n,W:new Map};l.A=new Promise((e=>l.L=e)),l.F=new Promise((e=>l.U=e)),e["s-p"]=[],e["s-rc"]=[],t.set(e,l)})(e=this,u),1&u.l)if(e.shadowRoot){if("open"!==e.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${u.S}! Mode is set to ${e.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else e.attachShadow({mode:"open"})}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),g&&(clearTimeout(g),g=null),S?b.push(this):h.jmp((()=>(e=>{if(!(1&h.l)){const t=n(e),o=t.O,c=()=>{};if(1&t.l)(null==t?void 0:t.t)?$e(t.t):(null==t?void 0:t.F)&&t.F.then((()=>$e(t.t)));else{t.l|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){se(t,t.j=n);break}}o.R&&Object.entries(o.R).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let o;if(!(32&t.l)){if(t.l|=32,n.H){const e=(e=>{const t=e.S.replace(/-/g,"_"),n=e.H;if(!n)return;const l=s.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(s.set(n,e),e[t])),r)
|
|
7
7
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(e&&"then"in e){const t=()=>{};o=await e,t()}else o=e;if(!o)throw Error(`Constructor for "${n.S}#${t.N}" was not found`);o.isProxied||(n.T=o.watchers,we(o,n,2),o.isProxied=!0);const i=()=>{};t.l|=8;try{o.__forceUpdate=pe,o.__registerControllers=e=>(l(e,t),t.O.R??{}),new o(t),o.__registerControllers=void 0}catch(e){r(e)}t.l&=-9,t.l|=128,i(),$e(t.t)}else o=e.constructor,customElements.whenDefined(e.localName).then((()=>t.l|=128));if(o&&o.style){let e;"string"==typeof o.style&&(e=o.style);const t=_(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);p&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.l)),l()}}}const c=t.j,u=()=>ie(t,!0);c&&c["s-rc"]?c["s-rc"].push(u):u()})(e,t,o)}c()}})(this)))}disconnectedCallback(){h.jmp((()=>(async()=>{if(!(1&h.l)){const e=n(this);(null==e?void 0:e.t)?be(e.t):(null==e?void 0:e.F)&&e.F.then((()=>be(e.t)))}})()))}componentOnReady(){return n(this).F}};u.H=e[0],m.includes(a)||y.get(a)||(d.push(a),y.define(a,we(f,u,1)))}))})),d.length>0&&(k&&($.textContent+=c),$.textContent+=d.sort()+"{visibility:hidden}[hydrated]{visibility:inherit}",$.innerHTML.length)){$.setAttribute("data-styles","");const e=null!=(u=h.C)?u:E(f);null!=e&&$.setAttribute("nonce",e),v.insertBefore($,w?w.nextSibling:v.firstChild)}S=!1,b.length?b.map((e=>e.connectedCallback())):h.jmp((()=>g=setTimeout(me,30)))},Se=(e,t)=>t,ke=e=>h.C=e;export{Se as F,A as H,N as a,ge as b,q as c,k as g,T as h,d as p,l as r,ke as s}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.57
|
|
5
5
|
*/
|
|
6
|
-
import{B as t,D as i,C as s,F as e,G as n,H as o,J as r,f as c,i as h,b as a,m as d,L as u,d as f,E as l,U as p}from"./p-605de796.js";import{g as y}from"./p-dbc5c2e8.js";var v,g=(t,i)=>t.manager.internals.members?.[i]?.[0],w=Symbol.for("controller");function b(t){v!==t&&(v=t,queueMicrotask((()=>{v===t&&(v=void 0)})))}function m(){return v}var k,j=[];function L(t){if(void 0===t)return void(j=[]);const i=j.indexOf(t);j=-1===i?[...j,t]:j.slice(0,i+1),queueMicrotask((()=>{j=[]}))}var _,x=async(t,i)=>{const s=O(t);if(void 0===s)return t;if(await s.ready,"function"==typeof i){const t=s.watchExports((s=>i(s,t)))}return s.exports},M=async t=>{const i=O(t);return await i.ready,i},O=t=>{const i=function(){const t=k;return k=void 0,t}();if(void 0!==i)return i;const s=m().manager.internals.resolveExports(t);return void 0!==s?s:(t=>"object"==typeof t&&null!==t&&(w in t||"hostConnected"in t||"hostDisconnected"in t||"hostUpdate"in t||"hostUpdated"in t))(t)?t:void 0},S={setter:!1,getter:!1,readOnly:!1},U=new WeakMap;_=w;var C=class{constructor(t){this._callbacks={hostConnected:[],hostDisconnected:[],hostLoad:[],hostLoaded:[],hostUpdate:[],hostUpdated:[],hostDestroy:[],hostLifecycle:[]},this._ready=new i,this._lifecycleCleanups=[],this.connectedCalled=!1,this._loadCalled=!1,this.loadedCalled=!1,this[_]=!0,this.ready=this._ready.promise,this._exports=P(this),this._exportWatchers=new Set;const s=t??m();this.component=s,this.component.addController(this),L(this),void 0===this.component.manager||queueMicrotask((()=>this.catchUpLifecycle()))}catchUpLifecycle(){const{manager:t}=this.component;!t.connectedCalled||this.connectedCalled||this.triggerConnected(),!t._loadCalled||this.triggerLoad().then((()=>{!t.loadedCalled||this.triggerLoaded()})).catch(console.error)}get exports(){return this._exports}set exports(t){const i=this._exports;i!==t&&(this._exports=t,this._exportWatchers.forEach(n),this.connectedCalled&&!1!==this.assignedProperty&&this.component.requestUpdate(this.assignedProperty,i)),this._ready.resolve(t)}setProvisionalExports(t){this._exports=P(t),this._exportWatchers.forEach(n)}watchExports(t){const i=()=>t(this._exports);return this._exportWatchers.add(i),()=>{this._exportWatchers.delete(i)}}get use(){return b(this.component),x}get useRef(){return b(this.component),M}get useRefSync(){return b(this.component),O}controllerRemoved(){this.component.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this._callbacks.hostConnected.push(t)}onDisconnected(t){this._callbacks.hostDisconnected.push(t)}onLoad(t){this._callbacks.hostLoad.push(t)}onLoaded(t){this._callbacks.hostLoaded.push(t)}onUpdate(t){this._callbacks.hostUpdate.push(t)}onUpdated(t){this._callbacks.hostUpdated.push(t)}onDestroy(t){this._callbacks.hostDestroy.push(t)}onLifecycle(t){this._callbacks.hostLifecycle.push(t),this.connectedCalled&&this.component.el.isConnected&&this._callLifecycle(t)}triggerConnected(){const t=this;t.hostConnected&&n(t.hostConnected,t),this._callbacks.hostConnected.forEach(n),this.triggerLifecycle(),this.connectedCalled=!0}triggerDisconnected(){const t=this;t.hostDisconnected&&n(t.hostDisconnected,t),this._callbacks.hostDisconnected.forEach(n),this._lifecycleCleanups.forEach(n),this._lifecycleCleanups=[]}async triggerLoad(){if(this._loadCalled)return;this._loadCalled=!0;const t=this;t.hostLoad&&await s(t.hostLoad,t),this._callbacks.hostLoad.length>0&&await Promise.allSettled(this._callbacks.hostLoad.map(s)),this._ready.resolve(this._exports)}triggerLoaded(){if(this.loadedCalled)return;const t=this;t.hostLoaded&&n(t.hostLoaded,t),this._callbacks.hostLoaded.forEach(n),this.loadedCalled=!0}triggerUpdate(t){const i=this;i.hostUpdate&&n(i.hostUpdate,i,t),this._callbacks.hostUpdate.forEach(D,t)}triggerUpdated(t){const i=this;i.hostUpdated&&n(i.hostUpdated,i,t),this._callbacks.hostUpdated.forEach(D,t)}triggerDestroy(){const t=this;t.hostDestroy&&n(t.hostDestroy,t),this._callbacks.hostDestroy.forEach(n)}triggerLifecycle(){const t=this;t.hostLifecycle&&this._callLifecycle((()=>t.hostLifecycle())),this._callbacks.hostLifecycle.forEach(this._callLifecycle,this)}_callLifecycle(t){b(this.component);const i=n(t);(Array.isArray(i)?i:[i]).forEach((t=>{"function"==typeof t?this._lifecycleCleanups.push(t):"object"==typeof t&&"function"==typeof t.remove&&this._lifecycleCleanups.push(t.remove)}))}};function D(t){n(t,void 0,this)}var E=C;function P(t){if("object"!=typeof t&&"function"!=typeof t||null===t)return t;const i=new Proxy(t,{get(t,s,e){if(!A.has(s)||!(s in t)||t[s]!==i)return s in t||s in Promise.prototype||"symbol"==typeof s?"function"==typeof t?t[s]:Reflect.get(t,s,e):void 0},set:(t,i,s,e)=>Reflect.set(t,i,s,e)});return i}var A=new Set(["exports","_exports"]),T=void 0;function q(){Array.from(T?.entries()??[]).forEach((([t,{callbacks:i}])=>{const s=Object.keys(t);i.forEach((t=>t(s)))})),T=void 0}function F(t,i,s){var e;const o=i,r=t.manager.internals;(e=r.allWatchers)[o]??(e[o]=[]);const c=r.allWatchers[o],h=s,a=(t,i,s)=>n(h,null,t,i,s);return c.push(a),()=>{const t=c.indexOf(a);-1!==t&&c.splice(t,1)}}var $=class{constructor(t){this.enabledWatchers={},this.allWatchers={},this.enableReadonly=()=>{if(this.enableReadonly=void 0,!this.component.manager.isLit)return;const t=this.component.manager.internals;Object.entries(t.members).forEach((([i,[s]])=>{var e;2048&s&&((e=t.setters)[i]??(e[i]=[]),t.setters[i].push(t.readonlySetter))}))},this.trackedValue=V,this.keyTrackers=[],this.getters={},this.setters={},this.accessorGetter={},this.accessorSetter={},this.reactiveUtilsIntegrations=new Set,this._exports=new WeakMap,this.readonlySetter=(t,i,s)=>{if(S.readOnly)return t;throw new Error(`Cannot assign to read-only property "${s}" of ${this.component.el.tagName.toLowerCase()}. Trying to assign "${String(t)}"`)},this.component=t}firePropTrackers(t,i){const s=this.keyTrackers;this.trackedValue=V,this.keyTrackers=[],s.forEach((s=>s(t,i)))}getSetProxy(t){const i=this.component,s=i.constructor.prototype;if(this._getSetProxy(s,t,"class"),i.manager.isLit)return;const e=i.el.constructor.prototype;s!==e&&this._getSetProxy(e,t,"html")}_getSetProxy(t,i,s){const e=g(this.component,i);let n;do{n=Object.getOwnPropertyDescriptor(t,i)}while(!n&&(t=Object.getPrototypeOf(t)));if(!n)return;const o=n.get,r=n.set,c=I in o,h=I in r;if(c&&h)return;const a=!c,d=!h,u=a?function(){let t=o.call(this);const s=U.get(this);if(void 0===s)return t;const e=s.manager.internals;t=e.accessorGetter[i](t,i);const n=e.getters[i]??R;for(let s=0;s<n.length;s++)t=n[s](t,i);return t}:o,f=d?function(t){const s=o.call(this),n=U.get(this);if(void 0===n)return void r.call(this,t);let c=n.manager.isLit?t??void 0:function(t,i=8){return null==t||"object"==typeof t||"function"==typeof t?t:4&i?"false"!==t&&(""===t||!!t):2&i?Number.parseFloat(t):1&i?String(t):t}(t,e);const h=n.manager.internals;if(c===s)r.call(this,c);else{const t=S.setter?R:h.setters[i]??R;for(let e=0;e<t.length&&(c=t[e](c,s,i),c!==s);e++);c=h.accessorSetter[i](c,s,i),r.call(this,c),c!==s&&h.enabledWatchers[i]?.forEach((t=>t(c,s,i)))}h.keyTrackers.length>0&&h?.firePropTrackers(i,t)}:r;a&&(u[I]=!0),d&&(f[I]=!0),Object.defineProperty(t,i,{...n,get:u,set:f})}markExports(t,i){("object"==typeof i&&null!==i||"function"==typeof i)&&this._exports.set(i,t)}resolveExports(t){return"object"==typeof t&&null!==t||"function"==typeof t?this._exports.get(t):void 0}},R=[],I=Symbol(),V=Symbol(),N=(t,i)=>new W(t,i),W=class extends E{constructor(s,e){const n="addController"in s,o=new Set,r=s;if(r.addController=function(t){o.add(t),!(w in t)&&s.renderRoot&&s.el.isConnected&&t.hostConnected?.()},r.removeController=function(t){o.delete(t),t.controllerRemoved?.()},!n){const t=e??s.constructor.__forceUpdate;r.requestUpdate=()=>t(s)}super(s),this.internals=new $(this.component),this.destroyed=!1,this._updatePromise=new i,this._originalLifecycles={},this.isLit=n,this.component.manager=this,function(i,s){if(s)i.manager.internals.members=Object.fromEntries(Array.from(i.constructor.elementProperties,(([t,i])=>i.noAccessor?void 0:[t,[(i.readOnly?2048:0)|(i.state?32:16)]])).filter(t));else{const t=i.constructor,s=t.__registerControllers?.(i)??void 0;if(t.__registerControllers=void 0,"object"!=typeof s)throw new Error("Failed to retrieve component meta");i.manager.internals.members=Object.fromEntries(Object.entries(s).filter((([t,[i]])=>!!(63&i))))}}(s,n),this._controllers=o,this.exports=void 0,this.hasDestroy=B in this.component&&"function"==typeof this.component.destroy,this._bindLifecycleMethods();const c=this.internals;Object.keys(c.members).forEach((t=>{c.accessorGetter[t]=H,c.accessorSetter[t]=H,c.getSetProxy(t)})),n?this.internals.enabledWatchers=this.internals.allWatchers:Object.defineProperty(s,"updateComplete",{get:async()=>await this._updatePromise.promise}),queueMicrotask(c.enableReadonly),L(void 0),b(s),U.set(s.el,s),U.set(s,s)}_bindLifecycleMethods(){const t=this.component,i=this.isLit,s=t.el===t;this._originalLifecycles={_connectedCallback:i||s?void 0:t.connectedCallback,_disconnectedCallback:i||s?void 0:t.disconnectedCallback,_load:i?t.load:t.componentWillLoad,_loaded:i?t.loaded:t.componentDidLoad,_willUpdate:i?void 0:t.componentWillUpdate,_updated:i?void 0:t.componentDidUpdate,_destroy:t.destroy};const e=this._connectedCallback.bind(this),n=this._disconnectedCallback.bind(this),o=this._update.bind(this),r=this._updated.bind(this);i?t.constructor.prototype.addController.call(t,{hostConnected:e,hostDisconnected:n,hostUpdate:o,hostUpdated:r}):(t.connectedCallback=e,t.disconnectedCallback=n,t.componentWillLoad=this._load.bind(this),t.componentDidLoad=this._loaded.bind(this),t.componentWillUpdate=o,t.componentDidUpdate=r),this.hasDestroy&&(t.destroy=this.destroy.bind(this))}_connectedCallback(){if(this.destroyed){const t=this.component.el.tagName.toLowerCase();throw this.component.el.remove(),new Error(`The ${t} component has already been destroyed. It can not be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${B} prop.`)}void 0!==this._autoDestroyTimeout&&clearTimeout(this._autoDestroyTimeout);const t=this.internals;t.enabledWatchers=t.allWatchers,q(),t.enableReadonly?.(),this._controllers.forEach(J),this._originalLifecycles._connectedCallback?.call(this.component)}_disconnectedCallback(){this.destroyed||(this._controllers.forEach(z),this._originalLifecycles._disconnectedCallback?.call(this.component),this.hasDestroy&&this._setAutoDestroyTimeout())}async _load(){const t=this.internals.reactiveUtilsIntegrations;if(t.size>0)for(const i of t)"triggerLoad"in i?await i.triggerLoad():await s(i.hostLoad,i);await Promise.allSettled(Array.from(this._controllers,K,t)),await(this._originalLifecycles._load?.call(this.component)),this.hasDestroy&&F(this.component,B,(()=>this._setAutoDestroyTimeout()))}_loaded(){this._controllers.forEach(Q),this._originalLifecycles._loaded?.call(this.component)}_update(){this._controllers.forEach(X,this.component.changedProperties),this._originalLifecycles._willUpdate?.call(this.component)}_updated(){const t=this.component;if(this._controllers.forEach(Y,t.changedProperties),this._originalLifecycles._updated?.call(this.component),this.isLit)t.changedProperties=new Map;else{const t=this._updatePromise;this._updatePromise=new i,t.resolve(!0)}}async destroy(){if(!this.destroyed){if(this.component.el.isConnected){this.hasDestroy=!1;try{this.component.el.remove()}finally{this.hasDestroy=!0}}this._autoDestroyTimeout=void 0,this.destroyed=!0,this._controllers.forEach(Z),this._controllers.clear(),await(this._originalLifecycles._destroy?.call(this.component))}}_setAutoDestroyTimeout(){void 0!==this._autoDestroyTimeout&&clearTimeout(this._autoDestroyTimeout),this.component.el.isConnected||this.component.autoDestroyDisabled||(this._autoDestroyTimeout=e((()=>{this.destroy().catch(console.error)}),G))}},B="autoDestroyDisabled",G=1e3,H=t=>t;function J(t){"triggerConnected"in t?t.triggerConnected():n(t.hostConnected,t)}function z(t){"triggerDisconnected"in t?t.triggerDisconnected():n(t.hostDisconnected,t)}async function K(t){this.has(t)||("triggerLoad"in t?await t.triggerLoad():await s(t.hostLoad,t))}function Q(t){"triggerLoaded"in t?t.triggerLoaded():n(t.hostLoaded,t)}function X(t){"triggerUpdate"in t?t.triggerUpdate(this):n(t.hostUpdate,t,this)}function Y(t){"triggerUpdated"in t?t.triggerUpdated(this):n(t.hostUpdated,t,this)}function Z(t){"triggerDestroy"in t?t.triggerDestroy():n(t.hostDestroy,t)}function tt(t,i,s){const e=t.manager.internals;return e.trackedValue!==V&&e.trackedValue!==s&&e.firePropTrackers(void 0,void 0),0===e.keyTrackers.length&&queueMicrotask((()=>e.firePropTrackers(void 0,void 0))),e.trackedValue=s,e.keyTrackers.push(((t,e)=>n(i,void 0,s===e?t:void 0))),s}function it(t,i){const s=m();return tt(s,(e=>{const n=e,o=s.manager,r=s,c=r[n];if(null!=c&&c!==t&&"function"==typeof i.set&&(i.initialSet??1)){const s=i.set(c,t,n);if(s!==c)if(o.isLit)r[n]=s;else{let t=!0;o.onConnected((()=>{t&&(t=!0,function(){S.setter=!0;try{return void(r[n]=s)}finally{S.setter=!1}}())}))}}!function(t,i,s){var e,n;const o=s,r=t.manager.internals,c="function"==typeof o.get?o.get:void 0;c&&((e=r.getters)[i]??(e[i]=[]),r.getters[i].unshift(c));const h="ignore"===o.set?et:o.set;h&&((n=r.setters)[i]??(n[i]=[]),r.setters[i].unshift(h))}(s,n,i)}),t)}var st,et=(t,i)=>i,nt=(st=class extends C{constructor(t,i){super(t);const s=this.exports;try{b(this.component);const t=i(this.component,this),e=this.exports!==s;if(t instanceof Promise){e||this.setProvisionalExports(t);const i=t.then((t=>{this.exports=t,super.catchUpLifecycle()})).catch((t=>{this._ready.reject(t),console.error(t)}));this.onLoad((async()=>await i))}else e&&void 0===t||(this.exports=t),queueMicrotask((()=>super.catchUpLifecycle()))}catch(t){this._ready.reject(t),console.error(t)}}catchUpLifecycle(){}},(...t)=>{const i=j,s=new st(...t),e=s.exports;L(i.at(-1));const o=s.component.manager.internals;var r;return o.markExports(s,e),s.watchExports((t=>o.markExports(s,t))),k!==(r=s)&&(k=r,queueMicrotask((()=>{k===r&&(k=void 0)}))),function(t,i,s){const e=Array.isArray(t)?t:[t];let o=e.length+1;const r=t=>{o-=1,void 0!==t&&(o=0),0===o&&i(t)};e.forEach((t=>function(t,i,s){const e=Object.keys(t),o=e.length;void 0===T&&queueMicrotask(q),T??(T=new Map);let r=T.get(t);return void 0===r&&(r={callbacks:[],keyCount:o},T.set(t,r)),r.keyCount!==o&&(r.callbacks.forEach((t=>t(e))),r.callbacks=[],r.keyCount=o),r.callbacks.push((e=>{const r=e[o];n(i,null,void 0===r?void 0:t[r]===s?r:void 0)})),s}(t,(i=>r(void 0===i?void 0:{key:i,host:t,isReactive:!1})),s)));const c=e.find((t=>"manager"in t&&"object"==typeof t.manager&&t.manager.component===t));return c&&tt(c,(t=>r(void 0===t?void 0:{key:t,host:c,isReactive:void 0!==g(c,t)})),s),s}([s.component,...i].reverse(),(t=>void 0===t?void 0:function(t,{host:i,key:s,isReactive:e},n){const o=i,r=o[s]!==n;o[s]!==t.exports&&!r&&n!==t.exports&&(o[s]=t.exports);if(i===t.component){if(e){const i=t.component.manager.internals;r&&i.markExports(t,o[s]),F(t.component,s,(s=>{s!==t.exports&&i.markExports(t,s)}))}t.assignedProperty=e?void 0:s}t.watchExports((()=>{if(o[s]===t.exports)return;const i=t.component.manager,e=i.internals.setters[s]?.includes(i.internals.readonlySetter);e?function(){S.readOnly=!0;try{return void(o[s]=t.exports)}finally{S.readOnly=!1}}():o[s]=t.exports}))}(s,t,e)),e)});function ot(t,i){if(!i)return t;const s={...t};return Object.entries(i).forEach((([i,e])=>{s[i]="object"==typeof e?ot(t[i],e):e??t[i]})),s}const rt=(t=>(i={})=>nt(void 0,((s,e)=>{const n=s;function c(t){const i=e.exports,s=i._original??i,n=ot(s,t);n._original=s,e.exports=n}if(e.onLifecycle((()=>o(s.el,t("./assets"),(({t9nLocale:t,t9nStrings:i,lang:o})=>{const r={...i,_lang:o,_t9nLocale:t,_loading:!1};e.exports=r;const h=i.componentLabel??i.widgetLabel;"string"==typeof h&&"label"in s&&null==s.label&&(s.label??(s.label=h)),c(n.messageOverrides)}),i.name))),"messageOverrides"in n&&e.onLifecycle((()=>F(n,"messageOverrides",c))),i.blocking)return e.ready;const h=r(s.el);return{_lang:h.lang,_t9nLocale:h.t9nLocale,_loading:!0}})))(y),ct={en:{id:"field-calculation",variables:[{name:"$layer",type:"featureSet",description:"The layer being calculated."}]}};async function ht(){return await import("./p-e36a3779.js")}const at=new class extends u{constructor(){super(...arguments),this._languageId="arcgis-sql-expression",this._languageOptions={},this._layerMap=new Map}updateFeatureLayerForModel(t,i){const s=this._getApiKey(t);this._layerMap.set(s,i)}setLanguageOptions(t){this._languageOptions=t}getFeatureLayerForModel(t){const i=this._getApiKey(t);return this._layerMap.get(i)}async setProfileForModel(t,i,s={locale:"en"}){h(i)&&(i=await async function(t,i="en"){if(!h(t))return;const s=await async function(t="en"){return await Promise.resolve(ct[t])}(i);if(!s)return;const e={variables:[],hiddenApiItems:t.hiddenApiItems?.map((t=>t.toLowerCase()))};return s.variables.forEach((i=>{if(t.disabledVariables?.includes(i.name))return;const s=t.definitions[i.name];if("featureSet"===i.type)return a(s)?e.variables.push({...i,type:i.type,definition:s}):void 0;throw Error(`sdkVariable type not supported (yet) type: ${i.type}`)})),e}(i,s.locale));const e=await f(s.locale,y("./assets/arcade-language/t9n"),"profile.t9n.");if(!e)throw new Error(`Failed to load the language bundle for ${s.locale}`);this.disposeForModel(t);const n=this._getApiKey(t),o=new l(i,e);this._profileMap.set(n,o);const r=(t=>{const{apiVersion:i,bundles:s,hiddenApiItems:e}=t.toEditorProfileDefinition(),n=t.variables[0];if(!n||"featureSet"!==n.type)throw Error("No variable found in the editor profile");const o=function(t){const{name:i}=t,s=t.getDescription(),{definition:e}=t.toProfileVariableDefinition(),n={label:i,detail:i,insertText:i,insertTextMode:d.exports.InsertTextMode.asIs,insertTextFormat:d.exports.InsertTextFormat.PlainText,kind:d.exports.CompletionItemKind.Field},o={name:i,description:s,type:"dictionary",properties:[],completion:n};if(!e||!("fields"in e))return o;const[r,h]=c(e.fields,s);return o.properties=r,n.documentation={kind:"markdown",value:h},o}(n);return{apiVersion:i,bundles:s,variables:[o],hiddenApiItems:e?.map((t=>t.toLowerCase()))}})(o);this.updateApiContextForModel(t,{locale:s.locale,profile:r});const u=i?.variables?.find((t=>"$layer"===t.name));u&&this.updateFeatureLayerForModel(t,u.definition)}async getApiLibrary(t){const i=p.parse(t),s=await async function(t){const i=await ht();return await i.getSqlExprWorker(t)}(i);return await s.getApiLibrary(this.getApiContextForModel(i))}};export{rt as a,ht as b,it as g,at as s,N as u}
|
|
6
|
+
import{B as t,D as i,C as s,F as e,G as n,H as o,J as r,f as c,i as h,b as a,m as d,L as u,d as f,E as l,U as p}from"./p-a2f6c223.js";import{g as y}from"./p-185b723d.js";var v,g=(t,i)=>t.manager.internals.members?.[i]?.[0],w=Symbol.for("controller");function b(t){v!==t&&(v=t,queueMicrotask((()=>{v===t&&(v=void 0)})))}function m(){return v}var k,j=[];function L(t){if(void 0===t)return void(j=[]);const i=j.indexOf(t);j=-1===i?[...j,t]:j.slice(0,i+1),queueMicrotask((()=>{j=[]}))}var _,x=async(t,i)=>{const s=O(t);if(void 0===s)return t;if(await s.ready,"function"==typeof i){const t=s.watchExports((s=>i(s,t)))}return s.exports},M=async t=>{const i=O(t);return await i.ready,i},O=t=>{const i=function(){const t=k;return k=void 0,t}();if(void 0!==i)return i;const s=m().manager.internals.resolveExports(t);return void 0!==s?s:(t=>"object"==typeof t&&null!==t&&(w in t||"hostConnected"in t||"hostDisconnected"in t||"hostUpdate"in t||"hostUpdated"in t))(t)?t:void 0},S={setter:!1,getter:!1,readOnly:!1},U=new WeakMap;_=w;var C=class{constructor(t){this._callbacks={hostConnected:[],hostDisconnected:[],hostLoad:[],hostLoaded:[],hostUpdate:[],hostUpdated:[],hostDestroy:[],hostLifecycle:[]},this._ready=new i,this._lifecycleCleanups=[],this.connectedCalled=!1,this._loadCalled=!1,this.loadedCalled=!1,this[_]=!0,this.ready=this._ready.promise,this._exports=P(this),this._exportWatchers=new Set;const s=t??m();this.component=s,this.component.addController(this),L(this),void 0===this.component.manager||queueMicrotask((()=>this.catchUpLifecycle()))}catchUpLifecycle(){const{manager:t}=this.component;!t.connectedCalled||this.connectedCalled||this.triggerConnected(),!t._loadCalled||this.triggerLoad().then((()=>{!t.loadedCalled||this.triggerLoaded()})).catch(console.error)}get exports(){return this._exports}set exports(t){const i=this._exports;i!==t&&(this._exports=t,this._exportWatchers.forEach(n),this.connectedCalled&&!1!==this.assignedProperty&&this.component.requestUpdate(this.assignedProperty,i)),this._ready.resolve(t)}setProvisionalExports(t){this._exports=P(t),this._exportWatchers.forEach(n)}watchExports(t){const i=()=>t(this._exports);return this._exportWatchers.add(i),()=>{this._exportWatchers.delete(i)}}get use(){return b(this.component),x}get useRef(){return b(this.component),M}get useRefSync(){return b(this.component),O}controllerRemoved(){this.component.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this._callbacks.hostConnected.push(t)}onDisconnected(t){this._callbacks.hostDisconnected.push(t)}onLoad(t){this._callbacks.hostLoad.push(t)}onLoaded(t){this._callbacks.hostLoaded.push(t)}onUpdate(t){this._callbacks.hostUpdate.push(t)}onUpdated(t){this._callbacks.hostUpdated.push(t)}onDestroy(t){this._callbacks.hostDestroy.push(t)}onLifecycle(t){this._callbacks.hostLifecycle.push(t),this.connectedCalled&&this.component.el.isConnected&&this._callLifecycle(t)}triggerConnected(){const t=this;t.hostConnected&&n(t.hostConnected,t),this._callbacks.hostConnected.forEach(n),this.triggerLifecycle(),this.connectedCalled=!0}triggerDisconnected(){const t=this;t.hostDisconnected&&n(t.hostDisconnected,t),this._callbacks.hostDisconnected.forEach(n),this._lifecycleCleanups.forEach(n),this._lifecycleCleanups=[]}async triggerLoad(){if(this._loadCalled)return;this._loadCalled=!0;const t=this;t.hostLoad&&await s(t.hostLoad,t),this._callbacks.hostLoad.length>0&&await Promise.allSettled(this._callbacks.hostLoad.map(s)),this._ready.resolve(this._exports)}triggerLoaded(){if(this.loadedCalled)return;const t=this;t.hostLoaded&&n(t.hostLoaded,t),this._callbacks.hostLoaded.forEach(n),this.loadedCalled=!0}triggerUpdate(t){const i=this;i.hostUpdate&&n(i.hostUpdate,i,t),this._callbacks.hostUpdate.forEach(D,t)}triggerUpdated(t){const i=this;i.hostUpdated&&n(i.hostUpdated,i,t),this._callbacks.hostUpdated.forEach(D,t)}triggerDestroy(){const t=this;t.hostDestroy&&n(t.hostDestroy,t),this._callbacks.hostDestroy.forEach(n)}triggerLifecycle(){const t=this;t.hostLifecycle&&this._callLifecycle((()=>t.hostLifecycle())),this._callbacks.hostLifecycle.forEach(this._callLifecycle,this)}_callLifecycle(t){b(this.component);const i=n(t);(Array.isArray(i)?i:[i]).forEach((t=>{"function"==typeof t?this._lifecycleCleanups.push(t):"object"==typeof t&&"function"==typeof t.remove&&this._lifecycleCleanups.push(t.remove)}))}};function D(t){n(t,void 0,this)}var E=C;function P(t){if("object"!=typeof t&&"function"!=typeof t||null===t)return t;const i=new Proxy(t,{get(t,s,e){if(!A.has(s)||!(s in t)||t[s]!==i)return s in t||s in Promise.prototype||"symbol"==typeof s?"function"==typeof t?t[s]:Reflect.get(t,s,e):void 0},set:(t,i,s,e)=>Reflect.set(t,i,s,e)});return i}var A=new Set(["exports","_exports"]),T=void 0;function q(){Array.from(T?.entries()??[]).forEach((([t,{callbacks:i}])=>{const s=Object.keys(t);i.forEach((t=>t(s)))})),T=void 0}function F(t,i,s){var e;const o=i,r=t.manager.internals;(e=r.allWatchers)[o]??(e[o]=[]);const c=r.allWatchers[o],h=s,a=(t,i,s)=>n(h,null,t,i,s);return c.push(a),()=>{const t=c.indexOf(a);-1!==t&&c.splice(t,1)}}var $=class{constructor(t){this.enabledWatchers={},this.allWatchers={},this.enableReadonly=()=>{if(this.enableReadonly=void 0,!this.component.manager.isLit)return;const t=this.component.manager.internals;Object.entries(t.members).forEach((([i,[s]])=>{var e;2048&s&&((e=t.setters)[i]??(e[i]=[]),t.setters[i].push(t.readonlySetter))}))},this.trackedValue=V,this.keyTrackers=[],this.getters={},this.setters={},this.accessorGetter={},this.accessorSetter={},this.reactiveUtilsIntegrations=new Set,this._exports=new WeakMap,this.readonlySetter=(t,i,s)=>{if(S.readOnly)return t;throw new Error(`Cannot assign to read-only property "${s}" of ${this.component.el.tagName.toLowerCase()}. Trying to assign "${String(t)}"`)},this.component=t}firePropTrackers(t,i){const s=this.keyTrackers;this.trackedValue=V,this.keyTrackers=[],s.forEach((s=>s(t,i)))}getSetProxy(t){const i=this.component,s=i.constructor.prototype;if(this._getSetProxy(s,t,"class"),i.manager.isLit)return;const e=i.el.constructor.prototype;s!==e&&this._getSetProxy(e,t,"html")}_getSetProxy(t,i,s){const e=g(this.component,i);let n;do{n=Object.getOwnPropertyDescriptor(t,i)}while(!n&&(t=Object.getPrototypeOf(t)));if(!n)return;const o=n.get,r=n.set,c=I in o,h=I in r;if(c&&h)return;const a=!c,d=!h,u=a?function(){let t=o.call(this);const s=U.get(this);if(void 0===s)return t;const e=s.manager.internals;t=e.accessorGetter[i](t,i);const n=e.getters[i]??R;for(let s=0;s<n.length;s++)t=n[s](t,i);return t}:o,f=d?function(t){const s=o.call(this),n=U.get(this);if(void 0===n)return void r.call(this,t);let c=n.manager.isLit?t??void 0:function(t,i=8){return null==t||"object"==typeof t||"function"==typeof t?t:4&i?"false"!==t&&(""===t||!!t):2&i?Number.parseFloat(t):1&i?String(t):t}(t,e);const h=n.manager.internals;if(c===s)r.call(this,c);else{const t=S.setter?R:h.setters[i]??R;for(let e=0;e<t.length&&(c=t[e](c,s,i),c!==s);e++);c=h.accessorSetter[i](c,s,i),r.call(this,c),c!==s&&h.enabledWatchers[i]?.forEach((t=>t(c,s,i)))}h.keyTrackers.length>0&&h?.firePropTrackers(i,t)}:r;a&&(u[I]=!0),d&&(f[I]=!0),Object.defineProperty(t,i,{...n,get:u,set:f})}markExports(t,i){("object"==typeof i&&null!==i||"function"==typeof i)&&this._exports.set(i,t)}resolveExports(t){return"object"==typeof t&&null!==t||"function"==typeof t?this._exports.get(t):void 0}},R=[],I=Symbol(),V=Symbol(),N=(t,i)=>new W(t,i),W=class extends E{constructor(s,e){const n="addController"in s,o=new Set,r=s;if(r.addController=function(t){o.add(t),!(w in t)&&s.renderRoot&&s.el.isConnected&&t.hostConnected?.()},r.removeController=function(t){o.delete(t),t.controllerRemoved?.()},!n){const t=e??s.constructor.__forceUpdate;r.requestUpdate=()=>t(s)}super(s),this.internals=new $(this.component),this.destroyed=!1,this._updatePromise=new i,this._originalLifecycles={},this.isLit=n,this.component.manager=this,function(i,s){if(s)i.manager.internals.members=Object.fromEntries(Array.from(i.constructor.elementProperties,(([t,i])=>i.noAccessor?void 0:[t,[(i.readOnly?2048:0)|(i.state?32:16)]])).filter(t));else{const t=i.constructor,s=t.__registerControllers?.(i)??void 0;if(t.__registerControllers=void 0,"object"!=typeof s)throw new Error("Failed to retrieve component meta");i.manager.internals.members=Object.fromEntries(Object.entries(s).filter((([t,[i]])=>!!(63&i))))}}(s,n),this._controllers=o,this.exports=void 0,this.hasDestroy=B in this.component&&"function"==typeof this.component.destroy,this._bindLifecycleMethods();const c=this.internals;Object.keys(c.members).forEach((t=>{c.accessorGetter[t]=H,c.accessorSetter[t]=H,c.getSetProxy(t)})),n?this.internals.enabledWatchers=this.internals.allWatchers:Object.defineProperty(s,"updateComplete",{get:async()=>await this._updatePromise.promise}),queueMicrotask(c.enableReadonly),L(void 0),b(s),U.set(s.el,s),U.set(s,s)}_bindLifecycleMethods(){const t=this.component,i=this.isLit,s=t.el===t;this._originalLifecycles={_connectedCallback:i||s?void 0:t.connectedCallback,_disconnectedCallback:i||s?void 0:t.disconnectedCallback,_load:i?t.load:t.componentWillLoad,_loaded:i?t.loaded:t.componentDidLoad,_willUpdate:i?void 0:t.componentWillUpdate,_updated:i?void 0:t.componentDidUpdate,_destroy:t.destroy};const e=this._connectedCallback.bind(this),n=this._disconnectedCallback.bind(this),o=this._update.bind(this),r=this._updated.bind(this);i?t.constructor.prototype.addController.call(t,{hostConnected:e,hostDisconnected:n,hostUpdate:o,hostUpdated:r}):(t.connectedCallback=e,t.disconnectedCallback=n,t.componentWillLoad=this._load.bind(this),t.componentDidLoad=this._loaded.bind(this),t.componentWillUpdate=o,t.componentDidUpdate=r),this.hasDestroy&&(t.destroy=this.destroy.bind(this))}_connectedCallback(){if(this.destroyed){const t=this.component.el.tagName.toLowerCase();throw this.component.el.remove(),new Error(`The ${t} component has already been destroyed. It can not be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${B} prop.`)}void 0!==this._autoDestroyTimeout&&clearTimeout(this._autoDestroyTimeout);const t=this.internals;t.enabledWatchers=t.allWatchers,q(),t.enableReadonly?.(),this._controllers.forEach(J),this._originalLifecycles._connectedCallback?.call(this.component)}_disconnectedCallback(){this.destroyed||(this._controllers.forEach(z),this._originalLifecycles._disconnectedCallback?.call(this.component),this.hasDestroy&&this._setAutoDestroyTimeout())}async _load(){const t=this.internals.reactiveUtilsIntegrations;if(t.size>0)for(const i of t)"triggerLoad"in i?await i.triggerLoad():await s(i.hostLoad,i);await Promise.allSettled(Array.from(this._controllers,K,t)),await(this._originalLifecycles._load?.call(this.component)),this.hasDestroy&&F(this.component,B,(()=>this._setAutoDestroyTimeout()))}_loaded(){this._controllers.forEach(Q),this._originalLifecycles._loaded?.call(this.component)}_update(){this._controllers.forEach(X,this.component.changedProperties),this._originalLifecycles._willUpdate?.call(this.component)}_updated(){const t=this.component;if(this._controllers.forEach(Y,t.changedProperties),this._originalLifecycles._updated?.call(this.component),this.isLit)t.changedProperties=new Map;else{const t=this._updatePromise;this._updatePromise=new i,t.resolve(!0)}}async destroy(){if(!this.destroyed){if(this.component.el.isConnected){this.hasDestroy=!1;try{this.component.el.remove()}finally{this.hasDestroy=!0}}this._autoDestroyTimeout=void 0,this.destroyed=!0,this._controllers.forEach(Z),this._controllers.clear(),await(this._originalLifecycles._destroy?.call(this.component))}}_setAutoDestroyTimeout(){void 0!==this._autoDestroyTimeout&&clearTimeout(this._autoDestroyTimeout),this.component.el.isConnected||this.component.autoDestroyDisabled||(this._autoDestroyTimeout=e((()=>{this.destroy().catch(console.error)}),G))}},B="autoDestroyDisabled",G=1e3,H=t=>t;function J(t){"triggerConnected"in t?t.triggerConnected():n(t.hostConnected,t)}function z(t){"triggerDisconnected"in t?t.triggerDisconnected():n(t.hostDisconnected,t)}async function K(t){this.has(t)||("triggerLoad"in t?await t.triggerLoad():await s(t.hostLoad,t))}function Q(t){"triggerLoaded"in t?t.triggerLoaded():n(t.hostLoaded,t)}function X(t){"triggerUpdate"in t?t.triggerUpdate(this):n(t.hostUpdate,t,this)}function Y(t){"triggerUpdated"in t?t.triggerUpdated(this):n(t.hostUpdated,t,this)}function Z(t){"triggerDestroy"in t?t.triggerDestroy():n(t.hostDestroy,t)}function tt(t,i,s){const e=t.manager.internals;return e.trackedValue!==V&&e.trackedValue!==s&&e.firePropTrackers(void 0,void 0),0===e.keyTrackers.length&&queueMicrotask((()=>e.firePropTrackers(void 0,void 0))),e.trackedValue=s,e.keyTrackers.push(((t,e)=>n(i,void 0,s===e?t:void 0))),s}function it(t,i){const s=m();return tt(s,(e=>{const n=e,o=s.manager,r=s,c=r[n];if(null!=c&&c!==t&&"function"==typeof i.set){const s=i.set(c,t,n);if(s!==c)if(o.isLit)r[n]=s;else{let t=!0;o.onConnected((()=>{t&&(t=!0,function(){S.setter=!0;try{return void(r[n]=s)}finally{S.setter=!1}}())}))}}!function(t,i,s){var e,n;const o=s,r=t.manager.internals,c="function"==typeof o.get?o.get:void 0;c&&((e=r.getters)[i]??(e[i]=[]),r.getters[i].unshift(c));const h="ignore"===o.set?et:o.set;h&&((n=r.setters)[i]??(n[i]=[]),r.setters[i].unshift(h))}(s,n,i)}),t)}var st,et=(t,i)=>i,nt=(st=class extends C{constructor(t,i){super(t);const s=this.exports;try{b(this.component);const t=i(this.component,this),e=this.exports!==s;if(t instanceof Promise){e||this.setProvisionalExports(t);const i=t.then((t=>{this.exports=t,super.catchUpLifecycle()})).catch((t=>{this._ready.reject(t),console.error(t)}));this.onLoad((async()=>await i))}else e&&void 0===t||(this.exports=t),queueMicrotask((()=>super.catchUpLifecycle()))}catch(t){this._ready.reject(t),console.error(t)}}catchUpLifecycle(){}},(...t)=>{const i=j,s=new st(...t),e=s.exports;L(i.at(-1));const o=s.component.manager.internals;var r;return o.markExports(s,e),s.watchExports((t=>o.markExports(s,t))),k!==(r=s)&&(k=r,queueMicrotask((()=>{k===r&&(k=void 0)}))),function(t,i,s){const e=Array.isArray(t)?t:[t];let o=e.length+1;const r=t=>{o-=1,void 0!==t&&(o=0),0===o&&i(t)};e.forEach((t=>function(t,i,s){const e=Object.keys(t),o=e.length;void 0===T&&queueMicrotask(q),T??(T=new Map);let r=T.get(t);return void 0===r&&(r={callbacks:[],keyCount:o},T.set(t,r)),r.keyCount!==o&&(r.callbacks.forEach((t=>t(e))),r.callbacks=[],r.keyCount=o),r.callbacks.push((e=>{const r=e[o];n(i,null,void 0===r?void 0:t[r]===s?r:void 0)})),s}(t,(i=>r(void 0===i?void 0:{key:i,host:t,isReactive:!1})),s)));const c=e.find((t=>"manager"in t&&"object"==typeof t.manager&&t.manager.component===t));return c&&tt(c,(t=>r(void 0===t?void 0:{key:t,host:c,isReactive:void 0!==g(c,t)})),s),s}([s.component,...i].reverse(),(t=>void 0===t?void 0:function(t,{host:i,key:s,isReactive:e},n){const o=i,r=o[s]!==n;o[s]!==t.exports&&!r&&n!==t.exports&&(o[s]=t.exports);if(i===t.component){if(e){const i=t.component.manager.internals;r&&i.markExports(t,o[s]),F(t.component,s,(s=>{s!==t.exports&&i.markExports(t,s)}))}t.assignedProperty=e?void 0:s}t.watchExports((()=>{if(o[s]===t.exports)return;const i=t.component.manager,e=i.internals.setters[s]?.includes(i.internals.readonlySetter);e?function(){S.readOnly=!0;try{return void(o[s]=t.exports)}finally{S.readOnly=!1}}():o[s]=t.exports}))}(s,t,e)),e)});function ot(t,i){if(!i)return t;const s={...t};return Object.entries(i).forEach((([i,e])=>{s[i]="object"==typeof e?ot(t[i],e):e??t[i]})),s}const rt=(t=>(i={})=>nt(void 0,((s,e)=>{const n=s;function c(t){const i=e.exports,s=i._original??i,n=ot(s,t);n._original=s,e.exports=n}if(e.onLifecycle((()=>o(s.el,t("./assets"),(({t9nLocale:t,t9nStrings:i,lang:o})=>{const r={...i,_lang:o,_t9nLocale:t,_loading:!1};e.exports=r;const h=i.componentLabel??i.widgetLabel;"string"==typeof h&&"label"in s&&null==s.label&&(s.label??(s.label=h)),c(n.messageOverrides)}),i.name))),"messageOverrides"in n&&e.onLifecycle((()=>F(n,"messageOverrides",c))),i.blocking)return e.ready;const h=r(s.el);return{_lang:h.lang,_t9nLocale:h.t9nLocale,_loading:!0}})))(y),ct={en:{id:"field-calculation",variables:[{name:"$layer",type:"featureSet",description:"The layer being calculated."}]}};async function ht(){return await import("./p-a481de5e.js")}const at=new class extends u{constructor(){super(...arguments),this._languageId="arcgis-sql-expression",this._languageOptions={},this._layerMap=new Map}updateFeatureLayerForModel(t,i){const s=this._getApiKey(t);this._layerMap.set(s,i)}setLanguageOptions(t){this._languageOptions=t}getFeatureLayerForModel(t){const i=this._getApiKey(t);return this._layerMap.get(i)}async setProfileForModel(t,i,s={locale:"en"}){h(i)&&(i=await async function(t,i="en"){if(!h(t))return;const s=await async function(t="en"){return await Promise.resolve(ct[t])}(i);if(!s)return;const e={variables:[],hiddenApiItems:t.hiddenApiItems?.map((t=>t.toLowerCase()))};return s.variables.forEach((i=>{if(t.disabledVariables?.includes(i.name))return;const s=t.definitions[i.name];if("featureSet"===i.type)return a(s)?e.variables.push({...i,type:i.type,definition:s}):void 0;throw Error(`sdkVariable type not supported (yet) type: ${i.type}`)})),e}(i,s.locale));const e=await f(s.locale,y("./assets/arcade-language/t9n"),"profile.t9n.");if(!e)throw new Error(`Failed to load the language bundle for ${s.locale}`);this.disposeForModel(t);const n=this._getApiKey(t),o=new l(i,e);this._profileMap.set(n,o);const r=(t=>{const{apiVersion:i,bundles:s,hiddenApiItems:e}=t.toEditorProfileDefinition(),n=t.variables[0];if(!n||"featureSet"!==n.type)throw Error("No variable found in the editor profile");const o=function(t){const{name:i}=t,s=t.getDescription(),{definition:e}=t.toProfileVariableDefinition(),n={label:i,detail:i,insertText:i,insertTextMode:d.exports.InsertTextMode.asIs,insertTextFormat:d.exports.InsertTextFormat.PlainText,kind:d.exports.CompletionItemKind.Field},o={name:i,description:s,type:"dictionary",properties:[],completion:n};if(!e||!("fields"in e))return o;const[r,h]=c(e.fields,s);return o.properties=r,n.documentation={kind:"markdown",value:h},o}(n);return{apiVersion:i,bundles:s,variables:[o],hiddenApiItems:e?.map((t=>t.toLowerCase()))}})(o);this.updateApiContextForModel(t,{locale:s.locale,profile:r});const u=i?.variables?.find((t=>"$layer"===t.name));u&&this.updateFeatureLayerForModel(t,u.definition)}async getApiLibrary(t){const i=p.parse(t),s=await async function(t){const i=await ht();return await i.getSqlExprWorker(t)}(i);return await s.getApiLibrary(this.getApiContextForModel(i))}};export{rt as a,ht as b,it as g,at as s,N as u}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.57
|
|
5
5
|
*/
|
|
6
|
-
import{M as t}from"./p-
|
|
6
|
+
import{M as t}from"./p-a2f6c223.js";
|
|
7
7
|
/*!-----------------------------------------------------------------------------
|
|
8
8
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
9
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.57
|
|
5
5
|
*/
|
|
6
|
-
import{N as t,M as e}from"./p-
|
|
6
|
+
import{N as t,M as e}from"./p-a2f6c223.js";
|
|
7
7
|
/*!-----------------------------------------------------------------------------
|
|
8
8
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
9
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.57
|
|
5
5
|
*/
|
|
6
|
-
import{M as t}from"./p-
|
|
6
|
+
import{M as t}from"./p-a2f6c223.js";
|
|
7
7
|
/*!-----------------------------------------------------------------------------
|
|
8
8
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
9
|
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.57
|
|
5
5
|
*/
|
|
6
|
-
import{m as e,g as t,O as s,R as n,x as r,P as i,D as a,Q as o}from"./p-605de796.js";var c=[[],[],[]];["++","--"].forEach((e=>c[e.length-1]?.push(e))),["-","+","!","~"].forEach((e=>c[e.length-1]?.push(e))),["||","&&"].forEach((e=>c[e.length-1]?.push(e))),["=","/=","*=","%=","+=","-="].forEach((e=>c[e.length-1]?.push(e))),["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"].forEach((e=>c[e.length-1]?.push(e)));var u=Object.values({Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"});Object.values({False:"false",Null:"null",True:"true"}).map((t=>({label:t,kind:e.exports.CompletionItemKind.Constant}))),u.map((t=>({label:t,kind:e.exports.CompletionItemKind.Keyword})));const l={wordPattern:/(-?\d*\.\d\w*)|([^`~!#%\^&\*\(\)\-=\+\[\{\]\}\\\|;:'",\.<>\/\?\s]+)/gu,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]}],autoCloseBefore:";:.,=}])` \n\t",folding:{markers:{start:/^\s*\/\/\s*#?region\b/u,end:/^\s*\/\/\s*#?endregion\b/u}},indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]\)].*$/u,increaseIndentPattern:/^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u}},g={defaultToken:"invalid",tokenPostfix:".arc",ignoreCase:!0,keywords:u.filter((e=>"from"!==e)),operators:["<=",">=","==","!=","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","=","+=","-=","*=","**=","/=","%="],constants:["true","false","null"],symbols:/[=><!~?:&|+\-*\/\^%]+/u,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/u,digits:/\d+(_+\d+)*/u,octaldigits:/[0-7]+(_+[0-7]+)*/u,binarydigits:/[0-1]+(_+[0-1]+)*/u,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/u,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/u,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/u,tokenizer:{root:[[/[{}]/u,"delimiter.bracket"],{include:"common"}],common:[[/import(?=\s)/u,{token:"keyword",next:"@import"}],[/[a-z_$][\w$]*/u,{cases:{"@constants":"constant","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/u,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/u,"@brackets"],[/[<>](?!@symbols)/u,"@brackets"],[/@symbols/u,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/u,"number"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/u,"number"],[/0[xX](@hexdigits)/u,"number"],[/0[oO]?(@octaldigits)/u,"number"],[/0[bB](@binarydigits)/u,"number"],[/(@digits)/u,"number"],[/[;,.]/u,"delimiter"],[/"([^"\\]|\\.)*$/u,"string.invalid"],[/'([^'\\]|\\.)*$/u,"string.invalid"],[/"/u,"string","@string_double"],[/'/u,"string","@string_single"],[/`/u,"string","@string_backtick"]],import:[[/import(?=\s)/u,{token:"keyword"}],{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier"],{include:"@whitespace"},[/from/u,{token:"keyword",next:"@popall"}]],whitespace:[[/[ \t\r\n]+/u,""],[/\/\*/u,"comment","@comment"],[/\/\/.*$/u,"comment"]],comment:[[/[^\/*]+/u,"comment"],[/\*\//u,"comment","@pop"],[/[\/*]/u,"comment"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/u,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/u,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/u,["regexp.escape.control","regexp.escape.control"]],[/[()]/u,"regexp.escape.control"],[/@regexpctl/u,"regexp.escape.control"],[/[^\\\/]/u,"regexp"],[/@regexpesc/u,"regexp.escape"],[/\\\./u,"regexp.invalid"],[/(\/)([gimsuy]*)/u,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/u,"regexp.escape.control"],[/\^/u,"regexp.invalid"],[/@regexpesc/u,"regexp.escape"],[/[^\]]/u,"regexp"],[/\]/u,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/"/u,"string","@pop"]],string_single:[[/[^\\']+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/'/u,"string","@pop"]],string_backtick:[[/\$\{/u,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/`/u,"string","@pop"]],bracketCounting:[[/\{/u,"delimiter.bracket","@bracketCounting"],[/\}/u,"delimiter.bracket","@pop"],{include:"common"}]}};class p{constructor(e,s,{defaults:n,diagnosticsService:r}){this._languageId=e,this._worker=s,this._disposables=[],this._listener=new Map,this._diagnosticsService=r,this._defaults=n;const a=e=>{const t=e.getLanguageId();if(t!==this._languageId)return;const s=i((()=>{this._doValidate(e,t).catch((e=>{throw e}))}));this._listener.set(e.uri.toString(),e.onDidChangeContent(s)),this._doValidate(e,t).catch(console.error)},o=e=>{const s=e.uri.toString();t.setModelMarkers(e,this._languageId,[]);const n=this._listener.get(s);n&&(n.dispose(),this._listener.delete(s))};this._disposables.push(t.onDidCreateModel(a)),this._disposables.push(t.onWillDisposeModel((e=>{o(e)}))),this._disposables.push(t.onDidChangeModelLanguage((e=>{o(e.model),a(e.model)}))),this._disposables.push(n.onDidChange((()=>{t.getModels().forEach((e=>{e.getLanguageId()===this._languageId&&(o(e),a(e))}))}))),this._disposables.push(n.onModelContextDidChange((e=>{t.getModels().forEach((t=>{t.getLanguageId()===this._languageId&&t.uri.toString()===e&&this._doValidate(t,this._languageId).catch(console.error)}))}))),this._disposables.push({dispose:()=>{this._listener.forEach((e=>e.dispose())),this._listener.clear()}}),t.getModels().forEach(a)}dispose(){this._disposables.forEach((e=>e.dispose())),this._disposables=[]}async _doValidate(e,s){if(e.isAttachedToEditor())try{const n=await this._worker(e.uri),r=this._defaults.getApiContextForModel(e.uri),i=await n.doValidation(e.uri.toString(),r),a=i.map((e=>{return{severity:d((t=e).severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message};var t}));this._diagnosticsService.fireDiagnosticsChange(e.uri,i),t.setModelMarkers(e,s,a)}catch(e){console.error(e)}}}function d(t){switch(t){case e.exports.DiagnosticSeverity.Error:return s.Error;case e.exports.DiagnosticSeverity.Warning:return s.Warning;case e.exports.DiagnosticSeverity.Information:return s.Info;case e.exports.DiagnosticSeverity.Hint:return s.Hint;default:return s.Info}}function h(e){return new n(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function m(e){return{range:h(e.range),text:e.newText}}function x(t){const s=r.CompletionItemKind;switch(t){case e.exports.CompletionItemKind.Text:return s.Text;case e.exports.CompletionItemKind.Method:return s.Method;case e.exports.CompletionItemKind.Function:return s.Function;case e.exports.CompletionItemKind.Constructor:return s.Constructor;case e.exports.CompletionItemKind.Field:return s.Field;case e.exports.CompletionItemKind.Variable:return s.Variable;case e.exports.CompletionItemKind.Class:return s.Class;case e.exports.CompletionItemKind.Interface:return s.Interface;case e.exports.CompletionItemKind.Module:return s.Module;case e.exports.CompletionItemKind.Property:return s.Property;case e.exports.CompletionItemKind.Unit:return s.Unit;case e.exports.CompletionItemKind.Value:return s.Value;case e.exports.CompletionItemKind.Enum:return s.Enum;case e.exports.CompletionItemKind.Keyword:return s.Keyword;case e.exports.CompletionItemKind.Snippet:return s.Snippet;case e.exports.CompletionItemKind.Color:return s.Color;case e.exports.CompletionItemKind.File:return s.File;case e.exports.CompletionItemKind.Reference:return s.Reference;case e.exports.CompletionItemKind.Folder:return s.Folder;case e.exports.CompletionItemKind.EnumMember:return s.EnumMember;case e.exports.CompletionItemKind.Constant:return s.Constant;case e.exports.CompletionItemKind.Struct:return s.Struct;case e.exports.CompletionItemKind.Event:return s.Event;case e.exports.CompletionItemKind.Operator:return s.Operator;case e.exports.CompletionItemKind.TypeParameter:return s.TypeParameter;default:return s.Property}}class w{constructor(e,t){this._worker=e,this._defaults=t,this.triggerCharacters=[".","("]}async provideCompletionItems(t,s){const i=await this._worker(t.uri),a=this._defaults.getApiContextForModel(t.uri),o=await i.doComplete(t.uri.toString(),function(e){return{character:e.column-1,line:e.lineNumber-1}}(s),a),c=t.getWordUntilPosition(s),u=new n(s.lineNumber,c.startColumn,s.lineNumber,c.endColumn),l=o.items.map((t=>{const s={label:t.label,insertText:t.insertText||t.label,sortText:t.sortText,filterText:t.filterText,detail:t.detail,range:u,kind:x(t.kind)};var n;return t.textEdit&&(s.range=void 0!==(n=t.textEdit).insert&&void 0!==n.replace?{insert:h(t.textEdit.insert),replace:h(t.textEdit.replace)}:h(t.textEdit.range),s.insertText=t.textEdit.newText),t.additionalTextEdits&&(s.additionalTextEdits=t.additionalTextEdits.map(m)),t.insertTextFormat===e.exports.InsertTextFormat.Snippet&&(s.insertTextRules=r.CompletionItemInsertTextRule.InsertAsSnippet),t.documentation&&(s.documentation="string"==typeof t.documentation?t.documentation:{supportThemeIcons:!1,value:t.documentation.value,supportHtml:!0}),s}));return{incomplete:o.isIncomplete,suggestions:l}}}class k{constructor(e,t){this._worker=e,this._defaults=t}async provideDocumentFormattingEdits(e){const t=await this._worker(e.uri),s=this._defaults.getApiContextForModel(e.uri.toString());return(await t.doFormat(e.uri.toString(),s)).map((e=>({range:h(e.range),text:e.newText})))}}let f,b=new a;class y{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,b=new a),this._client=null}static async waitForWorker(){return await b.promise}async _getClientProxy(){if(!this._client){const{languageId:e,languageOptions:s}=this._defaults;this._worker=t.createWebWorker({moduleId:"ArcadeWorker",label:e,createData:{languageId:e,languageOptions:s}}),b.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){const t=await this._getClientProxy();return await(this._worker?.withSyncedResources(e)),t}}async function v(...e){return await y.waitForWorker(),await new Promise(((t,s)=>{f?t(f(...e)):s(new Error("Arcade not registered!"))}))}const C=new class{constructor(){this._onDiagnosticsChange=new o}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}};function _(){return C}function F(e){const t=new y(e),s=async(...e)=>await t.getLanguageServiceWorker(...e);f=s,r.setMonarchTokensProvider(e.languageId,g),r.setLanguageConfiguration(e.languageId,l),r.registerCompletionItemProvider(e.languageId,new w(s,e)),r.registerDocumentFormattingEditProvider(e.languageId,new k(s,e)),new p(e.languageId,s,{defaults:e,diagnosticsService:C})}export{_ as getArcadeDiagnosticService,v as getArcadeWorker,F as setupMode}
|
|
6
|
+
import{m as e,g as t,O as s,R as n,x as r,P as i,D as a,Q as o}from"./p-a2f6c223.js";var c=[[],[],[]];["++","--"].forEach((e=>c[e.length-1]?.push(e))),["-","+","!","~"].forEach((e=>c[e.length-1]?.push(e))),["||","&&"].forEach((e=>c[e.length-1]?.push(e))),["=","/=","*=","%=","+=","-="].forEach((e=>c[e.length-1]?.push(e))),["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"].forEach((e=>c[e.length-1]?.push(e)));var u=Object.values({Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"});Object.values({False:"false",Null:"null",True:"true"}).map((t=>({label:t,kind:e.exports.CompletionItemKind.Constant}))),u.map((t=>({label:t,kind:e.exports.CompletionItemKind.Keyword})));const l={wordPattern:/(-?\d*\.\d\w*)|([^`~!#%\^&\*\(\)\-=\+\[\{\]\}\\\|;:'",\.<>\/\?\s]+)/gu,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]}],autoCloseBefore:";:.,=}])` \n\t",folding:{markers:{start:/^\s*\/\/\s*#?region\b/u,end:/^\s*\/\/\s*#?endregion\b/u}},indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]\)].*$/u,increaseIndentPattern:/^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u}},g={defaultToken:"invalid",tokenPostfix:".arc",ignoreCase:!0,keywords:u.filter((e=>"from"!==e)),operators:["<=",">=","==","!=","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","=","+=","-=","*=","**=","/=","%="],constants:["true","false","null"],symbols:/[=><!~?:&|+\-*\/\^%]+/u,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/u,digits:/\d+(_+\d+)*/u,octaldigits:/[0-7]+(_+[0-7]+)*/u,binarydigits:/[0-1]+(_+[0-1]+)*/u,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/u,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/u,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/u,tokenizer:{root:[[/[{}]/u,"delimiter.bracket"],{include:"common"}],common:[[/import(?=\s)/u,{token:"keyword",next:"@import"}],[/[a-z_$][\w$]*/u,{cases:{"@constants":"constant","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/u,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/u,"@brackets"],[/[<>](?!@symbols)/u,"@brackets"],[/@symbols/u,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/u,"number"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/u,"number"],[/0[xX](@hexdigits)/u,"number"],[/0[oO]?(@octaldigits)/u,"number"],[/0[bB](@binarydigits)/u,"number"],[/(@digits)/u,"number"],[/[;,.]/u,"delimiter"],[/"([^"\\]|\\.)*$/u,"string.invalid"],[/'([^'\\]|\\.)*$/u,"string.invalid"],[/"/u,"string","@string_double"],[/'/u,"string","@string_single"],[/`/u,"string","@string_backtick"]],import:[[/import(?=\s)/u,{token:"keyword"}],{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier"],{include:"@whitespace"},[/from/u,{token:"keyword",next:"@popall"}]],whitespace:[[/[ \t\r\n]+/u,""],[/\/\*/u,"comment","@comment"],[/\/\/.*$/u,"comment"]],comment:[[/[^\/*]+/u,"comment"],[/\*\//u,"comment","@pop"],[/[\/*]/u,"comment"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/u,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/u,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/u,["regexp.escape.control","regexp.escape.control"]],[/[()]/u,"regexp.escape.control"],[/@regexpctl/u,"regexp.escape.control"],[/[^\\\/]/u,"regexp"],[/@regexpesc/u,"regexp.escape"],[/\\\./u,"regexp.invalid"],[/(\/)([gimsuy]*)/u,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/u,"regexp.escape.control"],[/\^/u,"regexp.invalid"],[/@regexpesc/u,"regexp.escape"],[/[^\]]/u,"regexp"],[/\]/u,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/"/u,"string","@pop"]],string_single:[[/[^\\']+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/'/u,"string","@pop"]],string_backtick:[[/\$\{/u,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/`/u,"string","@pop"]],bracketCounting:[[/\{/u,"delimiter.bracket","@bracketCounting"],[/\}/u,"delimiter.bracket","@pop"],{include:"common"}]}};class p{constructor(e,s,{defaults:n,diagnosticsService:r}){this._languageId=e,this._worker=s,this._disposables=[],this._listener=new Map,this._diagnosticsService=r,this._defaults=n;const a=e=>{const t=e.getLanguageId();if(t!==this._languageId)return;const s=i((()=>{this._doValidate(e,t).catch((e=>{throw e}))}));this._listener.set(e.uri.toString(),e.onDidChangeContent(s)),this._doValidate(e,t).catch(console.error)},o=e=>{const s=e.uri.toString();t.setModelMarkers(e,this._languageId,[]);const n=this._listener.get(s);n&&(n.dispose(),this._listener.delete(s))};this._disposables.push(t.onDidCreateModel(a)),this._disposables.push(t.onWillDisposeModel((e=>{o(e)}))),this._disposables.push(t.onDidChangeModelLanguage((e=>{o(e.model),a(e.model)}))),this._disposables.push(n.onDidChange((()=>{t.getModels().forEach((e=>{e.getLanguageId()===this._languageId&&(o(e),a(e))}))}))),this._disposables.push(n.onModelContextDidChange((e=>{t.getModels().forEach((t=>{t.getLanguageId()===this._languageId&&t.uri.toString()===e&&this._doValidate(t,this._languageId).catch(console.error)}))}))),this._disposables.push({dispose:()=>{this._listener.forEach((e=>e.dispose())),this._listener.clear()}}),t.getModels().forEach(a)}dispose(){this._disposables.forEach((e=>e.dispose())),this._disposables=[]}async _doValidate(e,s){if(e.isAttachedToEditor())try{const n=await this._worker(e.uri),r=this._defaults.getApiContextForModel(e.uri),i=await n.doValidation(e.uri.toString(),r),a=i.map((e=>{return{severity:d((t=e).severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message};var t}));this._diagnosticsService.fireDiagnosticsChange(e.uri,i),t.setModelMarkers(e,s,a)}catch(e){console.error(e)}}}function d(t){switch(t){case e.exports.DiagnosticSeverity.Error:return s.Error;case e.exports.DiagnosticSeverity.Warning:return s.Warning;case e.exports.DiagnosticSeverity.Information:return s.Info;case e.exports.DiagnosticSeverity.Hint:return s.Hint;default:return s.Info}}function h(e){return new n(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function m(e){return{range:h(e.range),text:e.newText}}function x(t){const s=r.CompletionItemKind;switch(t){case e.exports.CompletionItemKind.Text:return s.Text;case e.exports.CompletionItemKind.Method:return s.Method;case e.exports.CompletionItemKind.Function:return s.Function;case e.exports.CompletionItemKind.Constructor:return s.Constructor;case e.exports.CompletionItemKind.Field:return s.Field;case e.exports.CompletionItemKind.Variable:return s.Variable;case e.exports.CompletionItemKind.Class:return s.Class;case e.exports.CompletionItemKind.Interface:return s.Interface;case e.exports.CompletionItemKind.Module:return s.Module;case e.exports.CompletionItemKind.Property:return s.Property;case e.exports.CompletionItemKind.Unit:return s.Unit;case e.exports.CompletionItemKind.Value:return s.Value;case e.exports.CompletionItemKind.Enum:return s.Enum;case e.exports.CompletionItemKind.Keyword:return s.Keyword;case e.exports.CompletionItemKind.Snippet:return s.Snippet;case e.exports.CompletionItemKind.Color:return s.Color;case e.exports.CompletionItemKind.File:return s.File;case e.exports.CompletionItemKind.Reference:return s.Reference;case e.exports.CompletionItemKind.Folder:return s.Folder;case e.exports.CompletionItemKind.EnumMember:return s.EnumMember;case e.exports.CompletionItemKind.Constant:return s.Constant;case e.exports.CompletionItemKind.Struct:return s.Struct;case e.exports.CompletionItemKind.Event:return s.Event;case e.exports.CompletionItemKind.Operator:return s.Operator;case e.exports.CompletionItemKind.TypeParameter:return s.TypeParameter;default:return s.Property}}class w{constructor(e,t){this._worker=e,this._defaults=t,this.triggerCharacters=[".","("]}async provideCompletionItems(t,s){const i=await this._worker(t.uri),a=this._defaults.getApiContextForModel(t.uri),o=await i.doComplete(t.uri.toString(),function(e){return{character:e.column-1,line:e.lineNumber-1}}(s),a),c=t.getWordUntilPosition(s),u=new n(s.lineNumber,c.startColumn,s.lineNumber,c.endColumn),l=o.items.map((t=>{const s={label:t.label,insertText:t.insertText||t.label,sortText:t.sortText,filterText:t.filterText,detail:t.detail,range:u,kind:x(t.kind)};var n;return t.textEdit&&(s.range=void 0!==(n=t.textEdit).insert&&void 0!==n.replace?{insert:h(t.textEdit.insert),replace:h(t.textEdit.replace)}:h(t.textEdit.range),s.insertText=t.textEdit.newText),t.additionalTextEdits&&(s.additionalTextEdits=t.additionalTextEdits.map(m)),t.insertTextFormat===e.exports.InsertTextFormat.Snippet&&(s.insertTextRules=r.CompletionItemInsertTextRule.InsertAsSnippet),t.documentation&&(s.documentation="string"==typeof t.documentation?t.documentation:{supportThemeIcons:!1,value:t.documentation.value,supportHtml:!0}),s}));return{incomplete:o.isIncomplete,suggestions:l}}}class f{constructor(e,t){this._worker=e,this._defaults=t}async provideDocumentFormattingEdits(e){const t=await this._worker(e.uri),s=this._defaults.getApiContextForModel(e.uri.toString());return(await t.doFormat(e.uri.toString(),s)).map((e=>({range:h(e.range),text:e.newText})))}}let k,b=new a;class y{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,b=new a),this._client=null}static async waitForWorker(){return await b.promise}async _getClientProxy(){if(!this._client){const{languageId:e,languageOptions:s}=this._defaults;this._worker=t.createWebWorker({moduleId:"ArcadeWorker",label:e,createData:{languageId:e,languageOptions:s}}),b.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){const t=await this._getClientProxy();return await(this._worker?.withSyncedResources(e)),t}}async function v(...e){return await y.waitForWorker(),await new Promise(((t,s)=>{k?t(k(...e)):s(new Error("Arcade not registered!"))}))}const C=new class{constructor(){this._onDiagnosticsChange=new o}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}};function _(){return C}function F(e){const t=new y(e),s=async(...e)=>await t.getLanguageServiceWorker(...e);k=s,r.setMonarchTokensProvider(e.languageId,g),r.setLanguageConfiguration(e.languageId,l),r.registerCompletionItemProvider(e.languageId,new w(s,e)),r.registerDocumentFormattingEditProvider(e.languageId,new f(s,e)),new p(e.languageId,s,{defaults:e,diagnosticsService:C})}export{_ as getArcadeDiagnosticService,v as getArcadeWorker,F as setupMode}
|