@arcgis/coding-components 4.32.0-next.58 → 4.32.0-next.60

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 (72) hide show
  1. package/dist/arcgis-coding-components/{PIU3GLSN.js → 27XX6TIU.js} +2 -2
  2. package/dist/arcgis-coding-components/{O362HU2I.js → 3PPWXWTS.js} +2 -2
  3. package/dist/arcgis-coding-components/{NXQWTU6D.js → 3QE4WEJR.js} +2 -2
  4. package/dist/arcgis-coding-components/3RYPISGD.js +6 -0
  5. package/dist/arcgis-coding-components/{EO7FSJ7P.js → 5NCIF6PY.js} +1 -1
  6. package/dist/arcgis-coding-components/{VOT5BYWL.js → 6KDUW6OF.js} +2 -2
  7. package/dist/arcgis-coding-components/{YKUWOITF.js → 77IZXYPY.js} +2 -2
  8. package/dist/arcgis-coding-components/{OYVPJNZK.js → AB3PCHOX.js} +2 -2
  9. package/dist/arcgis-coding-components/{IHBPXULM.js → AJDJLFAA.js} +2 -2
  10. package/dist/arcgis-coding-components/{7LNCLERO.js → BDNQ5Z2B.js} +2 -2
  11. package/dist/arcgis-coding-components/BWMK6GPR.js +6 -0
  12. package/dist/arcgis-coding-components/{YCNTHIAU.js → CFNLWCXB.js} +2 -2
  13. package/dist/arcgis-coding-components/{62SSNNAO.js → DBGTZ257.js} +1 -1
  14. package/dist/arcgis-coding-components/{LQRMBDCH.js → DRB2D4R2.js} +2 -2
  15. package/dist/arcgis-coding-components/{R75ZJURF.js → E6IQK7SV.js} +2 -2
  16. package/dist/arcgis-coding-components/FBKAKDLJ.js +14 -0
  17. package/dist/arcgis-coding-components/FO3FPKTU.js +6 -0
  18. package/dist/arcgis-coding-components/{MWBB5JJ7.js → GRHVEY5C.js} +2 -2
  19. package/dist/arcgis-coding-components/{3KI3B3S6.js → KNO4MLJY.js} +2 -2
  20. package/dist/arcgis-coding-components/{BKAQOBIR.js → LRLYHBR2.js} +2 -2
  21. package/dist/arcgis-coding-components/{4IJ3XFC2.js → MD4W3HAT.js} +2 -2
  22. package/dist/arcgis-coding-components/{PWAEEW7S.js → MDEPKIKV.js} +3 -3
  23. package/dist/arcgis-coding-components/{N6ISXI5Y.js → NEDGH3HO.js} +2 -2
  24. package/dist/arcgis-coding-components/{2L2TJL2K.js → NVS5EIUQ.js} +2 -2
  25. package/dist/arcgis-coding-components/{YA6FFFR2.js → RGXWU6RA.js} +2 -2
  26. package/dist/arcgis-coding-components/{X2X53W36.js → RV5HPJ7R.js} +1 -1
  27. package/dist/arcgis-coding-components/TBNJJAWE.js +6 -0
  28. package/dist/arcgis-coding-components/{ZULSO2FF.js → USHAHMFP.js} +2 -2
  29. package/dist/arcgis-coding-components/{GKFYIM5D.js → UX3FDPMK.js} +2 -2
  30. package/dist/arcgis-coding-components/{D4O6WEO7.js → W3VHE6OK.js} +2 -2
  31. package/dist/arcgis-coding-components/{NIC6H3IU.js → WCXILITC.js} +2 -2
  32. package/dist/arcgis-coding-components/{QUT7CUTS.js → WX4VSC6B.js} +2 -2
  33. package/dist/arcgis-coding-components/YKBBYHQG.js +6 -0
  34. package/dist/arcgis-coding-components/{6LSIDM7X.js → ZFXBOHYK.js} +2 -2
  35. package/dist/arcgis-coding-components/{75US6IWW.js → ZKC5GKT4.js} +2 -2
  36. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  37. package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +1 -1
  38. package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +45 -45
  39. package/dist/chunks/arcade-defaults.js +1 -1
  40. package/dist/chunks/arcade-executor.js +1 -1
  41. package/dist/chunks/arcade-mode.js +1 -1
  42. package/dist/chunks/arcade-service-accessors.js +1 -1
  43. package/dist/chunks/fields.js +1 -1
  44. package/dist/chunks/language-defaults-base.js +135 -144
  45. package/dist/chunks/markdown.js +1 -1
  46. package/dist/chunks/monaco-importer.js +1 -1
  47. package/dist/chunks/runtime.js +1 -1
  48. package/dist/chunks/sql-expr-defaults.js +1 -1
  49. package/dist/chunks/sql-expr-mode.js +1 -1
  50. package/dist/chunks/useT9n.js +1 -1
  51. package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
  52. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  53. package/dist/components/arcgis-arcade-suggestions/customElement.js +19 -16
  54. package/dist/components/arcgis-code-editor/customElement.js +1 -1
  55. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  56. package/dist/components/arcgis-language-api-panel/customElement.js +34 -35
  57. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  58. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  59. package/dist/docs/api.json +2 -2
  60. package/dist/docs/docs.json +2 -2
  61. package/dist/docs/web-types.json +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/loader.js +1 -1
  64. package/dist/utils/index.d.ts +1 -1
  65. package/dist/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +1 -3
  66. package/package.json +7 -7
  67. package/dist/arcgis-coding-components/3OIXH6J2.js +0 -6
  68. package/dist/arcgis-coding-components/BMSLGLZN.js +0 -16
  69. package/dist/arcgis-coding-components/TTS3GMIW.js +0 -6
  70. package/dist/arcgis-coding-components/XJEM4QTJ.js +0 -6
  71. package/dist/arcgis-coding-components/XWPD74FP.js +0 -6
  72. package/dist/arcgis-coding-components/YAR7YCKS.js +0 -6
