@arcgis/ai-components 5.0.0-next.133

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 (126) hide show
  1. package/LICENSE.md +17 -0
  2. package/README.md +11 -0
  3. package/dist/cdn/2KGO3SIH.js +4 -0
  4. package/dist/cdn/2OKOKVH3.js +4 -0
  5. package/dist/cdn/46CNQJRX.js +4 -0
  6. package/dist/cdn/7QPPUNQ3.js +4 -0
  7. package/dist/cdn/A3UHOE4Q.js +30 -0
  8. package/dist/cdn/A7BGJLHS.js +204 -0
  9. package/dist/cdn/AB32PU6M.js +4 -0
  10. package/dist/cdn/AD7WB3RO.js +4 -0
  11. package/dist/cdn/ASKBAWPQ.js +27 -0
  12. package/dist/cdn/BCCDWQP4.js +4 -0
  13. package/dist/cdn/CF42OIDB.js +4 -0
  14. package/dist/cdn/CGGGHCIN.js +4 -0
  15. package/dist/cdn/EJW7PCMD.js +4 -0
  16. package/dist/cdn/FORRN75L.js +4 -0
  17. package/dist/cdn/FYKWTA6C.js +58 -0
  18. package/dist/cdn/G7XEFTIR.js +4 -0
  19. package/dist/cdn/GRXZ64LO.js +20 -0
  20. package/dist/cdn/GZUY3255.js +61 -0
  21. package/dist/cdn/HPGCDT6I.js +4 -0
  22. package/dist/cdn/ID5STKZH.js +90 -0
  23. package/dist/cdn/J62NTCLN.js +4 -0
  24. package/dist/cdn/KMV7W5OL.js +4 -0
  25. package/dist/cdn/LILVLE37.js +87 -0
  26. package/dist/cdn/MXHQFIP3.js +19 -0
  27. package/dist/cdn/N4CYINOF.js +6 -0
  28. package/dist/cdn/NR6PK4OK.js +4 -0
  29. package/dist/cdn/PA2KCYKL.js +71 -0
  30. package/dist/cdn/PEFKT7JJ.js +4 -0
  31. package/dist/cdn/Q34AELDL.js +4 -0
  32. package/dist/cdn/Q3MKHRXI.js +4 -0
  33. package/dist/cdn/QIU4T2DV.js +4 -0
  34. package/dist/cdn/TCNLHL43.js +79 -0
  35. package/dist/cdn/UC4HPCM3.js +19 -0
  36. package/dist/cdn/UIUJKONY.js +4 -0
  37. package/dist/cdn/USJ5YVZN.js +16 -0
  38. package/dist/cdn/W4LEGPD2.js +111 -0
  39. package/dist/cdn/WOP5ENGJ.js +134 -0
  40. package/dist/cdn/YXLN5DSL.js +6 -0
  41. package/dist/cdn/ZQEX3TGK.js +17 -0
  42. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -0
  43. package/dist/cdn/assets/assistant-chat-card/t9n/messages.en.json +1 -0
  44. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.en.json +1 -0
  45. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -0
  46. package/dist/cdn/assets/assistant-shell/t9n/messages.en.json +1 -0
  47. package/dist/cdn/index.js +4 -0
  48. package/dist/cdn/main.css +1 -0
  49. package/dist/chunks/runtime.js +17 -0
  50. package/dist/chunks/useT9n.js +9 -0
  51. package/dist/chunks/utils.js +35 -0
  52. package/dist/chunks/utils2.js +9 -0
  53. package/dist/components/arcgis-assistant/customElement.d.ts +14 -0
  54. package/dist/components/arcgis-assistant/customElement.js +250 -0
  55. package/dist/components/arcgis-assistant/index.d.ts +5 -0
  56. package/dist/components/arcgis-assistant/index.js +5 -0
  57. package/dist/components/arcgis-assistant/support/OrchestratorController.d.ts +33 -0
  58. package/dist/components/arcgis-assistant/support/utils.d.ts +1 -0
  59. package/dist/components/arcgis-assistant-agent/customElement.d.ts +10 -0
  60. package/dist/components/arcgis-assistant-agent/customElement.js +21 -0
  61. package/dist/components/arcgis-assistant-agent/index.d.ts +1 -0
  62. package/dist/components/arcgis-assistant-agent/index.js +1 -0
  63. package/dist/components/arcgis-assistant-chat/customElement.d.ts +17 -0
  64. package/dist/components/arcgis-assistant-chat/customElement.js +47 -0
  65. package/dist/components/arcgis-assistant-chat/index.d.ts +2 -0
  66. package/dist/components/arcgis-assistant-chat/index.js +2 -0
  67. package/dist/components/arcgis-assistant-chat-card/customElement.d.ts +18 -0
  68. package/dist/components/arcgis-assistant-chat-card/customElement.js +55 -0
  69. package/dist/components/arcgis-assistant-chat-card/index.d.ts +6 -0
  70. package/dist/components/arcgis-assistant-chat-card/index.js +6 -0
  71. package/dist/components/arcgis-assistant-chat-card-content/customElement.d.ts +11 -0
  72. package/dist/components/arcgis-assistant-chat-card-content/customElement.js +42 -0
  73. package/dist/components/arcgis-assistant-chat-card-content/index.d.ts +2 -0
  74. package/dist/components/arcgis-assistant-chat-card-content/index.js +2 -0
  75. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +19 -0
  76. package/dist/components/arcgis-assistant-chat-entry/customElement.js +46 -0
  77. package/dist/components/arcgis-assistant-chat-entry/index.d.ts +4 -0
  78. package/dist/components/arcgis-assistant-chat-entry/index.js +4 -0
  79. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.d.ts +7 -0
  80. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +28 -0
  81. package/dist/components/arcgis-assistant-data-exploration-agent/index.d.ts +1 -0
  82. package/dist/components/arcgis-assistant-data-exploration-agent/index.js +1 -0
  83. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +14 -0
  84. package/dist/components/arcgis-assistant-interrupt/customElement.js +39 -0
  85. package/dist/components/arcgis-assistant-interrupt/index.d.ts +6 -0
  86. package/dist/components/arcgis-assistant-interrupt/index.js +6 -0
  87. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.d.ts +7 -0
  88. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +28 -0
  89. package/dist/components/arcgis-assistant-layer-filter-agent/index.d.ts +1 -0
  90. package/dist/components/arcgis-assistant-layer-filter-agent/index.js +1 -0
  91. package/dist/components/arcgis-assistant-layer-query-agent/customElement.d.ts +7 -0
  92. package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +28 -0
  93. package/dist/components/arcgis-assistant-layer-query-agent/index.d.ts +1 -0
  94. package/dist/components/arcgis-assistant-layer-query-agent/index.js +1 -0
  95. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.d.ts +7 -0
  96. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +28 -0
  97. package/dist/components/arcgis-assistant-layer-styling-agent/index.d.ts +1 -0
  98. package/dist/components/arcgis-assistant-layer-styling-agent/index.js +1 -0
  99. package/dist/components/arcgis-assistant-navigation-agent/customElement.d.ts +7 -0
  100. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +28 -0
  101. package/dist/components/arcgis-assistant-navigation-agent/index.d.ts +1 -0
  102. package/dist/components/arcgis-assistant-navigation-agent/index.js +1 -0
  103. package/dist/components/arcgis-assistant-shell/customElement.d.ts +25 -0
  104. package/dist/components/arcgis-assistant-shell/customElement.js +29 -0
  105. package/dist/components/arcgis-assistant-shell/index.d.ts +6 -0
  106. package/dist/components/arcgis-assistant-shell/index.js +6 -0
  107. package/dist/components/assistant/assistant-agents/support/utils.d.ts +14 -0
  108. package/dist/controllers/useT9n.d.ts +1 -0
  109. package/dist/customAgents/AddAgent/AddAgent.d.ts +2 -0
  110. package/dist/docs/api.json +2239 -0
  111. package/dist/docs/docs.json +2011 -0
  112. package/dist/docs/vscode.css-custom-data.json +6 -0
  113. package/dist/docs/vscode.html-custom-data.json +306 -0
  114. package/dist/docs/web-types.json +693 -0
  115. package/dist/index.d.ts +99 -0
  116. package/dist/index.js +8 -0
  117. package/dist/loader.d.ts +2 -0
  118. package/dist/loader.js +23 -0
  119. package/dist/oauth-callback.html +31 -0
  120. package/dist/runtime.d.ts +6 -0
  121. package/dist/types/components.d.ts +2 -0
  122. package/dist/types/lumina.d.ts +80 -0
  123. package/dist/types/preact.d.ts +98 -0
  124. package/dist/types/react.d.ts +119 -0
  125. package/dist/types/stencil.d.ts +87 -0
  126. package/package.json +47 -0
