/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import c from"./AILSAJ35.js";import{a as m}from"./4HCNI2HA.js";import b from"./EVSXXHQ5.js";import a from"./HDPC4QT2.js";import{a as s}from"./EMCHMKAC.js";import{Zk as d,al as t}from"./YCOWKBW5.js";export default $arcgis.t(([n,{a:a,b:p},{c:c}])=>{var k=["arcade","arcgis-sql-expression"],i=new Set,u=new Map;function f(e){let r=u.get(e);return r||(r=Promise.withResolvers(),u.set(e,r)),r}function l(e){f(e).resolve()}function T(e){return k.includes(e)?f(e).promise:Promise.resolve()}function h(e,r){return()=>{i.has(e)||i.add(e),r()}}async function U(e){i.has(e)||(await s()).createModel("",e,d.parse("")).dispose()}t.register({id:n.languageId,aliases:["Arcade","arcade"],extensions:[".arc"],mimetypes:["application/arcade"]});t.onLanguage(n.languageId,h(n.languageId,()=>{c().then(e=>{e.setupMode(n),l(n.languageId)}).catch(e=>{throw e})}));t.register({id:a.languageId,aliases:["EsiSqlExpression","sql-expression"],extensions:[".sql-expression"],mimetypes:["application/sql-expression"]});t.onLanguage(a.languageId,h(a.languageId,()=>{p().then(e=>{e.setupMode(a),l(a.languageId)}).catch(e=>{throw e})}));w();function w(){s().then(e=>{["light","dark"].forEach(r=>{let g=r==="light"?"vs":"vs-dark",o=m[`${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:T,b:U}},a,b,c)