@esri/solutions-components 5.1.0-next.147 → 5.1.0-next.149

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.
@@ -77,7 +77,7 @@ Description: {description}`,wz=A.object({schemaVersion:A.literal(Lf),modified:A.
77
77
  `)}var os=(function(t){Kf(e,t);function e(r,n,s,o,i){var a=this.constructor,u=t.call(this,Lc(r,{name:n,index:s,operation:o,tree:i}))||this;return u.name=n,u.index=s,u.operation=o,u.tree=i,Object.setPrototypeOf(u,a.prototype),u.message=Lc(r,{name:n,index:s,operation:o,tree:i}),u}return e})(Error);var K=os,Wf=se,In={add:function(t,e,r){return t[e]=this.value,{newDocument:r}},remove:function(t,e,r){var n=t[e];return delete t[e],{newDocument:r,removed:n}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:function(t,e,r){var n=go(r,this.path);n&&(n=se(n));var s=Zt(r,{op:"remove",path:this.from}).removed;return Zt(r,{op:"add",path:this.path,value:s}),{newDocument:r,removed:n}},copy:function(t,e,r){var n=go(r,this.from);return Zt(r,{op:"add",path:this.path,value:se(n)}),{newDocument:r}},test:function(t,e,r){return{newDocument:r,test:is(t[e],this.value)}},_get:function(t,e,r){return this.value=t[e],{newDocument:r}}},Hf={add:function(t,e,r){return ho(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:r,index:e}},remove:function(t,e,r){var n=t.splice(e,1);return{newDocument:r,removed:n[0]}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:In.move,copy:In.copy,test:In.test,_get:In._get};function go(t,e){if(e=="")return t;var r={op:"_get",path:e};return Zt(t,r),r.value}function Zt(t,e,r,n,s,o){if(r===void 0&&(r=!1),n===void 0&&(n=!0),s===void 0&&(s=!0),o===void 0&&(o=0),r&&(typeof r=="function"?r(e,0,t,e.path):yo(e,0)),e.path===""){var i={newDocument:t};if(e.op==="add")return i.newDocument=e.value,i;if(e.op==="replace")return i.newDocument=e.value,i.removed=t,i;if(e.op==="move"||e.op==="copy")return i.newDocument=go(t,e.from),e.op==="move"&&(i.removed=t),i;if(e.op==="test"){if(i.test=is(t,e.value),i.test===!1)throw new K("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return i.newDocument=t,i}else{if(e.op==="remove")return i.removed=t,i.newDocument=null,i;if(e.op==="_get")return e.value=t,i;if(r)throw new K("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,e,t);return i}}else{n||(t=se(t));var a=e.path||"",u=a.split("/"),l=t,p=1,m=u.length,y=void 0,h=void 0,b=void 0;for(typeof r=="function"?b=r:b=yo;;){if(h=u[p],h&&h.indexOf("~")!=-1&&(h=ss(h)),s&&(h=="__proto__"||h=="prototype"&&p>0&&u[p-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&y===void 0&&(l[h]===void 0?y=u.slice(0,p).join("/"):p==m-1&&(y=e.path),y!==void 0&&b(e,0,t,y)),p++,Array.isArray(l)){if(h==="-")h=l.length;else{if(r&&!ho(h))throw new K("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);ho(h)&&(h=~~h)}if(p>=m){if(r&&e.op==="add"&&h>l.length)throw new K("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);var i=Hf[e.op].call(e,l,h,t);if(i.test===!1)throw new K("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return i}}else if(p>=m){var i=In[e.op].call(e,l,h,t);if(i.test===!1)throw new K("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return i}if(l=l[h],r&&p<m&&(!l||typeof l!="object"))throw new K("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,e,t)}}}function xn(t,e,r,n,s){if(n===void 0&&(n=!0),s===void 0&&(s=!0),r&&!Array.isArray(e))throw new K("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(t=se(t));for(var o=new Array(e.length),i=0,a=e.length;i<a;i++)o[i]=Zt(t,e[i],r,!0,s,i),t=o[i].newDocument;return o.newDocument=t,o}function Jf(t,e,r){var n=Zt(t,e);if(n.test===!1)throw new K("Test operation failed","TEST_OPERATION_FAILED",r,e,t);return n.newDocument}function yo(t,e,r,n){if(typeof t!="object"||t===null||Array.isArray(t))throw new K("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,r);if(In[t.op]){if(typeof t.path!="string")throw new K("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,r);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new K('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,r);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new K("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new K("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&po(t.value))throw new K("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,r);if(r){if(t.op=="add"){var s=t.path.split("/").length,o=n.split("/").length;if(s!==o+1&&s!==o)throw new K("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,r)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==n)throw new K("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,r)}else if(t.op==="move"||t.op==="copy"){var i={op:"_get",path:t.from,value:void 0},a=Dc([i],r);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new K("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,r)}}}else throw new K("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,r)}function Dc(t,e,r){try{if(!Array.isArray(t))throw new K("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)xn(se(e),se(t),r||!0);else{r=r||yo;for(var n=0;n<t.length;n++)r(t[n],n,e,void 0)}}catch(s){if(s instanceof K)return s;throw s}}function is(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var r=Array.isArray(t),n=Array.isArray(e),s,o,i;if(r&&n){if(o=t.length,o!=e.length)return!1;for(s=o;s--!==0;)if(!is(t[s],e[s]))return!1;return!0}if(r!=n)return!1;var a=Object.keys(t);if(o=a.length,o!==Object.keys(e).length)return!1;for(s=o;s--!==0;)if(!e.hasOwnProperty(a[s]))return!1;for(s=o;s--!==0;)if(i=a[s],!is(t[i],e[i]))return!1;return!0}return t!==t&&e!==e}var ra={};ma(ra,{compare:()=>th,generate:()=>Qi,observe:()=>eh,unobserve:()=>Qf});var ea=new WeakMap,Zf=(function(){function t(e){this.observers=new Map,this.obj=e}return t})(),Vf=(function(){function t(e,r){this.callback=e,this.observer=r}return t})();function Gf(t){return ea.get(t)}function Yf(t,e){return t.observers.get(e)}function Xf(t,e){t.observers.delete(e.callback)}function Qf(t,e){e.unobserve()}function eh(t,e){var r=[],n,s=Gf(t);if(!s)s=new Zf(t),ea.set(t,s);else{var o=Yf(s,e);n=o&&o.observer}if(n)return n;if(n={},s.value=se(t),e){n.callback=e,n.next=null;var i=function(){Qi(n)},a=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return n.patches=r,n.object=t,n.unobserve=function(){Qi(n),clearTimeout(n.next),Xf(s,n),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},s.observers.set(e,new Vf(e,n)),n}function Qi(t,e){e===void 0&&(e=!1);var r=ea.get(t.object);ta(r.value,t.object,t.patches,"",e),t.patches.length&&xn(r.value,t.patches);var n=t.patches;return n.length>0&&(t.patches=[],t.callback&&t.callback(n)),n}function ta(t,e,r,n,s){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var o=fo(e),i=fo(t),a=!1,u=!1,l=i.length-1;l>=0;l--){var p=i[l],m=t[p];if(mo(e,p)&&!(e[p]===void 0&&m!==void 0&&Array.isArray(e)===!1)){var y=e[p];typeof m=="object"&&m!=null&&typeof y=="object"&&y!=null&&Array.isArray(m)===Array.isArray(y)?ta(m,y,r,n+"/"+Re(p),s):m!==y&&(a=!0,s&&r.push({op:"test",path:n+"/"+Re(p),value:se(m)}),r.push({op:"replace",path:n+"/"+Re(p),value:se(y)}))}else Array.isArray(t)===Array.isArray(e)?(s&&r.push({op:"test",path:n+"/"+Re(p),value:se(m)}),r.push({op:"remove",path:n+"/"+Re(p)}),u=!0):(s&&r.push({op:"test",path:n,value:t}),r.push({op:"replace",path:n,value:e}),a=!0)}if(!(!u&&o.length==i.length))for(var l=0;l<o.length;l++){var p=o[l];!mo(t,p)&&e[p]!==void 0&&r.push({op:"add",path:n+"/"+Re(p),value:se(e[p])})}}}function th(t,e,r){r===void 0&&(r=!1);var n=[];return ta(t,e,n,"",r),n}var Oz=Object.assign({},Xi,ra,{JsonPatchError:os,deepClone:se,escapePathComponent:Re,unescapePathComponent:ss});var sh=fa`:host{display:block;height:100%}.margin-lg{margin:var(--calcite-spacing-lg)}.display-flex-row{display:flex;flex-direction:row}.assistant-split-container{display:flex;width:100%;height:calc(100vh - 78px);overflow:hidden;border-radius:10px}.assistant-panel{display:flex;flex-direction:column;height:100%;border:1px solid var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-2);overflow:hidden}.chat-panel{min-width:320px}.builder-panel{min-width:320px;max-width:100%;border-left:1px solid var(--calcite-color-surface-3)}.panel-actions{display:flex;gap:8px;padding:6px;align-items:center}.builder-header,.builder-footer{padding:10px;background:var(--calcite-color-surface-1);border-bottom:1px solid var(--calcite-color-surface-3)}.builder-content{flex:1;overflow:auto;padding:12px}.builder-content pre{white-space:pre-wrap;word-wrap:break-word;max-height:100%;overflow:auto}.builder-actions{display:flex;gap:6px;align-items:center}.padding-left-10{padding-left:10px}.chat-container{display:flex;flex-direction:column;gap:0px;max-width:600px;height:75%;background-color:var(--calcite-color-surface-4);padding:1px}.chat-container_expanded{display:flex;flex-direction:column;gap:0px;max-width:100%;height:95%;background-color:var(--calcite-color-surface-1);border-radius:10px;padding:10px}.chat-panel{--calcite-color-focus: var(--calcite-color-brand);--calcite-panel-border-color: var(--calcite-color-border-2);--calcite-internal-panel-header-vertical-padding: 0px;--calcite-panel-header-content-space: 0px;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);height:100%}.header-content{display:flex;align-items:center;gap:var(--calcite-spacing-sm);height:65px;box-sizing:border-box;padding-inline-start:var(--calcite-space-2xl)}.header-title{font-size:var(--calcite-font-size-md);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.beta-chip{--calcite-chip-corner-radius: var(--calcite-corner-radius-half)}.chat-panel calcite-card,.chat-panel calcite-text-area,.chat-panel calcite-button,.chat-panel .chat-messages,.chat-panel .chat-input{--calcite-color-focus: var(--calcite-color-brand)}.assistant-followup-chip:focus{outline:2px solid var(--calcite-color-brand)}.chat-panel-heading{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-surface-1, var(--calcite-color-text-1))}.chat-messages{display:flex;flex-direction:column;gap:20px;padding:4px;height:100%;overflow-y:auto}.user-message{align-self:flex-end;background:var(--calcite-color-brand);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-brand);--calcite-card-border-color: var(--calcite-color-brand);color:var(--calcite-color-text-inverse);text-align:left}.system-message{align-self:flex-start;background:var(--calcite-color-surface-3);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4);color:var(--calcite-color-inverse);text-align:left}.loader-message{align-self:flex-start;background:var(--calcite-color-surface-4);border-radius:8px;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4)}.message-content{padding:0;font-size:14px}.response-message.message-content>p:first-of-type{margin-top:0}.message-content img{max-width:100%;height:auto;display:block;object-fit:contain}.message-content-pad{padding-bottom:10px;font-size:14px}.message-content-summary{padding-bottom:14px}.message-content-alignment{display:flex;align-items:center;gap:var(--calcite-spacing-md);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1)}.padding-top-10{padding-top:10px}.padding-right-8{padding-right:8px}.padding-left-right-5{padding-right:5px;padding-left:5px}.chip-content{padding:5px 5px 5px 0}.chat-input{display:flex;flex-direction:row;flex-grow:1}.table-cell{--calcite-table-cell-background: var(--calcite-color-surface-4)}.cursor-pointer{cursor:pointer}.notice-border-color{--temp-initial-brand: var(--calcite-color-brand)}.notice-border-color calcite-notice{--calcite-color-brand: #ddd;--calcite-icon-color: var(--temp-initial-brand)}.notice-border-color calcite-notice *{--calcite-color-brand: var(--temp-initial-brand)}.solution-card{padding:5px 0;text-decoration:none;display:block;width:100%;cursor:pointer}.solution-card calcite-card{display:flex;flex-direction:column;max-width:520px;overflow:hidden;--calcite-card-corner-radius: var(--calcite-corner-radius-round) !important;--calcite-card-shadow: var(--calcite-shadow-sm);--calcite-card-background-color: var(--calcite-card-background-color) }.solution-card div[slot=thumbnail]{max-height:100%;width:100%;position:relative;&:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;transition:all .15s ease-in-out}}.solution-card div[slot=thumbnail] img{max-height:100%;width:100%;object-fit:cover}.solution-card span[slot=description]{padding-top:10px}.solution-card calcite-chip{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);visibility:hidden;pointer-events:none;opacity:0;transition:all .15s ease-in-out;z-index:9999}.solution-card:hover calcite-chip{visibility:visible;opacity:1}.solution-card:hover div[slot=thumbnail]:after{background-color:#00000080}.solution-card:hover h3{text-decoration:underline}.solution-card:focus{outline:2px solid var(--calcite-color-brand)}.references-container{padding-top:10px;display:block}.references-container.collapsed{display:none}.width-100{width:100%}.disclaimer-div{display:flex;align-items:center;gap:var(--calcite-spacing-sm);font-size:var(--calcite-font-size--0);color:var(--calcite-color-text-1)}.display-none{display:none}.chat-messages calcite-fab{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:999}.icon-color-background{--calcite-button-icon-color: var(--calcite-color-surface-1)}#closeAssistantButton{--calcite-action-text-color: var(--calcite-color-text-1)}.icon-color-background:focus{--calcite-color-focus: var(--calcite-color-surface-1)}@media(max-width:430px){.solution-card .solution-snippet{display:none}}.height-32-flex-auto{height:32px;flex:0 0 auto}.margin-top-0.message-content>p:first-of-type{margin-top:0}a:not(.solution-card){color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:not(.solution-card):hover{background-size:100% 1px,100% 1px}a:not(.solution-card):focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:not(.solution-card):active{color:var(--calcite-color-brand-press)}`;async function xe(t,e){let r=Object.entries(t).find(([n])=>n.endsWith(`/${e}.md`));if(!r)throw new Error(`Prompt not found: ${e}
78
78
  Available prompts:
79
79
  ${Object.keys(t).join(`
80
- `)}`);return await r[1]()}function Io(t){return t?.configurable?.context?.translations}function Uc(t){if(typeof window>"u"||t.length<=1)return;let e=t.map(n=>n.solution.id),r=t.map(n=>n.solution.title);window.dispatchEvent(new CustomEvent("searchTermSet",{detail:{scope:"all-solutions",searchTerm:""}})),window.dispatchEvent(new CustomEvent("solutionMatchesFromAssistant",{detail:{solutionIds:e,solutionTitles:r},bubbles:!0,composed:!0})),window.dispatchEvent(new CustomEvent("navTabSelected",{detail:{tabType:"all-solutions"}}))}function Fc(t){if(typeof window>"u"||!t)return;let e=new CustomEvent("solutionIDFromAssistant",{detail:t,bubbles:!0,composed:!0});window.dispatchEvent(e)}var oh=Object.assign({"./prompts/solutions_explorer_description.md":()=>import("./MZXUUA7G.js").then(t=>t.default)});function ih(t){return t.replace(/<sup>\[\[(\d+)\]\]\(([^)]+)\)<\/sup>/g,'<sup><a href="$2">&#91;$1&#93;</a></sup>')}function ah(t,e){let r=[];return(e?.configurable?.context?.configContext.allCards??[]).forEach(n=>{let s=n.title;if(t.toLowerCase().includes(s.toLowerCase())){let o=`<a href="" target="solutionId:${n.deployCommonId}">${s}</a>`,i=new RegExp(s,"gi");t=t.replace(i,o),r.push({solution:{title:n.title,id:n.deployCommonId,snippet:n.snippet,description:n.description},score:100})}}),{source:t,allMatches:r}}function lh(t){return t&&t.helperServices.aiAssistantServices?`${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/chat`:null}function Bc(t){return t&&t.helperServices.aiAssistantServices?`${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat`:null}async function sa(t,e,r){let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",token:r},body:JSON.stringify(t)});if(!n.ok)throw new Error(`HTTP ${n.status} calling ${e}`);return n.json()}var uh=t=>new Promise(e=>setTimeout(e,t)),ch=z.Root({...co(),solutionResponse:z({reducer:(t,e)=>e??null,default:()=>null}),documentSkillUrl:z({reducer:(t,e)=>e??null,default:()=>null}),conversationId:z({reducer:(t,e)=>e??t,default:()=>null})}),ph=()=>new Qt(ch).addNode("initializeAgent",mh).addNode("askSolutionsQuestions",dh).addEdge(Yt,"initializeAgent").addEdge("initializeAgent","askSolutionsQuestions").addEdge("askSolutionsQuestions",ce),Kc=async(t,e,r,n)=>{if(!t)return;let s=Bc(t);if(!s)return;let o={context:{kind:"DocAIAssistantRequest",filters:{products:"ArcGIS Solutions",persona:{persona:"apps-solutions"},pipeline:{translation:{allow:!0,language:r,use_llm:!1}}}}};n&&(o.conversationId=n),sa(o,s,e??"")},dh=async(t,e)=>{let r=Io(e),n=t.documentSkillUrl,s=[];await Me({text:r.agentProgress.explorerAgentSearching},e);let o=await sa({message:t.agentExecutionContext.userRequest,conversationId:e?.configurable?.context?.convoId??void 0,context:{kind:"DocAIAssistantRequest",filters:{products:"ArcGIS Solutions",persona:{persona:"apps-solutions"},pipeline:{translation:{allow:!0,language:e?.configurable?.context?.configContext.locale??"en",use_llm:!1}}}}},n,e?.configurable?.context?.token??"");o.conversationId&&e?.configurable?.context?.setConversationId&&e.configurable.context.setConversationId(o.conversationId);let i={message:o.message,conversationId:o.conversationId,hasMore:o.hasMore,ackSequenceNumber:o.sequenceNumber,inquiryId:o.inquiryId},a="",u=async l=>{let p=l.context?.results?.[0]?.reply??"";if(p!==""){let y=ih(p),h=ah(y,e);a=h.source,s=[...s,...h.allMatches.filter(b=>!s.some(I=>I.solution.id===b.solution.id))]}let m=l.context?.results?.[0]?.status?.currentStatusStep;if(m){let y="";m===1?y=r.agentProgress.explorerAgentReading:m===2?y=r.agentProgress.explorerAgentReviewing:m===3&&(y=r.agentProgress.explorerAgentPreparing),await Me({text:y},e)}};for(await u(o);i.hasMore;)await uh(500),o=await sa({conversationId:i.conversationId,ackSequenceNumber:i.ackSequenceNumber,inquiryId:i.inquiryId},n,e?.configurable?.context?.token??""),i={message:o.message,conversationId:o.conversationId,hasMore:o.hasMore,ackSequenceNumber:o.sequenceNumber,inquiryId:o.inquiryId},await u(o);return Bc(e?.configurable?.context.portal)&&Kc(e?.configurable?.context.portal,e?.configurable?.context.token??"",e?.configurable?.context.configContext.locale??"en",i.conversationId),s.length&&(s.length===1?Fc(s[0].solution.id):Uc(s)),{outputMessage:a,summary:a,status:"success",solutionResponse:i,conversationId:i.conversationId}},mh=async(t,e)=>{let r=null;return t.documentSkillUrl===null&&e?.configurable?.context?.portal&&(r=lh(e.configurable.context.portal)),{documentSkillUrl:r}};await xe(oh,"solutions_explorer_description");var qc=t=>{if(t&&Array.isArray(t.id)&&t.id.length>0)return t.id[t.id.length-1].replace("Message","").toLowerCase();if(t&&typeof t._getType=="function")try{return t._getType()}catch{return"human"}return"human"},fh=t=>{let e=qc(t);if(t&&t.kwargs)return{role:e,...t.kwargs};if(t&&typeof t=="object"){let r={role:e,content:typeof t.content=="string"?t.content:String(t.content||"")};return t.id&&(r.id=t.id),t.name&&(r.name=t.name),t.additional_kwargs&&(r.additional_kwargs=t.additional_kwargs),t.response_metadata&&(r.response_metadata=t.response_metadata),r}return{role:"human",content:String(t)}},hh=t=>qc(t)==="human",gh=(t,e=3)=>t.filter(r=>hh(r)).slice(-e).map(fh),yh=(t,e=" ")=>gh(t).map(r=>r.content).join(e).trim(),_h={understandingRequest:"Understanding your request...",selectTemplatePrompt:"This use case could be supported in a few different ways. Choose the option that best matches what you want to accomplish.",searchingExistingSolutions:"Searching for existing solutions...",existingSolutionMatch:"I found one or more existing solutions that match your use case. These are ready-to-use solutions that may already meet your needs and can be deployed now. Do you want to continue building your own solution?",continueBuildingYes:"Yes, I want to build a new solution",continueBuildingNo:"No, I\u2019ll review existing solutions",continueBuildingDeclined:"Sounds good. We can focus on existing solutions. Let me know if I can help answer any questions or provide more details.",creatingDesign:"Generating solution design...",updatingDesign:"Updating solution design...",applyChangeFailed:"I wasn't able to apply that change. The design was not modified. Please try rephrasing your request.",createDesignFailed:"I wasn't able to create a solution design from that request. Please try rephrasing and try again.",discardMessage:"Are you sure you want to discard your solution?",discardForNewSolution:"I can help you build a new solution, but I will need to discard your current solution design. Do you want to continue?"},wh={builderMessages:_h},Ah=new Set(["add","all","alter","and","any","as","asc","backup","between","by","case","check","column","constraint","create","database","date","default","delete","desc","distinct","drop","exec","exists","foreign","from","full","group","having","in","index","inner","insert","into","is","join","key","left","like","limit","not","null","on","or","order","outer","primary","procedure","right","rownum","select","set","shape","subtype","table","top","truncate","union","unique","update","values","view","where"]),bo=class{constructor(e,r,n=!0){this.isValid=!0,this.issues=[],this.fieldNameRegistry=null,this.response=e,this.template=r,this.newDesign=n,this.validate()}validate(){this.compareModels(),this.validateResponse()}compareModels(){this.compareStrings(),this.compareItems(),this.compareFeatureLayers()}compareStrings(){let e=new Set(this.template.solution.strings.map(n=>n.key)),r=new Set(this.response.solution.strings.map(n=>n.key));e.size===r.size&&[...e].every(n=>r.has(n))||this.logIssue("String keys in llm response do not match the template.");for(let n of this.response.solution.strings)n.value||this.logIssue(`String key '${n.key}' has no value in the design. It must be populated.`)}compareItems(){let e=new Set(this.template.items.map(n=>n.id)),r=new Set(this.response.items.map(n=>n.id));e.size===r.size&&[...e].every(n=>r.has(n))||this.logIssue("Item IDs in design do not match the template.")}compareFeatureLayers(){let e=this.template.featureLayer,r=this.response.featureLayer;if(e.itemId!==r.itemId){this.logIssue(`Feature Layer itemId '${r.itemId}' does not match template '${e.itemId}'.`);return}if(!e.addLayers){let n=new Set(e.layers.map(o=>o.id)),s=new Set(r.layers.map(o=>o.id));if(!(n.size===s.size&&[...n].every(o=>s.has(o))))this.logIssue(`Feature Layer '${e.itemId}' had its layer ids altered.`);else for(let o of e.layers)if(o.type){let i=r.layers.find(a=>a.id===o.id);i&&i.type!==o.type&&this.logIssue(`Layer '${o.id}' type '${i.type}' does not match template type '${o.type}'. This layer type is immutable.`)}}}validateResponse(){let e=new Set(["Feature Layer (hosted)","Feature Layer (hosted, view)"]);for(let s of this.response.items)e.has(s.type)&&s.title.length>100&&this.logIssue(`Service name '${s.title}' exceeds 100 characters.`);let r=this.template.featureLayer.layers;this.response.featureLayer.layers.length||this.logIssue("Feature layer item must contain at least one layer.");let n=this.response.featureLayer.layers.map(s=>s.name.toLowerCase());n.length!==new Set(n).size&&this.logIssue(`Layer names must be unique (case-insensitive). Layer names in design: ${n}.`);for(let s of this.response.featureLayer.layers){this.validateLayer(s,this.response.featureLayer.addLayers);let o=r.find(i=>i.id===s.id);o&&this.validateRequiredFields(s,o)}}validateRequiredFields(e,r){let n=new Set(e.requiredFields.map(s=>s.name));for(let s of r.requiredFields)n.has(s.name)||this.logIssue(`Layer '${e.name}' is missing required field '${s.name}'.`)}validateLayer(e,r){!r&&e.typeMutable===!0&&e.type==="Table"&&this.logIssue(`Layer '${e.name}' cannot be a Table. It may be a Point, Line, or Polygon.`),this.validateLayerFields(e)}validateLayerFields(e){let r=new Set(["objectid","globalid","created_date","created_user","last_edited_date","last_edited_user"]),n=e.customFields.map(l=>l.name),s=new Set(e.requiredFields.map(l=>l.name)),o=[...new Set(n.filter(l=>r.has(l)))];for(let l of o)this.logIssue(`Layer '${e.name}' field '${l}' collides with a reserved system field name.`);let i=[...new Set(n.filter(l=>s.has(l)))];for(let l of i)this.logIssue(`Layer '${e.name}' field '${l}' collides with a required field name.`);if(!o.length&&!i.length){let l=e.systemFields??[],p=[...e.customFields,...e.requiredFields,...l].map(m=>m.name);p.length!==new Set(p).size&&this.logIssue(`Layer '${e.name}' has duplicate fields: ${JSON.stringify(p)}.`)}let a=e.systemFields??[],u=[...e.customFields,...e.requiredFields,...a].map(l=>l.name.toLowerCase());this.fieldNameRegistry=new Set(u);for(let l of[...e.customFields,...e.requiredFields])this.validateField(l);this.fieldNameRegistry=null}getUniqueTruncatedFieldName(e){let r=this.fieldNameRegistry;if(!r)return e.slice(0,31);let n=e.toLowerCase();r.delete(n);let s=e.slice(0,31),o=s,i=1;for(;r.has(o.toLowerCase());){let a=`_${i}`,u=Math.max(1,31-a.length);o=`${s.slice(0,u)}${a}`,i+=1}return r.add(o.toLowerCase()),o}validateField(e){let r=/^\p{L}/u,n=/^.[\p{L}\p{M}\p{N}_]*$/u;if(e.alias||this.logIssue(`Field '${e.name}' has no display name (alias).`),r.test(e.name)||this.logIssue(`Field '${e.name}' does not start with a letter.`),n.test(e.name)||this.logIssue(`Field '${e.name}' contains invalid characters (only letters from any writing system, numbers, and underscores are allowed; emojis and punctuation are not allowed).`),e.name.length>31)if(this.newDesign){let s=e.name;e.name=this.getUniqueTruncatedFieldName(e.name),console.debug(`Field '${s}' exceeds 31 characters. Auto-fixing to '${e.name}'.`)}else this.logIssue(`Field '${e.name}' exceeds 31 characters.`);if(Ah.has(e.name.toLowerCase())&&this.logIssue(`Field '${e.name}' is a SQL reserved keyword.`),e.choiceList&&(e.type!=="string"&&this.logIssue(`Field '${e.name}' must be of type 'string' to have a domain.`),e.choiceList.some(s=>!s)&&this.logIssue(`Field '${e.name}' has empty domain values.`),e.choiceList.length!==new Set(e.choiceList).size&&this.logIssue(`Field '${e.name}' has duplicate domain values.`),e.length!=null)){let s=Math.max(...e.choiceList.map(o=>o.length));s>e.length&&(this.newDesign?(console.debug(`Field '${e.name}' length ${e.length} is insufficient for choiceList value of length ${s}. Auto-fixing to ${s}.`),e.length=s):this.logIssue(`Field '${e.name}' length ${e.length} is insufficient for choiceList value of length ${s}.`))}}logIssue(e){console.debug(e),this.issues.push(e),this.isValid=!1}},bh=v.object({key:v.string().describe("Stable key identifier for the string."),value:v.string().describe("Display value for the string."),description:v.string().describe("Explanation of where/how the string is used.")}),Ih=v.object({id:v.string().describe("ArcGIS item id (32 hex characters)."),title:v.string().describe("Item title."),description:v.string().describe("Item description."),type:v.enum(["Feature Layer (hosted)","Feature Layer (hosted, view)","Web Map","Instant App","Dashboard","Web Experience","Form","Table (hosted)","Table (hosted, view)","Hub Site Application","Hub Page","CSV","Data Pipeline","Desktop Application Template","Group","Notebook","QuickCapture Project"]).describe("ArcGIS item type.")}),zc=v.object({name:v.string().describe("Field name."),type:v.enum(["string","integer","double","date","oid","guid","globalid"]).describe("Field data type."),alias:v.string().describe("Field alias for display."),description:v.string().describe("Field description."),choiceList:v.array(v.string()).nullable().describe("List of allowed values for string fields with a controlled vocabulary. Null if unrestricted or not applicable."),length:v.number().int().nullable().describe("Maximum string length for string fields. Null for non-string fields.")}),xh=v.object({id:v.number().int().describe("Layer/table id within the feature service."),type:v.enum(["Point","Polyline","Polygon","Table"]).describe("Layer type."),typeMutable:v.boolean().describe("Indicates whether the layer type can be changed."),name:v.string().describe("Layer/table name."),description:v.string().describe("Layer/table description."),customFields:v.array(zc).describe("User/business fields specific to the solution."),requiredFields:v.array(zc).describe("Fields required for solution functionality (e.g., relationship keys).")}),vh=v.object({itemId:v.string().describe("ArcGIS item id for the feature layer."),addLayers:v.boolean().describe("Indicates whether new layers can be added during solution design."),layers:v.array(xh)}),ia=v.object({response:v.string().describe("Conversational response to the user's query."),solution:v.object({itemId:v.string().nullable().describe("ArcGIS item id of the source Solution template used for deployment. Preserve the existing value exactly when known; otherwise use null."),title:v.string().describe("Title of the solution."),description:v.string().describe("Description of the solution."),tags:v.array(v.string()).describe("Keywords/tags associated with the solution."),strings:v.array(bh).describe("Localized strings/labels used by apps (dashboards, forms, etc.).")}),items:v.array(Ih).describe("ArcGIS items that belong to the solution (apps, maps, layers, etc.)."),featureLayer:vh.describe("Primary feature layer item and its schema/layers/tables details.")}),Th=v.object({op:v.enum(["add","remove","replace","move","copy"]).describe("RFC 6902 operation type."),path:v.string().describe("RFC 6901 JSON Pointer to the target location."),value:v.string().nullable().describe(`JSON-encoded value to apply (required for add and replace). Must be null \u2014 not an empty string \u2014 for remove, move, and copy operations. Serialize as a JSON string, e.g. '\\"text\\"' for a string, '[\\"a\\",\\"b\\"]' for an array, or '{\\"name\\":\\"x\\"}' for an object.`),from:v.string().nullable().describe("RFC 6901 JSON Pointer to the source location (required for move and copy). Must be null \u2014 not an empty string \u2014 for all other operations.")}),Ch=v.object({response:v.string().describe("Conversational response describing the accepted design changes."),patches:v.array(Th).describe("Minimal RFC 6902 patch operations needed to update the current design.")}),Ph=v.object({response:v.string().describe("Short, user-friendly explanation of why the requested update was not applied.")}),Oh=v.object({assistantResponse:v.string().describe("Natural-language response for the user."),isValidUpdate:v.boolean().describe("True only when the request is in scope for supported design updates.")}),kh=v.object({matchedTitles:v.array(v.string()).describe("Titles of solutions that match the user's request. Empty array if no strong match.")}),Sh=v.object({templateId:v.string().min(1).describe("Template id from the available template list."),confidence:v.number().min(0).max(1).describe("Confidence score from 0 to 1 for this template match."),templateDescription:v.string().min(1).describe("Short action\u2011oriented description of the template in the user's use case/workflow, starting with a verb.")}),Eh=v.object({assistantResponse:v.string().nullable().describe("Natural-language response for the user."),isValidUseCase:v.boolean().describe("True only when the request is concrete, appropriate, and has at least one matching template."),matchedTemplates:v.array(Sh).describe("Ordered list of matching templates, best match first. Empty when no valid match exists."),rationale:v.string().min(1).describe("A brief rationale for the choice for isValidUseCase and matchedTemplates (\u2264140 characters)")}),Mh=t=>t.length?t.map((e,r)=>`${r+1}. ${e}`).join(`
80
+ `)}`);return await r[1]()}function Io(t){return t?.configurable?.context?.translations}function Uc(t){if(typeof window>"u"||t.length<=1)return;let e=t.map(n=>n.solution.id),r=t.map(n=>n.solution.title);window.dispatchEvent(new CustomEvent("searchTermSet",{detail:{scope:"all-solutions",searchTerm:""}})),window.dispatchEvent(new CustomEvent("solutionMatchesFromAssistant",{detail:{solutionIds:e,solutionTitles:r},bubbles:!0,composed:!0})),window.dispatchEvent(new CustomEvent("navTabSelected",{detail:{tabType:"all-solutions"}}))}function Fc(t){if(typeof window>"u"||!t)return;let e=new CustomEvent("solutionIDFromAssistant",{detail:t,bubbles:!0,composed:!0});window.dispatchEvent(e)}var oh=Object.assign({"./prompts/solutions_explorer_description.md":()=>import("./MZXUUA7G.js").then(t=>t.default)});function ih(t){return t.replace(/<sup>\[\[(\d+)\]\]\(([^)]+)\)<\/sup>/g,'<sup><a href="$2">&#91;$1&#93;</a></sup>')}function ah(t,e){let r=[];return(e?.configurable?.context?.configContext.allCards??[]).forEach(n=>{let s=n.title;if(!s)return;let o=new RegExp(`(?<![\\p{L}\\p{N}])${s}(?![\\p{L}\\p{N}])`,"giu"),i=!1;t=t.replace(o,()=>(i=!0,`<a href="" target="solutionId:${n.deployCommonId}">${s}</a>`)),i&&r.push({solution:{title:n.title,id:n.deployCommonId,snippet:n.snippet,description:n.description},score:100})}),{source:t,allMatches:r}}function lh(t){return t&&t.helperServices.aiAssistantServices?`${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/chat`:null}function Bc(t){return t&&t.helperServices.aiAssistantServices?`${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat`:null}async function sa(t,e,r){let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",token:r},body:JSON.stringify(t)});if(!n.ok)throw new Error(`HTTP ${n.status} calling ${e}`);return n.json()}var uh=t=>new Promise(e=>setTimeout(e,t)),ch=z.Root({...co(),solutionResponse:z({reducer:(t,e)=>e??null,default:()=>null}),documentSkillUrl:z({reducer:(t,e)=>e??null,default:()=>null}),conversationId:z({reducer:(t,e)=>e??t,default:()=>null})}),ph=()=>new Qt(ch).addNode("initializeAgent",mh).addNode("askSolutionsQuestions",dh).addEdge(Yt,"initializeAgent").addEdge("initializeAgent","askSolutionsQuestions").addEdge("askSolutionsQuestions",ce),Kc=async(t,e,r,n)=>{if(!t)return;let s=Bc(t);if(!s)return;let o={context:{kind:"DocAIAssistantRequest",filters:{products:"ArcGIS Solutions",persona:{persona:"apps-solutions"},pipeline:{translation:{allow:!0,language:r,use_llm:!1}}}}};n&&(o.conversationId=n),sa(o,s,e??"")},dh=async(t,e)=>{let r=Io(e),n=t.documentSkillUrl,s=[];await Me({text:r.agentProgress.explorerAgentSearching},e);let o=await sa({message:t.agentExecutionContext.userRequest,conversationId:e?.configurable?.context?.convoId??void 0,context:{kind:"DocAIAssistantRequest",filters:{products:"ArcGIS Solutions",persona:{persona:"apps-solutions"},pipeline:{translation:{allow:!0,language:e?.configurable?.context?.configContext.locale??"en",use_llm:!1}}}}},n,e?.configurable?.context?.token??"");o.conversationId&&e?.configurable?.context?.setConversationId&&e.configurable.context.setConversationId(o.conversationId);let i={message:o.message,conversationId:o.conversationId,hasMore:o.hasMore,ackSequenceNumber:o.sequenceNumber,inquiryId:o.inquiryId},a="",u=async l=>{let p=l.context?.results?.[0]?.reply??"";if(p!==""){let y=ih(p),h=ah(y,e);a=h.source,s=[...s,...h.allMatches.filter(b=>!s.some(I=>I.solution.id===b.solution.id))]}let m=l.context?.results?.[0]?.status?.currentStatusStep;if(m){let y="";m===1?y=r.agentProgress.explorerAgentReading:m===2?y=r.agentProgress.explorerAgentReviewing:m===3&&(y=r.agentProgress.explorerAgentPreparing),await Me({text:y},e)}};for(await u(o);i.hasMore;)await uh(500),o=await sa({conversationId:i.conversationId,ackSequenceNumber:i.ackSequenceNumber,inquiryId:i.inquiryId},n,e?.configurable?.context?.token??""),i={message:o.message,conversationId:o.conversationId,hasMore:o.hasMore,ackSequenceNumber:o.sequenceNumber,inquiryId:o.inquiryId},await u(o);return Bc(e?.configurable?.context.portal)&&Kc(e?.configurable?.context.portal,e?.configurable?.context.token??"",e?.configurable?.context.configContext.locale??"en",i.conversationId),s.length&&(s.length===1?Fc(s[0].solution.id):Uc(s)),{outputMessage:a,summary:a,status:"success",solutionResponse:i,conversationId:i.conversationId}},mh=async(t,e)=>{let r=null;return t.documentSkillUrl===null&&e?.configurable?.context?.portal&&(r=lh(e.configurable.context.portal)),{documentSkillUrl:r}};await xe(oh,"solutions_explorer_description");var qc=t=>{if(t&&Array.isArray(t.id)&&t.id.length>0)return t.id[t.id.length-1].replace("Message","").toLowerCase();if(t&&typeof t._getType=="function")try{return t._getType()}catch{return"human"}return"human"},fh=t=>{let e=qc(t);if(t&&t.kwargs)return{role:e,...t.kwargs};if(t&&typeof t=="object"){let r={role:e,content:typeof t.content=="string"?t.content:String(t.content||"")};return t.id&&(r.id=t.id),t.name&&(r.name=t.name),t.additional_kwargs&&(r.additional_kwargs=t.additional_kwargs),t.response_metadata&&(r.response_metadata=t.response_metadata),r}return{role:"human",content:String(t)}},hh=t=>qc(t)==="human",gh=(t,e=3)=>t.filter(r=>hh(r)).slice(-e).map(fh),yh=(t,e=" ")=>gh(t).map(r=>r.content).join(e).trim(),_h={understandingRequest:"Understanding your request...",selectTemplatePrompt:"This use case could be supported in a few different ways. Choose the option that best matches what you want to accomplish.",searchingExistingSolutions:"Searching for existing solutions...",existingSolutionMatch:"I found one or more existing solutions that match your use case. These are ready-to-use solutions that may already meet your needs and can be deployed now. Do you want to continue building your own solution?",continueBuildingYes:"Yes, I want to build a new solution",continueBuildingNo:"No, I\u2019ll review existing solutions",continueBuildingDeclined:"Sounds good. We can focus on existing solutions. Let me know if I can help answer any questions or provide more details.",creatingDesign:"Generating solution design...",updatingDesign:"Updating solution design...",applyChangeFailed:"I wasn't able to apply that change. The design was not modified. Please try rephrasing your request.",createDesignFailed:"I wasn't able to create a solution design from that request. Please try rephrasing and try again.",discardMessage:"Are you sure you want to discard your solution?",discardForNewSolution:"I can help you build a new solution, but I will need to discard your current solution design. Do you want to continue?"},wh={builderMessages:_h},Ah=new Set(["add","all","alter","and","any","as","asc","backup","between","by","case","check","column","constraint","create","database","date","default","delete","desc","distinct","drop","exec","exists","foreign","from","full","group","having","in","index","inner","insert","into","is","join","key","left","like","limit","not","null","on","or","order","outer","primary","procedure","right","rownum","select","set","shape","subtype","table","top","truncate","union","unique","update","values","view","where"]),bo=class{constructor(e,r,n=!0){this.isValid=!0,this.issues=[],this.fieldNameRegistry=null,this.response=e,this.template=r,this.newDesign=n,this.validate()}validate(){this.compareModels(),this.validateResponse()}compareModels(){this.compareStrings(),this.compareItems(),this.compareFeatureLayers()}compareStrings(){let e=new Set(this.template.solution.strings.map(n=>n.key)),r=new Set(this.response.solution.strings.map(n=>n.key));e.size===r.size&&[...e].every(n=>r.has(n))||this.logIssue("String keys in llm response do not match the template.");for(let n of this.response.solution.strings)n.value||this.logIssue(`String key '${n.key}' has no value in the design. It must be populated.`)}compareItems(){let e=new Set(this.template.items.map(n=>n.id)),r=new Set(this.response.items.map(n=>n.id));e.size===r.size&&[...e].every(n=>r.has(n))||this.logIssue("Item IDs in design do not match the template.")}compareFeatureLayers(){let e=this.template.featureLayer,r=this.response.featureLayer;if(e.itemId!==r.itemId){this.logIssue(`Feature Layer itemId '${r.itemId}' does not match template '${e.itemId}'.`);return}if(!e.addLayers){let n=new Set(e.layers.map(o=>o.id)),s=new Set(r.layers.map(o=>o.id));if(!(n.size===s.size&&[...n].every(o=>s.has(o))))this.logIssue(`Feature Layer '${e.itemId}' had its layer ids altered.`);else for(let o of e.layers)if(o.type){let i=r.layers.find(a=>a.id===o.id);i&&i.type!==o.type&&this.logIssue(`Layer '${o.id}' type '${i.type}' does not match template type '${o.type}'. This layer type is immutable.`)}}}validateResponse(){let e=new Set(["Feature Layer (hosted)","Feature Layer (hosted, view)"]);for(let s of this.response.items)e.has(s.type)&&s.title.length>100&&this.logIssue(`Service name '${s.title}' exceeds 100 characters.`);let r=this.template.featureLayer.layers;this.response.featureLayer.layers.length||this.logIssue("Feature layer item must contain at least one layer.");let n=this.response.featureLayer.layers.map(s=>s.name.toLowerCase());n.length!==new Set(n).size&&this.logIssue(`Layer names must be unique (case-insensitive). Layer names in design: ${n}.`);for(let s of this.response.featureLayer.layers){this.validateLayer(s,this.response.featureLayer.addLayers);let o=r.find(i=>i.id===s.id);o&&this.validateRequiredFields(s,o)}}validateRequiredFields(e,r){let n=new Set(e.requiredFields.map(s=>s.name));for(let s of r.requiredFields)n.has(s.name)||this.logIssue(`Layer '${e.name}' is missing required field '${s.name}'.`)}validateLayer(e,r){!r&&e.typeMutable===!0&&e.type==="Table"&&this.logIssue(`Layer '${e.name}' cannot be a Table. It may be a Point, Line, or Polygon.`),this.validateLayerFields(e)}validateLayerFields(e){let r=new Set(["objectid","globalid","created_date","created_user","last_edited_date","last_edited_user"]),n=e.customFields.map(l=>l.name),s=new Set(e.requiredFields.map(l=>l.name)),o=[...new Set(n.filter(l=>r.has(l)))];for(let l of o)this.logIssue(`Layer '${e.name}' field '${l}' collides with a reserved system field name.`);let i=[...new Set(n.filter(l=>s.has(l)))];for(let l of i)this.logIssue(`Layer '${e.name}' field '${l}' collides with a required field name.`);if(!o.length&&!i.length){let l=e.systemFields??[],p=[...e.customFields,...e.requiredFields,...l].map(m=>m.name);p.length!==new Set(p).size&&this.logIssue(`Layer '${e.name}' has duplicate fields: ${JSON.stringify(p)}.`)}let a=e.systemFields??[],u=[...e.customFields,...e.requiredFields,...a].map(l=>l.name.toLowerCase());this.fieldNameRegistry=new Set(u);for(let l of[...e.customFields,...e.requiredFields])this.validateField(l);this.fieldNameRegistry=null}getUniqueTruncatedFieldName(e){let r=this.fieldNameRegistry;if(!r)return e.slice(0,31);let n=e.toLowerCase();r.delete(n);let s=e.slice(0,31),o=s,i=1;for(;r.has(o.toLowerCase());){let a=`_${i}`,u=Math.max(1,31-a.length);o=`${s.slice(0,u)}${a}`,i+=1}return r.add(o.toLowerCase()),o}validateField(e){let r=/^\p{L}/u,n=/^.[\p{L}\p{M}\p{N}_]*$/u;if(e.alias||this.logIssue(`Field '${e.name}' has no display name (alias).`),r.test(e.name)||this.logIssue(`Field '${e.name}' does not start with a letter.`),n.test(e.name)||this.logIssue(`Field '${e.name}' contains invalid characters (only letters from any writing system, numbers, and underscores are allowed; emojis and punctuation are not allowed).`),e.name.length>31)if(this.newDesign){let s=e.name;e.name=this.getUniqueTruncatedFieldName(e.name),console.debug(`Field '${s}' exceeds 31 characters. Auto-fixing to '${e.name}'.`)}else this.logIssue(`Field '${e.name}' exceeds 31 characters.`);if(Ah.has(e.name.toLowerCase())&&this.logIssue(`Field '${e.name}' is a SQL reserved keyword.`),e.choiceList&&(e.type!=="string"&&this.logIssue(`Field '${e.name}' must be of type 'string' to have a domain.`),e.choiceList.some(s=>!s)&&this.logIssue(`Field '${e.name}' has empty domain values.`),e.choiceList.length!==new Set(e.choiceList).size&&this.logIssue(`Field '${e.name}' has duplicate domain values.`),e.length!=null)){let s=Math.max(...e.choiceList.map(o=>o.length));s>e.length&&(this.newDesign?(console.debug(`Field '${e.name}' length ${e.length} is insufficient for choiceList value of length ${s}. Auto-fixing to ${s}.`),e.length=s):this.logIssue(`Field '${e.name}' length ${e.length} is insufficient for choiceList value of length ${s}.`))}}logIssue(e){console.debug(e),this.issues.push(e),this.isValid=!1}},bh=v.object({key:v.string().describe("Stable key identifier for the string."),value:v.string().describe("Display value for the string."),description:v.string().describe("Explanation of where/how the string is used.")}),Ih=v.object({id:v.string().describe("ArcGIS item id (32 hex characters)."),title:v.string().describe("Item title."),description:v.string().describe("Item description."),type:v.enum(["Feature Layer (hosted)","Feature Layer (hosted, view)","Web Map","Instant App","Dashboard","Web Experience","Form","Table (hosted)","Table (hosted, view)","Hub Site Application","Hub Page","CSV","Data Pipeline","Desktop Application Template","Group","Notebook","QuickCapture Project"]).describe("ArcGIS item type.")}),zc=v.object({name:v.string().describe("Field name."),type:v.enum(["string","integer","double","date","oid","guid","globalid"]).describe("Field data type."),alias:v.string().describe("Field alias for display."),description:v.string().describe("Field description."),choiceList:v.array(v.string()).nullable().describe("List of allowed values for string fields with a controlled vocabulary. Null if unrestricted or not applicable."),length:v.number().int().nullable().describe("Maximum string length for string fields. Null for non-string fields.")}),xh=v.object({id:v.number().int().describe("Layer/table id within the feature service."),type:v.enum(["Point","Polyline","Polygon","Table"]).describe("Layer type."),typeMutable:v.boolean().describe("Indicates whether the layer type can be changed."),name:v.string().describe("Layer/table name."),description:v.string().describe("Layer/table description."),customFields:v.array(zc).describe("User/business fields specific to the solution."),requiredFields:v.array(zc).describe("Fields required for solution functionality (e.g., relationship keys).")}),vh=v.object({itemId:v.string().describe("ArcGIS item id for the feature layer."),addLayers:v.boolean().describe("Indicates whether new layers can be added during solution design."),layers:v.array(xh)}),ia=v.object({response:v.string().describe("Conversational response to the user's query."),solution:v.object({itemId:v.string().nullable().describe("ArcGIS item id of the source Solution template used for deployment. Preserve the existing value exactly when known; otherwise use null."),title:v.string().describe("Title of the solution."),description:v.string().describe("Description of the solution."),tags:v.array(v.string()).describe("Keywords/tags associated with the solution."),strings:v.array(bh).describe("Localized strings/labels used by apps (dashboards, forms, etc.).")}),items:v.array(Ih).describe("ArcGIS items that belong to the solution (apps, maps, layers, etc.)."),featureLayer:vh.describe("Primary feature layer item and its schema/layers/tables details.")}),Th=v.object({op:v.enum(["add","remove","replace","move","copy"]).describe("RFC 6902 operation type."),path:v.string().describe("RFC 6901 JSON Pointer to the target location."),value:v.string().nullable().describe(`JSON-encoded value to apply (required for add and replace). Must be null \u2014 not an empty string \u2014 for remove, move, and copy operations. Serialize as a JSON string, e.g. '\\"text\\"' for a string, '[\\"a\\",\\"b\\"]' for an array, or '{\\"name\\":\\"x\\"}' for an object.`),from:v.string().nullable().describe("RFC 6901 JSON Pointer to the source location (required for move and copy). Must be null \u2014 not an empty string \u2014 for all other operations.")}),Ch=v.object({response:v.string().describe("Conversational response describing the accepted design changes."),patches:v.array(Th).describe("Minimal RFC 6902 patch operations needed to update the current design.")}),Ph=v.object({response:v.string().describe("Short, user-friendly explanation of why the requested update was not applied.")}),Oh=v.object({assistantResponse:v.string().describe("Natural-language response for the user."),isValidUpdate:v.boolean().describe("True only when the request is in scope for supported design updates.")}),kh=v.object({matchedTitles:v.array(v.string()).describe("Titles of solutions that match the user's request. Empty array if no strong match.")}),Sh=v.object({templateId:v.string().min(1).describe("Template id from the available template list."),confidence:v.number().min(0).max(1).describe("Confidence score from 0 to 1 for this template match."),templateDescription:v.string().min(1).describe("Short action\u2011oriented description of the template in the user's use case/workflow, starting with a verb.")}),Eh=v.object({assistantResponse:v.string().nullable().describe("Natural-language response for the user."),isValidUseCase:v.boolean().describe("True only when the request is concrete, appropriate, and has at least one matching template."),matchedTemplates:v.array(Sh).describe("Ordered list of matching templates, best match first. Empty when no valid match exists."),rationale:v.string().min(1).describe("A brief rationale for the choice for isValidUseCase and matchedTemplates (\u2264140 characters)")}),Mh=t=>t.length?t.map((e,r)=>`${r+1}. ${e}`).join(`
81
81
  `):"No validation errors were provided.",Rh=async t=>{let{query:e,validationIssues:r,recentMessages:n,fallbackMessage:s,promptModules:o}=t;try{return(await mt({promptText:await xe(o,"explainValidationFailure"),modelTier:"fast",temperature:0,schema:Ph,messages:n,inputVariables:{query:e,validationIssueCount:String(r.length),validationIssues:Mh(r)}})).response?.trim()||s}catch(i){return console.warn("Natural language response failed:",{error:i}),s}},aa=t=>t in er,Nh=5,$h=.8,Lh=.15,Dh="Web Mapping Application",jh="Embeddings",_o=null,na=null,wo=null,Ao=null,zh="Build",Vt=Object.assign({"./prompts/assessBuildRequest.md":()=>import("./U56TK45K.js").then(t=>t.default),"./prompts/assessUpdateRequest.md":()=>import("./LZDMYPQ2.js").then(t=>t.default),"./prompts/description.md":()=>import("./JDCZUOU6.js").then(t=>t.default),"./prompts/designSolution.md":()=>import("./V3MSUKLX.js").then(t=>t.default),"./prompts/explainValidationFailure.md":()=>import("./MZ73EAAV.js").then(t=>t.default),"./prompts/findExistingSolution.md":()=>import("./PRXFYNIG.js").then(t=>t.default),"./prompts/updateDesign.md":()=>import("./BG4LNU44.js").then(t=>t.default)}),Uh=wh.builderMessages,X=(t,e,r)=>Io(e)?.builderMessages?.[t]??Uh[t],Wc=t=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("arcgis-solution-design-update",{detail:t}))},Fh=async(t,e,r)=>{if(!t)return null;let n=`type:"${Dh}" AND typekeywords:${jh} AND group:${t}`;return(await Oo({q:n,params:e?{token:e}:void 0,portal:r,num:1}))?.results?.[0]??null};async function Bh(t,e,r){try{let n=await Fh(t,e,r);if(!n)return null;let s=new nh({id:n.id});return await s.load(),await s.fetchData("json")}catch{return null}}var Kh=async(t,e,r)=>{if(!t)return[];let n=`type:Solution AND typekeywords:${zh} AND group:${t}`;return(await Oo({q:n,params:e?{token:e}:void 0,portal:r,num:100}))?.results??[]},qh=async(t,e,r)=>{try{let n=await Ca(t,{params:e?{token:e}:void 0,portal:r}),s=n?.buildSolution;if(!s)return null;let o=n?.params,i=o&&typeof o=="object"&&!Array.isArray(o)?o:null;return{buildSolution:s,params:i}}catch{return null}},Gt=(t,e={})=>{let r=t;return"itemId"in e&&(r={...r,solution:{...r.solution,itemId:e.itemId??null}}),e.sourceBuildSolution!=null&&(r={...r,sourceBuildSolution:e.sourceBuildSolution}),"params"in e&&(r={...r,params:e.params??null}),"templateId"in e&&(r={...r,templateId:e.templateId??null}),r},Hc=(t,e)=>{if(t==null||e==null)return{ok:!1,error:"design or sourceBuildSolution is null/undefined"};try{let r=structuredClone(e);return new Uo({buildSolution:r}).applyLlmTemplate(t),{ok:!0}}catch(r){return{ok:!1,error:r instanceof Error?r.stack??r.message:String(r)}}},la=async t=>{if(na){Object.entries(na).forEach(([i,a])=>{er[i]&&(er[i].initialTemplate=a)});return}let e=t?.configurable?.context?.token,r=Zc(t),n=Vc(t);if(!r){console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping live template hydration.");return}let s=await Kh(r,e,n),o={};await Promise.all(s.map(async i=>{let a=i.properties?.templateInfo;if(!a||typeof a!="object")return;let u=a.id;if(typeof u!="string"||o[u])return;let l=await qh(i.id,e,n);if(!l)return;let{buildSolution:p,params:m}=l;if(typeof p=="object"&&p!==null&&"solution"in p){let h=p.solution;h.thumbnailUrl=i.thumbnail?`${n??"https://www.arcgis.com/sharing/rest"}/content/items/${i.id}/info/${i.thumbnail}`:void 0,h.item=i}let y={...a,buildSolution:p};o[u]=Gt(new Uo(y).dumpToLlmTemplate(),{itemId:i.id,sourceBuildSolution:structuredClone(p),params:m?structuredClone(m):null}),er[u]={...a,initialTemplate:o[u]}})),na=o},Jc=t=>{let e=t?.configurable?.context?.token;return typeof e!="string"||!e.trim()?null:e},Zc=t=>{let e=t?.configurable?.context?.configContext?.primarySolutionsGroupId;return typeof e!="string"||!e.trim()?null:e},Vc=t=>{let e=t?.configurable?.context?.configContext?.portalURL;if(!(typeof e!="string"||!e.trim()))return`${e.replace(/\/+$/,"")}/sharing/rest`},Wh=async t=>{await Promise.all([Yc(t),la(t)])},Gc=async t=>{let e=Jc(t);(!wo||e&&e!==Ao)&&(Ao=e??Ao,wo=Wh(t).catch(r=>{throw wo=null,Ao=null,r})),await wo};async function Yc(t){if(_o)return _o;let e=Zc(t);if(!e)return console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping embeddings load."),null;let r=Vc(t),n=t?.configurable?.context?.configContext?.portalURL;await new rh(n?{url:n}:void 0).load();let s=Jc(t)??void 0,o=await Bh(e,s,r);return o?(_o=o.items,_o):null}var Hh=()=>Object.entries(er).map(([t,e])=>`ID: ${t}
82
82
  Label: ${e.label}
83
83
  Description: ${e.description}`).join(`
@@ -87,4 +87,4 @@ Snippet: ${p.snippet}
87
87
  Description: ${p.description}`).join(`
88
88
 
89
89
  `),l=t.agentExecutionContext.messages.slice(-11);return{existingMatches:(await mt({promptText:await xe(Vt,"findExistingSolution"),modelTier:"fast",temperature:0,schema:kh,messages:l,inputVariables:{query:r,candidates:u}})).matchedTitles.map(p=>a.find(({solution:m})=>m.title===p)).filter(p=>p!==void 0)}},rg=(t,e)=>{let{existingMatches:r}=t,{hitlResponse:n}=e.configurable,s=`confirmExistingSolution:${r[0].solution.id}`;if(n?.agentId!=="solutionBuilder"||n.id!==s){r.length===1?Fc(r[0].solution.id):Uc(r);let a=X("existingSolutionMatch",e),u=[X("continueBuildingYes",e),X("continueBuildingNo",e)],l={agentId:"solutionBuilder",id:s,kind:"singleSelection",message:a,metadata:u};throw new ko(l)}let o=String(n.payload??"").trim(),i=X("continueBuildingNo",e);return{continueBuilding:o!==i}},ng=(t,e)=>{let r=X("continueBuildingDeclined",e);return{outputMessage:r,summary:r,status:"success"}},Xc=async(t,e)=>{await Gc(e);let{currentDesign:r}=t,n=t.agentExecutionContext.userRequest;await Me({text:X("creatingDesign",e)},e);let s=Cn(t.selectedTemplate);if(s?.initialTemplate||(await la(e),s=Cn(t.selectedTemplate)),!s?.initialTemplate)throw new Error("No hydrated templates are available for solution design.");let o=Gt(r??s.initialTemplate,{itemId:(r??s.initialTemplate)?.solution?.itemId??null,sourceBuildSolution:r?.sourceBuildSolution??s.initialTemplate.sourceBuildSolution,params:r?.params??s.initialTemplate.params??null}),i=t.agentExecutionContext.messages.slice(-11),a=await mt({promptText:await xe(Vt,"designSolution"),modelTier:"advanced",temperature:0,schema:ia,messages:i,inputVariables:{currentDesign:JSON.stringify(Fo(o)),templateInstructions:s.instructions,query:n}}),{response:u,featureLayer:l,...p}=a,m=Ko(l,o.featureLayer),y=Gt({...p,featureLayer:m},{itemId:o?.solution?.itemId,sourceBuildSolution:o.sourceBuildSolution,templateId:t.selectedTemplate??null,params:o.params??null}),h=new bo(y,s.initialTemplate);if(!h.isValid)return console.warn("[SolutionBuilder] designSolution validation failed:",{issues:h.issues,llmResponse:a}),{outputMessage:X("createDesignFailed",e)};let b=y.sourceBuildSolution,I=Hc(y,b);if(!I.ok){console.warn("[SolutionBuilder] designSolution Esri JSON conversion failed:",{error:I.error,llmResponse:a,design:y});let R=X("createDesignFailed",e);return{outputMessage:R,summary:R,status:"success"}}return Wc(y),{outputMessage:u,summary:u,status:"success",currentDesign:y}},sg=async(t,e)=>{let{currentDesign:r}=t;if(!r)return Xc(t,e);let n=t.agentExecutionContext.userRequest,s=t.agentExecutionContext.messages.slice(-11);await Me({text:X("updatingDesign",e)},e);let o;try{o=await mt({promptText:await xe(Vt,"updateDesign"),modelTier:"advanced",temperature:0,schema:Ch,messages:s,inputVariables:{currentDesign:JSON.stringify(Bo(r)),query:n}})}catch(k){console.warn("[SolutionBuilder] updateDesign structured prompt failed:",k);let D=X("applyChangeFailed",e);return{outputMessage:D,summary:D,status:"success"}}let{response:i,patches:a}=o;if(!a||a.length===0)return{outputMessage:i,summary:i,status:"success"};let u=k=>{try{return JSON.parse(k)}catch{let D=k.replace(/[\u0000-\u001F]/g,U=>{switch(U){case"\b":return"\\b";case"\f":return"\\f";case`
90
- `:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\u"+U.charCodeAt(0).toString(16).padStart(4,"0")}});try{return JSON.parse(D)}catch{return k}}},l=[...a.map(k=>({op:k.op,path:k.path.replace(/\/+$/,""),...k.value!=null&&k.value!==""?{value:u(k.value)}:{},...k.from!=null&&k.from!==""?{from:k.from}:{}}))].sort((k,D)=>k.op!=="remove"||D.op!=="remove"?0:D.path.localeCompare(k.path,void 0,{numeric:!0})),p=structuredClone(Fo(r));try{xn(p,l,!0)}catch(k){console.warn("[SolutionBuilder] updateDesign JSON patch failed:",{error:k,llmResponse:o,patches:l,patchTarget:p});let D=X("applyChangeFailed",e);return{outputMessage:D,summary:D,status:"success"}}let m=Gt({response:"",...p},{itemId:r.solution?.itemId??null}),y=ia.safeParse(m);if(!y.success){console.warn("[SolutionBuilder] updateDesign schema validation failed:",{errors:y.error.issues,llmResponse:o,patchedDesign:m});let k=X("applyChangeFailed",e);return{outputMessage:k,summary:k,status:"success"}}let{response:h,featureLayer:b,...I}=y.data,R=Ko(b,r.featureLayer),g=Gt({...I,featureLayer:R},{itemId:r.solution?.itemId,sourceBuildSolution:r.sourceBuildSolution,templateId:r.templateId??t.selectedTemplate??null,params:r.params??null}),w=Cn(t.selectedTemplate);if(w?.initialTemplate||(await la(e),w=Cn(t.selectedTemplate)),!w?.initialTemplate)throw new Error("No hydrated templates are available for solution design.");let O=new bo(g,w.initialTemplate,!1);if(!O.isValid){console.warn("[SolutionBuilder] updateDesign validation failed:",{issues:O.issues,llmResponse:o,patchedDesign:g});let k=await Rh({query:n,validationIssues:O.issues,recentMessages:s,fallbackMessage:X("applyChangeFailed",e),promptModules:Vt});return{outputMessage:k,summary:k,status:"success"}}let L=g.sourceBuildSolution,q=Hc(g,L);if(!q.ok){console.warn("[SolutionBuilder] updateDesign Esri JSON conversion failed:",{error:q.error,llmResponse:o,design:g});let k=X("applyChangeFailed",e);return{outputMessage:k,summary:k,status:"success"}}return Wc(g),{outputMessage:i,summary:i,status:"success",currentDesign:g}},og=t=>t.currentDesign!==null?"assessUpdateRequest":"assessBuildRequest",ig=t=>!t.updateAssessment||!t.updateAssessment.isValidUpdate?"invalidUpdateExit":"updateDesign",ag=t=>!t.assessment||!t.assessment.isValidUseCase?"invalidBuildExit":!t.selectedTemplate&&t.assessment.matchedTemplates.length>1?"selectTemplateHIL":"findExistingSolutions",lg=t=>t.existingMatches.length>0?"confirmContinueBuildingHIL":"designSolution",ug=t=>t.continueBuilding===!1?"declineContinueBuildingExit":"designSolution",cg=()=>new Qt(Zh).addNode("syncCurrentDesignFromContext",Vh).addNode("assessBuildRequest",Gh).addNode("assessUpdateRequest",Xh).addNode("invalidBuildExit",Yh).addNode("invalidUpdateExit",Qh).addNode("selectTemplateHIL",eg).addNode("findExistingSolutions",tg).addNode("confirmContinueBuildingHIL",rg).addNode("declineContinueBuildingExit",ng).addNode("designSolution",Xc).addNode("updateDesign",sg).addEdge(Yt,"syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext",og,{assessUpdateRequest:"assessUpdateRequest",assessBuildRequest:"assessBuildRequest"}).addConditionalEdges("assessUpdateRequest",ig,{invalidUpdateExit:"invalidUpdateExit",updateDesign:"updateDesign"}).addConditionalEdges("assessBuildRequest",ag,{invalidBuildExit:"invalidBuildExit",selectTemplateHIL:"selectTemplateHIL",findExistingSolutions:"findExistingSolutions"}).addEdge("invalidBuildExit",ce).addEdge("invalidUpdateExit",ce).addEdge("selectTemplateHIL","findExistingSolutions").addConditionalEdges("findExistingSolutions",lg,{confirmContinueBuildingHIL:"confirmContinueBuildingHIL",designSolution:"designSolution"}).addConditionalEdges("confirmContinueBuildingHIL",ug,{declineContinueBuildingExit:"declineContinueBuildingExit",designSolution:"designSolution"}).addEdge("declineContinueBuildingExit",ce).addEdge("designSolution",ce).addEdge("updateDesign",ce);await xe(Vt,"description");var pg=A.object({tool:A.enum(["explorer","builder","other"]).describe("The selected tool based on the user's query."),confidence:A.number().min(0).max(1).describe("A confidence score (0.00\u20131.00)."),rationale:A.string().min(1).describe("A brief rationale for the tool choice (\u2264140 characters)")}),ua=Object.assign({"./prompts/assistantResponse.md":()=>import("./7WIFBTQF.js").then(t=>t.default),"./prompts/classifyIntent.md":()=>import("./LWT3JEQ6.js").then(t=>t.default),"./prompts/description.md":()=>import("./XBFG3KX6.js").then(t=>t.default)}),ca=t=>{let e=new CustomEvent("assistantProcessing",{detail:{finished:!0,agent:t}});window.dispatchEvent(e)},Qc=z.Root({...co(),selectedTool:z({reducer:(t,e)=>e??null,default:()=>null}),intentRationale:z({reducer:(t,e)=>e??null,default:()=>null})}),dg=async(t,e)=>{let r=Io(e);await Me({text:r?.builderMessages.understandingRequest},e);let n=t.agentExecutionContext.userRequest,s=t.agentExecutionContext.messages.slice(-11),o=e?.configurable?.context?.solutionDesignJson,i=!1;if(typeof o=="string"&&o.trim())try{i=JSON.parse(o).solution!=null}catch{i=!1}let a=await xe(ua,"classifyIntent"),u=await mt({promptText:a,modelTier:"advanced",temperature:0,schema:pg,messages:s,inputVariables:{query:n,activeSolutionDesign:i}});return{selectedTool:u.tool,intentRationale:u.rationale}},mg=async(t,e)=>{let r=await ph().compile().invoke(t,e);return ca("explorer"),r},fg=async(t,e)=>{let r=await cg().compile().invoke(t,e);return ca("builder"),r},hg=async(t,e)=>{let r=Io(e),n=t.agentExecutionContext.userRequest,s=t.intentRationale??"No rationale available.";await Me({text:r?.executingSolutionsAssistantAgent},e);let o=await xe(ua,"assistantResponse"),i=t.agentExecutionContext.messages.slice(-11),a=await Nc({promptText:o,modelTier:"advanced",temperature:0,messages:i,inputVariables:{query:n,rationale:s}});return ca("assistant"),{outputMessage:a,summary:a,status:"success"}},gg=t=>t.selectedTool??"other",yg=()=>new Qt(Qc).addNode("classifyIntent",dg).addNode("routeToExplorer",mg).addNode("routeToBuilder",fg).addNode("assistantResponse",hg).addEdge(Yt,"classifyIntent").addConditionalEdges("classifyIntent",gg,{explorer:"routeToExplorer",builder:"routeToBuilder",other:"assistantResponse"}).addEdge("routeToExplorer",ce).addEdge("routeToBuilder",ce).addEdge("assistantResponse",ce),_g=await xe(ua,"description"),wg={id:"solutionsAssistant",name:"Solutions Assistant Agent",description:_g,createGraph:yg,workspace:Qc},Ag="https://links.esri.com/solutions/agol-organizational-account",bg="https://links.esri.com/solutions/configure-assistants",oa=class extends ba{constructor(){super(),this.open=!1,this.userFirstName="",this.builderVisible=!1,this.hasActiveBuilderDesign=!1,this._conversationId=void 0,this._orgSettings={aiAssistantsEnabled:!1,blockBetaApps:!0,colocateCompute:!1},this._suggestedPrompts=[],this._hasInteracted=!1,this._isMobile=window.innerWidth<=800,this._translations=xa({name:"arcgis-solutions-assistant",blocking:!0}),this._builderWidth=48,this._solutionDesignJson='{ "solution": null }',this._isAssistantBusy=!1,this._isBuilderBusy=!1,this._preChatCheck=!1,this._showNewChatConfirm=!1,this._assistantRef=wa(),this._configContextConsumer=Po({context:va,subscribe:!0,callback:e=>{e?.portalURL&&(jc.portalUrl=e.portalURL),e?.userSession&&!this.userFirstName&&this._loadUserFirstName(),e?.authentication?.PortalSubset?.orgSettings&&(this._orgSettings=e?.authentication?.PortalSubset?.orgSettings)}}),this._builderDesignContextConsumer=Po({context:Ta,subscribe:!0,callback:e=>{e?.design&&(this._solutionDesignJson=JSON.stringify(e.design,null,2))}}),this._handleResize=()=>{this._isMobile=window.innerWidth<=800},this._chatStartTime=null,this._handleAssistantProcessingFinished=e=>{let r=e;if(r.detail?.finished&&this._chatStartTime!==null){let n=Pa(this._chatStartTime);this._telemetry?.logEvent({category:Oa.ASSISTANT,action:"Chat",dimensions:[r.detail.agent],metrics:[n]}),this._chatStartTime=null,this.assistantProcessing.emit(!1)}},this.closeAssistant=To(),this.assistantProcessing=To(),this._handleAssistantLinkClick=e=>{let r=e.composedPath().find(n=>n instanceof HTMLAnchorElement);if(r?.href)if(e.preventDefault(),r.target.indexOf("solutionId:")>-1){let n=r.target.split("solutionId:")[1];this._emitItemIdFromAI(n)}else window.open(r.href,"_blank","noopener,noreferrer")},this._onSolutionDesignUpdate=e=>{let r=e.detail;this._solutionDesignJson=r?JSON.stringify(r,null,2):'{ "solution": null }'},this._handleSignIn=()=>{this._configContextConsumer.value?.authentication?.signIn("aiOpen")},this._checkURLOpenParameter=()=>{this.open=this._configContextConsumer.value?.authentication?.SignInParam==="aiOpen"||this.open},this.listenOn(window,"arcgisFeedback",e=>{let r=e.detail,{agentPicked:n,taskAssigned:s,userMessage:o}=this._parseAgentPickedAndTask(r);this._sendFeedback(r.content,o??s??"",r.feedback?.positive?"Good":r.feedback?.positive=="Bad"?"Bad":"N/A",n??"")}),this.listenOn(window,"clearAssistantConversation",()=>{this._clearConversation()})}static{this.properties={open:5,userFirstName:1,builderVisible:5,hasActiveBuilderDesign:5,_conversationId:16,_orgSettings:16,_suggestedPrompts:16,_hasInteracted:16,_isMobile:16,_translations:16,_builderWidth:16,_solutionDesignJson:16,_isAssistantBusy:16,_isBuilderBusy:16,_preChatCheck:16,_showNewChatConfirm:16}}static{this.styles=sh}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}connectedCallback(){super.connectedCallback(),window.addEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.addEventListener("click",this._handleAssistantLinkClick),window.addEventListener("resize",this._handleResize),window.addEventListener("assistantProcessing",this._handleAssistantProcessingFinished),this._builderDesignContextConsumer}disconnectedCallback(){window.removeEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.removeEventListener("click",this._handleAssistantLinkClick),window.removeEventListener("resize",this._handleResize),window.removeEventListener("assistantProcessing",this._handleAssistantProcessingFinished),super.disconnectedCallback()}loaded(){this._checkURLOpenParameter()}load(){this._configContextConsumer.value?.portalURL&&(jc.portalUrl=this._configContextConsumer.value.portalURL)}firstUpdated(e){this._loadUserFirstName()}willUpdate(e){e.has("open")&&this.open&&window.dispatchEvent(new CustomEvent("openAssistant")),this._configContextConsumer.value?.authentication&&this._configContextConsumer.value?.userSession?.token&&(this._preChatCheck||(Kc(this._configContextConsumer.value?.authentication.Portal,this._configContextConsumer.value?.userSession?.token,this._configContextConsumer.value?.locale??"en"),this._preChatCheck=!0)),this._configContextConsumer.value?.userSession?.token&&this._configContextConsumer.value?.authentication?.CanUseAI}_renderNoSign(){return Je`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage??Co} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`}_renderNoPermission(){return Je`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ha(this._translations.noPermissionMessage.replace("{{orgUrl}}",Ag).replace("{{configAI}}",bg))}</div></calcite-notice>`}render(){let e=this._suggestedPrompts.length>0?this._suggestedPrompts:this._hasInteracted?[]:Object.values(this._translations.defaultFollowUpQuestions);return this._suggestedPrompts.length>0?e=this._suggestedPrompts:this._hasInteracted||(e=[...Object.values(this._translations.defaultFollowUpQuestions)]),Je`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token?this._configContextConsumer.value?.authentication?.CanUseAI?Je`${!this._isMobile&&Je`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${()=>{window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"))}} scale=m slot=header-actions-end></calcite-action>`||""}${!this._isMobile&&Je`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>`||""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage??Co} .suggestedPrompts=${e} @arcgisSubmit=${r=>{console.log("arcgis submit: ",r.detail),this._suggestedPrompts=[],e=[],this._hasInteracted=!0,this._chatStartTime=Date.now(),this.assistantProcessing.emit(!0)}} @arcgisFeedback=${r=>{r.detail}} @arcgisInterrupt=${()=>{this._queryElementInShadowDom(this.el,".footer-container",!0)}} @arcgisInterruptCancel=${()=>{this._queryElementInShadowDom(this.el,".footer-container",!1)}} @arcgisInterruptSubmit=${()=>{this._queryElementInShadowDom(this.el,".footer-container",!1)}} ${Aa(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${()=>{this.hasActiveBuilderDesign?this._showNewChatConfirm=!0:this._clearConversation()}} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${wg} .context=${{token:this._configContextConsumer.value?.userSession?.token,configContext:this._configContextConsumer.value,convoId:this._conversationId,portal:this._configContextConsumer.value?.authentication.Portal,assistantRef:this._assistantRef,translations:this._translations,solutionDesignJson:this._solutionDesignJson,setConversationId:r=>{this._conversationId=r},clearSuggestedPrompts:()=>{this._suggestedPrompts=[]}}}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>`:this._renderNoPermission():this._renderNoSign()}${this._showNewChatConfirm&&Je`<calcite-dialog close-disabled escape-disabled heading="Start new conversation" modal open>${this._translations.builderMessages.discardMessage}<calcite-button appearance=outline @click=${()=>{this._showNewChatConfirm=!1}} slot=footer-end>\r\n Cancel</calcite-button><calcite-button appearance=solid kind=danger @click=${()=>{this._showNewChatConfirm=!1,window.dispatchEvent(new CustomEvent("requestBuilderDiscard"))}} slot=footer-end>\r\n Discard</calcite-button></calcite-dialog>`||""}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${()=>{this.closeAssistant.emit(!0)}} slot=header-actions-end .text=${this._translations.tooltips.close}></calcite-action><calcite-tooltip placement=bottom reference-element=closeAssistantButton><span>${this._translations.tooltips.close}</span></calcite-tooltip></calcite-panel>`}_clearConversation(){this._conversationId=void 0,this._suggestedPrompts=[],this._hasInteracted=!1,this._assistantRef.value?.clearChatHistory(),this._queryElementInShadowDom(this.el,".footer-container",!1),console.log("[arcgis-solutions-assistant] Conversation after clear:",{conversationId:this._conversationId,suggestedPrompts:this._suggestedPrompts,hasInteracted:this._hasInteracted})}_sendFeedback(e,r,n,s){let o=`https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(r)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({agent:s}))}&field:version=${encodeURIComponent("v2")}`;window.open(o,"_blank")}async _loadUserFirstName(){try{let e=await this._configContextConsumer.value?.userSession?.getUser();if(e?.fullName){let r=e.fullName.split(" ")[0];this.userFirstName=r}}catch{}}_parseAgentPickedAndTask(e){let r=Array.from(this._assistantRef.value?.messages||[]),n=e.log||[],s=[...r].sort((p,m)=>m.id-p.id).find(p=>p.role==="user"&&p.id<=e.id)?.content||null,o=n.find(p=>typeof p=="string"&&p.includes("Agent picked:"))??null;if(!o)return{agentPicked:null,taskAssigned:null,userMessage:s};let i=/Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i,a=o.match(i);if(!a)return{agentPicked:null,taskAssigned:null,userMessage:s};let u=a[1].trim(),l=a[2].trim();return{agentPicked:u,taskAssigned:l,userMessage:s}}_emitItemIdFromAI(e){let r=new CustomEvent("solutionIDFromAssistant",{detail:e,bubbles:!0,composed:!0});window.dispatchEvent(r)}_queryElementInShadowDom(e,r,n){let s=e.shadowRoot;if(s){let o=s.querySelector("arcgis-assistant");o&&o.shadowRoot&&this._findElementInShadowDom(o.shadowRoot,r,n)}else console.log("No shadowRoot found on this component.")}_findElementInShadowDom(e,r,n){let s=e.querySelector(r);s&&this._disableElementAndChildren(s,n);let o=e.children;for(let i of Array.from(o))i.classList.contains(r)&&this._disableElementAndChildren(i,n),this._findElementInShadowDom(i,r,n)}_disableElementAndChildren(e,r){"disabled"in e&&(e.disabled=r),e.querySelectorAll("*").forEach(n=>{n.nodeName.toLowerCase()==="arcgis-assistant-chat-entry"&&n.shadowRoot&&n.shadowRoot.querySelectorAll("*").forEach(s=>{"disabled"in s&&(s.disabled=r)}),"disabled"in n&&(n.disabled=r)})}};Ia("arcgis-solutions-assistant",oa);return oa},"config","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","portal/Portal","portal/PortalItem",a,b)
90
+ `:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\u"+U.charCodeAt(0).toString(16).padStart(4,"0")}});try{return JSON.parse(D)}catch{return k}}},l=[...a.map(k=>({op:k.op,path:k.path.replace(/\/+$/,""),...k.value!=null&&k.value!==""?{value:u(k.value)}:{},...k.from!=null&&k.from!==""?{from:k.from}:{}}))].sort((k,D)=>k.op!=="remove"||D.op!=="remove"?0:D.path.localeCompare(k.path,void 0,{numeric:!0})),p=structuredClone(Fo(r));try{xn(p,l,!0)}catch(k){console.warn("[SolutionBuilder] updateDesign JSON patch failed:",{error:k,llmResponse:o,patches:l,patchTarget:p});let D=X("applyChangeFailed",e);return{outputMessage:D,summary:D,status:"success"}}let m=Gt({response:"",...p},{itemId:r.solution?.itemId??null}),y=ia.safeParse(m);if(!y.success){console.warn("[SolutionBuilder] updateDesign schema validation failed:",{errors:y.error.issues,llmResponse:o,patchedDesign:m});let k=X("applyChangeFailed",e);return{outputMessage:k,summary:k,status:"success"}}let{response:h,featureLayer:b,...I}=y.data,R=Ko(b,r.featureLayer),g=Gt({...I,featureLayer:R},{itemId:r.solution?.itemId,sourceBuildSolution:r.sourceBuildSolution,templateId:r.templateId??t.selectedTemplate??null,params:r.params??null}),w=Cn(t.selectedTemplate);if(w?.initialTemplate||(await la(e),w=Cn(t.selectedTemplate)),!w?.initialTemplate)throw new Error("No hydrated templates are available for solution design.");let O=new bo(g,w.initialTemplate,!1);if(!O.isValid){console.warn("[SolutionBuilder] updateDesign validation failed:",{issues:O.issues,llmResponse:o,patchedDesign:g});let k=await Rh({query:n,validationIssues:O.issues,recentMessages:s,fallbackMessage:X("applyChangeFailed",e),promptModules:Vt});return{outputMessage:k,summary:k,status:"success"}}let L=g.sourceBuildSolution,q=Hc(g,L);if(!q.ok){console.warn("[SolutionBuilder] updateDesign Esri JSON conversion failed:",{error:q.error,llmResponse:o,design:g});let k=X("applyChangeFailed",e);return{outputMessage:k,summary:k,status:"success"}}return Wc(g),{outputMessage:i,summary:i,status:"success",currentDesign:g}},og=t=>t.currentDesign!==null?"assessUpdateRequest":"assessBuildRequest",ig=t=>!t.updateAssessment||!t.updateAssessment.isValidUpdate?"invalidUpdateExit":"updateDesign",ag=t=>!t.assessment||!t.assessment.isValidUseCase?"invalidBuildExit":!t.selectedTemplate&&t.assessment.matchedTemplates.length>1?"selectTemplateHIL":"findExistingSolutions",lg=t=>t.existingMatches.length>0?"confirmContinueBuildingHIL":"designSolution",ug=t=>t.continueBuilding===!1?"declineContinueBuildingExit":"designSolution",cg=()=>new Qt(Zh).addNode("syncCurrentDesignFromContext",Vh).addNode("assessBuildRequest",Gh).addNode("assessUpdateRequest",Xh).addNode("invalidBuildExit",Yh).addNode("invalidUpdateExit",Qh).addNode("selectTemplateHIL",eg).addNode("findExistingSolutions",tg).addNode("confirmContinueBuildingHIL",rg).addNode("declineContinueBuildingExit",ng).addNode("designSolution",Xc).addNode("updateDesign",sg).addEdge(Yt,"syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext",og,{assessUpdateRequest:"assessUpdateRequest",assessBuildRequest:"assessBuildRequest"}).addConditionalEdges("assessUpdateRequest",ig,{invalidUpdateExit:"invalidUpdateExit",updateDesign:"updateDesign"}).addConditionalEdges("assessBuildRequest",ag,{invalidBuildExit:"invalidBuildExit",selectTemplateHIL:"selectTemplateHIL",findExistingSolutions:"findExistingSolutions"}).addEdge("invalidBuildExit",ce).addEdge("invalidUpdateExit",ce).addEdge("selectTemplateHIL","findExistingSolutions").addConditionalEdges("findExistingSolutions",lg,{confirmContinueBuildingHIL:"confirmContinueBuildingHIL",designSolution:"designSolution"}).addConditionalEdges("confirmContinueBuildingHIL",ug,{declineContinueBuildingExit:"declineContinueBuildingExit",designSolution:"designSolution"}).addEdge("declineContinueBuildingExit",ce).addEdge("designSolution",ce).addEdge("updateDesign",ce);await xe(Vt,"description");var pg=A.object({tool:A.enum(["explorer","builder","other"]).describe("The selected tool based on the user's query."),confidence:A.number().min(0).max(1).describe("A confidence score (0.00\u20131.00)."),rationale:A.string().min(1).describe("A brief rationale for the tool choice (\u2264140 characters)")}),ua=Object.assign({"./prompts/assistantResponse.md":()=>import("./7WIFBTQF.js").then(t=>t.default),"./prompts/classifyIntent.md":()=>import("./LWT3JEQ6.js").then(t=>t.default),"./prompts/description.md":()=>import("./XBFG3KX6.js").then(t=>t.default)}),ca=t=>{let e=new CustomEvent("assistantProcessing",{detail:{finished:!0,agent:t}});window.dispatchEvent(e)},Qc=z.Root({...co(),selectedTool:z({reducer:(t,e)=>e??null,default:()=>null}),intentRationale:z({reducer:(t,e)=>e??null,default:()=>null})}),dg=async(t,e)=>{let r=Io(e);await Me({text:r?.builderMessages.understandingRequest},e);let n=t.agentExecutionContext.userRequest,s=t.agentExecutionContext.messages.slice(-11),o=e?.configurable?.context?.solutionDesignJson,i=!1;if(typeof o=="string"&&o.trim())try{i=JSON.parse(o).solution!=null}catch{i=!1}let a=await xe(ua,"classifyIntent"),u=await mt({promptText:a,modelTier:"advanced",temperature:0,schema:pg,messages:s,inputVariables:{query:n,activeSolutionDesign:i}});return{selectedTool:u.tool,intentRationale:u.rationale}},mg=async(t,e)=>{let r=await ph().compile().invoke(t,e);return ca("explorer"),r},fg=async(t,e)=>{let r=await cg().compile().invoke(t,e);return ca("builder"),r},hg=async(t,e)=>{let r=Io(e),n=t.agentExecutionContext.userRequest,s=t.intentRationale??"No rationale available.";await Me({text:r?.executingSolutionsAssistantAgent},e);let o=await xe(ua,"assistantResponse"),i=t.agentExecutionContext.messages.slice(-11),a=await Nc({promptText:o,modelTier:"advanced",temperature:0,messages:i,inputVariables:{query:n,rationale:s}});return ca("assistant"),{outputMessage:a,summary:a,status:"success"}},gg=t=>t.selectedTool??"other",yg=()=>new Qt(Qc).addNode("classifyIntent",dg).addNode("routeToExplorer",mg).addNode("routeToBuilder",fg).addNode("assistantResponse",hg).addEdge(Yt,"classifyIntent").addConditionalEdges("classifyIntent",gg,{explorer:"routeToExplorer",builder:"routeToBuilder",other:"assistantResponse"}).addEdge("routeToExplorer",ce).addEdge("routeToBuilder",ce).addEdge("assistantResponse",ce),_g=await xe(ua,"description"),wg={id:"solutionsAssistant",name:"Solutions Assistant Agent",description:_g,createGraph:yg,workspace:Qc},Ag="https://links.esri.com/solutions/agol-organizational-account",bg="https://links.esri.com/solutions/configure-assistants",oa=class extends ba{constructor(){super(),this.open=!1,this.userFirstName="",this.builderVisible=!1,this.hasActiveBuilderDesign=!1,this._conversationId=void 0,this._orgSettings={aiAssistantsEnabled:!1,blockBetaApps:!0,colocateCompute:!1},this._suggestedPrompts=[],this._hasInteracted=!1,this._isMobile=window.innerWidth<=800,this._translations=xa({name:"arcgis-solutions-assistant",blocking:!0}),this._builderWidth=48,this._solutionDesignJson='{ "solution": null }',this._isAssistantBusy=!1,this._isBuilderBusy=!1,this._preChatCheck=!1,this._showNewChatConfirm=!1,this._assistantRef=wa(),this._configContextConsumer=Po({context:va,subscribe:!0,callback:e=>{e?.portalURL&&(jc.portalUrl=e.portalURL),e?.userSession&&!this.userFirstName&&this._loadUserFirstName(),e?.authentication?.PortalSubset?.orgSettings&&(this._orgSettings=e?.authentication?.PortalSubset?.orgSettings)}}),this._builderDesignContextConsumer=Po({context:Ta,subscribe:!0,callback:e=>{e?.design&&(this._solutionDesignJson=JSON.stringify(e.design,null,2))}}),this._handleResize=()=>{this._isMobile=window.innerWidth<=800},this._chatStartTime=null,this._handleAssistantProcessingFinished=e=>{let r=e;if(r.detail?.finished&&this._chatStartTime!==null){let n=Pa(this._chatStartTime);this._telemetry?.logEvent({category:Oa.ASSISTANT,action:"Chat",dimensions:[r.detail.agent],metrics:[n]}),this._chatStartTime=null,this.assistantProcessing.emit(!1)}},this.closeAssistant=To(),this.assistantProcessing=To(),this._handleAssistantLinkClick=e=>{let r=e.composedPath().find(n=>n instanceof HTMLAnchorElement);if(r?.href)if(e.preventDefault(),r.target.indexOf("solutionId:")>-1){let n=r.target.split("solutionId:")[1];this._emitItemIdFromAI(n)}else window.open(r.href,"_blank","noopener,noreferrer")},this._onSolutionDesignUpdate=e=>{let r=e.detail;this._solutionDesignJson=r?JSON.stringify(r,null,2):'{ "solution": null }'},this._handleSignIn=()=>{this._configContextConsumer.value?.authentication?.signIn("aiOpen")},this._checkURLOpenParameter=()=>{this.open=this._configContextConsumer.value?.authentication?.SignInParam==="aiOpen"||this.open},this.listenOn(window,"arcgisFeedback",e=>{let r=e.detail,{agentPicked:n,taskAssigned:s,userMessage:o}=this._parseAgentPickedAndTask(r);this._sendFeedback(r.content,o??s??"",r.feedback?.positive?"Good":r.feedback?.positive=="Bad"?"Bad":"N/A",n??"")}),this.listenOn(window,"clearAssistantConversation",()=>{this._clearConversation()})}static{this.properties={open:5,userFirstName:1,builderVisible:5,hasActiveBuilderDesign:5,_conversationId:16,_orgSettings:16,_suggestedPrompts:16,_hasInteracted:16,_isMobile:16,_translations:16,_builderWidth:16,_solutionDesignJson:16,_isAssistantBusy:16,_isBuilderBusy:16,_preChatCheck:16,_showNewChatConfirm:16}}static{this.styles=sh}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}connectedCallback(){super.connectedCallback(),window.addEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.addEventListener("click",this._handleAssistantLinkClick),window.addEventListener("resize",this._handleResize),window.addEventListener("assistantProcessing",this._handleAssistantProcessingFinished),this._builderDesignContextConsumer}disconnectedCallback(){window.removeEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.removeEventListener("click",this._handleAssistantLinkClick),window.removeEventListener("resize",this._handleResize),window.removeEventListener("assistantProcessing",this._handleAssistantProcessingFinished),super.disconnectedCallback()}loaded(){this._checkURLOpenParameter()}load(){this._configContextConsumer.value?.portalURL&&(jc.portalUrl=this._configContextConsumer.value.portalURL)}firstUpdated(e){this._loadUserFirstName()}willUpdate(e){e.has("open")&&this.open&&window.dispatchEvent(new CustomEvent("openAssistant")),this._configContextConsumer.value?.authentication&&this._configContextConsumer.value?.userSession?.token&&(this._preChatCheck||(Kc(this._configContextConsumer.value?.authentication.Portal,this._configContextConsumer.value?.userSession?.token,this._configContextConsumer.value?.locale??"en"),this._preChatCheck=!0)),this._configContextConsumer.value?.userSession?.token&&this._configContextConsumer.value?.authentication?.CanUseAI}_renderNoSign(){return Je`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage??Co} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`}_renderNoPermission(){return Je`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ha(this._translations.noPermissionMessage.replace("{{orgUrl}}",Ag).replace("{{configAI}}",bg))}</div></calcite-notice>`}render(){let e=this._suggestedPrompts.length>0?this._suggestedPrompts:this._hasInteracted?[]:Object.values(this._translations.defaultFollowUpQuestions);return this._suggestedPrompts.length>0?e=this._suggestedPrompts:this._hasInteracted||(e=[...Object.values(this._translations.defaultFollowUpQuestions)]),Je`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token?this._configContextConsumer.value?.authentication?.CanUseAI?Je`${!this._isMobile&&Je`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${()=>{window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"))}} scale=m slot=header-actions-end></calcite-action>`||""}${!this._isMobile&&Je`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>`||""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage??Co} .suggestedPrompts=${e} @arcgisSubmit=${r=>{console.log("arcgis submit: ",r.detail),this._suggestedPrompts=[],e=[],this._hasInteracted=!0,this._chatStartTime=Date.now(),this.assistantProcessing.emit(!0)}} @arcgisFeedback=${r=>{r.detail}} @arcgisInterrupt=${()=>{this._queryElementInShadowDom(this.el,".footer-container",!0)}} @arcgisInterruptCancel=${()=>{this._queryElementInShadowDom(this.el,".footer-container",!1)}} @arcgisInterruptSubmit=${()=>{this._queryElementInShadowDom(this.el,".footer-container",!1)}} ${Aa(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${()=>{this.hasActiveBuilderDesign?this._showNewChatConfirm=!0:this._clearConversation()}} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${wg} .context=${{token:this._configContextConsumer.value?.userSession?.token,configContext:this._configContextConsumer.value,convoId:this._conversationId,portal:this._configContextConsumer.value?.authentication.Portal,assistantRef:this._assistantRef,translations:this._translations,solutionDesignJson:this._solutionDesignJson,setConversationId:r=>{this._conversationId=r},clearSuggestedPrompts:()=>{this._suggestedPrompts=[]}}}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>`:this._renderNoPermission():this._renderNoSign()}${this._showNewChatConfirm&&Je`<calcite-dialog close-disabled escape-disabled heading="Start new conversation" modal open>${this._translations.builderMessages.discardMessage}<calcite-button appearance=outline @click=${()=>{this._showNewChatConfirm=!1}} slot=footer-end>\r\n Cancel</calcite-button><calcite-button appearance=solid kind=danger @click=${()=>{this._showNewChatConfirm=!1,window.dispatchEvent(new CustomEvent("requestBuilderDiscard"))}} slot=footer-end>\r\n Discard</calcite-button></calcite-dialog>`||""}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${()=>{this.closeAssistant.emit(!0)}} slot=header-actions-end .text=${this._translations.tooltips.close}></calcite-action><calcite-tooltip placement=bottom reference-element=closeAssistantButton><span>${this._translations.tooltips.close}</span></calcite-tooltip></calcite-panel>`}_clearConversation(){this._conversationId=void 0,this._suggestedPrompts=[],this._hasInteracted=!1,this._assistantRef.value?.clearChatHistory(),this._queryElementInShadowDom(this.el,".footer-container",!1)}_sendFeedback(e,r,n,s){let o=`https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(r)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({agent:s}))}&field:version=${encodeURIComponent("v2")}`;window.open(o,"_blank")}async _loadUserFirstName(){try{let e=await this._configContextConsumer.value?.userSession?.getUser();if(e?.fullName){let r=e.fullName.split(" ")[0];this.userFirstName=r}}catch{}}_parseAgentPickedAndTask(e){let r=Array.from(this._assistantRef.value?.messages||[]),n=e.log||[],s=[...r].sort((p,m)=>m.id-p.id).find(p=>p.role==="user"&&p.id<=e.id)?.content||null,o=n.find(p=>typeof p=="string"&&p.includes("Agent picked:"))??null;if(!o)return{agentPicked:null,taskAssigned:null,userMessage:s};let i=/Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i,a=o.match(i);if(!a)return{agentPicked:null,taskAssigned:null,userMessage:s};let u=a[1].trim(),l=a[2].trim();return{agentPicked:u,taskAssigned:l,userMessage:s}}_emitItemIdFromAI(e){let r=new CustomEvent("solutionIDFromAssistant",{detail:e,bubbles:!0,composed:!0});window.dispatchEvent(r)}_queryElementInShadowDom(e,r,n){let s=e.shadowRoot;if(s){let o=s.querySelector("arcgis-assistant");o&&o.shadowRoot&&this._findElementInShadowDom(o.shadowRoot,r,n)}else console.log("No shadowRoot found on this component.")}_findElementInShadowDom(e,r,n){let s=e.querySelector(r);s&&this._disableElementAndChildren(s,n);let o=e.children;for(let i of Array.from(o))i.classList.contains(r)&&this._disableElementAndChildren(i,n),this._findElementInShadowDom(i,r,n)}_disableElementAndChildren(e,r){"disabled"in e&&(e.disabled=r),e.querySelectorAll("*").forEach(n=>{n.nodeName.toLowerCase()==="arcgis-assistant-chat-entry"&&n.shadowRoot&&n.shadowRoot.querySelectorAll("*").forEach(s=>{"disabled"in s&&(s.disabled=r)}),"disabled"in n&&(n.disabled=r)})}};Ia("arcgis-solutions-assistant",oa);return oa},"config","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","portal/Portal","portal/PortalItem",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a as N}from"./HYQVSB6C.js";import e from"./5O7LFBHI.js";import c from"./OANAQ6HY.js";import b from"./UBEU6ULP.js";import{a as L,b as T}from"./2B4SGB3I.js";import{b as w}from"./I2NTSKBD.js";import{K as y,M as x,N as R,nb as A,q as _,ta as P}from"./AE5HNAOV.js";import{a as I}from"./MGEDATQ7.js";import{k as E}from"./AYSQIO6L.js";import{b as D}from"./2I5LGZNX.js";import{E as d,F as h,G as S,I as p,J as M,K as u,h as k,i as a,q as v}from"./FFF5HUPM.js";export default $arcgis.t(([{h:b,m:m,q:O,r:f,s:F},{b:U,d:V,e:H,f:$,r:g},{a:z}])=>{var Y=k`.display-flex{display:flex}.flex-direction-row{flex-direction:row}.flex-direction-column{flex-direction:column}.flex-1{flex:1}.cursor-default{cursor:default}solution-details-card[id*=you-may-also-like]{width:240px}.border-bottom{border-bottom-color:var(--calcite-color-border-1);border-bottom-width:var(--calcite-spacing-px);border-bottom-style:solid}ul{list-style-type:disc;margin-block-start:var(--calcite-spacing-none);margin-block-end:var(--calcite-spacing-none)}ul ul{list-style-type:circle}li{margin:var(--calcite-spacing-sm) var(--calcite-spacing-none)}calcite-label{--calcite-label-margin-bottom: var(--calcite-spacing-none)}.padding-1{padding:var(--calcite-spacing-lg)}.padding-1-5{padding:var(--calcite-spacing-xl)}.padding-2px{padding:var(--calcite-spacing-base)}.padding-bottom-xxl{padding-bottom:var(--calcite-spacing-xxl)}.padding-bottom-1{padding-bottom:var(--calcite-spacing-lg)}.padding-bottom-sm{padding-bottom:var(--calcite-spacing-sm)}.padding-top-md{padding-top:var(--calcite-spacing-md)}.padding-top-sm{padding-top:var(--calcite-spacing-sm)}.padding-top-xs{padding-top:.25rem}.padding-bottom-1-5{padding-bottom:var(--calcite-spacing-xxl)}.padding-top-1{padding-top:var(--calcite-spacing-lg)}.padding-top-1-5{padding-top:var(--calcite-spacing-xxl)}.padding-top-1-2{padding-top:var(--calcite-spacing-sm)}.padding-end-1{padding-inline-end:var(--calcite-spacing-lg)}.padding-end-1-75{padding-inline-end:1.75rem}.padding-end-2{padding-inline-end:var(--calcite-spacing-xxxl)}.padding-start-1{padding-inline-start:var(--calcite-spacing-lg)}.margin-bottom-1{margin-bottom:var(--calcite-spacing-lg)}.margin-bottom-1-5{margin-bottom:var(--calcite-spacing-xxl)}.margin-end-1{margin-inline-end:var(--calcite-spacing-lg)}.margin-top-0{margin-top:var(--calcite-spacing-none)}.margin-top-1{margin-top:var(--calcite-spacing-lg)}.margin-top-875{margin-top:.875rem}.margin-top-1-5{margin-top:var(--calcite-spacing-xxl)}.margin-sides-0-5{margin-left:var(--calcite-spacing-sm);margin-right:var(--calcite-spacing-sm)}.margin-sides-1{margin-left:var(--calcite-spacing-lg);margin-right:var(--calcite-spacing-lg)}.margin-block-start-end-0{margin-block-start:var(--calcite-spacing-none);margin-block-end:var(--calcite-spacing-none)}.align-self-center{align-self:center;padding:5px;--calcite-fab-shadow: #FFFFFF00}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.button-width{width:260px;flex-grow:0;flex-shrink:0;align-self:flex-start}@container (max-width: 1050px){.button-width{width:auto}}.image-width{width:300px;flex-grow:0;flex-shrink:0}@container (max-width: 1050px){.image-width{flex-grow:0;flex-shrink:1}}.width-full{width:100%}@container (max-width: 800px){.width-full{flex-direction:column}.width-full>.display-flex{flex-direction:column}.image-width{width:100%;max-width:100%;margin:0;padding-bottom:0}.image-width img{width:100%;max-width:100%}.title-font{padding-inline-end:var(--calcite-spacing-lg);padding-top:var(--calcite-spacing-lg)}.button-width{width:100%;margin-top:var(--calcite-spacing-lg)}}.card-group{overflow:hidden;padding:.25rem var(--calcite-spacing-sm) var(--calcite-spacing-md)}#screenshots-subsection calcite-card{width:calc(33.333% - .5rem)}calcite-card{width:450px;--calcite-card-border-color: transparent}@container (max-width: 1496px){calcite-card{width:calc(100% / 3 - .5rem)}#screenshots-subsection calcite-card{width:calc(33.333% - .5rem)}}@container (max-width: 1100px){calcite-card{width:calc(50% - .5rem)}#screenshots-subsection calcite-card{width:calc(50% - .5rem)}}@container (max-width: 550px){calcite-card{width:100%}#screenshots-subsection calcite-card{width:100%}}.max-height-300{max-height:300px}.display-none{display:none}.cursor-pointer{cursor:pointer}calcite-card:hover img{-webkit-filter:brightness(30%);filter:brightness(30%);-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}calcite-card:hover .hover-text{opacity:1;color:#fff}calcite-card:hover{border:var(--calcite-spacing-base) solid var(--calcite-color-brand);box-sizing:border-box;cursor:pointer;padding:var(--calcite-spacing-base)}calcite-card.is-mobile:hover img{cursor:default;-webkit-filter:brightness(100%);filter:brightness(100%);transition:all .1s ease}calcite-card{border:var(--calcite-spacing-base) solid transparent;box-sizing:border-box;padding:var(--calcite-spacing-base)}.hover-text{transition:.1s ease;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:row;align-items:center;height:100%;font-size:var(--calcite-spacing-xl)}.card-image-wrap{width:100%;position:relative;margin-bottom:0;-webkit-box-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}#screenshots-subsection .card-image{background-color:var(--calcite-color-surface-2)}.card-image{width:100%;display:block}video,img{max-width:100%;height:auto}img{overflow-clip-margin:content-box;overflow:clip;display:block}.margin-inline-unset{margin-inline:unset}.collapsible-div{overflow:hidden;transition:max-height .3s ease-in-out}.collapsible-div.expanded{max-height:100%}.back-color-override{--calcite-panel-background-color: var(--calcite-color-surface-3)}.back-color-override-1{background-color:var(--calcite-color-surface-2)}.title-font{font-size:1.8rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.heading-font{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.line-height-xxl{line-height:var(--calcite-spacing-xxl)}.line-height-1{line-height:1.1}.font-1{font-size:var(--calcite-spacing-lg)}.font-color-1{color:var(--calcite-color-text-1)}.font-color-2{color:var(--calcite-color-text-2)}h1{font-weight:unset;margin:var(--calcite-spacing-none);padding:var(--calcite-spacing-none)}.item-padding{--calcite-internal-accordion-item-padding: var(--calcite-spacing-xl)}.accordion-bg{--calcite-accordion-background-color: var(--calcite-color-surface-2)}.table-cell{font-size:var(--calcite-spacing-lg);color:var(--calcite-color-text-2);margin:0}.table-cell p{margin:0}calcite-table-header{font-weight:var(--calcite-font-weight-medium);--calcite-internal-table-cell-font-size: var(--calcite-font-size-md)}.position-relative{position:relative}.background-color-2{background-color:var(--calcite-color-surface-3)}.panel-background-2{--calcite-panel-background-color: var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-3)}.border-none{border:none}.padding-end-xxl{padding-inline-end:var(--calcite-spacing-xxl)}calcite-shell{block-size:unset}.solution-detail-action{--calcite-color-focus: initial}a{color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:hover{background-size:100% 1px,100% 1px}a:focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:active{color:var(--calcite-color-brand-press)}*[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.chip-status{--calcite-chip-icon-color: var(--calcite-color-brand);cursor:pointer}.chip-deployed{--calcite-chip-icon-color: var(--calcite-color-status-success)}.chip-deployed-warn{--calcite-chip-icon-color: var(--calcite-color-status-warning)}`,C=class extends S{constructor(){super(),this.readOnlyNotice="",this._deployedTooltipContent="",this._isDeployDisabled=!1,this._isLoaded=!1,this._itemFetched=!1,this._showScreenshotsShowMore=!1,this._showYouMayAlsoLikeShowMore=!1,this.isMobile=!1,this._isScreenshotsRowExpanded=!1,this._isYouMayAlsoLikeRowExpanded=!1,this._screenshotsRowBaseHeight=340,this._showLoader=!1,this._templates=[],this._translations=I({name:"solution-details-panel",blocking:!0}),this._youMayAlsoLikeBaseHeight=340,this._allCards=[],this._configContextConsumer=w({context:T,subscribe:!0}),this._configureLearnMore="",this._customDeploymentMappings={},this._deployDialogRef=d(),this._deployingDialogRef=d(),this._deployFlow=new N({deployDialogRef:this._deployDialogRef,deployingDialogRef:this._deployingDialogRef,getCard:()=>this.card,onDeployStarted:()=>{this._deploymentStartTime=Date.now(),this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Started",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","",m(this.card?.typeKeywords)]})},onDeployCancelled:()=>{this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Dialog Canceled",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","",m(this.card?.typeKeywords)]})},onDeploySuccess:()=>{let e=f(this._deploymentStartTime);this._deploymentStartTime=null,this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Success",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","",m(this.card?.typeKeywords)],metrics:[e]})},onDeployFailedReal:e=>{let t=f(this._deploymentStartTime);this._deploymentStartTime=null;let i=O(e),l=i.length>200?i.slice(-200):i;console.error("Deployment failed:",e),this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Failure",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"",l,m(this.card?.typeKeywords)],metrics:[t]})},onDeploymentProcessCancelled:()=>{this._cancellationStartTime=Date.now(),this._deployToCancelDuration=f(this._deploymentStartTime),this._deploymentStartTime=null},onCloseAfterCancel:()=>{let e=f(this._cancellationStartTime);this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Canceled",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","",m(this.card?.typeKeywords)],metrics:[this._deployToCancelDuration,e]}),this._cancellationStartTime=null,this._deployToCancelDuration=0},onDeployedCardReady:e=>{window.dispatchEvent(new CustomEvent("displayDeployedCard",{detail:e}))},onDeploymentFallback:()=>{console.warn("Deployment completed but unable to navigate to deployed card - closing dialogs"),window.dispatchEvent(new CustomEvent("navTabSelected",{detail:"deployments"}))}}),this._isMobileContextConsumer=w({context:L,subscribe:!0,callback:e=>this.isMobile=e}),this._overviewAccordionItemElement=d(),this._privilegePopoverRef=d(),this._privileges=[],this._regexFsUrl="https?:\\/\\/.+FeatureServer\\b",this._regexID="\\b[0-9A-F]{32}\\b",this._releaseNotesAccordionItemElement=d(),this._relatedResourcesAccordionItemElement=d(),this._screenshotsAccordionItemElement=d(),this._screenshotsDialogRef=d(),this._screenshotsElement=d(),this._termsOfUseAccordionItemElement=d(),this._userOptions=[],this._youMayAlsoLikeAccordionItemElement=d(),this._youMayAlsoLikeElement=d(),this._signInParamValue=null,this._deploymentStartTime=null,this._cancellationStartTime=null,this._deployToCancelDuration=0,this.templatesFetched=v(),this.itemPropertiesFetched=v(),this.sortTypeChanged=v(),this.tokenRefreshed=v(),this._handleDeployCancelled=()=>{this._deployFlow.handleDeployCancelled()},this._deployProgressStart=e=>{this._deployFlow.deployProgressStart(e)},this._deployProgessUpdated=e=>{this._deployFlow.deployProgressUpdated(e)},this._handleDeploySuccess=e=>{this._deployFlow.handleDeploySuccess(e)},this._handleDeployedCardReady=e=>this._deployFlow.handleDeployedCardReady(e),this._handleDeploymentFallback=e=>{this._deployFlow.handleDeploymentFallback(e)},this._handleDeploymentProcessCancelled=()=>{this._deployFlow.handleDeploymentProcessCancelled()},this._handleDeployFailed=e=>{this._deployFlow.handleDeployFailed(e)},this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"allCardsFetched",this._allCardsFetched),this.listenOn(window,"deployAppTabSelected",this._handleDeployAppTabSelected),this.listenOn(window,"deployedCardReady",this._handleDeployedCardReady),this.listenOn(window,"deploymentCompletedWithoutNav",this._handleDeploymentFallback)}static{this.properties={card:0,readOnlyNotice:1,_deployedTooltipContent:16,_isDeployDisabled:16,_isLoaded:16,_itemFetched:16,_showScreenshotsShowMore:16,_showYouMayAlsoLikeShowMore:16,isMobile:16,_isScreenshotsRowExpanded:16,_isYouMayAlsoLikeRowExpanded:16,_itemProperties:16,_missingPrivilegeMessages:16,_screenshotsRowBaseHeight:16,_showLoader:16,_templates:16,_translations:16,_youMayAlsoLikeBaseHeight:16}}static{this.styles=Y}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async connectedCallback(){super.connectedCallback(),this.listenOn(window,"calciteTabChange",this._cleanupPanel)}async load(){this._isMobileContextConsumer.value&&(this.isMobile=this._isMobileContextConsumer.value)}willUpdate(e){e.has("card")&&(this._deployedTooltipContent="",this._isDeployDisabled=!1,this._isLoaded=!1,this._showLoader=!1,this._signInParamValue==="deploy"&&(this._showLoader=!0,this._signInParamValue=null))}loaded(){this._signInParamValue===null&&this._configContextConsumer.value?.authentication?.SignInParam&&(this._signInParamValue=this._configContextConsumer.value.authentication.SignInParam),this._resizeObserver=new ResizeObserver(async()=>{this._onResize()}),this._screenshotsElement.value&&this._resizeObserver.observe(this._screenshotsElement.value)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect()}render(){let e="padding-bottom-1-5",t=this._getRelatedResources(),i=this._getYouMayAlsoLikeCards();return a`<calcite-shell class="position-relative background-color-2"><calcite-panel class="panel-background-2 border-none" slot=panel-bottom><div class="margin-top-875 padding-1-5 back-color-override-1 margin-bottom-1-5" id=solution-details-row>${this._getSolutionRow()}</div><div class=${p(e)}>${this._getScreenshotsRow()}</div><div class=${p(e)}>${this._getOverviewRow()}</div><div class=${p(e)}>${this._getReleaseNotesRow()}</div>${t.length>0?a`<div class=${p(e)}>${this._getRelatedResourcesRow(t)}</div>`:""}${i.length>0?a`<div class=${p(e)}>${this._getYouMayAlsoLikeRow(i)}</div>`:""}<div class=${p(e)}>${this._getTermsOfUseRow()}</div>${this.isMobile?"":a`<solution-deploy-dialog .card=${this.card} @deployCancelled=${this._handleDeployCancelled} @deployFailed=${this._handleDeployFailed} @deployProgressEnd=${this._handleDeploySuccess} @deployProgressStart=${this._deployProgressStart} @deployProgressUpdated=${this._deployProgessUpdated} id=solutionDeployDialog .userOptions=${this._userOptions} ${h(this._deployDialogRef)}></solution-deploy-dialog>`}<solution-snapshot-gallery .card=${this.card} id=solutionSnapshotGallery .itemProperties=${this._itemProperties} ${h(this._screenshotsDialogRef)}></solution-snapshot-gallery><solution-deploying-dialog .card=${this.card} @deploymentProcessCancelled=${this._handleDeploymentProcessCancelled} ${h(this._deployingDialogRef)}></solution-deploying-dialog></calcite-panel></calcite-shell>`}updated(){setTimeout(()=>{let e=this._getYouMayAlsoLikeCards(),t=340;for(let i=0;i<e.length;i++){let l=this.el.shadowRoot?.getElementById(`you-may-also-like-${i}`),s=l?.offsetHeight?l.offsetHeight+40:0;s>t&&(t=s)}this._youMayAlsoLikeBaseHeight=t,this._showYouMayAlsoLikeShowMore=(this._youMayAlsoLikeElement.value?.scrollHeight||0)>this._youMayAlsoLikeBaseHeight,this._showScreenshotsShowMore=(this._screenshotsElement.value?.scrollHeight||0)>this._screenshotsRowBaseHeight+2},100)}_checkUrlParametersForAutoDeployment(){if(this._signInParamValue==="deploy"){let e=this._missingPrivilegeMessages&&(this._missingPrivilegeMessages.leadingMessages.length>0||this._missingPrivilegeMessages.bulletedMessages.length>0||this._missingPrivilegeMessages.trailingMessages.length>0);this._configContextConsumer.value?.authentication?.IsSignedIn&&this.card&&this._deployDialogRef.value&&!e&&!b(this._configContextConsumer.value)&&(this._signInParamValue=null,this._openDeploy())}}_getSolutionRow(){let e=this.card?.thumbnailUrl.replace(/w=\d+/,"w=400"),t=this._missingPrivilegeMessages?.leadingMessages||[],i=t.length>0,l=this._missingPrivilegeMessages?.bulletedMessages||[],s=l.length>0,o=this._missingPrivilegeMessages?.trailingMessages||[],r=o.length>0;return a`<div class="display-flex flex-direction-row width-full"><div class="padding-end-1-75 image-width"><img alt=${this.card?.title??u} src=${e??u}></div><div class="display-flex flex-direction-row flex-1">${this._getTextSection(i,s,r,t,l,o)}${this._getButtons()}</div></div>`}_getTextSection(e,t,i,l,s,o){return a`<div class="display-flex flex-direction-column padding-end-1 flex-1"><div class="display-flex flex-direction-row align-items-baseline"><h1 class="padding-top-xs title-font margin-top-0 margin-bottom-1-5 line-height-1" tabindex=0>${this.card?.title}</h1>${this._renderChips(this.card?.chips||[])}</div><div class="font-1 padding-end-1 line-height-xxl" tabindex=0>${this.card?.snippet}</div>${this.isMobile?"":b(this._configContextConsumer.value)?a`<div class="display-flex flex-direction-row padding-top-1">${this._getReadOnlyNotice()}</div>`:e||t||i?a`<div class="display-flex flex-direction-row padding-top-1">${this._getMissingPrivilegesNotice(l,s,o)}</div>`:""}</div>`}_renderChips(e){let t=e.filter(s=>s==="deployed"||s==="deployedOlderVersion"),i=e.filter(s=>s!=="deployed"&&s!=="deployedOlderVersion"),l=[];if(i.forEach(s=>{let o="margin-bottom-1-5 margin-sides-1 chip-status",r=`solution-details-card-chip-${s}`,c=s==="new"?"star":"mega-phone",n=s==="new"?this._translations.newChip:this._translations.updatedChip;l.push(a`<calcite-chip class=${p(o)} .icon=${c} id=${r??u} .label=${n} .value=${n} scale=s></calcite-chip><calcite-tooltip .referenceElement=${r}><span>${n}</span></calcite-tooltip>`)}),t.length>0){let s="margin-bottom-1-5 margin-sides-1 chip-status";i.length>0?s=t[0]==="deployedOlderVersion"?"chip-deployed-warn":"chip-deployed":s+=t[0]==="deployedOlderVersion"?" chip-deployed-warn":" chip-deployed",l.push(a`<calcite-chip class=${p(s)} .icon=${t[0]==="deployedOlderVersion"?"recent":"check-circle"} id=solution-details-card-chip-deployed .label=${this._translations.deployedChip} .value=${this._translations.deployedChip} scale=s></calcite-chip><calcite-tooltip placement=bottom reference-element=solution-details-card-chip-deployed @calciteTooltipBeforeOpen=${async()=>{let o={q:`${this.card?.deployCommonId} and owner:${this._configContextConsumer.value?.userSession?.username}`,authentication:this._configContextConsumer.value?.userSession,pagingParam:{start:1,num:100}},r=await A(o);this._deployedTooltipContent=a`<solutions-deployed-list .results=${r} has-links .listTitle=${t[0]==="deployedOlderVersion"?this._translations.deployedPreviousTitle:this._translations.deployedTitle}></solutions-deployed-list>`}} @calciteTooltipBeforeClose=${()=>{}}>${this._deployedTooltipContent}</calcite-tooltip>`)}return l}_getButtons(){let e=this._itemProperties?.demoURL||"",t=b(this._configContextConsumer.value);return a`<div class="display-flex flex-direction-column button-width">${!this.isMobile&&a`<calcite-button class="padding-bottom-1 solution-detail-action" .disabled=${this._isDeployDisabled||t} icon-flip-rtl=end @click=${()=>this._checkPermissionsBeforeDeploy()} scale=m width=full>${this._showLoader?a`<calcite-loader inline label></calcite-loader>`:this._translations.deployButton}</calcite-button>`||""}${!this._configContextConsumer.value?.isEnterprise&&e&&a`<calcite-button appearance=outline-fill kind=neutral class="padding-bottom-1 solution-detail-action" @click=${()=>this._handleWatchDemoClick(e)} scale=m width=full>${this._translations.watchDemo}</calcite-button>`||""}<calcite-button appearance=outline-fill kind=neutral class="padding-bottom-1 solution-detail-action" @click=${()=>this._handleLearnMoreClick()} scale=m width=full>${this._translations.openHelp}</calcite-button>${!this._configContextConsumer.value?.isEnterprise&&a`<solution-social-share button-appearance=outline-fill class="padding-bottom-1" share-button-kind=neutral .shareButtonText=${this._translations.share} share-button-scale=m .solutionId=${this.card?.deployCommonId||""} .solutionTitle=${this.card?.title||""} .solutionVersion=${this.card?.deployVersion||""}></solution-social-share>`||""}</div>`}_getReadOnlyNotice(){return a`<calcite-notice class="margin-inline-unset" icon=exclamation-mark-triangle kind=warning open scale=s><div slot=message .innerHTML=${this.readOnlyNotice??""}></div></calcite-notice>`}_getMissingPrivilegesNotice(e,t,i){let l="solutions-missing-privileges-notice",s=this._translations.missingPrivilegesPopup.missingLicensingOrPrivileges,o=t.length>0?"":"display-none",r=t.length>0?"padding-top-sm":"";return a`<div><calcite-notice class="margin-inline-unset" kind=info open><div slot=message>${`${s}`}</div><calcite-action icon=information id=${l} slot=actions-end .text=${s}></calcite-action></calcite-notice><calcite-popover closable label overlay-positioning=fixed placement=bottom reference-element=solutions-missing-privileges-notice ${h(this._privilegePopoverRef)}><div class="padding-1 display-flex flex-direction-column">${this._getSpanMessages(e,"padding-bottom-1")}<span class=${`padding-bottom-1-2 ${o}`}>${this._translations.missingPrivilegesPopup.missingPrivilegesListHeading}</span>${this._getBulletedMessages(t)}${this._getSpanMessages(i,r)}</div></calcite-popover></div>`}_getSpanMessages(e,t){return e.length>0?e.map(i=>a`<span class=${p(t)}>${i}</span>`):""}_getBulletedMessages(e){return e.length>0?a`<ul>${e.map(t=>a`<li>${t}</li>`)}</ul>`:""}_getScreenshotsRow(){let e=this._isScreenshotsRowExpanded?this._translations.showLess:this._translations.showMore,t=this._isScreenshotsRowExpanded?"arrow-up":"arrow-down",i=this._showScreenshotsShowMore?"":"display-none";return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._screenshotsAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.solutionOverview}</div><calcite-panel><div class="display-flex flex-direction-column back-color-override-1"><div class="collapsible-div max-height-300" id=screenshots-subsection ${h(this._screenshotsElement)}>${this._getScreenshots()}</div><calcite-fab appearance=outline-fill class=${`align-self-center ${i}`} .icon=${t} kind=neutral @click=${()=>{this._screenshotsElement.value?.classList.toggle("expanded"),this._isScreenshotsRowExpanded=this._screenshotsElement.value.classList.contains("expanded")}} .text=${e} text-enabled></calcite-fab></div></calcite-panel></calcite-accordion-item></calcite-accordion>`}_getScreenshots(){let e=this._itemProperties?.preview.filter(s=>s.format==="image")||[],t=this._configContextConsumer.value,i=this._itemFetched?"":"display-none",l=this._itemFetched?"display-none":"";return a`<calcite-loader class=${p(l)} label></calcite-loader><calcite-card-group class=${`card-group ${i}`} .label=${this._translations.solutionOverview}>${e.reduce((s,o)=>{let r=$(this.card?.id||"",o.name,t.authentication),c;return t.agoBasedEnterpriseSolutionsGroupId&&t.isEnterprise&&(c=$(this.card?.id||"",o.name,void 0,t.agolPortalUrl)),this.card?.id?s.push(a`<calcite-card class=${`${this.isMobile?"is-mobile":"cursor-pointer not-mobile"}`} .label=${o.alt} @click=${()=>this._openScreenshotGallery(o)} @keydown=${n=>F(n,()=>this._openScreenshotGallery(o))}><div class="card-image-wrap" slot=thumbnail><img alt=${o.alt??u} class="thumbnail card-image" slot=thumbnail src=${(c||r)??u}>${!this.isMobile&&a`<div class="hover-text">${this._translations.openInGallery}</div>`||""}</div></calcite-card>`):s.push(""),s},[])}</calcite-card-group>`}_openScreenshotGallery(e){if(!this.isMobile){this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Screenshot Gallery",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]});let t=this._screenshotsDialogRef.value;t&&(t.screenshot=e,t.open=!0)}}_getOverviewRow(){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._overviewAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.solutionDetails}</div>${this._getDescriptionRow()}${this._getInformationProductsRow()}</calcite-accordion-item></calcite-accordion>`}_getDescriptionRow(){return a`<div class="display-flex flex-direction-column"><div class="font-color-2 font-1 margin-top-0 line-height-xxl padding-bottom-xxl" tabindex=0>${this.card?.snippet}</div><div class="font-color-2 font-1 margin-top-0 line-height-xxl padding-bottom-xxl" .innerHTML=${this.card?.description??""} tabindex=0></div></div>`}_getInformationProductsRow(){return a`<div class="display-flex flex-direction-column font-1 line-height-xxl font-color-2"><span tabindex=0>${this.card?.title?this._translations.informationProductsSubText.replace("{{solutionTitle}}",this.card.title):""}</span><calcite-table bordered caption class="padding-top-1">${this._getInformationTableHeaderRow()}${this._getInformationTableRows()}</calcite-table><p tabindex=0>${this._translations.informationProductsFooterText}</p></div>`}_getInformationTableHeaderRow(){return a`<calcite-table-row slot=table-header><calcite-table-header .heading=${this._translations.solutionItem}></calcite-table-header><calcite-table-header .heading=${this._translations.description}></calcite-table-header><calcite-table-header .heading=${this._translations.minimumUserType}></calcite-table-header></calcite-table-row>`}_getInformationTableRows(){return(this._itemProperties?.infoProducts||[]).map(e=>a`<calcite-table-row><calcite-table-cell><p class="table-cell" .innerHTML=${_(e.item)??""}></p></calcite-table-cell><calcite-table-cell><p class="table-cell" .innerHTML=${_(e.description)??""}></p></calcite-table-cell><calcite-table-cell><p class="table-cell" .innerHTML=${_(e.userType)??""}></p></calcite-table-cell></calcite-table-row>`)}_getReleaseNotesRow(){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._releaseNotesAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.releaseNotes}</div><div class="display-flex flex-direction-column"><calcite-table bordered caption>${this._getReleaseNotesTableHeaderRow()}${this._getReleaseNotesTableRows()}</calcite-table></div></calcite-accordion-item></calcite-accordion>`}_getReleaseNotesTableHeaderRow(){return a`<calcite-table-row slot=table-header><calcite-table-header .heading=${this._translations.version}></calcite-table-header><calcite-table-header .heading=${this._translations.description}></calcite-table-header></calcite-table-row>`}_getReleaseNotesTableRows(){return(this._itemProperties?.releaseNotes||[])?.map(e=>a`<calcite-table-row><calcite-table-cell><p class="table-cell" .innerHTML=${_(e.version)??""}></p></calcite-table-cell><calcite-table-cell><p class="table-cell" .innerHTML=${_(e.description)??""}></p></calcite-table-cell></calcite-table-row>`)}_getRelatedResourcesRow(e){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._relatedResourcesAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.relatedResources}</div><div class="display-flex flex-direction-row">${e.map(()=>{a`<solution-resource-card></solution-resource-card>`})}</div></calcite-accordion-item></calcite-accordion>`}_getRelatedResources(){return[]}_getYouMayAlsoLikeRow(e){let t=this._showYouMayAlsoLikeShowMore?"":"display-none",i=this._isYouMayAlsoLikeRowExpanded?this._translations.showLess:this._translations.showMore,l=this._isYouMayAlsoLikeRowExpanded?"arrow-up":"arrow-down",s=this._isYouMayAlsoLikeRowExpanded?"":{height:`${this._youMayAlsoLikeBaseHeight}px`};return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._youMayAlsoLikeAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.youMayAlsoLike}</div><div class="display-flex flex-direction-column"><div class="collapsible-div" id=you-may-also-like-subsection style=${M(s)} ${h(this._youMayAlsoLikeElement)}><div class="display-flex flex-direction-row"><calcite-card-group class="card-group" .label=${this._translations.youMayAlsoLike}>${e.map((o,r)=>a`<solution-details-card .id=${`you-may-also-like-${r}`} .card=${o} class="padding-2px" source=you-may-also-like .referrerSolutionId=${this.card?.deployCommonId||""} .referrerSolutionTitle=${this.card?.title||""} .referrerSolutionVersion=${this.card?.deployVersion||""}></solution-details-card>`)}</calcite-card-group></div></div><calcite-fab appearance=outline-fill class=${`align-self-center ${t}`} .icon=${l} kind=inverse @click=${()=>{this._youMayAlsoLikeElement.value?.classList.toggle("expanded"),this._isYouMayAlsoLikeRowExpanded=this._youMayAlsoLikeElement.value.classList.contains("expanded")}} .text=${i} text-enabled></calcite-fab></div></calcite-accordion-item></calcite-accordion>`}_getYouMayAlsoLikeCards(){let e=this._itemProperties?.relatedSolutions||[];return this._allCards.filter(t=>e.indexOf(t.deployCommonId)>-1)}_getTermsOfUseRow(){return a`<calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded ${h(this._termsOfUseAccordionItemElement)}><div class="margin-block-start-end-0 heading-font" slot=content-start>${this._translations.termsOfUse}</div><div class="font-color-2" .innerHTML=${(this.card?.licenseInfo||"")??""} tabindex=0></div></calcite-accordion-item></calcite-accordion>`}_openDeploy(){if(this._configContextConsumer.value.authentication.IsSignedIn){let e=this._deployDialogRef.value;if(e){let t=m(this.card?.typeKeywords);this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Deploy Dialog Opened",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","",t]}),e.userOptions=this._userOptions,e.open=!0}}else this._configContextConsumer.value.authentication.signIn("deploy")}_openUrl(e){window.open(e,"_blank")}_handleWatchDemoClick(e){this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Watch Demo",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),this._openUrl(e)}_handleLearnMoreClick(){this._telemetry?.logEvent({category:g.SOLUTION_DETAILS,action:"Open Help",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),this._openUrl(this.card?.learnMoreUrl||"")}async _detailsCardSelected(e){this.card=e.detail,this.el.scrollIntoView(!0),this._onResize(),this._missingPrivilegeMessages=void 0,await this._getItemData(),this._expandAccordions()}_expandAccordions(){this._overviewAccordionItemElement.value&&(this._overviewAccordionItemElement.value.expanded=!0),this._releaseNotesAccordionItemElement.value&&(this._releaseNotesAccordionItemElement.value.expanded=!0),this._relatedResourcesAccordionItemElement.value&&(this._relatedResourcesAccordionItemElement.value.expanded=!0),this._screenshotsAccordionItemElement.value&&(this._screenshotsAccordionItemElement.value.expanded=!0),this._termsOfUseAccordionItemElement.value&&(this._termsOfUseAccordionItemElement.value.expanded=!0),this._youMayAlsoLikeAccordionItemElement.value&&(this._youMayAlsoLikeAccordionItemElement.value.expanded=!0)}async _getItemData(){this._itemFetched=!1;let e=this._configContextConsumer.value,t=e?.agoBasedEnterpriseSolutionsGroupId&&e?.isEnterprise?e.anonAgolSession:e?.userSession,i=await P(this.card.id,t),l=await E(this.card.id,t);this._itemFetched=!0,this._itemProperties=l.properties,this.itemPropertiesFetched.emit(this._itemProperties);let s=U(i,this.card.typeKeywords,e?.authentication);this._privileges=t.username?s:[],this._userPrivileges=e?.authentication?e.authentication.PortalUserEnrichedPrivileges:[];let o=this._privileges.filter(c=>!this._userPrivileges.includes(c));this._missingPrivilegeMessages=V(this._translations,o),this._isDeployDisabled=this._missingPrivilegeMessages&&(this._missingPrivilegeMessages.leadingMessages.length>0||this._missingPrivilegeMessages.bulletedMessages.length>0||this._missingPrivilegeMessages.trailingMessages.length>0);let r=i.params?await this.formatParams(i.params):[];this._userOptions=r,this._templates=i.templates,this.templatesFetched.emit(i.templates),this._checkUrlParametersForAutoDeployment(),this._isLoaded=!0,this._showLoader&&(this._showLoader=!1,this._isDeployDisabled||this._openDeploy())}formatParams(e){let t=this._configContextConsumer.value.userSession,i=[],l=e?Object.keys(e):[],s={id:"",props:[],accordionDisplay:!1};if(l.length>0){let o=[];return l.forEach(r=>{let c=e[r];c.valueType&&c.valueType.toLowerCase()==="itemid"&&o.push(this._findExistingItem(r,"Feature Service",t.username||""))}),Promise.all(o).then(r=>{let c={};return r.forEach(n=>{if(n.query&&n.results&&n.results.length>0){let B=n.query.split(" ")[0].replace("typekeywords:source-","");c[B]={resultId:n.results[0].id,response:n.results[0]}}}),l.forEach(n=>{if(n==="serviceLearnMore"){this._configureLearnMore=e[n],alert(this._configureLearnMore),delete e[n];return}e[n].enterpriseIDMapping&&(this._customDeploymentMappings[n]=e[n].enterpriseIDMapping),s.id=n,c[n]&&(e[n].existingItemId=c[n].resultId,this.updateUserProp(e[n],c[n].response)),this.updateOption(e[n],s,n)}),i.push(s),Promise.resolve(i)}).catch(()=>Promise.resolve([]))}else return Promise.resolve([])}_findExistingItem(e,t,i){let l=this._configContextConsumer.value.userSession;return z(`typekeywords:source-${e} type:${t} owner:${i}`,l)}updateUserProp(e,t){let i=e.itemType?.toLowerCase()==="feature service",l=new RegExp(i?this._regexFsUrl:e.itemType,"iu"),s=x(t,i?"url":"type","")||"",o=s!==""&&l.test(s);return e.responseValue=o?s:"",e.name=o&&y(t,"name")||"",e.title=o&&y(t,"title")||"",e.itemType=o?y(t,"type"):e.itemType,e.validId=o,e.itemUrl=H(t.id,this._configContextConsumer.value.authentication),o}updateOption(e,t,i){let l=e.default||"",s=typeof l,o=l.toString();this._setFeatureServiceProps(e);let r=this.getValidation(e,o);t.props.push({id:i,outType:s,prop:i,itemType:e.itemType||"",responseValue:e.responseValue||"",label:e.label||"",choices:e.choices||[],valueType:e.valueType.toLowerCase(),attributes:e.attributes||{},value:e.existingItemId&&e.valueType.toLowerCase()==="itemid"?e.existingItemId:o,default:o,srSearchText:o,autoSelect:o!=="",...r,loading:!1,validId:!0,tooltip:e.tooltip||"",name:e.name||"",title:e.title||"",itemUrl:e.itemUrl||""})}_setFeatureServiceProps(e){e.valueType&&e.valueType.toLowerCase()==="itemid"&&R(e,"attributes.required","true")}getValidation(e,t){let i="",l=y(e,"validation.message")||"",s=!0;return y(e,"attributes.required")==="true"&&(i=x(e,"validation.expression","\\S{1,}"),s=new RegExp(i).test(t)),e.valueType&&e.valueType.toLowerCase()==="itemid"&&(i=this._regexID,l=this._translations.configure.invalidID),{valid:s,validation:{expression:i,message:l}}}_allCardsFetched(e){this._allCards=e.detail}_onResize(){this._showYouMayAlsoLikeShowMore=(this._youMayAlsoLikeElement.value?.scrollHeight||0)>this._youMayAlsoLikeBaseHeight,this._showScreenshotsShowMore=(this._screenshotsElement.value?.scrollHeight||0)>this._screenshotsRowBaseHeight+2}_cleanupPanel(){this.el.scrollIntoView(!0),this._isScreenshotsRowExpanded=!1,this._showScreenshotsShowMore=!1,this._screenshotsElement.value?.classList.remove("expanded"),this._isYouMayAlsoLikeRowExpanded=!1,this._showYouMayAlsoLikeShowMore=!1,this._youMayAlsoLikeElement.value?.classList.remove("expanded"),this._privilegePopoverRef.value?.open&&(this._privilegePopoverRef.value.open=!1),this._isDeployDisabled=!1,this._isLoaded=!1,this._itemFetched=!1,this._showLoader=!1,this._expandAccordions()}_handleDeployAppTabSelected(e){e.detail==="details"&&this.sortTypeChanged.emit("")}_checkPermissionsBeforeDeploy(){b(this._configContextConsumer.value)||(this._isLoaded?this._openDeploy():this._configContextConsumer.value.authentication?.IsSignedIn?this._showLoader=!0:this._openDeploy())}};D("solution-details-panel",C);return C},b,c,e)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import d from"./AH3PJQ6A.js";import"./HYQVSB6C.js";import c from"./UTZUXO5F.js";import"./PNESECPO.js";import"./5DEYOM7D.js";import"./ONARC6AZ.js";import"./NQH7ZZWD.js";import"./2BIUOM64.js";import b from"./OANAQ6HY.js";import a from"./UBEU6ULP.js";import"./2B4SGB3I.js";import"./I2NTSKBD.js";import"./AE5HNAOV.js";import"./MGEDATQ7.js";import"./RMEDO4JC.js";import"./ISFTCFSJ.js";import"./TEHBW75B.js";import"./IHG7KTNC.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./YKB6256M.js";import"./N22MFQSQ.js";import"./N7BXCDA3.js";import"./ZX3UHK6P.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LP2JYX4X.js";import"./GF4QELNV.js";import"./AYSQIO6L.js";import"./YQHYMLC7.js";import"./DKD2EGQP.js";import"./5O53T3SW.js";import"./AJZDBHB6.js";import"./FES7B3SJ.js";import"./2I5LGZNX.js";import"./FFF5HUPM.js";import"./QPIMTXPL.js";export default $arcgis.t(([,,,{b:o}])=>{return o},a,b,c,d)
2
+ import d from"./DO7NLLUV.js";import"./HYQVSB6C.js";import c from"./5O7LFBHI.js";import"./PNESECPO.js";import"./HQLA2AI4.js";import"./ONARC6AZ.js";import"./NQH7ZZWD.js";import"./2BIUOM64.js";import b from"./OANAQ6HY.js";import a from"./UBEU6ULP.js";import"./2B4SGB3I.js";import"./I2NTSKBD.js";import"./AE5HNAOV.js";import"./MGEDATQ7.js";import"./RMEDO4JC.js";import"./ISFTCFSJ.js";import"./TEHBW75B.js";import"./IHG7KTNC.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./YKB6256M.js";import"./N22MFQSQ.js";import"./N7BXCDA3.js";import"./ZX3UHK6P.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LP2JYX4X.js";import"./GF4QELNV.js";import"./AYSQIO6L.js";import"./YQHYMLC7.js";import"./DKD2EGQP.js";import"./5O53T3SW.js";import"./AJZDBHB6.js";import"./FES7B3SJ.js";import"./2I5LGZNX.js";import"./FFF5HUPM.js";import"./QPIMTXPL.js";export default $arcgis.t(([,,,{b:o}])=>{return o},a,b,c,d)