@@ -28,7 +28,7 @@
28
28
  `,`
29
29
  `]:[`
30
30
  `]}nextPos(t,n=!1){let i=Math.max(t.line,0);return Math.max(t.column,0)<this.getLineLength(i)?(t.column+=1,n?!!this.skipSpaces(t):!0):i<this.length?(t.line+=1,t.column=0,n?!!this.skipSpaces(t):!0):!1}prevPos(t,n=!1){let i=t.line,r=t.column;if(r<1){if(i-=1,i<1)return!1;r=this.getLineLength(i)}else r=Math.min(r-1,this.getLineLength(i));return t.line=i,t.column=r,n?!!this.skipSpaces(t,!0):!0}firstPos(){return{line:1,column:0}}lastPos(){return{line:this.length,column:this.getLineLength(this.length)}}skipSpaces(t,n=!1){if(n){for(;this.prevPos(t);)if(!Mi(this.charAt(t))&&this.nextPos(t))return t;return null}else{for(;Mi(this.charAt(t));)if(!this.nextPos(t))return null;return t}}slice(t,n){if(!n&&!t)return this;if(n??(n=this.lastPos()),!t)throw new Error("cannot slice with end but not start");let i=this.lineRecords.slice(t.line-1,n.line);return t.line===n.line?i[0]=Gt(i[0],t.column,n.column):(i[0]=Gt(i[0],t.column),i.push(Gt(i.pop()??i[0],0,n.column))),new ys(i)}sliceString(t=this.firstPos(),n=this.lastPos()){let i=[];for(let r=t.line;r<=n.line;r++){let s=this.lineRecords[r-1];r===t.line?r===n.line?s=Gt(s,t.column,n.column):s=Gt(s,t.column):r===n.line&&(s=Gt(s,0,n.column));let o="",a=Math.max(s.indentation,0);a>0&&(o+=new Array(a+1).join(" ")),o+=s.line.slice(s.sliceStart,s.sliceEnd),i.push(o)}return i.join(`