@@ -0,0 +1,6 @@
1
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
3
+ v5.0.0-next.133 */
4
+ var Y=globalThis,Z=Y.ShadowRoot&&(Y.ShadyCSS===void 0||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,yt=Symbol(),Rt=new WeakMap,k=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==yt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Rt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Rt.set(e,t))}return t}toString(){return this.cssText}},Mt=o=>new k(typeof o=="string"?o:o+"",void 0,yt),ge=(o,...t)=>{let e=o.length===1?o[0]:t.reduce(((s,r,i)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+o[i+1]),o[0]);return new k(e,o,yt)},It=(o,t)=>{if(Z)o.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),r=Y.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,o.appendChild(s)}},gt=Z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Mt(e)})(o):o;var{is:ve,defineProperty:Ee,getOwnPropertyDescriptor:$e,getOwnPropertyNames:be,getOwnPropertySymbols:_e,getPrototypeOf:Ae}=Object,tt=globalThis,kt=tt.trustedTypes,Ce=kt?kt.emptyScript:"",we=tt.reactiveElementPolyfillSupport,j=(o,t)=>o,X={toAttribute(o,t){switch(t){case Boolean:o=o?Ce:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},H=(o,t)=>!ve(o,t),jt={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:H};Symbol.metadata??=Symbol("metadata"),tt.litPropertyMetadata??=new WeakMap;var _=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Ee(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){let{get:r,set:i}=$e(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){let a=r?.call(this);i?.call(this,n),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jt}static _$Ei(){if(this.hasOwnProperty(j("elementProperties")))return;let t=Ae(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(j("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(j("properties"))){let e=this.properties,s=[...be(e),..._e(e)];for(let r of s)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let r of s)e.unshift(gt(r))}else t!==void 0&&e.push(gt(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return It(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){let i=(s.converter?.toAttribute!==void 0?s.converter:X).toAttribute(e,s.type);this._$Em=t,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(t,e){let s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let i=s.getPropertyOptions(r),n=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:X;this._$Em=r,this[r]=n.fromAttribute(e,i.type)??this._$Ej?.get(r)??null,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let r=this.constructor,i=this[t];if(s??=r.getPropertyOptions(t),!((s.hasChanged??H)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:i},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),i!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[r,i]of s){let{wrapped:n}=i,a=this[r];n!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,i,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[j("elementProperties")]=new Map,_[j("finalized")]=new Map,we?.({ReactiveElement:_}),(tt.reactiveElementVersions??=[]).push("2.1.0");var Et=globalThis,et=Et.trustedTypes,Ht=et?et.createPolicy("lit-html",{createHTML:o=>o}):void 0,$t="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,bt="?"+A,Oe=`<${bt}>`,T=document,z=()=>T.createComment(""),B=o=>o===null||typeof o!="object"&&typeof o!="function",_t=Array.isArray,qt=o=>_t(o)||typeof o?.[Symbol.iterator]=="function",vt=`[
5
+ \f\r]`,V=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vt=/-->/g,zt=/>/g,w=RegExp(`>|${vt}(?:([^\\s"'>=/]+)(${vt}*=${vt}*(?:[^
6
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,Wt=/"/g,Gt=/^(?:script|style|textarea|title)$/i,At=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),ls=At(1),hs=At(2),ds=At(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Ft=new WeakMap,O=T.createTreeWalker(T,129);function Kt(o,t){if(!_t(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}var Qt=(o,t)=>{let e=o.length-1,s=[],r,i=t===2?"<svg>":t===3?"<math>":"",n=V;for(let a=0;a<e;a++){let c=o[a],h,u,l=-1,y=0;for(;y<c.length&&(n.lastIndex=y,u=n.exec(c),u!==null);)y=n.lastIndex,n===V?u[1]==="!--"?n=Vt:u[1]!==void 0?n=zt:u[2]!==void 0?(Gt.test(u[2])&&(r=RegExp("</"+u[2],"g")),n=w):u[3]!==void 0&&(n=w):n===w?u[0]===">"?(n=r??V,l=-1):u[1]===void 0?l=-2:(l=n.lastIndex-u[2].length,h=u[1],n=u[3]===void 0?w:u[3]==='"'?Wt:Bt):n===Wt||n===Bt?n=w:n===Vt||n===zt?n=V:(n=w,r=void 0);let g=n===w&&o[a+1].startsWith("/>")?" ":"";i+=n===V?c+Oe:l>=0?(s.push(h),c.slice(0,l)+$t+c.slice(l)+A+g):c+A+(l===-2?a:g)}return[Kt(o,i+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},W=class o{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let i=0,n=0,a=t.length-1,c=this.parts,[h,u]=Qt(t,e);if(this.el=o.createElement(h,s),O.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(r=O.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let l of r.getAttributeNames())if(l.endsWith($t)){let y=u[n++],g=r.getAttribute(l).split(A),C=/([.?@])?(.*)/.exec(y);c.push({type:1,index:i,name:C[2],strings:g,ctor:C[1]==="."?ot:C[1]==="?"?rt:C[1]==="@"?it:P}),r.removeAttribute(l)}else l.startsWith(A)&&(c.push({type:6,index:i}),r.removeAttribute(l));if(Gt.test(r.tagName)){let l=r.textContent.split(A),y=l.length-1;if(y>0){r.textContent=et?et.emptyScript:"";for(let g=0;g<y;g++)r.append(l[g],z()),O.nextNode(),c.push({type:2,index:++i});r.append(l[y],z())}}}else if(r.nodeType===8)if(r.data===bt)c.push({type:2,index:i});else{let l=-1;for(;(l=r.data.indexOf(A,l+1))!==-1;)c.push({type:7,index:i}),l+=A.length-1}i++}}static createElement(t,e){let s=T.createElement("template");return s.innerHTML=t,s}};function S(o,t,e=o,s){if(t===f)return t;let r=s!==void 0?e._$Co?.[s]:e._$Cl,i=B(t)?void 0:t._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(o),r._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=r:e._$Cl=r),r!==void 0&&(t=S(o,r._$AS(o,t.values),r,s)),t}var st=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??T).importNode(e,!0);O.currentNode=r;let i=O.nextNode(),n=0,a=0,c=s[0];for(;c!==void 0;){if(n===c.index){let h;c.type===2?h=new U(i,i.nextSibling,this,t):c.type===1?h=new c.ctor(i,c.name,c.strings,this,t):c.type===6&&(h=new nt(i,this,t)),this._$AV.push(h),c=s[++a]}n!==c?.index&&(i=O.nextNode(),n++)}return O.currentNode=T,r}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},U=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),B(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):qt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=W.createElement(Kt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{let i=new st(r,this),n=i.u(this.options);i.p(e),this.T(n),this._$AH=i}}_$AC(t){let e=Ft.get(t.strings);return e===void 0&&Ft.set(t.strings,e=new W(t)),e}k(t){_t(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,r=0;for(let i of t)r===e.length?e.push(s=new o(this.O(z()),this.O(z()),this,this.options)):s=e[r],s._$AI(i),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,i){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,r){let i=this.strings,n=!1;if(i===void 0)t=S(this,t,e,0),n=!B(t)||t!==this._$AH&&t!==f,n&&(this._$AH=t);else{let a=t,c,h;for(t=i[0],c=0;c<i.length-1;c++)h=S(this,a[s+c],e,c),h===f&&(h=this._$AH[c]),n||=!B(h)||h!==this._$AH[c],h===d?t=d:t!==d&&(t+=(h??"")+i[c+1]),this._$AH[c]=h}n&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ot=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},rt=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},it=class extends P{constructor(t,e,s,r,i){super(t,e,s,r,i),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===f)return;let s=this._$AH,r=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==d&&(s===d||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},nt=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},Jt={M:$t,P:A,A:bt,C:1,L:Qt,R:st,D:qt,V:S,I:U,H:P,N:rt,U:it,B:ot,F:nt},Te=Et.litHtmlPolyfillSupport;Te?.(W,U),(Et.litHtmlVersions??=[]).push("3.3.0");var Ct=(o,t,e)=>{let s=e?.renderBefore??t,r=s._$litPart$;if(r===void 0){let i=e?.renderBefore??null;s._$litPart$=r=new U(t.insertBefore(z(),i),i,void 0,e??{})}return r._$AI(o),r};var wt=globalThis,$=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ct(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};$._$litElement$=!0,$.finalized=!0,wt.litElementHydrateSupport?.({LitElement:$});var Se=wt.litElementPolyfillSupport;Se?.({LitElement:$});(wt.litElementVersions??=[]).push("4.2.0");var p=(o,t,...e)=>{try{return o?.call(t,...e)}catch(s){console.error(s,o)}},F=async(o,t,...e)=>{try{return await o?.call(t,...e)}catch(s){console.error(s,o)}};var G=Symbol.for("controller"),Pe=o=>typeof o=="object"&&o!==null&&(G in o||"hostConnected"in o||"hostDisconnected"in o||"hostUpdate"in o||"hostUpdated"in o),ws=o=>typeof o?.then=="function";var q,x=o=>{q!==o&&(q=o,queueMicrotask(()=>q===o?q=void 0:0))},K=o=>q,N=[],Yt=o=>{if(o===void 0){N=[];return}let t=N.indexOf(o);N=t===-1?[...N,o]:N.slice(0,t+1),queueMicrotask(()=>N=[])},Zt=()=>N,R,Os=o=>{R!==o&&(R=o,queueMicrotask(()=>R===o?R=void 0:0))},Ne=()=>{let o=R;return R=void 0,o},Xt=async(o,t)=>{let e=ct(o);if(e===void 0)return o;if(await e.ready,typeof t=="function"){let s=e.watchExports(r=>t(r,s))}return e.exports},te=async o=>{let t=ct(o);return await t.ready,t},ct=o=>{let e=K().manager.X(o);if(e!==void 0)return e;if(Pe(o))return o;let s=Ne();if(s!==void 0)return s},at=!1,Ts=o=>{at=!0;try{return o()}finally{at=!1}};var b=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}},ee=(o,t)=>{let e=t>xe?De:t/Le,s=0,r=setInterval(()=>{s+=e,s>=t&&(clearInterval(r),o())},e);return r},xe=4e3,De=2e3,Le=4;var se=new Set,oe;var re=o=>typeof o=="string"?o:"el"in o?o.el.localName:"localName"in o?o.localName:o.declaredClass,Ns=(o,t,e,s)=>{let r=re(t);if(s?.once){let n=`${o}${r}${e}`;if(se.has(n))return;se.add(n)}let i;if(s?.detail){i={};for(let[n,a]of Object.entries(s.detail))if((typeof a=="object"||typeof a=="function")&&a!==null){let c=new WeakRef(a);Object.defineProperty(i,n,{get(){return c.deref()}})}else i[n]=a;oe?.log.interceptors?.forEach(n=>n(o,r,e,i)),console[o](`[${r}]: ${e}`,i)}else oe?.log.interceptors?.forEach(n=>n(o,r,e)),console[o](`[${r}]: ${e}`)},ie=o=>{let t=`[${re(o)}] `;return e=>{let s=e instanceof Error&&e.message?e:new Error(String(e));s.message=`${t}${s.message}`,setTimeout(()=>{throw e})}};var Ue=(o,t,e)=>{let s=Object.keys(o),r=s.length;M===void 0&&queueMicrotask(I),M??=new Map;let i=M.get(o);return i===void 0&&(i={callbacks:[],keyCount:r},M.set(o,i)),i.keyCount!==r&&(i.callbacks.forEach(n=>n(s)),i.callbacks=[],i.keyCount=r),i.callbacks.push(n=>{let a=h=>p(t,null,h),c=n[r];c===void 0?a(void 0):o[c]===e?a(c):a(void 0)}),e},M,I=()=>{M?.forEach(({callbacks:o},t)=>{let e=Object.keys(t);o.forEach(s=>s(e))}),M=void 0},Re=(o,t,e)=>{let s=o.manager;return s.V!==d&&s.V!==e&&s.S(void 0,void 0),s.T.length===0&&queueMicrotask(()=>s.S(void 0,void 0)),s.V=e,s.T.push((r,i)=>p(t,void 0,e===i?r:void 0)),e},Me=(o=[K(),...Zt()],t,e)=>{let s=Array.isArray(o)?o:[o],r=s.length+1,i=n=>{r-=1,n!==void 0&&(r=Math.min(r,0)),r===0&&t(n)};s.forEach(n=>Ue(n,a=>i(a===void 0?void 0:{key:a,host:n,isReactive:!1}),e));for(let n of s)if("manager"in n&&n.manager.component===n){Re(n,a=>i(a===void 0?void 0:{key:a,host:n,isReactive:!0}),e);break}return e},Ie=(o="",t={},e=K())=>{let s={emit:r=>{o===""&&I();let i=new CustomEvent(o,{detail:r,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(i),i}};return o===""&&Me(void 0,r=>o=r.key,s),s},ke=Ie.bind(null,""),ce;ce=G;var Ot=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#r=[],this.#i=[],this.#c=[],this.#l=[],this.#p=[],this.#h=[],this.#d=!1,this.P=new b,this.connectedCalled=!1,this.loadedCalled=!1,this[ce]=!0,this.#a=[];let e=this,s=t??K(new.target.name);e.#o=s,e.ready=e.P.promise,e.#n=ae(e),e.component=s,e.#o.addController(e),e.#o.manager===void 0||(Yt(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#r;#i;#c;#l;#p;#h;#d;#o;catchUpLifecycle(){let{manager:t}=this.#o;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#d&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(ie(this.#o))}#n;get exports(){return this.#n}set exports(t){let e=this.#n;e!==t&&(this.#n=t,this.#a.forEach(p),this.connectedCalled&&this.O!==!1&&this.#o.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#n=e?ae(t):t,this.#a.forEach(p)}#a;watchExports(t){let e=()=>t(this.#n);return this.#a.push(e),()=>void this.#a.splice(this.#a.indexOf(e),1)}get use(){return x(this.#o),Xt}get useRef(){return x(this.#o),te}get useRefSync(){return x(this.#o),ct}controllerRemoved(){this.#o.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#r.push(t)}onUpdate(t){this.#i.push(t)}onUpdated(t){this.#c.push(t)}onDestroy(t){this.#l.push(t)}onLifecycle(t){this.#p.push(t),this.connectedCalled&&this.#o.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#h.forEach(p),t.#h=[]}async triggerLoad(){if(this.#d)return;this.#d=!0;let t=this;t.hostLoad&&await F(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(F)),this.P.resolve(this.#n)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#r.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#i.forEach(ne,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#c.forEach(ne,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#l.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#p.forEach(this.#u,this)}#u(t){x(this.#o);let e=p(t);(Array.isArray(e)?e:[e]).forEach(r=>{typeof r=="function"?this.#h.push(r):typeof r=="object"&&typeof r.remove=="function"&&this.#h.push(r.remove)})}};function ne(o){p(o,void 0,this)}var le=Ot,ae=o=>{if(typeof o!="object"&&typeof o!="function"||o===null)return o;let t={get(s,r,i){if(!((r==="exports"||r==="_exports")&&r in s&&s[r]===e)&&(r in s||r in Promise.prototype||typeof r=="symbol"))return typeof s=="function"?s[r]:Reflect.get(s,r,i)}},e=new Proxy(o,t);return e};var{I:Hs}=Jt;var lt=o=>o.strings===void 0;var je={},he=(o,t=je)=>o._$AH=t;var m={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},E=o=>(...t)=>({_$litDirective$:o,values:t}),v=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var Q=(o,t)=>{let e=o._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),Q(s,t);return!0},ht=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while(e?.size===0)},de=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),ze(t)}};function He(o){this._$AN!==void 0?(ht(this),this._$AM=o,de(this)):this._$AM=o}function Ve(o,t=!1,e=0){let s=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(s))for(let i=e;i<s.length;i++)Q(s[i],!1),ht(s[i]);else s!=null&&(Q(s,!1),ht(s));else Q(this,o)}var ze=o=>{o.type==m.CHILD&&(o._$AP??=Ve,o._$AQ??=He)},dt=class extends v{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),de(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Q(this,t),ht(this))}setValue(t){if(lt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Js=()=>new St,St=class{},Tt=new WeakMap,Pt=E(class extends dt{render(o){return d}update(o,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=o.options?.host,this.rt(this.ct=o.element)),d}rt(o){if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=Tt.get(t);e===void 0&&(e=new WeakMap,Tt.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){return typeof this.G=="function"?Tt.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var pt=o=>o.replace(We,(t,e)=>`${e===0?"":"-"}${t.toLowerCase()}`),We=/[A-Z]+(?![a-z])|[A-Z]/gu;var lo="randomUUID"in crypto;var xt=o=>{let t=o;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(o),(e.I??e._postLoad).promise}return!1},Dt={};function Lt(){}var Fe=(o,t)=>function(s,r){if(!globalThis.customElements)return;let n=(r??s??{}).resourcesUrl;n&&o.setAssetPath(n);for(let[a,[c,h=""]]of Object.entries(t)){if(customElements.get(a))continue;let[u,l,y]=h.split(";"),g=u?u?.split(",").map(qe):void 0,C=g?.map(([L])=>L),D=class extends Nt{static{this.observedAttributes=g?.map(([,L])=>L).filter(L=>L!=="")}static{this.C=C}static{this.E=l?l?.split(","):void 0}static{this.D=y?.split(",")}static{this.L=a}static{this.K=o}constructor(){!D.B&&(D.B=c(),D.F()),super()}};customElements.define(a,D)}},ut=Object.defineProperty,qe=o=>{let t=o.split(":");return t.length===1?[t[0],pt(t[0])]:t},Ge=globalThis.HTMLElement??Lt,Nt=class extends Ge{constructor(){super(),this.#e={},this.#s=[],this.I=new b,this.H=new b,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(s=>{Object.hasOwn(t,s)&&(t.#e[s]=t[s],delete t[s])}),e.A?t.#r({a:e.A}):e.B.then(async s=>{await e.K.p,t.#r(await(s.default?.then(r=>typeof r=="function"?{a:r}:r)??s))}).catch(s=>{t.H.reject(s),setTimeout(()=>{throw s})})}static{this.lumina=!0}static F(){for(let t of this.C??[])ut(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])ut(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])ut(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,s){this.#t?.attributeChangedCallback(t,e,s),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=xt(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#r(t){let e=this.constructor,s=e.L,r=this.#e,i=Object.values(t).find(l=>l.L===s),n=`${s}--lazy`,a=i;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);Qe(a),!e.A&&(e.A=i,customElements.define(n,i)),i.N=this;let h=document.createElement(n);i.N=void 0,this.#t=h,this.#e=h,this.#s.forEach(l=>h.attributeChangedCallback(l,null,this.getAttribute(l))),Object.entries(r).forEach(Ke,h);let u=this.isConnected;(u||this.G)&&(h.connectedCallback?.(),u||h.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function Ke([o,t]){this[o]=t}var Qe=o=>{let t=o.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(r,i){e.setAttribute.call(this.el,r,i)},t.removeAttribute=function(r){e.removeAttribute.call(this.el,r)},ut(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var ft=class extends le{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=mt in t&&typeof t.destroy=="function",$.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${mt} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),I();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),x(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>void this.#e.destroy();this.#t=ee(t,Je)}}S(t,e){let s=this.T;this.V=d,this.T=[],s.forEach(r=>r(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},Je=1e3,mt="autoDestroyDisabled";var ue=E(class extends v{constructor(o){if(super(o),o.type!==m.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter((t=>o[t])).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter((s=>s!==""))));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let e=o.element.classList;for(let s of this.st)s in t||(e.remove(s),this.st.delete(s));for(let s in t){let r=!!t[s];r===this.st.has(s)||this.nt?.has(s)||(r?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return f}});var fe="important",Ye=" !"+fe,Ze=E(class extends v{constructor(o){if(super(o),o.type!==m.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce(((t,e)=>{let s=o[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(let s in t){let r=t[s];if(r!=null){this.ft.add(s);let i=typeof r=="string"&&r.endsWith(Ye);s.includes("-")||i?e.setProperty(s,i?r.slice(0,-11):r,i?fe:""):e[s]=r}}return f}});var Xe=E(class extends v{constructor(o){if(super(o),o.type!==m.PROPERTY&&o.type!==m.ATTRIBUTE&&o.type!==m.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!lt(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===f||t===d)return t;let e=o.element,s=o.name;if(o.type===m.PROPERTY){if(t===e[s])return f}else if(o.type===m.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return f}else if(o.type===m.ATTRIBUTE&&e.getAttribute(s)===t+"")return f;return he(o),t}});var me=class o extends ${constructor(){super(),this.M=[],this.manager=new ft(this);let t=this,e=t.constructor,s=e.N,r=e.K.o,i=o.prototype.shouldUpdate;t.#r=s?.H??new b,t.I=s?.I??new b,t.J=s?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=s??t,t.#s=t.enableUpdating,t.enableUpdating=Lt,t.shouldUpdate!==i&&(t.#e=t.shouldUpdate,t.shouldUpdate=i),r&&(t.#t=new Map,e.elementProperties.forEach((n,a)=>t.#t.set(a,r()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),s=this.shadowRootOptions===Dt;return this.K?.commonStyles===void 0||s?e:[this.K.commonStyles,...e]}static createProperty(t,e){let s=typeof e=="number"?e:Array.isArray(e)?e[0]:0,r=Array.isArray(e)?e[1]:void 0,i=r?.hasChanged??H,n={attribute:s&1&&typeof t=="string"?pt(t):!1,reflect:!!(s&2),type:s&4?Boolean:s&8?Number:void 0,state:!!(s&16),readOnly:!!(s&32),noAccessor:!!(s&64),c:!1,...r,hasChanged(a,c){let h=i(a,c);return n.c=h,h}};super.createProperty(t,n)}static getPropertyDescriptor(t,e,s){let r=this.K,i=super.getPropertyDescriptor(t,e,s);return s.d=i,{...i,get(){return r.t?.(this.#t.get(t)),i.get?.call(this)},set(n){let a=this.manager;if(s.readOnly&&!at&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${n}"`);i.set.call(this,n??void 0),s.c&&this.#t?.get(t)?.notify(),a.T.length>0&&(I(),a?.S(t,n))}}}static{this.lumina=!0}#t;#e;#s;#r;#i;connectedCallback(){if(this.el.hasAttribute("defer-hydration"))return;let t=this.constructor.K.c?.(()=>this.requestUpdate());this.#i=t;let e=!this.manager.connectedCalled;super.connectedCallback(),e?queueMicrotask(()=>this.#l().catch(s=>{this.#r.reject(s),setTimeout(()=>{throw s})})):t&&this.requestUpdate()}#c(t){try{this.#i.clear(),this.constructor.K.r(this.#i,()=>super.update(t))}catch(e){throw this.#i.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#i?.destroy(),this.#i=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,s=e.shadowRootOptions,i=t??(s===Dt?this.el:this.el.attachShadow(s));if(this.isConnected){let n=i.getRootNode();n.adoptedStyleSheets=[...n.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return i}async#l(){let t=this.el.G??xt(this.el);t&&await t;let e=[];for(let r of this.M)"triggerLoad"in r?e.push(r.triggerLoad()):e.push(F(r.hostLoad,r));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(r=>r.has(mt)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await Promise.resolve();let s=this.J.filter(r=>!r.manager?.loadedCalled);s.length&&await Promise.allSettled(s.map(async r=>await r.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let r of this.M)"triggerLoaded"in r?r.triggerLoaded():p(r.hostLoaded,r);this.loaded?.(),this.#r.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#i?this.#c(t):super.update(t)}listen(t,e,s){let r=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,r,s),()=>this.el.removeEventListener(t,r,s)))}listenOn(t,e,s,r){let i=s?.bind(this)??s;this.manager.onLifecycle(()=>(t.addEventListener(e,i,r),()=>t.removeEventListener(e,i,r)))}async componentOnReady(){return await this.#r.promise,this}addController(t){this.M.push(t),!(G in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}};var ye=o=>{let t,e=r=>{t=new URL(r,globalThis.location?.href||void 0).href},s={...o,getAssetPath(r){let i=new URL(r,t);return i.origin!==globalThis.location?.origin?i.href:i.pathname},setAssetPath:e,customElement(r,i){i.K=s,i.L=r,customElements.get(r)||customElements.define(r,i)}};return e(o.defaultAssetPath),s};var Er=o=>typeof o=="object"&&o!=null?ue(o):o;var Ut=class extends v{#t;#e;constructor(t){super(t);let e=this;this.#e=function(r){return e.#t.call(this,r)}}render(t){return typeof t=="function"?(this.#t=t,Pt(this.#e)):Pt(t)}},$r=E(Ut);var br=d;var J=ye({defaultAssetPath:"https://jsdev.arcgis.com/5.0.0-next/ai-components/",hydratedAttribute:"hydrated"}),{customElement:Or,getAssetPath:Tr,setAssetPath:Sr}=J;J.t=void 0;J.o=void 0;J.c=void 0;J.r=void 0;export{ws as a,x as b,Yt as c,Zt as d,Os as e,Ts as f,ge as g,ls as h,Ns as i,Me as j,ke as k,Ot as l,Fe as m,Js as n,Pt as o,me as p,Er as q,br as r,J as s,Or as t,Tr as u};
@@ -0,0 +1,17 @@
1
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
3
+ v5.0.0-next.133 */
4
+ import{$ as qe,A as Ie,B as $e,C as Ne,D as ze,E as Re,Eb as B,F as q,G as K,I as P,J as T,K as le,L as ue,M as w,Mb as pe,N as Ue,Nb as me,O as Be,P as E,Pb as j,Q as y,Qb as Q,R as A,Rb as X,S as De,T as He,U as I,V as $,W as We,Wb as d,X as Ge,Xb as Y,Y as x,Yb as C,Z as N,Zb as h,_ as Je,_b as D,aa as z,ba as g,ca as v,da as Ke,ea as Qe,fa as V,ga as Xe,h as oe,ha as Ye,ia as Ze,ja as Le,ka as R,n as Me,o as Pe,p as Te,q as Ve,r as je,s as Ce,t as Oe,u as Fe,v as Se,w as ke,x as Ee,y as M,yb as U,z as Ae}from"./LILVLE37.js";import{b as _e}from"./46CNQJRX.js";export default $arcgis.t(_=>{var it={};_e(it,{AIMessage:()=>w,AIMessageChunk:()=>E,BaseMessage:()=>M,BaseMessageChunk:()=>ze,ChatMessage:()=>y,ChatMessageChunk:()=>A,FunctionMessage:()=>I,FunctionMessageChunk:()=>$,HumanMessage:()=>x,HumanMessageChunk:()=>N,RemoveMessage:()=>z,SystemMessage:()=>g,SystemMessageChunk:()=>v,ToolMessage:()=>P,ToolMessageChunk:()=>T,_isMessageFieldWithRole:()=>Re,_mergeDicts:()=>Ie,_mergeLists:()=>$e,_mergeObj:()=>Ne,_mergeStatus:()=>Ee,coerceMessageLikeToMessage:()=>V,convertToChunk:()=>R,convertToOpenAIImageBlock:()=>Ce,convertToProviderContentBlock:()=>Se,defaultTextSplitter:()=>de,filterMessages:()=>et,getBufferString:()=>Xe,isAIMessage:()=>Ue,isAIMessageChunk:()=>Be,isBase64ContentBlock:()=>Te,isBaseMessage:()=>q,isBaseMessageChunk:()=>K,isChatMessage:()=>De,isChatMessageChunk:()=>He,isDataContentBlock:()=>Me,isFunctionMessage:()=>We,isFunctionMessageChunk:()=>Ge,isHumanMessage:()=>Je,isHumanMessageChunk:()=>qe,isIDContentBlock:()=>je,isOpenAIToolCallArray:()=>Ae,isPlainTextContentBlock:()=>Ve,isSystemMessage:()=>Ke,isSystemMessageChunk:()=>Qe,isToolMessage:()=>le,isToolMessageChunk:()=>ue,isURLContentBlock:()=>Pe,mapChatMessagesToStoredMessages:()=>Le,mapStoredMessageToChatMessage:()=>Ye,mapStoredMessagesToChatMessages:()=>Ze,mergeContent:()=>ke,mergeMessageRuns:()=>tt,parseBase64DataUrl:()=>Fe,parseMimeType:()=>Oe,trimMessages:()=>rt});var H=(i,e)=>{let t=[...new Set(e?.map(r=>{if(typeof r=="string")return r;let s=new r({});if(!("getType"in s)||typeof s.getType!="function")throw new Error("Invalid type provided.");return s.getType()}))],a=i.getType();return t.some(r=>r===a)};function et(i,e){return Array.isArray(i)?ce(i,e):B.from(t=>ce(t,i))}function ce(i,e={}){let{includeNames:t,excludeNames:a,includeTypes:r,excludeTypes:s,includeIds:o,excludeIds:n}=e,u=[];for(let l of i)if(!(a&&l.name&&a.includes(l.name))){{if(s&&H(l,s))continue;if(n&&l.id&&n.includes(l.id))continue}r||o||t?(t&&l.name&&t.some(p=>p===l.name)||r&&H(l,r)||o&&l.id&&o.some(p=>p===l.id))&&u.push(l):u.push(l)}return u}function tt(i){return Array.isArray(i)?fe(i):B.from(fe)}function fe(i){if(!i.length)return[];let e=[];for(let t of i){let a=t,r=e.pop();if(!r)e.push(a);else if(a.getType()==="tool"||a.getType()!==r.getType())e.push(r,a);else{let s=R(r),o=R(a),n=s.concat(o);typeof s.content=="string"&&typeof o.content=="string"&&(n.content=`${s.content}
5
+ ${o.content}`),e.push(st(n))}}return e}function rt(i,e){if(Array.isArray(i)){let t=i;if(!e)throw new Error("Options parameter is required when providing messages.");return he(t,e)}else{let t=i;return B.from(a=>he(a,t)).withConfig({runName:"trim_messages"})}}async function he(i,e){let{maxTokens:t,tokenCounter:a,strategy:r="last",allowPartial:s=!1,endOn:o,startOn:n,includeSystem:u=!1,textSplitter:l}=e;if(n&&r==="first")throw new Error("`startOn` should only be specified if `strategy` is 'last'.");if(u&&r==="first")throw new Error("`includeSystem` should only be specified if `strategy` is 'last'.");let p;"getNumTokens"in a?p=async m=>(await Promise.all(m.map(b=>a.getNumTokens(b.content)))).reduce((b,J)=>b+J,0):p=async m=>a(m);let c=de;if(l&&("splitText"in l?c=l.splitText:c=async m=>l(m)),r==="first")return ge(i,{maxTokens:t,tokenCounter:p,textSplitter:c,partialStrategy:s?"first":void 0,endOn:o});if(r==="last")return at(i,{maxTokens:t,tokenCounter:p,textSplitter:c,allowPartial:s,includeSystem:u,startOn:n,endOn:o});throw new Error(`Unrecognized strategy: '${r}'. Must be one of 'first' or 'last'.`)}async function ge(i,e){let{maxTokens:t,tokenCounter:a,textSplitter:r,partialStrategy:s,endOn:o}=e,n=[...i],u=0;for(let l=0;l<n.length;l+=1){let p=l>0?n.slice(0,-l):n;if(await a(p)<=t){u=n.length-l;break}}if(u<n.length&&s){let l=!1;if(Array.isArray(n[u].content)){let p=n[u];if(typeof p.content=="string")throw new Error("Expected content to be an array.");let c=p.content.length,m=s==="last"?[...p.content].reverse():p.content;for(let f=1;f<=c;f+=1){let b=s==="first"?m.slice(0,f):m.slice(-f),J=Object.fromEntries(Object.entries(p).filter(([ne])=>ne!=="type"&&!ne.startsWith("lc_"))),ve=Z(p.getType(),{...J,content:b}),ie=[...n.slice(0,u),ve];if(await a(ie)<=t)n=ie,u+=1,l=!0;else break}l&&s==="last"&&(p.content=[...m].reverse())}if(!l){let p=n[u],c;if(Array.isArray(p.content)&&p.content.some(m=>typeof m=="string"||m.type==="text")?c=p.content.find(f=>f.type==="text"&&f.text)?.text:typeof p.content=="string"&&(c=p.content),c){let m=await r(c),f=m.length;s==="last"&&m.reverse();for(let b=0;b<f-1;b+=1)if(m.pop(),p.content=m.join(""),await a([...n.slice(0,u),p])<=t){s==="last"&&(p.content=[...m].reverse().join("")),n=[...n.slice(0,u),p],u+=1;break}}}}if(o){let l=Array.isArray(o)?o:[o];for(;u>0&&!H(n[u-1],l);)u-=1}return n.slice(0,u)}async function at(i,e){let{allowPartial:t=!1,includeSystem:a=!1,endOn:r,startOn:s,...o}=e,n=i.map(p=>{let c=Object.fromEntries(Object.entries(p).filter(([m])=>m!=="type"&&!m.startsWith("lc_")));return Z(p.getType(),c,K(p))});if(r){let p=Array.isArray(r)?r:[r];for(;n.length>0&&!H(n[n.length-1],p);)n=n.slice(0,-1)}let u=a&&n[0]?.getType()==="system",l=u?n.slice(0,1).concat(n.slice(1).reverse()):n.reverse();return l=await ge(l,{...o,partialStrategy:t?"last":void 0,endOn:s}),u?[l[0],...l.slice(1).reverse()]:l.reverse()}var be={human:{message:x,messageChunk:N},ai:{message:w,messageChunk:E},system:{message:g,messageChunk:v},developer:{message:g,messageChunk:v},tool:{message:P,messageChunk:T},function:{message:I,messageChunk:$},generic:{message:y,messageChunk:A},remove:{message:z,messageChunk:z}};function Z(i,e,t){let a,r;switch(i){case"human":t?a=new N(e):r=new x(e);break;case"ai":if(t){let s={...e};"tool_calls"in s&&(s={...s,tool_call_chunks:s.tool_calls?.map(o=>({...o,type:"tool_call_chunk",index:void 0,args:JSON.stringify(o.args)}))}),a=new E(s)}else r=new w(e);break;case"system":t?a=new v(e):r=new g(e);break;case"developer":t?a=new v({...e,additional_kwargs:{...e.additional_kwargs,__openai_role__:"developer"}}):r=new g({...e,additional_kwargs:{...e.additional_kwargs,__openai_role__:"developer"}});break;case"tool":if("tool_call_id"in e)t?a=new T(e):r=new P(e);else throw new Error("Can not convert ToolMessage to ToolMessageChunk if 'tool_call_id' field is not defined.");break;case"function":if(t)a=new $(e);else{if(!e.name)throw new Error("FunctionMessage must have a 'name' field");r=new I(e)}break;case"generic":if("role"in e)t?a=new A(e):r=new y(e);else throw new Error("Can not convert ChatMessage to ChatMessageChunk if 'role' field is not defined.");break;default:throw new Error(`Unrecognized message type ${i}`)}if(t&&a)return a;if(r)return r;throw new Error(`Unrecognized message type ${i}`)}function st(i){let e=i.getType(),t,a=Object.fromEntries(Object.entries(i).filter(([r])=>!["type","tool_call_chunks"].includes(r)&&!r.startsWith("lc_")));if(e in be&&(t=Z(e,a)),!t)throw new Error(`Unrecognized message chunk class ${e}. Supported classes are ${Object.keys(be)}`);return t}function de(i){let e=i.split(`
6
+ `);return Promise.resolve([...e.slice(0,-1).map(t=>`${t}
7
+ `),e[e.length-1]])}var _=class i extends D{static lc_name(){return"ImagePromptTemplate"}constructor(e){if(super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts","image"]}),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"additionalContentFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=e.template,this.templateFormat=e.templateFormat??this.templateFormat,this.validateTemplate=e.validateTemplate??this.validateTemplate,this.additionalContentFields=e.additionalContentFields,this.validateTemplate){let t=this.inputVariables;this.partialVariables&&(t=t.concat(Object.keys(this.partialVariables))),C([{type:"image_url",image_url:this.template}],this.templateFormat,t)}}_getPromptType(){return"prompt"}async partial(e){let t=this.inputVariables.filter(s=>!(s in e)),a={...this.partialVariables??{},...e},r={...this,inputVariables:t,partialVariables:a};return new i(r)}async format(e){let t={};for(let[o,n]of Object.entries(this.template))typeof n=="string"?t[o]=d(n,this.templateFormat,e):t[o]=n;let a=e.url||t.url,r=e.detail||t.detail;if(!a)throw new Error("Must provide either an image URL.");if(typeof a!="string")throw new Error("url must be a string.");let s={url:a};return r&&(s.detail=r),s}async formatPromptValue(e){let t=await this.format(e);return new me(t)}};var O=class extends U{static lc_name(){return"DictPromptTemplate"}constructor(e){let t=e.templateFormat??"f-string",a=L(e.template,t);super({inputVariables:a,...e}),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts","dict"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=e.template,this.templateFormat=t,this.inputVariables=a}async format(e){return ee(this.template,e,this.templateFormat)}async invoke(e){return await this._callWithConfig(this.format.bind(this),e,{runType:"prompt"})}};function L(i,e){let t=[];for(let a of Object.values(i))if(typeof a=="string")Y(a,e).forEach(r=>{r.type==="variable"&&t.push(r.name)});else if(Array.isArray(a))for(let r of a)typeof r=="string"?Y(r,e).forEach(s=>{s.type==="variable"&&t.push(s.name)}):typeof r=="object"&&t.push(...L(r,e));else typeof a=="object"&&a!==null&&t.push(...L(a,e));return Array.from(new Set(t))}function ee(i,e,t){let a={};for(let[r,s]of Object.entries(i))if(typeof s=="string")a[r]=d(s,t,e);else if(Array.isArray(s)){let o=[];for(let n of s)typeof n=="string"?o.push(d(n,t,e)):typeof n=="object"&&o.push(ee(n,e,t));a[r]=o}else typeof s=="object"&&s!==null?a[r]=ee(s,e,t):a[r]=s;return a}var F=class extends U{constructor(){super(...arguments),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts","chat"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0})}async invoke(e,t){return this._callWithConfig(a=>this.formatMessages(a),e,{...t,runType:"prompt"})}},W=class extends F{static lc_name(){return"MessagesPlaceholder"}constructor(e){typeof e=="string"&&(e={variableName:e}),super(e),Object.defineProperty(this,"variableName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"optional",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.variableName=e.variableName,this.optional=e.optional??!1}get inputVariables(){return[this.variableName]}async formatMessages(e){let t=e[this.variableName];if(this.optional&&!t)return[];if(!t){let r=new Error(`Field "${this.variableName}" in prompt uses a MessagesPlaceholder, which expects an array of BaseMessages as an input value. Received: undefined`);throw r.name="InputFormatError",r}let a;try{Array.isArray(t)?a=t.map(V):a=[V(t)]}catch(r){let s=typeof t=="string"?t:JSON.stringify(t,null,2),o=new Error([`Field "${this.variableName}" in prompt uses a MessagesPlaceholder, which expects an array of BaseMessages or coerceable values as input.`,`Received value: ${s}`,`Additional message: ${r.message}`].join(`
8
+
9
+ `));throw o.name="InputFormatError",o.lc_error_code=r.lc_error_code,o}return a}},te=class extends F{constructor(e){"prompt"in e||(e={prompt:e}),super(e),Object.defineProperty(this,"prompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.prompt=e.prompt}get inputVariables(){return this.prompt.inputVariables}async formatMessages(e){return[await this.format(e)]}},S=class extends D{constructor(e){super(e)}async format(e){return(await this.formatPromptValue(e)).toString()}async formatPromptValue(e){let t=await this.formatMessages(e);return new pe(t)}},re=class extends te{static lc_name(){return"ChatMessagePromptTemplate"}constructor(e,t){"prompt"in e||(e={prompt:e,role:t}),super(e),Object.defineProperty(this,"role",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.role=e.role}async format(e){return new y(await this.prompt.format(e),this.role)}static fromTemplate(e,t,a){return new this(h.fromTemplate(e,{templateFormat:a?.templateFormat}),t)}};function nt(i){return i===null||typeof i!="object"||Array.isArray(i)?!1:Object.keys(i).length===1&&"text"in i&&typeof i.text=="string"}function ot(i){return i===null||typeof i!="object"||Array.isArray(i)?!1:"image_url"in i&&(typeof i.image_url=="string"||typeof i.image_url=="object"&&i.image_url!==null&&"url"in i.image_url&&typeof i.image_url.url=="string")}var k=class extends F{static _messageClass(){throw new Error("Can not invoke _messageClass from inside _StringImageMessagePromptTemplate")}constructor(e,t){if("prompt"in e||(e={prompt:e}),super(e),Object.defineProperty(this,"lc_namespace",{enumerable:!0,configurable:!0,writable:!0,value:["langchain_core","prompts","chat"]}),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"inputVariables",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"additionalOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"prompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messageClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chatMessageClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.prompt=e.prompt,Array.isArray(this.prompt)){let a=[];this.prompt.forEach(r=>{"inputVariables"in r&&(a=a.concat(r.inputVariables))}),this.inputVariables=a}else this.inputVariables=this.prompt.inputVariables;this.additionalOptions=t??this.additionalOptions}createMessage(e){let t=this.constructor;if(t._messageClass()){let a=t._messageClass();return new a({content:e})}else if(t.chatMessageClass){let a=t.chatMessageClass();return new a({content:e,role:this.getRoleFromMessageClass(a.lc_name())})}else throw new Error("No message class defined")}getRoleFromMessageClass(e){switch(e){case"HumanMessage":return"human";case"AIMessage":return"ai";case"SystemMessage":return"system";case"ChatMessage":return"chat";default:throw new Error("Invalid message class name")}}static fromTemplate(e,t){if(typeof e=="string")return new this(h.fromTemplate(e,t));let a=[];for(let r of e)if(typeof r=="string")a.push(h.fromTemplate(r,t));else if(r!==null)if(nt(r)){let s="";typeof r.text=="string"&&(s=r.text??"");let o={...t,additionalContentFields:r};a.push(h.fromTemplate(s,o))}else if(ot(r)){let s=r.image_url??"",o,n=[];if(typeof s=="string"){let u;t?.templateFormat==="mustache"?u=X(s):u=Q(s);let l=u.flatMap(p=>p.type==="variable"?[p.name]:[]);if((l?.length??0)>0){if(l.length>1)throw new Error(`Only one format variable allowed per image template.
10
+ Got: ${l}
11
+ From: ${s}`);n=[l[0]]}else n=[];s={url:s},o=new _({template:s,inputVariables:n,templateFormat:t?.templateFormat,additionalContentFields:r})}else if(typeof s=="object"){if("url"in s){let u;t?.templateFormat==="mustache"?u=X(s.url):u=Q(s.url),n=u.flatMap(l=>l.type==="variable"?[l.name]:[])}else n=[];o=new _({template:s,inputVariables:n,templateFormat:t?.templateFormat,additionalContentFields:r})}else throw new Error("Invalid image template");a.push(o)}else typeof r=="object"&&a.push(new O({template:r,templateFormat:t?.templateFormat}));return new this({prompt:a,additionalOptions:t})}async format(e){if(this.prompt instanceof j){let t=await this.prompt.format(e);return this.createMessage(t)}else{let t=[];for(let a of this.prompt){let r={};if(!("inputVariables"in a))throw new Error(`Prompt ${a} does not have inputVariables defined.`);for(let s of a.inputVariables)r||(r={[s]:e[s]}),r={...r,[s]:e[s]};if(a instanceof j){let s=await a.format(r),o;"additionalContentFields"in a&&(o=a.additionalContentFields),s!==""&&t.push({...o,type:"text",text:s})}else if(a instanceof _){let s=await a.format(r),o;"additionalContentFields"in a&&(o=a.additionalContentFields),t.push({...o,type:"image_url",image_url:s})}else if(a instanceof O){let s=await a.format(r),o;"additionalContentFields"in a&&(o=a.additionalContentFields),t.push({...o,...s})}}return this.createMessage(t)}}async formatMessages(e){return[await this.format(e)]}},G=class extends k{static _messageClass(){return x}static lc_name(){return"HumanMessagePromptTemplate"}},ae=class extends k{static _messageClass(){return w}static lc_name(){return"AIMessagePromptTemplate"}},se=class extends k{static _messageClass(){return g}static lc_name(){return"SystemMessagePromptTemplate"}};function lt(i){return typeof i.formatMessages=="function"}function ut(i,e){if(lt(i)||q(i))return i;if(Array.isArray(i)&&i[0]==="placeholder"){let r=i[1];if(e?.templateFormat==="mustache"&&typeof r=="string"&&r.slice(0,2)==="{{"&&r.slice(-2)==="}}"){let s=r.slice(2,-2);return new W({variableName:s,optional:!0})}else if(typeof r=="string"&&r[0]==="{"&&r[r.length-1]==="}"){let s=r.slice(1,-1);return new W({variableName:s,optional:!0})}throw new Error(`Invalid placeholder template for format ${e?.templateFormat??'"f-string"'}: "${i[1]}". Expected a variable name surrounded by ${e?.templateFormat==="mustache"?"double":"single"} curly braces.`)}let t=V(i),a;if(typeof t.content=="string"?a=t.content:a=t.content.map(r=>"text"in r?{...r,text:r.text}:"image_url"in r?{...r,image_url:r.image_url}:r),t._getType()==="human")return G.fromTemplate(a,e);if(t._getType()==="ai")return ae.fromTemplate(a,e);if(t._getType()==="system")return se.fromTemplate(a,e);if(y.isInstance(t))return re.fromTemplate(t.content,t.role,e);throw new Error(`Could not coerce message prompt template from input. Received message type: "${t._getType()}".`)}function pt(i){return i.constructor.lc_name()==="MessagesPlaceholder"}var ye=class i extends S{static lc_name(){return"ChatPromptTemplate"}get lc_aliases(){return{promptMessages:"messages"}}constructor(e){if(super(e),Object.defineProperty(this,"promptMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),e.templateFormat==="mustache"&&e.validateTemplate===void 0&&(this.validateTemplate=!1),Object.assign(this,e),this.validateTemplate){let t=new Set;for(let n of this.promptMessages)if(!(n instanceof M))for(let u of n.inputVariables)t.add(u);let a=this.inputVariables,r=new Set(this.partialVariables?a.concat(Object.keys(this.partialVariables)):a),s=new Set([...r].filter(n=>!t.has(n)));if(s.size>0)throw new Error(`Input variables \`${[...s]}\` are not used in any of the prompt messages.`);let o=new Set([...t].filter(n=>!r.has(n)));if(o.size>0)throw new Error(`Input variables \`${[...o]}\` are used in prompt messages but not in the prompt template.`)}}_getPromptType(){return"chat"}async _parseImagePrompts(e,t){if(typeof e.content=="string")return e;let a=await Promise.all(e.content.map(async r=>{if(r.type!=="image_url")return r;let s="";typeof r.image_url=="string"?s=r.image_url:s=r.image_url.url;let n=await h.fromTemplate(s,{templateFormat:this.templateFormat}).format(t);return typeof r.image_url!="string"&&"url"in r.image_url?r.image_url.url=n:r.image_url=n,r}));return e.content=a,e}async formatMessages(e){let t=await this.mergePartialAndUserVariables(e),a=[];for(let r of this.promptMessages)if(r instanceof M)a.push(await this._parseImagePrompts(r,t));else{let s;this.templateFormat==="mustache"?s={...t}:s=r.inputVariables.reduce((n,u)=>{if(!(u in t)&&!(pt(r)&&r.optional))throw oe(new Error(`Missing value for input variable \`${u.toString()}\``),"INVALID_PROMPT_INPUT");return n[u]=t[u],n},{});let o=await r.formatMessages(s);a=a.concat(o)}return a}async partial(e){let t=this.inputVariables.filter(s=>!(s in e)),a={...this.partialVariables??{},...e},r={...this,inputVariables:t,partialVariables:a};return new i(r)}static fromTemplate(e,t){let a=h.fromTemplate(e,t),r=new G({prompt:a});return this.fromMessages([r])}static fromMessages(e,t){let a=e.reduce((o,n)=>o.concat(n instanceof i?n.promptMessages:[ut(n,t)]),[]),r=e.reduce((o,n)=>n instanceof i?Object.assign(o,n.partialVariables):o,Object.create(null)),s=new Set;for(let o of a)if(!(o instanceof M))for(let n of o.inputVariables)n in r||s.add(n);return new this({...t,inputVariables:[...s],promptMessages:a,partialVariables:r,templateFormat:t?.templateFormat})}static fromPromptMessages(e){return this.fromMessages(e)}};var we=class i extends j{constructor(e){if(super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleSelector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"exampleSeparator",{enumerable:!0,configurable:!0,writable:!0,value:`
12
+
13
+ `}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.assign(this,e),this.examples!==void 0&&this.exampleSelector!==void 0)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(this.examples===void 0&&this.exampleSelector===void 0)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let t=this.inputVariables;this.partialVariables&&(t=t.concat(Object.keys(this.partialVariables))),C(this.prefix+this.suffix,this.templateFormat,t)}}_getPromptType(){return"few_shot"}static lc_name(){return"FewShotPromptTemplate"}async getExamples(e){if(this.examples!==void 0)return this.examples;if(this.exampleSelector!==void 0)return this.exampleSelector.selectExamples(e);throw new Error("One of 'examples' and 'example_selector' should be provided")}async partial(e){let t=this.inputVariables.filter(s=>!(s in e)),a={...this.partialVariables??{},...e},r={...this,inputVariables:t,partialVariables:a};return new i(r)}async format(e){let t=await this.mergePartialAndUserVariables(e),a=await this.getExamples(t),r=await Promise.all(a.map(o=>this.examplePrompt.format(o))),s=[this.prefix,...r,this.suffix].join(this.exampleSeparator);return d(s,this.templateFormat,t)}serialize(){if(this.exampleSelector||!this.examples)throw new Error("Serializing an example selector is not currently supported");if(this.outputParser!==void 0)throw new Error("Serializing an output parser is not currently supported");return{_type:this._getPromptType(),input_variables:this.inputVariables,example_prompt:this.examplePrompt.serialize(),example_separator:this.exampleSeparator,suffix:this.suffix,prefix:this.prefix,template_format:this.templateFormat,examples:this.examples}}static async deserialize(e){let{example_prompt:t}=e;if(!t)throw new Error("Missing example prompt");let a=await h.deserialize(t),r;if(Array.isArray(e.examples))r=e.examples;else throw new Error("Invalid examples format. Only list or string are supported.");return new i({inputVariables:e.input_variables,examplePrompt:a,examples:r,exampleSeparator:e.example_separator,prefix:e.prefix,suffix:e.suffix,templateFormat:e.template_format})}},xe=class i extends S{_getPromptType(){return"few_shot_chat"}static lc_name(){return"FewShotChatMessagePromptTemplate"}constructor(e){if(super(e),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleSelector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"exampleSeparator",{enumerable:!0,configurable:!0,writable:!0,value:`
14
+
15
+ `}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this.examples=e.examples,this.examplePrompt=e.examplePrompt,this.exampleSeparator=e.exampleSeparator??`
16
+
17
+ `,this.exampleSelector=e.exampleSelector,this.prefix=e.prefix??"",this.suffix=e.suffix??"",this.templateFormat=e.templateFormat??"f-string",this.validateTemplate=e.validateTemplate??!0,this.examples!==void 0&&this.exampleSelector!==void 0)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(this.examples===void 0&&this.exampleSelector===void 0)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let t=this.inputVariables;this.partialVariables&&(t=t.concat(Object.keys(this.partialVariables))),C(this.prefix+this.suffix,this.templateFormat,t)}}async getExamples(e){if(this.examples!==void 0)return this.examples;if(this.exampleSelector!==void 0)return this.exampleSelector.selectExamples(e);throw new Error("One of 'examples' and 'example_selector' should be provided")}async formatMessages(e){let t=await this.mergePartialAndUserVariables(e),a=await this.getExamples(t);a=a.map(s=>{let o={};return this.examplePrompt.inputVariables.forEach(n=>{o[n]=s[n]}),o});let r=[];for(let s of a){let o=await this.examplePrompt.formatMessages(s);r.push(...o)}return r}async format(e){let t=await this.mergePartialAndUserVariables(e),a=await this.getExamples(t),s=(await Promise.all(a.map(n=>this.examplePrompt.formatMessages(n)))).flat().map(n=>n.content),o=[this.prefix,...s,this.suffix].join(this.exampleSeparator);return d(o,this.templateFormat,t)}async partial(e){let t=this.inputVariables.filter(s=>!(s in e)),a={...this.partialVariables??{},...e},r={...this,inputVariables:t,partialVariables:a};return new i(r)}};return{a:it,b:_,c:O,d:F,e:W,f:te,g:S,h:re,i:G,j:ae,k:se,l:ye,m:we,n:xe}},)
@@ -0,0 +1 @@
1
+ {"assistantLabel":"Assistant"}
@@ -0,0 +1 @@
1
+ {"thumbsUpLabel":"Thumbs Up","thumbsDownLabel":"Thumbs Down","copyButtonLabel":"Copy","logButtonLabel":"Log"}
@@ -0,0 +1 @@
1
+ {"entryPlaceholder":"Type your message here...","stopButtonLabel":"Stop","askButtonLabel":"Ask"}
@@ -0,0 +1 @@
1
+ {"optionsLabel":"Options","enterTextLabel":"Enter text","submitButtonLabel":"Submit","cancelButtonLabel":"Cancel"}
@@ -0,0 +1 @@
1
+ {"shellHeading":"Chat","shellEntryMessage":"No messages yet. Start the conversation by typing a message below.","suggestedPromptsLabel":"Suggested Prompts"}
@@ -0,0 +1,4 @@
1
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
3
+ v5.0.0-next.133 */
4
+ import{m as t,s as e}from"./YXLN5DSL.js";import"./46CNQJRX.js";var s=t(e,{"arcgis-assistant":[()=>import("./N4CYINOF.js"),"description,entryMessage,heading,orchestrator:,portal:,referenceElement,suggestedPrompts:;;register"],"arcgis-assistant-agent":[()=>import("./Q34AELDL.js"),"agent:,context:;;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./G7XEFTIR.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-filter-agent":[()=>import("./NR6PK4OK.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-query-agent":[()=>import("./CGGGHCIN.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./7QPPUNQ3.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./BCCDWQP4.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./KMV7W5OL.js"),"loading,loadingMessage,messages:,user"],"arcgis-assistant-chat-card":[()=>import("./AB32PU6M.js"),"content,error,feedbackDisabled,loading,loadingMessage,log,timestampDisabled,type,user"],"arcgis-assistant-chat-card-content":[()=>import("./QIU4T2DV.js"),"content,loading,loadingMessage,type"],"arcgis-assistant-chat-entry":[()=>import("./AD7WB3RO.js"),"awaitingResponse,enterKeySubmits,entryPlaceholder,inputValue,status"],"arcgis-assistant-interrupt":[()=>import("./2OKOKVH3.js"),"message,options:,type"],"arcgis-assistant-shell":[()=>import("./CF42OIDB.js"),"awaitingResponse,description,entryMessage,entryMessageClosed,heading,inputValue,loading,status,suggestedPrompts:"]});s({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-layer-filter-agent,arcgis-assistant-layer-query-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-card,arcgis-assistant-chat-card-content,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-shell){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,e)
@@ -0,0 +1 @@
1
+ @layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-layer-filter-agent,arcgis-assistant-layer-query-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-card,arcgis-assistant-chat-card-content,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-shell){visibility:hidden}}
@@ -0,0 +1,17 @@
1
+ import "../cdn/main.css";
2
+ import { makeRuntime as e } from "@arcgis/lumina";
3
+ import { trackAccess as s, createObservable as a, createTrackingTarget as r, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
4
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
5
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
6
+ v5.0.0-next.133 */
7
+ const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/5.0.0-next/ai-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: i, setAssetPath: d } = t;
8
+ t.t = s;
9
+ t.o = a;
10
+ t.c = r;
11
+ t.r = c;
12
+ export {
13
+ n as c,
14
+ i as g,
15
+ t as r,
16
+ d as s
17
+ };
@@ -0,0 +1,9 @@
1
+ import { makeT9nController as o } from "@arcgis/lumina/controllers";
2
+ import { g as t } from "./runtime.js";
3
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
4
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
5
+ v5.0.0-next.133 */
6
+ const s = o(t);
7
+ export {
8
+ s as u
9
+ };
@@ -0,0 +1,35 @@
1
+ import { getClosestElement as i } from "@arcgis/toolkit/dom";
2
+ import { g as a } from "./utils2.js";
3
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
4
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
5
+ v5.0.0-next.133 */
6
+ function o(e, t) {
7
+ const n = a(e.referenceElement);
8
+ if (n)
9
+ return n;
10
+ const s = i(e.el, "arcgis-assistant"), r = a(s?.referenceElement);
11
+ if (r)
12
+ return r;
13
+ throw new Error(`${t}: Reference element not found`);
14
+ }
15
+ async function l(e, t) {
16
+ const n = o(e, t);
17
+ await n.componentOnReady();
18
+ const s = n.view;
19
+ if (!s)
20
+ throw new Error(`${t}: Reference element does not have a view`);
21
+ return await s.when(), s;
22
+ }
23
+ function m(e) {
24
+ const t = i(e.el, "arcgis-assistant");
25
+ if (t === void 0)
26
+ throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");
27
+ t.register({
28
+ agent: e.agent,
29
+ getContext: () => e.getContext?.() ?? e.context ?? {}
30
+ });
31
+ }
32
+ export {
33
+ m as i,
34
+ l as r
35
+ };
@@ -0,0 +1,9 @@
1
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
3
+ v5.0.0-next.133 */
4
+ function u(t) {
5
+ return t ? typeof t == "string" ? document.querySelector(t) : t : null;
6
+ }
7
+ export {
8
+ u as g
9
+ };
@@ -0,0 +1,14 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import { Orchestrator, AgentWithContext } from '@arcgis/ai-orchestrator';
3
+ import { default as Portal } from '@arcgis/core/portal/Portal.js';
4
+ import { PublicLitElement as LitElement, JsxNode, TargetedEvent } from '@arcgis/lumina';
5
+
6
+ export declare class ArcgisAssistant extends LitElement {
7
+ get orchestrator(): Orchestrator | undefined;
8
+ entryMessage?: string;
9
+ heading?: string;
10
+ description?: string;
11
+ referenceElement: HTMLArcgisMapElement | string | null;
12
+ portal: Portal;
13
+ suggestedPrompts: string[];
14
+ }
@@ -0,0 +1,250 @@
1
+ import { c as y } from "../../chunks/runtime.js";
2
+ import { css as v, html as p } from "lit";
3
+ import { Orchestrator as f } from "@arcgis/ai-orchestrator";
4
+ import _ from "@arcgis/core/core/Collection.js";
5
+ import { whenOnce as w, watch as b, when as $ } from "@arcgis/core/core/reactiveUtils.js";
6
+ import E from "@arcgis/core/portal/Portal.js";
7
+ import { LitElement as C } from "@arcgis/lumina";
8
+ import { createRef as g, ref as m } from "lit/directives/ref.js";
9
+ import L from "@arcgis/core/core/Accessor.js";
10
+ import { property as c, subclass as O } from "@arcgis/core/core/accessorSupport/decorators.js";
11
+ import { g as P } from "../../chunks/utils2.js";
12
+ import { u as S } from "../../chunks/useT9n.js";
13
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
14
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
15
+ v5.0.0-next.133 */
16
+ const k = v`:host{height:100%}`;
17
+ var H = Object.defineProperty, M = Object.getOwnPropertyDescriptor, a = (l, t, e, r) => {
18
+ for (var s = r > 1 ? void 0 : r ? M(t, e) : t, n = l.length - 1, o; n >= 0; n--)
19
+ (o = l[n]) && (s = (r ? o(t, e, s) : o(s)) || s);
20
+ return r && s && H(t, e, s), s;
21
+ };
22
+ let i = class extends L {
23
+ constructor(l) {
24
+ super(l), this.view = null, this.loading = !1, this.processing = !1, this.processingStep = "";
25
+ }
26
+ async load() {
27
+ this._set("loading", !0);
28
+ try {
29
+ await this._initialize();
30
+ } finally {
31
+ this._set("loading", !1);
32
+ }
33
+ }
34
+ destroy() {
35
+ this.orchestrator?.dispose(), super.destroy();
36
+ }
37
+ async _initialize() {
38
+ this.removeHandles(), await Promise.all([this.portal.load(), this.view?.when()]), this.view && await w(() => !this.view.updating), this._set(
39
+ "orchestrator",
40
+ await f.init({
41
+ agents: [...this.agents],
42
+ portal: this.portal,
43
+ view: this.view ?? void 0
44
+ })
45
+ ), this.addHandles([
46
+ b(
47
+ () => [this.view, this.agents],
48
+ () => void this._initialize()
49
+ )
50
+ ]);
51
+ }
52
+ async *ask(l, t) {
53
+ if (!this.orchestrator)
54
+ throw new Error("Orchestrator not initialized yet.");
55
+ this._set("processing", !0), this._set("processingStep", "");
56
+ let e = "";
57
+ try {
58
+ const r = this.orchestrator.ask(l);
59
+ for await (const s of r) {
60
+ if (t?.aborted) {
61
+ yield { type: "cancelled" };
62
+ break;
63
+ }
64
+ switch (s.type) {
65
+ case "trace": {
66
+ this._set("processingStep", s.data.text), e += `${s.data.text}
67
+
68
+ `;
69
+ break;
70
+ }
71
+ case "completed": {
72
+ if (!s.result.content.length) {
73
+ yield { type: "completed", error: "Could not process the request.", log: e };
74
+ return;
75
+ }
76
+ const n = s.result.content;
77
+ this._set("processingStep", ""), yield { type: "completed", response: n, log: e };
78
+ return;
79
+ }
80
+ case "interrupt": {
81
+ console.log("Orchestrator interrupt:", s);
82
+ const { kind: n, message: o, metadata: u } = s.interrupt, h = Array.isArray(u) ? [...u] : [], d = (() => {
83
+ switch (n) {
84
+ case "booleanChoice":
85
+ return { type: "boolean-choice", message: o, options: h };
86
+ case "singleSelection":
87
+ return { type: "single-select", message: o, options: h };
88
+ case "multipleSelection":
89
+ return { type: "multi-select", message: o, options: h };
90
+ case "textInput":
91
+ return { type: "text-input", message: o };
92
+ default:
93
+ return { type: n, message: o, options: h };
94
+ }
95
+ })();
96
+ this._set("processingStep", "Waiting for user input..."), yield { type: "interrupt", payload: d };
97
+ break;
98
+ }
99
+ case "cancelled": {
100
+ yield { type: "cancelled" };
101
+ return;
102
+ }
103
+ default: {
104
+ console.warn("Unknown event type:", s);
105
+ break;
106
+ }
107
+ }
108
+ }
109
+ } catch (r) {
110
+ console.warn("Error during message processing:", r), yield { type: "completed", error: "An error occurred during message processing.", log: e };
111
+ return;
112
+ } finally {
113
+ this._set("processing", !1);
114
+ }
115
+ }
116
+ };
117
+ a([
118
+ c({ readOnly: !0 })
119
+ ], i.prototype, "orchestrator", 2);
120
+ a([
121
+ c()
122
+ ], i.prototype, "agents", 2);
123
+ a([
124
+ c()
125
+ ], i.prototype, "portal", 2);
126
+ a([
127
+ c()
128
+ ], i.prototype, "view", 2);
129
+ a([
130
+ c({ readOnly: !0 })
131
+ ], i.prototype, "loading", 2);
132
+ a([
133
+ c({ readOnly: !0 })
134
+ ], i.prototype, "processing", 2);
135
+ a([
136
+ c({ readOnly: !0 })
137
+ ], i.prototype, "processingStep", 2);
138
+ i = a([
139
+ O("OrchestratorController")
140
+ ], i);
141
+ class A extends C {
142
+ constructor() {
143
+ super(...arguments), this._messages = S({ blocking: !0 }), this.#e = g(), this.#s = g(), this.#t = null, this.#r = null, this.#n = /* @__PURE__ */ new Map(), this.#i = (t) => {
144
+ t.stopPropagation(), this.orchestrator?.cancelInterrupt(), this._interrupt = null;
145
+ }, this.#o = (t) => {
146
+ t.stopPropagation();
147
+ const e = t.detail;
148
+ this.orchestrator?.resumeInterrupt(e), this._interrupt = null;
149
+ }, this.#a = (t) => {
150
+ t.stopPropagation(), this.suggestedPrompts = [];
151
+ const e = t.detail;
152
+ this.#h(e);
153
+ }, this.#l = (t) => {
154
+ if (t.stopPropagation(), this._interrupt) {
155
+ this.orchestrator?.cancelInterrupt(), this._interrupt = null;
156
+ return;
157
+ }
158
+ this.#r?.abort();
159
+ }, this._interrupt = null, this._chatHistory = new _([]), this._error = null, this.referenceElement = null, this.portal = new E(), this.suggestedPrompts = [];
160
+ }
161
+ static {
162
+ this.properties = { _interrupt: 16, _chatHistory: 16, _error: 16, orchestrator: 32, entryMessage: 1, heading: 1, description: 1, referenceElement: 1, portal: 0, suggestedPrompts: 0 };
163
+ }
164
+ static {
165
+ this.styles = k;
166
+ }
167
+ #e;
168
+ #s;
169
+ #t;
170
+ #r;
171
+ #n;
172
+ #i;
173
+ #o;
174
+ #a;
175
+ #l;
176
+ get orchestrator() {
177
+ return this.#t?.orchestrator;
178
+ }
179
+ register(t) {
180
+ this.#n.set(t.agent.id, t);
181
+ }
182
+ load() {
183
+ this.manager.onLifecycle(() => () => {
184
+ this.#r?.abort(), this._interrupt = null, this._chatHistory.removeAll(), this._error = null;
185
+ });
186
+ }
187
+ loaded() {
188
+ this.manager.onLifecycle(() => {
189
+ this.#e.value?.addEventListener("arcgisSubmit", this.#a), this.#e.value?.addEventListener("arcgisCancel", this.#l);
190
+ const t = $(() => !!this._interrupt && !!this.#s.value, () => {
191
+ const e = this.#s.value;
192
+ e.removeEventListener("arcgisSubmit", this.#o), e.removeEventListener("arcgisCancel", this.#i), e.addEventListener("arcgisSubmit", this.#o, { once: !0 }), e.addEventListener("arcgisCancel", this.#i, { once: !0 });
193
+ });
194
+ return queueMicrotask(() => void this.#c()), () => {
195
+ t.remove(), this.#s.value?.removeEventListener("arcgisSubmit", this.#o), this.#s.value?.removeEventListener("arcgisCancel", this.#i), this.#e.value?.removeEventListener("arcgisSubmit", this.#a), this.#e.value?.removeEventListener("arcgisCancel", this.#l), this.#t?.destroy(), this.#t = null;
196
+ };
197
+ });
198
+ }
199
+ async #c() {
200
+ try {
201
+ const t = P(this.referenceElement);
202
+ await t?.componentOnReady();
203
+ const e = [...this.#n.values()];
204
+ this.#t = new i({
205
+ agents: e,
206
+ portal: this.portal,
207
+ view: t?.view
208
+ }), await this.#t.load();
209
+ } catch (t) {
210
+ console.warn(t), this._error = "Error initializing orchestrator.";
211
+ }
212
+ }
213
+ async #h(t) {
214
+ const e = t.trim();
215
+ if (!e || (this._chatHistory.push({
216
+ type: "prompt",
217
+ content: e
218
+ }), !this.#t))
219
+ return;
220
+ this.#r = new AbortController();
221
+ const r = this.#t.ask(e, this.#r.signal);
222
+ for await (const s of r)
223
+ switch (s.type) {
224
+ case "completed":
225
+ this._chatHistory.push({
226
+ type: "response",
227
+ content: s.response,
228
+ log: s.log,
229
+ error: s.error
230
+ });
231
+ break;
232
+ case "interrupt":
233
+ this._interrupt = s.payload;
234
+ break;
235
+ case "cancelled":
236
+ this._chatHistory.push({
237
+ type: "response",
238
+ error: "Request cancelled."
239
+ });
240
+ break;
241
+ }
242
+ }
243
+ render() {
244
+ return p`<arcgis-assistant-shell .loading=${this.#t?.loading} .heading=${this.heading ?? this._messages.assistantLabel} .description=${this.description} .entryMessage=${this.entryMessage} .entryMessageClosed=${this._chatHistory.length > 0} .awaitingResponse=${this.#t?.processing} .suggestedPrompts=${this.suggestedPrompts} .status=${this.#t?.processing ? "working" : this._error ? "error" : "ready"} ${m(this.#e)}>${this._error ? p`<calcite-notice slot=entry-message open kind=danger icon width=full><div slot=message>${this._error}</div></calcite-notice>` : null}${this._interrupt ? p`<arcgis-assistant-interrupt slot=entry-message .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${m(this.#s)}></arcgis-assistant-interrupt>` : null}<arcgis-assistant-chat .loading=${this.#t?.processing} .loadingMessage=${this.#t?.processingStep || ""} .messages=${this._chatHistory} .user=${this.portal?.user?.fullName || this.portal?.user?.username}><slot></slot></arcgis-assistant-chat><slot name=header-actions-end slot=header-actions-end></slot>${this.entryMessage ? null : p`<slot name=entry-message slot=entry-message></slot>`}<slot name=entry-actions-start slot=entry-actions-start></slot><slot name=footer-content slot=footer-content></slot></arcgis-assistant-shell>`;
245
+ }
246
+ }
247
+ y("arcgis-assistant", A);
248
+ export {
249
+ A as ArcgisAssistant
250
+ };
@@ -0,0 +1,5 @@
1
+ import "../arcgis-assistant-shell/index.js";
2
+ import "@esri/calcite-components/components/calcite-notice";
3
+ import "../arcgis-assistant-interrupt/index.js";
4
+ import "../arcgis-assistant-chat/index.js";
5
+ export * from "./customElement.js";
@@ -0,0 +1,5 @@
1
+ import "../arcgis-assistant-shell/index.js";
2
+ import "@esri/calcite-components/components/calcite-notice";
3
+ import "../arcgis-assistant-interrupt/index.js";
4
+ import "../arcgis-assistant-chat/index.js";
5
+ export * from "./customElement.js";
@@ -0,0 +1,33 @@
1
+ /// <reference types="@arcgis/core/interfaces.d.ts" />
2
+ import { Orchestrator, AgentWithContext } from '@arcgis/ai-orchestrator';
3
+ import { default as Accessor } from '@arcgis/core/core/Accessor.js';
4
+ type ConstructProperties = Partial<Pick<OrchestratorController, "agents" | "portal" | "view">>;
5
+ export declare class OrchestratorController extends Accessor {
6
+ constructor(properties?: ConstructProperties);
7
+ orchestrator?: Orchestrator;
8
+ agents: AgentWithContext[];
9
+ portal: __esri.Portal;
10
+ view: __esri.MapView | null;
11
+ loading: boolean;
12
+ processing: boolean;
13
+ processingStep: string;
14
+ load(): Promise<void>;
15
+ destroy(): void;
16
+ private _initialize;
17
+ ask(message: string, signal?: AbortSignal): AsyncGenerator<{
18
+ type: "interrupt";
19
+ payload: {
20
+ type: "boolean-choice" | "multi-select" | "single-select" | "text-input";
21
+ message?: string;
22
+ options?: string[];
23
+ };
24
+ } | {
25
+ type: "cancelled";
26
+ } | {
27
+ type: "completed";
28
+ response?: string;
29
+ error?: string;
30
+ log: string;
31
+ }>;
32
+ }
33
+ export {};
@@ -0,0 +1 @@
1
+ export declare function getReferenceElement(referenceElement: HTMLArcgisMapElement | string | null | undefined): HTMLArcgisMapElement | null;
@@ -0,0 +1,10 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import { AgentRegistration } from '@arcgis/ai-orchestrator';
3
+ import { PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina';
4
+ import { AssistantAgentHost } from '../assistant/assistant-agents/support/utils';
5
+
6
+ export declare class ArcgisAssistantAgent<TContext = Record<string, unknown>> extends LitElement {
7
+ /** @required */
8
+ agent: AgentRegistration;
9
+ context?: TContext;
10
+ }
@@ -0,0 +1,21 @@
1
+ import { c as t } from "../../chunks/runtime.js";
2
+ import { LitElement as s } from "@arcgis/lumina";
3
+ import { i as e } from "../../chunks/utils.js";
4
+ /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
5
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
6
+ v5.0.0-next.133 */
7
+ class i extends s {
8
+ static {
9
+ this.properties = { agent: 0, context: 0 };
10
+ }
11
+ getContext() {
12
+ return this.context;
13
+ }
14
+ load() {
15
+ e(this);
16
+ }
17
+ }
18
+ t("arcgis-assistant-agent", i);
19
+ export {
20
+ i as ArcgisAssistantAgent
21
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";