@esri/solutions-components 5.0.2-next.6 → 5.0.2-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{XOO4MQ4X.js → 2DAM5BYX.js} +1 -1
- package/dist/cdn/{ULDNFSZC.js → 2UMRDDIV.js} +1 -1
- package/dist/cdn/{4XMWC6IV.js → 3B4FA5CV.js} +1 -1
- package/dist/cdn/{UJSTWEYZ.js → 3ELXQUHH.js} +1 -1
- package/dist/cdn/{Y7OWLSUL.js → 3LEJ44U2.js} +1 -1
- package/dist/cdn/{H4AQ3NOB.js → 3M6AYSM7.js} +1 -1
- package/dist/cdn/{CDTD573U.js → 4OZQG5MW.js} +1 -1
- package/dist/cdn/{CO37Q2G7.js → 5UEEUPL5.js} +1 -1
- package/dist/cdn/{HFSCLHH3.js → 5VP4DXWE.js} +1 -1
- package/dist/cdn/{Q7XZ2WSI.js → 5W3ANKBB.js} +1 -1
- package/dist/cdn/{ET27C34M.js → 5Z32YRHM.js} +1 -1
- package/dist/cdn/{K7HI6WU5.js → 6BEDO5MX.js} +1 -1
- package/dist/cdn/{V5DYUI5A.js → 6CJGNF3Y.js} +1 -1
- package/dist/cdn/{JCIUAWOV.js → 6EFUV7CH.js} +1 -1
- package/dist/cdn/{QKVN24LI.js → 6LPOLFT7.js} +1 -1
- package/dist/cdn/{EAP3T73G.js → 6RXHEPPS.js} +1 -1
- package/dist/cdn/{BN2OKCTV.js → 73LVZIP7.js} +1 -1
- package/dist/cdn/{VPQWJHDX.js → 7UXCJXCE.js} +1 -1
- package/dist/cdn/{NUVM3TEI.js → ALDUB3A4.js} +1 -1
- package/dist/cdn/{6QDXYJ2A.js → BNQ63VOG.js} +1 -1
- package/dist/cdn/{BN7W4V6O.js → BVWFZPY7.js} +1 -1
- package/dist/cdn/{N7QXUPEE.js → CK7LURBK.js} +1 -1
- package/dist/cdn/{653SJFXP.js → CTRHHRDP.js} +1 -1
- package/dist/cdn/{UCJQY6QB.js → D2QNPQWY.js} +1 -1
- package/dist/cdn/{2RABE6MU.js → D37HOE6T.js} +1 -1
- package/dist/cdn/{FGR7TVGE.js → DUEAJUQG.js} +1 -1
- package/dist/cdn/{M63QPB4V.js → DZUVI4S3.js} +1 -1
- package/dist/cdn/{I3SA63N4.js → E4L5GTBZ.js} +1 -1
- package/dist/cdn/{TOPWR24E.js → E74QDAYN.js} +1 -1
- package/dist/cdn/{DLMYZ6ZN.js → EH43P34B.js} +1 -1
- package/dist/cdn/{2P5ILJMU.js → EL4G77RV.js} +1 -1
- package/dist/cdn/{ETMW3Z3K.js → ERFCQNCV.js} +1 -1
- package/dist/cdn/{X3XKJE25.js → EUZCYCCK.js} +1 -1
- package/dist/cdn/{YQYUGVWA.js → EVFB6G4J.js} +1 -1
- package/dist/cdn/{IYTHORN5.js → FJSRWM5L.js} +1 -1
- package/dist/cdn/{BBLQ4DLJ.js → FL74XITX.js} +1 -1
- package/dist/cdn/{UGXAX5D3.js → GJJOB4RR.js} +1 -1
- package/dist/cdn/{ZE5JXFPR.js → GXXXAGCI.js} +1 -1
- package/dist/cdn/{GYKTRMNC.js → H5ZE4RIC.js} +1 -1
- package/dist/cdn/{YU5HCUEF.js → HAAFUV3J.js} +1 -1
- package/dist/cdn/{3WKRKVN4.js → HDIQAOAL.js} +1 -1
- package/dist/cdn/{I2RB3ZK5.js → HNRZHAOD.js} +1 -1
- package/dist/cdn/{2M7N6LPR.js → HPBIBS4W.js} +1 -1
- package/dist/cdn/{X5T425K7.js → I2FILQIE.js} +1 -1
- package/dist/cdn/{OHXRTGLZ.js → I3OLKEFJ.js} +1 -1
- package/dist/cdn/{5F66HK4S.js → IDEWFRKI.js} +1 -1
- package/dist/cdn/{DD3JC2L3.js → JE7L7M3J.js} +1 -1
- package/dist/cdn/{6VTGA46N.js → JHOXJY5O.js} +1 -1
- package/dist/cdn/{5UAKLHDN.js → JN4HYWSX.js} +1 -1
- package/dist/cdn/{WVAU657C.js → JQFNYWZI.js} +1 -1
- package/dist/cdn/{SKTW2DTJ.js → JQO5U72D.js} +1 -1
- package/dist/cdn/{P3NBQIFK.js → JQU7O6FD.js} +1 -1
- package/dist/cdn/{6YDPEFML.js → JVMVZ2RC.js} +1 -1
- package/dist/cdn/{YRN6NQC6.js → KDKRXEOX.js} +1 -1
- package/dist/cdn/{7VEBBW3O.js → KVR3XE7B.js} +1 -1
- package/dist/cdn/{TAAFNJJG.js → LGUC7DRT.js} +1 -1
- package/dist/cdn/{ACCRMKQI.js → LTBO6VJF.js} +1 -1
- package/dist/cdn/{YUCIOMKU.js → MAVNADWN.js} +1 -1
- package/dist/cdn/N5PYWRMD.js +2 -0
- package/dist/cdn/{PF7VCNOY.js → N5YBX6NM.js} +1 -1
- package/dist/cdn/{4FHS5SYC.js → N7RLYKQG.js} +1 -1
- package/dist/cdn/{PH6E5VEX.js → NLNE5H6M.js} +1 -1
- package/dist/cdn/{QAZVEVP5.js → O2OYKALV.js} +1 -1
- package/dist/cdn/{Y6QXO4MV.js → OAWQFVGG.js} +1 -1
- package/dist/cdn/{XV34GT2B.js → OJLSK25V.js} +1 -1
- package/dist/cdn/{3XA5R24U.js → P3AXNFRS.js} +1 -1
- package/dist/cdn/{ECIJI2EF.js → P6ETLC5A.js} +1 -1
- package/dist/cdn/{TUBYR7DR.js → PNBTKFO6.js} +1 -1
- package/dist/cdn/{KJSSBTJF.js → QKGOQ7EC.js} +1 -1
- package/dist/cdn/{Y6GYY3TH.js → RDWJHF5P.js} +1 -1
- package/dist/cdn/{C5NTEEMX.js → RIWLHWBH.js} +1 -1
- package/dist/cdn/{ZL6A7VRS.js → RTSKNY33.js} +1 -1
- package/dist/cdn/{BHP43GOA.js → SETNDPAB.js} +1 -1
- package/dist/cdn/{VY4VI4VX.js → T5ZR5RSW.js} +1 -1
- package/dist/cdn/{ZE5JOQG7.js → TAXUQXTN.js} +1 -1
- package/dist/cdn/{PF3DUV4R.js → TP6FTOYI.js} +1 -1
- package/dist/cdn/{N4KU3YV3.js → TPRPYUVX.js} +1 -1
- package/dist/cdn/{Z22WUH5B.js → U75PDOJF.js} +1 -1
- package/dist/cdn/{SA34OEYY.js → UGKLBL7D.js} +1 -1
- package/dist/cdn/{I5FU5F72.js → UR6OMPID.js} +1 -1
- package/dist/cdn/{QMDTLWB6.js → USIESVTZ.js} +1 -1
- package/dist/cdn/{VS7Q2BDJ.js → V65IKENN.js} +1 -1
- package/dist/cdn/{S5XSLTYG.js → VCH6XDEH.js} +1 -1
- package/dist/cdn/{WCKVYL7Q.js → VQFRDGSZ.js} +1 -1
- package/dist/cdn/{H4SMK2IM.js → XJWEK5VT.js} +1 -1
- package/dist/cdn/{TXGCOPR2.js → XUFPQNGT.js} +1 -1
- package/dist/cdn/{GRUGONVG.js → Y3FTYVXY.js} +1 -1
- package/dist/cdn/{64I67VMK.js → Y4TNT6PF.js} +1 -1
- package/dist/cdn/{PLCLZYNU.js → YT2QG2ST.js} +1 -1
- package/dist/cdn/{NTFCCIR6.js → ZVJIHRYK.js} +1 -1
- package/dist/cdn/{43NWVIMB.js → ZZ3AVDZU.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/solution-details-panel/customElement.js +11 -11
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/solutions-components_commit.txt +5 -8
- package/package.json +1 -1
- package/dist/cdn/KBXJXULA.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import d from"./EAV7DUA3.js";import c from"./S6EMQP4I.js";import b from"./P5ERFKR2.js";import a from"./GPP5RTWG.js";import{a as K}from"./4T7P5RXF.js";import{b as Se}from"./Y7OWLSUL.js";import"./GDPFKW75.js";import{G as Ee,H as ze,J as _,K as E,h as ke,i as L,j as ue,l as fe,u as Re}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([Ge,D,ce,it,,,{a:B,b:W},{a:Ie,b:ve,d:Pe,e:Te,f:he,g:Fe,i:Me,o:pe,s:He,t:Z,u:me,v:Ue,w:Be}])=>{(function($,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):($=typeof globalThis<"u"?globalThis:$||self,e($.maquette={}))})(void 0,(function($){"use strict";var e=function(){var t,i;return{invalidate:function(){i=void 0,t=void 0},result:function(a,l){if(t)for(var p=0;p<a.length;p++)t[p]!==a[p]&&(i=void 0);return i||(i=l(),t=a),i}}},s="http://www.w3.org/",c="".concat(s,"2000/svg"),n="".concat(s,"1999/xlink"),r=[],u=function(t,i){var a={};return Object.keys(t).forEach(function(l){a[l]=t[l]}),i&&Object.keys(i).forEach(function(l){a[l]=i[l]}),a},h=function(t,i){return t.vnodeSelector!==i.vnodeSelector?!1:t.properties&&i.properties?t.properties.key!==i.properties.key?!1:t.properties.bind===i.properties.bind:!t.properties&&!i.properties},w=function(t){if(typeof t!="string")throw new Error("Style values must be strings")},b=function(t,i,a){if(i.vnodeSelector!==""){for(var l=a;l<t.length;l++)if(h(t[l],i))return l}return-1},z=function(t,i,a,l){var p=t[i];if(p.vnodeSelector!==""){var o=p.properties,A=o?o.key===void 0?o.bind:o.key:void 0;if(!A){for(var v=0;v<t.length;v++)if(v!==i){var d=t[v];if(h(d,p))throw Object.assign(new Error("".concat(a.vnodeSelector," had a ").concat(p.vnodeSelector," child ").concat(l==="added"?l:"removed",", but there is now more than one. You must add unique key properties to make them distinguishable.")),{parentNode:a,childNode:p})}}}},k=function(t){if(t.properties){var i=t.properties.enterAnimation;i&&i(t.domNode,t.properties)}},x=[],S=!1,I=function(t){(t.children||[]).forEach(I),t.properties&&t.properties.afterRemoved&&t.properties.afterRemoved.apply(t.properties.bind||t.properties,[t.domNode])},P=function(){S=!1,x.forEach(I),x.length=0},R=function(t){x.push(t),S||(S=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(P,{timeout:16}):setTimeout(P,16))},F=function(t){var i=t.domNode;if(t.properties){var a=t.properties.exitAnimation;if(a){i.style.pointerEvents="none";var l=function(){i.parentNode&&(i.parentNode.removeChild(i),R(t))};a(i,l,t.properties);return}}i.parentNode&&(i.parentNode.removeChild(i),R(t))},G=["on","afterCreate","afterUpdate","afterRemoved","enterAnimation","exitAnimation","updateAnimation"];function O(t){return!G.includes(t)}var j=function(t,i,a){if(i){for(var l=a.eventHandlerInterceptor,p=Object.keys(i).filter(O),o=p.length,A=0;A<o;A++){var v=p[A],d=i[v];if(v==="className")throw new Error('Property "className" is not supported, use "class".');if(v==="class")re(t,d,!0);else if(v==="classes")for(var f=Object.keys(d),C=f.length,y=0;y<C;y++){var m=f[y];d[m]&&t.classList.add(m)}else if(v==="styles")for(var M=Object.keys(d),T=M.length,y=0;y<T;y++){var J=M[y],ee=d[J];ee&&(w(ee),a.styleApplyer(t,J,ee))}else if(v!=="key"&&d!==null&&d!==void 0){var oe=typeof d;oe==="function"?(v.lastIndexOf("on",0)===0&&l&&(d=l(v,d,t,i)),t[v]=d):a.namespace===c?v==="href"?t.setAttributeNS(n,v,d):t.setAttribute(v,d):oe==="string"&&v!=="value"&&v!=="innerHTML"?t.setAttribute(v,d):t[v]=d}}if(i.on)for(var te=0,de=Object.entries(i.on);te<de.length;te++){var X=de[te],Y=X[0],Q=X[1],ie=typeof Q=="function"?Q:Q.listener;l&&(ie=l(Y,ie,t,i)),ie&&t.addEventListener(Y,ie,typeof Q=="function"?void 0:Q.options)}}},H=function(t,i,a){if(i)for(var l=0,p=i;l<p.length;l++){var o=p[l];q(o,t,void 0,a)}},U=function(t,i,a){H(t,i.children,a),i.text&&(t.textContent=i.text),j(t,i.properties,a),i.properties&&i.properties.afterCreate&&i.properties.afterCreate.apply(i.properties.bind||i.properties,[t,a,i.vnodeSelector,i.properties,i.children])},q=function(t,i,a,l){var p,o,A=0,v=t.vnodeSelector,d=i.ownerDocument;if(v==="")t.domNode?t.domNode.nodeValue=t.text:(o=t.domNode=d.createTextNode(t.text),a!==void 0?i.insertBefore(o,a):i.appendChild(o));else{for(var f=0;f<=v.length;++f){var C=v.charAt(f);if(f===v.length||C==="."||C==="#"){var y=v.charAt(A-1),m=v.slice(A,f);y==="."?o.classList.add(m):y==="#"?o.id=m:(m==="svg"&&(l=u(l,{namespace:c})),l.namespace!==void 0?o=t.domNode=d.createElementNS(l.namespace,m):(o=t.domNode=t.domNode||(!((p=t.properties)===null||p===void 0)&&p.is?d.createElement(m,{is:t.properties.is}):d.createElement(m)),m==="input"&&t.properties&&t.properties.type!==void 0&&o.setAttribute("type",t.properties.type)),a!==void 0?i.insertBefore(o,a):o.parentNode!==i&&i.appendChild(o)),A=f+1}}U(o,t,l)}},N,re=function(t,i,a){i&&i.split(" ").forEach(function(l){l&&t.classList.toggle(l,a)})},Xe=function(t,i,a,l){if(a){for(var p=!1,o=Object.keys(a).filter(O),A=o.length,v=0;v<A;v++){var d=o[v],f=a[d],C=i[d];if(d==="class")C!==f&&(re(t,C,!1),re(t,f,!0));else if(d==="classes")for(var y=t.classList,m=Object.keys(f),M=m.length,T=0;T<M;T++){var J=m[T],ee=!!f[J],oe=!!C[J];ee!==oe&&(p=!0,ee?y.add(J):y.remove(J))}else if(d==="styles")for(var te=Object.keys(f),de=te.length,T=0;T<de;T++){var X=te[T],Y=f[X],Q=C[X];Y!==Q&&(p=!0,Y?(w(Y),l.styleApplyer(t,X,Y)):l.styleApplyer(t,X,""))}else if(!f&&typeof C=="string"&&(f=""),d==="value"){var ie=t[d];ie!==f&&f!==C&&(t[d]=f),f!==C&&(p=!0)}else if(f!==C){var Ce=typeof f;(Ce!=="function"||!l.eventHandlerInterceptor)&&(l.namespace===c?d==="href"?t.setAttributeNS(n,d,f):t.setAttribute(d,f):Ce==="string"&&d!=="innerHTML"?d==="role"&&f===""?t.removeAttribute(d):t.setAttribute(d,f):t[d]!==f&&(t[d]=f),p=!0)}}return p}},Ye=function(t,i,a,l,p){if(a===l)return!1;a=a||r,l=l||r;for(var o=a.length,A=l.length,v=0,d=0,f,C=!1;d<A;){var y=v<o?a[v]:void 0,m=l[d];if(y!==void 0&&h(y,m))C=N(y,m,p,i,a)||C,v++;else{var M=b(a,m,v+1);if(M>=0){for(f=v;f<M;f++)F(a[f]),z(a,f,t,"removed");C=N(a[M],m,p,i,a)||C,v=M+1}else q(m,i,v<o?a[v].domNode:void 0,p),k(m),z(l,d,t,"added")}d++}if(o>v)for(f=v;f<o;f++)F(a[f]),z(a,f,t,"removed");return C};N=function(t,i,a,l,p){var o=t.domNode,A=!1;if(t===i)return!1;var v=!1;if(i.vnodeSelector===""){if(i.text!==t.text){var d=o.ownerDocument.createTextNode(i.text);try{l.replaceChild(d,o)}catch{l.replaceChild(d,l.childNodes[p.indexOf(t)])}return i.domNode=d,A=!0,A}i.domNode=o}else i.vnodeSelector.lastIndexOf("svg",0)===0&&(a=u(a,{namespace:c})),t.text!==i.text&&(v=!0,i.text===void 0?o.removeChild(o.firstChild):o.textContent=i.text),i.domNode=o,v=Ye(i,o,t.children,i.children,a)||v,v=Xe(o,t.properties,i.properties,a)||v,i.properties&&i.properties.afterUpdate&&i.properties.afterUpdate.apply(i.properties.bind||i.properties,[o,a,i.vnodeSelector,i.properties,i.children]);return v&&i.properties&&i.properties.updateAnimation&&i.properties.updateAnimation(o,i.properties,t.properties),A};var se=function(t,i){return{getLastRender:function(){return t},update:function(a){if(t.vnodeSelector!==a.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");var l=t;t=a,N(l,a,i,l.domNode.parentNode,[l])},domNode:t.domNode}},Qe={namespace:void 0,performanceLogger:function(){},eventHandlerInterceptor:void 0,styleApplyer:function(t,i,a){i.charAt(0)==="-"?t.style.setProperty(i,a):t.style[i]=a}},V=function(t){return u(Qe,t)},le={create:function(t,i){return i=V(i),q(t,document.createElement("div"),void 0,i),se(t,i)},append:function(t,i,a){return a=V(a),q(i,t,void 0,a),se(i,a)},insertBefore:function(t,i,a){return a=V(a),q(i,t.parentNode,t,a),se(i,a)},merge:function(t,i,a){return a=V(a),i.domNode=t,U(t,i,a),se(i,a)},replace:function(t,i,a){return a=V(a),q(i,t.parentNode,t,a),t.parentNode.removeChild(t),se(i,a)}},Ze=function(t){return{vnodeSelector:"",properties:void 0,children:void 0,text:t.toString(),domNode:null}},xe=function(t,i,a){for(var l=0,p=i.length;l<p;l++){var o=i[l];Array.isArray(o)?xe(t,o,a):o!=null&&o!==!1&&(typeof o=="string"&&(o=Ze(o)),a.push(o))}};function Oe(t,i,a){if(Array.isArray(i))a=i,i=void 0;else if(i&&(typeof i=="string"||i.vnodeSelector)||a&&(typeof a=="string"||a.vnodeSelector))throw new Error("h called with invalid arguments");var l,p;return a&&a.length===1&&typeof a[0]=="string"?l=a[0]:a&&(p=[],xe(t,a,p),p.length===0&&(p=void 0)),{vnodeSelector:t,properties:i,children:p,text:l===""?void 0:l,domNode:null}}var je=function(t,i,a){var l=[],p=[];return{results:p,map:function(o){for(var A=o.map(t),v=p.slice(),d=0,f=0;f<o.length;f++){var C=o[f],y=A[f];if(y===l[d])p[f]=v[d],a(C,v[d],f),d++;else{for(var m=!1,M=1;M<l.length+1;M++){var T=(d+M)%l.length;if(l[T]===y){p[f]=v[T],a(o[f],v[T],f),d=T+1,m=!0;break}}m||(p[f]=i(C,f))}}p.length=o.length,l=A}}},Ne=function(t,i){for(var a=[];t&&t!==i;)a.push(t),t=t.parentNode;return a},Ve=function(t,i){var a=t;return i.forEach(function(l){a=a&&a.children?a.children.find(function(p){return p.domNode===l}):void 0}),a},et=function(t,i,a){return function(p,o,A,v){return l};function l(p){var o,A;a("domEvent",p);var v=i(),d=Ne(p.currentTarget,v.domNode);d.reverse();var f=Ve(v.getLastRender(),d);t.scheduleRender();var C;if(f){var y=(A=(o=f.properties["on".concat(p.type)])!==null&&o!==void 0?o:f.properties.on[p.type].listener)!==null&&A!==void 0?A:f.properties.on[p.type];C=y.apply(f.properties.bind||this,arguments)}return a("domEventProcessed",p),C}},tt=function(t){var i,a=V(t),l=a.performanceLogger,p=!0,o,A=!1,v=[],d=[],f=function(y,m,M){var T,J=function(){return T};a.eventHandlerInterceptor=et(i,J,l),T=y(m,M(),a),v.push(T),d.push(M)},C=function(){if(o=void 0,!!p){p=!1,l("renderStart",void 0);for(var y=0;y<v.length;y++){var m=d[y]();l("rendered",void 0),v[y].update(m),l("patched",void 0)}l("renderDone",void 0),p=!0}};return i={renderNow:C,scheduleRender:function(){!o&&!A&&(o=requestAnimationFrame(C))},stop:function(){o&&(cancelAnimationFrame(o),o=void 0),A=!0},resume:function(){A=!1,p=!0,i.scheduleRender()},append:function(y,m){f(le.append,y,m)},insertBefore:function(y,m){f(le.insertBefore,y,m)},merge:function(y,m){f(le.merge,y,m)},replace:function(y,m){f(le.replace,y,m)},detach:function(y){for(var m=0;m<d.length;m++)if(d[m]===y)return d.splice(m,1),v.splice(m,1)[0];throw new Error("renderFunction was not found")}},i};$.createCache=e,$.createMapping=je,$.createProjector=tt,$.dom=le,$.h=Oe}));var at=96;function ne($){return $?$/72*at:0}var nt=(void 0)(),Je=10,_e=20,ge=10,Le=20,Ae={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function rt($="vertical"){let e={stroke:"rgb(200, 200, 200)",strokeWidth:"1"};return $==="vertical"?L`<svg height=4 width=10>${ue`<line x1=0 y1=2 x2=10 y2=2 style=${E(e)} />`}</svg>`:L`<svg height=10 width=10>${ue`<line x1=5 y1=0 x2=5 y2=10 style=${E(e)} />`}</svg>`}function st($,e="vertical"){let s=document.createElement("div");return s.style.height=`${_e}px`,s.className=Ae.univariateAboveAndBelowSymbol,$!=null&&(s.style.opacity=$.toString()),nt.append(s,rt.bind(null,e)),s}function Ke($,e,s="vertical",c){$.infos.forEach((n,r)=>{if(c&&r===2)n.preview=st(e,s);else{let{size:u}=n,h=ne(u)+(s==="horizontal"?Le:ge),w=n.preview.tagName.toLowerCase()==="div",b=w?n.preview:document.createElement("div");b&&(b.className=Ae.univariateAboveAndBelowSymbol),s==="horizontal"?b&&(b.style.width=`${h}px`):b&&(b.style.height=`${h}px`),w||b&&b.appendChild(n.preview),n.preview=b}})}function De($,e="classic"){let s=$.infos,c=s[0].size,n=s[s.length-1].size;return e==="classic"?(ne(c)+ge)/2:(ne(c)-ne(n))/2}function ye($,e){if(!$)return null;let s=$.infos.map(n=>n.color),c=Ge.renderColorRampPreviewHTML(e.type==="full"?s:e.type==="above"?s.slice(0,3):s.slice(2,5),{width:e.width,height:e.height,align:e.rampAlignment,effectList:e.effectList});return c.className=Ae.colorRamp,e.opacity!=null&&(c.style.opacity=e.opacity.toString()),c}function lt($,e,s,c="vertical"){let n=0,r=$.infos,u=Math.floor(r.length/2),h=e==="full"||e==="above"?0:u,w=e==="full"||e==="below"?r.length-1:u;for(let b=h;b<=w;b++)if(s&&b===u)n+=c==="horizontal"?Je:_e;else{let z=r[b].size,k=ne(z)+(c==="horizontal"?Le:ge);n+=k}return Math.round(n)}function $e($,e,s,c="vertical"){let n=lt($,e,s,c),r=$.infos,u=Math.floor(r.length/2),h=e==="full"||e==="above"?0:u,w=e==="full"||e==="below"?r.length-1:u,b=e==="full"?r[h].size+r[w].size:e==="above"?r[h].size:r[w].size,z=s?c==="vertical"?_e:Je:0,k=c==="vertical"?ge*(e==="full"?2:1):Le*(e==="full"?2:1);return Math.round(n-(ne(b)/2+z/2+k/2))}function ct($,e,s="vertical"){let c=$.infos,n=c.find(({type:u})=>u==="size-ramp"),r=c.find(({type:u})=>u==="color-ramp");return n&&(n={...n},n.infos=[...n.infos],Ke(n,e,s,!0)),r&&(r={...r},r.infos=[...r.infos]),s==="horizontal"&&(n?.infos.reverse(),r?.infos.reverse()),{sizeRampElement:n,colorRampElement:r}}function ot($,e="vertical"){let s=$.infos,c=s.find(({type:r})=>r==="size-ramp"),n=s.find(({type:r})=>r==="color-ramp");return c&&(c={...c},c.infos=[...c.infos],Ke(c,null,e,!1)),n&&(n={...n},n.infos=[...n.infos]),e==="horizontal"&&(c?.infos.reverse(),n?.infos.reverse()),{sizeRampElement:c,colorRampElement:n}}function dt($,e){return!0}var ft=ke`@layer{instant-apps-interactive-legend-classic{display:block;--instant-apps-interactive-legend-heading-font-size: 1rem;--instant-apps-interactive-legend-heading-font-weight: normal;--instant-apps-interactive-legend-caption-font-weight: normal;--instant-apps-interactive-legend-secondary-color: var( --calcite-color-text-1 );--instant-apps-interactive-legend-field-name-font-size: 1rem;--instant-apps-interactive-legend-total-feature-count-font-size: .875rem;--instant-apps-interactive-legend-info-font-size: .875rem;--instant-apps-interactive-legend-info-item-background--selected: #c7ebff;--instant-apps-interactive-legend-info-item-background--selected--dark: #009af2;--instant-apps-interactive-legend-info-item-background--hover: #e9e9e9;--instant-apps-interactive-legend-info-item-background--hover--dark: #4a4a4a;--instant-apps-interactive-legend-info-item-color--selected: var( --calcite-color-text-2 );--instant-apps-interactive-legend-secondary-background-color: var( --calcite-color-background );--instant-apps-interactive-legend-ui-margin: 20px 15px;--instant-apps-interactive-legend-ui-padding: 20px 15px}instant-apps-interactive-legend-classic .esri-legend__service{padding:0}instant-apps-interactive-legend-classic .esri-legend__layer-body,instant-apps-interactive-legend-classic .esri-legend__layer,instant-apps-interactive-legend-classic .esri-legend__layer-table,instant-apps-interactive-legend-classic .esri-legend__group-layer-child,instant-apps-interactive-legend-classic .esri-legend__layer-child-table{margin:0;overflow:hidden}instant-apps-interactive-legend-classic .esri-legend__layer-caption calcite-action{margin-right:5px}instant-apps-interactive-legend-classic .esri-legend__layer-caption{display:flex;align-items:center;font-size:var(--instant-apps-interactive-legend-field-name-font-size);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-caption-btn-container{white-space:nowrap}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-caption-btn-container calcite-button{margin:2px}instant-apps-interactive-legend-classic .esri-legend__layer-caption{font-weight:var(--instant-apps-interactive-legend-caption-font-weight)}instant-apps-interactive-legend-classic .esri-legend__layer-cell.esri-legend__layer-cell--info{font-size:var(--instant-apps-interactive-legend-info-font-size);text-align:left}instant-apps-interactive-legend-classic .esri-legend__layer-cell,instant-apps-interactive-legend-classic .esri-legend__layer-row{display:flex;align-items:center}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__non-interactive .esri-legend__layer-body{display:block;margin:var(--instant-apps-interactive-legend-ui-margin)}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__non-interactive.instant-apps-interactive-legend__nested-unique-symbol>.esri-legend__layer-body{margin:0}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__non-interactive .esri-legend__layer-row{display:table-row}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__non-interactive .esri-legend__layer-cell{display:table-cell}instant-apps-interactive-legend-classic .esri-legend__layer-cell--symbols{justify-content:center;width:20%}instant-apps-interactive-legend-classic .esri-legend__layer-cell--info{width:65%}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive{margin:1px;background:transparent;border:none;width:100%}instant-apps-interactive-legend-classic .esri-legend__layer-cell--info{color:var(--instant-apps-interactive-legend-secondary-color)}instant-apps-interactive-legend-classic .esri-legend__layer-row,instant-apps-interactive-legend-classic .esri-legend__layer-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive{position:relative}instant-apps-interactive-legend-classic .instant-apps-interactive-legend-element-info--selected{background-color:var(--instant-apps-interactive-legend-info-item-background--selected)}instant-apps-interactive-legend-classic .calcite-mode-dark .instant-apps-interactive-legend-element-info--selected{cursor:pointer;background-color:var(--instant-apps-interactive-legend-info-item-background--selected--dark)}instant-apps-interactive-legend-classic .calcite-mode-dark .instant-apps-interactive-legend-element-info--selected .esri-legend__layer-cell--info{color:var(--calcite-color-text-inverse)}instant-apps-interactive-legend-classic .hide{display:none}.instant-apps-interactive-legend__compact .esri-legend__layer-row{--instant-apps-interactive-legend-ui-padding: 10px 5px}.instant-apps-interactive-legend__compact .esri-legend__layer-row .esri-legend__layer-cell--info{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;line-clamp:2;line-height:1.3125rem;max-height:2.625rem}@media(min-width:992px){instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive{cursor:pointer}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover)}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive:hover.instant-apps-interactive-legend-element-info--selected{background-color:#e2f2fe}instant-apps-interactive-legend-classic .calcite-mode-dark .instant-apps-interactive-legend__layer-row--interactive:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover--dark)}instant-apps-interactive-legend-classic .calcite-mode-dark .instant-apps-interactive-legend__layer-row--interactive:hover.instant-apps-interactive-legend-element-info--selected{background-color:#26a9f4}}}`,g={layer:"esri-legend__layer",layerBody:"esri-legend__layer-body",layerRow:"esri-legend__layer-row",layerInfo:"esri-legend__layer-cell esri-legend__layer-cell--info",imageryLayerStretchedImage:"esri-legend__imagery-layer-image--stretched",symbolContainer:"esri-legend__layer-cell esri-legend__layer-cell--symbols",symbol:"esri-legend__symbol",rampContainer:"esri-legend__ramps",sizeRamp:"esri-legend__size-ramp",colorRamp:"esri-legend__color-ramp",opacityRamp:"esri-legend__opacity-ramp",rampLabelsContainer:"esri-legend__ramp-labels",rampLabel:"esri-legend__ramp-label",univariateAboveAndBelowLabel:"esri-univariate-above-and-below-ramp__label",message:"esri-legend__message",interactiveLayerRow:"instant-apps-interactive-legend__layer-row--interactive",infoSelected:"instant-apps-interactive-legend-element-info--selected",compact:"instant-apps-interactive-legend__compact"},vt=24,qe={display:"flex",alignItems:"flex-start"},be={marginLeft:"3px"},ae={display:"table-cell",verticalAlign:"middle"},we=class extends ze{constructor(){super(...arguments),this.calculatingFeatureCount=!1,this.isLoading=!0,this.zoomTo=!1,this.featureCount=!1,this.filterMode={type:"filter"}}static{this.properties={isLoading:16,legendvm:0,zoomTo:5,featureCount:5,filterMode:0,messages:0}}static{this.styles=ft}static{this.shadowRootOptions=Re}connectedCallback(){super.connectedCallback(),!this.handles&&(this.handles=new it)}async load(){new MutationObserver(()=>{this.requestUpdate()}).observe(this.el,{attributes:!0}),W.onChange("data",()=>this.requestUpdate())}willUpdate(e){e.has("filterMode")&&this.legendvm?.view&&(this.hasUpdated||this.filterMode.type!=="filter")&&Ue(this.filterMode,this.legendvm.view)}async loaded(){await this.initLegend()}disconnectedCallback(){super.disconnectedCallback(),this.handles?.removeAll(),this.handles?.destroy(),this.handles=null}async initLegend(){try{await D.whenOnce(()=>this.legendvm?.view);let e=async()=>{try{let s=this.legendvm?.view?.map;await s?.load(),await s?.basemap?.load();let c=s?.allLayers?.map(async h=>await h.load()),n=(await Promise.allSettled(c)).map(h=>h?.status==="fulfilled"&&h?.value?h.value:null).filter(h=>!!h),r=[];n.forEach(h=>{this.legendvm?.view&&r.push(this.legendvm.view.whenLayerView(h))}),await Promise.allSettled(r);let u=await ve(this.legendvm);W.set("data",{...B.data,...u}),this.isLoading=!1,await this.setupWatchersAndListeners()}catch(s){console.error(s),this.isLoading=!1}};this.legendvm?.view?.when(e),this.legendvm?.view?.map?.layers?.on("after-changes",e)}catch{this.isLoading=!1}}getStretchStopLabel(e){let s=this.messages[e.label];return e.label?`${s}: ${typeof e.value=="string"?e.value:ce.formatNumber(e.value,{style:"decimal",notation:e.value.toString().includes("e")?"scientific":"standard"})}`:""}getTitle(e,s){if(!e)return;if(typeof e=="string"||typeof e=="number")return e;if("value"in e||"unit"in e){let r=typeof this.messages?.dotValue=="string"?this.messages.dotValue:"";return ce.substitute(r,e)}if("colorName"in e||"bandName"in e){let{colorName:r,bandName:u}=e,h=this.messages[r],w=typeof this.messages[u]=="string"?this.messages[u]:u;return`${h}: ${w}`}if("showCount"in e)return e.showCount?this.messages.clusterCountTitle:null;let c=null;if(s){let r=e;c=r.ratioPercentTotal?"showRatioPercentTotal":r.ratioPercent?"showRatioPercent":r.ratio?"showRatio":e.normField?"showNormField":e.field?"showField":null}else if(this.isRendererTitle(s)){let r=e;c=r.normField?"showNormField":r.normByPct?"showNormPct":r.field?"showField":null}let n=c==="showField"?"{field}":typeof c=="string"?this.messages[c]:"";return c?ce.substitute(n,{field:e.field,normField:e.normField}):""}isRendererTitle(e){return!e}async setupWatchersAndListeners(){let e=this.legendvm?.view?.map?.allLayers?.filter(n=>n?.type==="feature"),s=[];for(let n of e)this.legendvm?.view&&s.push(this.legendvm?.view?.whenLayerView(n));let c=[];try{c=await Promise.all(s)}catch(n){console.error(n)}for(let n of c){let r=`fLayerViewScale-${n.layer.id}`;!this.handles?.has(r)&&n&&this.handles?.add(n.watch("visibleAtCurrentScale",()=>{this.createDataForLayer(n.layer).catch(u=>{console.error(u)})}),r)}e?.forEach(n=>{let r=`fLayer-${n?.id}`;this.handles?.has(r)||this.handles?.add(D?.watch(()=>n?.visible,()=>{this.createDataForLayer(n).catch(u=>{console.error(u)})}),r)}),this.handles?.add(D.when(()=>this.legendvm,()=>{D.watch(()=>this.legendvm?.view?.updating,()=>{this.calculatingFeatureCount||this.legendvm?.view?.updating&&(this.calculatingFeatureCount=!0,D.when(()=>!this.legendvm?.view?.updating,()=>{pe(this.legendvm,B.data).then(n=>{W.set("data",{...B.data,...n}),this.calculatingFeatureCount=!1}).catch(n=>{console.error(n)})},{once:!0,initial:!0}))},{initial:!0})},{initial:!0,once:!0})),this.handles?.add(D.on(()=>this.legendvm?.activeLayerInfos,"change",n=>{ve(this.legendvm).then(r=>{W.set("data",{...B.data,...r}),this.requestUpdate()}).then(()=>{this.handles?.add(D.on(()=>n.children,"change",()=>{ve(this.legendvm).then(r=>{W.set("data",{...B.data,...r}),this.requestUpdate()}).catch(r=>{console.error(r)})}))}).catch(r=>{console.error(r)})})),this.handles?.add(D.on(()=>this.legendvm?.view?.map?.layers,"after-changes",()=>{pe(this.legendvm,B.data).then(n=>{W.set("data",{...B.data,...n}),this.calculatingFeatureCount=!1}).catch(n=>{console.error(n)})}))}async createDataForLayer(e){let s=W.get("data")?.[e?.id],c=Be(this.legendvm?.activeLayerInfos)?.find(n=>n?.layer?.id===e?.id);if(!s&&c){let n=await Ie(this.legendvm,c);if(me({intLegendLayerData:n,layerId:e?.id}),this.featureCount){let r=await pe(this.legendvm,B.data);W.set("data",{...B.data,...r})}}}applyFilter(e,s,c,n){return async()=>{let r={...B.data?.[s?.id]};n?await he(r,e,c,this.filterMode,n):await he(r,e,c,this.filterMode),me({intLegendLayerData:r,layerId:s?.id})}}render(){let e=this.renderFilteredLayers(),s=W.get("compact")?` ${g.compact}`:"";return this.isLoading?K("interactive-legend-loader",L`<calcite-loader scale=m .label=${this.messages?.loading} .text=${this.messages?.loading}></calcite-loader>`):K("interactive-legend-classic-container",L`<div class=${`${Z(this.el)}${s}`}>${e?.length>0?e:L`<div class=${_(g.message)}>${this.messages?.noLegend}</div>`}</div>`)}renderFilteredLayers(){return(this.legendvm?.activeLayerInfos?.toArray()).map(e=>this.renderLegendForLayer(e)).filter(e=>!!e)}renderLegendForLayer(e,s){if(!e.ready)return null;if(e.children.length){let r=e.children.map(u=>this.renderLegendForLayer(u,!0)).toArray();return L`<instant-apps-interactive-legend-group-legend-element class=${_(Z(this.el))} .legendvm=${this.legendvm} .featureCount=${this.featureCount} .activeLayerInfo=${e} .isChild=${s}><div style=${E({paddingLeft:"20px"})} .id=${`${e?.layer?.id}-legend-layer`} slot=content>${r}</div></instant-apps-interactive-legend-group-legend-element>`}let c=e.legendElements;if(c&&!c.length)return null;let n=c.map((r,u)=>this.renderLegendForElement(r,e.layer,e.effectList,e,u)).filter(r=>!!r);return n.length?L`<instant-apps-interactive-legend-layer-element class=${_(Z(this.el))} .legendvm=${this.legendvm} .featureCount=${this.featureCount} .activeLayerInfo=${e} .isChild=${!!s}><div slot=content .id=${`${e?.layer?.id}-legend-layer`} class=${_(g.layer)}>${n}</div></instant-apps-interactive-legend-layer-element>`:null}renderLegendForElement(e,s,c,n,r,u,h){let w=e.type==="color-ramp",b=e.type==="opacity-ramp",z=e.type==="size-ramp",k=null,x=Me(n,e,r),S=e?.type==="relationship-ramp";if(e.type==="symbol-table"||z){let R=e.infos.map((F,G)=>this.renderLegendForElementInfo(F,s,c,z,e,n,r,G,x,h)).filter(F=>!!F);R.length&&(k=L`<div class=${_(g.layerBody)}>${R}</div>`)}else if(e.type==="color-ramp"||e.type==="opacity-ramp"||e.type==="heatmap-ramp"||e.type==="stretch-ramp"){let R=e;k=this.renderLegendForRamp(R,s.opacity)}else if(S)k=K("relationship-ramp",L`<instant-apps-interactive-legend-relationship class=${_(Z(this.el))} .filterMode=${this.filterMode} .activeLayerInfo=${n} .legendElement=${e}></instant-apps-interactive-legend-relationship>`);else if(e.type==="pie-chart-ramp"){let R=e;k=this.renderPieChartRamp(R)}else if(e.type==="univariate-above-and-below-ramp"){let R=e;k=this.renderUnivariateAboveAndBelowRamp(R,s.opacity,c)}else if(e.type==="univariate-color-size-ramp"){let R=e;k=this.renderUnivariateColorSizeRamp(R,s.opacity,c)}if(!k)return null;let I=e.title,P=null;if(typeof I=="string")P=I;else if(I){let R=I,F=this.getTitle(R,w||b);this.isRendererTitle(w||b)?"title"in I&&(P=`${I.title} (${F})`):P=F}return L`<instant-apps-interactive-legend-legend-element class=${_(Z(this.el))} .activeLayerInfo=${n} .isSizeRamp=${z} .isChild=${!!u} .isColorRamp=${w} .isRelationshipRamp=${S} .isInteractive=${x} .zoomTo=${this.zoomTo} .legendElement=${e} .titleText=${P} .legendvm=${this.legendvm} .legendElementIndex=${r}><div slot=content>${k}</div></instant-apps-interactive-legend-legend-element>`}renderPieChartRamp(e){return L`<div .innerHTML=${`${e.preview?.outerHTML}`}></div>`}renderUnivariateAboveAndBelowRamp(e,s,c){let{sizeRampElement:n,colorRampElement:r}=ct(e,s);if(!n)return null;let u=$e(n,"above",!0),h=$e(n,"below",!0),w=12,b=ye(r,{width:w,height:u,rampAlignment:"vertical",opacity:s,type:"above",effectList:c}),z=ye(r,{width:w,height:h,rampAlignment:"vertical",opacity:s,type:"below",effectList:c}),k=De(n),x=n.infos.map(H=>H.label),S=x.map((H,U)=>U===0?L`<div class=${_(H?b?g.univariateAboveAndBelowLabel:g.rampLabel:"")}>${H}</div>`:U===2?L`<div></div>`:null),I=x.length-1,P=Math.floor(x.length/2),R=x.map((H,U)=>U===P||U===I?L`<div class=${_(H?b?g.univariateAboveAndBelowLabel:g.rampLabel:"")}>${H}</div>`:null),F={display:"table-cell",verticalAlign:"middle"},G={marginTop:`${k}px`},O={height:`${u}px`},j={height:`${h}px`};return K("univariate-above-and-below-ramp-preview",L`<div style=${E(qe)}><div class=${_(g.layerBody)}>${n.infos.map((H,U)=>L`<div class=${`${g.layerRow} ${g.sizeRamp}`}><div class=${_(g.symbol)} style=${E(F)} .innerHTML=${H?.preview?.outerHTML??""??""}></div>${!b&&U%2===0?L`<div class=${_(g.layerInfo)}>${x[U]}</div>`:null}</div>`)}</div>${b?K("color-ramp-preview",L`<div style=${E(G)}><div style=${E(be)}><div style=${E(ae)}><div class=${_(g.rampContainer)}>${b}</div></div><div style=${E(ae)}><div class=${_(g.rampLabelsContainer)} style=${E(O)}>${S}</div></div></div><div style=${E(be)}><div style=${E(ae)}><div class=${_(g.rampContainer)}>${z}</div></div><div style=${E(ae)}><div class=${_(g.rampLabelsContainer)} style=${E(j)}>${R}</div></div></div></div>`):null}</div>`)}renderUnivariateColorSizeRamp(e,s,c){let{sizeRampElement:n,colorRampElement:r}=ot(e);if(!n)return null;let u=De(n),h=12,w=$e(n,"full",!1),b=ye(r,{width:h,height:w,rampAlignment:"vertical",opacity:s,type:"full",effectList:c}),z=n.infos.length-1,k=n.infos.map((P,R)=>R===0||R===z?L`<div class=${_(P.label?r?g.univariateAboveAndBelowLabel:g.rampLabel:"")}>${P.label}</div>`:null),x={display:"table-cell",verticalAlign:"middle"},S={marginTop:`${u}px`},I={height:`${w}px`};return K("univariate-above-and-below-ramp-preview",L`<div style=${E(qe)}><div class=${_(g.layerBody)}>${n.infos.map(P=>L`<div class=${`${g.layerRow} ${g.sizeRamp}`}><div class=${_(g.symbol)} style=${E(x)} .innerHTML=${P?.preview?.outerHTML??""??""}></div></div>`)}</div>${K("color-ramp-preview",L`<div style=${E(S)}><div style=${E(be)}><div style=${E(ae)}><div class=${_(g.rampContainer)}>${b}</div></div><div style=${E(ae)}><div class=${_(g.rampLabelsContainer)} style=${E(I)}>${k}</div></div></div></div>`)}</div>`)}renderLegendForRamp(e,s){let c=e.infos,n=e.type==="opacity-ramp",r=e.type==="heatmap-ramp",u=e.type==="stretch-ramp",h=e.preview,w=n?g.opacityRamp:"";h&&(h.classList.add(g.colorRamp),w&&h.classList.add(w)),s!=null&&h&&(h.style.opacity=s.toString());let b=c.map(x=>{let S;if(r){let I=this.messages[x.label];S=typeof I=="string"?I:x.label}else u?S="value"in x?this.getStretchStopLabel(x):x.label:S=x.label;return L`<div class=${_(x.label?g.rampLabel:"")}>${S}</div>`}),z={width:`${vt}px`},k={height:h?.style?.height};return L`<div class=${_(g.layerRow)}><div class=${_(g.symbolContainer)} style=${E({...z})}><div class=${_(g.rampContainer)} ${Ee(x=>{x?.firstChild&&x?.firstChild?.remove(),x?.appendChild(h)})}></div></div><div class=${_(g.layerInfo)}><div class=${_(g.rampLabelsContainer)} style=${E({...k})}>${b}</div></div></div>`}renderLegendForElementInfo(e,s,c,n,r,u,h,w,b,z){if("infos"in e)return this.renderLegendForElement(e,s,c,u,h,!0,e);let k=null,x=!dt(s,r.type);if("preview"in e){let{outerHTML:q}=e.preview;k=L`<div class=${_(g.symbol)} .innerHTML=${q??""}></div>`}else"src"in e&&(k=this.renderImage(e,s,x));if(!k)return null;let S="",I=n?` ${g.sizeRamp}`:"",P,R=Te(s),F=He(R,z);if(B.data){let q=Pe(R,s,e,F,w),N=F?F?.nestedInfos:R,re=Fe(N);P=R?.categories?.size===1?!q?.selected:re||q?.selected}let G="label"in e?e.label:null,O=F&&!("value"in e)?!1:b,j=W.get("compact"),H=this.getTitle(G,!1)||"",U=F?r.title:G??s?.id;return O?L`<button @click=${this.applyFilter(e,s,w,z)} class=${`${g.layerRow} ${g.interactiveLayerRow}${P?` ${g.infoSelected}`:""}`} title=${(j?`${H}`:void 0)??fe} .ariaPressed=${P?"true":"false"}><div class=${`${g.symbolContainer}${S}${I}`}>${k}</div><div class=${`${g.layerInfo}${S}`}>${this.getTitle(G,!1)||""}</div>${this.featureCount&&!j?L`<instant-apps-interactive-legend-count class=${_(Z(this.el))} .categoryId=${U} .activeLayerInfo=${u} .legendvm=${this.legendvm} .selected=${!!P} .legendElement=${r} .infoIndex=${w}></instant-apps-interactive-legend-count>`:null}</button>`:L`<div class=${_(g.layerRow)}><div class=${`${g.symbolContainer}${S}${I}`}>${k}</div><div class=${`${g.layerInfo}${S}`}>${H}</div></div>`}renderImage(e,s,c){let{label:n,src:r,opacity:u}=e,h=c?` ${g.imageryLayerStretchedImage}`:"",w=c?"":` ${g.symbol}`,b={opacity:`${u??s.opacity}`};return L`<img alt=${this.getTitle(n,!1)??fe} src=${r??fe} width=${e.width} height=${e.height} class=${`$${h}${w}`} style=${E(b)}>`}};Se("instant-apps-interactive-legend-classic",we);return we},"symbols/support/symbolUtils","core/reactiveUtils","intl","core/Handles",a,b,c,d)
|
|
2
|
+
import d from"./EAV7DUA3.js";import c from"./S6EMQP4I.js";import b from"./P5ERFKR2.js";import a from"./GPP5RTWG.js";import{a as K}from"./4T7P5RXF.js";import{b as Se}from"./3LEJ44U2.js";import"./GDPFKW75.js";import{G as Ee,H as ze,J as _,K as E,h as ke,i as L,j as ue,l as fe,u as Re}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([Ge,D,ce,it,,,{a:B,b:W},{a:Ie,b:ve,d:Pe,e:Te,f:he,g:Fe,i:Me,o:pe,s:He,t:Z,u:me,v:Ue,w:Be}])=>{(function($,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):($=typeof globalThis<"u"?globalThis:$||self,e($.maquette={}))})(void 0,(function($){"use strict";var e=function(){var t,i;return{invalidate:function(){i=void 0,t=void 0},result:function(a,l){if(t)for(var p=0;p<a.length;p++)t[p]!==a[p]&&(i=void 0);return i||(i=l(),t=a),i}}},s="http://www.w3.org/",c="".concat(s,"2000/svg"),n="".concat(s,"1999/xlink"),r=[],u=function(t,i){var a={};return Object.keys(t).forEach(function(l){a[l]=t[l]}),i&&Object.keys(i).forEach(function(l){a[l]=i[l]}),a},h=function(t,i){return t.vnodeSelector!==i.vnodeSelector?!1:t.properties&&i.properties?t.properties.key!==i.properties.key?!1:t.properties.bind===i.properties.bind:!t.properties&&!i.properties},w=function(t){if(typeof t!="string")throw new Error("Style values must be strings")},b=function(t,i,a){if(i.vnodeSelector!==""){for(var l=a;l<t.length;l++)if(h(t[l],i))return l}return-1},z=function(t,i,a,l){var p=t[i];if(p.vnodeSelector!==""){var o=p.properties,A=o?o.key===void 0?o.bind:o.key:void 0;if(!A){for(var v=0;v<t.length;v++)if(v!==i){var d=t[v];if(h(d,p))throw Object.assign(new Error("".concat(a.vnodeSelector," had a ").concat(p.vnodeSelector," child ").concat(l==="added"?l:"removed",", but there is now more than one. You must add unique key properties to make them distinguishable.")),{parentNode:a,childNode:p})}}}},k=function(t){if(t.properties){var i=t.properties.enterAnimation;i&&i(t.domNode,t.properties)}},x=[],S=!1,I=function(t){(t.children||[]).forEach(I),t.properties&&t.properties.afterRemoved&&t.properties.afterRemoved.apply(t.properties.bind||t.properties,[t.domNode])},P=function(){S=!1,x.forEach(I),x.length=0},R=function(t){x.push(t),S||(S=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(P,{timeout:16}):setTimeout(P,16))},F=function(t){var i=t.domNode;if(t.properties){var a=t.properties.exitAnimation;if(a){i.style.pointerEvents="none";var l=function(){i.parentNode&&(i.parentNode.removeChild(i),R(t))};a(i,l,t.properties);return}}i.parentNode&&(i.parentNode.removeChild(i),R(t))},G=["on","afterCreate","afterUpdate","afterRemoved","enterAnimation","exitAnimation","updateAnimation"];function O(t){return!G.includes(t)}var j=function(t,i,a){if(i){for(var l=a.eventHandlerInterceptor,p=Object.keys(i).filter(O),o=p.length,A=0;A<o;A++){var v=p[A],d=i[v];if(v==="className")throw new Error('Property "className" is not supported, use "class".');if(v==="class")re(t,d,!0);else if(v==="classes")for(var f=Object.keys(d),C=f.length,y=0;y<C;y++){var m=f[y];d[m]&&t.classList.add(m)}else if(v==="styles")for(var M=Object.keys(d),T=M.length,y=0;y<T;y++){var J=M[y],ee=d[J];ee&&(w(ee),a.styleApplyer(t,J,ee))}else if(v!=="key"&&d!==null&&d!==void 0){var oe=typeof d;oe==="function"?(v.lastIndexOf("on",0)===0&&l&&(d=l(v,d,t,i)),t[v]=d):a.namespace===c?v==="href"?t.setAttributeNS(n,v,d):t.setAttribute(v,d):oe==="string"&&v!=="value"&&v!=="innerHTML"?t.setAttribute(v,d):t[v]=d}}if(i.on)for(var te=0,de=Object.entries(i.on);te<de.length;te++){var X=de[te],Y=X[0],Q=X[1],ie=typeof Q=="function"?Q:Q.listener;l&&(ie=l(Y,ie,t,i)),ie&&t.addEventListener(Y,ie,typeof Q=="function"?void 0:Q.options)}}},H=function(t,i,a){if(i)for(var l=0,p=i;l<p.length;l++){var o=p[l];q(o,t,void 0,a)}},U=function(t,i,a){H(t,i.children,a),i.text&&(t.textContent=i.text),j(t,i.properties,a),i.properties&&i.properties.afterCreate&&i.properties.afterCreate.apply(i.properties.bind||i.properties,[t,a,i.vnodeSelector,i.properties,i.children])},q=function(t,i,a,l){var p,o,A=0,v=t.vnodeSelector,d=i.ownerDocument;if(v==="")t.domNode?t.domNode.nodeValue=t.text:(o=t.domNode=d.createTextNode(t.text),a!==void 0?i.insertBefore(o,a):i.appendChild(o));else{for(var f=0;f<=v.length;++f){var C=v.charAt(f);if(f===v.length||C==="."||C==="#"){var y=v.charAt(A-1),m=v.slice(A,f);y==="."?o.classList.add(m):y==="#"?o.id=m:(m==="svg"&&(l=u(l,{namespace:c})),l.namespace!==void 0?o=t.domNode=d.createElementNS(l.namespace,m):(o=t.domNode=t.domNode||(!((p=t.properties)===null||p===void 0)&&p.is?d.createElement(m,{is:t.properties.is}):d.createElement(m)),m==="input"&&t.properties&&t.properties.type!==void 0&&o.setAttribute("type",t.properties.type)),a!==void 0?i.insertBefore(o,a):o.parentNode!==i&&i.appendChild(o)),A=f+1}}U(o,t,l)}},N,re=function(t,i,a){i&&i.split(" ").forEach(function(l){l&&t.classList.toggle(l,a)})},Xe=function(t,i,a,l){if(a){for(var p=!1,o=Object.keys(a).filter(O),A=o.length,v=0;v<A;v++){var d=o[v],f=a[d],C=i[d];if(d==="class")C!==f&&(re(t,C,!1),re(t,f,!0));else if(d==="classes")for(var y=t.classList,m=Object.keys(f),M=m.length,T=0;T<M;T++){var J=m[T],ee=!!f[J],oe=!!C[J];ee!==oe&&(p=!0,ee?y.add(J):y.remove(J))}else if(d==="styles")for(var te=Object.keys(f),de=te.length,T=0;T<de;T++){var X=te[T],Y=f[X],Q=C[X];Y!==Q&&(p=!0,Y?(w(Y),l.styleApplyer(t,X,Y)):l.styleApplyer(t,X,""))}else if(!f&&typeof C=="string"&&(f=""),d==="value"){var ie=t[d];ie!==f&&f!==C&&(t[d]=f),f!==C&&(p=!0)}else if(f!==C){var Ce=typeof f;(Ce!=="function"||!l.eventHandlerInterceptor)&&(l.namespace===c?d==="href"?t.setAttributeNS(n,d,f):t.setAttribute(d,f):Ce==="string"&&d!=="innerHTML"?d==="role"&&f===""?t.removeAttribute(d):t.setAttribute(d,f):t[d]!==f&&(t[d]=f),p=!0)}}return p}},Ye=function(t,i,a,l,p){if(a===l)return!1;a=a||r,l=l||r;for(var o=a.length,A=l.length,v=0,d=0,f,C=!1;d<A;){var y=v<o?a[v]:void 0,m=l[d];if(y!==void 0&&h(y,m))C=N(y,m,p,i,a)||C,v++;else{var M=b(a,m,v+1);if(M>=0){for(f=v;f<M;f++)F(a[f]),z(a,f,t,"removed");C=N(a[M],m,p,i,a)||C,v=M+1}else q(m,i,v<o?a[v].domNode:void 0,p),k(m),z(l,d,t,"added")}d++}if(o>v)for(f=v;f<o;f++)F(a[f]),z(a,f,t,"removed");return C};N=function(t,i,a,l,p){var o=t.domNode,A=!1;if(t===i)return!1;var v=!1;if(i.vnodeSelector===""){if(i.text!==t.text){var d=o.ownerDocument.createTextNode(i.text);try{l.replaceChild(d,o)}catch{l.replaceChild(d,l.childNodes[p.indexOf(t)])}return i.domNode=d,A=!0,A}i.domNode=o}else i.vnodeSelector.lastIndexOf("svg",0)===0&&(a=u(a,{namespace:c})),t.text!==i.text&&(v=!0,i.text===void 0?o.removeChild(o.firstChild):o.textContent=i.text),i.domNode=o,v=Ye(i,o,t.children,i.children,a)||v,v=Xe(o,t.properties,i.properties,a)||v,i.properties&&i.properties.afterUpdate&&i.properties.afterUpdate.apply(i.properties.bind||i.properties,[o,a,i.vnodeSelector,i.properties,i.children]);return v&&i.properties&&i.properties.updateAnimation&&i.properties.updateAnimation(o,i.properties,t.properties),A};var se=function(t,i){return{getLastRender:function(){return t},update:function(a){if(t.vnodeSelector!==a.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");var l=t;t=a,N(l,a,i,l.domNode.parentNode,[l])},domNode:t.domNode}},Qe={namespace:void 0,performanceLogger:function(){},eventHandlerInterceptor:void 0,styleApplyer:function(t,i,a){i.charAt(0)==="-"?t.style.setProperty(i,a):t.style[i]=a}},V=function(t){return u(Qe,t)},le={create:function(t,i){return i=V(i),q(t,document.createElement("div"),void 0,i),se(t,i)},append:function(t,i,a){return a=V(a),q(i,t,void 0,a),se(i,a)},insertBefore:function(t,i,a){return a=V(a),q(i,t.parentNode,t,a),se(i,a)},merge:function(t,i,a){return a=V(a),i.domNode=t,U(t,i,a),se(i,a)},replace:function(t,i,a){return a=V(a),q(i,t.parentNode,t,a),t.parentNode.removeChild(t),se(i,a)}},Ze=function(t){return{vnodeSelector:"",properties:void 0,children:void 0,text:t.toString(),domNode:null}},xe=function(t,i,a){for(var l=0,p=i.length;l<p;l++){var o=i[l];Array.isArray(o)?xe(t,o,a):o!=null&&o!==!1&&(typeof o=="string"&&(o=Ze(o)),a.push(o))}};function Oe(t,i,a){if(Array.isArray(i))a=i,i=void 0;else if(i&&(typeof i=="string"||i.vnodeSelector)||a&&(typeof a=="string"||a.vnodeSelector))throw new Error("h called with invalid arguments");var l,p;return a&&a.length===1&&typeof a[0]=="string"?l=a[0]:a&&(p=[],xe(t,a,p),p.length===0&&(p=void 0)),{vnodeSelector:t,properties:i,children:p,text:l===""?void 0:l,domNode:null}}var je=function(t,i,a){var l=[],p=[];return{results:p,map:function(o){for(var A=o.map(t),v=p.slice(),d=0,f=0;f<o.length;f++){var C=o[f],y=A[f];if(y===l[d])p[f]=v[d],a(C,v[d],f),d++;else{for(var m=!1,M=1;M<l.length+1;M++){var T=(d+M)%l.length;if(l[T]===y){p[f]=v[T],a(o[f],v[T],f),d=T+1,m=!0;break}}m||(p[f]=i(C,f))}}p.length=o.length,l=A}}},Ne=function(t,i){for(var a=[];t&&t!==i;)a.push(t),t=t.parentNode;return a},Ve=function(t,i){var a=t;return i.forEach(function(l){a=a&&a.children?a.children.find(function(p){return p.domNode===l}):void 0}),a},et=function(t,i,a){return function(p,o,A,v){return l};function l(p){var o,A;a("domEvent",p);var v=i(),d=Ne(p.currentTarget,v.domNode);d.reverse();var f=Ve(v.getLastRender(),d);t.scheduleRender();var C;if(f){var y=(A=(o=f.properties["on".concat(p.type)])!==null&&o!==void 0?o:f.properties.on[p.type].listener)!==null&&A!==void 0?A:f.properties.on[p.type];C=y.apply(f.properties.bind||this,arguments)}return a("domEventProcessed",p),C}},tt=function(t){var i,a=V(t),l=a.performanceLogger,p=!0,o,A=!1,v=[],d=[],f=function(y,m,M){var T,J=function(){return T};a.eventHandlerInterceptor=et(i,J,l),T=y(m,M(),a),v.push(T),d.push(M)},C=function(){if(o=void 0,!!p){p=!1,l("renderStart",void 0);for(var y=0;y<v.length;y++){var m=d[y]();l("rendered",void 0),v[y].update(m),l("patched",void 0)}l("renderDone",void 0),p=!0}};return i={renderNow:C,scheduleRender:function(){!o&&!A&&(o=requestAnimationFrame(C))},stop:function(){o&&(cancelAnimationFrame(o),o=void 0),A=!0},resume:function(){A=!1,p=!0,i.scheduleRender()},append:function(y,m){f(le.append,y,m)},insertBefore:function(y,m){f(le.insertBefore,y,m)},merge:function(y,m){f(le.merge,y,m)},replace:function(y,m){f(le.replace,y,m)},detach:function(y){for(var m=0;m<d.length;m++)if(d[m]===y)return d.splice(m,1),v.splice(m,1)[0];throw new Error("renderFunction was not found")}},i};$.createCache=e,$.createMapping=je,$.createProjector=tt,$.dom=le,$.h=Oe}));var at=96;function ne($){return $?$/72*at:0}var nt=(void 0)(),Je=10,_e=20,ge=10,Le=20,Ae={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function rt($="vertical"){let e={stroke:"rgb(200, 200, 200)",strokeWidth:"1"};return $==="vertical"?L`<svg height=4 width=10>${ue`<line x1=0 y1=2 x2=10 y2=2 style=${E(e)} />`}</svg>`:L`<svg height=10 width=10>${ue`<line x1=5 y1=0 x2=5 y2=10 style=${E(e)} />`}</svg>`}function st($,e="vertical"){let s=document.createElement("div");return s.style.height=`${_e}px`,s.className=Ae.univariateAboveAndBelowSymbol,$!=null&&(s.style.opacity=$.toString()),nt.append(s,rt.bind(null,e)),s}function Ke($,e,s="vertical",c){$.infos.forEach((n,r)=>{if(c&&r===2)n.preview=st(e,s);else{let{size:u}=n,h=ne(u)+(s==="horizontal"?Le:ge),w=n.preview.tagName.toLowerCase()==="div",b=w?n.preview:document.createElement("div");b&&(b.className=Ae.univariateAboveAndBelowSymbol),s==="horizontal"?b&&(b.style.width=`${h}px`):b&&(b.style.height=`${h}px`),w||b&&b.appendChild(n.preview),n.preview=b}})}function De($,e="classic"){let s=$.infos,c=s[0].size,n=s[s.length-1].size;return e==="classic"?(ne(c)+ge)/2:(ne(c)-ne(n))/2}function ye($,e){if(!$)return null;let s=$.infos.map(n=>n.color),c=Ge.renderColorRampPreviewHTML(e.type==="full"?s:e.type==="above"?s.slice(0,3):s.slice(2,5),{width:e.width,height:e.height,align:e.rampAlignment,effectList:e.effectList});return c.className=Ae.colorRamp,e.opacity!=null&&(c.style.opacity=e.opacity.toString()),c}function lt($,e,s,c="vertical"){let n=0,r=$.infos,u=Math.floor(r.length/2),h=e==="full"||e==="above"?0:u,w=e==="full"||e==="below"?r.length-1:u;for(let b=h;b<=w;b++)if(s&&b===u)n+=c==="horizontal"?Je:_e;else{let z=r[b].size,k=ne(z)+(c==="horizontal"?Le:ge);n+=k}return Math.round(n)}function $e($,e,s,c="vertical"){let n=lt($,e,s,c),r=$.infos,u=Math.floor(r.length/2),h=e==="full"||e==="above"?0:u,w=e==="full"||e==="below"?r.length-1:u,b=e==="full"?r[h].size+r[w].size:e==="above"?r[h].size:r[w].size,z=s?c==="vertical"?_e:Je:0,k=c==="vertical"?ge*(e==="full"?2:1):Le*(e==="full"?2:1);return Math.round(n-(ne(b)/2+z/2+k/2))}function ct($,e,s="vertical"){let c=$.infos,n=c.find(({type:u})=>u==="size-ramp"),r=c.find(({type:u})=>u==="color-ramp");return n&&(n={...n},n.infos=[...n.infos],Ke(n,e,s,!0)),r&&(r={...r},r.infos=[...r.infos]),s==="horizontal"&&(n?.infos.reverse(),r?.infos.reverse()),{sizeRampElement:n,colorRampElement:r}}function ot($,e="vertical"){let s=$.infos,c=s.find(({type:r})=>r==="size-ramp"),n=s.find(({type:r})=>r==="color-ramp");return c&&(c={...c},c.infos=[...c.infos],Ke(c,null,e,!1)),n&&(n={...n},n.infos=[...n.infos]),e==="horizontal"&&(c?.infos.reverse(),n?.infos.reverse()),{sizeRampElement:c,colorRampElement:n}}function dt($,e){return!0}var ft=ke`@layer{instant-apps-interactive-legend-classic{display:block;--instant-apps-interactive-legend-heading-font-size: 1rem;--instant-apps-interactive-legend-heading-font-weight: normal;--instant-apps-interactive-legend-caption-font-weight: normal;--instant-apps-interactive-legend-secondary-color: var( --calcite-color-text-1 );--instant-apps-interactive-legend-field-name-font-size: 1rem;--instant-apps-interactive-legend-total-feature-count-font-size: .875rem;--instant-apps-interactive-legend-info-font-size: .875rem;--instant-apps-interactive-legend-info-item-background--selected: #c7ebff;--instant-apps-interactive-legend-info-item-background--selected--dark: #009af2;--instant-apps-interactive-legend-info-item-background--hover: #e9e9e9;--instant-apps-interactive-legend-info-item-background--hover--dark: #4a4a4a;--instant-apps-interactive-legend-info-item-color--selected: var( --calcite-color-text-2 );--instant-apps-interactive-legend-secondary-background-color: var( --calcite-color-background );--instant-apps-interactive-legend-ui-margin: 20px 15px;--instant-apps-interactive-legend-ui-padding: 20px 15px}instant-apps-interactive-legend-classic .esri-legend__service{padding:0}instant-apps-interactive-legend-classic .esri-legend__layer-body,instant-apps-interactive-legend-classic .esri-legend__layer,instant-apps-interactive-legend-classic .esri-legend__layer-table,instant-apps-interactive-legend-classic .esri-legend__group-layer-child,instant-apps-interactive-legend-classic .esri-legend__layer-child-table{margin:0;overflow:hidden}instant-apps-interactive-legend-classic .esri-legend__layer-caption calcite-action{margin-right:5px}instant-apps-interactive-legend-classic .esri-legend__layer-caption{display:flex;align-items:center;font-size:var(--instant-apps-interactive-legend-field-name-font-size);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-caption-btn-container{white-space:nowrap}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-caption-btn-container calcite-button{margin:2px}instant-apps-interactive-legend-classic .esri-legend__layer-caption{font-weight:var(--instant-apps-interactive-legend-caption-font-weight)}instant-apps-interactive-legend-classic .esri-legend__layer-cell.esri-legend__layer-cell--info{font-size:var(--instant-apps-interactive-legend-info-font-size);text-align:left}instant-apps-interactive-legend-classic .esri-legend__layer-cell,instant-apps-interactive-legend-classic .esri-legend__layer-row{display:flex;align-items:center}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__non-interactive .esri-legend__layer-body{display:block;margin:var(--instant-apps-interactive-legend-ui-margin)}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__non-interactive.instant-apps-interactive-legend__nested-unique-symbol>.esri-legend__layer-body{margin:0}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__non-interactive .esri-legend__layer-row{display:table-row}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__non-interactive .esri-legend__layer-cell{display:table-cell}instant-apps-interactive-legend-classic .esri-legend__layer-cell--symbols{justify-content:center;width:20%}instant-apps-interactive-legend-classic .esri-legend__layer-cell--info{width:65%}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive{margin:1px;background:transparent;border:none;width:100%}instant-apps-interactive-legend-classic .esri-legend__layer-cell--info{color:var(--instant-apps-interactive-legend-secondary-color)}instant-apps-interactive-legend-classic .esri-legend__layer-row,instant-apps-interactive-legend-classic .esri-legend__layer-caption{padding:var(--instant-apps-interactive-legend-ui-padding)}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive{position:relative}instant-apps-interactive-legend-classic .instant-apps-interactive-legend-element-info--selected{background-color:var(--instant-apps-interactive-legend-info-item-background--selected)}instant-apps-interactive-legend-classic .calcite-mode-dark .instant-apps-interactive-legend-element-info--selected{cursor:pointer;background-color:var(--instant-apps-interactive-legend-info-item-background--selected--dark)}instant-apps-interactive-legend-classic .calcite-mode-dark .instant-apps-interactive-legend-element-info--selected .esri-legend__layer-cell--info{color:var(--calcite-color-text-inverse)}instant-apps-interactive-legend-classic .hide{display:none}.instant-apps-interactive-legend__compact .esri-legend__layer-row{--instant-apps-interactive-legend-ui-padding: 10px 5px}.instant-apps-interactive-legend__compact .esri-legend__layer-row .esri-legend__layer-cell--info{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;line-clamp:2;line-height:1.3125rem;max-height:2.625rem}@media(min-width:992px){instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive{cursor:pointer}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover)}instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive:hover.instant-apps-interactive-legend-element-info--selected{background-color:#e2f2fe}instant-apps-interactive-legend-classic .calcite-mode-dark .instant-apps-interactive-legend__layer-row--interactive:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover--dark)}instant-apps-interactive-legend-classic .calcite-mode-dark .instant-apps-interactive-legend__layer-row--interactive:hover.instant-apps-interactive-legend-element-info--selected{background-color:#26a9f4}}}`,g={layer:"esri-legend__layer",layerBody:"esri-legend__layer-body",layerRow:"esri-legend__layer-row",layerInfo:"esri-legend__layer-cell esri-legend__layer-cell--info",imageryLayerStretchedImage:"esri-legend__imagery-layer-image--stretched",symbolContainer:"esri-legend__layer-cell esri-legend__layer-cell--symbols",symbol:"esri-legend__symbol",rampContainer:"esri-legend__ramps",sizeRamp:"esri-legend__size-ramp",colorRamp:"esri-legend__color-ramp",opacityRamp:"esri-legend__opacity-ramp",rampLabelsContainer:"esri-legend__ramp-labels",rampLabel:"esri-legend__ramp-label",univariateAboveAndBelowLabel:"esri-univariate-above-and-below-ramp__label",message:"esri-legend__message",interactiveLayerRow:"instant-apps-interactive-legend__layer-row--interactive",infoSelected:"instant-apps-interactive-legend-element-info--selected",compact:"instant-apps-interactive-legend__compact"},vt=24,qe={display:"flex",alignItems:"flex-start"},be={marginLeft:"3px"},ae={display:"table-cell",verticalAlign:"middle"},we=class extends ze{constructor(){super(...arguments),this.calculatingFeatureCount=!1,this.isLoading=!0,this.zoomTo=!1,this.featureCount=!1,this.filterMode={type:"filter"}}static{this.properties={isLoading:16,legendvm:0,zoomTo:5,featureCount:5,filterMode:0,messages:0}}static{this.styles=ft}static{this.shadowRootOptions=Re}connectedCallback(){super.connectedCallback(),!this.handles&&(this.handles=new it)}async load(){new MutationObserver(()=>{this.requestUpdate()}).observe(this.el,{attributes:!0}),W.onChange("data",()=>this.requestUpdate())}willUpdate(e){e.has("filterMode")&&this.legendvm?.view&&(this.hasUpdated||this.filterMode.type!=="filter")&&Ue(this.filterMode,this.legendvm.view)}async loaded(){await this.initLegend()}disconnectedCallback(){super.disconnectedCallback(),this.handles?.removeAll(),this.handles?.destroy(),this.handles=null}async initLegend(){try{await D.whenOnce(()=>this.legendvm?.view);let e=async()=>{try{let s=this.legendvm?.view?.map;await s?.load(),await s?.basemap?.load();let c=s?.allLayers?.map(async h=>await h.load()),n=(await Promise.allSettled(c)).map(h=>h?.status==="fulfilled"&&h?.value?h.value:null).filter(h=>!!h),r=[];n.forEach(h=>{this.legendvm?.view&&r.push(this.legendvm.view.whenLayerView(h))}),await Promise.allSettled(r);let u=await ve(this.legendvm);W.set("data",{...B.data,...u}),this.isLoading=!1,await this.setupWatchersAndListeners()}catch(s){console.error(s),this.isLoading=!1}};this.legendvm?.view?.when(e),this.legendvm?.view?.map?.layers?.on("after-changes",e)}catch{this.isLoading=!1}}getStretchStopLabel(e){let s=this.messages[e.label];return e.label?`${s}: ${typeof e.value=="string"?e.value:ce.formatNumber(e.value,{style:"decimal",notation:e.value.toString().includes("e")?"scientific":"standard"})}`:""}getTitle(e,s){if(!e)return;if(typeof e=="string"||typeof e=="number")return e;if("value"in e||"unit"in e){let r=typeof this.messages?.dotValue=="string"?this.messages.dotValue:"";return ce.substitute(r,e)}if("colorName"in e||"bandName"in e){let{colorName:r,bandName:u}=e,h=this.messages[r],w=typeof this.messages[u]=="string"?this.messages[u]:u;return`${h}: ${w}`}if("showCount"in e)return e.showCount?this.messages.clusterCountTitle:null;let c=null;if(s){let r=e;c=r.ratioPercentTotal?"showRatioPercentTotal":r.ratioPercent?"showRatioPercent":r.ratio?"showRatio":e.normField?"showNormField":e.field?"showField":null}else if(this.isRendererTitle(s)){let r=e;c=r.normField?"showNormField":r.normByPct?"showNormPct":r.field?"showField":null}let n=c==="showField"?"{field}":typeof c=="string"?this.messages[c]:"";return c?ce.substitute(n,{field:e.field,normField:e.normField}):""}isRendererTitle(e){return!e}async setupWatchersAndListeners(){let e=this.legendvm?.view?.map?.allLayers?.filter(n=>n?.type==="feature"),s=[];for(let n of e)this.legendvm?.view&&s.push(this.legendvm?.view?.whenLayerView(n));let c=[];try{c=await Promise.all(s)}catch(n){console.error(n)}for(let n of c){let r=`fLayerViewScale-${n.layer.id}`;!this.handles?.has(r)&&n&&this.handles?.add(n.watch("visibleAtCurrentScale",()=>{this.createDataForLayer(n.layer).catch(u=>{console.error(u)})}),r)}e?.forEach(n=>{let r=`fLayer-${n?.id}`;this.handles?.has(r)||this.handles?.add(D?.watch(()=>n?.visible,()=>{this.createDataForLayer(n).catch(u=>{console.error(u)})}),r)}),this.handles?.add(D.when(()=>this.legendvm,()=>{D.watch(()=>this.legendvm?.view?.updating,()=>{this.calculatingFeatureCount||this.legendvm?.view?.updating&&(this.calculatingFeatureCount=!0,D.when(()=>!this.legendvm?.view?.updating,()=>{pe(this.legendvm,B.data).then(n=>{W.set("data",{...B.data,...n}),this.calculatingFeatureCount=!1}).catch(n=>{console.error(n)})},{once:!0,initial:!0}))},{initial:!0})},{initial:!0,once:!0})),this.handles?.add(D.on(()=>this.legendvm?.activeLayerInfos,"change",n=>{ve(this.legendvm).then(r=>{W.set("data",{...B.data,...r}),this.requestUpdate()}).then(()=>{this.handles?.add(D.on(()=>n.children,"change",()=>{ve(this.legendvm).then(r=>{W.set("data",{...B.data,...r}),this.requestUpdate()}).catch(r=>{console.error(r)})}))}).catch(r=>{console.error(r)})})),this.handles?.add(D.on(()=>this.legendvm?.view?.map?.layers,"after-changes",()=>{pe(this.legendvm,B.data).then(n=>{W.set("data",{...B.data,...n}),this.calculatingFeatureCount=!1}).catch(n=>{console.error(n)})}))}async createDataForLayer(e){let s=W.get("data")?.[e?.id],c=Be(this.legendvm?.activeLayerInfos)?.find(n=>n?.layer?.id===e?.id);if(!s&&c){let n=await Ie(this.legendvm,c);if(me({intLegendLayerData:n,layerId:e?.id}),this.featureCount){let r=await pe(this.legendvm,B.data);W.set("data",{...B.data,...r})}}}applyFilter(e,s,c,n){return async()=>{let r={...B.data?.[s?.id]};n?await he(r,e,c,this.filterMode,n):await he(r,e,c,this.filterMode),me({intLegendLayerData:r,layerId:s?.id})}}render(){let e=this.renderFilteredLayers(),s=W.get("compact")?` ${g.compact}`:"";return this.isLoading?K("interactive-legend-loader",L`<calcite-loader scale=m .label=${this.messages?.loading} .text=${this.messages?.loading}></calcite-loader>`):K("interactive-legend-classic-container",L`<div class=${`${Z(this.el)}${s}`}>${e?.length>0?e:L`<div class=${_(g.message)}>${this.messages?.noLegend}</div>`}</div>`)}renderFilteredLayers(){return(this.legendvm?.activeLayerInfos?.toArray()).map(e=>this.renderLegendForLayer(e)).filter(e=>!!e)}renderLegendForLayer(e,s){if(!e.ready)return null;if(e.children.length){let r=e.children.map(u=>this.renderLegendForLayer(u,!0)).toArray();return L`<instant-apps-interactive-legend-group-legend-element class=${_(Z(this.el))} .legendvm=${this.legendvm} .featureCount=${this.featureCount} .activeLayerInfo=${e} .isChild=${s}><div style=${E({paddingLeft:"20px"})} .id=${`${e?.layer?.id}-legend-layer`} slot=content>${r}</div></instant-apps-interactive-legend-group-legend-element>`}let c=e.legendElements;if(c&&!c.length)return null;let n=c.map((r,u)=>this.renderLegendForElement(r,e.layer,e.effectList,e,u)).filter(r=>!!r);return n.length?L`<instant-apps-interactive-legend-layer-element class=${_(Z(this.el))} .legendvm=${this.legendvm} .featureCount=${this.featureCount} .activeLayerInfo=${e} .isChild=${!!s}><div slot=content .id=${`${e?.layer?.id}-legend-layer`} class=${_(g.layer)}>${n}</div></instant-apps-interactive-legend-layer-element>`:null}renderLegendForElement(e,s,c,n,r,u,h){let w=e.type==="color-ramp",b=e.type==="opacity-ramp",z=e.type==="size-ramp",k=null,x=Me(n,e,r),S=e?.type==="relationship-ramp";if(e.type==="symbol-table"||z){let R=e.infos.map((F,G)=>this.renderLegendForElementInfo(F,s,c,z,e,n,r,G,x,h)).filter(F=>!!F);R.length&&(k=L`<div class=${_(g.layerBody)}>${R}</div>`)}else if(e.type==="color-ramp"||e.type==="opacity-ramp"||e.type==="heatmap-ramp"||e.type==="stretch-ramp"){let R=e;k=this.renderLegendForRamp(R,s.opacity)}else if(S)k=K("relationship-ramp",L`<instant-apps-interactive-legend-relationship class=${_(Z(this.el))} .filterMode=${this.filterMode} .activeLayerInfo=${n} .legendElement=${e}></instant-apps-interactive-legend-relationship>`);else if(e.type==="pie-chart-ramp"){let R=e;k=this.renderPieChartRamp(R)}else if(e.type==="univariate-above-and-below-ramp"){let R=e;k=this.renderUnivariateAboveAndBelowRamp(R,s.opacity,c)}else if(e.type==="univariate-color-size-ramp"){let R=e;k=this.renderUnivariateColorSizeRamp(R,s.opacity,c)}if(!k)return null;let I=e.title,P=null;if(typeof I=="string")P=I;else if(I){let R=I,F=this.getTitle(R,w||b);this.isRendererTitle(w||b)?"title"in I&&(P=`${I.title} (${F})`):P=F}return L`<instant-apps-interactive-legend-legend-element class=${_(Z(this.el))} .activeLayerInfo=${n} .isSizeRamp=${z} .isChild=${!!u} .isColorRamp=${w} .isRelationshipRamp=${S} .isInteractive=${x} .zoomTo=${this.zoomTo} .legendElement=${e} .titleText=${P} .legendvm=${this.legendvm} .legendElementIndex=${r}><div slot=content>${k}</div></instant-apps-interactive-legend-legend-element>`}renderPieChartRamp(e){return L`<div .innerHTML=${`${e.preview?.outerHTML}`}></div>`}renderUnivariateAboveAndBelowRamp(e,s,c){let{sizeRampElement:n,colorRampElement:r}=ct(e,s);if(!n)return null;let u=$e(n,"above",!0),h=$e(n,"below",!0),w=12,b=ye(r,{width:w,height:u,rampAlignment:"vertical",opacity:s,type:"above",effectList:c}),z=ye(r,{width:w,height:h,rampAlignment:"vertical",opacity:s,type:"below",effectList:c}),k=De(n),x=n.infos.map(H=>H.label),S=x.map((H,U)=>U===0?L`<div class=${_(H?b?g.univariateAboveAndBelowLabel:g.rampLabel:"")}>${H}</div>`:U===2?L`<div></div>`:null),I=x.length-1,P=Math.floor(x.length/2),R=x.map((H,U)=>U===P||U===I?L`<div class=${_(H?b?g.univariateAboveAndBelowLabel:g.rampLabel:"")}>${H}</div>`:null),F={display:"table-cell",verticalAlign:"middle"},G={marginTop:`${k}px`},O={height:`${u}px`},j={height:`${h}px`};return K("univariate-above-and-below-ramp-preview",L`<div style=${E(qe)}><div class=${_(g.layerBody)}>${n.infos.map((H,U)=>L`<div class=${`${g.layerRow} ${g.sizeRamp}`}><div class=${_(g.symbol)} style=${E(F)} .innerHTML=${H?.preview?.outerHTML??""??""}></div>${!b&&U%2===0?L`<div class=${_(g.layerInfo)}>${x[U]}</div>`:null}</div>`)}</div>${b?K("color-ramp-preview",L`<div style=${E(G)}><div style=${E(be)}><div style=${E(ae)}><div class=${_(g.rampContainer)}>${b}</div></div><div style=${E(ae)}><div class=${_(g.rampLabelsContainer)} style=${E(O)}>${S}</div></div></div><div style=${E(be)}><div style=${E(ae)}><div class=${_(g.rampContainer)}>${z}</div></div><div style=${E(ae)}><div class=${_(g.rampLabelsContainer)} style=${E(j)}>${R}</div></div></div></div>`):null}</div>`)}renderUnivariateColorSizeRamp(e,s,c){let{sizeRampElement:n,colorRampElement:r}=ot(e);if(!n)return null;let u=De(n),h=12,w=$e(n,"full",!1),b=ye(r,{width:h,height:w,rampAlignment:"vertical",opacity:s,type:"full",effectList:c}),z=n.infos.length-1,k=n.infos.map((P,R)=>R===0||R===z?L`<div class=${_(P.label?r?g.univariateAboveAndBelowLabel:g.rampLabel:"")}>${P.label}</div>`:null),x={display:"table-cell",verticalAlign:"middle"},S={marginTop:`${u}px`},I={height:`${w}px`};return K("univariate-above-and-below-ramp-preview",L`<div style=${E(qe)}><div class=${_(g.layerBody)}>${n.infos.map(P=>L`<div class=${`${g.layerRow} ${g.sizeRamp}`}><div class=${_(g.symbol)} style=${E(x)} .innerHTML=${P?.preview?.outerHTML??""??""}></div></div>`)}</div>${K("color-ramp-preview",L`<div style=${E(S)}><div style=${E(be)}><div style=${E(ae)}><div class=${_(g.rampContainer)}>${b}</div></div><div style=${E(ae)}><div class=${_(g.rampLabelsContainer)} style=${E(I)}>${k}</div></div></div></div>`)}</div>`)}renderLegendForRamp(e,s){let c=e.infos,n=e.type==="opacity-ramp",r=e.type==="heatmap-ramp",u=e.type==="stretch-ramp",h=e.preview,w=n?g.opacityRamp:"";h&&(h.classList.add(g.colorRamp),w&&h.classList.add(w)),s!=null&&h&&(h.style.opacity=s.toString());let b=c.map(x=>{let S;if(r){let I=this.messages[x.label];S=typeof I=="string"?I:x.label}else u?S="value"in x?this.getStretchStopLabel(x):x.label:S=x.label;return L`<div class=${_(x.label?g.rampLabel:"")}>${S}</div>`}),z={width:`${vt}px`},k={height:h?.style?.height};return L`<div class=${_(g.layerRow)}><div class=${_(g.symbolContainer)} style=${E({...z})}><div class=${_(g.rampContainer)} ${Ee(x=>{x?.firstChild&&x?.firstChild?.remove(),x?.appendChild(h)})}></div></div><div class=${_(g.layerInfo)}><div class=${_(g.rampLabelsContainer)} style=${E({...k})}>${b}</div></div></div>`}renderLegendForElementInfo(e,s,c,n,r,u,h,w,b,z){if("infos"in e)return this.renderLegendForElement(e,s,c,u,h,!0,e);let k=null,x=!dt(s,r.type);if("preview"in e){let{outerHTML:q}=e.preview;k=L`<div class=${_(g.symbol)} .innerHTML=${q??""}></div>`}else"src"in e&&(k=this.renderImage(e,s,x));if(!k)return null;let S="",I=n?` ${g.sizeRamp}`:"",P,R=Te(s),F=He(R,z);if(B.data){let q=Pe(R,s,e,F,w),N=F?F?.nestedInfos:R,re=Fe(N);P=R?.categories?.size===1?!q?.selected:re||q?.selected}let G="label"in e?e.label:null,O=F&&!("value"in e)?!1:b,j=W.get("compact"),H=this.getTitle(G,!1)||"",U=F?r.title:G??s?.id;return O?L`<button @click=${this.applyFilter(e,s,w,z)} class=${`${g.layerRow} ${g.interactiveLayerRow}${P?` ${g.infoSelected}`:""}`} title=${(j?`${H}`:void 0)??fe} .ariaPressed=${P?"true":"false"}><div class=${`${g.symbolContainer}${S}${I}`}>${k}</div><div class=${`${g.layerInfo}${S}`}>${this.getTitle(G,!1)||""}</div>${this.featureCount&&!j?L`<instant-apps-interactive-legend-count class=${_(Z(this.el))} .categoryId=${U} .activeLayerInfo=${u} .legendvm=${this.legendvm} .selected=${!!P} .legendElement=${r} .infoIndex=${w}></instant-apps-interactive-legend-count>`:null}</button>`:L`<div class=${_(g.layerRow)}><div class=${`${g.symbolContainer}${S}${I}`}>${k}</div><div class=${`${g.layerInfo}${S}`}>${H}</div></div>`}renderImage(e,s,c){let{label:n,src:r,opacity:u}=e,h=c?` ${g.imageryLayerStretchedImage}`:"",w=c?"":` ${g.symbol}`,b={opacity:`${u??s.opacity}`};return L`<img alt=${this.getTitle(n,!1)??fe} src=${r??fe} width=${e.width} height=${e.height} class=${`$${h}${w}`} style=${E(b)}>`}};Se("instant-apps-interactive-legend-classic",we);return we},"symbols/support/symbolUtils","core/reactiveUtils","intl","core/Handles",a,b,c,d)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as x}from"./4T7P5RXF.js";import{a as S}from"./24S5LVU5.js";import{a as L}from"./N4KU3YV3.js";import{b as I}from"./Y7OWLSUL.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{F as $,G as v,H as k,J as p,h as F,i as l,l as h,r as b}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([T,m])=>{var D="instant-apps-filter-list calcite-mode-light",P="instant-apps-filter-list calcite-mode-dark",g=["feature","geojson","wfs","csv","scene","subtype-group","point-cloud","map-image","sublayer"];function w(f){return f.replaceAll("'","''")}function y(f,e=!1){if(f){let t=new Date(f),i=`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`;if(e){let s=`${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}`;return`${i} ${s}`}else return i}}function _(f){if(f!=null){f.value=["",""];let e=f.shadowRoot?.querySelectorAll("calcite-input");if(e!=null)for(let t of e)t.value=""}}var O=F`:host{display:block}.instant-apps-filter-list *{box-sizing:border-box}.instant-apps-filter-list__container{height:100%}.instant-apps-filter-list__container calcite-block{--calcite-internal-block-actions-spacing: 0}.instant-apps-filter-list__container calcite-block calcite-action[slot=actions-end]{height:100%}.instant-apps-filter-list__container calcite-block:last-of-type{margin-bottom:0}.instant-apps-filter-list__footer{padding:12px;display:flex}.instant-apps-filter-list__footer calcite-button:nth-child(2){margin-left:6px}.instant-apps-filter-list__item-container,.instant-apps-filter-list__item-container--user-input{display:flex;justify-content:space-between;align-items:center}.instant-apps-filter-list__item-container:not(:last-child),.instant-apps-filter-list__item-container--user-input:not(:last-child){padding-bottom:20px}.instant-apps-filter-list__item-container--user-input{margin:0;display:flex;flex-direction:column;align-items:flex-start}.instant-apps-filter-list__item-container--user-input>span{margin:0 0 6px;font-size:14px;font-weight:400}.instant-apps-filter-list__item-container--user-input calcite-combobox{width:100%;font-size:16px;--calcite-combobox-input-height: 24px}.instant-apps-filter-list__number-input-container{width:100%;display:flex;justify-content:center}.instant-apps-filter-list__number-input-container calcite-slider{width:90%}.instant-apps-filter-list__date-picker-input-container{display:flex;align-items:center;justify-content:unset;width:100%}.instant-apps-filter-list__date-picker-input-container calcite-action{height:65px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__time-picker-input-container{display:grid;grid-template-columns:auto 32px;width:100%}.instant-apps-filter-list__time-picker-input-container calcite-input-time-picker:first-child{grid-column:1;grid-row:1}.instant-apps-filter-list__time-picker-input-container calcite-input-time-picker:last-child{grid-column:1;grid-row:2}.instant-apps-filter-list__time-picker-input-container calcite-action{grid-column:2;grid-row:1/span 2;height:64px;width:33px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__title{margin-right:20px}.instant-apps-filter-list__title>p{font-size:14px;font-weight:400;margin:0}.instant-apps-filter-list__checkbox-container{display:flex}.instant-apps-filter-list__checkbox-container calcite-checkbox{height:18px}.instant-apps-filter-list__operator-description{margin:0;--calcite-font-size--1: 12px}.instant-apps-filter-list calcite-input-date-picker{--calcite-font-size--1: 16px}@media(prefers-reduced-motion){.instant-apps-filter-list calcite-loader{--calcite-internal-duration-factor: 2;--calcite-internal-animation-timing-slow: .6s }}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__header-container{background:#2b2b2b;color:#fff}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__operator-description{background:#353535}`,d={filterContainer:"instant-apps-filter-list__container",footer:"instant-apps-filter-list__footer",filterItemTitle:"instant-apps-filter-list__title",filterItemContainer:"instant-apps-filter-list__item-container",filterUIItemContainer:"instant-apps-filter-list__item-container--user-input",checkboxContainer:"instant-apps-filter-list__checkbox-container",numberInputContainer:"instant-apps-filter-list__number-input-container",dateInputContainer:"instant-apps-filter-list__date-picker-input-container",timeInputContainer:"instant-apps-filter-list__time-picker-input-container",operatorDesc:"instant-apps-filter-list__operator-description"},C=class extends k{constructor(){super(...arguments),this._messages=L({name:"instant-apps-filter-list",blocking:!0}),this.resetBtnEl=$(),this.panelEl=$(),this.isLayerExpUpdated=!1,this.isInitUpdateComplete=!1,this.baseClass=D,this.autoUpdateUrl=!1,this.closeBtn=!1,this.comboboxOverlayPositioning="absolute",this.openFilters=!1,this.extentSelector=!1,this.filterCount=0,this.zoomBtn=!0,this.resetBtn=!0,this.resetFiltersOnDisconnect=!0,this.filterListReset=b(),this.filterUpdate=b()}static{this.properties={loading:16,filterLayerExpressions:16,baseClass:16,initDefExpressions:16,initMapImageExpressions:16,initPointCloudFilters:16,layerExpressions:0,autoUpdateUrl:5,closeBtn:5,closeBtnOnClick:0,comboboxOverlayPositioning:1,closeBtnText:1,openFilters:5,extentSelector:5,extentSelectorConfig:0,urlParams:0,filterCount:9,view:0,zoomBtn:5,resetBtn:5,resetFiltersOnDisconnect:5}}static{this.styles=O}async forceReset(){return this.resetExpressions(),await Promise.resolve(!0)}async getCurrentLayerExpressions(){let e=structuredClone(this.filterLayerExpressions);return await Promise.resolve(e)}async getFilterInitState(){return await Promise.resolve({initDefExpressions:this.initDefExpressions,initMapImageExpressions:this.initMapImageExpressions,initPointCloudFilters:this.initPointCloudFilters})}async handleUpdatingT9nData(e){return e==null?await Promise.resolve(!0):(this.filterLayerExpressions?.forEach(t=>{let i=e?.find(s=>s.id===t.id);i!=null&&(t.title=i.title,t.expressions?.forEach(s=>{let n=i.expressions?.find(a=>a.id===s.id);n!=null&&(s.name=n.name)}))}),await Promise.resolve(!0))}async updateInitDefExpressions(e){return this.initDefExpressions=e.initDefExpressions,this.initMapImageExpressions=e.initMapImageExpressions,this.initPointCloudFilters=e.initPointCloudFilters,await Promise.resolve(!0)}connectedCallback(){super.connectedCallback(),!(this.layerExpressions==null&&this.view==null)&&(this.isLayerExpUpdated=!0,this.filterLayerExpressions=structuredClone(this.layerExpressions),this.isInitUpdateComplete=!1,this.handleLayerExpressionsUpdate())}async load(){this.baseClass=S(this.el)==="dark"?P:D,!this.isLayerExpUpdated&&(this.isLayerExpUpdated=!0,this.filterLayerExpressions=this.layerExpressions!=null?structuredClone(this.layerExpressions):[],this.view!=null&&this.handleLayerExpressionsUpdate())}willUpdate(e){e.has("view")&&this.handleWhenView(),e.has("layerExpressions")&&(this.isInitUpdateComplete=!1,this.resetAllFilters(),this.filterLayerExpressions=structuredClone(this.layerExpressions),this.handleLayerExpressionsUpdate())}updated(){this.resetBtnEl.value!=null&&(this.resetBtnEl.value.disabled=!(this.filterLayerExpressions&&this.filterLayerExpressions.length>0))}disconnectedCallback(){super.disconnectedCallback(),this.resetFiltersOnDisconnect&&(this.isLayerExpUpdated=!1,this.filterLayerExpressions=structuredClone(this.layerExpressions),this.resetAllFilters())}initFilterConfig(){if(this.filterLayerExpressions&&this.filterLayerExpressions.length>0){if(this.filterLayerExpressions.length===1){let{operator:e}=this.filterLayerExpressions[0],t=e?.trim()==="OR"?"orOperator":"andOperator",i=this.renderZoomTo(this.filterLayerExpressions[0]);return l`<calcite-block class=${p(d.operatorDesc)} .heading=${this._messages[t]} expanded>${i}${this.renderFilter(this.filterLayerExpressions[0])}</calcite-block>`}else if(this.filterLayerExpressions.length>1)return this.renderLayerBlock()}}handleResetDatePicker(e,t){let i=this.panelEl.value?.querySelector(`[id='${e.id}']`);i&&(_(i),e.active=!1,e.definitionExpression=void 0,e.range=void 0,this.generateOutput(t))}handleResetTimePicker(e,t){this.resetTimePicker(e),e.active=!1,e.definitionExpression=void 0,e.range=void 0,this.generateOutput(t)}resetTimePicker(e){let t=this.panelEl.value?.querySelector(`[id='${e.id}-min']`),i=this.panelEl.value?.querySelector(`[id='${e.id}-max']`);!t||!i||(t.value=e.min,i.value=e.max)}initInput(e,t){let{type:i,numDisplayOption:s,displayOption:n}=t;if(i==="string"||i==="coded-value"||(i==="number"||i==="range"||i==="date"||i==="time-only")&&(s==="drop-down"||n==="drop-down"))return this.renderCombobox(e,t);if(i==="number"||i==="range")return this.renderNumberSlider(e,t);if(i==="date")return this.renderDatePicker(e,t);if(i==="time-only")return this.renderTimePicker(e,t)}async initExpressions(){if(this.loading=!0,this.filterLayerExpressions==null||this.view==null){this.loading=!1;return}await this.processExpressions(),this.loading=!1}async processExpressions(){this.filterLayerExpressions&&await Promise.all(this.filterLayerExpressions.map(async e=>{await Promise.all((e.expressions||[]).map(async t=>await this.setInitExpression(e,t)))}))}handleResetFilter(){this.resetExpressions(),this.resetAllFilters(),this.generateURLParams(),this.filterListReset.emit()}resetExpressions(){this.filterLayerExpressions?.forEach(e=>{e.expressions?.forEach(t=>{let{type:i,numDisplayOption:s,displayOption:n}=t,a="";i==="string"||i==="coded-value"||(i==="number"||i==="range"||i==="date"||i==="time-only")&&(s==="drop-down"||n==="drop-down")?a="combobox":i==="date"?a="datePicker":i==="number"||i==="range"?a="numberRange":i==="time-only"&&(a="timePicker"),a?this.resetExpressionUI(a,t):this.resetCheckbox(t),t.active=!1})})}resetExpressionUI(e,t){let{id:i}=t;switch(e){case"combobox":{t.selectedFields=void 0;let s=this.panelEl.value?.querySelector(`[id='${i}']`);s&&Array.from(s.children).forEach(n=>{n.selected=!1});break}case"datePicker":{t.range=void 0;let s=this.panelEl.value?.querySelector(`[id='${i}']`);s&&_(s);break}case"numberRange":{t.range=void 0;let s=this.panelEl.value?.querySelector(`[id='${i}']`);s&&(s.minValue=t.min,s.maxValue=t.max);break}case"timePicker":t.range=void 0,this.resetTimePicker(t)}}resetCheckbox(e){let{id:t}=e,i=this.panelEl.value?.querySelector(`[id='${t}']`);i&&(i.checked=!1)}resetAllFilters(){this.view?.map?.allLayers?.concat(this.view?.map?.allTables.toArray()??[])?.forEach(e=>{if(!g.includes(e.type))return;let t=e;if(t.type==="point-cloud"){if(!this.initPointCloudFilters)return;t.filters=this.initPointCloudFilters[t.id]}else if(t.type==="map-image")t.allSublayers.forEach(i=>{i.definitionExpression=this.initMapImageExpressions?.[t.id]?.[i.id]??""});else{if(this.initDefExpressions==null)return;t.definitionExpression=this.initDefExpressions[t.id]}})}async updateStringExpression(e,t){let i=this.findFilterLayer(e);return i?(await this.getFeatureAttributes(i,t),this.handleDateField(i,t),t?.selectedFields?(t.definitionExpression=this.createDefinitionExpression(t),!0):!1):!1}handleDateField(e,t){t.type==="date"&&e.fields.find(({name:i})=>i===t.field)?.type==="date-only"&&(t.dateOnly=!0)}createDefinitionExpression(e){if(!e.selectedFields?.length)return"";let t=e.selectedFields.map(i=>typeof i=="number"?i:`'${w(i)}'`);return`${e.field} IN (${t.join(",")})`}async updateNumberExpression(e,t){if(!t?.min&&t?.min!==0||!t?.max&&t?.max!==0){let i=this.findFilterLayer(e);if(!i)return!1;let{field:s}=t;if(s!=null)if(this.setExpressionFormat(i,t,s),t?.numDisplayOption==="drop-down"||t?.displayOption==="drop-down")await this.getFeatureAttributes(i,t);else{let n=(await this.calculateMinMaxStatistics(i,s))?.[0]?.attributes;if(t.format?.places!=null?(t.min=this.roundMinNumberDown(n[`min${s}`],t.format.places),t.max=this.roundMaxNumberUp(n[`max${s}`],t.format.places)):(t.min=n[`min${s}`],t.max=n[`max${s}`]),t?.range&&Object.keys(t.range).length){let{min:a,max:r}=t.range;return t.definitionExpression=`${t.field} BETWEEN ${a} AND ${r}`,!0}}}return!1}async updateDateExpression(e,t){let{field:i,range:s}=t,n=this.findFilterLayer(e);if(!n)return!1;let a=(await this.calculateMinMaxStatistics(n,i))?.[0]?.attributes;if(t.min=y(a[`min${i}`]),t.max=y(a[`max${i}`]),s!=null&&(s?.max!=null||s?.min!=null)){let{min:r,max:o}=s;if(r=r?.replace("+"," "),o=o?.replace("+"," "),r||o){let c=o&&!r?"<":!o&&r?">":null;return c?t.definitionExpression=`${i} ${c} '${r??o}'`:t.definitionExpression=`${i} BETWEEN '${r}' AND '${o}'`,!0}}return!1}async updateTimeExpression(e,t){let{field:i,range:s}=t,n=this.findFilterLayer(e);if(!n)return!1;let a=(await this.calculateMinMaxStatistics(n,i))?.[0]?.attributes;if(t.min=a[`min${i}`],t.max=a[`max${i}`],s!=null&&(s?.max!=null||s?.min!=null)){let{min:r,max:o}=s;if(r||o){let c=o&&!r?"<":!o&&r?">":null;return c?t.definitionExpression=`${i} ${c} TIME '${r??o}'`:t.definitionExpression=`${i} BETWEEN TIME '${r}' AND TIME '${o}'`,!0}}return!1}async updateCodedValueExpression(e,t,i){if(!i?.domain||i?.domain?.type!=="coded-value")return!1;let s=this.findFilterLayer(e);if(!s)return!1;await this.getFeatureAttributes(s,t);let n=i.domain.codedValues.reduce((a,{code:r,name:o})=>(a[r]=o,a),{});if(t.codedValues=n,this.sortCodedValues(t),t.selectedFields?.length){let a=t.selectedFields.map(r=>typeof r=="number"?r:`'${w(r)}'`).join(",");return t.definitionExpression=`${t.field} IN (${a})`,!0}return!1}updateRangeExpression(e,t){if(!t?.domain||t?.domain?.type!=="range")return!1;let{field:i,range:s}=e;return e.min=t.domain.minValue,e.max=t.domain.maxValue,s&&Object.keys(s).length?(e.definitionExpression=`${i} BETWEEN ${s.min} AND ${s.max}`,!0):!1}async getFeatureAttributes(e,t){if(!this.isLayerSupported(e)){t.fields=[];return}let i=await this.getQueryLayer(e),{maxRecordCount:s,supportsMaxRecordCountFactor:n}=this.extractQueryCapabilities(e),a=await i.queryFeatureCount(),r=this.createQuery(i,t);await this.queryDistinctFeatures(i,r,t),this.shouldPaginate(s,a,n)&&this.handlePagination(i,r,s,n,a,t)}isLayerSupported(e){return e&&g.includes(e.type)}extractQueryCapabilities(e){return{maxRecordCount:e.capabilities?.query?.maxRecordCount??e.sourceJSON?.maxRecordCount,supportsMaxRecordCountFactor:e.capabilities?.query?.supportsMaxRecordCountFactor}}createQuery(e,t){let i=e.createQuery();this.applyCacheHint(e,i);let s=t?.field;if(s){let n=this.getInitDefExprFromLayer(e);i.where=n||"1=1",i.outFields=[s],i.orderByFields=[`${s} ASC`],i.returnDistinctValues=!0,i.returnGeometry=!1,i.maxRecordCountFactor=5,this.applyQueryGeometryFromExtentSelector(i)}return i}async queryDistinctFeatures(e,t,i){if(!t.outFields)return;let s=await this.queryForFeatures(e,t,t.outFields[0]);s?.length&&(i.fields=[...new Set(s)],i.type==="string"?i.fields=i.fields.sort((n,a)=>n.localeCompare(a)):i.type==="number"&&(i.fields=i.fields.sort((n,a)=>n-a)))}getQueryCount(e,t){return t?e*5:e}shouldPaginate(e,t,i){let s=this.getQueryCount(e,i);return e!=null&&t>s}async handlePagination(e,t,i,s,n,a){let r=this.getQueryCount(i,s),o=[];for(let c=r;c<n;c+=r){let u=t.clone();u.num=i,u.start=c,o.push(this.queryForFeatures(e,u,t?.outFields?.[0]??""))}Promise.all(o).then(c=>{c.forEach(u=>{u?.length&&a.fields&&a.fields.push(...u)}),a.type==="string"?a.fields=[...new Set(a.fields)].sort((u,E)=>u.localeCompare(E)):a.type==="number"?a.fields=[...new Set(a.fields)].sort((u,E)=>u-E):a.type==="coded-value"&&a.codedValues?this.sortCodedValues(a):a.fields=[...new Set(a.fields)].sort()})}async queryForFeatures(e,t,i){return(await e.queryFeatures(t))?.features.filter(s=>{let n=s.attributes?.[i];return n!=null&&n!==""})?.map(s=>s.attributes?.[i])}async calculateMinMaxStatistics(e,t){if(!e||!g.includes(e.type)||!t)return[];let i=this.createStatisticsQuery(e,t);return(await e.queryFeatures(i))?.features||[]}createStatisticsQuery(e,t){let i=e.createQuery();return i.where=this.getInitDefExprFromLayer(e)||"1=1",this.applyCacheHint(e,i),i.outStatistics=[{onStatisticField:t,outStatisticFieldName:`max${t}`,statisticType:"max"},{onStatisticField:t,outStatisticFieldName:`min${t}`,statisticType:"min"}],this.applyQueryGeometryFromExtentSelector(i),i}getExtent(e,t){if(e&&t){let{constraints:i}=t,s={...i}.geometry;if(s){let n="extent"in s?s:T.fromJSON(s);if(n?.type==="extent"||n?.type==="polygon")return n}}}async setInitExpression(e,t){if(!t.field||!t.type){await this.updateExpression(e,t,void 0);return}let i=this.findFilterLayer(e);i&&((i.loadStatus==="not-loaded"||i.loadStatus==="failed")&&await i.load(),await i.when(async()=>{let s=i.fields?.find(({name:a})=>a===t.field),n=s?.domain?.type;t.type=n==="coded-value"||n==="range"?n:t.type,await this.updateExpression(e,t,s)}))}async updateExpression(e,t,i){let s=await this.handleExpressionType(e,t,i);this.requestUpdate(),s&&this.generateOutput(e)}async handleExpressionType(e,t,i){switch(t.type){case"string":return await this.updateStringExpression(e,t);case"number":return await this.updateNumberExpression(e,t);case"date":return await this.updateDateExpressionBasedOnDisplayOption(e,t);case"time-only":return await this.updateTimeExpressionBasedOnDisplayOption(e,t);case"coded-value":return await this.updateCodedValueExpression(e,t,i);case"range":return await this.updateRangeExpressionBasedOnDisplayOption(e,t,i);case"checkbox":case null:case void 0:return t.active??!1;default:return!1}}async updateDateExpressionBasedOnDisplayOption(e,t){return t.displayOption==="drop-down"?await this.updateStringExpression(e,t):await this.updateDateExpression(e,t)}async updateTimeExpressionBasedOnDisplayOption(e,t){return t.displayOption==="drop-down"?await this.updateStringExpression(e,t):await this.updateTimeExpression(e,t)}async updateRangeExpressionBasedOnDisplayOption(e,t,i){return t.displayOption==="drop-down"?await this.updateStringExpression(e,t):this.updateRangeExpression(t,i)}updateRangeExpressions(e,t,i,s){let n=this.getInitDefExprFromLayerExpression(t);(s||s===0)&&(i||i===0)&&(s===e?.min&&i===e?.max?(e.definitionExpression=void 0,e.active=!1):(e.definitionExpression=n?`(${n}) AND ${e?.field} BETWEEN ${s} AND ${i}`:`${e?.field} BETWEEN ${s} AND ${i}`,e.active=!0)),e.range={min:s,max:i}}handleCheckboxChange(e,t,i){let s=i.target;t.active=s.checked,this.generateOutput(e)}handleSliderChange(e,t,i){let{maxValue:s,minValue:n}=i.target;this.updateRangeExpressions(e,t,s,n),this.generateOutput(t)}handleComboSelect(e,t,i){let s=i.target.selectedItems,{field:n,type:a}=e;if(e.selectedFields=s.map(({value:r})=>r),s.length){let r=s.map(({value:o})=>typeof o=="number"?o:`'${w(o)}'`);e.definitionExpression=a==="date"?r.map(o=>this.buildDateExpression(o,n)).join(" OR "):a==="time-only"?`${n} IN (${r.map(o=>`TIME ${o}`).join(",")})`:`${n} IN (${r.join(",")})`,e.active=!0}else e.definitionExpression=void 0,e.active=!1;this.generateOutput(t)}handleDatePickerRangeChange(e,t,i){let s=i.target,[n,a]=s.valueAsDate,r=n?y(Math.floor(n.getTime()),!0):void 0,o=a?y(Math.floor(a.getTime()),!0):void 0;(r||o)&&(e.definitionExpression=this.constructDefinitionExpression(e.field,r,o),e.range={min:r,max:o},e.active=!0,this.generateOutput(t))}handleTimePickerRangeChange(e,t,i,s){let n=s.target,a=n.value;e.range==null&&(e.range={min:void 0,max:void 0}),i?e.max&&a>e.max?(e.range.min=e.max,n.value=e.range.min):e.min&&a<e.min?(e.range.min=e.min,n.value=e.range.min):e.range.min=a:e.max&&a>e.max?(e.range.max=e.max,n.value=e.range.max):e.min&&a<e.min?(e.range.max=e.min,n.value=e.range.max):e.range.max=a,(e.range.min||e.range.max)&&(e.definitionExpression=this.constructTimeDefinitionExpression(e.field,e.range.min,e.range.max),e.active=!0,this.generateOutput(t))}constructDefinitionExpression(e,t,i){return t?i?`${e} BETWEEN '${t}' AND '${i}'`:`${e} > '${t}'`:`${e} < '${i}'`}constructTimeDefinitionExpression(e,t,i){return t?i?`${e} BETWEEN TIME '${t}' AND TIME '${i}'`:`${e} > TIME '${t}'`:`${e} < TIME '${i}'`}handleURLParams(){if(!("URLSearchParams"in window))return;let e=new URLSearchParams(document.location.search).get("filter");if(!e){this.filterCount=0;return}let t=e.split(";").map(i=>JSON.parse(i));this.filterCount=this.applyFilters(t)}applyFilters(e){let t=0;return e.forEach(i=>{let s=this.filterLayerExpressions?.find(n=>n.id===i.layerId);s&&s.expressions?.forEach(n=>{n.id?.toString()===i.expressionId?.toString()&&(this.activateExpression(n,i),t++)})}),t}activateExpression(e,t){e.active=!0,t.type==="range"?e.range=t.range:t.type==="select"&&(e.selectedFields=t.selectedFields)}createURLParamExpression(e,t){let{id:i,range:s,selectedFields:n,type:a}=t;return a==="string"||a==="coded-value"||t?.numDisplayOption==="drop-down"||t?.displayOption==="drop-down"?{type:"select",layerId:e.id,expressionId:i.toString(),selectedFields:n}:a==="number"||a==="range"||a==="date"||a==="time-only"?{type:"range",layerId:e.id,expressionId:i.toString(),range:s}:{layerId:e.id,expressionId:i.toString()}}autoUpdateURLCheck(e){if(this.autoUpdateUrl){let t=e.toString()?`${window.location.pathname}?${e}`.trim():window.location.pathname;window.history.replaceState({},"",t)}}generateURLParams(){if(!("URLSearchParams"in window))return;let e=new URLSearchParams(window.location.search),t=this.filterLayerExpressions?.flatMap(i=>i?.expressions?.filter(s=>s.active).map(s=>JSON.stringify(this.createURLParamExpression(i,s)))||[])||[];this.filterCount=t.length,t.length>0?e.set("filter",t.join(";")):e.delete("filter"),this.autoUpdateURLCheck(e),this.urlParams=e}updateFilter(e,t,i){let{id:s}=e,n=this.view.map?.findLayerById(s)??this.view.map?.findTableById(s);if(n!=null)if(n.type==="point-cloud")this.updateFilterLayerPCLFilter(n,i);else if(n.type==="map-image"){let a=n.findSublayerById(e?.sublayerId);a!=null&&this.updateFilterLayerDefExpression(a,t,e)}else this.updateFilterLayerDefExpression(n,t,e)}updateFilterLayerDefExpression(e,t,i){let{operator:s}=i,n=this.getInitDefExprFromLayer(e),a=t?.length>0&&n!=null&&n!==""?`(${t.join(s)}) AND (${n})`:t.length>0?t.join(s):n;e.definitionExpression=a}updateFilterLayerPCLFilter(e,t){e.filters=t}async handleWhenView(){this.view!=null&&(await this.view.map.loadAll(),await this.handleLayerExpressionsUpdate())}async handleLayerExpressionsUpdate(){this.isInitUpdateComplete||(this.updateInitExpressions(),this.handleURLParams(),this.initExpressions())}async handleZoomTo(e){let t=e?.sublayerId?`#zoom-to-${e.id}-${e.sublayerId}`:`#zoom-to-${e.id}`,i=this.panelEl.value?.querySelector(t),s=(n,a)=>{i&&(i.loading=n,i.disabled=a)};if(s(!0,!0),await this.getZoomToExtent(e),this.zoomToExtent){let n=this.zoomToExtent.type==="point"&&this.zoomToExtent.count===1?{target:this.zoomToExtent.extent,zoom:10}:this.zoomToExtent.extent;await this.view.goTo(n)}s(!1,!1)}async getZoomToExtent(e){let t=this.view.allLayerViews.find(({layer:s})=>s.id===e.id).layer,i=t.type==="map-image"?t.findSublayerById(e.sublayerId):t;if(i&&i.type!=="point-cloud"&&g.includes(i?.type)){let s=await this.getQueryLayer(i),n=s.createQuery();n.where=s.definitionExpression??"1=1";let a=await s.queryExtent(n);this.zoomToExtent={...a,type:s.geometryType}}}generateOutput(e){if(this.view==null)return;let t=[],i=[];if(e){for(let s of e.expressions){let{active:n,definitionExpression:a,pointCloudFilters:r}=s;n&&a&&t.push(`(${a})`),n&&r!=null&&r.length>0&&(i=i.concat(r))}this.updateFilter(e,t,i),this.generateURLParams(),this.filterUpdate.emit()}}numberWithCommas(e){return e.toLocaleString("en-US",{maximumFractionDigits:20})}scientificRounding(e,t,i){if(e==null)return;let s;if(!String(e).includes("e"))s=Math[i](e*Math.pow(10,t))/Math.pow(10,t);else{let[n,a]=String(e).split("e").map(o=>Number(o)),r=a+t;s=Math[i](+`${n}e${r}`)*Math.pow(10,-t)}return+s.toFixed(t)}roundMinNumberDown(e,t){return this.scientificRounding(e,t,"floor")}roundMaxNumberUp(e,t){return this.scientificRounding(e,t,"ceil")}roundNumber(e,t){return this.scientificRounding(e,t,"round")??e}setExpressionFormat(e,t,i){if(e?.popupTemplate!=null){let s=e?.popupTemplate.fieldInfos?.find(({fieldName:n})=>n===i);s?.format&&(t.format=s.format)}}getInitDefExprFromLayer(e){return e.type==="sublayer"?this.initMapImageExpressions?.[e?.layer?.id??""]?.[e.id]??"":this.initDefExpressions?.[e.id]??""}getInitDefExprFromLayerExpression(e){return e?.sublayerId!=null?this.initMapImageExpressions?.[e.id]?.[e.sublayerId]??"":this.initDefExpressions?.[e.id]??""}findFilterLayer(e){let t=this.view.map?.allLayers.concat(this.view.map?.allTables.toArray()??[])?.find(({id:i})=>i===e.id);return t?.type==="map-image"?t?.findSublayerById(e.sublayerId):t}createLabel(e,t){if(e.type==="coded-value")return e?.codedValues?.[t]??t;if(e.type==="number"&&typeof t=="number"){let i=t;return e.format?.places!=null&&(i=this.roundNumber(t,e.format.places)),e.format?.digitSeparator?this.numberWithCommas(i):i}if(e.type==="date"&&!e.dateOnly){let i=m.convertDateFormatToIntlOptions("short-date-long-time");return m.formatDate(t,i)}if(e.type==="time-only"){let i=m.convertDateFormatToIntlOptions("long-time");return m.formatTimeOnly(t,i)}return t}buildDateExpression(e,t){if(e){let i=new Date(e),s=new Date(e),n=new Date(s.setDate(i.getDate()+1)),a=`${i.getFullYear()}-${i.getMonth()+1}-${i.getDate()}`,r=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}`,o=`${n.getHours()}:${n.getMinutes()}:${n.getSeconds()}`,c=`${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()}`;return`${t} BETWEEN '${a} ${r}' AND '${c} ${o}'`}}async getQueryLayer(e){let t=e.type==="sublayer"?await e.createFeatureLayer():e;if(!t)throw new Error("Failed to create feature layer");return t}applyCacheHint(e,t){e?.capabilities?.query?.supportsCacheHint&&(t.cacheHint=!0)}applyQueryGeometryFromExtentSelector(e){if(!this.extentSelector||!this.extentSelectorConfig)return;let t=this.getExtent(this.extentSelector,this.extentSelectorConfig);t&&(e.geometry=t,e.spatialRelationship="intersects")}updateInitExpressions(){if(!this.view?.map)return;let e=this.view.map;this.initDefExpressions={},this.initPointCloudFilters={},this.initMapImageExpressions={},e.allLayers.concat(e.allTables.toArray()??[]).forEach(t=>{if(!g.includes(t.type))return;let i=t;if(i.type==="point-cloud")this.initPointCloudFilters||(this.initPointCloudFilters={}),this.initPointCloudFilters[i.id]=i.filters;else if(i.type==="map-image")this.initMapImageExpressions||(this.initMapImageExpressions={}),this.initMapImageExpressions[i.id]=i.allSublayers.reduce((s,n)=>(s[n.id]=n.definitionExpression??"",s),{});else{if(!this.initDefExpressions)return;this.initDefExpressions[i.id]=i.definitionExpression??""}}),this.isInitUpdateComplete=!0}sortCodedValues(e){typeof e.fields?.[0]=="number"?e.fields=[...new Set(e.fields)].sort((t,i)=>{let s=e.codedValues?.[t],n=e.codedValues?.[i];return(s??t)-(n??i)}):e.fields=[...new Set(e.fields)].sort((t,i)=>{let s=e.codedValues?.[t],n=e.codedValues?.[i],a=s??t,r=n??i;return a.localeCompare(r)})}render(){let e=this.loading?this.renderLoading():this.initFilterConfig(),t=this.renderFooter();return l`<calcite-panel class=${p(this.baseClass)} ${v(this.panelEl)}><slot slot=header-content name=filter-header-content></slot><slot slot=header-actions-end name=filter-header-actions-end></slot>${x("filter-container",l`<div class=${p(d.filterContainer)}>${e}${t}</div>`)}</calcite-panel>`}renderLoading(){return l`<calcite-loader label="Loading filters..."></calcite-loader>`}renderFilter(e){let{id:t}=e;return e.expressions.map((i,s)=>i.type==="checkbox"||i.type==null?x(`${t}-${s}`,l`<div class=${p(d.filterItemContainer)}><div class=${p(d.filterItemTitle)}><p>${i.name}</p></div><div class=${p(d.checkboxContainer)}><calcite-checkbox id=${i.id.toString()??h} scale=l .checked=${i?.active} @calciteCheckboxChange=${this.handleCheckboxChange.bind(this,e,i)}></calcite-checkbox></div></div>`):this.initInput(e,i))}renderLayerBlock(){return this.filterLayerExpressions?.map(e=>this.renderFilterBlocks(e))}renderFilterBlocks(e){let t=this.renderFilter(e),{operator:i}=e,s=i?.trim()==="OR"?"orOperator":"andOperator",n=this.renderZoomTo(e);return x(e.id,l`<calcite-block .heading=${e.title} .description=${this._messages[s]} .expanded=${this.openFilters?!0:void 0} collapsible>${n}${t}</calcite-block>`)}renderCombobox(e,t){return x("combo-select",l`<label class=${p(d.filterUIItemContainer)}><span>${t.name}</span><calcite-combobox id=${t.id.toString()??h} @calciteComboboxChange=${this.handleComboSelect.bind(this,t,e)} .label=${t.name} .placeholder=${t.placeholder} selection-mode=multiple max-items=6 scale=s .overlayPositioning=${this.comboboxOverlayPositioning}>${t.fields?.map((i,s)=>this.renderComboboxItem(t,i,s))}</calcite-combobox></label>`)}renderComboboxItem(e,t,i){let s=this.createLabel(e,t),n=e?.selectedFields?.includes(t)??!1;return x(`${s}-${i}`,l`<calcite-combobox-item .value=${t} .heading=${`${s}`} .selected=${n}></calcite-combobox-item>`)}renderNumberSlider(e,t){let i=t?.min,s=t?.max,n=t?.step?t.step:1,a=i!=null&&s!=null,r=t?.field??"",o=t?.range?.min!=null?t.range.min:i,c=t?.range?.max!=null?t.range.max:s,u=[o,c];return a?x(t?.id.toString(),l`<label class=${p(d.filterUIItemContainer)}><span>${t?.name}</span><div class=${p(d.numberInputContainer)}><calcite-slider id=${t?.id.toString()??h} @calciteSliderChange=${this.handleSliderChange.bind(this,t,e)} .min=${i} .max=${s} .minValue=${i} .maxValue=${s} .minLabel=${this._messages.minSlider?.replace("{field}",r)} .maxLabel=${this._messages.maxSlider?.replace("{field}",r)} .step=${n} label-handles snap .value=${u} .groupSeparator=${t?.format?.digitSeparator} precise></calcite-slider></div></label>`):void 0}renderDatePicker(e,t){let{min:i,max:s}=t,n=[t?.range?.min,t?.range?.max];return i!=null&&s!=null?l`<label class=${p(d.filterUIItemContainer)}><span>${t?.name}</span><div class=${p(d.dateInputContainer)}><calcite-input-date-picker id=${t?.id.toString()??h} @calciteInputDatePickerChange=${this.handleDatePickerRangeChange.bind(this,t,e)} .min=${i} .max=${s} calendars=1 overlay-positioning=fixed lang=${m.getLocale()??"en"??h} layout=vertical .value=${n} range></calcite-input-date-picker><calcite-action @click=${this.handleResetDatePicker.bind(this,t,e)} icon=reset .text=${this._messages.resetDatePicker} title=${this._messages.resetDatePicker??h} scale=s></calcite-action></div></label>`:void 0}renderTimePicker(e,t){let{min:i,max:s,range:n}=t,a=i!=null&&s!=null,r=n?.min!=null?n.min:i,o=n?.max!=null?n.max:s;return a?l`<label class=${p(d.filterUIItemContainer)}><span>${t?.name}</span><div class=${p(d.timeInputContainer)}><calcite-input-time-picker .id=${`${t?.id.toString()}-min`} .value=${r} overlay-positioning=fixed lang=${m.getLocale()??"en"??h} @calciteInputTimePickerChange=${this.handleTimePickerRangeChange.bind(this,t,e,!0)}></calcite-input-time-picker><calcite-input-time-picker .id=${`${t?.id.toString()}-max`} .value=${o} overlay-positioning=fixed lang=${m.getLocale()??"en"??h} @calciteInputTimePickerChange=${this.handleTimePickerRangeChange.bind(this,t,e,!1)}></calcite-input-time-picker><calcite-action @click=${this.handleResetTimePicker.bind(this,t,e)} icon=reset .text=${this._messages.resetTimePicker} title=${this._messages.resetTimePicker??h} scale=s></calcite-action></div></label>`:void 0}renderFooter(){let e=this.closeBtnText??this._messages.close,t=this.closeBtn&&this.resetBtn?"half":"full";return l`<div class=${p(d.footer)} slot=footer>${this.resetBtn?l`<calcite-button appearance=outline .width=${t} @click=${this.handleResetFilter} ${v(this.resetBtnEl)}>${this._messages.resetFilter}</calcite-button>`:void 0}${this.closeBtn?l`<calcite-button appearance=solid .width=${t} kind=brand @click=${this.closeBtnOnClick}>${e}</calcite-button>`:void 0}</div>`}renderZoomTo(e){let t=e?.sublayerId?`zoom-to-${e.id}-${e.sublayerId}`:`zoom-to-${e.id}`;return this.zoomBtn?l`<calcite-action id=${t??h} slot=actions-end appearance=transparent .text=${this._messages.zoomTo} title=${this._messages.zoomTo??h} scale=s icon=magnifying-glass-plus @click=${this.handleZoomTo.bind(this,e)}></calcite-action>`:void 0}};I("instant-apps-filter-list",C);return C},"geometry/support/jsonUtils","intl")
|
|
2
|
+
import{a as x}from"./4T7P5RXF.js";import{a as S}from"./24S5LVU5.js";import{a as L}from"./TPRPYUVX.js";import{b as I}from"./3LEJ44U2.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{F as $,G as v,H as k,J as p,h as F,i as l,l as h,r as b}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([T,m])=>{var D="instant-apps-filter-list calcite-mode-light",P="instant-apps-filter-list calcite-mode-dark",g=["feature","geojson","wfs","csv","scene","subtype-group","point-cloud","map-image","sublayer"];function w(f){return f.replaceAll("'","''")}function y(f,e=!1){if(f){let t=new Date(f),i=`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`;if(e){let s=`${t.getHours()}:${t.getMinutes()}:${t.getSeconds()}`;return`${i} ${s}`}else return i}}function _(f){if(f!=null){f.value=["",""];let e=f.shadowRoot?.querySelectorAll("calcite-input");if(e!=null)for(let t of e)t.value=""}}var O=F`:host{display:block}.instant-apps-filter-list *{box-sizing:border-box}.instant-apps-filter-list__container{height:100%}.instant-apps-filter-list__container calcite-block{--calcite-internal-block-actions-spacing: 0}.instant-apps-filter-list__container calcite-block calcite-action[slot=actions-end]{height:100%}.instant-apps-filter-list__container calcite-block:last-of-type{margin-bottom:0}.instant-apps-filter-list__footer{padding:12px;display:flex}.instant-apps-filter-list__footer calcite-button:nth-child(2){margin-left:6px}.instant-apps-filter-list__item-container,.instant-apps-filter-list__item-container--user-input{display:flex;justify-content:space-between;align-items:center}.instant-apps-filter-list__item-container:not(:last-child),.instant-apps-filter-list__item-container--user-input:not(:last-child){padding-bottom:20px}.instant-apps-filter-list__item-container--user-input{margin:0;display:flex;flex-direction:column;align-items:flex-start}.instant-apps-filter-list__item-container--user-input>span{margin:0 0 6px;font-size:14px;font-weight:400}.instant-apps-filter-list__item-container--user-input calcite-combobox{width:100%;font-size:16px;--calcite-combobox-input-height: 24px}.instant-apps-filter-list__number-input-container{width:100%;display:flex;justify-content:center}.instant-apps-filter-list__number-input-container calcite-slider{width:90%}.instant-apps-filter-list__date-picker-input-container{display:flex;align-items:center;justify-content:unset;width:100%}.instant-apps-filter-list__date-picker-input-container calcite-action{height:65px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__time-picker-input-container{display:grid;grid-template-columns:auto 32px;width:100%}.instant-apps-filter-list__time-picker-input-container calcite-input-time-picker:first-child{grid-column:1;grid-row:1}.instant-apps-filter-list__time-picker-input-container calcite-input-time-picker:last-child{grid-column:1;grid-row:2}.instant-apps-filter-list__time-picker-input-container calcite-action{grid-column:2;grid-row:1/span 2;height:64px;width:33px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__title{margin-right:20px}.instant-apps-filter-list__title>p{font-size:14px;font-weight:400;margin:0}.instant-apps-filter-list__checkbox-container{display:flex}.instant-apps-filter-list__checkbox-container calcite-checkbox{height:18px}.instant-apps-filter-list__operator-description{margin:0;--calcite-font-size--1: 12px}.instant-apps-filter-list calcite-input-date-picker{--calcite-font-size--1: 16px}@media(prefers-reduced-motion){.instant-apps-filter-list calcite-loader{--calcite-internal-duration-factor: 2;--calcite-internal-animation-timing-slow: .6s }}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__header-container{background:#2b2b2b;color:#fff}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__operator-description{background:#353535}`,d={filterContainer:"instant-apps-filter-list__container",footer:"instant-apps-filter-list__footer",filterItemTitle:"instant-apps-filter-list__title",filterItemContainer:"instant-apps-filter-list__item-container",filterUIItemContainer:"instant-apps-filter-list__item-container--user-input",checkboxContainer:"instant-apps-filter-list__checkbox-container",numberInputContainer:"instant-apps-filter-list__number-input-container",dateInputContainer:"instant-apps-filter-list__date-picker-input-container",timeInputContainer:"instant-apps-filter-list__time-picker-input-container",operatorDesc:"instant-apps-filter-list__operator-description"},C=class extends k{constructor(){super(...arguments),this._messages=L({name:"instant-apps-filter-list",blocking:!0}),this.resetBtnEl=$(),this.panelEl=$(),this.isLayerExpUpdated=!1,this.isInitUpdateComplete=!1,this.baseClass=D,this.autoUpdateUrl=!1,this.closeBtn=!1,this.comboboxOverlayPositioning="absolute",this.openFilters=!1,this.extentSelector=!1,this.filterCount=0,this.zoomBtn=!0,this.resetBtn=!0,this.resetFiltersOnDisconnect=!0,this.filterListReset=b(),this.filterUpdate=b()}static{this.properties={loading:16,filterLayerExpressions:16,baseClass:16,initDefExpressions:16,initMapImageExpressions:16,initPointCloudFilters:16,layerExpressions:0,autoUpdateUrl:5,closeBtn:5,closeBtnOnClick:0,comboboxOverlayPositioning:1,closeBtnText:1,openFilters:5,extentSelector:5,extentSelectorConfig:0,urlParams:0,filterCount:9,view:0,zoomBtn:5,resetBtn:5,resetFiltersOnDisconnect:5}}static{this.styles=O}async forceReset(){return this.resetExpressions(),await Promise.resolve(!0)}async getCurrentLayerExpressions(){let e=structuredClone(this.filterLayerExpressions);return await Promise.resolve(e)}async getFilterInitState(){return await Promise.resolve({initDefExpressions:this.initDefExpressions,initMapImageExpressions:this.initMapImageExpressions,initPointCloudFilters:this.initPointCloudFilters})}async handleUpdatingT9nData(e){return e==null?await Promise.resolve(!0):(this.filterLayerExpressions?.forEach(t=>{let i=e?.find(s=>s.id===t.id);i!=null&&(t.title=i.title,t.expressions?.forEach(s=>{let n=i.expressions?.find(a=>a.id===s.id);n!=null&&(s.name=n.name)}))}),await Promise.resolve(!0))}async updateInitDefExpressions(e){return this.initDefExpressions=e.initDefExpressions,this.initMapImageExpressions=e.initMapImageExpressions,this.initPointCloudFilters=e.initPointCloudFilters,await Promise.resolve(!0)}connectedCallback(){super.connectedCallback(),!(this.layerExpressions==null&&this.view==null)&&(this.isLayerExpUpdated=!0,this.filterLayerExpressions=structuredClone(this.layerExpressions),this.isInitUpdateComplete=!1,this.handleLayerExpressionsUpdate())}async load(){this.baseClass=S(this.el)==="dark"?P:D,!this.isLayerExpUpdated&&(this.isLayerExpUpdated=!0,this.filterLayerExpressions=this.layerExpressions!=null?structuredClone(this.layerExpressions):[],this.view!=null&&this.handleLayerExpressionsUpdate())}willUpdate(e){e.has("view")&&this.handleWhenView(),e.has("layerExpressions")&&(this.isInitUpdateComplete=!1,this.resetAllFilters(),this.filterLayerExpressions=structuredClone(this.layerExpressions),this.handleLayerExpressionsUpdate())}updated(){this.resetBtnEl.value!=null&&(this.resetBtnEl.value.disabled=!(this.filterLayerExpressions&&this.filterLayerExpressions.length>0))}disconnectedCallback(){super.disconnectedCallback(),this.resetFiltersOnDisconnect&&(this.isLayerExpUpdated=!1,this.filterLayerExpressions=structuredClone(this.layerExpressions),this.resetAllFilters())}initFilterConfig(){if(this.filterLayerExpressions&&this.filterLayerExpressions.length>0){if(this.filterLayerExpressions.length===1){let{operator:e}=this.filterLayerExpressions[0],t=e?.trim()==="OR"?"orOperator":"andOperator",i=this.renderZoomTo(this.filterLayerExpressions[0]);return l`<calcite-block class=${p(d.operatorDesc)} .heading=${this._messages[t]} expanded>${i}${this.renderFilter(this.filterLayerExpressions[0])}</calcite-block>`}else if(this.filterLayerExpressions.length>1)return this.renderLayerBlock()}}handleResetDatePicker(e,t){let i=this.panelEl.value?.querySelector(`[id='${e.id}']`);i&&(_(i),e.active=!1,e.definitionExpression=void 0,e.range=void 0,this.generateOutput(t))}handleResetTimePicker(e,t){this.resetTimePicker(e),e.active=!1,e.definitionExpression=void 0,e.range=void 0,this.generateOutput(t)}resetTimePicker(e){let t=this.panelEl.value?.querySelector(`[id='${e.id}-min']`),i=this.panelEl.value?.querySelector(`[id='${e.id}-max']`);!t||!i||(t.value=e.min,i.value=e.max)}initInput(e,t){let{type:i,numDisplayOption:s,displayOption:n}=t;if(i==="string"||i==="coded-value"||(i==="number"||i==="range"||i==="date"||i==="time-only")&&(s==="drop-down"||n==="drop-down"))return this.renderCombobox(e,t);if(i==="number"||i==="range")return this.renderNumberSlider(e,t);if(i==="date")return this.renderDatePicker(e,t);if(i==="time-only")return this.renderTimePicker(e,t)}async initExpressions(){if(this.loading=!0,this.filterLayerExpressions==null||this.view==null){this.loading=!1;return}await this.processExpressions(),this.loading=!1}async processExpressions(){this.filterLayerExpressions&&await Promise.all(this.filterLayerExpressions.map(async e=>{await Promise.all((e.expressions||[]).map(async t=>await this.setInitExpression(e,t)))}))}handleResetFilter(){this.resetExpressions(),this.resetAllFilters(),this.generateURLParams(),this.filterListReset.emit()}resetExpressions(){this.filterLayerExpressions?.forEach(e=>{e.expressions?.forEach(t=>{let{type:i,numDisplayOption:s,displayOption:n}=t,a="";i==="string"||i==="coded-value"||(i==="number"||i==="range"||i==="date"||i==="time-only")&&(s==="drop-down"||n==="drop-down")?a="combobox":i==="date"?a="datePicker":i==="number"||i==="range"?a="numberRange":i==="time-only"&&(a="timePicker"),a?this.resetExpressionUI(a,t):this.resetCheckbox(t),t.active=!1})})}resetExpressionUI(e,t){let{id:i}=t;switch(e){case"combobox":{t.selectedFields=void 0;let s=this.panelEl.value?.querySelector(`[id='${i}']`);s&&Array.from(s.children).forEach(n=>{n.selected=!1});break}case"datePicker":{t.range=void 0;let s=this.panelEl.value?.querySelector(`[id='${i}']`);s&&_(s);break}case"numberRange":{t.range=void 0;let s=this.panelEl.value?.querySelector(`[id='${i}']`);s&&(s.minValue=t.min,s.maxValue=t.max);break}case"timePicker":t.range=void 0,this.resetTimePicker(t)}}resetCheckbox(e){let{id:t}=e,i=this.panelEl.value?.querySelector(`[id='${t}']`);i&&(i.checked=!1)}resetAllFilters(){this.view?.map?.allLayers?.concat(this.view?.map?.allTables.toArray()??[])?.forEach(e=>{if(!g.includes(e.type))return;let t=e;if(t.type==="point-cloud"){if(!this.initPointCloudFilters)return;t.filters=this.initPointCloudFilters[t.id]}else if(t.type==="map-image")t.allSublayers.forEach(i=>{i.definitionExpression=this.initMapImageExpressions?.[t.id]?.[i.id]??""});else{if(this.initDefExpressions==null)return;t.definitionExpression=this.initDefExpressions[t.id]}})}async updateStringExpression(e,t){let i=this.findFilterLayer(e);return i?(await this.getFeatureAttributes(i,t),this.handleDateField(i,t),t?.selectedFields?(t.definitionExpression=this.createDefinitionExpression(t),!0):!1):!1}handleDateField(e,t){t.type==="date"&&e.fields.find(({name:i})=>i===t.field)?.type==="date-only"&&(t.dateOnly=!0)}createDefinitionExpression(e){if(!e.selectedFields?.length)return"";let t=e.selectedFields.map(i=>typeof i=="number"?i:`'${w(i)}'`);return`${e.field} IN (${t.join(",")})`}async updateNumberExpression(e,t){if(!t?.min&&t?.min!==0||!t?.max&&t?.max!==0){let i=this.findFilterLayer(e);if(!i)return!1;let{field:s}=t;if(s!=null)if(this.setExpressionFormat(i,t,s),t?.numDisplayOption==="drop-down"||t?.displayOption==="drop-down")await this.getFeatureAttributes(i,t);else{let n=(await this.calculateMinMaxStatistics(i,s))?.[0]?.attributes;if(t.format?.places!=null?(t.min=this.roundMinNumberDown(n[`min${s}`],t.format.places),t.max=this.roundMaxNumberUp(n[`max${s}`],t.format.places)):(t.min=n[`min${s}`],t.max=n[`max${s}`]),t?.range&&Object.keys(t.range).length){let{min:a,max:r}=t.range;return t.definitionExpression=`${t.field} BETWEEN ${a} AND ${r}`,!0}}}return!1}async updateDateExpression(e,t){let{field:i,range:s}=t,n=this.findFilterLayer(e);if(!n)return!1;let a=(await this.calculateMinMaxStatistics(n,i))?.[0]?.attributes;if(t.min=y(a[`min${i}`]),t.max=y(a[`max${i}`]),s!=null&&(s?.max!=null||s?.min!=null)){let{min:r,max:o}=s;if(r=r?.replace("+"," "),o=o?.replace("+"," "),r||o){let c=o&&!r?"<":!o&&r?">":null;return c?t.definitionExpression=`${i} ${c} '${r??o}'`:t.definitionExpression=`${i} BETWEEN '${r}' AND '${o}'`,!0}}return!1}async updateTimeExpression(e,t){let{field:i,range:s}=t,n=this.findFilterLayer(e);if(!n)return!1;let a=(await this.calculateMinMaxStatistics(n,i))?.[0]?.attributes;if(t.min=a[`min${i}`],t.max=a[`max${i}`],s!=null&&(s?.max!=null||s?.min!=null)){let{min:r,max:o}=s;if(r||o){let c=o&&!r?"<":!o&&r?">":null;return c?t.definitionExpression=`${i} ${c} TIME '${r??o}'`:t.definitionExpression=`${i} BETWEEN TIME '${r}' AND TIME '${o}'`,!0}}return!1}async updateCodedValueExpression(e,t,i){if(!i?.domain||i?.domain?.type!=="coded-value")return!1;let s=this.findFilterLayer(e);if(!s)return!1;await this.getFeatureAttributes(s,t);let n=i.domain.codedValues.reduce((a,{code:r,name:o})=>(a[r]=o,a),{});if(t.codedValues=n,this.sortCodedValues(t),t.selectedFields?.length){let a=t.selectedFields.map(r=>typeof r=="number"?r:`'${w(r)}'`).join(",");return t.definitionExpression=`${t.field} IN (${a})`,!0}return!1}updateRangeExpression(e,t){if(!t?.domain||t?.domain?.type!=="range")return!1;let{field:i,range:s}=e;return e.min=t.domain.minValue,e.max=t.domain.maxValue,s&&Object.keys(s).length?(e.definitionExpression=`${i} BETWEEN ${s.min} AND ${s.max}`,!0):!1}async getFeatureAttributes(e,t){if(!this.isLayerSupported(e)){t.fields=[];return}let i=await this.getQueryLayer(e),{maxRecordCount:s,supportsMaxRecordCountFactor:n}=this.extractQueryCapabilities(e),a=await i.queryFeatureCount(),r=this.createQuery(i,t);await this.queryDistinctFeatures(i,r,t),this.shouldPaginate(s,a,n)&&this.handlePagination(i,r,s,n,a,t)}isLayerSupported(e){return e&&g.includes(e.type)}extractQueryCapabilities(e){return{maxRecordCount:e.capabilities?.query?.maxRecordCount??e.sourceJSON?.maxRecordCount,supportsMaxRecordCountFactor:e.capabilities?.query?.supportsMaxRecordCountFactor}}createQuery(e,t){let i=e.createQuery();this.applyCacheHint(e,i);let s=t?.field;if(s){let n=this.getInitDefExprFromLayer(e);i.where=n||"1=1",i.outFields=[s],i.orderByFields=[`${s} ASC`],i.returnDistinctValues=!0,i.returnGeometry=!1,i.maxRecordCountFactor=5,this.applyQueryGeometryFromExtentSelector(i)}return i}async queryDistinctFeatures(e,t,i){if(!t.outFields)return;let s=await this.queryForFeatures(e,t,t.outFields[0]);s?.length&&(i.fields=[...new Set(s)],i.type==="string"?i.fields=i.fields.sort((n,a)=>n.localeCompare(a)):i.type==="number"&&(i.fields=i.fields.sort((n,a)=>n-a)))}getQueryCount(e,t){return t?e*5:e}shouldPaginate(e,t,i){let s=this.getQueryCount(e,i);return e!=null&&t>s}async handlePagination(e,t,i,s,n,a){let r=this.getQueryCount(i,s),o=[];for(let c=r;c<n;c+=r){let u=t.clone();u.num=i,u.start=c,o.push(this.queryForFeatures(e,u,t?.outFields?.[0]??""))}Promise.all(o).then(c=>{c.forEach(u=>{u?.length&&a.fields&&a.fields.push(...u)}),a.type==="string"?a.fields=[...new Set(a.fields)].sort((u,E)=>u.localeCompare(E)):a.type==="number"?a.fields=[...new Set(a.fields)].sort((u,E)=>u-E):a.type==="coded-value"&&a.codedValues?this.sortCodedValues(a):a.fields=[...new Set(a.fields)].sort()})}async queryForFeatures(e,t,i){return(await e.queryFeatures(t))?.features.filter(s=>{let n=s.attributes?.[i];return n!=null&&n!==""})?.map(s=>s.attributes?.[i])}async calculateMinMaxStatistics(e,t){if(!e||!g.includes(e.type)||!t)return[];let i=this.createStatisticsQuery(e,t);return(await e.queryFeatures(i))?.features||[]}createStatisticsQuery(e,t){let i=e.createQuery();return i.where=this.getInitDefExprFromLayer(e)||"1=1",this.applyCacheHint(e,i),i.outStatistics=[{onStatisticField:t,outStatisticFieldName:`max${t}`,statisticType:"max"},{onStatisticField:t,outStatisticFieldName:`min${t}`,statisticType:"min"}],this.applyQueryGeometryFromExtentSelector(i),i}getExtent(e,t){if(e&&t){let{constraints:i}=t,s={...i}.geometry;if(s){let n="extent"in s?s:T.fromJSON(s);if(n?.type==="extent"||n?.type==="polygon")return n}}}async setInitExpression(e,t){if(!t.field||!t.type){await this.updateExpression(e,t,void 0);return}let i=this.findFilterLayer(e);i&&((i.loadStatus==="not-loaded"||i.loadStatus==="failed")&&await i.load(),await i.when(async()=>{let s=i.fields?.find(({name:a})=>a===t.field),n=s?.domain?.type;t.type=n==="coded-value"||n==="range"?n:t.type,await this.updateExpression(e,t,s)}))}async updateExpression(e,t,i){let s=await this.handleExpressionType(e,t,i);this.requestUpdate(),s&&this.generateOutput(e)}async handleExpressionType(e,t,i){switch(t.type){case"string":return await this.updateStringExpression(e,t);case"number":return await this.updateNumberExpression(e,t);case"date":return await this.updateDateExpressionBasedOnDisplayOption(e,t);case"time-only":return await this.updateTimeExpressionBasedOnDisplayOption(e,t);case"coded-value":return await this.updateCodedValueExpression(e,t,i);case"range":return await this.updateRangeExpressionBasedOnDisplayOption(e,t,i);case"checkbox":case null:case void 0:return t.active??!1;default:return!1}}async updateDateExpressionBasedOnDisplayOption(e,t){return t.displayOption==="drop-down"?await this.updateStringExpression(e,t):await this.updateDateExpression(e,t)}async updateTimeExpressionBasedOnDisplayOption(e,t){return t.displayOption==="drop-down"?await this.updateStringExpression(e,t):await this.updateTimeExpression(e,t)}async updateRangeExpressionBasedOnDisplayOption(e,t,i){return t.displayOption==="drop-down"?await this.updateStringExpression(e,t):this.updateRangeExpression(t,i)}updateRangeExpressions(e,t,i,s){let n=this.getInitDefExprFromLayerExpression(t);(s||s===0)&&(i||i===0)&&(s===e?.min&&i===e?.max?(e.definitionExpression=void 0,e.active=!1):(e.definitionExpression=n?`(${n}) AND ${e?.field} BETWEEN ${s} AND ${i}`:`${e?.field} BETWEEN ${s} AND ${i}`,e.active=!0)),e.range={min:s,max:i}}handleCheckboxChange(e,t,i){let s=i.target;t.active=s.checked,this.generateOutput(e)}handleSliderChange(e,t,i){let{maxValue:s,minValue:n}=i.target;this.updateRangeExpressions(e,t,s,n),this.generateOutput(t)}handleComboSelect(e,t,i){let s=i.target.selectedItems,{field:n,type:a}=e;if(e.selectedFields=s.map(({value:r})=>r),s.length){let r=s.map(({value:o})=>typeof o=="number"?o:`'${w(o)}'`);e.definitionExpression=a==="date"?r.map(o=>this.buildDateExpression(o,n)).join(" OR "):a==="time-only"?`${n} IN (${r.map(o=>`TIME ${o}`).join(",")})`:`${n} IN (${r.join(",")})`,e.active=!0}else e.definitionExpression=void 0,e.active=!1;this.generateOutput(t)}handleDatePickerRangeChange(e,t,i){let s=i.target,[n,a]=s.valueAsDate,r=n?y(Math.floor(n.getTime()),!0):void 0,o=a?y(Math.floor(a.getTime()),!0):void 0;(r||o)&&(e.definitionExpression=this.constructDefinitionExpression(e.field,r,o),e.range={min:r,max:o},e.active=!0,this.generateOutput(t))}handleTimePickerRangeChange(e,t,i,s){let n=s.target,a=n.value;e.range==null&&(e.range={min:void 0,max:void 0}),i?e.max&&a>e.max?(e.range.min=e.max,n.value=e.range.min):e.min&&a<e.min?(e.range.min=e.min,n.value=e.range.min):e.range.min=a:e.max&&a>e.max?(e.range.max=e.max,n.value=e.range.max):e.min&&a<e.min?(e.range.max=e.min,n.value=e.range.max):e.range.max=a,(e.range.min||e.range.max)&&(e.definitionExpression=this.constructTimeDefinitionExpression(e.field,e.range.min,e.range.max),e.active=!0,this.generateOutput(t))}constructDefinitionExpression(e,t,i){return t?i?`${e} BETWEEN '${t}' AND '${i}'`:`${e} > '${t}'`:`${e} < '${i}'`}constructTimeDefinitionExpression(e,t,i){return t?i?`${e} BETWEEN TIME '${t}' AND TIME '${i}'`:`${e} > TIME '${t}'`:`${e} < TIME '${i}'`}handleURLParams(){if(!("URLSearchParams"in window))return;let e=new URLSearchParams(document.location.search).get("filter");if(!e){this.filterCount=0;return}let t=e.split(";").map(i=>JSON.parse(i));this.filterCount=this.applyFilters(t)}applyFilters(e){let t=0;return e.forEach(i=>{let s=this.filterLayerExpressions?.find(n=>n.id===i.layerId);s&&s.expressions?.forEach(n=>{n.id?.toString()===i.expressionId?.toString()&&(this.activateExpression(n,i),t++)})}),t}activateExpression(e,t){e.active=!0,t.type==="range"?e.range=t.range:t.type==="select"&&(e.selectedFields=t.selectedFields)}createURLParamExpression(e,t){let{id:i,range:s,selectedFields:n,type:a}=t;return a==="string"||a==="coded-value"||t?.numDisplayOption==="drop-down"||t?.displayOption==="drop-down"?{type:"select",layerId:e.id,expressionId:i.toString(),selectedFields:n}:a==="number"||a==="range"||a==="date"||a==="time-only"?{type:"range",layerId:e.id,expressionId:i.toString(),range:s}:{layerId:e.id,expressionId:i.toString()}}autoUpdateURLCheck(e){if(this.autoUpdateUrl){let t=e.toString()?`${window.location.pathname}?${e}`.trim():window.location.pathname;window.history.replaceState({},"",t)}}generateURLParams(){if(!("URLSearchParams"in window))return;let e=new URLSearchParams(window.location.search),t=this.filterLayerExpressions?.flatMap(i=>i?.expressions?.filter(s=>s.active).map(s=>JSON.stringify(this.createURLParamExpression(i,s)))||[])||[];this.filterCount=t.length,t.length>0?e.set("filter",t.join(";")):e.delete("filter"),this.autoUpdateURLCheck(e),this.urlParams=e}updateFilter(e,t,i){let{id:s}=e,n=this.view.map?.findLayerById(s)??this.view.map?.findTableById(s);if(n!=null)if(n.type==="point-cloud")this.updateFilterLayerPCLFilter(n,i);else if(n.type==="map-image"){let a=n.findSublayerById(e?.sublayerId);a!=null&&this.updateFilterLayerDefExpression(a,t,e)}else this.updateFilterLayerDefExpression(n,t,e)}updateFilterLayerDefExpression(e,t,i){let{operator:s}=i,n=this.getInitDefExprFromLayer(e),a=t?.length>0&&n!=null&&n!==""?`(${t.join(s)}) AND (${n})`:t.length>0?t.join(s):n;e.definitionExpression=a}updateFilterLayerPCLFilter(e,t){e.filters=t}async handleWhenView(){this.view!=null&&(await this.view.map.loadAll(),await this.handleLayerExpressionsUpdate())}async handleLayerExpressionsUpdate(){this.isInitUpdateComplete||(this.updateInitExpressions(),this.handleURLParams(),this.initExpressions())}async handleZoomTo(e){let t=e?.sublayerId?`#zoom-to-${e.id}-${e.sublayerId}`:`#zoom-to-${e.id}`,i=this.panelEl.value?.querySelector(t),s=(n,a)=>{i&&(i.loading=n,i.disabled=a)};if(s(!0,!0),await this.getZoomToExtent(e),this.zoomToExtent){let n=this.zoomToExtent.type==="point"&&this.zoomToExtent.count===1?{target:this.zoomToExtent.extent,zoom:10}:this.zoomToExtent.extent;await this.view.goTo(n)}s(!1,!1)}async getZoomToExtent(e){let t=this.view.allLayerViews.find(({layer:s})=>s.id===e.id).layer,i=t.type==="map-image"?t.findSublayerById(e.sublayerId):t;if(i&&i.type!=="point-cloud"&&g.includes(i?.type)){let s=await this.getQueryLayer(i),n=s.createQuery();n.where=s.definitionExpression??"1=1";let a=await s.queryExtent(n);this.zoomToExtent={...a,type:s.geometryType}}}generateOutput(e){if(this.view==null)return;let t=[],i=[];if(e){for(let s of e.expressions){let{active:n,definitionExpression:a,pointCloudFilters:r}=s;n&&a&&t.push(`(${a})`),n&&r!=null&&r.length>0&&(i=i.concat(r))}this.updateFilter(e,t,i),this.generateURLParams(),this.filterUpdate.emit()}}numberWithCommas(e){return e.toLocaleString("en-US",{maximumFractionDigits:20})}scientificRounding(e,t,i){if(e==null)return;let s;if(!String(e).includes("e"))s=Math[i](e*Math.pow(10,t))/Math.pow(10,t);else{let[n,a]=String(e).split("e").map(o=>Number(o)),r=a+t;s=Math[i](+`${n}e${r}`)*Math.pow(10,-t)}return+s.toFixed(t)}roundMinNumberDown(e,t){return this.scientificRounding(e,t,"floor")}roundMaxNumberUp(e,t){return this.scientificRounding(e,t,"ceil")}roundNumber(e,t){return this.scientificRounding(e,t,"round")??e}setExpressionFormat(e,t,i){if(e?.popupTemplate!=null){let s=e?.popupTemplate.fieldInfos?.find(({fieldName:n})=>n===i);s?.format&&(t.format=s.format)}}getInitDefExprFromLayer(e){return e.type==="sublayer"?this.initMapImageExpressions?.[e?.layer?.id??""]?.[e.id]??"":this.initDefExpressions?.[e.id]??""}getInitDefExprFromLayerExpression(e){return e?.sublayerId!=null?this.initMapImageExpressions?.[e.id]?.[e.sublayerId]??"":this.initDefExpressions?.[e.id]??""}findFilterLayer(e){let t=this.view.map?.allLayers.concat(this.view.map?.allTables.toArray()??[])?.find(({id:i})=>i===e.id);return t?.type==="map-image"?t?.findSublayerById(e.sublayerId):t}createLabel(e,t){if(e.type==="coded-value")return e?.codedValues?.[t]??t;if(e.type==="number"&&typeof t=="number"){let i=t;return e.format?.places!=null&&(i=this.roundNumber(t,e.format.places)),e.format?.digitSeparator?this.numberWithCommas(i):i}if(e.type==="date"&&!e.dateOnly){let i=m.convertDateFormatToIntlOptions("short-date-long-time");return m.formatDate(t,i)}if(e.type==="time-only"){let i=m.convertDateFormatToIntlOptions("long-time");return m.formatTimeOnly(t,i)}return t}buildDateExpression(e,t){if(e){let i=new Date(e),s=new Date(e),n=new Date(s.setDate(i.getDate()+1)),a=`${i.getFullYear()}-${i.getMonth()+1}-${i.getDate()}`,r=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}`,o=`${n.getHours()}:${n.getMinutes()}:${n.getSeconds()}`,c=`${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()}`;return`${t} BETWEEN '${a} ${r}' AND '${c} ${o}'`}}async getQueryLayer(e){let t=e.type==="sublayer"?await e.createFeatureLayer():e;if(!t)throw new Error("Failed to create feature layer");return t}applyCacheHint(e,t){e?.capabilities?.query?.supportsCacheHint&&(t.cacheHint=!0)}applyQueryGeometryFromExtentSelector(e){if(!this.extentSelector||!this.extentSelectorConfig)return;let t=this.getExtent(this.extentSelector,this.extentSelectorConfig);t&&(e.geometry=t,e.spatialRelationship="intersects")}updateInitExpressions(){if(!this.view?.map)return;let e=this.view.map;this.initDefExpressions={},this.initPointCloudFilters={},this.initMapImageExpressions={},e.allLayers.concat(e.allTables.toArray()??[]).forEach(t=>{if(!g.includes(t.type))return;let i=t;if(i.type==="point-cloud")this.initPointCloudFilters||(this.initPointCloudFilters={}),this.initPointCloudFilters[i.id]=i.filters;else if(i.type==="map-image")this.initMapImageExpressions||(this.initMapImageExpressions={}),this.initMapImageExpressions[i.id]=i.allSublayers.reduce((s,n)=>(s[n.id]=n.definitionExpression??"",s),{});else{if(!this.initDefExpressions)return;this.initDefExpressions[i.id]=i.definitionExpression??""}}),this.isInitUpdateComplete=!0}sortCodedValues(e){typeof e.fields?.[0]=="number"?e.fields=[...new Set(e.fields)].sort((t,i)=>{let s=e.codedValues?.[t],n=e.codedValues?.[i];return(s??t)-(n??i)}):e.fields=[...new Set(e.fields)].sort((t,i)=>{let s=e.codedValues?.[t],n=e.codedValues?.[i],a=s??t,r=n??i;return a.localeCompare(r)})}render(){let e=this.loading?this.renderLoading():this.initFilterConfig(),t=this.renderFooter();return l`<calcite-panel class=${p(this.baseClass)} ${v(this.panelEl)}><slot slot=header-content name=filter-header-content></slot><slot slot=header-actions-end name=filter-header-actions-end></slot>${x("filter-container",l`<div class=${p(d.filterContainer)}>${e}${t}</div>`)}</calcite-panel>`}renderLoading(){return l`<calcite-loader label="Loading filters..."></calcite-loader>`}renderFilter(e){let{id:t}=e;return e.expressions.map((i,s)=>i.type==="checkbox"||i.type==null?x(`${t}-${s}`,l`<div class=${p(d.filterItemContainer)}><div class=${p(d.filterItemTitle)}><p>${i.name}</p></div><div class=${p(d.checkboxContainer)}><calcite-checkbox id=${i.id.toString()??h} scale=l .checked=${i?.active} @calciteCheckboxChange=${this.handleCheckboxChange.bind(this,e,i)}></calcite-checkbox></div></div>`):this.initInput(e,i))}renderLayerBlock(){return this.filterLayerExpressions?.map(e=>this.renderFilterBlocks(e))}renderFilterBlocks(e){let t=this.renderFilter(e),{operator:i}=e,s=i?.trim()==="OR"?"orOperator":"andOperator",n=this.renderZoomTo(e);return x(e.id,l`<calcite-block .heading=${e.title} .description=${this._messages[s]} .expanded=${this.openFilters?!0:void 0} collapsible>${n}${t}</calcite-block>`)}renderCombobox(e,t){return x("combo-select",l`<label class=${p(d.filterUIItemContainer)}><span>${t.name}</span><calcite-combobox id=${t.id.toString()??h} @calciteComboboxChange=${this.handleComboSelect.bind(this,t,e)} .label=${t.name} .placeholder=${t.placeholder} selection-mode=multiple max-items=6 scale=s .overlayPositioning=${this.comboboxOverlayPositioning}>${t.fields?.map((i,s)=>this.renderComboboxItem(t,i,s))}</calcite-combobox></label>`)}renderComboboxItem(e,t,i){let s=this.createLabel(e,t),n=e?.selectedFields?.includes(t)??!1;return x(`${s}-${i}`,l`<calcite-combobox-item .value=${t} .heading=${`${s}`} .selected=${n}></calcite-combobox-item>`)}renderNumberSlider(e,t){let i=t?.min,s=t?.max,n=t?.step?t.step:1,a=i!=null&&s!=null,r=t?.field??"",o=t?.range?.min!=null?t.range.min:i,c=t?.range?.max!=null?t.range.max:s,u=[o,c];return a?x(t?.id.toString(),l`<label class=${p(d.filterUIItemContainer)}><span>${t?.name}</span><div class=${p(d.numberInputContainer)}><calcite-slider id=${t?.id.toString()??h} @calciteSliderChange=${this.handleSliderChange.bind(this,t,e)} .min=${i} .max=${s} .minValue=${i} .maxValue=${s} .minLabel=${this._messages.minSlider?.replace("{field}",r)} .maxLabel=${this._messages.maxSlider?.replace("{field}",r)} .step=${n} label-handles snap .value=${u} .groupSeparator=${t?.format?.digitSeparator} precise></calcite-slider></div></label>`):void 0}renderDatePicker(e,t){let{min:i,max:s}=t,n=[t?.range?.min,t?.range?.max];return i!=null&&s!=null?l`<label class=${p(d.filterUIItemContainer)}><span>${t?.name}</span><div class=${p(d.dateInputContainer)}><calcite-input-date-picker id=${t?.id.toString()??h} @calciteInputDatePickerChange=${this.handleDatePickerRangeChange.bind(this,t,e)} .min=${i} .max=${s} calendars=1 overlay-positioning=fixed lang=${m.getLocale()??"en"??h} layout=vertical .value=${n} range></calcite-input-date-picker><calcite-action @click=${this.handleResetDatePicker.bind(this,t,e)} icon=reset .text=${this._messages.resetDatePicker} title=${this._messages.resetDatePicker??h} scale=s></calcite-action></div></label>`:void 0}renderTimePicker(e,t){let{min:i,max:s,range:n}=t,a=i!=null&&s!=null,r=n?.min!=null?n.min:i,o=n?.max!=null?n.max:s;return a?l`<label class=${p(d.filterUIItemContainer)}><span>${t?.name}</span><div class=${p(d.timeInputContainer)}><calcite-input-time-picker .id=${`${t?.id.toString()}-min`} .value=${r} overlay-positioning=fixed lang=${m.getLocale()??"en"??h} @calciteInputTimePickerChange=${this.handleTimePickerRangeChange.bind(this,t,e,!0)}></calcite-input-time-picker><calcite-input-time-picker .id=${`${t?.id.toString()}-max`} .value=${o} overlay-positioning=fixed lang=${m.getLocale()??"en"??h} @calciteInputTimePickerChange=${this.handleTimePickerRangeChange.bind(this,t,e,!1)}></calcite-input-time-picker><calcite-action @click=${this.handleResetTimePicker.bind(this,t,e)} icon=reset .text=${this._messages.resetTimePicker} title=${this._messages.resetTimePicker??h} scale=s></calcite-action></div></label>`:void 0}renderFooter(){let e=this.closeBtnText??this._messages.close,t=this.closeBtn&&this.resetBtn?"half":"full";return l`<div class=${p(d.footer)} slot=footer>${this.resetBtn?l`<calcite-button appearance=outline .width=${t} @click=${this.handleResetFilter} ${v(this.resetBtnEl)}>${this._messages.resetFilter}</calcite-button>`:void 0}${this.closeBtn?l`<calcite-button appearance=solid .width=${t} kind=brand @click=${this.closeBtnOnClick}>${e}</calcite-button>`:void 0}</div>`}renderZoomTo(e){let t=e?.sublayerId?`zoom-to-${e.id}-${e.sublayerId}`:`zoom-to-${e.id}`;return this.zoomBtn?l`<calcite-action id=${t??h} slot=actions-end appearance=transparent .text=${this._messages.zoomTo} title=${this._messages.zoomTo??h} scale=s icon=magnifying-glass-plus @click=${this.handleZoomTo.bind(this,e)}></calcite-action>`:void 0}};I("instant-apps-filter-list",C);return C},"geometry/support/jsonUtils","intl")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./RTSKNY33.js";import{b as h}from"./PZ4L77M5.js";import"./JE7L7M3J.js";import{a as S}from"./LFIJXE3U.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as m}from"./VU3OQQKP.js";import{H as u,L as c,h as g,i as a,r as n}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{L:p,a:y,b:_,t:l}])=>{var w=g`.toolbar-sizing{display:flex;align-items:center;padding-right:0;padding-left:0;margin-left:auto;margin-right:auto;box-sizing:border-box;height:65px}.flex-row{display:flex;flex-direction:row}.flex-grow-1{flex-grow:1}calcite-input-text{--calcite-color-focus: transparent;--calcite-input-text-border-color: transparent;--calcite-color-border-input: transparent;--calcite-color-brand: transparent;display:grid;block-size:65px;box-sizing:border-box;border-bottom:2px solid transparent}@media(prefers-color-scheme:dark){calcite-input-text:focus{border-bottom:2px solid #009AF2}}@media(prefers-color-scheme:light){calcite-input-text:focus{border-bottom:2px solid #007AC2}}.padding-end-1-2{padding-inline-end:.5rem}`,d=class extends u{constructor(){super(),this.defaultSortType="relevance",this.isOrgSolutions=!1,this._activeSearchSortSettings=[{scope:"all-solutions",settings:{enabled:!0,isOrgSolutions:!1,searchTerm:"",sortType:"relevance"}},{scope:"deployments",settings:{enabled:!0,isOrgSolutions:!1,searchTerm:"",sortType:"created"}}],this._isMobile=!1,this._canViewOrg=!1,this._translations=S({name:"solutions-searchsort-toolbar",blocking:!0}),this._configContextConsumer=h({context:_,subscribe:!0,callback:async t=>{t&&t.authentication&&(this._canViewOrg=t.authentication.CanViewOrg)}}),this._isMobileContextConsumer=h({context:y,subscribe:!0,callback:t=>this._isMobile=t}),this.searchChanged=n(),this.sortTypeChanged=n(),this.toggleFilter=n(),this.updateUrlParams=n(),this.listenOn(window,"detailsCardSelected",()=>{this.scope=void 0}),this.listenOn(window,"deployedCardSelected",()=>{this.scope=void 0}),this.listenOn(window,"searchTermSet",t=>{let e=t.detail;this.scope=e.scope,this.changeSearchFilter(e.searchTerm,!1)}),this.listenOn(window,"sortTypeSet",t=>{let e=t.detail;this.scope=e.scope,this.sortChanged(e.sortType,!1)}),this.listenOn(window,"tabChanged",t=>{this.scope=t.detail;let e=this._getCurrentScopeSetting();(this.scope==="all-solutions"||this.scope==="deployments")&&(this.changeSearchFilter(e?.searchTerm||"",!1),this.sortChanged(e?.sortType||this.defaultSortType,!1),this._updateUrlParams(t))})}static{this.properties={defaultSortType:[0,{type:String,attribute:"default-sort-type"}],isOrgSolutions:5,scope:1,_activeSearchSortSettings:16,_isMobile:16,_canViewOrg:16,_translations:16}}static{this.styles=w}changeOwnerFilter(t){this.isOrgSolutions=!t,this._activeSearchSortSettings=this._activeSearchSortSettings.map(s=>s.scope===this.scope?{...s,settings:{...s.settings,isOrgSolutions:this.isOrgSolutions}}:s);let e={displayValue:this.isOrgSolutions?p.ORG:p.MINE,type:"owner",value:this.isOrgSolutions?"My organization's solutions":"My solutions"};this.searchChanged.emit({option:e,scope:this.scope})}changeSearchFilter(t,e,s){let i=this._activeSearchSortSettings.map(o=>o.scope===this.scope?{...o,settings:{...o.settings,searchTerm:t}}:o),r=JSON.stringify(this._activeSearchSortSettings)!==JSON.stringify(i);this._activeSearchSortSettings=i,e&&r&&this.searchChanged.emit({option:{searchTerm:t},scope:this.scope}),s&&(this._searchTelemetryTimer&&window.clearTimeout(this._searchTelemetryTimer),this._searchTelemetryTimer=window.setTimeout(()=>{this.searchChanged.emit({option:{searchTerm:t},scope:this.scope,logSearchTelemetry:!0})},1e3))}sortChanged(t,e){this._activeSearchSortSettings=this._activeSearchSortSettings.map(s=>s.scope===this.scope?{...s,settings:{...s.settings,sortType:t}}:s),e&&this.sortTypeChanged.emit({sortType:t,scope:this.scope})}async load(){this._isMobileContextConsumer.value&&(this._isMobile=this._isMobileContextConsumer.value)}render(){let t=this.scope==="all-solutions"||this.scope==="deployments"&&this._configContextConsumer.value?.authentication?.IsSignedIn,e=t?this._getCurrentScopeSetting():void 0,s=this.scope==="deployments"?this._translations.search.deployments:this._translations.search.solutions,i=this._isMobile?"padding-end-1-2":"";return t?a`<div class="flex-row toolbar-sizing"><calcite-input-text class="flex-grow-1" clearable icon=search @calciteInputTextChange=${r=>{let o=r.target;this.changeSearchFilter(o.value,!0,!1)}} @keyup=${r=>{let o=r.target;["Tab","Shift","Alt","Control","Meta","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Escape"].includes(r.key)||(r.key==="Enter"?this.changeSearchFilter(o.value,!0,!1):(o.value.length>=3||o.value.length===0)&&this.changeSearchFilter(o.value,o.value.length>=3||o.value.length===0,!0))}} .placeholder=${s} scale=l slot=content-top .value=${e?.searchTerm}></calcite-input-text>${this._isMobile&&this.scope==="all-solutions"?a`<calcite-button appearance=transparent class=${`focus-color ${i}`} icon-start=filter kind=neutral .label=${this._translations.showFilters} @click=${this._toggleFilter}></calcite-button>`:""}${this.scope==="deployments"&&this._canViewOrg&&this._renderOwnerBlock()||""}${this._renderDropdown()}</div>`:""}_renderOwnerBlock(){return a`<calcite-dropdown width=m overlay-positioning=fixed><calcite-button appearance=transparent class="header-button-padding" .iconStart=${this.isOrgSolutions?"organization":"user"} kind=neutral slot=trigger>${this._isMobile?"":this.isOrgSolutions?this._translations.myOrgSolutions:this._translations.mySolutions}</calcite-button><calcite-dropdown-group group-title=${this._translations.filterBy??c}><calcite-dropdown-item icon-start=user @click=${t=>{t.detail!==0&&this.changeOwnerFilter(!0)}} @keydown=${t=>l(t,()=>this.changeOwnerFilter(!0))} .selected=${!this.isOrgSolutions}>${this._translations.mySolutions}</calcite-dropdown-item><calcite-dropdown-item icon-start=organization @click=${t=>{t.detail!==0&&this.changeOwnerFilter(!1)}} @keydown=${t=>l(t,()=>this.changeOwnerFilter(!1))} .selected=${this.isOrgSolutions}>${this._translations.myOrgSolutions}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown>`}_renderDropdown(){let t=[];t=[{displayValue:this._translations.sortByRelevance,sortType:"relevance"},{displayValue:this._translations.sortByTitle,sortType:"title"}],this.scope==="deployments"?t.push({displayValue:this._translations.sortByDateDeployed,sortType:"created"}):(t.push({displayValue:this._translations.sortByNew,sortType:"new"}),t.push({displayValue:this._translations.sortByUpdated,sortType:"updated"}),this._configContextConsumer.value?.authentication?.IsSignedIn&&t.push({displayValue:this._translations.sortBySuggestedForYou,sortType:"suggested"}));let e=this._getCurrentScopeSetting();return a`<calcite-dropdown width=m><calcite-button appearance=transparent class="header-button-padding" icon-start=sort-descending kind=neutral slot=trigger>${this._isMobile?"":e?.sortType?this._getString(e.sortType):""}</calcite-button><calcite-dropdown-group group-title=${this._translations.chooseSortType??c}>${t.map(s=>this._getDropdownItem(s.displayValue,s.sortType))}</calcite-dropdown-group></calcite-dropdown>`}_getDropdownItem(t,e){let s=this._getCurrentScopeSetting();return s?.sortType&&s.sortType!==e?a`<calcite-dropdown-item @click=${i=>{i.detail!==0&&this.sortChanged(e,!0)}} @keydown=${i=>l(i,()=>this.sortChanged(e,!0))}>${t}</calcite-dropdown-item>`:a`<calcite-dropdown-item @click=${i=>{i.detail!==0&&this.sortChanged(e,!0)}} @keydown=${i=>l(i,()=>this.sortChanged(e,!0))} selected>${t}</calcite-dropdown-item>`}_getString(t){let e="";switch(t){case"new":e=this._translations.sortByNew;break;case"relevance":e=this._translations.sortByRelevance;break;case"suggested":e=this._translations.sortBySuggestedForYou;break;case"title":e=this._translations.sortByTitle;break;case"updated":e=this._translations.sortByUpdated;break;case"created":e=this._translations.sortByDateDeployed;break}return e}_getCurrentScopeSetting(){return this._activeSearchSortSettings?.filter(t=>t.scope===this.scope)?.[0]?.settings}_toggleFilter(){this.toggleFilter.emit()}_updateUrlParams(t){let e=t.detail,s;this._activeSearchSortSettings.some(i=>i.scope===e?(s=i,!0):!1),s&&this.updateUrlParams.emit(s)}};m("solutions-searchsort-toolbar",d);return d},b)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as y}from"./4T7P5RXF.js";import{a as E}from"./24S5LVU5.js";import{a as $}from"./
|
|
2
|
+
import{a as y}from"./4T7P5RXF.js";import{a as E}from"./24S5LVU5.js";import{a as $}from"./TPRPYUVX.js";import{b as f}from"./3LEJ44U2.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{F as h,G as u,H as m,J as p,h as b,i as o,l as _,r as w}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([c,S,L])=>{var C=`
|
|
3
3
|
@media print {
|
|
4
4
|
@page {
|
|
5
5
|
size: Portrait;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{c as r}from"./
|
|
2
|
+
import{c as r}from"./3LEJ44U2.js";import{b as o}from"./36I27Q5R.js";var s=o(r);export{s as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./RTSKNY33.js";import{b as r}from"./PZ4L77M5.js";import{a as b}from"./LFIJXE3U.js";import{b as g}from"./VU3OQQKP.js";import{F as o,G as s,H as p,K as u,h as d,i,j as h,r as l}from"./46DQNAMV.js";export default $arcgis.t(([{a:v,b:f,t:m}])=>{var x=d`calcite-shell-panel{z-index:var(--calcite-z-index-1)}.display-flex{display:flex}.flex-1,.flex-grow{flex:1}.flex-shrink-0{flex:0 0 auto}.leader-1{margin-top:var(--calcite-spacing-xxl)}.trailer-1{margin-bottom:var(--calcite-spacing-xxl)}.warning-text{max-width:35em;margin-left:auto;margin-right:auto;font-size:var(--calcite-font-size-md)}.text-center{text-align:center}.border-override{border-top-width:var(--calcite-border-width-none);border-bottom-width:var(--calcite-border-width-none)}.header-override{--calcite-panel-header-content-space: var(--calcite-spacing-none);--calcite-panel-header-background-color: var(--calcite-color-foreground-2)}.panel-override{--calcite-panel-background-color: var(--calcite-color-foreground-2);--calcite-panel-border-color: none}.label-override{--calcite-label-margin-bottom: var(--calcite-spacing-none);font-weight:var(--calcite-font-weight-medium)}.header-content-wrapper{padding-inline-start:var(--calcite-spacing-xxs)}.header-button-padding{padding-top:var(--calcite-spacing-sm);padding-bottom:var(--calcite-spacing-sm);padding-inline-start:var(--calcite-spacing-lg);padding-inline-end:var(--calcite-spacing-lg)}.padding-start{padding-inline-start:var(--calcite-spacing-lg)}.align-items-center{align-items:center}.justify-content-end{justify-content:end}.justify-content-start{justify-content:start}.filter-width-350{--calcite-shell-panel-width: 350px}.z-index-2{z-index:2}.mock-fab{--calcite-fab-shadow-internal: 0 6px 20px -4px rgba(0, 0, 0, .1), 0 4px 12px -2px rgba(0, 0, 0, .08);box-shadow:var(--calcite-fab-shadow, var(--calcite-fab-shadow-internal));--calcite-button-background-color: var(--calcite-fab-background-color);--calcite-button-border-color: var(--calcite-fab-border-color);--calcite-button-text-color: var(--calcite-fab-text-color);--calcite-button-loader-color: var(--calcite-fab-loader-color)}.position-relative{position:relative}.height-100{height:100%}.height-50{height:50px}.sign-in-prompt{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%}.sign-in-icon{transform:translate(-20px)}.height-150{height:150px}.width-150{width:150px}.padding-top-8{padding-top:8px}`,c=class extends p{constructor(){super(),this.solutionsCount=0,this.filterOpen=!0,this.isMobile=!1,this._showAlertFailed=!1,this._translations=b({name:"solutions-deployed-shell",blocking:!0}),this._configContextConsumer=r({context:f,subscribe:!0}),this._deployedCardFetchFailedMessage="",this._deployedCardFetchFailedTitle="",this._isMobileContextConsumer=r({context:v,subscribe:!0,callback:e=>this.isMobile=e}),this._solutionsDeployedPanelRef=o(),this._mainPanelRef=o(),this._panelFixed=!1,this.filterRemoved=l(),this.tokenRefreshed=l(),this._handleSignIn=()=>{let e=window.location.pathname.endsWith("deployments")?"":"deployments";this._configContextConsumer.value?.authentication?.signIn(e)},this.listenOn(window,"deployedCardFetchFailed",e=>{let t=e.detail;this._deployedCardFetchFailedTitle=t.title,this._deployedCardFetchFailedMessage=t.message,this._showAlertFailed=!0})}static{this.properties={solutionsCount:9,filterOpen:16,isMobile:16,_showAlertFailed:16,_translations:16}}static{this.styles=x}willUpdate(e){e.has("isMobile")&&(this.filterOpen=!this.isMobile)}async searchSolutions(e){this._solutionsDeployedPanelRef.value?.setSearchOptions(e),("sortType"in e||"searchTerm"in e)&&this._solutionsDeployedPanelRef.value?.searchSolutions(e)}async load(){this._isMobileContextConsumer.value&&(this.isMobile=this._isMobileContextConsumer.value)}updated(){this._fixPanelContentWrapperFocus()}_fixPanelContentWrapperFocus(){if(!this._panelFixed&&this._mainPanelRef.value){let e=this._mainPanelRef.value;e.componentOnReady?.().then(()=>{if(e.shadowRoot){let t=e.shadowRoot.querySelector(".content-wrapper");t&&(t.tabIndex=-1,this._panelFixed=!0,this._setupPanelObserver())}}).catch(()=>{this._panelFixed=!0})}}_setupPanelObserver(){if(this._panelObserver)return;this._panelObserver=new MutationObserver(t=>{t.forEach(a=>{if(a.type==="attributes"&&a.attributeName==="tabindex"){let n=a.target;n.classList.contains("content-wrapper")&&n.tabIndex===0&&(n.tabIndex=-1)}})});let e=this._mainPanelRef.value;if(e?.shadowRoot){let t=e.shadowRoot.querySelector(".content-wrapper");t&&this._panelObserver.observe(t,{attributes:!0,attributeFilter:["tabindex"]})}}disconnectedCallback(){super.disconnectedCallback(),this._panelObserver?.disconnect()}render(){if(!this._configContextConsumer.value?.authentication?.IsSignedIn)return this._getSignInPrompt();let e=this.isMobile?"justify-content-start":"";return i`<calcite-shell class="position-relative"><calcite-panel class="border-override header-override panel-override z-index-1" ${s(this._mainPanelRef)}><div class=${`display-flex align-items-center height-50 header-content-wrapper ${e}`} slot=header-content><calcite-label class="label-override flex-shrink-0 padding-top-8" layout=inline>${this._translations.numberOfDeployments?.replace("{{count}}",this.solutionsCount.toString())}</calcite-label></div>${this._getSolutionsDeployedPanel()}</calcite-panel></calcite-shell>`}_getSignInPrompt(){return i`<div class="sign-in-prompt">${this._getSignInIcon()}<div class="text-center leader-1 warning-text trailer-1">${this._translations.signInMessage}</div><calcite-button appearance=outline @click=${this._handleSignIn} @keydown=${e=>m(e,()=>this._handleSignIn())} scale=l>${this._translations.signIn}</calcite-button></div>`}_getSolutionsDeployedPanel(){let e=this.isMobile&&this.filterOpen?{display:"none"}:"";return i`<div><solutions-deployed-panel @deployedCardsFetched=${this._updateSolutionCount} style=${u(e)} ${s(this._solutionsDeployedPanelRef)}></solutions-deployed-panel><calcite-alert icon=exclamation-mark-triangle kind=danger .label=${this._deployedCardFetchFailedTitle} @calciteAlertClose=${()=>{this._showAlertFailed=!1}} .open=${this._showAlertFailed}><div slot=title>${this._deployedCardFetchFailedTitle}</div><div slot=message>${this._deployedCardFetchFailedMessage}</div></calcite-alert></div>`}_updateSolutionCount(e){this.solutionsCount=e.detail}_getSignInIcon(){return i`<div class="sign-in-icon"><svg viewBox="0 0 64 64" width=200 height=200 xmlns=http://www.w3.org/2000/svg>${h`<path d="M56.9 4.1V60h-.8V4.9H23.3l25.6 7.47v39.26l-28.8 8.4V35h.8v23.97l27.2-7.94V12.97L20.9 5.03V30h-.8V4.1h36.8zM30.735 41.7l.565.566 9.766-9.766-9.766-9.766-.565.567 8.799 8.799H5v.8h34.534l-8.8 8.8z" fill=var(--calcite-color-text-3) />`}</svg></div>`}};g("solutions-deployed-shell",c);return c},a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import{a as t}from"./
|
|
2
|
+
import{a as t}from"./3LEJ44U2.js";import{v as e}from"./46DQNAMV.js";var o=e(t,{"instant-apps-app-error":[()=>import("./JVMVZ2RC.js"),"_messages:;clearErrorMessage"],"instant-apps-app-guide":[()=>import("./XJWEK5VT.js"),"_messages:,data:,header"],"instant-apps-buffer":[()=>import("./VQFRDGSZ.js").then(m=>m.default.then(e=>({InstantAppsBuffer:e}))),"_messages:,bufferColor:,bufferDistance,bufferGraphicSymbol:,bufferInputStep,bufferLayer:,bufferMaxDistance,bufferMinDistance,bufferOutlineColor:,bufferOutlineWidth,bufferStyle,bufferUnit,distanceValuesSorted:,elevationInfoMode,geodesicBufferEnabled,inputGraphics:,inputMethod,open,readyToBuffer,sources:,view:;clearBufferLayer,close,setFocus"],"instant-apps-buffer-distance-manager":[()=>import("./D37HOE6T.js"),"addButtonLabel,bufferDistance,bufferInputStep,bufferMaxDistance,bufferMinDistance,distanceValuesSorted:,inputNumberLabel,removeValueLabel"],"instant-apps-buffer-input-radiogroup":[()=>import("./DUEAJUQG.js"),"disabled,labels:,selectedValue"],"instant-apps-compass":[()=>import("./ZZ3AVDZU.js").then(m=>m.default.then(e=>({InstantAppsCompass:e}))),"_messages:,view:"],"instant-apps-control-panel":[()=>import("./CTRHHRDP.js").then(m=>m.default.then(e=>({InstantAppsControlPanel:e}))),"components:,view:"],"instant-apps-create":[()=>import("./7UXCJXCE.js").then(m=>m.default.then(e=>({InstantAppsCreate:e}))),"_messages:,content:,mode,options:,popoverIcon,popoverPlacement,popoverPositioning,portal:,showHeader"],"instant-apps-export":[()=>import("./GXXXAGCI.js").then(m=>m.default.then(e=>({InstantAppsExport:e}))),"_messages:,allowedFileTypes:,beforeExport:,cloneExtraContent,defaultFileType,extraContent:,extraContentLabel,headerTitle,includeExtraContent,includeFileFormat,includeLegend,includeMap,includePopup,logoAltText,logoImage,mapAltText,maskBackground,maskBorder,mode,output:,popoverIcon,popoverPlacement,popoverPositioning,scale,showExtraContentInImg,showHeaderTitle,showIncludeLegend,showIncludeMap,showIncludePopup,showScaleBar,view:"],"instant-apps-export-views":[()=>import("./TP6FTOYI.js").then(m=>m.default.then(e=>({InstantAppsExportViews:e}))),"_messages:,beforeExport:,exportViews:,includeHeader,includeLegend,includeMap,includePopup,mode,output:,popoverIcon,popoverPlacement,popoverPositioning,scale,showIncludeHeader,showIncludeLegend,showIncludeMap,showIncludePopup,showScaleBar"],"instant-apps-filter-list":[()=>import("./T5ZR5RSW.js").then(m=>m.default.then(e=>({InstantAppsFilterList:e}))),"_messages:,autoUpdateUrl,closeBtn,closeBtnOnClick:,closeBtnText,comboboxOverlayPositioning,extentSelector,extentSelectorConfig:,filterCount,layerExpressions:,openFilters,resetBtn,resetFiltersOnDisconnect,urlParams:,view:,zoomBtn;forceReset,getCurrentLayerExpressions,getFilterInitState,handleUpdatingT9nData,updateInitDefExpressions"],"instant-apps-header":[()=>import("./I3OLKEFJ.js"),"backgroundColor,customHeaderCss,customHeaderHtml,fontFamily,headerAlignment,infoButton,infoIsOpen,infoTitleText,logoImage,logoImageAltText,logoLink,logoScale,mobileWidthBreakpoint,textColor,titleText,titleTextLink;toggleInfo"],"instant-apps-interactive-legend":[()=>import("./6BEDO5MX.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegend:e}))),"_messages:,compact,featureCount,filterMode:,view:,zoomTo"],"instant-apps-interactive-legend-classic":[()=>import("./SETNDPAB.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegendClassic:e}))),"featureCount,filterMode:,legendvm:,messages:,zoomTo"],"instant-apps-interactive-legend-count":[()=>import("./JQFNYWZI.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegendCount:e}))),"_messages:,activeLayerInfo:,categoryId,infoIndex,legendElement:,legendvm:,selected,showTotal"],"instant-apps-interactive-legend-group-legend-element":[()=>import("./2DAM5BYX.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegendGroupLegendElement:e}))),"activeLayerInfo:,featureCount,isChild,legendvm:"],"instant-apps-interactive-legend-group-legend-element-caption":[()=>import("./YT2QG2ST.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegendGroupLegendElementCaption:e}))),"_messages:,activeLayerInfo:,expanded,featureCount,isChild,legendvm:"],"instant-apps-interactive-legend-layer-element":[()=>import("./OJLSK25V.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegendLayerElement:e}))),"activeLayerInfo:,featureCount,isChild,legendvm:"],"instant-apps-interactive-legend-layer-element-caption":[()=>import("./RIWLHWBH.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegendLayerElementCaption:e}))),"_messages:,activeLayerInfo:,expanded,featureCount,isChild,legendvm:"],"instant-apps-interactive-legend-legend-element":[()=>import("./JQU7O6FD.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegendLegendElement:e}))),"activeLayerInfo:,isChild,isColorRamp,isInteractive,isRelationshipRamp,isSizeRamp,legendElement:,legendElementIndex,legendvm:,titleText,zoomTo"],"instant-apps-interactive-legend-legend-element-caption":[()=>import("./E74QDAYN.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegendLegendElementCaption:e}))),"_messages:,activeLayerInfo:,expanded,isInteractive,layer:,legendElement:,legendElementIndex,legendvm:,titleText,zoomTo"],"instant-apps-interactive-legend-relationship":[()=>import("./EH43P34B.js").then(m=>m.default.then(e=>({InstantAppsInteractiveLegendRelationship:e}))),"_messages:,activeLayerInfo:,filterMode:,legendElement:"],"instant-apps-keyboard-shortcuts":[()=>import("./OAWQFVGG.js"),"_messages:,view:"],"instant-apps-landing-page":[()=>import("./NLNE5H6M.js"),"alignment,backgroundImageSrc,descriptionText,disableTransition,enableSignIn,entryButtonScale,entryButtonText,fontFamily,iconImage,iconImageAltText,iconImageScale,oauthappid,open,portal:,subtitleText,titleText"],"instant-apps-language-switcher":[()=>import("./ALDUB3A4.js").then(m=>m.default.then(e=>({InstantAppsLanguageSwitcher:e}))),"calciteDropdownOverlayPositioning,defaultLocale,icon,locales:,portalItem:,selectedLanguage,view:;refresh"],"instant-apps-language-translator":[()=>import("./O2OYKALV.js").then(m=>m.default.then(e=>({InstantAppsLanguageTranslator:e}))),"_messages:,appSettings:,locales:,open,portalItem:,translatedLocaleInputOnChangeCallback:,userLocaleInputOnChangeCallback:;batchWriteToPortalItemResource,getPortalItemResource,getTranslationData,setTranslationData"],"instant-apps-ckeditor-wrapper":[()=>import("./73LVZIP7.js"),"config:,editorInstance:,value"],"instant-apps-language-translator-content":[()=>import("./3ELXQUHH.js").then(m=>m.default.then(e=>({InstantAppsLanguageTranslatorContent:e}))),"_messages:"],"instant-apps-language-translator-item":[()=>import("./EVFB6G4J.js").then(m=>m.default.then(e=>({InstantAppsLanguageTranslatorItem:e}))),"fieldName,setting:,translatedLanguageLabels:,translatedLocaleInputOnChangeCallback:,userLocaleInputOnChangeCallback:"],"instant-apps-language-translator-search":[()=>import("./H5ZE4RIC.js").then(m=>m.default.then(e=>({InstantAppsLanguageTranslatorSearch:e}))),"t9nPlaceholder"],"instant-apps-measurement":[()=>import("./5W3ANKBB.js"),"_messages:,activeToolType,areaUnit,closable,coordinateFormat,linearUnit,showHeading,view:"],"instant-apps-measurement-tool":[()=>import("./IDEWFRKI.js").then(m=>m.default.then(e=>({InstantAppsMeasurementTool:e}))),"activeTool,measureConfiguration:,view:"],"instant-apps-popover":[()=>import("./FJSRWM5L.js"),"_messages:,content,disableAction,imgAlt,imgSrc,index,mediaSrc,messageOverrides:,pagination,parent:,placement,popoverAction:,popoverTitle,referenceElement,refId,subtitle"],"instant-apps-popovers":[()=>import("./3B4FA5CV.js"),"beforeOpen:,currentId,instantAppsPopovers:,inTour;beginTour,close,done,endTour,next,open,previous"],"instant-apps-scoreboard":[()=>import("./6RXHEPPS.js").then(m=>m.default.then(e=>({InstantAppsScoreboard:e}))),"_messages:,autoDockEnabled,geometry:,itemLimit,items:,mode,position,queryType,view:"],"instant-apps-selection-toolbar":[()=>import("./Y4TNT6PF.js").then(m=>m.default.then(e=>({InstantAppsSelectionToolbar:e}))),"_messages:,continuousSelectionEnabled,disabled,enabledTool,readyToSelect,selectedCount:,selectionManager:,selectionToolbarViewModel:,sources:,view:;getSelectedFeatures;clearSelection"],"instant-apps-sign-in":[()=>import("./EL4G77RV.js").then(m=>m.default.then(e=>({InstantAppsSignIn:e}))),"_messages:,closeLandingPage:,landingPage,oauthappid,openInPopup,portal:,showIndicator,signInPopoverItems:,type"],"instant-apps-social-share":[()=>import("./EUZCYCCK.js").then(m=>m.default.then(e=>({InstantAppsSocialShare:e}))),"_messages:,autoUpdateShareUrl,defaultUrlParams:,displayTipText,embed,flipRtl,iframeInnerText,inlineSuccessPopoverPlacement,isNativeShareEnabled,mode,popoverButtonIconScale,popoverPositioning,removePopoverOffset,scale,shareButtonColor,shareButtonScale,shareButtonType,shareIconsLayout,shareText,shareUrl,shortenShareUrl,socialMedia,successMessage,useNativeShare,view:"],"instant-apps-splash":[()=>import("./ZVJIHRYK.js"),"_messages:,closeBehavior,closeButtonDisabled,confirmationText,content,isConfirmed:,localStorageKey,open,outsideCloseDisabled,primaryButtonText,secondaryButton,secondaryButtonCallback:,secondaryButtonIcon,secondaryButtonText,titleText"],"instant-apps-time-filter":[()=>import("./P6ETLC5A.js").then(m=>m.default.then(e=>({InstantAppsTimeFilter:e}))),"_messages:,autoPlay,filterMode:,timeInfoConfigItems:,timeSliderConfig:,view:"]});export{o as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import b from"./ET27C34M.js";import a from"./ZL6A7VRS.js";import{b as C}from"./PZ4L77M5.js";import{rb as v,sa as S,sb as T,tb as $}from"./DD3JC2L3.js";import{a as D}from"./LFIJXE3U.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as I}from"./VU3OQQKP.js";import{F as m,G as f,H as y,J as u,h as g,i as r,r as c}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{J:V,K:w,b:b,f:_},{a:P}])=>{var N=g`*[tabindex]:focus-visible{outline-style:solid!important;outline-width:2px!important;outline-color:var(--calcite-color-brand)!important;outline-offset:2px!important}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}.flex-direction-row{flex-direction:row}.font-weight-medium{font-weight:var(--calcite-font-weight-medium)}.font-style-1{font-size:1rem;color:var(--calcite-color-text-2)}.margin-top-0{margin-top:0}.padding-top-20{padding-top:20px}.padding-bottom-2{padding-bottom:2rem}.padding-left-2{padding-left:2rem}.padding-right-2{padding-right:2rem}.padding-end-1{padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.width-full{width:100%}.justify-content-space{justify-content:space-between}`,x=class extends y{constructor(){super(...arguments),this.open=!1,this.source="Card Dropdown",this.solutionData={},this.templateInfos=[],this._saveDisabled=!1,this._displayTemplateInfos=[],this._hasNameLengthError=!1,this._nonSolutionDependencyItems=[],this._solutionItemsTitlesUpdating=!1,this._translations=D({name:"solution-configure-titles",blocking:!0}),this._configContextConsumer=C({context:b,subscribe:!0}),this._defaultPrefix="",this._defaultSuffix="",this._loadingDefaultPrefix=!1,this._loadingDefaultSuffix=!1,this._prefixRef=m(),this._prefixValue="",this._suffixRef=m(),this._suffixValue="",this._templateInfos=[],this._originalTitles=[],this.solutionConfigureTitlesBeforeClose=c(),this.solutionItemsTitlesChanged=c()}static{this.properties={card:0,open:5,source:1,solutionData:1,templateInfos:0,_saveDisabled:16,_displayTemplateInfos:16,_hasNameLengthError:16,_nonSolutionDependencyItems:16,_solutionItemsTitlesUpdating:16,_translations:16}}static{this.styles=N}async willUpdate(i){if(i.has("templateInfos")&&(this._templateInfos=JSON.parse(JSON.stringify(this.templateInfos)),this._updateTemplates()),i.has("open")){let t=i.get("open");if(this.open&&!t){await this._updatePrefixSuffix(),this._templateInfos=JSON.parse(JSON.stringify(this.templateInfos)),this._originalTitles=this._templateInfos.map(s=>({id:s.id,title:s.title})),this._updateTemplates();let e=await P(this._configContextConsumer.value.userSession,this.card);this._nonSolutionDependencyItems=e._nonSolutionDependencyItems,await this._accordionRef?.expandFirstItem()}}}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async load(){this._updateTemplates(),await this._updatePrefixSuffix()}async _updatePrefixSuffix(){this.solutionData=await S(this.card.id,this._configContextConsumer.value.userSession),this.solutionData.titles?.prefix&&(this._loadingDefaultPrefix=!0,this._defaultPrefix=this.solutionData.titles.prefix,this._prefixValue=this.solutionData.titles.prefix),this.solutionData.titles?.suffix&&(this._loadingDefaultSuffix=!0,this._defaultSuffix=this.solutionData.titles.suffix,this._suffixValue=this.solutionData.titles.suffix)}render(){return r`<calcite-dialog .heading=${this.card.title} modal @calciteDialogBeforeClose=${()=>{this.solutionConfigureTitlesBeforeClose.emit()}} .open=${this.open} outside-close-disabled width=l>${this._getPrefixSuffixControls()}${this._getAccordion()}${this._getDialogButtons()}</calcite-dialog>`}_getPrefixSuffixControls(){let i=_(this._prefixValue,"item"),t=this._hasNameLengthError&&this._prefixValue.length>0,e=!i,s=!t,n=e?"display-none":"",h=s?"display-none":"",a=e&&s?"valid":"invalid",l=_(this._suffixValue,"item"),o=this._hasNameLengthError&&this._suffixValue.length>0,d=!l,p=!o,E=d?"display-none":"",W=p?"display-none":"",k=d&&p?"valid":"invalid";return this._saveDisabled=!e||!s||!d||!p||!this._hasChanges(),r`<div class="display-flex flex-direction-column padding-left-2 padding-right-2 padding-top-20"><calcite-label scale=l class="font-weight-medium"><span tabindex=0>${this._translations.configureTitlesDialogHeader}</span></calcite-label><p class="font-style-1 margin-top-0" tabindex=0>${this._translations.addPrefixOrSuffixToItems}</p><div class="display-flex flex-direction-row justify-content-space"><calcite-label class="width-full padding-end-1" scale=l>${this._translations.prefixToAddToItems}<calcite-input clearable @blur=${this._prefixInput} @input=${this._prefixInput} .placeholder=${this._translations.enterPrefixPlaceholder} .status=${a} .value=${this._prefixValue} ${f(this._prefixRef)}></calcite-input><calcite-input-message class=${u(n)} icon=exclamation-mark-triangle status=invalid>${this._translations.invalidPrefixOrSuffixCharsError}</calcite-input-message><calcite-input-message class=${u(h)} icon=exclamation-mark-triangle status=invalid>${this._translations.invalidPrefixOrSuffixLengthError}</calcite-input-message></calcite-label><calcite-label class="width-full" scale=l>${this._translations.suffixToAddToItems}<calcite-input clearable @blur=${this._suffixInput} @input=${this._suffixInput} .placeholder=${this._translations.enterSuffixPlaceholder} .status=${k} .value=${this._suffixValue} ${f(this._suffixRef)}></calcite-input><calcite-input-message class=${u(E)} icon=exclamation-mark-triangle status=invalid>${this._translations.invalidPrefixOrSuffixCharsError}</calcite-input-message><calcite-input-message class=${u(W)} icon=exclamation-mark-triangle status=invalid>${this._translations.invalidPrefixOrSuffixLengthError}</calcite-input-message></calcite-label></div></div>`}_getAccordion(){let i=[...new Set(this._nonSolutionDependencyItems.map(t=>t.controlItemId))];return r`<div class="display-flex flex-direction-column padding-left-2 padding-right-2 padding-bottom-2"><p class="font-style-1 margin-top-0">${this._translations.previewTheChanges}</p><solution-item-accordion .itemRelationshipDependencies=${i} list-selection-mode=multiple .reuseWarning=${this._translations.itemDependencyReuseWarning} .templateInfos=${this._displayTemplateInfos} .typeKeywords=${this.card?.typeKeywords} ${f(async t=>{t&&(this._accordionRef=t)})}></solution-item-accordion></div>`}_getDialogButtons(){return r`<div slot=footer-end><calcite-button appearance=outline class="padding-end-1-2" kind=brand @click=${this._closeDialog}>${this._translations.cancelTheDialog}</calcite-button><calcite-button .disabled=${this._saveDisabled} kind=brand .loading=${this._solutionItemsTitlesUpdating} @click=${this._commitNameChanges}>${this._translations.applyChangesAndCloseTheDialog}</calcite-button></div>`}_prefixInput(){clearTimeout(this._textInputTimeout),this._textInputTimeout=setTimeout(()=>{this._prefixValue=this._prefixRef.value?.value||"",this._updateTemplates()},500)}_suffixInput(){clearTimeout(this._textInputTimeout),this._textInputTimeout=setTimeout(()=>{this._suffixValue=this._suffixRef.value?.value||"",this._updateTemplates()},500)}_updateTemplates(){this._templateInfos=this._templateInfos.map(t=>(this._loadingDefaultPrefix&&t.title.startsWith(this._prefixValue)&&(t.title=this._replaceStart(t.title,this._prefixValue,"")),this._loadingDefaultSuffix&&t.title.endsWith(this._suffixValue)&&(t.title=this._replaceAtEnd(t.title,this._suffixValue,"")),t));let i=JSON.parse(JSON.stringify(this._templateInfos));this._hasNameLengthError=!1,this._displayTemplateInfos=i.map(t=>{let e=this._prefixValue!=="",s=this._suffixValue!=="",n=this._defaultPrefix!=="",h=this._defaultSuffix!=="",a=t.title;e&&(n?this._originalTitles.find(o=>o.id===t.id)?.title.startsWith(this._defaultPrefix)?a=this._applyPrefixWithDuplicateCheck(t.title,this._prefixValue):this._prefixValue!==this._defaultPrefix&&(a=this._applyPrefixWithDuplicateCheck(t.title,this._prefixValue)):a=this._applyPrefixWithDuplicateCheck(t.title,this._prefixValue));let l=a;return s&&(h?this._originalTitles.find(o=>o.id===t.id)?.title.endsWith(this._defaultSuffix)?l=this._applySuffixWithDuplicateCheck(a,this._suffixValue):this._suffixValue!==this._defaultSuffix&&(l=this._applySuffixWithDuplicateCheck(a,this._suffixValue)):l=this._applySuffixWithDuplicateCheck(a,this._suffixValue)),t.title=l,this._hasNameLengthError||(this._hasNameLengthError=t.title.length>V),t}),this._loadingDefaultPrefix=!1,this._loadingDefaultSuffix=!1}_replaceStart(i,t,e){return i.startsWith(t)?`${e}${i.slice(t.length)}`:i}_replaceAtEnd(i,t,e){return i.endsWith(t)?`${i.substring(0,i.length-t.length)}${e}`:i}_applyPrefixWithDuplicateCheck(i,t){return!t||i.startsWith(t)?i:t+i}_applySuffixWithDuplicateCheck(i,t){return!t||i.endsWith(t)?i:i+t}_hasChanges(){let i=this._defaultPrefix!==this._prefixValue,t=this._defaultSuffix!==this._suffixValue;return this._displayTemplateInfos.some(e=>{let s=this._originalTitles.find(n=>n.id===e.id);return s&&s.title!==e.title})||i||t}_closeDialog(){this.open=!1}async _commitNameChanges(){if(this._hasChanges()){this._telemetry?.logEvent({category:w.DEPLOYMENTS,action:"Rename Items",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"",this.source]}),this._solutionItemsTitlesUpdating=!0;let i=this._displayTemplateInfos.reduce((t,e)=>{let s={id:e.id,title:e.title};return t.push(e.type==="Group"?T(s,this._configContextConsumer.value.userSession):v(s,this._configContextConsumer.value.userSession,void 0,{solutionOwner:this.card?.owner})),t},[]);if(this.solutionData?.templates){let t={id:this.card.id},e={...this.solutionData,titles:{prefix:this._prefixValue,suffix:this._suffixValue}};i.push($(t,e,this._configContextConsumer.value.userSession,void 0,void 0,null,this.card?.owner))}await Promise.all(i),this._solutionItemsTitlesUpdating=!1,this.solutionItemsTitlesChanged.emit()}this._closeDialog()}};I("solution-configure-titles",x);return x},a,b)
|
|
2
|
+
import b from"./5Z32YRHM.js";import a from"./RTSKNY33.js";import{b as C}from"./PZ4L77M5.js";import{rb as v,sa as S,sb as T,tb as $}from"./JE7L7M3J.js";import{a as D}from"./LFIJXE3U.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import"./AOBFPJ2R.js";import"./JK6XUSIM.js";import"./UPHYUDLT.js";import"./QJJXVRMV.js";import"./7FMLZNDR.js";import"./LL5C4DHP.js";import"./WPAMUSBR.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./J3QMHA2M.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./OEJAW72H.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import"./5UWT66A7.js";import{b as I}from"./VU3OQQKP.js";import{F as m,G as f,H as y,J as u,h as g,i as r,r as c}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([{J:V,K:w,b:b,f:_},{a:P}])=>{var N=g`*[tabindex]:focus-visible{outline-style:solid!important;outline-width:2px!important;outline-color:var(--calcite-color-brand)!important;outline-offset:2px!important}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}.flex-direction-row{flex-direction:row}.font-weight-medium{font-weight:var(--calcite-font-weight-medium)}.font-style-1{font-size:1rem;color:var(--calcite-color-text-2)}.margin-top-0{margin-top:0}.padding-top-20{padding-top:20px}.padding-bottom-2{padding-bottom:2rem}.padding-left-2{padding-left:2rem}.padding-right-2{padding-right:2rem}.padding-end-1{padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.width-full{width:100%}.justify-content-space{justify-content:space-between}`,x=class extends y{constructor(){super(...arguments),this.open=!1,this.source="Card Dropdown",this.solutionData={},this.templateInfos=[],this._saveDisabled=!1,this._displayTemplateInfos=[],this._hasNameLengthError=!1,this._nonSolutionDependencyItems=[],this._solutionItemsTitlesUpdating=!1,this._translations=D({name:"solution-configure-titles",blocking:!0}),this._configContextConsumer=C({context:b,subscribe:!0}),this._defaultPrefix="",this._defaultSuffix="",this._loadingDefaultPrefix=!1,this._loadingDefaultSuffix=!1,this._prefixRef=m(),this._prefixValue="",this._suffixRef=m(),this._suffixValue="",this._templateInfos=[],this._originalTitles=[],this.solutionConfigureTitlesBeforeClose=c(),this.solutionItemsTitlesChanged=c()}static{this.properties={card:0,open:5,source:1,solutionData:1,templateInfos:0,_saveDisabled:16,_displayTemplateInfos:16,_hasNameLengthError:16,_nonSolutionDependencyItems:16,_solutionItemsTitlesUpdating:16,_translations:16}}static{this.styles=N}async willUpdate(i){if(i.has("templateInfos")&&(this._templateInfos=JSON.parse(JSON.stringify(this.templateInfos)),this._updateTemplates()),i.has("open")){let t=i.get("open");if(this.open&&!t){await this._updatePrefixSuffix(),this._templateInfos=JSON.parse(JSON.stringify(this.templateInfos)),this._originalTitles=this._templateInfos.map(s=>({id:s.id,title:s.title})),this._updateTemplates();let e=await P(this._configContextConsumer.value.userSession,this.card);this._nonSolutionDependencyItems=e._nonSolutionDependencyItems,await this._accordionRef?.expandFirstItem()}}}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async load(){this._updateTemplates(),await this._updatePrefixSuffix()}async _updatePrefixSuffix(){this.solutionData=await S(this.card.id,this._configContextConsumer.value.userSession),this.solutionData.titles?.prefix&&(this._loadingDefaultPrefix=!0,this._defaultPrefix=this.solutionData.titles.prefix,this._prefixValue=this.solutionData.titles.prefix),this.solutionData.titles?.suffix&&(this._loadingDefaultSuffix=!0,this._defaultSuffix=this.solutionData.titles.suffix,this._suffixValue=this.solutionData.titles.suffix)}render(){return r`<calcite-dialog .heading=${this.card.title} modal @calciteDialogBeforeClose=${()=>{this.solutionConfigureTitlesBeforeClose.emit()}} .open=${this.open} outside-close-disabled width=l>${this._getPrefixSuffixControls()}${this._getAccordion()}${this._getDialogButtons()}</calcite-dialog>`}_getPrefixSuffixControls(){let i=_(this._prefixValue,"item"),t=this._hasNameLengthError&&this._prefixValue.length>0,e=!i,s=!t,n=e?"display-none":"",h=s?"display-none":"",a=e&&s?"valid":"invalid",l=_(this._suffixValue,"item"),o=this._hasNameLengthError&&this._suffixValue.length>0,d=!l,p=!o,E=d?"display-none":"",W=p?"display-none":"",k=d&&p?"valid":"invalid";return this._saveDisabled=!e||!s||!d||!p||!this._hasChanges(),r`<div class="display-flex flex-direction-column padding-left-2 padding-right-2 padding-top-20"><calcite-label scale=l class="font-weight-medium"><span tabindex=0>${this._translations.configureTitlesDialogHeader}</span></calcite-label><p class="font-style-1 margin-top-0" tabindex=0>${this._translations.addPrefixOrSuffixToItems}</p><div class="display-flex flex-direction-row justify-content-space"><calcite-label class="width-full padding-end-1" scale=l>${this._translations.prefixToAddToItems}<calcite-input clearable @blur=${this._prefixInput} @input=${this._prefixInput} .placeholder=${this._translations.enterPrefixPlaceholder} .status=${a} .value=${this._prefixValue} ${f(this._prefixRef)}></calcite-input><calcite-input-message class=${u(n)} icon=exclamation-mark-triangle status=invalid>${this._translations.invalidPrefixOrSuffixCharsError}</calcite-input-message><calcite-input-message class=${u(h)} icon=exclamation-mark-triangle status=invalid>${this._translations.invalidPrefixOrSuffixLengthError}</calcite-input-message></calcite-label><calcite-label class="width-full" scale=l>${this._translations.suffixToAddToItems}<calcite-input clearable @blur=${this._suffixInput} @input=${this._suffixInput} .placeholder=${this._translations.enterSuffixPlaceholder} .status=${k} .value=${this._suffixValue} ${f(this._suffixRef)}></calcite-input><calcite-input-message class=${u(E)} icon=exclamation-mark-triangle status=invalid>${this._translations.invalidPrefixOrSuffixCharsError}</calcite-input-message><calcite-input-message class=${u(W)} icon=exclamation-mark-triangle status=invalid>${this._translations.invalidPrefixOrSuffixLengthError}</calcite-input-message></calcite-label></div></div>`}_getAccordion(){let i=[...new Set(this._nonSolutionDependencyItems.map(t=>t.controlItemId))];return r`<div class="display-flex flex-direction-column padding-left-2 padding-right-2 padding-bottom-2"><p class="font-style-1 margin-top-0">${this._translations.previewTheChanges}</p><solution-item-accordion .itemRelationshipDependencies=${i} list-selection-mode=multiple .reuseWarning=${this._translations.itemDependencyReuseWarning} .templateInfos=${this._displayTemplateInfos} .typeKeywords=${this.card?.typeKeywords} ${f(async t=>{t&&(this._accordionRef=t)})}></solution-item-accordion></div>`}_getDialogButtons(){return r`<div slot=footer-end><calcite-button appearance=outline class="padding-end-1-2" kind=brand @click=${this._closeDialog}>${this._translations.cancelTheDialog}</calcite-button><calcite-button .disabled=${this._saveDisabled} kind=brand .loading=${this._solutionItemsTitlesUpdating} @click=${this._commitNameChanges}>${this._translations.applyChangesAndCloseTheDialog}</calcite-button></div>`}_prefixInput(){clearTimeout(this._textInputTimeout),this._textInputTimeout=setTimeout(()=>{this._prefixValue=this._prefixRef.value?.value||"",this._updateTemplates()},500)}_suffixInput(){clearTimeout(this._textInputTimeout),this._textInputTimeout=setTimeout(()=>{this._suffixValue=this._suffixRef.value?.value||"",this._updateTemplates()},500)}_updateTemplates(){this._templateInfos=this._templateInfos.map(t=>(this._loadingDefaultPrefix&&t.title.startsWith(this._prefixValue)&&(t.title=this._replaceStart(t.title,this._prefixValue,"")),this._loadingDefaultSuffix&&t.title.endsWith(this._suffixValue)&&(t.title=this._replaceAtEnd(t.title,this._suffixValue,"")),t));let i=JSON.parse(JSON.stringify(this._templateInfos));this._hasNameLengthError=!1,this._displayTemplateInfos=i.map(t=>{let e=this._prefixValue!=="",s=this._suffixValue!=="",n=this._defaultPrefix!=="",h=this._defaultSuffix!=="",a=t.title;e&&(n?this._originalTitles.find(o=>o.id===t.id)?.title.startsWith(this._defaultPrefix)?a=this._applyPrefixWithDuplicateCheck(t.title,this._prefixValue):this._prefixValue!==this._defaultPrefix&&(a=this._applyPrefixWithDuplicateCheck(t.title,this._prefixValue)):a=this._applyPrefixWithDuplicateCheck(t.title,this._prefixValue));let l=a;return s&&(h?this._originalTitles.find(o=>o.id===t.id)?.title.endsWith(this._defaultSuffix)?l=this._applySuffixWithDuplicateCheck(a,this._suffixValue):this._suffixValue!==this._defaultSuffix&&(l=this._applySuffixWithDuplicateCheck(a,this._suffixValue)):l=this._applySuffixWithDuplicateCheck(a,this._suffixValue)),t.title=l,this._hasNameLengthError||(this._hasNameLengthError=t.title.length>V),t}),this._loadingDefaultPrefix=!1,this._loadingDefaultSuffix=!1}_replaceStart(i,t,e){return i.startsWith(t)?`${e}${i.slice(t.length)}`:i}_replaceAtEnd(i,t,e){return i.endsWith(t)?`${i.substring(0,i.length-t.length)}${e}`:i}_applyPrefixWithDuplicateCheck(i,t){return!t||i.startsWith(t)?i:t+i}_applySuffixWithDuplicateCheck(i,t){return!t||i.endsWith(t)?i:i+t}_hasChanges(){let i=this._defaultPrefix!==this._prefixValue,t=this._defaultSuffix!==this._suffixValue;return this._displayTemplateInfos.some(e=>{let s=this._originalTitles.find(n=>n.id===e.id);return s&&s.title!==e.title})||i||t}_closeDialog(){this.open=!1}async _commitNameChanges(){if(this._hasChanges()){this._telemetry?.logEvent({category:w.DEPLOYMENTS,action:"Rename Items",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"",this.source]}),this._solutionItemsTitlesUpdating=!0;let i=this._displayTemplateInfos.reduce((t,e)=>{let s={id:e.id,title:e.title};return t.push(e.type==="Group"?T(s,this._configContextConsumer.value.userSession):v(s,this._configContextConsumer.value.userSession,void 0,{solutionOwner:this.card?.owner})),t},[]);if(this.solutionData?.templates){let t={id:this.card.id},e={...this.solutionData,titles:{prefix:this._prefixValue,suffix:this._suffixValue}};i.push($(t,e,this._configContextConsumer.value.userSession,void 0,void 0,null,this.card?.owner))}await Promise.all(i),this._solutionItemsTitlesUpdating=!1,this.solutionItemsTitlesChanged.emit()}this._closeDialog()}};I("solution-configure-titles",x);return x},a,b)
|