@arcgis/ai-components 5.1.0-next.20 → 5.1.0-next.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{D6OOXTNF.js → 3HM2G4HN.js} +1 -1
- package/dist/cdn/4VLOHDTM.js +2 -0
- package/dist/cdn/{MYKSIL6I.js → 56GVUCXF.js} +1 -1
- package/dist/cdn/{AGZUEMOX.js → 5GQGMYKS.js} +1 -1
- package/dist/cdn/{NVDHSI7U.js → 73BA5SPH.js} +1 -1
- package/dist/cdn/{XDZPERQF.js → 7DEQA72J.js} +1 -1
- package/dist/cdn/{XWE57GB7.js → BQUUQCFT.js} +1 -1
- package/dist/cdn/{2YSKWJQE.js → D2Y5AERZ.js} +1 -1
- package/dist/cdn/{LKI5DI3H.js → DT4PF4CH.js} +1 -1
- package/dist/cdn/{E77IJ3SU.js → F2UO6SO4.js} +61 -61
- package/dist/cdn/{XM2LOEZ6.js → IKSKLUGP.js} +1 -1
- package/dist/cdn/{DARXCM4F.js → LGK7IK2J.js} +1 -1
- package/dist/cdn/{2XALI4ZK.js → LH7MVXN7.js} +1 -1
- package/dist/cdn/{ZGRFMSA2.js → OHENWFSF.js} +1 -1
- package/dist/cdn/{EH66ASBE.js → PTDPFR7R.js} +3 -3
- package/dist/cdn/{HWZW3JSY.js → SVFV3OUW.js} +1 -1
- package/dist/cdn/{7X4WODN4.js → ULL6U6XS.js} +1 -1
- package/dist/cdn/{ARLFZJO5.js → VDUOWASW.js} +2 -0
- package/dist/cdn/{PQHYDFCL.js → WDIBMSCQ.js} +1 -1
- package/dist/cdn/WQ6XTWQR.js +4 -0
- package/dist/cdn/{GC556G6M.js → Z6ZNHTPJ.js} +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-assistant/customElement.d.ts +25 -8
- package/dist/components/arcgis-assistant/customElement.js +29 -25
- package/dist/components/arcgis-assistant/index.js +2 -1
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +12 -2
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.d.ts +5 -0
- package/dist/components/arcgis-assistant-help-agent/customElement.d.ts +7 -3
- package/dist/components/arcgis-assistant-navigation-agent/customElement.d.ts +10 -5
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/utils/index.d.ts +11 -7
- package/package.json +6 -6
- package/dist/cdn/I5KOHNUY.js +0 -2
- package/dist/cdn/VG7GKLZR.js +0 -4
- package/dist/cdn/utils.js +0 -2
- /package/dist/{utils.js → utils/index.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as $,c as k}from"./WBSNYWJJ.js";import{A as N,a as C,b as L,c as m,d as f,e as P,f as O,k as g,m as v,o as w}from"./
|
|
2
|
+
import{a as $,c as k}from"./WBSNYWJJ.js";import{A as N,a as C,b as L,c as m,d as f,e as P,f as O,k as g,m as v,o as w}from"./WQ6XTWQR.js";var _=t=>(...s)=>{let o=f(),e=new t(...s),r=e.exports;m(o.at(-1));let n=e.component.manager;n.W(e,r),e.watchExports(n.W.bind(n,e)),P(e);let a=[e.component,...o].reverse();return v(a,i=>i===void 0?void 0:j(e,i,r),r)},j=(t,{host:s,key:o,isReactive:e},r)=>{let n=s,a=n[o]!==t.exports,i=n[o]!==r,c=r!==t.exports;if(a&&!i&&c&&(n[o]=t.exports),s===t.component){if(e){let l=t.component.manager;i&&l.W(t,n[o]),t.onUpdate(u=>{if(u.has(o)){let x=n[o];x!==t.exports&&l.W(t,x)}})}t.O=e?void 0:o}let d=t.component.constructor.elementProperties.get(o)?.readOnly;t.watchExports(()=>{n[o]!==t.exports&&(d?O(()=>{n[o]=t.exports}):n[o]=t.exports)})};var z="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),M=new Set(z),h="en",U={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},F=async(t,s,o="")=>{let e=`${s}/${o}`,r=`${e}${t}.json`;return b[r]??(b[r]=A(t,e)),await b[r]},b={},A=async(t,s)=>{let o=`${s}${t}.json`;try{let e=await fetch(o);if(e.ok)return await e.json()}catch(e){return g("error","intl",`An unknown error occurred while fetching localization strings at ${o}`,{detail:{error:e}}),{}}return t===h?{}:await A(h,s)},y=t=>{let s=k(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:T(s)}},T=t=>{let[s,o]=t.split("-"),e=s.toLowerCase(),r=e;return o&&(r=`${e}-${o.toUpperCase()}`),r=U[r]??r,M.has(r)?r:o?T(e):h},D=(t,s,o,e)=>{let r,n=()=>K(t,s(),e).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&o(a),r=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),$(t,["lang"],n)},K=async(t,s,o=t.localName.split("-").slice(1).join("-"))=>{let{lang:e,t9nLocale:r}=y(t),n=`${s}/${o}/t9n`,i=o===null?{}:await F(r,n,"messages.");return{lang:e,t9nLocale:r,t9nStrings:i}};var W=t=>I(void 0,t);var E=class extends w{constructor(s,o){super(s);let e=this.exports;try{L(this.component);let r=o(this.component,this),n=this.exports!==e;if(C(r)){n||this.setProvisionalExports(r);let a=r.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},I=_(E);var S=t=>(s={})=>W((o,e)=>{let r=y(o.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=o;e.onLifecycle(()=>D(o.el,()=>t("./assets"),({t9nLocale:c,t9nStrings:p,lang:d})=>{let l={...p,_lang:d,_t9nLocale:c,_loading:!1};e.exports=l;let u=p.componentLabel;typeof u=="string"&&"label"in o&&o.label==null&&(o.label??=u),i(a.messageOverrides)},s.name));let i=c=>{let p=e.exports,d=p._original??p,l=V(d,c);c&&(l._original=d),e.exports=l};return"messageOverrides"in a&&e.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(e.setProvisionalExports(n,!1),e.ready):n}),V=(t,s)=>{if(!s)return t;let o={...t};return Object.entries(s).forEach(([e,r])=>{t[e]!==void 0&&(typeof r=="object"?o[e]=V(t[e],r):o[e]=r??t[e])}),o};var ct=S(N);export{ct as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as k}from"./3HM2G4HN.js";import c from"./PTDPFR7R.js";import{a as C}from"./OJUEJ4RT.js";import"./WBSNYWJJ.js";import{g as b,h,l as v,n as a,t as u,u as m,v as f,z as w}from"./WQ6XTWQR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([S,{whenOnce:I,watch:L,when:P},O,M,{property:p,subclass:x},{y:E}])=>{var R=b`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%)}`,A=Object.defineProperty,z=Object.getOwnPropertyDescriptor,l=(c,t,e,i)=>{for(var s=i>1?void 0:i?z(t,e):t,r=c.length-1,n;r>=0;r--)(n=c[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&A(t,e,s),s},o=class extends M{constructor(c){super(c),this.view=null,this.loading=!1,this.processing=!1,this.processingStep=""}async load(){this._set("loading",!0);try{await this._initialize()}finally{this._set("loading",!1)}}destroy(){this.orchestrator?.dispose(),super.destroy()}async _initialize(){this.removeHandles(),await Promise.all([this.portal.load(),this.view?.when()]),this.view&&await I(()=>!this.view.updating),this._set("orchestrator",await E.init({agents:[...this.agents],view:this.view??void 0})),this.addHandles([L(()=>[this.view,this.agents],()=>void this._initialize())])}clearChatHistory(){this.orchestrator?.newConversation()}async*ask(c,t){if(!this.orchestrator)throw new Error("Orchestrator not initialized yet.");this._set("processing",!0),this._set("processingStep","");let e=[];try{let i=this.orchestrator.ask(c);for await(let s of i){let r=s.runId;if(t?.aborted){yield{type:"cancelled",runId:r};break}switch(s.type){case"trace":{this._set("processingStep",s.data.text),e.push(s.data.text);break}case"completed":{if(!s.result.content.length){yield{type:"completed",error:"Could not process the request.",log:e,runId:r};return}let n=s.result.content;this._set("processingStep",""),yield{type:"completed",response:n,log:e,runId:r};return}case"interrupt":{let{kind:n,message:g,metadata:_}=s.interrupt,d=Array.isArray(_)?[..._]:[],$=(()=>{switch(n){case"booleanChoice":return{type:"boolean-choice",message:g,options:d};case"singleSelection":return{type:"single-select",message:g,options:d};case"multipleSelection":return{type:"multi-select",message:g,options:d};case"textInput":return{type:"text-input",message:g};default:return{type:n,message:g,options:d}}})();this._set("processingStep","Waiting for user input..."),yield{type:"interrupt",payload:$,runId:r};break}case"cancelled":{yield{type:"cancelled",runId:r};return}case"error":{yield{type:"completed",error:s.error.message,log:e,runId:r};return}default:{console.warn("Unknown event type:",s);break}}}}catch(i){console.warn("Error during message processing:",i),yield{type:"completed",error:"An error occurred during message processing.",log:e,runId:"error"};return}finally{this._set("processing",!1)}}};l([p({readOnly:!0})],o.prototype,"orchestrator",2);l([p()],o.prototype,"agents",2);l([p()],o.prototype,"portal",2);l([p()],o.prototype,"view",2);l([p({readOnly:!0})],o.prototype,"loading",2);l([p({readOnly:!0})],o.prototype,"processing",2);l([p({readOnly:!0})],o.prototype,"processingStep",2);o=l([x("OrchestratorController")],o);var H="Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.",j="Embeddings not found for this web map.",F="https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings",y=class extends f{constructor(){super(...arguments),this._messages=k({blocking:!0}),this.#t=u(),this.#e=u(),this.#s=null,this.#a=new Map,this.#r=O.getDefault(),this.#i=t=>{t.stopPropagation(),this.arcgisInterruptCancel.emit(),this.orchestrator?.cancelInterrupt(),this._interrupt=null},this.#o=t=>{t.stopPropagation();let e=t.detail;this.arcgisInterruptSubmit.emit(e),this.orchestrator?.resumeInterrupt(e),this._interrupt=null},this.#n=t=>{t.stopPropagation(),this.keepSuggestedPrompts||(this.suggestedPrompts=[]);let e=t.detail;this.arcgisSubmit.emit(e),this.submitMessage(e)},this.#l=t=>{if(t.stopPropagation(),this.arcgisCancel.emit(),this._interrupt){this.orchestrator?.cancelInterrupt(),this._interrupt=null;return}this.#s?.abort()},this.#c=t=>{t.stopPropagation();let e=t.detail;this.arcgisFeedback.emit(e)},this._orchestratorController=null,this._interrupt=null,this._error=null,this.messages=new S([]),this.referenceElement=null,this.suggestedPrompts=[],this.feedbackEnabled=!1,this.keepSuggestedPrompts=!1,this.logEnabled=!1,this.copyEnabled=!1,this.arcgisCancel=a(),this.arcgisError=a(),this.arcgisFeedback=a(),this.arcgisInterrupt=a(),this.arcgisInterruptCancel=a(),this.arcgisInterruptSubmit=a(),this.arcgisReady=a(),this.arcgisSubmit=a()}static{this.properties={_orchestratorController:16,_interrupt:16,_error:16,_user:16,messages:0,orchestrator:32,entryMessage:1,heading:1,description:1,referenceElement:1,suggestedPrompts:0,feedbackEnabled:5,keepSuggestedPrompts:5,logEnabled:5,copyEnabled:5}}static{this.styles=R}#t;#e;#s;#a;#r;#i;#o;#n;#l;#c;async#h(){try{let t=C(this.el,this.referenceElement);await t?.componentOnReady();let e=[...this.#a.values()];return e.length?(this._orchestratorController=new o({agents:e,portal:this.#r,view:t?.view}),await this._orchestratorController.load(),!0):(this._error="No agents found.",!1)}catch(t){return this._error=t?.message??"Error initializing orchestrator.",v(this)(t),!1}}get _user(){return this.#r?.user?.fullName||this.#r?.user?.username}get orchestrator(){return this._orchestratorController?.orchestrator}async clearChatHistory(){this._reset(),this._orchestratorController?.clearChatHistory()}register(t){this.#a.set(t.agent.id,t)}async submitMessage(t){let e=t.trim();if(!e||(this.messages.push({id:Date.now().toString(),role:"user",content:e}),!this._orchestratorController))return;let i=this._orchestratorController.ask(e,this.#s?.signal);for await(let s of i){let r=s.runId;switch(s.type){case"completed":this.messages.push({role:"assistant",content:s.response,log:s.log,error:s.error,id:r});break;case"interrupt":this._interrupt={...s.payload,id:r};break;case"cancelled":this.messages.push({role:"assistant",error:"Request cancelled.",id:r});break}}}load(){this.manager.onLifecycle(this._reset.bind(this))}loaded(){this.manager.onLifecycle(()=>{this.#t.value?.addEventListener("arcgisSubmit",this.#n),this.#t.value?.addEventListener("arcgisCancel",this.#l),this.#t.value?.addEventListener("arcgisFeedback",this.#c);let t=P(()=>!!this._interrupt&&!!this.#e.value,()=>{let e=this.#e.value;e.removeEventListener("arcgisSubmit",this.#o),e.removeEventListener("arcgisCancel",this.#i),e.addEventListener("arcgisSubmit",this.#o,{once:!0}),e.addEventListener("arcgisCancel",this.#i,{once:!0}),this._interrupt&&this.arcgisInterrupt.emit(this._interrupt)});return queueMicrotask(()=>{this.#h().then(e=>{e?this.arcgisReady.emit():this._error&&this.arcgisError.emit(new Error(this._error))})}),()=>{t.remove(),this.#e.value?.removeEventListener("arcgisSubmit",this.#o),this.#e.value?.removeEventListener("arcgisCancel",this.#i),this.#t.value?.removeEventListener("arcgisSubmit",this.#n),this.#t.value?.removeEventListener("arcgisCancel",this.#l),this.#t.value?.removeEventListener("arcgisFeedback",this.#c),this._orchestratorController?.destroy(),this._orchestratorController=null}})}_reset(){this.#s?.abort(),this._interrupt=null,this.messages.removeAll(),this._error=null}_renderErrorNotice(){return this._error?h`<calcite-notice closable slot=entry-message open kind=danger icon width=full>${this._error===H?h`<div slot=message>${j}</div><calcite-link slot=link .href=${F} target=_blank title="Learn about web map embeddings">Read more</calcite-link>`:h`<div slot=message>${this._error}</div>`}</calcite-notice>`:null}render(){return h`<arcgis-assistant-shell .loading=${!this._orchestratorController&&!this._error||this._orchestratorController?.loading} .heading=${this.heading??this._messages.assistantLabel} .description=${this.description} .entryMessage=${this.entryMessage} .entryMessageClosed=${this.messages.length>0} .awaitingResponse=${this._orchestratorController?.processing} .suggestedPrompts=${this.suggestedPrompts} .messages=${this.messages} ${m(this.#t)}>${this._renderErrorNotice()}${this._interrupt?h`<arcgis-assistant-interrupt slot=entry-message .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${m(this.#e)}></arcgis-assistant-interrupt>`:null}<arcgis-assistant-chat .loading=${this._orchestratorController?.processing} .loadingMessage=${this._orchestratorController?.processingStep||""} .messages=${this.messages} .user=${this._user} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled}><slot></slot></arcgis-assistant-chat><slot name=header-actions-end slot=header-actions-end></slot>${this.entryMessage?null:h`<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>`}};w("arcgis-assistant",y);return y},"core/Collection","core/reactiveUtils","portal/Portal","core/Accessor","core/accessorSupport/decorators",c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as n}from"./
|
|
2
|
+
import{a as n}from"./3HM2G4HN.js";import"./WBSNYWJJ.js";import{g as a,h as e,n as s,v as c,z as l}from"./WQ6XTWQR.js";import"./CFDTXKJ6.js";var o=a``,i=class extends c{constructor(){super(...arguments),this.#t=[],this._messages=n({blocking:!0}),this.arcgisCancel=s(),this.arcgisSubmit=s()}static{this.properties={type:1,message:1,options:0}}static{this.styles=o}#t;_renderInterruptOptions(){switch(this.type){case"single-select":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems[0]?.value}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems.map(r=>r.value)}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"boolean-choice":return null;case"text-input":return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${t=>this.#t=t.target.value}></calcite-input>`}}render(){return e`<calcite-panel .description=${this.message}>${this._renderInterruptOptions()}<calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${()=>this.arcgisSubmit.emit(this.type==="boolean-choice"?!0:this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`}};l("arcgis-assistant-interrupt",i);export{i as ArcgisAssistantInterrupt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{b as a}from"./WFEBJPQ4.js";import"./OJUEJ4RT.js";import"./WBSNYWJJ.js";import{v as s,z as e}from"./
|
|
2
|
+
import{b as a}from"./WFEBJPQ4.js";import"./OJUEJ4RT.js";import"./WBSNYWJJ.js";import{v as s,z as e}from"./WQ6XTWQR.js";import"./CFDTXKJ6.js";var t=class extends s{static{this.properties={agent:0,context:0}}getContext(){return this.context}load(){a(this)}};e("arcgis-assistant-agent",t);export{t as ArcgisAssistantAgent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{g as t,h as s,t as e,u as i,v as n,z as l}from"./
|
|
2
|
+
import{g as t,h as s,t as e,u as i,v as n,z as l}from"./WQ6XTWQR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([c,{watch:d}])=>{var r=t`.assistant-chat__messages-container{display:flex;flex:1;flex-direction:column}.assistant-chat__messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-md);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}`,a=class extends n{constructor(){super(...arguments),this.#s=e(),this.feedbackEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.loading=!1,this.loadingMessage="",this.messages=new c([])}static{this.properties={feedbackEnabled:5,logEnabled:5,copyEnabled:5,loading:5,loadingMessage:1,user:1,messages:0}}static{this.styles=r}#s;firstUpdated(){this._scrollToEnd()}loaded(){this.manager.onLifecycle(()=>[this.messages.on("change",()=>{this.requestUpdate(),this._scrollToEnd()}),d(()=>this.loading,()=>{this._scrollToEnd()})])}_scrollToEnd(){requestAnimationFrame(()=>{this.#s.value?.scrollIntoView({behavior:"smooth"})})}render(){return s`<div class="assistant-chat__messages-container"><div class="assistant-chat__messages-list"><slot></slot>${this.messages.map(o=>s`<arcgis-assistant-chat-card .message=${o} .user=${this.user} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled}></arcgis-assistant-chat-card>`)}${this.loading?s`<arcgis-assistant-chat-card .loading=${this.loading} .loadingMessage=${this.loadingMessage} .message=${{id:"loading",role:"assistant",content:this.loadingMessage}}></arcgis-assistant-chat-card>`:null}</div><div ${i(this.#s)}></div></div>`}};l("arcgis-assistant-chat",a);return a},"core/Collection","core/reactiveUtils")
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as h,b as g}from"./
|
|
2
|
+
import{a as h,b as g}from"./IKSKLUGP.js";import{a as d}from"./3HM2G4HN.js";import"./WBSNYWJJ.js";import{g as i,h as t,n as c,t as o,u as n,v as r,z as l}from"./WQ6XTWQR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{watch:p}])=>{var _=i`:host{display:block;container-type:inline-size}.assistant-chat-card__prompt-container{display:flex;align-items:center;gap:var(--calcite-spacing-md);background:color-mix(in srgb,var(--calcite-color-brand) 25%,transparent);color:var(--calcite-color-text-1);padding:var(--calcite-spacing-md);border-radius:var(--calcite-border-radius);width:fit-content;margin-left:auto;justify-content:flex-end}.assistant-chat-card__prompt-avatar{display:flex;align-items:center;justify-content:center}.assistant-chat-card__content-container{display:flex;flex:1;flex-direction:column;width:100%}.assistant-chat-card__response-container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--calcite-spacing-sm);width:100%;text-align:left}.assistant-chat-card__response-icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.assistant-chat-card__footer{display:flex;width:100%;justify-content:space-between;padding:0 var(--calcite-spacing-xxs)}.assistant-chat-card__feedback-actions{display:flex;flex-direction:row;gap:var(--calcite-spacing-xxs)}.assistant-chat-card__log-container{padding:0 var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);margin-bottom:var(--calcite-spacing-sm)}.assistant-chat-card__log{margin:0;background-color:var(--calcite-color-foreground-1);width:100%;max-height:300px;overflow:auto}.assistant-chat-card__log-entry{margin-left:var(--calcite-spacing-sm);padding:var(--calcite-spacing-xxs) var(--calcite-spacing-lg);border-left:1px solid var(--calcite-color-border-1)}.assistant-chat-card__footer-start,.assistant-chat-card__footer-end{display:flex;gap:var(--calcite-spacing-xxs)}@container (min-width: 480px){.assistant-chat-card__prompt-container,.assistant-chat-card__response-container{max-width:80%}}`,s=class extends r{constructor(){super(...arguments),this._messages=d({blocking:!0}),this._endRef=o(),this._showLog=!1,this.loading=!1,this.feedbackEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.arcgisFeedback=c()}static{this.properties={_showLog:16,_role:16,_content:16,_log:16,_error:16,_feedback:16,loading:5,messageRole:1,feedbackEnabled:5,logEnabled:5,copyEnabled:5,content:1,loadingMessage:1,log:0,error:1,user:1,message:0}}static{this.styles=_}get _role(){return this.message?.role??this.messageRole}get _content(){return this.message?.content??this.content}get _log(){return(this.message?.role==="assistant"?this.message?.log:void 0)??this.log}get _error(){return(this.message?.role==="assistant"?this.message?.error:void 0)??this.error}get _feedback(){return this.message?.role==="assistant"?this.message?.feedback?.positive:void 0}loaded(){this.manager.onLifecycle(()=>[p(()=>this._showLog,()=>this._scrollToEnd())])}_scrollToEnd(){requestAnimationFrame(()=>{this._endRef.value?.scrollIntoView({behavior:"smooth",block:"end"})})}_handleFeedback(a){this.message?.role==="assistant"&&(this.message.feedback=this.message.feedback?.positive===a?void 0:{positive:a},this.arcgisFeedback.emit(this.message),this.requestUpdate())}_renderLog(){return this._log&&this._showLog&&this.logEnabled?t`<div class="assistant-chat-card__log-container"><div class="assistant-chat-card__log"><calcite-accordion appearance=transparent icon-position=start icon-type=chevron scale=s>${this._log.map(a=>{let e=a.includes(`
|
|
3
3
|
`)||a.length>70;return t`<calcite-accordion-item .heading=${e?`${a.substring(0,70)}...`:a} .expanded=${e}><div class="assistant-chat-card__log-entry">${e?h(g(a)):null}</div></calcite-accordion-item>`})}</calcite-accordion></div></div>`:null}_renderThumbsUpButton(){return t`<calcite-action id=action-thumbs-up icon=thumbs-up scale=s .active=${this._feedback===!0} @click=${()=>this._handleFeedback(!0)} text></calcite-action><calcite-tooltip reference-element=action-thumbs-up overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsUpLabel}</span></calcite-tooltip>`}_renderThumbsDownButton(){return t`<calcite-action id=action-thumbs-down icon=thumbs-down scale=s .active=${this._feedback===!1} @click=${()=>this._handleFeedback(!1)} text></calcite-action><calcite-tooltip reference-element=action-thumbs-down overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsDownLabel}</span></calcite-tooltip>`}_renderFeedback(){return this.feedbackEnabled&&!this._error?t`<div class="assistant-chat-card__feedback-actions">${this._renderThumbsUpButton()}${this._renderThumbsDownButton()}</div>`:null}_renderCopyButton(){return!this._error&&this.copyEnabled?t`<calcite-action id=action-copy icon=copy-to-clipboard scale=s @click=${async()=>{try{this._content&&await navigator.clipboard.writeText(this._content)}catch(a){console.error("Failed to copy text to clipboard:",a)}}} text></calcite-action><calcite-tooltip reference-element=action-copy overlay-positioning=fixed placement=bottom><span>${this._messages.copyButtonLabel}</span></calcite-tooltip>`:null}_renderLogButton(){return this._log&&this.logEnabled?t`<calcite-action id=action-log icon=access-string-results scale=s @click=${()=>this._showLog=!this._showLog} .text=${this._messages.logButtonLabel} .active=${this._showLog}></calcite-action><calcite-tooltip reference-element=action-log overlay-positioning=fixed placement=bottom><span>${this._messages.logButtonLabel}</span></calcite-tooltip>`:null}_renderFooter(){return this.loading?null:t`<div class="assistant-chat-card__footer"><div class="assistant-chat-card__footer-start">${this._renderCopyButton()}${this._renderLogButton()}<slot name=footer-actions-start></slot></div><div class="assistant-chat-card__footer-end"><slot name=footer-actions-end></slot>${this._renderFeedback()}</div></div>`}render(){return this._role==="user"?t`<div class="assistant-chat-card__prompt-container"><div>${this._content}</div><div class="assistant-chat-card__prompt-avatar"><calcite-avatar .fullName=${this.user} scale=s></calcite-avatar></div></div>`:t`<div class="assistant-chat-card__response-container"><calcite-icon icon=effects class="assistant-chat-card__response-icon" scale=s></calcite-icon><div class="assistant-chat-card__content-container"><arcgis-assistant-chat-card-content .loading=${this.loading} .loadingMessage=${this.loadingMessage} .type=${this._error?"error":"text"} .content=${this._error??this._content}></arcgis-assistant-chat-card-content>${this._renderLog()}${this._renderFooter()}</div><div ${n(this._endRef)}></div></div>`}};l("arcgis-assistant-chat-card",s);return s},"core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./F2UO6SO4.js";import a from"./PTDPFR7R.js";import{a as s,b as i}from"./WFEBJPQ4.js";import"./OJUEJ4RT.js";import"./WBSNYWJJ.js";import{v as r,z as e}from"./WQ6XTWQR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{c:a}])=>{var t=class extends r{constructor(){super(...arguments),this.agent=a}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-filter-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=s(this,"arcgis-assistant-layer-filter-agent"),i(this)}};e("arcgis-assistant-layer-filter-agent",t);return t},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./F2UO6SO4.js";import a from"./PTDPFR7R.js";import{a as e,b as i}from"./WFEBJPQ4.js";import"./OJUEJ4RT.js";import"./WBSNYWJJ.js";import{v as s,z as r}from"./WQ6XTWQR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{e:a}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=a}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=e(this,"arcgis-assistant-layer-styling-agent"),i(this)}};r("arcgis-assistant-layer-styling-agent",t);return t},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./F2UO6SO4.js";import a from"./PTDPFR7R.js";import{a as r,b as i}from"./WFEBJPQ4.js";import"./OJUEJ4RT.js";import"./WBSNYWJJ.js";import{v as s,z as e}from"./WQ6XTWQR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{f:a}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=a}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=r(this,"arcgis-assistant-help-agent"),i(this)}};e("arcgis-assistant-help-agent",t);return t},a,b)
|