31
- `)}};function r0(e,t=2){let n=0,i=e.length;for(let r=0;r<i;r++)switch(e.charCodeAt(r)){case 9:{let s=Math.ceil(n/t)*t;s===n?n+=t:n=s;break}case 11:case 12:case 13:case 65279:break;case 32:default:n+=1;break}return n}function Gt(e,t,n){let i=e.sliceStart,r=e.sliceEnd,s=Math.max(e.indentation,0),o=s+r-i;return n??(n=o),t=Math.max(t,0),n=Math.min(n,o),n=Math.max(n,t),n<s?(s=n,r=i):r-=o-n,o=n,o-=t,t<s?s-=t:(t-=s,s=0,i+=t),e.indentation===s&&e.sliceStart===i&&e.sliceEnd===r?e:{line:e.line,indentation:s,sliceStart:i,sliceEnd:r}}function y1(e,t,n){return!e&&!n?"":e?n?`${e}${t}${n}`:e:n}var s0=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/u,U=class We{constructor(t=[]){this.lines=t}static fromString(t){return new We(t.split(s0))}static appendLines(t=[]){let n=new We;return t.forEach(i=>{i!=null&&(typeof i=="string"?n.lines.push(i):n.lines.push(...i.lines))}),n}static joinLines(t=[],n=""){let i=new We;return t.forEach(r=>{if(r==null)return;let s=i.lines.pop()??"";typeof r=="string"?i.lines.push(y1(s,n,r)):(i.lines.push(y1(s,n,r.lines.slice(0)[0])),i.lines.push(...r.lines.slice(1)))}),i}static aggregateLines(t,n,i,r,s){if(i.isEmpty)return t;if(!n||t.isEmpty)return i.indentFirstLine(s);let o=r.start.line-n.end.line;if(o===0)return We.joinLines([t," ",i]);let a=o===1?void 0:"";return We.appendLines([t,a,i.indentFirstLine(s)])}get isEmpty(){return this.lines.length===0||this.lines.length===1&&this.lines[0].length===0}get maxLineLength(){return this.lines.reduce((t,n)=>Math.max(t,n.length),0)}get firstLineLength(){return(this.lines[0]??"").length}get lastLineLength(){return(this.lines[this.lines.length-1]??"").length}surroundWith(t="",n=""){return!t&&!n?this:this.isEmpty?new We([t+n]):this.lines.length===1?new We([t+this.lines[0]+n]):We.joinLines([t,this,n])}indentFirstLine(t=""){return this.isEmpty?this:(this.lines[0]=t+this.lines[0],this)}suffixWith(t){return this.surroundWith("",t)}toString(t=`
31
+ `)}};function r0(e,t=2){let n=0,i=e.length;for(let r=0;r<i;r++)switch(e.charCodeAt(r)){case 9:{let s=Math.ceil(n/t)*t;s===n?n+=t:n=s;break}case 11:case 12:case 13:case 65279:break;case 32:default:n+=1;break}return n}function Gt(e,t,n){let i=e.sliceStart,r=e.sliceEnd,s=Math.max(e.indentation,0),o=s+r-i;return n??(n=o),t=Math.max(t,0),n=Math.min(n,o),n=Math.max(n,t),n<s?(s=n,r=i):r-=o-n,t<s?s-=t:(t-=s,s=0,i+=t),e.indentation===s&&e.sliceStart===i&&e.sliceEnd===r?e:{line:e.line,indentation:s,sliceStart:i,sliceEnd:r}}function y1(e,t,n){return!e&&!n?"":e?n?`${e}${t}${n}`:e:n}var s0=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/u,U=class We{constructor(t=[]){this.lines=t}static fromString(t){return new We(t.split(s0))}static appendLines(t=[]){let n=new We;return t.forEach(i=>{i!=null&&(typeof i=="string"?n.lines.push(i):n.lines.push(...i.lines))}),n}static joinLines(t=[],n=""){let i=new We;return t.forEach(r=>{if(r==null)return;let s=i.lines.pop()??"";typeof r=="string"?i.lines.push(y1(s,n,r)):(i.lines.push(y1(s,n,r.lines.slice(0)[0])),i.lines.push(...r.lines.slice(1)))}),i}static aggregateLines(t,n,i,r,s){if(i.isEmpty)return t;if(!n||t.isEmpty)return i.indentFirstLine(s);let o=r.start.line-n.end.line;if(o===0)return We.joinLines([t," ",i]);let a=o===1?void 0:"";return We.appendLines([t,a,i.indentFirstLine(s)])}get isEmpty(){return this.lines.length===0||this.lines.length===1&&this.lines[0].length===0}get maxLineLength(){return this.lines.reduce((t,n)=>Math.max(t,n.length),0)}get firstLineLength(){return(this.lines[0]??"").length}get lastLineLength(){return(this.lines[this.lines.length-1]??"").length}surroundWith(t="",n=""){return!t&&!n?this:this.isEmpty?new We([t+n]):this.lines.length===1?new We([t+this.lines[0]+n]):We.joinLines([t,this,n])}indentFirstLine(t=""){return this.isEmpty?this:(this.lines[0]=t+this.lines[0],this)}suffixWith(t){return this.surroundWith("",t)}toString(t=`
32
32
  `){return this.lines.join(t)}};function Rs(e,t){return e*(t.indentWidth??2)}function Ct(e=0,t){let{indentWidth:n=2}=Is(t);return new Array(e*n+1).join(" ")}function Bi(e){return e.replace(/['"]/gu,t=>t==='"'?"'":'"')}function o0(e,t){switch(e.type){case p.UnaryExpression:return C1(t)&&t.object===e;case p.BinaryExpression:case p.LogicalExpression:switch(t.type){case p.UnaryExpression:return!0;case p.MemberExpression:return t.object===e;case p.BinaryExpression:case p.LogicalExpression:return Ti[t.operator]>Ti[e.operator];default:return!1}case p.Literal:return C1(t)&&typeof e.value=="number"&&t.object===e;case p.AssignmentExpression:switch(t.type){case p.UnaryExpression:case p.BinaryExpression:case p.LogicalExpression:case p.ReturnStatement:return!0;case p.MemberExpression:return t.object===e;default:return!1}default:return!1}}function Y(e,t,n){switch(e?.type){case p.BinaryExpression:case p.LogicalExpression:return a0(e,t,n);case p.AssignmentExpression:return new Ms(e,t,n);case p.MemberExpression:return new X1(e,t,n);case p.Identifier:return new Ss(e,t,n);case p.CallExpression:return new l0(e,t,n);case p.ObjectExpression:return wt(e,t,n);case p.ArrayExpression:return wt(e,t,n);case p.Literal:return new Ss(e,t,n);case p.UpdateExpression:case p.UnaryExpression:return new G1(e,t,n);case p.TemplateLiteral:return new h0(e,t,n);case p.VariableDeclaration:return new Ns(e,t,n);default:throw new Error(`unknown type: ${JSON.stringify(e)}`)}}function wt(e,t,n){let i=new Wi(e,t,n);switch(e.type){case p.ArrayExpression:return i.setupCollection(e.elements.map(r=>Y(r,e,n)),"SquareBrackets"),i;case p.ObjectExpression:return i.setupCollection(e.properties.map(r=>new c0(r,e,n)),"CurlyBrackets"),i;case p.VariableDeclaration:return i.prefix="var ",i.setupCollection(e.declarations.map(r=>j1(r,e,n)),"None"),i;case p.FunctionDeclaration:return i.prefix=`function ${e.id.name}`,i.setupCollection(e.params.map(r=>Y(r,e,n)),"Parentheses"),i;case p.ForStatement:return i.prefix="for ",i.setupCollection([Y(e.init,e,n),Y(e.test,e,n),Y(e.update,e,n)],"Parentheses",";"),i;case p.ForInStatement:case p.ForOfStatement:return i.prefix="for ",i.setupCollection([new Ms(e,t,n)],"Parentheses",""),i;case p.IfStatement:return i.prefix="if ",i.setupCollection([Y(e.test,e,n)],"Parentheses",""),i;case p.WhileStatement:return i.prefix="while ",i.setupCollection([Y(e.test,e,n)],"Parentheses",""),i;default:return i}}function j1(e,t,n){return e.init?new Ms(e,t,n):new Ss(e.id,t,n)}function a0(e,t,n){let i=[...zi(e.left,e.operator),...zi(e.right,e.operator)].map(s=>Y(s,e,n)),r=new Wi(e,t,n);return r.setupCollection(i,"None",` ${e.operator}`),r}function zi(e,t){return e.type!==p.BinaryExpression&&e.type!==p.LogicalExpression?[e]:e.operator!==t?[e]:[...zi(e.left,t),...zi(e.right,t)]}var $e=class{constructor(e,t,n){this.node=e,this.parent=t,this.options=n,this.prefix="",this.suffix="",this.groupingParentheses=!1,this.groupingParentheses=o0(e,t)}get openingParenthesis(){return this.groupingParentheses?"(":""}get closingParenthesis(){return this.groupingParentheses?")":""}get leadingString(){return[this.prefix,this.openingParenthesis].join("")}get trailingString(){return[this.closingParenthesis,this.suffix].join("")}finalize(e){return typeof e=="string"&&(e=U.fromString(e)),e.surroundWith(this.leadingString,this.trailingString)}},Wi=class extends $e{constructor(e,t,n){super(e,t,n),this.node=e,this.parent=t,this.options=n,this.type="CollectionPrinter",this.bracketsType="None",this.separator=",",this.printers=[]}setupCollection(e=[],t="None",n){return this.bracketsType=t,this.separator=n??this.separator,this.printers=e,this}getOpeningBracket(e=!1,t="singleLine"){if(this.bracketsType==="None")return"";if(this.bracketsType==="CurlyBrackets")return`{${e||t==="multiline"?"":" "}`;switch(this.bracketsType){case"Parentheses":return"(";case"SquareBrackets":return"[";default:return""}}getClosingBracket(e=!1,t="singleLine"){if(this.bracketsType==="None")return"";if(this.bracketsType==="CurlyBrackets")return`${e||t==="multiline"?"":" "}}`;switch(this.bracketsType){case"Parentheses":return")";case"SquareBrackets":return"]";default:return""}}getLinesLevel(e=0){return this.bracketsType!=="None"||zc(this.parent)||z1(this.parent)||(vs(this.node)||Ls(this.node))&&(vs(this.parent)||Ls(this.parent))?e+1:e}finalize(e,t="singleLine",n=0){if(this.bracketsType==="None")return super.finalize(e);let i=this.getOpeningBracket(e.isEmpty,t),r=this.getClosingBracket(e.isEmpty,t);if(t==="singleLine")return super.finalize(e.surroundWith(i,r));let s=Ct(n,this.options);return super.finalize(U.appendLines([i,e,s+r]))}singleLineFormat(e=0){let t=this.printers.length-1;return U.joinLines(this.printers.map((n,i)=>n.format("singleLine",e).suffixWith(i<t?this.separator:""))," ")}optimizedPrinterFormat(e,t,n=0){let i=this.getLinesLevel(n),r=Ct(i,this.options),s=this.bracketsType==="None"&&t===0?"":r,o=t<this.printers.length-1?this.separator:"",a=e.format("singleLine",i).suffixWith(o);return a.maxLineLength+r.length<=this.options.wrapColumn?a.indentFirstLine(s):e.format("multiline",i).suffixWith(o).indentFirstLine(s)}multilineFormat(e=0){return U.appendLines(this.printers.map((t,n)=>this.optimizedPrinterFormat(t,n,e)))}format(e="singleLine",t=0){if(this.printers.length===0){let i=this.getOpeningBracket(!0,e),r=this.getClosingBracket(!0,e);return super.finalize(U.fromString(i+r))}if(e==="singleLine"){let i=this.singleLineFormat(t);return this.finalize(i,e,t)}let n=this.multilineFormat(t);return this.finalize(n,e,t)}},u0=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/u,Ss=class extends $e{constructor(e,t,n){super(e,t,n),this.node=e,this.parent=t,this.options=n,this.type="StringPrinter"}format(){if(Be(this.node))return this.finalize(this.node.name);if(typeof this.node.value!="string")return this.finalize(this.node.raw);if(Hc(this.parent)&&this.parent.key===this.node&&q1(this.node)&&typeof this.node.value=="string"&&u0.test(this.node.value))return this.finalize(this.node.value);switch(this.options.quote){case"auto":{let e=JSON.stringify(this.node.value),t=Bi(JSON.stringify(Bi(this.node.value)));return this.finalize(e.length>t.length?t:e)}case"single":return this.finalize(Bi(JSON.stringify(Bi(this.node.value))));default:return this.finalize(JSON.stringify(this.node.value))}}},G1=class extends $e{constructor(e,t,n){super(e,t,n),this.node=e,this.parent=t,this.options=n,this.type="SingleExpressionPrinter";let i=Wc(e),r=$c(e);if(i||r){this.prefix=i?e.operator:"",this.suffix=r&&!e.prefix?e.operator:"",this.printer=Y(e.argument,e,this.options);return}this.printer=Y(e,t,this.options)}format(e="singleLine",t=0){return this.finalize(this.printer.format(e,t))}},Ns=class extends $e{constructor(e,t,n){super(e,t,n),this.node=e,this.parent=t,this.options=n,this.type="VariableDeclaratorsPrinter",e.declarations.length===1?(this.printer=j1(e.declarations[0],e,this.options),this.printer.prefix="var "):this.printer=wt(e,t,this.options)}format(e="singleLine",t=0){return this.finalize(this.printer.format(e,t))}},l0=class extends $e{constructor(e,t,n){super(e,t,n),this.node=e,this.parent=t,this.options=n,this.type="CallExpressionPrinter",this.argumentsPrinter=new Wi(e,t,n),this.argumentsPrinter.setupCollection(e.arguments.map(i=>Y(i,e,n)),"Parentheses"),Be(e.callee)?this.argumentsPrinter.prefix=e.callee.name:this.memberExpressionPrinter=new X1(e.callee,t,n)}format(e="singleLine",t=0){if(!this.memberExpressionPrinter)return this.finalize(this.argumentsPrinter.format(e,t));let n=this.memberExpressionPrinter.format("singleLine",t),i=this.argumentsPrinter.format("singleLine",t);if(e==="singleLine")return this.finalize(U.joinLines([n,i]));let r=Rs(t,this.options)+this.leadingString.length+n.firstLineLength;return r+1<this.options.wrapColumn?(i=this.argumentsPrinter.format("multiline",t),this.finalize(U.joinLines([n,i]))):(n=this.memberExpressionPrinter.format("multiline",t),r=n.lastLineLength,r+i.maxLineLength>this.options.wrapColumn&&(i=this.argumentsPrinter.format("multiline",t+1)),this.finalize(U.joinLines([n,i])))}},X1=class extends $e{constructor(e,t,n){if(super(e,t,n),this.node=e,this.parent=t,this.options=n,this.type="MemberExpressionPrinter",this.objectPrinter=Y(e.object,e,this.options),e.computed){let i=new Wi(e.property,e,this.options);i.setupCollection([Y(e.property,e,this.options)],"SquareBrackets"),this.propertyPrinter=i}else{let i=new G1(e.property,e,this.options);i.prefix=".",this.propertyPrinter=i}}format(e="singleLine",t=0){let n=this.objectPrinter.format("singleLine",t),i=this.propertyPrinter.format("singleLine",t);if(e==="singleLine")return this.finalize(U.joinLines([n,i]));let r=Rs(t,this.options)+this.leadingString.length+n.firstLineLength;r>this.options.wrapColumn&&(n=this.objectPrinter.format("multiline",t),r=n.lastLineLength);let s=i.firstLineLength+this.trailingString.length;if(r+s<this.options.wrapColumn)return this.finalize(U.joinLines([n,i]));if(this.node.computed)return this.finalize(U.joinLines([n,this.propertyPrinter.format("multiline",t)]));let o=t+1,a=Ct(o,this.options);return i=this.propertyPrinter.format("singleLine",t),s=a.length+i.lastLineLength+this.trailingString.length,s>this.options.wrapColumn&&(i=this.propertyPrinter.format("multiline",o)),this.finalize(U.appendLines([n,i.indentFirstLine(a)]))}},c0=class extends $e{constructor(e,t,n){super(e,t,n),this.node=e,this.parent=t,this.options=n,this.type="PropertyPrinter",this.key=Y(e.key,e,this.options),e.shorthand||(this.key.suffix=":",this.value=Y(e.value,e,this.options))}format(e="singleLine",t=0){if(this.node.shorthand||!this.value)return this.finalize(this.key.format(e,t));let n=this.key.format("singleLine",t);if(e==="singleLine"){let s=this.value.format("singleLine",t);return this.finalize(U.joinLines([n,s]," "))}if(Oi(this.node.value)||Oi(this.node.value)){let s=this.value.format("multiline",t);return this.finalize(U.joinLines([n,s]," "))}let i=Ct(t+1,this.options),r=this.value.format("singleLine",t+1).indentFirstLine(i);return r.maxLineLength+this.trailingString.length+1<=this.options.wrapColumn?this.finalize(U.appendLines([n,r])):(r=this.value.format("multiline",t+1).indentFirstLine(i),this.finalize(U.appendLines([n,r])))}},Ms=class extends $e{constructor(e,t,n){switch(super(e,t,n),this.node=e,this.parent=t,this.options=n,this.type="OperationPrinter",this.operator="",this.noNewLineWrapping=!1,e.type){case p.AssignmentExpression:this.leftPrinter=Y(e.left,e,this.options),this.operator=` ${e.operator}`,this.rightPrinter=Y(e.right,e,this.options),this.noNewLineWrapping=(Be(e.left)||q1(e.left))&&(Oi(e.right)||D1(e.right));return;case p.VariableDeclarator:this.leftPrinter=Y(e.id,e,this.options),e.init&&(this.operator=" =",this.rightPrinter=Y(e.init,e,this.options)),this.noNewLineWrapping=Oi(e.init)||D1(e.init);return;case p.ForInStatement:case p.ForOfStatement:this.leftPrinter=Y(e.left,e,this.options),this.operator=e.type==="ForInStatement"?" in":" of",this.rightPrinter=Y(e.right,e,this.options);return;case p.BinaryExpression:case p.LogicalExpression:this.leftPrinter=Y(e.left,e,this.options),this.operator=` ${e.operator}`,this.rightPrinter=Y(e.right,e,this.options);return}}format(e="singleLine",t=0){if(!this.rightPrinter)return this.finalize(this.leftPrinter.format(e,t));let n=this.leftPrinter.format("singleLine",t).suffixWith(this.operator),i=this.rightPrinter.format("singleLine",t);if(e==="singleLine")return this.finalize(U.joinLines([n,i]," "));let r=Rs(t,this.options)+this.leadingString.length+n.maxLineLength+1;r>this.options.wrapColumn&&(n=this.leftPrinter.format("multiline",t).suffixWith(this.operator),r=n.lastLineLength+1);let s=i.firstLineLength+this.trailingString.length+1;if(r+s<this.options.wrapColumn)return this.finalize(U.joinLines([n,i]," "));let o=this.rightPrinter.format("multiline",t);return o.firstLineLength+this.trailingString.length+1+r<this.options.wrapColumn||this.noNewLineWrapping?this.finalize(U.joinLines([n,o]," ")):(s>this.options.wrapColumn&&(i=this.rightPrinter.format("multiline",t+1)),i=i.indentFirstLine(Ct(t+1)),this.finalize(U.appendLines([n,i])))}},h0=class extends $e{constructor(e,t,n){super(e,t,n),this.node=e,this.parent=t,this.options=n,this.type="TemplateLiteralPrinter",this.parts=[];let i=e.expressions.map(r=>Y(r,e,this.options));this.parts.push("`"),e.quasis.forEach((r,s)=>{this.parts.push(r.value.raw),s<i.length&&(this.parts.push("${"),this.parts.push(i[s]),this.parts.push("}"))}),this.parts.push("`")}format(e="singleLine",t=0){return this.finalize(U.joinLines(this.parts.map(n=>typeof n=="string"?n:n.format(e,t))))}};function f0(e){let t={...e.leadingComments?.slice(0,1)[0]?.loc.start??e.loc.start},n={...e.trailingComments?.slice(-1)[0]?.loc.end??e.loc.end};return{start:t,end:n}}function d0(e){return e.trailingComments?.slice(-1)[0]?.type===p.LineComment}var He=class{constructor(e,t,n){this.node=e,this.parent=t,this.options=n,this.indentStatementFirstLine=!0,this.externalOffset=0,this.options=Is(this.options)}createStatementPrinter(e){switch(e.type){case p.Program:return new Nn(e,this.node,this.options);case p.ImportDeclaration:return new D0(e,this.node,this.options);case p.ExpressionStatement:return new x0(e,this.node,this.options);case p.FunctionDeclaration:return new N1(e,this.node,this.options);case p.ExportNamedDeclaration:return Vi(e)?new S1(e,this.node,this.options):new N1(e,this.node,this.options);case p.BlockStatement:return new Nn(e,this.node,this.options);case p.ReturnStatement:return new b0(e,this.node,this.options);case p.VariableDeclaration:return new S1(e,this.node,this.options);case p.IfStatement:return new p0(e,this.node,this.options);case p.ForStatement:case p.ForInStatement:case p.ForOfStatement:case p.WhileStatement:return new g0(e,this.node,this.options);case p.EmptyStatement:case p.BreakStatement:case p.ContinueStatement:return new m0(e,this.node,this.options);default:throw new Error(`unknown type: ${JSON.stringify(e)}`)}}getFormattedBody(e,t=0){if(this.cachedBody&&this.cachedBody.level===t)return this.cachedBody.body;let n=e.format(t);return this.cachedBody={body:n,level:t},n}getStatementIndentation(e=0){return this.indentStatementFirstLine?Ct(e,this.options):""}getStatementIndentationLength(e=0){return this.indentStatementFirstLine?e*this.options.indentWidth:0}getIndentation(e=0){return Ct(e,this.options)}addComments(e,t=0){let n=this.getStatementIndentation(t);if(!this.node.leadingComments?.length&&!this.node.trailingComments?.length)return e.indentFirstLine(n);let i=(this.node.leadingComments??[]).reduce((s,o)=>{let a=this.formatComment(o);return{formattedLines:U.aggregateLines(s.formattedLines,s.location,a,o.loc,n),location:o.loc}},{formattedLines:new U}),r=U.aggregateLines(i.formattedLines,i.location,e,this.node.loc,n);return(this.node.trailingComments?.reduce((s,o)=>{let a=this.formatComment(o);return{formattedLines:U.aggregateLines(s.formattedLines,s.location,a,o.loc,n),location:o.loc}},{formattedLines:r,location:this.node.loc})??{formattedLines:r}).formattedLines}formatInnerComments(e=0){if(!Pe(this.node)||!Array.isArray(this.node.innerComments)||!this.node.innerComments.length)return new U;let t=this.getIndentation(e);return this.node.innerComments.reduce((n,i)=>{let r=this.formatComment(i);return{formattedLines:U.aggregateLines(n.formattedLines,n.location,r,i.loc,t),location:i.loc}},{formattedLines:new U}).formattedLines}formatComment(e){switch(e.type){case p.BlockComment:return U.fromString(e.value).surroundWith("/*","*/");default:return U.fromString(e.value.trimEnd()).surroundWith("//")}}canFitSingleLine(e,t=0,n=0){return this.externalOffset+n+this.getStatementIndentationLength(t)+e.lastLineLength<=this.options.wrapColumn}},Nn=class extends He{constructor(e,t,n){super(e,t,n),this.node=e,this.printers=[],this.printers=e.body.map(i=>this.createStatementPrinter(i))}format(e=0){if(this.printers.length===0)return this.formatEmptyBlock(e);let t=[],n=Pe(this.node);n&&t.push("{");let i=n?e+1:e,r;return this.printers.forEach(s=>{if(ks(s.node))return;let o=f0(s.node);r&&o.start.line-r.end.line>1&&t.push(""),r=o,t.push(s.format(i))}),n&&t.push(`${this.getIndentation(e)}}`),this.addComments(U.appendLines(t),e)}formatEmptyBlock(e=0){if(!Pe(this.node))return this.addComments(U.fromString(""),e);let t=this.formatInnerComments(e+1),n="{",i=`${this.getIndentation(e)}}`;return t.isEmpty?_s(this.parent)?this.addComments(U.appendLines([n,i]),e):this.addComments(U.fromString("{}"),e):this.addComments(U.appendLines([n,t,i]),e)}},m0=class extends He{constructor(e,t,n){switch(super(e,t,n),this.node=e,this.keyword="",this.node.type){case p.ContinueStatement:this.keyword="continue;";break;case p.BreakStatement:this.keyword="break;";break;default:this.keyword=";"}}format(e=0){return this.addComments(U.fromString(this.keyword),e)}},S1=class extends He{constructor(e,t,n){if(super(e,t,n),this.node=e,Vi(e))this.printer=new Ns(e,t,n);else if(Vi(e.declaration))this.printer=new Ns(e.declaration,t,n),this.printer.prefix="export ";else throw new Error(`invalid type: ${JSON.stringify(e)}`)}format(e=0,t="optimized"){if(t==="singleLine"||t==="optimized"){let n=this.printer.format("singleLine",e).suffixWith(";");if(t==="singleLine"||this.canFitSingleLine(n,e))return this.addComments(n,e)}return this.addComments(this.printer.format("multiline",e).suffixWith(";"),e)}},N1=class extends He{constructor(e,t,n){if(super(e,t,n),this.node=e,b1(e))this.header=wt(e,t,n),this.body=new Nn(e.body,e,n);else if(b1(e.declaration))this.header=wt(e.declaration,t,n),this.header.prefix="export ",this.body=new Nn(e.declaration.body,e,n);else throw new Error(`invalid type: ${JSON.stringify(e)}`)}format(e=0,t="optimized"){this.body.indentStatementFirstLine=!1;let n=this.getFormattedBody(this.body,e);if(t==="singleLine"||t==="optimized"){let r=this.header.format("singleLine",e);if(t==="singleLine"||this.canFitSingleLine(r,e,n.firstLineLength+1))return this.addComments(U.joinLines([r,n]," "),e)}let i=this.header.format("multiline",e);return this.addComments(U.joinLines([i,n]," "),e)}},p0=class extends He{constructor(e,t,n){super(e,t,n),this.node=e,this.header=wt(e,t,n),this.consequent=this.createStatementPrinter(e.consequent),this.consequent.indentStatementFirstLine=!1,e.alternate&&(this.alternate=this.createStatementPrinter(e.alternate),this.alternate.indentStatementFirstLine=!1)}format(e=0,t="optimized"){let n=!1,i;if(t==="singleLine"||t==="optimized"){let a=this.header.format("singleLine",e),l=Pe(this.node.consequent)?2:0;(t==="singleLine"||this.canFitSingleLine(a,e,l))&&(i=a)}i||(n=!0,i=this.header.format("multiline",e));let r;if(Pe(this.node.consequent)){let a=this.consequent.format(e,"optimized");r=U.joinLines([i," ",a])}else if(n||_s(this.node.consequent)){this.consequent.indentStatementFirstLine=!0;let a=this.consequent.format(e+1,"singleLine");this.canFitSingleLine(a,e+1)||(a=this.consequent.format(e+1,"multiline")),r=U.appendLines([i,a])}else{this.consequent.indentStatementFirstLine=!1;let a=this.consequent.format(e,"singleLine");this.canFitSingleLine(a,0,i.lastLineLength+1)?r=U.joinLines([i," ",a]):(this.consequent.indentStatementFirstLine=!0,a=this.consequent.format(e+1,"optimized"),r=U.appendLines([i,a]))}if(!this.alternate)return this.addComments(r,e);let s=d0(this.node.consequent)||!Pe(this.node.consequent),o;if(this.alternate.externalOffset=0,Pe(this.node.alternate)||_s(this.node.alternate))this.alternate.indentStatementFirstLine=!1,this.alternate.externalOffset=s?5:r.lastLineLength+6,o=this.alternate.format(e,"optimized"),o=U.joinLines(["else ",o]);else{let a=s?4:r.lastLineLength+4;this.alternate.indentStatementFirstLine=!1,o=this.alternate.format(e,"singleLine"),this.canFitSingleLine(o,e,a+1)?o=U.joinLines(["else ",o]):(this.alternate.indentStatementFirstLine=!0,o=this.alternate.format(e+1,"optimized"),o=U.appendLines(["else",o]))}return s?r=U.appendLines([r,o.indentFirstLine(this.getIndentation(e))]):r=U.joinLines([r,o]," "),this.addComments(r,e)}},g0=class extends He{constructor(e,t,n){super(e,t,n),this.node=e,this.header=wt(e,t,n),this.body=this.createStatementPrinter(e.body)}format(e=0,t="optimized"){this.body.indentStatementFirstLine=!1;let n=this.getFormattedBody(this.body,e);if(t==="singleLine"||t==="optimized"){let r=this.header.format("singleLine",e);if(t==="singleLine"||this.canFitSingleLine(r,e,n.firstLineLength+1))return this.addComments(U.joinLines([r,n]," "),e)}let i=this.header.format("multiline",e);return this.addComments(U.joinLines([i,n]," "),e)}},x0=class extends He{constructor(e,t,n){super(e,t,n),this.node=e,this.expression=Y(e.expression,e,n)}format(e=0,t="optimized"){if(t==="singleLine"||t==="optimized"){let n=this.expression.format("singleLine",e).suffixWith(";");if(t==="singleLine"||this.canFitSingleLine(n,e))return this.addComments(n,e)}return this.addComments(this.expression.format("multiline",e).suffixWith(";"),e)}},b0=class extends He{constructor(e,t,n){super(e,t,n),this.node=e,this.argument=Y(e.argument,e,n)}format(e=0,t="optimized"){if(t==="singleLine"||t==="optimized"){let s=this.argument.format("singleLine",e).surroundWith("return ",";");if(t==="singleLine"||this.canFitSingleLine(s,e))return this.addComments(s,e)}if(!vs(this.node.argument)&&!Ls(this.node.argument)){let s=this.argument.format("multiline",e).surroundWith("return ",";");return this.addComments(s,e)}let n=this.getIndentation(e+1),i=this.argument.format("multiline",e+1).indentFirstLine(n),r=this.getIndentation(e);return this.addComments(U.appendLines(["return (",i,`${r});`]),e)}},D0=class extends He{constructor(e,t,n){super(e,t,n),this.node=e,this.libraryNamePrinter=Y(e.specifiers[0].local,e,n),this.librarySourcePrinter=Y(e.source,e,n)}format(e=0){return this.addComments(U.joinLines(["import"," ",this.libraryNamePrinter.format("singleLine",e)," from ",this.librarySourcePrinter.format("singleLine")]).suffixWith(";"),e)}},C0={quote:"auto"};function J1(e,t={}){try{let n=e.getText(),i=e.positionAt(n.length),r={start:{line:0,character:0},end:i},s={...C0,...t.formattingOptions??{}},o=w0(n,s);return[{range:r,newText:o}]}catch(n){return console.error("Arcade Formatting Error:",n),[]}}function w0(e,t){if(!e)return"";let n=Is(t),i=i0.fromString(e,n),r=i.toString(),s=H1(r,{tolerant:!0,comments:!0}),o=Zc(s,i);return s.loc.start=o.start,s.loc.end=o.end,new Nn(s,null,n).format().toString()}var E0=Object.values($),A0=Object.values(yn),_0=["case","catch","debugger","switch","try"];async function L0(e,t){try{let n=await e,i=new Map,r=new Map,s=[],o=v0(t);return n.forEach(a=>{let l=[];a.items.forEach(c=>F0(l,r,i,o,c)),l.length&&s.push({...a,items:l})}),{categories:s,functionDefinitions:i,constantDefinitions:r}}catch(n){return console.error(n),{categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}function v0(e){let{profile:{apiVersion:t,bundles:n,hiddenApiItems:i=[]}={}}=e,r=Q1(t),s=Array.isArray(n)&&n.length>0?new Set(["core",...n]):void 0;return o=>S0(r,o.sinceVersion)&&(!s||s.has(o.bundle))&&!i.includes(o.name)}function F0(e,t,n,i,r){if(Array.isArray(r)){r.forEach(s=>k1(e,n,i,s));return}r.type==="constant"?y0(e,t,i,r):k1(e,n,i,r)}function k1(e,t,n,i){if(!n(i))return;i.disableDocumentation||e.push(i);let{completion:{label:r}}=i,s=r.toLowerCase(),o=t.get(s);o||(o={type:"functionDefinition",key:s,overloads:[]},t.set(s,o)),o.overloads.push(i)}function y0(e,t,n,i){if(!n(i))return;e.push(i);let{completion:{label:r}}=i,s=r.toLowerCase();t.set(s,i);let[o,a]=i.completion.label.split(".");if(!a)return;let l=o.toLowerCase(),c=t.get(l);c||(c={type:"namespace",key:l,members:[],completion:{label:o,detail:o,insertText:o,insertTextMode:fe.adjustIndentation,insertTextFormat:he.PlainText,kind:ne.Enum}},t.set(l,c));let f=structuredClone(i);f.name=a,f.completion.label=a,f.completion.insertText=a,f.completion.kind=ne.Constant,c.members.push(f),c.completion.documentation=c.members.reduce((h,d)=>(h.value=`${h.value}${h.value?`
33
33
 
34
34
  `:""}**${d.completion.label}**: ${d.description}`,h),{kind:vn.Markdown,value:""})}function Q1(e){if(!e||typeof e!="string")return null;let t=e.split(".").map(r=>Number.parseInt(r));if(t.some(Number.isNaN))return console.error("Invalid API version string",e),null;let[n,i]=t.slice(0,2);return{major:n,minor:i}}function S0(e,t){if(!e)return!0;let n=Q1(t);return n?e.major>n.major?!1:e.minor===void 0||n.minor===void 0?!0:n.minor<=e.minor:!0}function I1(e){return!!e&&e.type!=="dictionary"}function N0(e){return e?.type==="dictionary"}var k0=class{constructor(e){this._settings=e,this.localeToApiLibraryPromiseMap=new Map}async getApiDatabase(e){let{locale:t="en"}=e,n=this.localeToApiLibraryPromiseMap.get(t);return n||(n=this._settings.getApiLibrary(t),this.localeToApiLibraryPromiseMap.set(t,n)),await L0(n,e)}async getApiLibrary(e){let{categories:t}=await this.getApiDatabase(e);return t}},I0=A0.map(e=>({label:e,kind:ne.Constant})),R0=E0.map(e=>({label:e,kind:ne.Keyword})),M0=[{label:"exportfunction",kind:ne.Snippet,detail:"Export Function Statement",insertText:`export function \${1:functionName} ($2) {