@esri/solutions-components 5.0.2-next.8 → 5.0.2-next.9

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.
@@ -4,4 +4,4 @@ import{a as pn}from"./LFIJXE3U.js";import"./36I27Q5R.js";import"./GDPFKW75.js";i
4
4
  `),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery&&(this.service==="s3"&&!m.has("X-Amz-Expires")&&m.set("X-Amz-Expires","86400"),m.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),m.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),m.set("X-Amz-SignedHeaders",this.signedHeaders)),this.service==="s3")try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch{this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");S||(this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/")),this.encodedPath=pr(this.encodedPath);let O=new Set;this.encodedSearch=[...this.url.searchParams].filter(([w])=>{if(!w)return!1;if(this.service==="s3"){if(O.has(w))return!1;O.add(w)}return!0}).map(w=>w.map(v=>pr(encodeURIComponent(v)))).sort(([w,v],[A,k])=>w<A?-1:w>A?1:v<k?-1:v>k?1:0).map(w=>w.join("=")).join("&")}async sign(){return this.signQuery?(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken&&this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)):this.headers.set("Authorization",await this.authHeader()),{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){let t=this.datetime.slice(0,8),n=[this.secretAccessKey,t,this.region,this.service].join(),r=this.cache.get(n);if(!r){let i=await _e("AWS4"+this.secretAccessKey,t),o=await _e(i,this.region),s=await _e(o,this.service);r=await _e(s,"aws4_request"),this.cache.set(n,r)}return vt(await _e(r,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,vt(await fr(await this.canonicalString()))].join(`
5
5
  `)}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+`
6
6
  `,this.signedHeaders,await this.hexBodyHash()].join(`
7
- `)}async hexBodyHash(){let t=this.headers.get("X-Amz-Content-Sha256")||(this.service==="s3"&&this.signQuery?"UNSIGNED-PAYLOAD":null);if(t==null){if(this.body&&typeof this.body!="string"&&!("byteLength"in this.body))throw new Error("body must be a string, ArrayBuffer or ArrayBufferView, unless you include the X-Amz-Content-Sha256 header");t=vt(await fr(this.body||""))}return t}};async function _e(e,t){let n=await crypto.subtle.importKey("raw",typeof e=="string"?Nt.encode(e):e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return crypto.subtle.sign("HMAC",n,Nt.encode(t))}async function fr(e){return crypto.subtle.digest("SHA-256",typeof e=="string"?Nt.encode(e):e)}var dr=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function vt(e){let t=new Uint8Array(e),n="";for(let r=0;r<t.length;r++){let i=t[r];n+=dr[i>>>4&15],n+=dr[i&15]}return n}function pr(e){return e.replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}function As(e,t){let{hostname:n,pathname:r}=e;if(n.endsWith(".on.aws")){let a=n.match(/^[^.]{1,63}\.lambda-url\.([^.]{1,63})\.on\.aws$/);return a!=null?["lambda",a[1]||""]:["",""]}if(n.endsWith(".r2.cloudflarestorage.com"))return["s3","auto"];if(n.endsWith(".backblazeb2.com")){let a=n.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);return a!=null?["s3",a[1]||""]:["",""]}let i=n.replace("dualstack.","").match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/),o=i&&i[1]||"",s=i&&i[2];if(s==="us-gov")s="us-gov-west-1";else if(s==="s3"||s==="s3-accelerate")s="us-east-1",o="s3";else if(o==="iot")n.startsWith("iot.")?o="execute-api":n.startsWith("data.jobs.iot.")?o="iot-jobs-data":o=r==="/mqtt"?"iotdevicegateway":"iotdata";else if(o==="autoscaling"){let a=(t.get("X-Amz-Target")||"").split(".")[0];a==="AnyScaleFrontendService"?o="application-autoscaling":a==="AnyScaleScalingPlannerFrontendService"&&(o="autoscaling-plans")}else s==null&&o.startsWith("s3-")?(s=o.slice(3).replace(/^fips-|^external-1/,""),o="s3"):o.endsWith("-fips")?o=o.slice(0,-5):s&&/-\d$/.test(o)&&!/-\d$/.test(s)&&([o,s]=[s,o]);return[Os[o]||o,s||""]}var on="Event",gr=on+"Listener";function Is(e){return function(t,n,r,i){var o=r||no,s=i||!1;if(!Z)return o;var a=et(n),u=et(t,!0);if(!u.length)throw new Error("noElements");if(!a.length)throw new Error("no"+on);var c=[];return(function p(l){l&&(c=[]);for(var x=l?"add"+gr:"remove"+gr,y=0;y<u.length;y++){var b=u[y];c[y]=l?s&&s.once?Es(o):o:c[y]||o;for(var S=0;S<a.length;S++)b[x]?b["on"+a[S]]=l?c[y]:null:b[x](a[S],c[y],s)}return p.bind(null,!l)})(e)}}function et(e,t){if(le(e))return t?et(document.querySelectorAll(e)):(n=e).split(n.indexOf(",")>-1?",":" ").map(function(s){return s.trim()});var n;if(NodeList.prototype.isPrototypeOf(e)){for(var r=[],i=e.length>>>0;i--;)r[i]=e[i];return r}var o=yo(e);return t?o.map(function(s){return le(s)?et(s,!0):s}).flat():o}function Es(e,t){var n;return function(){return e&&(n=e.apply(this,arguments),e=null),n}}var bt=Is(on);function ci(e,t){return Z&&ee(window[e])?(n=window[e],r=t,(i=window)===void 0&&(i=null),ee(n)?function(){n.apply(i,arguments),r.apply(i,arguments)}:r):window[e]=t;var n,r,i}ci.bind(null,"onerror");ci.bind(null,"onload");var li=typeof window>"u",hr="hidden";function Ps(e){if(li)return!1;var t=js(),n="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),r=function(){return e(!!document[t])},i=function(){return document.addEventListener(n,r)};return i(),function(){return document.removeEventListener(n,r),i}}function js(){var e=["webkit","moz","ms","o"];return li||hr in document?hr:e.reduce(function(t,n){var r=n+"Hidden";return!t&&r in document?r:t},null)}var Ts=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Ns(e,t){t===void 0&&(t={});var n=(function(s,a){var u=this,c=!1;return function(p){c||(s.call(u,p),c=!0,setTimeout(function(){return c=!1},a))}})(e,t.throttle||1e4),r=[];function i(){var s=Ps(function(a){a||n({type:"tabVisible"})});return r=[s].concat(Ts.map(function(a){return bt(document,a,n)})).concat(bt(window,"load",n)).concat(bt(window,"scroll",n,{capture:!0,passive:!0})),o}function o(){r.map(function(s){return s()})}return i(),function(){return o(),i}}function _s(e){var t,n,r=e.onIdle,i=e.onWakeUp,o=e.onHeartbeat,s=e.timeout,a=s,u=e.throttle,c=u,p=!1,l=!1,x=new Date,y=function(){return clearTimeout(t)};function b(h){y(),o&&!p&&o(Ce(x),h),i&&p&&(p=!1,i(Ce(n),h),x=new Date),t=setTimeout(function(){p=!0,r&&(n=new Date,r(Ce(x),h))},a)}var S=Ns(b,{throttle:c});return{disable:function(){l=!0,p=!1,y();var h=S();return function(){return l=!1,x=new Date,b({type:"load"}),h()}},getStatus:function(){return{isIdle:p,isDisabled:l,active:p?0:Ce(x,l),idle:p?Ce(n,l):0}}}}function Ce(e,t){return t?0:Math.round((new Date-e)/1e3)}var fi="object",Cs="string",mr="?",F="name",B="version",Ms="",yr="function",Us="undefined",Ds="BlackBerry",Rs="Chrome",zs="Firefox",vr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ls=[[/microsoft (windows) (vista|xp)/i],[F,B],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[F,[B,br,vr]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[F,"Windows"],[B,br,vr]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[B,/_/g,"."],[F,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[F,"MacOS"],[B,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[B,F],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[F,B],[/\(bb(10);/i],[B,[F,Ds]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[B,[F,zs+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[B,[F,"webOS"]],[/crkey\/([\d\.]+)/i],[B,[F,Rs+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[F,"Chromium OS"],B],[/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/(unix) ?([\w\.]*)/i],[F,B]];function $s(e,t){for(var n=0,r,i,o,s,a,u;n<t.length&&!a;){var c=t[n],p=t[n+1];for(r=i=0;r<c.length&&!a;)if(a=c[r++].exec(e),a)for(o=0;o<p.length;o++)u=a[++i],s=p[o],te(s)===fi&&s.length>0?s.length==2?te(s[1])==yr?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:s.length==3?te(s[1])===yr&&!(s[1].exec&&s[1].test)?this[s[0]]=u?s[1].call(this,u,s[2]):void 0:this[s[0]]=u?u.replace(s[1],s[2]):void 0:s.length==4&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):void 0):this[s]=u||void 0;n+=2}}function br(e,t){for(var n in t)if(te(t[n])===fi&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(wr(t[n][r],e))return n===mr?void 0:n}else if(wr(t[n],e))return n===mr?void 0:n;return e}function wr(e,t){return te(e)===Cs?xr(t).indexOf(xr(e))!==-1:!1}function xr(e){return e.toLowerCase()}function Vs(e){var t=(typeof window>"u"?"undefined":te(window))!==Us&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:Ms,n={};return n[F]=void 0,n[B]=void 0,$s.call(n,t,Ls),n}var di="Brave";function sn(){if(typeof window>"u")return{};if(!window.navigator)return{};var e=window.navigator,t=e.platform,n=e.product,r=e.vendor,i=Hs(window.navigator),o=i.type,s=i.version,a=o===di?o:(r||"").split(" ")[0];return{platform:t,os:Vs(),make:a||n,model:o,version:s,name:[o,s].join("/"),language:Ws(),timezone:qs()}}function Ws(){var e=window.navigator,t=e.language,n=e.browserLanguage,r=e.languages;return(t||n||(r||["en_US"])[0]).toLowerCase().replace("-","_")}function qs(){var e=/\(([A-Za-z\s].*)\)/.exec(new Date().toString());return e&&e[1]||""}function Hs(e){var t=e.userAgent,n=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(t);if(n)return{type:n[1],version:n[2]};var r=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(t);if(r)return{type:r[1],version:r[2]};var i=/(headlesschrome)(?:\/([\w\.]+)| )/i.exec(t);if(i)return{type:i[1],version:i[2]};var o=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(t);if(o){var s=e.brave&&e.brave.isBrave||!1;return{type:s?di:o[1],version:o[2]}}var a=/.+(Safari)\/([0-9\.]+).*/i.exec(t);if(a)return{type:a[1],version:a[2]};var u=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(t);if(u)return{type:u[1],version:u[2]};var c=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(t),p=c||["","NA","0.0.0"];return{type:p[1],version:p[2]}}function Ks(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t[e]||e}function Mt(e){return Ut.apply(this,arguments)}function Ut(){return Ut=re(K.mark(function e(t){var n,r,i,o,s,a,u=arguments;return K.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:n=u.length>1&&u[1]!==void 0?u[1]:!1,r={},c.t0=K.keys(t);case 3:if((c.t1=c.t0()).done){c.next=13;break}return i=c.t1.value,o=Array.isArray(t[i])?t[i]:[t[i]],s=n?o:o[0],c.next=9,gi(s,Gs);case 9:a=c.sent,hi(a)||(r[i]=a),c.next=3;break;case 13:return c.abrupt("return",r);case 14:case"end":return c.stop()}},e)})),Ut.apply(this,arguments)}function pi(e){return Dt.apply(this,arguments)}function Dt(){return Dt=re(K.mark(function e(t){var n,r;return K.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:n={},i.t0=K.keys(t);case 2:if((i.t1=i.t0()).done){i.next=9;break}return r=i.t1.value,i.next=6,gi(t[r],Js);case 6:n[r]=i.sent,i.next=2;break;case 9:return i.abrupt("return",n);case 10:case"end":return i.stop()}},e)})),Dt.apply(this,arguments)}function gi(e,t){return Rt.apply(this,arguments)}function Rt(){return Rt=re(K.mark(function e(t,n){return K.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(typeof t!="function"){r.next=4;break}return r.next=3,t();case 3:t=r.sent;case 4:return r.abrupt("return",n(t));case 5:case"end":return r.stop()}},e)})),Rt.apply(this,arguments)}function Gs(e){if(e!=null)return Array.isArray(e)?e.filter(Xs).map(function(t){return t.toString()}):hi(e)?e:e.toString()}function Js(e){return parseFloat(Number(Array.isArray(e)?e[0]:e))}function Xs(e){return e!==null&&typeof e<"u"}function hi(e){return e==null}var zt="_session.start",ut="_session.stop",mi="pageView";function Fs(e){return Lt.apply(this,arguments)}function Lt(){return Lt=re(K.mark(function e(t){var n,r,i,o,s,a,u,c,p,l,x,y,b,S,h,f,m,O,w,v,A,k,C,M,P,z,U,q,$,E,H,D=arguments;return K.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(n=D.length>1&&D[1]!==void 0?D[1]:{},r=D.length>2&&D[2]!==void 0?D[2]:{},i=r.appTitle,o=r.appPackageName,s=r.appVersionCode,a=r.eventMapping,u=r.enrichEventAttributes,c=r.enrichEventMetrics,p=r.debug,l=p?console.log:function(){},x=Ks(t,a),y=Le(),b=n.sessionId||y.id,S=n.sessionStart||y.createdAt,h=n.sessionStart?new Date(n.sessionStart).getTime():y.created,l("event sessionData ",JSON.stringify(y)),be&&(f=rn(),m=ui(),l("event pageSessionInfo",JSON.stringify(f)),l("event tabSessionData ",JSON.stringify(m))),O=n.attributes||{},w=n.eventId||xe(),v=n.time?new Date(n.time):new Date,A=v.toISOString(),k=v.getTime()-h,C=J({date:A,sessionId:b},be?{pageSession:f.id}:{}),!u){N.next=23;break}return N.next=20,u();case 20:N.t0=N.sent,N.next=24;break;case 23:N.t0={};case 24:if(M=N.t0,P=J(J(J({},C),M),O),z=n.metrics||{},U={sessionTime:y.elapsed||k,hour:v.getHours(),day:v.getDay()+1,month:v.getMonth()+1,year:v.getFullYear()},!c){N.next=34;break}return N.next=31,c();case 31:N.t1=N.sent,N.next=35;break;case 34:N.t1={};case 35:return q=N.t1,$=J(J(J({},U),q),z),N.next=39,Mt(P);case 39:return N.t2=N.sent,N.next=42,pi($);case 42:return N.t3=N.sent,E={attributes:N.t2,metrics:N.t3},l("".concat(w,":").concat(x)),l("eventAttributes",E.attributes),l("eventMetrics",E.metrics),be&&l("clientInfo",sn()),H=tn({},w,J(J({EventType:x,Timestamp:A,AppPackageName:o,AppTitle:i},s?{AppVersionCode:s}:{}),{},{Attributes:E.attributes,Metrics:E.metrics,Session:{Id:b,StartTimestamp:S}})),t===ut&&(H[w].Session.Duration=k,H[w].Session.StopTimestamp=A),N.abrupt("return",H);case 51:case"end":return N.stop()}},e)})),Lt.apply(this,arguments)}var Bs="__endpoint";function ct(e){return"".concat(Bs,".").concat(e)}var Sr="__endpoint",Or=!1;function an(){return $t.apply(this,arguments)}function $t(){return $t=re(K.mark(function e(){var t,n,r,i,o,s,a,u,c,p,l,x,y,b,S,h,f,m,O,w,v,A=arguments;return K.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return t=A.length>0&&A[0]!==void 0?A[0]:{},n=A.length>1&&A[1]!==void 0?A[1]:{},r=n.getUserId,i=n.getEndpointId,o=n.endpointMigration,s=ra(n),a=s.sessionKey?s.sessionKey():"sessions",u=s.pageViewKey?s.pageViewKey():"pageViews",be&&(l=sn(),c=rn(),p=c.id),x=Le(),k.next=10,i();case 10:if(y=k.sent,Or||(Or=!0,b=Ft(Sr),b&&(wt(y,b),Qr(Sr))),S=Qs(y),h=ta(n),f=Ys(h,l),m={Attributes:{},Demographic:f,Location:{},Metrics:{}},be&&(l.device&&l.device.vendor&&(m.Attributes.DeviceMake=[l.device.vendor]),l.device&&l.device.model&&(m.Attributes.DeviceModel=[l.device.model]),l.device&&l.device.type&&(m.Attributes.DeviceType=[l.device.type])),t=Ss.all([S,m,t],{arrayMerge:na}),!(t.User&&t.User.UserId)){k.next=23;break}return k.next=21,r();case 21:O=k.sent,t.User.UserId!==O&&(t.User.UserId=O);case 23:if(!(!t.User||!t.User.UserId)){k.next=28;break}return k.next=26,r();case 26:w=k.sent,w&&(t.User=t.User||{},t.User.UserId=w);case 28:if(!(t.User&&t.User.UserAttributes)){k.next=32;break}return k.next=31,Mt(t.User.UserAttributes,!0);case 31:t.User.UserAttributes=k.sent;case 32:return k.next=34,Mt(t.Attributes,!0);case 34:return t.Attributes=k.sent,k.next=37,pi(t.Metrics);case 37:if(t.Metrics=k.sent,t.Metrics[a]||(t.Metrics[a]=1),t.Metrics[u]||(t.Metrics[u]=1),o&&(t=o(y,t)),v=t.Attributes.lastSession,v){k.next=47;break}return t.Attributes.lastSessionDate=[x.createdAt],t.Attributes.lastSession=[x.id],p&&(t.Attributes.lastPageSession=[p]),k.abrupt("return",wt(y,t));case 47:return v&&v[0]!==x.id&&(t.Attributes.lastSessionDate=[x.createdAt],t.Attributes.lastSession=[x.id],t.Metrics[a]+=1),t.Attributes&&t.Attributes.lastPageSession&&Array.isArray(t.Attributes.lastPageSession)&&t.Attributes.lastPageSession.length>0&&t.Attributes.lastPageSession[0]!==p&&(t.Attributes.lastPageSession=[p],t.Metrics[u]+=1),k.abrupt("return",wt(y,t));case 50:case"end":return k.stop()}},e)})),$t.apply(this,arguments)}function wt(e,t){var n=ct(e),r=bs(t)?t:JSON.stringify(t);return Xo(n,r),t}function Qs(e){try{return JSON.parse(Ft(ct(e)))||{}}catch{}return{}}function Ys(e,t){return be?ea(e,t):Zs(e)}function Zs(e){var t={AppVersion:e,Make:"generic server",Platform:"Node.js",PlatformVersion:process.version};return t}function ea(e,t){var n={AppVersion:e,Locale:t.language,Make:t.make,Model:t.model,ModelVersion:t.version,Platform:t.os.name||t.platform};return t.os&&t.os.version&&(n.PlatformVersion=t.os.version),n}function ta(e){var t=e.appTitle||e.appPackageName||"",n=e.appVersionCode||"0.0.0";return t?"".concat(t,"@").concat(n):n}function na(e,t){return t}function ra(e){var t=e.getContext;return typeof t=="function"?t():t}function ia(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function(){var n=re(K.mark(function i(o){var s,a,u,c,p=arguments;return K.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return s=p.length>1&&p[1]!==void 0?p[1]:{},a=p.length>2&&p[2]!==void 0?p[2]:{},u=p.length>3&&p[3]!==void 0?p[3]:!1,cr(s)&&(s={},u=s),cr(a)&&(a={},u=a),l.next=7,Fs(o,s,t);case 7:if(c=l.sent,!(Object.entries(a).length||o===mi)){l.next=12;break}return l.next=11,an(a,t);case 11:a=l.sent;case 12:if(e.push(c),!u){l.next=17;break}return l.abrupt("return",e.flush());case 17:case"end":return l.stop()}},i)}));function r(i){return n.apply(this,arguments)}return r})()}var kr,oa=[429,500],sa=[202],aa=400;function ua(e,t){return Vt.apply(this,arguments)}function Vt(){return Vt=re(K.mark(function e(t,n){var r,i,o,s,a,u,c,p,l,x,y,b,S,h,f,m,O,w,v;return K.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return r=n.pinpointRegion,i=n.pinpointAppId,o=n.lambdaArn,s=n.lambdaRegion,a=n.credentials,u=n.getCredentials,c=n.debug,A.next=3,ca(a,u);case 3:return p=A.sent,c&&console.log("pinpoint auth",p),l=s||r,x=r||s,y=n.fips===!0?"-fips":"",b="https://lambda.".concat(l,".amazonaws.com/2015-03-31/functions/").concat(o,"/invocations"),S="https://pinpoint".concat(y,".").concat(x,".amazonaws.com/v1/apps/").concat(i,"/events"),h=o?b:S,O={body:JSON.stringify(t)},f=new _t(p),A.next=16,f.fetch(h,O).then(function(k){return k.json()});case 16:m=A.sent,A.next=24;break;case 19:return f=new kr.PinpointClient({credentials:p,region:r}),w=new kr.PutEventsCommand({ApplicationId:i,EventsRequest:t}),A.next=23,f.send(w);case 23:m=A.sent;case 24:return m&&m.Results&&(v=Object.keys(m.Results).map(function(k){return m.Results[k]}),v.forEach(function(k){var C=k.EndpointItemResponse||{},M=k.EventsItemResponse||{};Object.keys(C).length&&(sa.includes(C.StatusCode)||oa.includes(C.StatusCode)||la(C,Endpoint));var P=Object.keys(M);P.length&&P.forEach(function(z){})})),A.abrupt("return",m);case 26:case"end":return A.stop()}},e)})),Vt.apply(this,arguments)}function ca(e,t){return Wt.apply(this,arguments)}function Wt(){return Wt=re(K.mark(function e(t,n){var r,i;return K.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r=t,!(!Object.keys(r).length&&n)){o.next=11;break}return o.prev=2,o.next=5,n();case 5:r=o.sent,o.next=11;break;case 8:throw o.prev=8,o.t0=o.catch(2),new Error(o.t0);case 11:return i={accessKeyId:r.accessKeyId||r.AccessKeyId,secretAccessKey:r.secretAccessKey||r.SecretKey,sessionToken:r.sessionToken||r.SessionToken,retries:5},o.abrupt("return",i);case 13:case"end":return o.stop()}},e,null,[[2,8]])})),Wt.apply(this,arguments)}function la(e,t){var n=e.StatusCode,r=e.Message;if(n===aa){if(r.startsWith("Missing ChannelType"))throw new Error("Missing ChannelType");if(r.startsWith("Exceeded maximum endpoint per user count"))throw new Error("Exceeded maximum endpoint per user count")}}var fa=["PUSH","GCM","APNS","APNS_SANDBOX","APNS_VOIP","APNS_VOIP_SANDBOX","ADM","SMS","VOICE","EMAIL","BAIDU","CUSTOM"],xt=fa.reduce(function(e,t){return e[t]=t,e},{}),da=sn(),Ar=zt,Ir=ut,pa=/.+\@.+\..+/;function ga(e){return pa.test(e)}function ha(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.getEndpointId,n=e.debug;return(function(){var r=re(K.mark(function o(){var s,a,u,c,p,l,x,y,b,S,h=arguments;return K.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=h.length>0&&h[0]!==void 0?h[0]:[],a=h.length>1&&h[1]!==void 0?h[1]:{},f.next=4,t();case 4:if(u=f.sent,u){f.next=8;break}return console.error("No endpoint id. check getEndpointId()"),f.abrupt("return");case 8:if(c=te(a)==="object"&&Object.keys(a).length,c){f.next=13;break}f.t0=ma(u),f.next=16;break;case 13:return f.next=15,an(a,e);case 15:f.t0=f.sent;case 16:return p=f.t0,l=p.ChannelType,p.Address&&ga(p.Address)&&(l=xt.EMAIL),!l&&p.Address&&(da.platform==="android"?l=l||xt.GCM:l=l||xt.APNS),n&&(console.log("Endpoint",p),console.log("CHANNEL_TYPE",l)),p.RequestId=xe(),p.ChannelType=l,p.Address&&(p.OptOut=p.OptOut||"NONE"),x=ya(s),y=va(u,p,x),f.prev=26,f.next=29,ua(y,e);case 29:b=f.sent,f.next=36;break;case 32:f.prev=32,f.t1=f.catch(26),console.log("Error calling AWS",f.t1),S=f.t1;case 36:return f.abrupt("return",{endpoint:p,response:b,error:S,events:s});case 37:case"end":return f.stop()}},o,null,[[26,32]])}));function i(){return r.apply(this,arguments)}return i})()}function ma(e){try{return JSON.parse(Ft(ct(e)))||{}}catch{}return{}}function ya(e){return e.sort(function(t,n){var r=t.EventType,i=n.EventType;if(r==Ar)return-1;if(i==Ar||r==Ir)return 1;if(i==Ir)return-1}).reduce(function(t,n){return J(J({},n),t)},{})}function va(e,t,n){return{BatchItem:tn({},e,{Endpoint:t,Events:n})}}var ba=ut;function yi(){return{}}function wa(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=J({getContext:e.getContext||yi,credentials:e.credentials||{},getEndpointId:e.getEndpointId},e),n=t.debug?console.log:function(){},r=ha(t),i=hs((function(){var u=re(K.mark(function c(p,l){var x;return K.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return p.forEach(function(b){return n("> Queue event",b)}),y.next=3,r(p,{});case 3:x=y.sent,n("> Queue response",x);case 5:case"end":return y.stop()}},c)}));return function(c,p){return u.apply(this,arguments)}})(),{max:10,interval:e.flushInterval||3e3,throttle:!0}),o=ia(i,t);an({},e);var s=xa(o);function a(u){return r([],u)}return{updateEndpoint:a,recordEvent:o,disable:function(){s()}}}function xa(e){if(!be)return yi;var t=Sa(e);return window.addEventListener("beforeunload",t),function(){return window.removeEventListener("beforeunload",t)}}function Sa(e){return function(){e(ba,!0)}}function St(){throw new Error("Pinpoint not loaded")}function Oa(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return typeof r=="number"&&(t.metrics[n]=r),(typeof r=="string"||typeof r=="boolean")&&(t.attributes[n]=r),t},{attributes:{},metrics:{}})}function ka(e){var t=e.config,n=e.instance;t&&t.disableAnonymousTraffic&&!n.user("userId")&&n.once("identifyStart",function(r){var i=r.plugins,o=i["aws-pinpoint"];o.loaded()||n.loadPlugin("aws-pinpoint")})}var Aa={disableAnonymousTraffic:!1,pinpointRegion:"us-east-1",eventMapping:{}};function Ia(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t,n,r=!1;function i(){var s=Le();e.debug&&console.log("Stop session",s),t(ut,!0)}function o(){var s=Ze(30);e.debug&&console.log("START SESSION",s),t(zt)}return{name:"aws-pinpoint",config:J(J({},Aa),e),bootstrap:ka,initialize:function(s){var a=s.config,u=s.instance,c=a.disableAnonymousTraffic,p=a.debug,l=p?console.log:function(){},x=u.getState(),y=x.user||{},b=y.userId,S=y.anonymousId,h=x.context||{},f=h.app,m=h.version,O=h.campaign,w=rn(),v=ui(),A=Le();if(l("initPageSession",w),l("initTabSession",v),l("initSessionData",A),A&&A.anonId&&A.anonId!==S){l("anonId different refresh session details"),ur(),vs();var k=Ze(30,{anonId:S,userId:b});l("newSessionForNewUser",k)}if(!b&&c)return!1;var C=Object.keys(O).reduce(function(U,q){return U["utm_".concat(q)]=O[q],U},{}),M=wa(J(J({},a),{},{appTitle:a.appTitle||f,appPackageName:a.appPackageName||f,appVersionCode:a.appVersionCode||m,eventMapping:a.eventMapping,getEndpointId:function(){return u.user("anonymousId")},getUserId:function(){return u.user("userId")},getContext:function(){return{sessionKey:a.sessionKey,pageViewKey:a.pageViewKey,initialSession:A}},enrichEventAttributes:function(){return J({anonId:u.user("anonymousId"),userId:u.user("userId"),hash:window.location.hash,path:window.location.pathname,referrer:document.referrer,search:window.location.search,title:document.title,host:window.location.hostname,url:window.location.origin+window.location.pathname},C)},enrichUserAttributes:a.enrichUserAttributes,enrichEventMetrics:function(){return{}}}));t=M.recordEvent,n=M.updateEndpoint,A&&A.isNew&&(l("Start brand new session because cookie not found"),t(zt));var P=18e5,z=P;_s({timeout:z,throttle:2e4,onIdle:function(U,q){l("Session idle. Active ".concat(U," seconds")),i()},onWakeUp:function(U,q){l("Session wakeup. Idle ".concat(U," seconds")),o()},onHeartbeat:function(U,q){l("ping session",new Date),l("total active time",U);var $=u.user();ys(30,{anonId:$.anonymousId,userId:$.userId})}})},page:function(s){if(s.payload,s.config,!t)return St();r&&ur(),t(mi),r=!0},track:function(s){var a=s.payload,u=s.config;if(s.instance,!t)return St();if(!(u.disableAnonymousTraffic&&!a.userId)){var c=Oa(a.properties);t(a.event,c)}},identify:function(s){var a=s.payload,u=a.userId,c=a.traits;if(!n)return St();var p={},l={};u&&(l.UserId=u),c&&Object.keys(c).length&&(l.UserAttributes=c),Object.keys(l).length&&(p.User=l),n(p,!0)},reset:function(s){var a=s.instance,u=a.user("anonymousId"),c=ct(u);Qr(c)},loaded:function(){return!!t}}}var Ea=Ia;function vi(e){return Object.keys(e).some(t=>{let n=e[t];if(!n)return!1;switch(n&&n.toParam&&(n=n.toParam()),n.constructor.name){case"Array":return!1;case"Object":return!1;case"Date":return!1;case"Function":return!1;case"Boolean":return!1;case"String":return!1;case"Number":return!1;default:return!0}})}function bi(e){let t={};return Object.keys(e).forEach(n=>{var r,i;let o=e[n];if(o&&o.toParam&&(o=o.toParam()),!o&&o!==0&&typeof o!="boolean"&&typeof o!="string")return;let s=o.constructor.name,a;switch(s){case"Array":let u=(i=(r=o[0])===null||r===void 0?void 0:r.constructor)===null||i===void 0?void 0:i.name;a=u==="Array"?o:u==="Object"?JSON.stringify(o):o.join(",");break;case"Object":a=JSON.stringify(o);break;case"Date":a=o.valueOf();break;case"Function":a=null;break;case"Boolean":a=o+"";break;default:a=o;break}(a||a===0||typeof a=="string"||Array.isArray(a))&&(t[n]=a)}),t}function wi(e,t){return Array.isArray(t)&&t[0]&&Array.isArray(t[0])?t.map(n=>wi(e,n)).join("&"):encodeURIComponent(e)+"="+encodeURIComponent(t)}function xi(e){let t=bi(e);return Object.keys(t).map(n=>wi(n,t[n])).join("&")}var Pa=globalThis.FormData;function ja(e,t){let n=vi(e)||t,r=bi(e);if(n){let i=new Pa;return Object.keys(r).forEach(o=>{if(typeof Blob<"u"&&r[o]instanceof Blob){let s=r.fileName||r[o].name||o;i.append(o,r[o],s)}else i.append(o,r[o])}),i}else return xi(e)}var de=class extends Error{constructor(t,n,r,i,o){super(t);let s=new.target.prototype;Object.setPrototypeOf(this,s),t=t||"UNKNOWN_ERROR",n=n||"UNKNOWN_ERROR_CODE",this.name="ArcGISRequestError",this.message=n==="UNKNOWN_ERROR_CODE"?t:`${n}: ${t}`,this.originalMessage=t,this.code=n,this.response=r,this.url=i,this.options=o}},Ta={noCorsDomains:[],crossOriginNoCorsDomains:{},pendingNoCorsRequests:{}},qt="ARCGIS_REST_JS_NO_CORS";globalThis[qt]||(globalThis[qt]=Object.assign({},Ta));var Y=globalThis[qt];function Na(e){let t=new URL(e);e=t.origin+t.pathname,t.search.includes("f=json")&&(e+="?f=json");let n=t.origin;return Y.pendingNoCorsRequests[n]||(Y.pendingNoCorsRequests[n]=fetch(e,{mode:"no-cors",credentials:"include",cache:"no-store"}).then(r=>{Y.noCorsDomains.indexOf(n)===-1&&Y.noCorsDomains.push(n),Y.crossOriginNoCorsDomains[n.toLowerCase()]=Date.now(),delete Y.pendingNoCorsRequests[n]}).catch(r=>(delete Y.pendingNoCorsRequests[n],Promise.reject(new Error(`no-cors request to ${n} failed`))))),Y.pendingNoCorsRequests[n]}function _a(e){e.forEach(t=>{t=t.toLowerCase(),/^https?:\/\//.test(t)?Ot(t):(Ot("http://"+t),Ot("https://"+t))})}function Ot(e){let t=new URL(e).origin;Y.noCorsDomains.indexOf(t)===-1&&Y.noCorsDomains.push(t)}function Si(e){let t=!1;if(Y.noCorsDomains.length){let n=new URL(e).origin.toLowerCase();t=Y.noCorsDomains.some(r=>n.includes(r))}return t}function Ca(e){let t=!1;if(Si(e)){let n=new URL(e).origin.toLowerCase(),r=Y.crossOriginNoCorsDomains[n]||0;Date.now()-60*6e4>r&&(t=!0)}return t}function Ma(e){console&&console.warn&&console.warn.apply(console,[e])}function Ua(){return Promise.resolve({fetch:globalThis.fetch,Headers:globalThis.Headers,Response:globalThis.Response,Request:globalThis.Request})}function Da(e,t){var n;if(!t&&!window||!e)return!1;{t=t||window;let r=(n=t.location)===null||n===void 0?void 0:n.origin;return e.startsWith(r)}}var Ra="@esri/arcgis-rest-js";function za(){return globalThis.DEFAULT_ARCGIS_REQUEST_OPTIONS||{httpMethod:"POST",params:{f:"json"}}}var tt=class extends de{constructor(t="AUTHENTICATION_ERROR",n="AUTHENTICATION_ERROR_CODE",r,i,o){super(t,n,r,i,o),this.name="ArcGISAuthError",this.message=n==="AUTHENTICATION_ERROR_CODE"?t:`${n}: ${t}`;let s=new.target.prototype;Object.setPrototypeOf(this,s)}retry(t,n=1){let r=0,i=(o,s)=>{r=r+1,t(this.url,this.options).then(a=>{let u=Object.assign(Object.assign({},this.options),{authentication:a});return Oi(this.url,u)}).then(a=>{o(a)}).catch(a=>{a.name==="ArcGISAuthError"&&r<n?i(o,s):a.name===this.name&&a.message===this.message&&r>=n?s(this):s(a)})};return new Promise((o,s)=>{i(o,s)})}};function La(e,t,n,r,i){if(e.code>=400){let{message:o,code:s}=e;throw new de(o,s,e,t,r)}if(e.error){let{message:o,code:s,messageCode:a}=e.error,u=a||s||"UNKNOWN_ERROR_CODE";throw s===498||s===499?i||new tt(o,u,e,t,r):new de(o,u,e,t,r)}if(e.status==="failed"||e.status==="failure"){let o,s="UNKNOWN_ERROR_CODE";try{o=JSON.parse(e.statusMessage).message,s=JSON.parse(e.statusMessage).code}catch{o=e.statusMessage||e.message}throw new de(o,s,e,t,r)}return e}function Oi(e,t){let n=za(),r=Object.assign(Object.assign(Object.assign({httpMethod:"POST"},n),t),{params:Object.assign(Object.assign({},n.params),t.params),headers:Object.assign(Object.assign({},n.headers),t.headers)}),{httpMethod:i,rawResponse:o}=r,s=Object.assign({f:"json"},r.params),a=null,u={method:i,signal:r.signal,credentials:r.credentials||"same-origin"};Si(e)&&(u.credentials="include"),r.headers&&r.headers["X-Esri-Auth-Client-Id"]&&e.indexOf("/oauth2/platformSelf")>-1&&(u.credentials="include");let c;if(typeof r.authentication=="string"){let b=r.authentication;c={portal:"https://www.arcgis.com/sharing/rest",getToken:()=>Promise.resolve(b)},!r.authentication.startsWith("AAPK")&&!r.authentication.startsWith("AAPT")&&!r.authentication.startsWith("AATK")&&!r.authentication.startsWith("AAST")&&!r.suppressWarnings&&!globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING&&(Ma("Using an oAuth 2.0 access token directly in the token option is discouraged. Consider using ArcGISIdentityManager or Application session. See https://esriurl.com/arcgis-rest-js-direct-token-warning for more information."),globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING=!0)}else c=r.authentication;let p=e,l=!1;typeof window<"u"&&(l=Da(e));let x=!l&&Ca(e);r.headers&&r.headers["X-Esri-Auth-Client-Id"]&&e.indexOf("/oauth2/platformSelf")>-1&&(u.credentials="include");let y=Promise.resolve();return x&&(u.credentials="include",y=Na(e)),y.then(()=>c?c.getToken(e).catch(b=>(b.url=e,b.options=r,a=b,Promise.resolve(""))):Promise.resolve("")).then(b=>{b.length&&(s.token=b),c&&c.getDomainCredentials&&(u.credentials=c.getDomainCredentials(e));let S={};if(u.method==="GET"){s.token&&r.hideToken&&typeof window>"u"&&(S["X-Esri-Authorization"]=`Bearer ${s.token}`,delete s.token);let f=xi(s),m=f===""?e:`${e}?${f}`;r.maxUrlLength&&m.length>r.maxUrlLength||!r.maxUrlLength&&m.length>2e3||s.token&&r.hideToken?(u.method="POST",b.length&&r.hideToken&&(s.token=b,delete S["X-Esri-Authorization"])):e=m}let h=new RegExp("/items/.+/updateResources").test(e);return u.method==="POST"&&(u.body=ja(s,h)),u.headers=Object.assign(Object.assign({},S),r.headers),(typeof window>"u"||window&&typeof window.document>"u")&&!u.headers.referer&&(u.headers.referer=Ra),!vi(s)&&!h&&(u.headers["Content-Type"]="application/x-www-form-urlencoded"),globalThis.fetch?globalThis.fetch(e,u):Ua().then(({fetch:f})=>f(e,u))}).then(b=>{if(!b.ok)return b.json().then(S=>{let{status:h,statusText:f}=b,{message:m,details:O}=S.error,w=`${m}. ${O?O.join(" "):""}`.trim();throw new de(w,`HTTP ${h} ${f}`,S,e,r)}).catch(S=>{if(S.name==="ArcGISRequestError")throw S;let{status:h,statusText:f}=b;throw new de(f,`HTTP ${h}`,b,e,r)});if(o)return console.warn("rawResponse option is deprecated and will be removed in ArcGIS REST JS v5.0."),b;switch(s.f){case"json":return b.json();case"geojson":return b.json();case"html":return b.text();case"text":return b.text();default:return b.blob()}}).then(b=>{if((s.f==="json"||s.f==="geojson")&&!o){let S=La(b,p,s,r,a);if(b&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(e)&&Array.isArray(b.authorizedCrossOriginNoCorsDomains)&&_a(b.authorizedCrossOriginNoCorsDomains),a){let h=e.toLowerCase().split(/\/rest(\/admin)?\/services\//)[0];r.authentication.federatedServers[h]={token:[],expires:new Date(Date.now()+86400*1e3)},a=null}return S}else return b})}function ki(e,t={params:{f:"json"}}){let{request:n}=t,r=Gt(t,["request"]);return n?n(e,r):Oi(e,r).catch(i=>i instanceof tt&&t.authentication&&typeof t.authentication!="string"&&t.authentication.canRefresh&&t.authentication.refreshCredentials?i.retry(()=>t.authentication.refreshCredentials(),1):Promise.reject(i))}function $a(e){return typeof e!="string"||(e=e.trim(),e[e.length-1]==="/"&&(e=e.slice(0,-1))),e}function Re(e={}){return e.portal?$a(e.portal):e.authentication&&typeof e.authentication!="string"?e.authentication.portal:"https://www.arcgis.com/sharing/rest"}function Va(e){return e.owner?Promise.resolve(e.owner):e.item&&e.item.owner?Promise.resolve(e.item.owner):e.authentication&&e.authentication.getUsername?e.authentication.getUsername():Promise.reject(new Error("Could not determine the owner of this item. Pass the `owner`, `item.owner`, or `authentication` option."))}function Wa(e){return Array.isArray(e)&&Array.isArray(e[0])&&Array.isArray(e[1])}function qa(e){return e.join(",")}function Ai(e,t,n){if(!e)return e;let r=null;return typeof e.thumbnail=="string"&&(r=`${t}/content/items/${e.id}/info/${e.thumbnail}`,r&&e.access!=="public"&&n&&(r+=`?${n}`)),Object.assign(Object.assign({},e),r?{thumbnailUrl:r}:{})}function Ha(e){return Va(e).then(t=>{let n=e.folderId?`${Re(e)}/content/users/${t}/${e.folderId}/items/${e.item.id}/update`:`${Re(e)}/content/users/${t}/items/${e.item.id}/update`;e.params=Object.assign(Object.assign({},e.params),e.item),e.params.extent&&Wa(e.params.extent)&&(e.params.extent=qa(e.params.extent));let r=Re(e),i=Ai(Object.assign(Object.assign({},e.item),{access:e.item.access}),r),o=e.params.thumbnailUrl;return typeof i.thumbnailUrl=="string"&&typeof o=="string"&&i.thumbnailUrl.split("?")[0]===o.split("?")[0]&&delete e.params.thumbnailUrl,ki(n,e)})}function Ii(e,t){let n=Ka(e,t),r=Object.assign({httpMethod:"GET"},t);return ki(n,r).then(async i=>{let o=t?.portal||Re(t),s;return t?.authentication&&typeof t.authentication!="string"&&i.access!=="public"&&(s=await t.authentication.getToken(n)),Ai(i,o,s)})}var Ka=(e,t)=>`${typeof t=="string"?t:Re(t)}/content/items/${e}`;function Ga(e,t,n){return n.reduce((r,i)=>{let{action:o,targetProperty:s}=i;return o==="add"?r[s]={updatedAt:new Date,updatedBy:e}:o==="remove"&&delete r[s],r},t)}async function Ja({id:e,authentication:t,username:n,accessChangeset:r}){let{properties:i={}}=await Ii(e,{authentication:t}),o=i.telemetry,s=o===void 0?{}:o,{arcgis:{access:a={}}={}}=s,u=Gt(s,["arcgis"]),c=Ga(n,a,r);return Ha({item:{id:e,properties:Object.assign(Object.assign({},i),{telemetry:Object.assign(Object.assign({},u),{arcgis:{access:Object.assign({},c)}})})},authentication:t})}async function Xa({id:e,authentication:t}){let{properties:{telemetry:{arcgis:{access:n={}}={}}={}}}=await Ii(e,{authentication:t});return{access:n}}var Ht=class{constructor(t){this.name="amazon",this.isInitialized=!1;let{app:n={},fips:r,userPoolID:i}=t;this.analytics=os({app:n.name,version:n.version,plugins:[Ea({fips:r,pinpointAppId:n.id,getCredentials:()=>Wi(i,{fips:r})})]}),Object.assign(this,t)}init(){if(!this.isInitialized)return this.isInitialized=!0,Promise.resolve()}static async setAccessPermissions({id:t,authentication:n,username:r,accessChangeset:i}){return Ja({id:t,authentication:n,username:r,accessChangeset:i})}static async getAccessPermissions({id:t,authentication:n}){return Xa({id:t,authentication:n})}logPageView(t,n){let r=Xi({page:t,previousPage:this.previousPage,options:n,dimensionLookup:this.dimensions,metricLookup:this.metrics}),{pageUrl:i,pageName:o}=r;this.previousPage={pageUrl:i,pageName:o},this.analytics.track("pageView",r)}logEvent(t={}){let n=Ji({event:t,dimensionLookup:this.dimensions,metricLookup:this.metrics}),{name:r}=n;this.analytics.track(r,n)}},Fa=cn`:host{display:block}`,Kt=class extends fn{constructor(){super(...arguments),this.amazonAppId="",this.amazonAppName="",this.amazonUserPoolID="",this.amazonVersion="",this.firstUseVar="",this.measurementIds=[],this._open=!1,this._translations=pn({name:"consent-manager",blocking:!0}),this._loaded=!1,this.consentGranted=ln()}static{this.properties={amazonAppId:1,amazonAppName:1,amazonUserPoolID:1,amazonVersion:1,firstUseVar:1,measurementIds:0,portal:0,_open:16,_translations:16}}static{this.styles=Fa}async getInstance(){if(localStorage.getItem(this.firstUseVar)==="true"||this.portal?.eueiEnabled)return await this._init(),this._telemetryInstance}async load(){this._open=localStorage.getItem(this.firstUseVar)===null}render(){return""}loaded(){this.consentGranted.emit({granted:localStorage.getItem(this.firstUseVar)==="true"})}async _init(){if(!this._loaded){let t={info:console.info.bind(console),error:console.error.bind(console),warn:(r,...i)=>{(!r.includes("non-primitive value")||!r.includes("userSince"))&&console.warn(r,...i)}},n={plugins:[],portal:this.portal,logger:t};if(this.measurementIds?.length>0){let r=new At({measurementIds:this.measurementIds});n.plugins.push(r)}if(this.amazonUserPoolID){let r=new Ht({userPoolID:this.amazonUserPoolID,app:{name:this.amazonAppName,id:this.amazonAppId,version:this.amazonVersion}});n.plugins.push(r)}this._telemetryInstance=new kt(n),await this._telemetryInstance.init(),this._loaded=!0}}_alertClosed(){this._open=!1,localStorage.getItem(this.firstUseVar)!=="true"&&localStorage.setItem(this.firstUseVar,"false")}_accept(){localStorage.setItem(this.firstUseVar,"true"),this.consentGranted.emit({granted:!0}),this._open=!1}};dn("consent-manager",Kt);export{Kt as ConsentManager};
7
+ `)}async hexBodyHash(){let t=this.headers.get("X-Amz-Content-Sha256")||(this.service==="s3"&&this.signQuery?"UNSIGNED-PAYLOAD":null);if(t==null){if(this.body&&typeof this.body!="string"&&!("byteLength"in this.body))throw new Error("body must be a string, ArrayBuffer or ArrayBufferView, unless you include the X-Amz-Content-Sha256 header");t=vt(await fr(this.body||""))}return t}};async function _e(e,t){let n=await crypto.subtle.importKey("raw",typeof e=="string"?Nt.encode(e):e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return crypto.subtle.sign("HMAC",n,Nt.encode(t))}async function fr(e){return crypto.subtle.digest("SHA-256",typeof e=="string"?Nt.encode(e):e)}var dr=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function vt(e){let t=new Uint8Array(e),n="";for(let r=0;r<t.length;r++){let i=t[r];n+=dr[i>>>4&15],n+=dr[i&15]}return n}function pr(e){return e.replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}function As(e,t){let{hostname:n,pathname:r}=e;if(n.endsWith(".on.aws")){let a=n.match(/^[^.]{1,63}\.lambda-url\.([^.]{1,63})\.on\.aws$/);return a!=null?["lambda",a[1]||""]:["",""]}if(n.endsWith(".r2.cloudflarestorage.com"))return["s3","auto"];if(n.endsWith(".backblazeb2.com")){let a=n.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);return a!=null?["s3",a[1]||""]:["",""]}let i=n.replace("dualstack.","").match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/),o=i&&i[1]||"",s=i&&i[2];if(s==="us-gov")s="us-gov-west-1";else if(s==="s3"||s==="s3-accelerate")s="us-east-1",o="s3";else if(o==="iot")n.startsWith("iot.")?o="execute-api":n.startsWith("data.jobs.iot.")?o="iot-jobs-data":o=r==="/mqtt"?"iotdevicegateway":"iotdata";else if(o==="autoscaling"){let a=(t.get("X-Amz-Target")||"").split(".")[0];a==="AnyScaleFrontendService"?o="application-autoscaling":a==="AnyScaleScalingPlannerFrontendService"&&(o="autoscaling-plans")}else s==null&&o.startsWith("s3-")?(s=o.slice(3).replace(/^fips-|^external-1/,""),o="s3"):o.endsWith("-fips")?o=o.slice(0,-5):s&&/-\d$/.test(o)&&!/-\d$/.test(s)&&([o,s]=[s,o]);return[Os[o]||o,s||""]}var on="Event",gr=on+"Listener";function Is(e){return function(t,n,r,i){var o=r||no,s=i||!1;if(!Z)return o;var a=et(n),u=et(t,!0);if(!u.length)throw new Error("noElements");if(!a.length)throw new Error("no"+on);var c=[];return(function p(l){l&&(c=[]);for(var x=l?"add"+gr:"remove"+gr,y=0;y<u.length;y++){var b=u[y];c[y]=l?s&&s.once?Es(o):o:c[y]||o;for(var S=0;S<a.length;S++)b[x]?b["on"+a[S]]=l?c[y]:null:b[x](a[S],c[y],s)}return p.bind(null,!l)})(e)}}function et(e,t){if(le(e))return t?et(document.querySelectorAll(e)):(n=e).split(n.indexOf(",")>-1?",":" ").map(function(s){return s.trim()});var n;if(NodeList.prototype.isPrototypeOf(e)){for(var r=[],i=e.length>>>0;i--;)r[i]=e[i];return r}var o=yo(e);return t?o.map(function(s){return le(s)?et(s,!0):s}).flat():o}function Es(e,t){var n;return function(){return e&&(n=e.apply(this,arguments),e=null),n}}var bt=Is(on);function ci(e,t){return Z&&ee(window[e])?(n=window[e],r=t,(i=window)===void 0&&(i=null),ee(n)?function(){n.apply(i,arguments),r.apply(i,arguments)}:r):window[e]=t;var n,r,i}ci.bind(null,"onerror");ci.bind(null,"onload");var li=typeof window>"u",hr="hidden";function Ps(e){if(li)return!1;var t=js(),n="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),r=function(){return e(!!document[t])},i=function(){return document.addEventListener(n,r)};return i(),function(){return document.removeEventListener(n,r),i}}function js(){var e=["webkit","moz","ms","o"];return li||hr in document?hr:e.reduce(function(t,n){var r=n+"Hidden";return!t&&r in document?r:t},null)}var Ts=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Ns(e,t){t===void 0&&(t={});var n=(function(s,a){var u=this,c=!1;return function(p){c||(s.call(u,p),c=!0,setTimeout(function(){return c=!1},a))}})(e,t.throttle||1e4),r=[];function i(){var s=Ps(function(a){a||n({type:"tabVisible"})});return r=[s].concat(Ts.map(function(a){return bt(document,a,n)})).concat(bt(window,"load",n)).concat(bt(window,"scroll",n,{capture:!0,passive:!0})),o}function o(){r.map(function(s){return s()})}return i(),function(){return o(),i}}function _s(e){var t,n,r=e.onIdle,i=e.onWakeUp,o=e.onHeartbeat,s=e.timeout,a=s,u=e.throttle,c=u,p=!1,l=!1,x=new Date,y=function(){return clearTimeout(t)};function b(h){y(),o&&!p&&o(Ce(x),h),i&&p&&(p=!1,i(Ce(n),h),x=new Date),t=setTimeout(function(){p=!0,r&&(n=new Date,r(Ce(x),h))},a)}var S=Ns(b,{throttle:c});return{disable:function(){l=!0,p=!1,y();var h=S();return function(){return l=!1,x=new Date,b({type:"load"}),h()}},getStatus:function(){return{isIdle:p,isDisabled:l,active:p?0:Ce(x,l),idle:p?Ce(n,l):0}}}}function Ce(e,t){return t?0:Math.round((new Date-e)/1e3)}var fi="object",Cs="string",mr="?",F="name",B="version",Ms="",yr="function",Us="undefined",Ds="BlackBerry",Rs="Chrome",zs="Firefox",vr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ls=[[/microsoft (windows) (vista|xp)/i],[F,B],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[F,[B,br,vr]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[F,"Windows"],[B,br,vr]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[B,/_/g,"."],[F,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[F,"MacOS"],[B,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[B,F],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[F,B],[/\(bb(10);/i],[B,[F,Ds]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[B,[F,zs+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[B,[F,"webOS"]],[/crkey\/([\d\.]+)/i],[B,[F,Rs+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[F,"Chromium OS"],B],[/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/(unix) ?([\w\.]*)/i],[F,B]];function $s(e,t){for(var n=0,r,i,o,s,a,u;n<t.length&&!a;){var c=t[n],p=t[n+1];for(r=i=0;r<c.length&&!a;)if(a=c[r++].exec(e),a)for(o=0;o<p.length;o++)u=a[++i],s=p[o],te(s)===fi&&s.length>0?s.length==2?te(s[1])==yr?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:s.length==3?te(s[1])===yr&&!(s[1].exec&&s[1].test)?this[s[0]]=u?s[1].call(this,u,s[2]):void 0:this[s[0]]=u?u.replace(s[1],s[2]):void 0:s.length==4&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):void 0):this[s]=u||void 0;n+=2}}function br(e,t){for(var n in t)if(te(t[n])===fi&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(wr(t[n][r],e))return n===mr?void 0:n}else if(wr(t[n],e))return n===mr?void 0:n;return e}function wr(e,t){return te(e)===Cs?xr(t).indexOf(xr(e))!==-1:!1}function xr(e){return e.toLowerCase()}function Vs(e){var t=(typeof window>"u"?"undefined":te(window))!==Us&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:Ms,n={};return n[F]=void 0,n[B]=void 0,$s.call(n,t,Ls),n}var di="Brave";function sn(){if(typeof window>"u")return{};if(!window.navigator)return{};var e=window.navigator,t=e.platform,n=e.product,r=e.vendor,i=Hs(window.navigator),o=i.type,s=i.version,a=o===di?o:(r||"").split(" ")[0];return{platform:t,os:Vs(),make:a||n,model:o,version:s,name:[o,s].join("/"),language:Ws(),timezone:qs()}}function Ws(){var e=window.navigator,t=e.language,n=e.browserLanguage,r=e.languages;return(t||n||(r||["en_US"])[0]).toLowerCase().replace("-","_")}function qs(){var e=/\(([A-Za-z\s].*)\)/.exec(new Date().toString());return e&&e[1]||""}function Hs(e){var t=e.userAgent,n=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(t);if(n)return{type:n[1],version:n[2]};var r=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(t);if(r)return{type:r[1],version:r[2]};var i=/(headlesschrome)(?:\/([\w\.]+)| )/i.exec(t);if(i)return{type:i[1],version:i[2]};var o=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(t);if(o){var s=e.brave&&e.brave.isBrave||!1;return{type:s?di:o[1],version:o[2]}}var a=/.+(Safari)\/([0-9\.]+).*/i.exec(t);if(a)return{type:a[1],version:a[2]};var u=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(t);if(u)return{type:u[1],version:u[2]};var c=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(t),p=c||["","NA","0.0.0"];return{type:p[1],version:p[2]}}function Ks(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t[e]||e}function Mt(e){return Ut.apply(this,arguments)}function Ut(){return Ut=re(K.mark(function e(t){var n,r,i,o,s,a,u=arguments;return K.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:n=u.length>1&&u[1]!==void 0?u[1]:!1,r={},c.t0=K.keys(t);case 3:if((c.t1=c.t0()).done){c.next=13;break}return i=c.t1.value,o=Array.isArray(t[i])?t[i]:[t[i]],s=n?o:o[0],c.next=9,gi(s,Gs);case 9:a=c.sent,hi(a)||(r[i]=a),c.next=3;break;case 13:return c.abrupt("return",r);case 14:case"end":return c.stop()}},e)})),Ut.apply(this,arguments)}function pi(e){return Dt.apply(this,arguments)}function Dt(){return Dt=re(K.mark(function e(t){var n,r;return K.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:n={},i.t0=K.keys(t);case 2:if((i.t1=i.t0()).done){i.next=9;break}return r=i.t1.value,i.next=6,gi(t[r],Js);case 6:n[r]=i.sent,i.next=2;break;case 9:return i.abrupt("return",n);case 10:case"end":return i.stop()}},e)})),Dt.apply(this,arguments)}function gi(e,t){return Rt.apply(this,arguments)}function Rt(){return Rt=re(K.mark(function e(t,n){return K.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(typeof t!="function"){r.next=4;break}return r.next=3,t();case 3:t=r.sent;case 4:return r.abrupt("return",n(t));case 5:case"end":return r.stop()}},e)})),Rt.apply(this,arguments)}function Gs(e){if(e!=null)return Array.isArray(e)?e.filter(Xs).map(function(t){return t.toString()}):hi(e)?e:e.toString()}function Js(e){return parseFloat(Number(Array.isArray(e)?e[0]:e))}function Xs(e){return e!==null&&typeof e<"u"}function hi(e){return e==null}var zt="_session.start",ut="_session.stop",mi="pageView";function Fs(e){return Lt.apply(this,arguments)}function Lt(){return Lt=re(K.mark(function e(t){var n,r,i,o,s,a,u,c,p,l,x,y,b,S,h,f,m,O,w,v,A,k,C,M,P,z,U,q,$,E,H,D=arguments;return K.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(n=D.length>1&&D[1]!==void 0?D[1]:{},r=D.length>2&&D[2]!==void 0?D[2]:{},i=r.appTitle,o=r.appPackageName,s=r.appVersionCode,a=r.eventMapping,u=r.enrichEventAttributes,c=r.enrichEventMetrics,p=r.debug,l=p?console.log:function(){},x=Ks(t,a),y=Le(),b=n.sessionId||y.id,S=n.sessionStart||y.createdAt,h=n.sessionStart?new Date(n.sessionStart).getTime():y.created,l("event sessionData ",JSON.stringify(y)),be&&(f=rn(),m=ui(),l("event pageSessionInfo",JSON.stringify(f)),l("event tabSessionData ",JSON.stringify(m))),O=n.attributes||{},w=n.eventId||xe(),v=n.time?new Date(n.time):new Date,A=v.toISOString(),k=v.getTime()-h,C=J({date:A,sessionId:b},be?{pageSession:f.id}:{}),!u){N.next=23;break}return N.next=20,u();case 20:N.t0=N.sent,N.next=24;break;case 23:N.t0={};case 24:if(M=N.t0,P=J(J(J({},C),M),O),z=n.metrics||{},U={sessionTime:y.elapsed||k,hour:v.getHours(),day:v.getDay()+1,month:v.getMonth()+1,year:v.getFullYear()},!c){N.next=34;break}return N.next=31,c();case 31:N.t1=N.sent,N.next=35;break;case 34:N.t1={};case 35:return q=N.t1,$=J(J(J({},U),q),z),N.next=39,Mt(P);case 39:return N.t2=N.sent,N.next=42,pi($);case 42:return N.t3=N.sent,E={attributes:N.t2,metrics:N.t3},l("".concat(w,":").concat(x)),l("eventAttributes",E.attributes),l("eventMetrics",E.metrics),be&&l("clientInfo",sn()),H=tn({},w,J(J({EventType:x,Timestamp:A,AppPackageName:o,AppTitle:i},s?{AppVersionCode:s}:{}),{},{Attributes:E.attributes,Metrics:E.metrics,Session:{Id:b,StartTimestamp:S}})),t===ut&&(H[w].Session.Duration=k,H[w].Session.StopTimestamp=A),N.abrupt("return",H);case 51:case"end":return N.stop()}},e)})),Lt.apply(this,arguments)}var Bs="__endpoint";function ct(e){return"".concat(Bs,".").concat(e)}var Sr="__endpoint",Or=!1;function an(){return $t.apply(this,arguments)}function $t(){return $t=re(K.mark(function e(){var t,n,r,i,o,s,a,u,c,p,l,x,y,b,S,h,f,m,O,w,v,A=arguments;return K.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return t=A.length>0&&A[0]!==void 0?A[0]:{},n=A.length>1&&A[1]!==void 0?A[1]:{},r=n.getUserId,i=n.getEndpointId,o=n.endpointMigration,s=ra(n),a=s.sessionKey?s.sessionKey():"sessions",u=s.pageViewKey?s.pageViewKey():"pageViews",be&&(l=sn(),c=rn(),p=c.id),x=Le(),k.next=10,i();case 10:if(y=k.sent,Or||(Or=!0,b=Ft(Sr),b&&(wt(y,b),Qr(Sr))),S=Qs(y),h=ta(n),f=Ys(h,l),m={Attributes:{},Demographic:f,Location:{},Metrics:{}},be&&(l.device&&l.device.vendor&&(m.Attributes.DeviceMake=[l.device.vendor]),l.device&&l.device.model&&(m.Attributes.DeviceModel=[l.device.model]),l.device&&l.device.type&&(m.Attributes.DeviceType=[l.device.type])),t=Ss.all([S,m,t],{arrayMerge:na}),!(t.User&&t.User.UserId)){k.next=23;break}return k.next=21,r();case 21:O=k.sent,t.User.UserId!==O&&(t.User.UserId=O);case 23:if(!(!t.User||!t.User.UserId)){k.next=28;break}return k.next=26,r();case 26:w=k.sent,w&&(t.User=t.User||{},t.User.UserId=w);case 28:if(!(t.User&&t.User.UserAttributes)){k.next=32;break}return k.next=31,Mt(t.User.UserAttributes,!0);case 31:t.User.UserAttributes=k.sent;case 32:return k.next=34,Mt(t.Attributes,!0);case 34:return t.Attributes=k.sent,k.next=37,pi(t.Metrics);case 37:if(t.Metrics=k.sent,t.Metrics[a]||(t.Metrics[a]=1),t.Metrics[u]||(t.Metrics[u]=1),o&&(t=o(y,t)),v=t.Attributes.lastSession,v){k.next=47;break}return t.Attributes.lastSessionDate=[x.createdAt],t.Attributes.lastSession=[x.id],p&&(t.Attributes.lastPageSession=[p]),k.abrupt("return",wt(y,t));case 47:return v&&v[0]!==x.id&&(t.Attributes.lastSessionDate=[x.createdAt],t.Attributes.lastSession=[x.id],t.Metrics[a]+=1),t.Attributes&&t.Attributes.lastPageSession&&Array.isArray(t.Attributes.lastPageSession)&&t.Attributes.lastPageSession.length>0&&t.Attributes.lastPageSession[0]!==p&&(t.Attributes.lastPageSession=[p],t.Metrics[u]+=1),k.abrupt("return",wt(y,t));case 50:case"end":return k.stop()}},e)})),$t.apply(this,arguments)}function wt(e,t){var n=ct(e),r=bs(t)?t:JSON.stringify(t);return Xo(n,r),t}function Qs(e){try{return JSON.parse(Ft(ct(e)))||{}}catch{}return{}}function Ys(e,t){return be?ea(e,t):Zs(e)}function Zs(e){var t={AppVersion:e,Make:"generic server",Platform:"Node.js",PlatformVersion:process.version};return t}function ea(e,t){var n={AppVersion:e,Locale:t.language,Make:t.make,Model:t.model,ModelVersion:t.version,Platform:t.os.name||t.platform};return t.os&&t.os.version&&(n.PlatformVersion=t.os.version),n}function ta(e){var t=e.appTitle||e.appPackageName||"",n=e.appVersionCode||"0.0.0";return t?"".concat(t,"@").concat(n):n}function na(e,t){return t}function ra(e){var t=e.getContext;return typeof t=="function"?t():t}function ia(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(function(){var n=re(K.mark(function i(o){var s,a,u,c,p=arguments;return K.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return s=p.length>1&&p[1]!==void 0?p[1]:{},a=p.length>2&&p[2]!==void 0?p[2]:{},u=p.length>3&&p[3]!==void 0?p[3]:!1,cr(s)&&(s={},u=s),cr(a)&&(a={},u=a),l.next=7,Fs(o,s,t);case 7:if(c=l.sent,!(Object.entries(a).length||o===mi)){l.next=12;break}return l.next=11,an(a,t);case 11:a=l.sent;case 12:if(e.push(c),!u){l.next=17;break}return l.abrupt("return",e.flush());case 17:case"end":return l.stop()}},i)}));function r(i){return n.apply(this,arguments)}return r})()}var kr,oa=[429,500],sa=[202],aa=400;function ua(e,t){return Vt.apply(this,arguments)}function Vt(){return Vt=re(K.mark(function e(t,n){var r,i,o,s,a,u,c,p,l,x,y,b,S,h,f,m,O,w,v;return K.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return r=n.pinpointRegion,i=n.pinpointAppId,o=n.lambdaArn,s=n.lambdaRegion,a=n.credentials,u=n.getCredentials,c=n.debug,A.next=3,ca(a,u);case 3:return p=A.sent,c&&console.log("pinpoint auth",p),l=s||r,x=r||s,y=n.fips===!0?"-fips":"",b="https://lambda.".concat(l,".amazonaws.com/2015-03-31/functions/").concat(o,"/invocations"),S="https://pinpoint".concat(y,".").concat(x,".amazonaws.com/v1/apps/").concat(i,"/events"),h=o?b:S,O={body:JSON.stringify(t)},f=new _t(p),A.next=16,f.fetch(h,O).then(function(k){return k.json()});case 16:m=A.sent,A.next=24;break;case 19:return f=new kr.PinpointClient({credentials:p,region:r}),w=new kr.PutEventsCommand({ApplicationId:i,EventsRequest:t}),A.next=23,f.send(w);case 23:m=A.sent;case 24:return m&&m.Results&&(v=Object.keys(m.Results).map(function(k){return m.Results[k]}),v.forEach(function(k){var C=k.EndpointItemResponse||{},M=k.EventsItemResponse||{};Object.keys(C).length&&(sa.includes(C.StatusCode)||oa.includes(C.StatusCode)||la(C,Endpoint));var P=Object.keys(M);P.length&&P.forEach(function(z){})})),A.abrupt("return",m);case 26:case"end":return A.stop()}},e)})),Vt.apply(this,arguments)}function ca(e,t){return Wt.apply(this,arguments)}function Wt(){return Wt=re(K.mark(function e(t,n){var r,i;return K.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r=t,!(!Object.keys(r).length&&n)){o.next=11;break}return o.prev=2,o.next=5,n();case 5:r=o.sent,o.next=11;break;case 8:throw o.prev=8,o.t0=o.catch(2),new Error(o.t0);case 11:return i={accessKeyId:r.accessKeyId||r.AccessKeyId,secretAccessKey:r.secretAccessKey||r.SecretKey,sessionToken:r.sessionToken||r.SessionToken,retries:5},o.abrupt("return",i);case 13:case"end":return o.stop()}},e,null,[[2,8]])})),Wt.apply(this,arguments)}function la(e,t){var n=e.StatusCode,r=e.Message;if(n===aa){if(r.startsWith("Missing ChannelType"))throw new Error("Missing ChannelType");if(r.startsWith("Exceeded maximum endpoint per user count"))throw new Error("Exceeded maximum endpoint per user count")}}var fa=["PUSH","GCM","APNS","APNS_SANDBOX","APNS_VOIP","APNS_VOIP_SANDBOX","ADM","SMS","VOICE","EMAIL","BAIDU","CUSTOM"],xt=fa.reduce(function(e,t){return e[t]=t,e},{}),da=sn(),Ar=zt,Ir=ut,pa=/.+\@.+\..+/;function ga(e){return pa.test(e)}function ha(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.getEndpointId,n=e.debug;return(function(){var r=re(K.mark(function o(){var s,a,u,c,p,l,x,y,b,S,h=arguments;return K.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return s=h.length>0&&h[0]!==void 0?h[0]:[],a=h.length>1&&h[1]!==void 0?h[1]:{},f.next=4,t();case 4:if(u=f.sent,u){f.next=8;break}return console.error("No endpoint id. check getEndpointId()"),f.abrupt("return");case 8:if(c=te(a)==="object"&&Object.keys(a).length,c){f.next=13;break}f.t0=ma(u),f.next=16;break;case 13:return f.next=15,an(a,e);case 15:f.t0=f.sent;case 16:return p=f.t0,l=p.ChannelType,p.Address&&ga(p.Address)&&(l=xt.EMAIL),!l&&p.Address&&(da.platform==="android"?l=l||xt.GCM:l=l||xt.APNS),n&&(console.log("Endpoint",p),console.log("CHANNEL_TYPE",l)),p.RequestId=xe(),p.ChannelType=l,p.Address&&(p.OptOut=p.OptOut||"NONE"),x=ya(s),y=va(u,p,x),f.prev=26,f.next=29,ua(y,e);case 29:b=f.sent,f.next=36;break;case 32:f.prev=32,f.t1=f.catch(26),console.log("Error calling AWS",f.t1),S=f.t1;case 36:return f.abrupt("return",{endpoint:p,response:b,error:S,events:s});case 37:case"end":return f.stop()}},o,null,[[26,32]])}));function i(){return r.apply(this,arguments)}return i})()}function ma(e){try{return JSON.parse(Ft(ct(e)))||{}}catch{}return{}}function ya(e){return e.sort(function(t,n){var r=t.EventType,i=n.EventType;if(r==Ar)return-1;if(i==Ar||r==Ir)return 1;if(i==Ir)return-1}).reduce(function(t,n){return J(J({},n),t)},{})}function va(e,t,n){return{BatchItem:tn({},e,{Endpoint:t,Events:n})}}var ba=ut;function yi(){return{}}function wa(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=J({getContext:e.getContext||yi,credentials:e.credentials||{},getEndpointId:e.getEndpointId},e),n=t.debug?console.log:function(){},r=ha(t),i=hs((function(){var u=re(K.mark(function c(p,l){var x;return K.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return p.forEach(function(b){return n("> Queue event",b)}),y.next=3,r(p,{});case 3:x=y.sent,n("> Queue response",x);case 5:case"end":return y.stop()}},c)}));return function(c,p){return u.apply(this,arguments)}})(),{max:10,interval:e.flushInterval||3e3,throttle:!0}),o=ia(i,t);an({},e);var s=xa(o);function a(u){return r([],u)}return{updateEndpoint:a,recordEvent:o,disable:function(){s()}}}function xa(e){if(!be)return yi;var t=Sa(e);return window.addEventListener("beforeunload",t),function(){return window.removeEventListener("beforeunload",t)}}function Sa(e){return function(){e(ba,!0)}}function St(){throw new Error("Pinpoint not loaded")}function Oa(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return typeof r=="number"&&(t.metrics[n]=r),(typeof r=="string"||typeof r=="boolean")&&(t.attributes[n]=r),t},{attributes:{},metrics:{}})}function ka(e){var t=e.config,n=e.instance;t&&t.disableAnonymousTraffic&&!n.user("userId")&&n.once("identifyStart",function(r){var i=r.plugins,o=i["aws-pinpoint"];o.loaded()||n.loadPlugin("aws-pinpoint")})}var Aa={disableAnonymousTraffic:!1,pinpointRegion:"us-east-1",eventMapping:{}};function Ia(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t,n,r=!1;function i(){var s=Le();e.debug&&console.log("Stop session",s),t(ut,!0)}function o(){var s=Ze(30);e.debug&&console.log("START SESSION",s),t(zt)}return{name:"aws-pinpoint",config:J(J({},Aa),e),bootstrap:ka,initialize:function(s){var a=s.config,u=s.instance,c=a.disableAnonymousTraffic,p=a.debug,l=p?console.log:function(){},x=u.getState(),y=x.user||{},b=y.userId,S=y.anonymousId,h=x.context||{},f=h.app,m=h.version,O=h.campaign,w=rn(),v=ui(),A=Le();if(l("initPageSession",w),l("initTabSession",v),l("initSessionData",A),A&&A.anonId&&A.anonId!==S){l("anonId different refresh session details"),ur(),vs();var k=Ze(30,{anonId:S,userId:b});l("newSessionForNewUser",k)}if(!b&&c)return!1;var C=Object.keys(O).reduce(function(U,q){return U["utm_".concat(q)]=O[q],U},{}),M=wa(J(J({},a),{},{appTitle:a.appTitle||f,appPackageName:a.appPackageName||f,appVersionCode:a.appVersionCode||m,eventMapping:a.eventMapping,getEndpointId:function(){return u.user("anonymousId")},getUserId:function(){return u.user("userId")},getContext:function(){return{sessionKey:a.sessionKey,pageViewKey:a.pageViewKey,initialSession:A}},enrichEventAttributes:function(){return J({anonId:u.user("anonymousId"),userId:u.user("userId"),hash:window.location.hash,path:window.location.pathname,referrer:document.referrer,search:window.location.search,title:document.title,host:window.location.hostname,url:window.location.origin+window.location.pathname},C)},enrichUserAttributes:a.enrichUserAttributes,enrichEventMetrics:function(){return{}}}));t=M.recordEvent,n=M.updateEndpoint,A&&A.isNew&&(l("Start brand new session because cookie not found"),t(zt));var P=18e5,z=P;_s({timeout:z,throttle:2e4,onIdle:function(U,q){l("Session idle. Active ".concat(U," seconds")),i()},onWakeUp:function(U,q){l("Session wakeup. Idle ".concat(U," seconds")),o()},onHeartbeat:function(U,q){l("ping session",new Date),l("total active time",U);var $=u.user();ys(30,{anonId:$.anonymousId,userId:$.userId})}})},page:function(s){if(s.payload,s.config,!t)return St();r&&ur(),t(mi),r=!0},track:function(s){var a=s.payload,u=s.config;if(s.instance,!t)return St();if(!(u.disableAnonymousTraffic&&!a.userId)){var c=Oa(a.properties);t(a.event,c)}},identify:function(s){var a=s.payload,u=a.userId,c=a.traits;if(!n)return St();var p={},l={};u&&(l.UserId=u),c&&Object.keys(c).length&&(l.UserAttributes=c),Object.keys(l).length&&(p.User=l),n(p,!0)},reset:function(s){var a=s.instance,u=a.user("anonymousId"),c=ct(u);Qr(c)},loaded:function(){return!!t}}}var Ea=Ia;function vi(e){return Object.keys(e).some(t=>{let n=e[t];if(!n)return!1;switch(n&&n.toParam&&(n=n.toParam()),n.constructor.name){case"Array":return!1;case"Object":return!1;case"Date":return!1;case"Function":return!1;case"Boolean":return!1;case"String":return!1;case"Number":return!1;default:return!0}})}function bi(e){let t={};return Object.keys(e).forEach(n=>{var r,i;let o=e[n];if(o&&o.toParam&&(o=o.toParam()),!o&&o!==0&&typeof o!="boolean"&&typeof o!="string")return;let s=o.constructor.name,a;switch(s){case"Array":let u=(i=(r=o[0])===null||r===void 0?void 0:r.constructor)===null||i===void 0?void 0:i.name;a=u==="Array"?o:u==="Object"?JSON.stringify(o):o.join(",");break;case"Object":a=JSON.stringify(o);break;case"Date":a=o.valueOf();break;case"Function":a=null;break;case"Boolean":a=o+"";break;default:a=o;break}(a||a===0||typeof a=="string"||Array.isArray(a))&&(t[n]=a)}),t}function wi(e,t){return Array.isArray(t)&&t[0]&&Array.isArray(t[0])?t.map(n=>wi(e,n)).join("&"):encodeURIComponent(e)+"="+encodeURIComponent(t)}function xi(e){let t=bi(e);return Object.keys(t).map(n=>wi(n,t[n])).join("&")}var Pa=globalThis.FormData;function ja(e,t){let n=vi(e)||t,r=bi(e);if(n){let i=new Pa;return Object.keys(r).forEach(o=>{if(typeof Blob<"u"&&r[o]instanceof Blob){let s=r.fileName||r[o].name||o;i.append(o,r[o],s)}else i.append(o,r[o])}),i}else return xi(e)}var de=class extends Error{constructor(t,n,r,i,o){super(t);let s=new.target.prototype;Object.setPrototypeOf(this,s),t=t||"UNKNOWN_ERROR",n=n||"UNKNOWN_ERROR_CODE",this.name="ArcGISRequestError",this.message=n==="UNKNOWN_ERROR_CODE"?t:`${n}: ${t}`,this.originalMessage=t,this.code=n,this.response=r,this.url=i,this.options=o}},Ta={noCorsDomains:[],crossOriginNoCorsDomains:{},pendingNoCorsRequests:{}},qt="ARCGIS_REST_JS_NO_CORS";globalThis[qt]||(globalThis[qt]=Object.assign({},Ta));var Y=globalThis[qt];function Na(e){let t=new URL(e);e=t.origin+t.pathname,t.search.includes("f=json")&&(e+="?f=json");let n=t.origin;return Y.pendingNoCorsRequests[n]||(Y.pendingNoCorsRequests[n]=fetch(e,{mode:"no-cors",credentials:"include",cache:"no-store"}).then(r=>{Y.noCorsDomains.indexOf(n)===-1&&Y.noCorsDomains.push(n),Y.crossOriginNoCorsDomains[n.toLowerCase()]=Date.now(),delete Y.pendingNoCorsRequests[n]}).catch(r=>(delete Y.pendingNoCorsRequests[n],Promise.reject(new Error(`no-cors request to ${n} failed`))))),Y.pendingNoCorsRequests[n]}function _a(e){e.forEach(t=>{t=t.toLowerCase(),/^https?:\/\//.test(t)?Ot(t):(Ot("http://"+t),Ot("https://"+t))})}function Ot(e){let t=new URL(e).origin;Y.noCorsDomains.indexOf(t)===-1&&Y.noCorsDomains.push(t)}function Si(e){let t=!1;if(Y.noCorsDomains.length){let n=new URL(e).origin.toLowerCase();t=Y.noCorsDomains.some(r=>n.includes(r))}return t}function Ca(e){let t=!1;if(Si(e)){let n=new URL(e).origin.toLowerCase(),r=Y.crossOriginNoCorsDomains[n]||0;Date.now()-60*6e4>r&&(t=!0)}return t}function Ma(e){console&&console.warn&&console.warn.apply(console,[e])}function Ua(){return Promise.resolve({fetch:globalThis.fetch,Headers:globalThis.Headers,Response:globalThis.Response,Request:globalThis.Request})}function Da(e,t){var n;if(!t&&!window||!e)return!1;{t=t||window;let r=(n=t.location)===null||n===void 0?void 0:n.origin;return e.startsWith(r)}}var Ra="@esri/arcgis-rest-js";function za(){return globalThis.DEFAULT_ARCGIS_REQUEST_OPTIONS||{httpMethod:"POST",params:{f:"json"}}}var tt=class extends de{constructor(t="AUTHENTICATION_ERROR",n="AUTHENTICATION_ERROR_CODE",r,i,o){super(t,n,r,i,o),this.name="ArcGISAuthError",this.message=n==="AUTHENTICATION_ERROR_CODE"?t:`${n}: ${t}`;let s=new.target.prototype;Object.setPrototypeOf(this,s)}retry(t,n=1){let r=0,i=(o,s)=>{r=r+1,t(this.url,this.options).then(a=>{let u=Object.assign(Object.assign({},this.options),{authentication:a});return Oi(this.url,u)}).then(a=>{o(a)}).catch(a=>{a.name==="ArcGISAuthError"&&r<n?i(o,s):a.name===this.name&&a.message===this.message&&r>=n?s(this):s(a)})};return new Promise((o,s)=>{i(o,s)})}};function La(e,t,n,r,i){if(e.code>=400){let{message:o,code:s}=e;throw new de(o,s,e,t,r)}if(e.error){let{message:o,code:s,messageCode:a}=e.error,u=a||s||"UNKNOWN_ERROR_CODE";throw s===498||s===499?i||new tt(o,u,e,t,r):new de(o,u,e,t,r)}if(e.status==="failed"||e.status==="failure"){let o,s="UNKNOWN_ERROR_CODE";try{o=JSON.parse(e.statusMessage).message,s=JSON.parse(e.statusMessage).code}catch{o=e.statusMessage||e.message}throw new de(o,s,e,t,r)}return e}function Oi(e,t){let n=za(),r=Object.assign(Object.assign(Object.assign({httpMethod:"POST"},n),t),{params:Object.assign(Object.assign({},n.params),t.params),headers:Object.assign(Object.assign({},n.headers),t.headers)}),{httpMethod:i,rawResponse:o}=r,s=Object.assign({f:"json"},r.params),a=null,u={method:i,signal:r.signal,credentials:r.credentials||"same-origin"};Si(e)&&(u.credentials="include"),r.headers&&r.headers["X-Esri-Auth-Client-Id"]&&e.indexOf("/oauth2/platformSelf")>-1&&(u.credentials="include");let c;if(typeof r.authentication=="string"){let b=r.authentication;c={portal:"https://www.arcgis.com/sharing/rest",getToken:()=>Promise.resolve(b)},!r.authentication.startsWith("AAPK")&&!r.authentication.startsWith("AAPT")&&!r.authentication.startsWith("AATK")&&!r.authentication.startsWith("AAST")&&!r.suppressWarnings&&!globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING&&(Ma("Using an oAuth 2.0 access token directly in the token option is discouraged. Consider using ArcGISIdentityManager or Application session. See https://esriurl.com/arcgis-rest-js-direct-token-warning for more information."),globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING=!0)}else c=r.authentication;let p=e,l=!1;typeof window<"u"&&(l=Da(e));let x=!l&&Ca(e);r.headers&&r.headers["X-Esri-Auth-Client-Id"]&&e.indexOf("/oauth2/platformSelf")>-1&&(u.credentials="include");let y=Promise.resolve();return x&&(u.credentials="include",y=Na(e)),y.then(()=>c?c.getToken(e).catch(b=>(b.url=e,b.options=r,a=b,Promise.resolve(""))):Promise.resolve("")).then(b=>{b.length&&(s.token=b),c&&c.getDomainCredentials&&(u.credentials=c.getDomainCredentials(e));let S={};if(u.method==="GET"){s.token&&r.hideToken&&typeof window>"u"&&(S["X-Esri-Authorization"]=`Bearer ${s.token}`,delete s.token);let f=xi(s),m=f===""?e:`${e}?${f}`;r.maxUrlLength&&m.length>r.maxUrlLength||!r.maxUrlLength&&m.length>2e3||s.token&&r.hideToken?(u.method="POST",b.length&&r.hideToken&&(s.token=b,delete S["X-Esri-Authorization"])):e=m}let h=new RegExp("/items/.+/updateResources").test(e);return u.method==="POST"&&(u.body=ja(s,h)),u.headers=Object.assign(Object.assign({},S),r.headers),(typeof window>"u"||window&&typeof window.document>"u")&&!u.headers.referer&&(u.headers.referer=Ra),!vi(s)&&!h&&(u.headers["Content-Type"]="application/x-www-form-urlencoded"),globalThis.fetch?globalThis.fetch(e,u):Ua().then(({fetch:f})=>f(e,u))}).then(b=>{if(!b.ok)return b.json().then(S=>{let{status:h,statusText:f}=b,{message:m,details:O}=S.error,w=`${m}. ${O?O.join(" "):""}`.trim();throw new de(w,`HTTP ${h} ${f}`,S,e,r)}).catch(S=>{if(S.name==="ArcGISRequestError")throw S;let{status:h,statusText:f}=b;throw new de(f,`HTTP ${h}`,b,e,r)});if(o)return console.warn("rawResponse option is deprecated and will be removed in ArcGIS REST JS v5.0."),b;switch(s.f){case"json":return b.json();case"geojson":return b.json();case"html":return b.text();case"text":return b.text();default:return b.blob()}}).then(b=>{if((s.f==="json"||s.f==="geojson")&&!o){let S=La(b,p,s,r,a);if(b&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(e)&&Array.isArray(b.authorizedCrossOriginNoCorsDomains)&&_a(b.authorizedCrossOriginNoCorsDomains),a){let h=e.toLowerCase().split(/\/rest(\/admin)?\/services\//)[0];r.authentication.federatedServers[h]={token:[],expires:new Date(Date.now()+86400*1e3)},a=null}return S}else return b})}function ki(e,t={params:{f:"json"}}){let{request:n}=t,r=Gt(t,["request"]);return n?n(e,r):Oi(e,r).catch(i=>i instanceof tt&&t.authentication&&typeof t.authentication!="string"&&t.authentication.canRefresh&&t.authentication.refreshCredentials?i.retry(()=>t.authentication.refreshCredentials(),1):Promise.reject(i))}function $a(e){return typeof e!="string"||(e=e.trim(),e[e.length-1]==="/"&&(e=e.slice(0,-1))),e}function Re(e={}){return e.portal?$a(e.portal):e.authentication&&typeof e.authentication!="string"?e.authentication.portal:"https://www.arcgis.com/sharing/rest"}function Va(e){return e.owner?Promise.resolve(e.owner):e.item&&e.item.owner?Promise.resolve(e.item.owner):e.authentication&&e.authentication.getUsername?e.authentication.getUsername():Promise.reject(new Error("Could not determine the owner of this item. Pass the `owner`, `item.owner`, or `authentication` option."))}function Wa(e){return Array.isArray(e)&&Array.isArray(e[0])&&Array.isArray(e[1])}function qa(e){return e.join(",")}function Ai(e,t,n){if(!e)return e;let r=null;return typeof e.thumbnail=="string"&&(r=`${t}/content/items/${e.id}/info/${e.thumbnail}`,r&&e.access!=="public"&&n&&(r+=`?${n}`)),Object.assign(Object.assign({},e),r?{thumbnailUrl:r}:{})}function Ha(e){return Va(e).then(t=>{let n=e.folderId?`${Re(e)}/content/users/${t}/${e.folderId}/items/${e.item.id}/update`:`${Re(e)}/content/users/${t}/items/${e.item.id}/update`;e.params=Object.assign(Object.assign({},e.params),e.item),e.params.extent&&Wa(e.params.extent)&&(e.params.extent=qa(e.params.extent));let r=Re(e),i=Ai(Object.assign(Object.assign({},e.item),{access:e.item.access}),r),o=e.params.thumbnailUrl;return typeof i.thumbnailUrl=="string"&&typeof o=="string"&&i.thumbnailUrl.split("?")[0]===o.split("?")[0]&&delete e.params.thumbnailUrl,ki(n,e)})}function Ii(e,t){let n=Ka(e,t),r=Object.assign({httpMethod:"GET"},t);return ki(n,r).then(async i=>{let o=t?.portal||Re(t),s;return t?.authentication&&typeof t.authentication!="string"&&i.access!=="public"&&(s=await t.authentication.getToken(n)),Ai(i,o,s)})}var Ka=(e,t)=>`${typeof t=="string"?t:Re(t)}/content/items/${e}`;function Ga(e,t,n){return n.reduce((r,i)=>{let{action:o,targetProperty:s}=i;return o==="add"?r[s]={updatedAt:new Date,updatedBy:e}:o==="remove"&&delete r[s],r},t)}async function Ja({id:e,authentication:t,username:n,accessChangeset:r}){let{properties:i={}}=await Ii(e,{authentication:t}),o=i.telemetry,s=o===void 0?{}:o,{arcgis:{access:a={}}={}}=s,u=Gt(s,["arcgis"]),c=Ga(n,a,r);return Ha({item:{id:e,properties:Object.assign(Object.assign({},i),{telemetry:Object.assign(Object.assign({},u),{arcgis:{access:Object.assign({},c)}})})},authentication:t})}async function Xa({id:e,authentication:t}){let{properties:{telemetry:{arcgis:{access:n={}}={}}={}}}=await Ii(e,{authentication:t});return{access:n}}var Ht=class{constructor(t){this.name="amazon",this.isInitialized=!1;let{app:n={},fips:r,userPoolID:i}=t;this.analytics=os({app:n.name,version:n.version,plugins:[Ea({fips:r,pinpointAppId:n.id,getCredentials:()=>Wi(i,{fips:r})})]}),Object.assign(this,t)}init(){if(!this.isInitialized)return this.isInitialized=!0,Promise.resolve()}static async setAccessPermissions({id:t,authentication:n,username:r,accessChangeset:i}){return Ja({id:t,authentication:n,username:r,accessChangeset:i})}static async getAccessPermissions({id:t,authentication:n}){return Xa({id:t,authentication:n})}logPageView(t,n){let r=Xi({page:t,previousPage:this.previousPage,options:n,dimensionLookup:this.dimensions,metricLookup:this.metrics}),{pageUrl:i,pageName:o}=r;this.previousPage={pageUrl:i,pageName:o},this.analytics.track("pageView",r)}logEvent(t={}){let n=Ji({event:t,dimensionLookup:this.dimensions,metricLookup:this.metrics}),{name:r}=n;this.analytics.track(r,n)}},Fa=cn`:host{display:block}`,Kt=class extends fn{constructor(){super(...arguments),this.amazonAppId="",this.amazonAppName="",this.amazonUserPoolID="",this.amazonVersion="",this.firstUseVar="",this.measurementIds=[],this._open=!1,this._translations=pn({name:"consent-manager",blocking:!0}),this._loaded=!1,this.consentGranted=ln()}static{this.properties={amazonAppId:1,amazonAppName:1,amazonUserPoolID:1,amazonVersion:1,firstUseVar:1,measurementIds:0,portal:0,_open:16,_translations:16}}static{this.styles=Fa}async getInstance(){if(localStorage.getItem(this.firstUseVar)==="true"||this.portal?.eueiEnabled)return await this._init(),this._telemetryInstance}async load(){this._open=localStorage.getItem(this.firstUseVar)===null}render(){return""}loaded(){this.consentGranted.emit({granted:localStorage.getItem(this.firstUseVar)==="true"})}async _init(){if(!this._loaded){let t={info:console.info?console.info.bind(console):console.log.bind(console),error:console.error?console.error.bind(console):console.log.bind(console),warn:(r,...i)=>{(!r.includes("non-primitive value")||!r.includes("userSince"))&&(console.warn||console.log)(r,...i)}},n={plugins:[],portal:this.portal,logger:t};if(this.measurementIds?.length>0){let r=new At({measurementIds:this.measurementIds});n.plugins.push(r)}if(this.amazonUserPoolID){let r=new Ht({userPoolID:this.amazonUserPoolID,app:{name:this.amazonAppName,id:this.amazonAppId,version:this.amazonVersion}});n.plugins.push(r)}this._telemetryInstance=new kt(n),await this._telemetryInstance.init(),this._loaded=!0}}_alertClosed(){this._open=!1,localStorage.getItem(this.firstUseVar)!=="true"&&localStorage.setItem(this.firstUseVar,"false")}_accept(){localStorage.setItem(this.firstUseVar,"true"),this.consentGranted.emit({granted:!0}),this._open=!1}};dn("consent-manager",Kt);export{Kt as ConsentManager};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
+ import g from"./PNBTKFO6.js";import e from"./5Z32YRHM.js";import a from"./RTSKNY33.js";import{b as d}from"./PZ4L77M5.js";import{a as b}from"./LFIJXE3U.js";import{b as f}from"./VU3OQQKP.js";import{H as m,J as u,L as c,h,i,r as o}from"./46DQNAMV.js";export default $arcgis.t(([{A:y,K:n,a:x,b:v,u:_,w:w},{a:$},{d:g,h:C,i:D}])=>{var k=h`.negative-tabbing-offset[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:-2px}.tabbing-offset[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.font-weight-med{font-weight:var(--calcite-font-weight-medium)}.font-weight-bold{font-weight:var(--calcite-font-weight-bold)}.heading-font{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.title-font{font-size:1.8rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.font-1{font-size:var(--calcite-spacing-lg)}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}.flex-direction-row{flex-direction:row}@media(min-width:801px){.font-size-override .display-flex.flex-direction-row>.image-width+.display-flex{flex:1;min-width:0}}.icon-color{color:var(--calcite-color-text-3)}.padding-bottom-lg{padding-bottom:var(--calcite-spacing-lg)}.item-padding{--calcite-internal-accordion-item-padding: var(--calcite-spacing-xl)}.align-items-center{align-items:center}.align-items-start{align-items:start}.font-size-override{--calcite-font-size--2: var(--calcite-font-size--1)}.background-color-1{background-color:var(--calcite-color-foreground-1)}.background-color-2{background-color:var(--calcite-color-foreground-2)}.label-override{--calcite-label-margin-bottom: var(--calcite-spacing-none)}.position-relative{position:relative}.overflow-hidden{overflow:hidden}.overflow-auto{overflow:auto}.margin-block-start-end-0{margin-block-start:var(--calcite-spacing-none);margin-block-end:var(--calcite-spacing-none)}.panel-background-2{--calcite-panel-background-color: var(--calcite-color-foreground-2);background-color:var(--calcite-color-foreground-2)}.panel-background-1{--calcite-panel-background-color: var(--calcite-color-foreground-1);--calcite-shell-panel-background-color: var(--calcite-color-foreground-1)}.border-none{border:none}.font-color-1{color:var(--calcite-color-text-1)}.panel-bg-color{--calcite-panel-header-background-color: var(--calcite-color-foreground-1);--calcite-panel-background-color: var(--calcite-color-foreground-1)}.dialog-y-size{--calcite-dialog-size-y: 90% }.dialog-x-size{--calcite-dialog-size-x: 90% }.bottom-border{border-bottom:solid var(--calcite-spacing-px);color:var(--calcite-color-border-1)}.margin-start-end-xxl{margin-inline-start:var(--calcite-spacing-xxl);margin-inline-end:var(--calcite-spacing-xxl)}.margin-start-end-lg{margin-inline-start:var(--calcite-spacing-lg);margin-inline-end:var(--calcite-spacing-lg)}.margin-top-xxl{margin-top:var(--calcite-spacing-xxl)}.justify-between{justify-content:space-between}.items-baseline{align-items:baseline}.padding-xxl{padding:var(--calcite-spacing-xxl)}.padding-lg{padding:var(--calcite-spacing-lg)}.padding-top-xxl{padding-top:var(--calcite-spacing-xxl)}.padding-top-lg{padding-top:var(--calcite-spacing-lg)}.padding-bottom-xxl{padding-bottom:var(--calcite-spacing-xxl)}.padding-end-1{padding-inline-end:var(--calcite-spacing-lg)}.padding-end-xxl{padding-inline-end:var(--calcite-spacing-xxl)}.padding-start-sm{padding-inline-start:var(--calcite-spacing-sm)}.padding-start-xxl{padding-inline-start:var(--calcite-spacing-xxl)}.image-width{width:300px;flex-grow:0;flex-shrink:0}@media(max-width:1280px){.image-width{flex-grow:0;flex-shrink:1}}img{max-width:100%;height:auto;overflow-clip-margin:content-box;overflow:clip;display:block}.margin-xl{margin:var(--calcite-spacing-xl)}.line-height-1{line-height:1.1}.line-height-xxl{line-height:var(--calcite-line-height-xxl)}@media(max-width:800px){.font-size-override .display-flex.flex-direction-row{flex-direction:column!important}.image-width{width:100%!important;max-width:100%!important;margin:0!important;padding:var(--calcite-spacing-lg)!important;padding-bottom:0!important;box-sizing:border-box}.image-width img{width:100%;max-width:100%}.margin-xl{margin:0!important}.image-width+.display-flex{padding-inline-start:var(--calcite-spacing-lg)!important;padding-inline-end:var(--calcite-spacing-lg)!important}.padding-start-sm{padding-inline-start:0!important}.title-font{padding-inline-start:0!important;padding-top:var(--calcite-spacing-lg)!important;padding-bottom:var(--calcite-spacing-lg)!important}.align-items-start.padding-bottom-xxl,.padding-bottom-xxl.padding-start-sm{padding-bottom:var(--calcite-spacing-lg)!important}}calcite-shell-panel{--calcite-shell-panel-max-width: 20rem;--calcite-shell-panel-width: 24vw}calcite-shell{block-size:unset}.solution-deployed-action{--calcite-color-focus: initial}`,p=class extends m{constructor(){super(),this.diagramKey="",this.open=!1,this.templateInfos=[],this._accordionLoading=!1,this._configureTitlesOpen=!1,this._deleteDialogOpen=!1,this._hasNewVersion=!1,this._isDiagramOpen=!1,this._isNameConflict=!1,this._invalidNameMessage="",this._showSuccessAlert=!1,this._showFailedAlert=!1,this._showItemUpdateLoading=!1,this.isMobile=!1,this._templateInfoGraph=[],this._thumbnailUrl="",this._translations=b({name:"solution-deployed-card-panel",blocking:!0}),this._configContextConsumer=d({context:v,subscribe:!0,callback:async e=>{e&&(this._isOrgAdmin=w(e.authentication),this._user=e.authentication?.Portal?.user)}}),this._isOrgAdmin=!1,this._isMobileContextConsumer=d({context:x,subscribe:!0,callback:e=>this.isMobile=e}),this.navTabSelected=o(),this.forceSelectTab=o(),this.sortTypeChanged=o(),this.solutionConfigureDialogClose=o(),this._nonSolutionDependencyItems=[],this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"deployAppTabSelected",this._handleDeployAppTabSelected),this.listenOn(window,"displayDeployedCard",()=>{this._showSuccessAlert=!0}),this.listenOn(window,"sessionRefreshed",e=>{this._updateThumbnailToken(e.detail)})}static{this.properties={card:0,cardRef:1,diagramKey:1,open:5,templateInfos:0,_accordionLoading:16,_configureTitlesOpen:16,_deleteDialogOpen:16,_hasNewVersion:16,_isDiagramOpen:16,_isNameConflict:16,_invalidNameMessage:16,_showSuccessAlert:16,_showFailedAlert:16,_showItemUpdateLoading:16,isMobile:16,_templateInfoGraph:16,_thumbnailUrl:16,_translations:16,_nonSolutionDependencyItems:16}}static{this.styles=k}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async load(){if(this._isMobileContextConsumer.value&&(this.isMobile=this._isMobileContextConsumer.value),this.card?.thumbnailUrl){let e=this._configContextConsumer.value?.userSession,t=this.card?.thumbnailUrl.replace(/w=\d+/,"w=400");this._thumbnailUrl=`${t}&token=${e?.token}`}}willUpdate(e){if(e.has("card")){let t=this._configContextConsumer.value?.userSession,a=this.card?.thumbnailUrl.replace(/w=\d+/,"w=400");this._thumbnailUrl=`${a}&token=${t?.token}`}}render(){return this.isMobile?i`<calcite-shell class="position-relative background-color-2"><calcite-panel class="panel-background-2 border-none" slot=panel-bottom><div class="background-color-2 padding-top-lg">${this._getSolutionPanel()}</div><div class="background-color-1 margin-top-xxl">${this._getButtons()}${this._getOwnerSection()}<div class="bottom-border margin-start-end-xxl"></div>${this._getSolutionVersionCard()}</div>${this._getSolutionContents()}</calcite-panel></calcite-shell>`:i`<calcite-shell class="position-relative background-color-2"><calcite-panel class="padding-end-xxl panel-background-2 border-none" slot=panel-bottom><div class="display-flex flex-direction-column overflow-hidden"><div class="background-color-2 padding-top-xxl">${this._getSolutionPanel()}</div>${this._getSolutionContents()}</div></calcite-panel><calcite-shell-panel class="panel-background-1" slot=panel-end>${this._getButtons()}${this._getOwnerSection()}<div class="bottom-border margin-start-end-xxl"></div>${this._getSolutionVersionCard()}</calcite-shell-panel>${this._renderDiagramDialog()}${this._getConfigureTitlesDialog()}${this._getDeleteDialog()}${this._getSuccessDeployAlert()}</calcite-shell>`}async _deployedCardSelected(e){let t=e.detail;this.card=t.card,this.cardRef=t.cardRef,this.templateInfos=[],this._accordionLoading=!0,this.templateInfos=await this._getTemplates(),this._accordionLoading=!1;let a=await $(this._configContextConsumer.value.userSession,this.card);this._nonSolutionDependencyItems=a._nonSolutionDependencyItems;let l=C(this._configContextConsumer.value?.allCards||[],this.card.deployCommonId),s=!1;if(l){let r=g(l),S=g(this.card);s=r>S}this._hasNewVersion=s}_handleDeployAppTabSelected(e){e.detail==="deployed-card"&&this.sortTypeChanged.emit("")}_getButtons(){let e=this._configContextConsumer.value?.userSession?.username,t=this._configContextConsumer.value?.authentication?.CanUpdateSolution,a=this.card?.owner===e||this._isOrgAdmin||t,l=this.card?.owner===e||this._isOrgAdmin,s=a?"display-none":"",r=this.isMobile?"padding-lg":"padding-xxl";return i`<div class=${`display-flex flex-direction-column ${r}`}>${!this.isMobile&&i`<calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" kind=neutral @click=${this._openDiagram}>${this._translations.viewTheDiagram}</calcite-button>`||""}<calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" kind=neutral @click=${this._viewDocumentation}>${this._translations.solutionDocumentation}</calcite-button><calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" kind=neutral @click=${this._openItemDetails}>${this._translations.itemDetails}</calcite-button>${a&&!this.isMobile&&i`<calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" id=solution-configure-titles-button kind=neutral @click=${this._openConfigureTitlesDialog}>${this._translations.updateTitles}</calcite-button><calcite-tooltip class=${u(s)} overlay-positioning=fixed reference-element=solution-configure-titles-button><span>${this._translations.mustOwnSolution}</span></calcite-tooltip>`||""}${l&&!this.isMobile&&i`<calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" kind=neutral @click=${this._deleteSolution}>${this._translations.deleteSolution}</calcite-button>`||""}</div>`}_openConfigureTitlesDialog(){this._configureTitlesOpen=!0}_getConfigureTitlesDialog(){return this._configureTitlesOpen?i`<solution-configure-titles .card=${this.card} @solutionConfigureTitlesBeforeClose=${async()=>{this.templateInfos=await this._getTemplates(),this._configureTitlesOpen=!1}} @solutionItemsTitlesChanged=${async()=>{this.templateInfos=await this._getTemplates()}} .open=${this._configureTitlesOpen} source="Details Page" .templateInfos=${this.templateInfos}></solution-configure-titles>`:""}_viewDocumentation(e){e.stopPropagation(),this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"Open Help",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Details Page"]}),window.open(this.card.learnMoreUrl,"_blank")}_openItemDetails(e){e.stopPropagation(),this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"Open Item Details",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Details Page"]}),window.open(this.card.itemUrl,"_blank")}_getOwnerSection(){if(!this._configContextConsumer?.value)return;let e=this.isMobile?"margin-start-end-lg":"margin-start-end-xxl";return i`<div class=${`display-flex padding-bottom-xxl ${e} flex-direction-column`}><div class="display-flex justify-between items-baseline"><calcite-label class="font-weight-med label-override tabbing-offset" layout=inline scale=l tabindex=0>${this._translations.aboutYourSolutionOwner}</calcite-label></div><solution-user-avatar .fullname=${this._user?.username===this.card?.owner?this._user?.fullName:void 0} .lookupProfile=${this._user?.username!==this.card?.owner} .thumbnailUrl=${this._user?.username===this.card?.owner?this._user?.thumbnailUrl:void 0} .username=${this.card?.owner}></solution-user-avatar></div>`}async _openDiagram(e){e.stopPropagation();let t=await this._getTemplates();t&&(this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"View Diagram",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Details Page"]}),this._templateInfoGraph=t,this._isDiagramOpen=!0)}async _getTemplates(){return this.cardRef?await this.cardRef.getTemplates():this.card?await _(this.card.id,this._configContextConsumer.value.userSession):void 0}_getSolutionVersionCard(){let e=this._hasNewVersion?this._translations.newVersionAvailable:this._translations.youHaveTheLatestVersion,t=this.isMobile?"padding-lg":"padding-xxl";return i`<div class=${`${t} display-flex flex-direction-column`}><calcite-label class="font-weight-med label-override tabbing-offset" layout=inline scale=l slot=heading tabindex=0>${this._translations.solutionVersion.replace("{{version}}",this.card?.deployVersion||"")}</calcite-label><div class="display-flex"><div class="display-flex flex-direction-row padding-top-lg align-items-center"><calcite-icon class="icon-color" icon=clock-forward scale=m></calcite-icon><div class="display-flex flex-direction-column padding-start-xxl"><span class="tabbing-offset" tabindex=0>${e}</span></div></div></div>${this._hasNewVersion?i`<calcite-button appearance=outline class="padding-top-lg solution-deployed-action" kind=neutral @click=${this._openNewVersionSolution} width=full>${this._translations.learnMoreNewVersion}</calcite-button>`:""}</div>`}async _openNewVersionSolution(e){e.stopPropagation(),this._telemetry?.logEvent({category:n.DEPLOYMENTS,action:"View Latest Version",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),await new Promise(a=>setTimeout(a,100));let t=D(this._configContextConsumer.value.allCards,this.card.deployCommonId);t&&this.forceSelectTab.emit({tabType:"details",tabTitleOrId:t})}_getSolutionPanel(){return i`<calcite-panel class="font-size-override panel-background-1"><div class="display-flex flex-direction-row"><div class="image-width margin-xl"><img alt=${this.card?.title??c} src=${this._thumbnailUrl??c}></div><div class="display-flex flex-direction-column"><h1 class="title-font margin-block-start-end-0 padding-end-xxl padding-start-sm padding-top-xxl padding-bottom-xxl line-height-1 negative-tabbing-offset" tabindex=0>${this.card?.title}</h1><div class="display-flex flex-direction-column padding-bottom-xxl padding-start-sm"><div class="display-flex align-items-start padding-bottom-xxl"><div class="font-1 padding-end-1 line-height-xxl negative-tabbing-offset" tabindex=0>${this.card?.snippet}</div></div><div class="display-flex"><div class="display-flex"><calcite-label class="label-override icon-color tabbing-offset" layout=inline tabindex=0><calcite-icon class="icon-color" icon=projects scale=s></calcite-icon>${this._translations.aboutYourSolutionDeployedDate.replace("{{deployedDate}}",this.card?.created||"")}</calcite-label></div></div></div></div></div></calcite-panel>`}_getSolutionContents(){let e=[...new Set(this._nonSolutionDependencyItems.map(t=>t.controlItemId))];return i`<calcite-panel class="panel-background-1 padding-top-xxl"><calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded><div class="margin-block-start-end-0 heading-font " slot=content-start>${this._translations.solutionsContentsAndCount.replace("{{numberOfSolutions}}",this.templateInfos.length.toString())}</div><div class="overflow-auto">${this._accordionLoading?i`<calcite-loader .label=${this._translations.loadingText} scale=m></calcite-loader>`:i`<solution-item-accordion .itemRelationshipDependencies=${e} .listSelectionMode=${e.length>0?"multiple":"single"} .reuseWarning=${this._translations.itemUsedInOtherSolutions} .templateInfos=${this.templateInfos} .typeKeywords=${this.card?.typeKeywords}></solution-item-accordion>`}</div></calcite-accordion-item></calcite-accordion></calcite-panel>`}_getDeleteDialog(){return this._deleteDialogOpen?i`<solution-delete-dialog .card=${this.card} @solutionDeleted=${()=>setTimeout(()=>this.navTabSelected.emit({tabType:"deployments"}),100)} @solutionDeleteDialogBeforeClose=${()=>{this._deleteDialogOpen=!1}} .open=${this._deleteDialogOpen} source="Details Page"></solution-delete-dialog>`:""}_getSuccessDeployAlert(){return i`<calcite-alert auto-close auto-close-duration=medium icon=check-circle kind=success .label=${this._translations.deploySuccessAlert.replace("{{solutionTitle}}",this.card?.title??"")} .open=${this._showSuccessAlert} @calciteAlertClose=${()=>{this._showSuccessAlert=!1}}><div slot=title>${this._translations.deploySuccessAlert.replace("{{solutionTitle}}",this.card?.title??"")}</div></calcite-alert>`}_renderDiagramDialog(){return this._isDiagramOpen?i`<calcite-dialog class="dialog-y-size dialog-x-size panel-bg-color" .heading=${this._translations.diagramOfTheSolution.replace("{{solution}}",this.card?.title??"")} id=${this._translations.diagramOfTheSolution.replace("{{solution}}",this.card?.title??"")??c} modal .open=${this._isDiagramOpen} @calciteDialogClose=${()=>{this._isDiagramOpen=!1}} outside-close-disabled scale=m width=l><solution-item-diagram .diagramKey=${this.diagramKey!==""?this.diagramKey:this._configContextConsumer.value?.diagramKey??""} .templateInfoGraph=${this._templateInfoGraph} .typeKeywords=${this.card?.typeKeywords}></solution-item-diagram></calcite-dialog>`:""}async _deleteSolution(){this._deleteDialogOpen=!0}_updateThumbnailToken(e){this._thumbnailUrl!==""&&(this._thumbnailUrl=y(this._thumbnailUrl,e))}};f("solution-deployed-card-panel",p);return p},a,e,g)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import d from"./2UMRDDIV.js";import c from"./PNBTKFO6.js";import b from"./5Z32YRHM.js";import a from"./RTSKNY33.js";import"./PZ4L77M5.js";import"./JE7L7M3J.js";import"./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"./VU3OQQKP.js";import"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,,a])=>{return a},a,b,c,d)
2
+ import d from"./UDTF5SYU.js";import c from"./PNBTKFO6.js";import b from"./5Z32YRHM.js";import a from"./RTSKNY33.js";import"./PZ4L77M5.js";import"./JE7L7M3J.js";import"./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"./VU3OQQKP.js";import"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,,a])=>{return a},a,b,c,d)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import m from"./6EFUV7CH.js";import l from"./CK7LURBK.js";import k from"./USIESVTZ.js";import j from"./4CMHNL7Z.js";import i from"./U75PDOJF.js";import h from"./2UMRDDIV.js";import f from"./PNBTKFO6.js";import e from"./N5PYWRMD.js";import"./NQXUGAR7.js";import d from"./FL74XITX.js";import c from"./6CJGNF3Y.js";import b from"./5Z32YRHM.js";import"./4T7P5RXF.js";import"./6MZ227J7.js";import a from"./RTSKNY33.js";import{a as u}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 C}from"./VU3OQQKP.js";import{F as o,G as s,H as v,J as _,h as g,i as p,r as n}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,,{D:x,H:D,I:I,K:c,a:f,b:w,w:F},,{b:O},,,{g:k,h:A},,,,,{a:y,b:M},{a:T}])=>{var $=g`.back-color-override{background-color:var(--calcite-color-foreground-2);--calcite-tab-border-color: var(--calcite-color-foreground-3)}.display-none{display:none!important}.height-100{height:100%}calcite-tab-nav{padding-bottom:6px;padding-top:6px}calcite-tab{--calcite-color-focus: transparent}calcite-tab>*{--calcite-color-focus: initial}calcite-tabs{--calcite-tab-border-color: var(--calcite-color-border-3);height:100%}.tab-space-0{--calcite-tab-content-space-y: var(--calcite-spacing-none)}.tab-space-md{--calcite-tab-content-space-y: var(--calcite-spacing-md)}solutions-searchsort-toolbar,solutions-deploy-app-nav,solution-details-panel,solutions-resources-shell,solutions-deployed-shell,solutions-all-shell,calcite-tab-nav,solution-deployed-card-panel{width:1440px;display:block;max-width:96vw;padding-right:var(--calcite-spacing-none);padding-left:var(--calcite-spacing-none);margin-left:auto;margin-right:auto;box-sizing:border-box}.border{height:var(--calcite-spacing-px);border-bottom-color:var(--calcite-color-border-3);border-bottom-style:solid;border-bottom-width:var(--calcite-border-width-sm);box-sizing:border-box}.overflow-auto{overflow:auto}solution-details-panel{scroll-margin-top:3rem}`,m=class extends v{constructor(){super(),this.initTitleOrId="",this.sortType="relevance",this.useLocalAppConfig=!1,this.authentication=void 0,this._isLoaded=!1,this.isMobile=!1,this._activeTab="all-solutions",this._showDeployedCardFetchFailed=!1,this._translations=S({name:"solutions-deploy-app",blocking:!0}),this._agoTerms=`${I}`,this._allCards=[],this._allShell=o(),this._allTab=o(),this._allTabTitle=o(),this._resourcesTab=o(),this._resourcesTabTitle=o(),this._categories=[],this._configContextProvider=u({context:w}),this._delay=!1,this._deployAppNav=o(),this._deployedCardPanel=o(),this._deployCardFetchFailedMessage="",this._deployedCardTab=o(),this._deployedCardTabTitle=o(),this._detailsShell=o(),this._detailsTab=o(),this._detailsTabTitle=o(),this._forceInit=!1,this._getSuggested=!1,this._tabpanelsFixed=!1,this._isMobileContextProvider=u({context:f}),this._mySolutionsShell=o(),this._mySolutionsTab=o(),this._mySolutionsTabTitle=o(),this._sortField="relevance",this._sortOrder="desc",this._telemetryManager=new T,this.deployAppTabSelected=n(),this.deployedCardFetchFailed=n(),this.detailsCardSelected=n(),this.deployedCardSelected=n(),this.metaTagStringsReady=n(),this.sessionRefreshed=n(),this.tabChanged=n(),this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"displayDeployedCard",this._handleDeployedCardDisplay),this.listenOn(window,"navTabSelected",this._setActiveTab),this.listenOn(window,"forceSelectTab",t=>this.selectTab(t.detail,{})),this._mediaQueryChange=this._mediaQueryChange.bind(this)}static{this.properties={appConfig:1,initTab:1,initTitleOrId:1,sortType:1,useLocalAppConfig:5,authentication:16,_isLoaded:16,isMobile:16,_activeTab:16,_showDeployedCardFetchFailed:16,_translations:16}}static{this.styles=$}get _telemetry(){return this._configContextProvider.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextProvider.value?.isEnterprise===!0&&this._configContextProvider.value?.authentication?.CanSearchArcGISOnline===!1}async selectTab(t,e){if(this._isLoaded||this._forceInit){let i=this._getDefaultSearchOptions(e);switch(this._searchSortToolbar&&(this._searchSortToolbar.scope=t.tabType),t.tabType){case"all-solutions":this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0,i&&await this._allShell.value?.searchSolutions(i);break;case"resources":this._resourcesTab.value.selected=!0,this._resourcesTabTitle.value.selected=!0;break;case"deployed-card":if(this.authentication?.IsSignedIn){if(this._forceInit=!0,this._isLoaded=!1,this._cardFetcherDeployed&&await this._getDeployedSolution(t.tabTitleOrId),this._deployedSolutions?.cards?.length>0){let a;this._deployedSolutions.cards.some(l=>l.id===t.tabTitleOrId?(a=l,this.deployedCardSelected.emit({card:a}),!0):!1),this._isLoaded=!0,this._forceInit=!1}else return this._isLoaded=!0,this._forceInit=!1,this.selectTab({tabTitleOrId:"",tabType:"deployments"},e);break}else await this.authentication?.signIn();case"details":if(this._allCards){let a=k(this._allCards,t.tabTitleOrId);a=a||A(this._allCards,t.tabTitleOrId),a?(this._detailsTab.value.selected=!0,this._detailsTabTitle.value.selected=!0,this.detailsCardSelected.emit(a)):(t.tabType="all-solutions",this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0)}break;case"deployments":this._mySolutionsTab.value.selected=!0,this._mySolutionsTabTitle.value.selected=!0,this._searchSortToolbar&&i?.filter&&this._searchSortToolbar.changeOwnerFilter(i.filter!=="Organization"),i&&await this._mySolutionsShell.value?.searchSolutions(i);break}return this._setActiveTab(new CustomEvent("setActiveTab",{detail:t})),this._blurTabs(),this._showDeployedCardFetchFailed&&(this.deployedCardFetchFailed.emit({message:this._deployCardFetchFailedMessage,title:this._translations.failedToOpen}),this._showDeployedCardFetchFailed=!1),!0}else return this._initTab=t,this._initFilters=e,!1}async connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia("(max-width: 800px)"),this._mediaQuery.addEventListener("change",this._mediaQueryChange),this._mediaQueryChange(this._mediaQuery)}updated(){this._fixTabpanelFocus()}_fixTabpanelFocus(){if(!this._tabpanelsFixed&&this._allTab.value){let t=[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab];Promise.all(t.map(async e=>{let i=e.value;if(i&&(await i.componentOnReady?.(),i.shadowRoot)){let a=i.shadowRoot.querySelector('[role="tabpanel"]');a&&(a.tabIndex=-1)}})).then(()=>{this._tabpanelsFixed=!0,this._setupTabpanelObserver()}).catch(()=>{this._tabpanelsFixed=!0})}}_setupTabpanelObserver(){this._tabpanelObserver||(this._tabpanelObserver=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"&&e.attributeName==="tabindex"){let i=e.target;i.getAttribute("role")==="tabpanel"&&i.tabIndex===0&&(i.tabIndex=-1)}})}),[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(t=>{let e=t.value;if(e?.shadowRoot){let i=e.shadowRoot.querySelector('[role="tabpanel"]');i&&this._tabpanelObserver.observe(i,{attributes:!0,attributeFilter:["tabindex"]})}}))}async load(){this.useLocalAppConfig&&(this.appConfig=O)}render(){let t=this._isLoaded?"display-none":"",e=this._isLoaded?"":"display-none";return p`<calcite-shell><solutions-deploy-app-nav .appConfig=${this.appConfig} .initTab=${this.initTab} @authInit=${this._handleAuthInit} slot=header ${s(this._deployAppNav)}></solutions-deploy-app-nav>${this._isSearchToolbarShowing()&&p`<div class="border" slot=header></div>`||""}<solutions-searchsort-toolbar slot=header ${s(async i=>{i&&(await this._deployAppNav.value?.componentOnReady(),this._searchSortToolbar=i)})}></solutions-searchsort-toolbar><calcite-loader class=${_(t)} id=solutions-loader .label=${this._translations.fetchingAllSolutions}></calcite-loader><calcite-tabs class=${_(e)} scale=l><calcite-tab-nav class="display-none" @calciteTabChange=${this._handleCalciteTabChanged} slot=title-group><calcite-tab-title ${s(this._allTabTitle)}>${this._translations.allSolutions}</calcite-tab-title><calcite-tab-title ${s(this._mySolutionsTabTitle)}>${this._translations.mySolutions}</calcite-tab-title><calcite-tab-title ${s(this._resourcesTabTitle)}>${this._translations.solutionResources}</calcite-tab-title><calcite-tab-title class="display-none" ${s(this._detailsTabTitle)}></calcite-tab-title><calcite-tab-title class="display-none" ${s(this._deployedCardTabTitle)}></calcite-tab-title></calcite-tab-nav><calcite-tab class="back-color-override tab-space-0" selected ${s(this._allTab)}><solutions-all-shell class="height-100" ${s(this._allShell)}></solutions-all-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._mySolutionsTab)}><solutions-deployed-shell class="height-100" ${s(this._mySolutionsShell)}></solutions-deployed-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._resourcesTab)}><solutions-resources-shell class="height-100"></solutions-resources-shell></calcite-tab><calcite-tab class="back-color-override" ${s(this._detailsTab)}><solution-details-panel class="height-100" ${s(this._detailsShell)}></solution-details-panel></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._deployedCardTab)}><solution-deployed-card-panel class="shell-container height-100" ${s(this._deployedCardPanel)}></solution-deployed-card-panel></calcite-tab></calcite-tabs></calcite-shell>`}loaded(){this._setScrollbarGutters()}disconnectedCallback(){super.disconnectedCallback(),this._mediaQuery?.removeEventListener("change",this._mediaQueryChange),this._tabpanelObserver?.disconnect()}async _handleAuthInit(t){let e=t.detail;e.telemetrySession||(e.telemetrySession=T.getDisabledSession()),this._configContextProvider.setValue(e),e.authentication&&(this.authentication=e.authentication),this._cardFetcherDeployed=new y(e.locale,e.orgUrl,e.portalURL),this._cardsFetcher=new y(e.locale,e.orgUrl,e.portalURL),this._isDisconnectedEnvironment||await this._getSolutions(e.primarySolutionsGroupId,e.agoBasedEnterpriseSolutionsGroupId),this._configContextProvider.value.allCards=this._allCards,this._configContextProvider.value.anonAgolSession=this._cardsFetcher.anonAgolSession,this._configContextProvider.value.agolPortalUrl=this._cardsFetcher.agolPortalUrl,await this._initializeTelemetry(),this._isLoaded=!0,this._setRefreshInterval(),this._initTab?(this.selectTab(this._initTab,this._initFilters),this._logTabViewTelemetry(this._initTab.tabType),this._initTab=void 0,this._initFilters=void 0):this.authentication?.IsSignedIn&&(this.initTab==="details"||this.initTab==="deployed-card"||(this._logTabViewTelemetry(this._activeTab),this._emitMetaTagStrings(this._activeTab)))}_mediaQueryChange(t){this.isMobile=t.matches,this._isMobileContextProvider.setValue(this.isMobile)}_setActiveTab(t){let e=t.detail.tabType,i=this._activeTab!==e;switch(this._activeTab=e,i&&this._logTabViewTelemetry(e),e){case"all-solutions":this._allTabTitle.value?.click();break;case"deployments":this._mySolutionsTabTitle.value?.click();break;case"resources":this._resourcesTabTitle.value?.click();break;case"deployed-card":this._deployedCardTabTitle.value?.click();break;case"details":this._detailsTabTitle.value?.click();break}e!=="details"&&e!=="deployed-card"&&(this._deployAppNav.value.activateMenuItem(e),this.deployAppTabSelected.emit(e),this._emitMetaTagStrings(e))}_logTabViewTelemetry(t,e){let i;switch(t){case"all-solutions":i=c.ALL_SOLUTIONS;break;case"deployments":i=c.DEPLOYMENTS;break;case"resources":i=c.RESOURCES;break;case"details":i=c.SOLUTION_DETAILS;break;case"deployed-card":i=c.DEPLOYMENTS;break}if(!((t==="details"||t==="deployed-card")&&!e)&&i){let a=[];if((t==="details"||t==="deployed-card")&&e){let r=e;a.push(r.title||""),a.push(r.deployCommonId||""),a.push(r.deployVersion||"")}let l=t==="deployed-card"?"Open":"View";this._telemetry?.logEvent({category:i,action:l,dimensions:a.length>0?a:void 0})}}_emitMetaTagStrings(t,e){let i="",a="";switch(t){case"all-solutions":i=this._translations.metaAllSolutionsTitle,a=this._translations.metaAllSolutionsDescription;break;case"deployments":case"deployed-card":i=this._translations.metaDeploymentsTitle,a=this._translations.metaDeploymentsDescription;break;case"resources":i=this._translations.metaResourcesTitle,a=this._translations.metaResourcesDescription;break;case"details":e&&(i=this._translations.metaDetailsTitle.replace("{title}",e.title),a=e.snippet);break}this.metaTagStringsReady.emit({pageType:t,title:i,description:a,detailTemplate:e})}_handleCalciteTabChanged(){this.tabChanged.emit(this._activeTab)}_detailsCardSelected(t){this._activeTab="details",this._detailsTabTitle.value.selected=!0,this._detailsTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail&&(this._selectedDetailsCard=t.detail),this._logTabViewTelemetry("details",this._selectedDetailsCard),this._emitMetaTagStrings("details",this._selectedDetailsCard)}_deployedCardSelected(t){this._activeTab="deployed-card",this._deployedCardTabTitle.value.selected=!0,this._deployedCardTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail?.card&&(this._selectedDeployedCard=t.detail.card),this._logTabViewTelemetry("deployed-card",this._selectedDeployedCard),this._emitMetaTagStrings("deployed-card")}_handleDeployedCardDisplay(t){let{card:e,cardRef:i}=t.detail;this.deployedCardSelected.emit({card:e,cardRef:i})}async _initializeTelemetry(){let t=this._configContextProvider.value;if(!this.authentication||!t)return;let e=await this._telemetryManager.initializeTelemetry(this.authentication,t);this._configContextProvider.value.telemetrySession=e}async _getSolutions(t,e){if(this._isDisconnectedEnvironment)return[];this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let i=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},t,e,this._configContextProvider.value.userSession,this._configContextProvider.value.isEnterprise,this._abortController.signal,{num:1e3});return this._abortController=void 0,this._allCards.length===0&&i?.cards&&(this._allCards=i?.cards),this._allCards}async _getDeployedSolution(t){let e=this._configContextProvider.value.authentication,i=this._configContextProvider.value.userSession;if(e&&i&&e.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let a=F(e);try{let l=await M(e,i,this._cardsFetcher,this._cardFetcherDeployed,D,"created","desc",!1,[],[],this._abortControllerDeployed.signal,a?"My organization's solutions":"My solutions",t);l.cards.length===0||l.cards[0].typeKeywords.indexOf("Deployed")<0?(this._deployCardFetchFailedMessage=this._translations.failedToFetchNotSolution.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):this._deployedSolutions=l}catch(l){let r=l.message;r.indexOf("CONT_0001")>-1||r.indexOf("Item does not exist or is inaccessible.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongId.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):r.indexOf("GWM_0003")>-1||r.indexOf("You do not have permissions to access this resource or perform this operation.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongPermissions.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):(this._showDeployedCardFetchFailed=!0,this._deployCardFetchFailedMessage=""),console.warn(l)}}}_blurTabs(){this._allTabTitle.value?.blur(),this._resourcesTabTitle.value?.blur(),this._detailsTabTitle.value?.blur(),this._mySolutionsTabTitle.value?.blur()}_isSearchToolbarShowing(){return this._activeTab==="all-solutions"||this._activeTab==="deployments"&&this.authentication?.IsSignedIn===!0}_getDefaultSearchOptions(t){let e;if(t){let i=t.domain,a=t.industry==="AEC"?x.AEC:t.industry,l=t.offerType,r=t.searchTerm,E="",d=t.sortField,h=t.owner,b=t.filter;e=i||a?{type:i?"domain":a?"industry":""}:void 0,i&&(e=e?{...e,domain:i}:{domain:i}),a&&(e=e?{...e,industry:a}:{industry:a}),r&&(e=e?{...e,searchTerm:r}:{searchTerm:r}),e&&(e={...e,displayValue:E}),d&&(e=e?{...e,sortType:d}:{sortType:d}),l&&(d=l.toLowerCase(),e=e?{...e,sortType:d}:{sortType:d}),h&&(e=e?{...e,owner:h}:{owner:h}),b&&(e=e?{...e,filter:b}:{filter:b})}return e}_setScrollbarGutters(){let t=this._detailsTab.value?.shadowRoot?.firstElementChild;t?.style&&(t.style.scrollbarGutter="stable both-edges");let e=this._deployedCardTab.value?.shadowRoot?.firstElementChild;e?.style&&(e.style.scrollbarGutter="stable both-edges")}_setRefreshInterval(){let{userSession:t,authentication:e}=this._configContextProvider.value;if(t&&t.tokenDuration&&e?.IsSignedIn){let i=Date.now(),a=(e.Credential?.expires-i)*.95;setInterval(async()=>{if(e.Credential&&e.Credential.expires){await e.Credential?.refreshToken();let l=new Date(e.Credential.expires);t.updateToken(e.Credential.token,l),this.sessionRefreshed.emit(t.token)}},a)}}};C("solutions-deploy-app",m);return m},"identity/IdentityManager","identity/OAuthInfo","portal/Portal",a,b,c,d,e,f,h,i,j,k,l,m)
2
+ import m from"./6EFUV7CH.js";import l from"./CK7LURBK.js";import k from"./USIESVTZ.js";import j from"./4CMHNL7Z.js";import i from"./U75PDOJF.js";import h from"./UDTF5SYU.js";import f from"./PNBTKFO6.js";import e from"./N5PYWRMD.js";import"./NQXUGAR7.js";import d from"./FL74XITX.js";import c from"./6CJGNF3Y.js";import b from"./5Z32YRHM.js";import"./4T7P5RXF.js";import"./6MZ227J7.js";import a from"./RTSKNY33.js";import{a as u}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 C}from"./VU3OQQKP.js";import{F as o,G as s,H as v,J as _,h as g,i as p,r as n}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,,{D:x,H:D,I:I,K:c,a:f,b:w,w:F},,{b:O},,,{g:k,h:A},,,,,{a:y,b:M},{a:T}])=>{var $=g`.back-color-override{background-color:var(--calcite-color-foreground-2);--calcite-tab-border-color: var(--calcite-color-foreground-3)}.display-none{display:none!important}.height-100{height:100%}calcite-tab-nav{padding-bottom:6px;padding-top:6px}calcite-tab{--calcite-color-focus: transparent}calcite-tab>*{--calcite-color-focus: initial}calcite-tabs{--calcite-tab-border-color: var(--calcite-color-border-3);height:100%}.tab-space-0{--calcite-tab-content-space-y: var(--calcite-spacing-none)}.tab-space-md{--calcite-tab-content-space-y: var(--calcite-spacing-md)}solutions-searchsort-toolbar,solutions-deploy-app-nav,solution-details-panel,solutions-resources-shell,solutions-deployed-shell,solutions-all-shell,calcite-tab-nav,solution-deployed-card-panel{width:1440px;display:block;max-width:96vw;padding-right:var(--calcite-spacing-none);padding-left:var(--calcite-spacing-none);margin-left:auto;margin-right:auto;box-sizing:border-box}.border{height:var(--calcite-spacing-px);border-bottom-color:var(--calcite-color-border-3);border-bottom-style:solid;border-bottom-width:var(--calcite-border-width-sm);box-sizing:border-box}.overflow-auto{overflow:auto}solution-details-panel{scroll-margin-top:3rem}`,m=class extends v{constructor(){super(),this.initTitleOrId="",this.sortType="relevance",this.useLocalAppConfig=!1,this.authentication=void 0,this._isLoaded=!1,this.isMobile=!1,this._activeTab="all-solutions",this._showDeployedCardFetchFailed=!1,this._translations=S({name:"solutions-deploy-app",blocking:!0}),this._agoTerms=`${I}`,this._allCards=[],this._allShell=o(),this._allTab=o(),this._allTabTitle=o(),this._resourcesTab=o(),this._resourcesTabTitle=o(),this._categories=[],this._configContextProvider=u({context:w}),this._delay=!1,this._deployAppNav=o(),this._deployedCardPanel=o(),this._deployCardFetchFailedMessage="",this._deployedCardTab=o(),this._deployedCardTabTitle=o(),this._detailsShell=o(),this._detailsTab=o(),this._detailsTabTitle=o(),this._forceInit=!1,this._getSuggested=!1,this._tabpanelsFixed=!1,this._isMobileContextProvider=u({context:f}),this._mySolutionsShell=o(),this._mySolutionsTab=o(),this._mySolutionsTabTitle=o(),this._sortField="relevance",this._sortOrder="desc",this._telemetryManager=new T,this.deployAppTabSelected=n(),this.deployedCardFetchFailed=n(),this.detailsCardSelected=n(),this.deployedCardSelected=n(),this.metaTagStringsReady=n(),this.sessionRefreshed=n(),this.tabChanged=n(),this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"displayDeployedCard",this._handleDeployedCardDisplay),this.listenOn(window,"navTabSelected",this._setActiveTab),this.listenOn(window,"forceSelectTab",t=>this.selectTab(t.detail,{})),this._mediaQueryChange=this._mediaQueryChange.bind(this)}static{this.properties={appConfig:1,initTab:1,initTitleOrId:1,sortType:1,useLocalAppConfig:5,authentication:16,_isLoaded:16,isMobile:16,_activeTab:16,_showDeployedCardFetchFailed:16,_translations:16}}static{this.styles=$}get _telemetry(){return this._configContextProvider.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextProvider.value?.isEnterprise===!0&&this._configContextProvider.value?.authentication?.CanSearchArcGISOnline===!1}async selectTab(t,e){if(this._isLoaded||this._forceInit){let i=this._getDefaultSearchOptions(e);switch(this._searchSortToolbar&&(this._searchSortToolbar.scope=t.tabType),t.tabType){case"all-solutions":this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0,i&&await this._allShell.value?.searchSolutions(i);break;case"resources":this._resourcesTab.value.selected=!0,this._resourcesTabTitle.value.selected=!0;break;case"deployed-card":if(this.authentication?.IsSignedIn){if(this._forceInit=!0,this._isLoaded=!1,this._cardFetcherDeployed&&await this._getDeployedSolution(t.tabTitleOrId),this._deployedSolutions?.cards?.length>0){let a;this._deployedSolutions.cards.some(l=>l.id===t.tabTitleOrId?(a=l,this.deployedCardSelected.emit({card:a}),!0):!1),this._isLoaded=!0,this._forceInit=!1}else return this._isLoaded=!0,this._forceInit=!1,this.selectTab({tabTitleOrId:"",tabType:"deployments"},e);break}else await this.authentication?.signIn();case"details":if(this._allCards){let a=k(this._allCards,t.tabTitleOrId);a=a||A(this._allCards,t.tabTitleOrId),a?(this._detailsTab.value.selected=!0,this._detailsTabTitle.value.selected=!0,this.detailsCardSelected.emit(a)):(t.tabType="all-solutions",this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0)}break;case"deployments":this._mySolutionsTab.value.selected=!0,this._mySolutionsTabTitle.value.selected=!0,this._searchSortToolbar&&i?.filter&&this._searchSortToolbar.changeOwnerFilter(i.filter!=="Organization"),i&&await this._mySolutionsShell.value?.searchSolutions(i);break}return this._setActiveTab(new CustomEvent("setActiveTab",{detail:t})),this._blurTabs(),this._showDeployedCardFetchFailed&&(this.deployedCardFetchFailed.emit({message:this._deployCardFetchFailedMessage,title:this._translations.failedToOpen}),this._showDeployedCardFetchFailed=!1),!0}else return this._initTab=t,this._initFilters=e,!1}async connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia("(max-width: 800px)"),this._mediaQuery.addEventListener("change",this._mediaQueryChange),this._mediaQueryChange(this._mediaQuery)}updated(){this._fixTabpanelFocus()}_fixTabpanelFocus(){if(!this._tabpanelsFixed&&this._allTab.value){let t=[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab];Promise.all(t.map(async e=>{let i=e.value;if(i&&(await i.componentOnReady?.(),i.shadowRoot)){let a=i.shadowRoot.querySelector('[role="tabpanel"]');a&&(a.tabIndex=-1)}})).then(()=>{this._tabpanelsFixed=!0,this._setupTabpanelObserver()}).catch(()=>{this._tabpanelsFixed=!0})}}_setupTabpanelObserver(){this._tabpanelObserver||(this._tabpanelObserver=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"&&e.attributeName==="tabindex"){let i=e.target;i.getAttribute("role")==="tabpanel"&&i.tabIndex===0&&(i.tabIndex=-1)}})}),[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(t=>{let e=t.value;if(e?.shadowRoot){let i=e.shadowRoot.querySelector('[role="tabpanel"]');i&&this._tabpanelObserver.observe(i,{attributes:!0,attributeFilter:["tabindex"]})}}))}async load(){this.useLocalAppConfig&&(this.appConfig=O)}render(){let t=this._isLoaded?"display-none":"",e=this._isLoaded?"":"display-none";return p`<calcite-shell><solutions-deploy-app-nav .appConfig=${this.appConfig} .initTab=${this.initTab} @authInit=${this._handleAuthInit} slot=header ${s(this._deployAppNav)}></solutions-deploy-app-nav>${this._isSearchToolbarShowing()&&p`<div class="border" slot=header></div>`||""}<solutions-searchsort-toolbar slot=header ${s(async i=>{i&&(await this._deployAppNav.value?.componentOnReady(),this._searchSortToolbar=i)})}></solutions-searchsort-toolbar><calcite-loader class=${_(t)} id=solutions-loader .label=${this._translations.fetchingAllSolutions}></calcite-loader><calcite-tabs class=${_(e)} scale=l><calcite-tab-nav class="display-none" @calciteTabChange=${this._handleCalciteTabChanged} slot=title-group><calcite-tab-title ${s(this._allTabTitle)}>${this._translations.allSolutions}</calcite-tab-title><calcite-tab-title ${s(this._mySolutionsTabTitle)}>${this._translations.mySolutions}</calcite-tab-title><calcite-tab-title ${s(this._resourcesTabTitle)}>${this._translations.solutionResources}</calcite-tab-title><calcite-tab-title class="display-none" ${s(this._detailsTabTitle)}></calcite-tab-title><calcite-tab-title class="display-none" ${s(this._deployedCardTabTitle)}></calcite-tab-title></calcite-tab-nav><calcite-tab class="back-color-override tab-space-0" selected ${s(this._allTab)}><solutions-all-shell class="height-100" ${s(this._allShell)}></solutions-all-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._mySolutionsTab)}><solutions-deployed-shell class="height-100" ${s(this._mySolutionsShell)}></solutions-deployed-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._resourcesTab)}><solutions-resources-shell class="height-100"></solutions-resources-shell></calcite-tab><calcite-tab class="back-color-override" ${s(this._detailsTab)}><solution-details-panel class="height-100" ${s(this._detailsShell)}></solution-details-panel></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${s(this._deployedCardTab)}><solution-deployed-card-panel class="shell-container height-100" ${s(this._deployedCardPanel)}></solution-deployed-card-panel></calcite-tab></calcite-tabs></calcite-shell>`}loaded(){this._setScrollbarGutters()}disconnectedCallback(){super.disconnectedCallback(),this._mediaQuery?.removeEventListener("change",this._mediaQueryChange),this._tabpanelObserver?.disconnect()}async _handleAuthInit(t){let e=t.detail;e.telemetrySession||(e.telemetrySession=T.getDisabledSession()),this._configContextProvider.setValue(e),e.authentication&&(this.authentication=e.authentication),this._cardFetcherDeployed=new y(e.locale,e.orgUrl,e.portalURL),this._cardsFetcher=new y(e.locale,e.orgUrl,e.portalURL),this._isDisconnectedEnvironment||await this._getSolutions(e.primarySolutionsGroupId,e.agoBasedEnterpriseSolutionsGroupId),this._configContextProvider.value.allCards=this._allCards,this._configContextProvider.value.anonAgolSession=this._cardsFetcher.anonAgolSession,this._configContextProvider.value.agolPortalUrl=this._cardsFetcher.agolPortalUrl,await this._initializeTelemetry(),this._isLoaded=!0,this._setRefreshInterval(),this._initTab?(this.selectTab(this._initTab,this._initFilters),this._logTabViewTelemetry(this._initTab.tabType),this._initTab=void 0,this._initFilters=void 0):this.authentication?.IsSignedIn&&(this.initTab==="details"||this.initTab==="deployed-card"||(this._logTabViewTelemetry(this._activeTab),this._emitMetaTagStrings(this._activeTab)))}_mediaQueryChange(t){this.isMobile=t.matches,this._isMobileContextProvider.setValue(this.isMobile)}_setActiveTab(t){let e=t.detail.tabType,i=this._activeTab!==e;switch(this._activeTab=e,i&&this._logTabViewTelemetry(e),e){case"all-solutions":this._allTabTitle.value?.click();break;case"deployments":this._mySolutionsTabTitle.value?.click();break;case"resources":this._resourcesTabTitle.value?.click();break;case"deployed-card":this._deployedCardTabTitle.value?.click();break;case"details":this._detailsTabTitle.value?.click();break}e!=="details"&&e!=="deployed-card"&&(this._deployAppNav.value.activateMenuItem(e),this.deployAppTabSelected.emit(e),this._emitMetaTagStrings(e))}_logTabViewTelemetry(t,e){let i;switch(t){case"all-solutions":i=c.ALL_SOLUTIONS;break;case"deployments":i=c.DEPLOYMENTS;break;case"resources":i=c.RESOURCES;break;case"details":i=c.SOLUTION_DETAILS;break;case"deployed-card":i=c.DEPLOYMENTS;break}if(!((t==="details"||t==="deployed-card")&&!e)&&i){let a=[];if((t==="details"||t==="deployed-card")&&e){let r=e;a.push(r.title||""),a.push(r.deployCommonId||""),a.push(r.deployVersion||"")}let l=t==="deployed-card"?"Open":"View";this._telemetry?.logEvent({category:i,action:l,dimensions:a.length>0?a:void 0})}}_emitMetaTagStrings(t,e){let i="",a="";switch(t){case"all-solutions":i=this._translations.metaAllSolutionsTitle,a=this._translations.metaAllSolutionsDescription;break;case"deployments":case"deployed-card":i=this._translations.metaDeploymentsTitle,a=this._translations.metaDeploymentsDescription;break;case"resources":i=this._translations.metaResourcesTitle,a=this._translations.metaResourcesDescription;break;case"details":e&&(i=this._translations.metaDetailsTitle.replace("{title}",e.title),a=e.snippet);break}this.metaTagStringsReady.emit({pageType:t,title:i,description:a,detailTemplate:e})}_handleCalciteTabChanged(){this.tabChanged.emit(this._activeTab)}_detailsCardSelected(t){this._activeTab="details",this._detailsTabTitle.value.selected=!0,this._detailsTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail&&(this._selectedDetailsCard=t.detail),this._logTabViewTelemetry("details",this._selectedDetailsCard),this._emitMetaTagStrings("details",this._selectedDetailsCard)}_deployedCardSelected(t){this._activeTab="deployed-card",this._deployedCardTabTitle.value.selected=!0,this._deployedCardTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail?.card&&(this._selectedDeployedCard=t.detail.card),this._logTabViewTelemetry("deployed-card",this._selectedDeployedCard),this._emitMetaTagStrings("deployed-card")}_handleDeployedCardDisplay(t){let{card:e,cardRef:i}=t.detail;this.deployedCardSelected.emit({card:e,cardRef:i})}async _initializeTelemetry(){let t=this._configContextProvider.value;if(!this.authentication||!t)return;let e=await this._telemetryManager.initializeTelemetry(this.authentication,t);this._configContextProvider.value.telemetrySession=e}async _getSolutions(t,e){if(this._isDisconnectedEnvironment)return[];this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let i=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},t,e,this._configContextProvider.value.userSession,this._configContextProvider.value.isEnterprise,this._abortController.signal,{num:1e3});return this._abortController=void 0,this._allCards.length===0&&i?.cards&&(this._allCards=i?.cards),this._allCards}async _getDeployedSolution(t){let e=this._configContextProvider.value.authentication,i=this._configContextProvider.value.userSession;if(e&&i&&e.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let a=F(e);try{let l=await M(e,i,this._cardsFetcher,this._cardFetcherDeployed,D,"created","desc",!1,[],[],this._abortControllerDeployed.signal,a?"My organization's solutions":"My solutions",t);l.cards.length===0||l.cards[0].typeKeywords.indexOf("Deployed")<0?(this._deployCardFetchFailedMessage=this._translations.failedToFetchNotSolution.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):this._deployedSolutions=l}catch(l){let r=l.message;r.indexOf("CONT_0001")>-1||r.indexOf("Item does not exist or is inaccessible.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongId.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):r.indexOf("GWM_0003")>-1||r.indexOf("You do not have permissions to access this resource or perform this operation.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongPermissions.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):(this._showDeployedCardFetchFailed=!0,this._deployCardFetchFailedMessage=""),console.warn(l)}}}_blurTabs(){this._allTabTitle.value?.blur(),this._resourcesTabTitle.value?.blur(),this._detailsTabTitle.value?.blur(),this._mySolutionsTabTitle.value?.blur()}_isSearchToolbarShowing(){return this._activeTab==="all-solutions"||this._activeTab==="deployments"&&this.authentication?.IsSignedIn===!0}_getDefaultSearchOptions(t){let e;if(t){let i=t.domain,a=t.industry==="AEC"?x.AEC:t.industry,l=t.offerType,r=t.searchTerm,E="",d=t.sortField,h=t.owner,b=t.filter;e=i||a?{type:i?"domain":a?"industry":""}:void 0,i&&(e=e?{...e,domain:i}:{domain:i}),a&&(e=e?{...e,industry:a}:{industry:a}),r&&(e=e?{...e,searchTerm:r}:{searchTerm:r}),e&&(e={...e,displayValue:E}),d&&(e=e?{...e,sortType:d}:{sortType:d}),l&&(d=l.toLowerCase(),e=e?{...e,sortType:d}:{sortType:d}),h&&(e=e?{...e,owner:h}:{owner:h}),b&&(e=e?{...e,filter:b}:{filter:b})}return e}_setScrollbarGutters(){let t=this._detailsTab.value?.shadowRoot?.firstElementChild;t?.style&&(t.style.scrollbarGutter="stable both-edges");let e=this._deployedCardTab.value?.shadowRoot?.firstElementChild;e?.style&&(e.style.scrollbarGutter="stable both-edges")}_setRefreshInterval(){let{userSession:t,authentication:e}=this._configContextProvider.value;if(t&&t.tokenDuration&&e?.IsSignedIn){let i=Date.now(),a=(e.Credential?.expires-i)*.95;setInterval(async()=>{if(e.Credential&&e.Credential.expires){await e.Credential?.refreshToken();let l=new Date(e.Credential.expires);t.updateToken(e.Credential.token,l),this.sessionRefreshed.emit(t.token)}},a)}}};C("solutions-deploy-app",m);return m},"identity/IdentityManager","identity/OAuthInfo","portal/Portal",a,b,c,d,e,f,h,i,j,k,l,m)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
+ import e from"./QJ4MQK3Y.js";import{a as V}from"./LLYTIOG4.js";import c from"./5UEEUPL5.js";import"./MQF26HKA.js";import"./G4VIPBRX.js";import{a as L}from"./PZ4L77M5.js";import"./JE7L7M3J.js";import b from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as E}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 T,c as k}from"./VU3OQQKP.js";import{F as d,G as h,H as x,J as p,h as S,i as l,l as m,r as w,s as v,u as $}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([A,G,U,N,u,f,,{g:C,j:I},{a:P,d:O,e:D,f:R}])=>{var M=S`@layer{:host{display:block;--calcite-input-message-spacing-value: 0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-bottom-0{padding-bottom:0!important}.padding-inline-start-0{padding-inline-start:0!important}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-block-start-1{padding-block-start:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-top-1-2{padding-block-start:.5rem!important}.padding-top-1{padding-top:1rem}.indent-group{border-inline-start:1px solid var(--calcite-color-border-2);margin-bottom:.5rem;padding-inline-start:1rem;margin-inline-start:.5rem}.margin-bottom-0-5{margin-bottom:.5rem}.margin-top-0-5{margin-top:.5rem!important}.instructional-text{line-height:1;padding:0!important;margin:0;color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--2)}.info-blue{color:var(--calcite-color-status-info)}.info-message{justify-content:center;display:grid}.font-bold{font-weight:700}.header-label{font-weight:700;font-size:var(--calcite-font-size-0)}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:.5rem}.margin-top-0{margin-block-start:0!important}.margin-top-1{margin-top:1rem!important}.label-margin-0{--calcite-label-margin-bottom: 0}.list-label{color:var(--calcite-color-text-1);font-weight:var(--calcite-font-weight-bold)!important}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3: var(--calcite-color-brand);--calcite-color-foreground-2: var(--calcite-color-brand-hover);--calcite-color-text-1: var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}.list-container{padding:0 1rem 1rem}.list-items{align-items:center;background-color:#fff;box-shadow:0 1px 3px #0000001a;font-family:sans-serif;padding:12px 16px}.list-item{display:flex;align-items:center;justify-content:space-between}.item-label{color:#4a4a4a;font-size:16px}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}calcite-segmented-control{--calcite-segmented-control-border-color: var(--calcite-color-border-2)}calcite-segmented-control-item{--calcite-segmented-control-color: var(--calcite-color-text-3)}calcite-segmented-control-item[checked]{--calcite-segmented-control-border-color: var(--calcite-color-surface-highlight);--calcite-segmented-control-background-color: var(--calcite-color-surface-highlight);--calcite-segmented-control-color: var(--calcite-color-text-highlight)}calcite-action-bar{--calcite-internal-action-bar-gap: 0px;--calcite-internal-action-bar-padding: 0px}}`,b=class extends v{constructor(){super(),this.managedLayers={},this.managedTables=[],this.highlightHandles=[]}removeHandles(){this.highlightHandles.forEach(e=>{e?.remove()}),this.highlightHandles=[]}},y=class extends x{constructor(){super(),this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=!1,this.customExport=!1,this.customExportURL="",this.defaultBufferDistance=0,this.defaultBufferUnit="feet",this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.featureHighlightEnabled=!1,this.noResultText="",this.initialNotice="",this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType="PDF",this._fetchingData=!1,this._isMobile=!1,this._numDuplicates=0,this._pageType="LIST",this._saveEnabled=!1,this._selectionSets=[],this._segmentType="STANDARD",this._selectedReportingLayerId="",this._isInitialLoading=!0,this._layoutTemplates=[],this._translations=E({name:"public-notification",blocking:!0}),this._downloadTools=d(),this.layoutTemplateSelectRef=d(),this.reportTemplateSelectRef=d(),this._onboardingImageUrl="",this._popupsEnabled=!1,this._removeDuplicates=d(),this._selectTools=d(),this._refineSelection=d(),this._titleElement=d(),this._titleValue=void 0,this._numSelected=0,this._pnStateContextProvider=L({context:V}),this._refineGraphics=[],this._reportTemplates=[],this._reportTemplatesInfo=[],this.searchConfigurationChange=w(),this.listenOn(window,"selectionSetsChanged",this.selectionSetsChanged),this._pnState=new b,this._pnStateContextProvider.setValue(this._pnState)}static{this.properties={addresseeLayerIds:0,bufferColor:1,bufferOutlineColor:1,customLabelEnabled:5,customExport:5,customExportURL:1,defaultBufferDistance:9,defaultBufferUnit:1,defaultExportTitle:1,defaultNumLabelsPerPage:9,enableLayerFeatures:5,enableLayerFeaturesOnLoad:5,enableSearchDistance:5,enableSearchDistanceOnLoad:5,enableSketchTools:5,featureEffect:0,featureHighlightEnabled:5,mapView:0,noResultText:1,initialNotice:1,searchConfiguration:0,selectionLayerIds:0,showRefineSelection:5,showSearchSettings:5,sketchLineSymbol:0,sketchPointSymbol:0,sketchPolygonSymbol:0,_exportGraphics:16,_addMap:16,_addResults:16,_addTitle:16,_downloadActive:16,_exportType:16,_fetchingData:16,_isMobile:16,_numDuplicates:16,_pageType:16,_saveEnabled:16,_selectionSets:16,_segmentType:16,_selectedReportingLayerId:16,_isInitialLoading:16,_layoutTemplates:16,_translations:16}}static{this.styles=M}static{this.shadowRootOptions=$}willUpdate(e){e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView),e.has("searchConfiguration")&&this.searchConfiguration&&this.watchSearchConfigurationHandler(this.searchConfiguration,e.get("searchConfiguration")),e.has("sketchLineSymbol")&&this.sketchLineSymbolWatchHandler(this.sketchLineSymbol,e.get("sketchLineSymbol")),e.has("sketchPointSymbol")&&this.sketchPointSymbolWatchHandler(this.sketchPointSymbol,e.get("sketchPointSymbol")),e.has("sketchPolygonSymbol")&&this.sketchPolygonSymbolWatchHandler(this.sketchPolygonSymbol,e.get("sketchPolygonSymbol")),e.has("_pageType")&&(this.hasUpdated||this._pageType!=="LIST")&&this.pageTypeWatchHandler(this._pageType,e.get("_pageType")),(e.has("customExport")||e.has("customExportURL"))&&this.hasUpdated&&this._setTemplates()}async mapViewWatchHandler(e){e?.popup&&(this._popupsEnabled=e?.popupEnabled),this.searchConfiguration&&this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(e,t){let i=JSON.stringify(e);this.mapView&&(i!==JSON.stringify(t)||i&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(i),this._searchConfiguration&&this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setLineSymbol(e)}async sketchPointSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setPointSymbol(e)}async sketchPolygonSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setPolygonSymbol(e)}async pageTypeWatchHandler(e,t){if(this._checkPopups(),this.mapView?.popup&&(this.mapView.popupEnabled=e!=="LIST"?!1:this._popupsEnabled),e==="EXPORT"&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),(t==="SELECT"||t==="REFINE")&&await this._clearSelection(),t==="EXPORT"&&this._removeExportGraphics(),e!=="SELECT")return this._highlightFeatures()}selectionSetsChanged(e){this._selectionSets=[...e.detail]}connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia("(max-width: 600px)"),this.listenOn(this._mediaQuery,"change",e=>this._setIsMobile(e))}async load(){this._initSymbols(),this._onboardingImageUrl=k("assets/public-notification/images/onboarding.png")}render(){let e=this._isMobile?"footer":"header";return l`<calcite-shell>${this._isInitialLoading?l`<calcite-loader label></calcite-loader>`:l`<calcite-action-bar class="border-bottom-1 action-bar-size" expand-disabled layout=horizontal slot=${e??m}>${this._getActionGroup("list-check","LIST",this._translations.myLists)}${this.showRefineSelection?this._getActionGroup("test-data","REFINE",this._translations.refineSelection):null}${this._getActionGroup("export","EXPORT",this._translations.export)}</calcite-action-bar>${this._getPage(this._pageType)}`}</calcite-shell>`}async loaded(){this.searchConfiguration&&this._initSearchConfiguration(this.searchConfiguration),this.customExport&&this.customExportURL&&await this._setTemplates(),this._isInitialLoading=!1}_initSearchConfiguration(e){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=e,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(e){let t=e?.type==="simple-line";this.sketchLineSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(e){let t=e?.type==="simple-marker";this.sketchPointSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(e){let t=e?.type==="simple-fill";this.sketchPolygonSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(e){this._isMobile=e.matches}_getActionGroup(e,t,i){let s=this.showRefineSelection?"w-1-3":"w-1-2";return l`<calcite-action-group class=${p(s)} layout=horizontal><div class="background-override"><calcite-action .active=${this._pageType===t} alignment=center appearance=solid class="width-full height-full" .icon=${e} id=${e??m} @click=${()=>{this._setPageType(t)}} text></calcite-action></div><calcite-tooltip label placement=bottom .referenceElement=${e}><span>${i}</span></calcite-tooltip></calcite-action-group>`}_setPageType(e){this._pageType=e}_getPage(e){let t;switch(e){case"LIST":t=this._getListPage();break;case"SELECT":t=this._getSelectPage();break;case"EXPORT":t=this._getExportPage();break;case"REFINE":t=this._getRefinePage();break}return t}_getListPage(){let e=this._hasSelections(),t=e?this._translations.listHasSetsTip:this.initialNotice!==""?this.initialNotice:this._translations.selectLayerAndAdd;return l`<calcite-panel>${this._getLabel(this._translations.myLists,!1,"header-label")}${this._getNotice(t||"","padding-sides-1 padding-bottom-1","word-wrap-anywhere")}${e?this._getSelectionSetList():this._getOnboardingImage()}<div class="display-flex padding-1"><calcite-button @click=${()=>{this._setPageType("SELECT")}} width=full><span class="font-weight-500">${this._translations.add}</span></calcite-button></div></calcite-panel>`}_getOnboardingImage(){return l`<div class="display-flex padding-sides-1"><img class="img-container" role=presentation src=${this._onboardingImageUrl??m}></div>`}_getSelectionSetList(){return l`<div class="padding-top-1-2 padding-bottom-1-2"><calcite-list class="list-border margin-sides-1" label>${this._selectionSets.reduce((e,t,i)=>{let s=this._getSelectionSetIds(t),a=!0;return t.workflowType==="REFINE"&&(a=Object.keys(t.refineInfos).reduce((o,c)=>{let n=t.refineInfos[c];return o+=n.addIds.length+n.removeIds.length,o},0)>0),a&&e.push(l`<calcite-list-item .label=${t.label} @click=${()=>this.mapView&&this._gotoSelection(t,this.mapView)}><div slot=content><div class="list-label">${t.label}</div><div class="list-description">${t?.layerView?.layer.title}</div><div class="list-description">${this._translations.selectedFeatures.replace("{{n}}",s.length.toString())}</div></div>${this._getAction(!0,"pencil","",o=>this._openSelection(t,o),!1,"actions-end")}${this._getAction(!0,"x","",o=>this._deleteSelection(i,o),!1,"actions-end")}</calcite-list-item>`),e},[])}</calcite-list></div>`}_getSelectionSetIds(e){return e.workflowType!=="REFINE"?e.selectedIds:Object.keys(e.refineInfos).reduce((t,i)=>[...t,...e.refineInfos[i].addIds],[])}_hasSelections(e=!1){let t=[],i=this._selectionSets.some(s=>s.workflowType==="REFINE"?(t=this._getSelectionSetIds(s),!0):!1);return e&&i?t.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){let e=this._getExportInfos(),t=this.mapView?.map&&await P(this.mapView.map,e),i=t&&O(t);return t&&i?t.length-i.length:0}_getExportInfos(){return this._selectionSets.reduce((e,t)=>{if(t.download)if(t.workflowType!=="REFINE"&&t?.layerView){let i=t.layerView.layer.id;i!==void 0&&this._updateIds(i,t.layerView,t.selectedIds,e)}else Object.keys(t.refineInfos).forEach(i=>{let s=t.refineInfos[i];s.addIds.length>0&&this._updateIds(i,s.layerView,s.addIds,e)});return e},{})}_updateIds(e,t,i,s){return s[e]?s[e].ids=s[e].ids.concat(i):s[e]={layerView:t,ids:i},s}_getSelectPage(){let e=this._translations.selectSearchTip;return l`<calcite-panel>${this._getLabel(this._translations?.stepTwoFull,!0,"header-label")}${this._getNotice(e,"padding-1","word-wrap-anywhere")}<div><map-select-tools .bufferColor=${this.bufferColor} .bufferOutlineColor=${this.bufferOutlineColor} class="" .customLabelEnabled=${this.customLabelEnabled} .defaultBufferDistance=${this.defaultBufferDistance} .defaultBufferUnit=${this.defaultBufferUnit} .enableLayerFeatures=${this.enableLayerFeatures} .enableLayerFeaturesOnLoad=${this.enableLayerFeaturesOnLoad} .enableSearchDistance=${this.enableSearchDistance} .enableSearchDistanceOnLoad=${this.enableSearchDistanceOnLoad} .enableSketchTools=${this.enableSketchTools} .enabledLayerIds=${this.addresseeLayerIds} header-label-class .isUpdate=${!!this._activeSelection} .mapView=${this.mapView} .noResultText=${this.noResultText} @selectionSetChange=${this._updateForSelection} .searchConfiguration=${this._searchConfiguration} .searchDistanceEnabled=${this.enableSearchDistanceOnLoad} .selectionLayerIds=${this.selectionLayerIds} .selectionSet=${this._activeSelection} .sketchLineSymbol=${this.sketchLineSymbol} .sketchPointSymbol=${this.sketchPointSymbol} .sketchPolygonSymbol=${this.sketchPolygonSymbol} .useLayerFeaturesEnabled=${this.enableLayerFeaturesOnLoad} ${h(this._selectTools)}></map-select-tools></div>${this._getPageNavButtons(this._translations.done,this._numSelected===0,()=>{this._saveSelection()},this._translations.cancel,!1,()=>{this._home()})}</calcite-panel>`}_getExportPage(){let e=this._hasSelections(this.showRefineSelection),t=this._numDuplicates>0?"display-block":"display-none",i=this.customExport&&this.customExportURL&&this._layoutTemplates.length;return l`<calcite-panel><div>${this._getLabel(this._translations.export,!1,"header-label")}${e?l`<div>${this._getNotice(this._translations.exportTip,"padding-sides-1")}${this._getLabel(this._translations.exportListsLabel,!1,"")}${this._getExportSelectionLists()}<div class=${`padding-sides-1 ${t}`}><div class="display-flex"><calcite-label layout=inline><calcite-checkbox ${h(this._removeDuplicates)}></calcite-checkbox><div class="display-flex">${this._translations.removeDuplicate}<div class="info-message padding-start-1-2"><calcite-input-message class="info-blue margin-top-0" scale=m>${` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`}</calcite-input-message></div></div></calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=remove-duplicates-icon scale=s></calcite-icon></div><calcite-popover closable label overlay-positioning=fixed reference-element=remove-duplicates-icon><span class="tooltip-message">${this._translations.duplicatesTip}</span></calcite-popover></div><div class="border-bottom"></div><div class="segmented-controls padding-top-sides-1">${this._getLabel(this._translations.exportOptions,!0,"","margin-bottom-0-5")}${this._getSegmentedControls()}</div>${i?this._getCustomPrintOptions():l`<div class="padding-1 padding-bottom-0">${this._getExportOptions()}</div>`}<div class="padding-1 display-flex"><calcite-button .disabled=${!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults} .loading=${this._fetchingData} @click=${()=>this._segmentType==="CUSTOM"?this._customExport():void this._standardExport()} width=full><span class="font-weight-500">${this._translations.export}</span></calcite-button></div></div>`:this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")}</div></calcite-panel>`}_customExport(){if(!this.mapView)return;let e=this.layoutTemplateSelectRef.value?this.layoutTemplateSelectRef.value.selectedOption.value:"",t=this.reportTemplateSelectRef.value?this.reportTemplateSelectRef.value.selectedOption.value:"";this._fetchingData=!0;let i=this._reportTemplatesInfo.find(n=>n.reportTemplate===t),s=i?{...i.reportOptions}:{},a=this._selectedReportingLayerId;s?.reportSectionOverrides&&Object.keys(s.reportSectionOverrides).forEach(n=>{s.reportSectionOverrides[n].sourceId=a});let o=new G({layout:e,report:t,format:"pdf",layoutOptions:{titleText:this._titleElement.value?.value},reportOptions:s}),c=new U({view:this.mapView,template:o});N.execute(this.customExportURL,c).then(n=>{let g=this._titleValue;if(!g){let r=this._getSelectionIdsAndViews(this._selectionSets,!0),_=R(r);g=D(_)}n.url&&g&&this._downloadCustomPDF(n.url,g),this._fetchingData=!1}).catch(n=>{this._fetchingData=!1,console.error(n)})}async _downloadCustomPDF(e,t){try{let i=await fetch(e);if(!i.ok)throw new Error(`Failed to fetch PDF: ${i.statusText}`);let s=await i.blob(),a=window.URL.createObjectURL(s),o=document.createElement("a");o.href=a,o.download=t||"download.pdf";let c=document.getElementById("custom-export-div");c&&(c.appendChild(o),o.click(),window.URL.revokeObjectURL(a),c.removeChild(o))}catch(i){console.error("Download failed:",i)}}_exportTypeChange(e){this._exportType=e.target.value}_segmentTypeChange(e){this._titleValue="",this._segmentType=e.target.value}_getSegmentedControls(){return this.customExport&&this.customExportURL&&this._layoutTemplates.length?this._getStandardAndCustomSegmentedControl():this._getPDFAndCSVSementedControl()}_getPDFAndCSVSementedControl(){return l`<calcite-segmented-control class="w-100 calcite-segments" @calciteSegmentedControlChange=${this._exportTypeChange} width=full><calcite-segmented-control-item .checked=${this._exportType==="PDF"} class="w-50 end-border" value=PDF><span class="font-weight-500">${this._translations.pdf}</span></calcite-segmented-control-item><calcite-segmented-control-item .checked=${this._exportType==="CSV"} class="w-50" value=CSV><span class="font-weight-500">${this._translations.csv}</span></calcite-segmented-control-item></calcite-segmented-control>`}_getStandardAndCustomSegmentedControl(){return l`<calcite-segmented-control class="w-100 calcite-segments" @calciteSegmentedControlChange=${this._segmentTypeChange} width=full><calcite-segmented-control-item .checked=${this._segmentType==="STANDARD"} class="w-50 end-border" value=STANDARD><span class="font-weight-500">${this._translations.standard}</span></calcite-segmented-control-item><calcite-segmented-control-item .checked=${this._segmentType==="CUSTOM"} class="w-50" value=CUSTOM><span class="font-weight-500">${this._translations.custom}</span></calcite-segmented-control-item></calcite-segmented-control>`}_getCustomPrintOptions(){return this._segmentType==="STANDARD"?this._getStandardExportOptions():this._getCustomExportOptions()}_getStandardExportOptions(){return l`<div class="padding-1 padding-bottom-0"><calcite-label layout=inline alignment=start scale=m><calcite-radio-button .checked=${this._exportType==="PDF"} scale=m value=PDF @calciteRadioButtonChange=${this._exportTypeChange}></calcite-radio-button>${this._translations.pdf}</calcite-label><div class=indent-group>${this._getExportOptions()}</div><calcite-label layout=inline class="margin-top-1" alignment=start scale=m><calcite-radio-button .checked=${this._exportType==="CSV"} scale=m value=CSV @calciteRadioButtonChange=${this._exportTypeChange}></calcite-radio-button>${this._translations.csv}</calcite-label></div>`}_getCustomExportOptions(){let e=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",t=[],i=this._getSelectionIdsAndViews(this._selectionSets,!0);return Object.keys(i).forEach(s=>{i[s].ids.length&&t.push(s)}),l`<div id=custom-export-div class="padding-top-sides-1"><p class="instructional-text">${this._translations.formattingTip}</p>${t.length>1&&l`<p class="instructional-text margin-top-0-5">${this._translations.selectMatchingInputLayersLabel}</p>`||""}<div class=${"margin-top-1"}>${this._getLabel(this._translations.title,!0,"","none")}<calcite-input-text class="padding-inline-start-0 padding-top-1-2" @calciteInputTextInput=${()=>this._changeTitle()} .placeholder=${this._translations.titlePlaceholder} .value=${e} ${h(this._titleElement)}></calcite-input-text></div><div class=${"margin-top-1"}>${this._getLabel(this._translations.layoutTemplate,!0,"","none")}</div><calcite-select class="padding-inline-start-0 padding-top-1-2" label ${h(this.layoutTemplateSelectRef)}>${this._layoutTemplates.map((s,a)=>l`<calcite-option .selected=${a===0} .value=${s}>${s}</calcite-option>`)}</calcite-select>${this._reportTemplates?.length&&l`<div class=${"margin-top-1"}>${this._getLabel(this._translations.reportTemplate,!0,"","none")}</div><calcite-select class="padding-inline-start-0 padding-top-1-2" label ${h(this.reportTemplateSelectRef)}>${this._reportTemplates.map((s,a)=>l`<calcite-option .selected=${a===0} .value=${s}>${s}</calcite-option>`)}</calcite-select><div class=${"padding-top-sides-1 padding-inline-start-0 display-flex margin-bottom-0-5"}><calcite-label class="label-margin-0" layout=inline>${this._translations.reportLayer}</calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=information id=filter-message-info scale=s></calcite-icon><calcite-popover closable label overlay-positioning=fixed reference-element=filter-message-info><span class="tooltip-message">${this._translations.sourceLayerWarning}</span></calcite-popover></div><map-layer-picker .disabled=${t.length<=1} .enabledLayerIds=${t} .mapView=${this.mapView} @layerSelectionChange=${s=>{this._selectedReportingLayerId=s.detail[0]}} .selectedIds=${[this._selectedReportingLayerId]}></map-layer-picker>`||""}</div>`}async _setTemplates(){if(!this.customExportURL||!this.customExport){this.resetCustomExport();return}let e=this.customExportURL,t=`${e.split("/GPServer")?.[0]}/GPServer`;try{let i=await this.getTasksInfo(t),s="",a=i.tasks?.map(async r=>{await this.getTaskType(r,t)==="GetReportTemplatesInfo"&&(s=`${t}/${r}`)});a&&await Promise.all(a),s&&i.executionType&&await this._fetchReportTemplates(s,i.executionType);let o=(await f(e,{authMode:"auto",responseType:"json",query:{f:"json"}}))?.data,c=o.parameters.find(r=>r.name==="Layout_Template"&&Array.isArray(r.choiceList)),n=o.parameters.find(r=>r.name==="Report_Template"&&Array.isArray(r.choiceList));this._layoutTemplates=c?c.choiceList:[];let g=n?n.choiceList:[];this._reportTemplates=this._reportTemplatesInfo.length?g.filter(r=>this._reportTemplatesInfo.some(_=>_.reportTemplate===r)):[]}catch(i){this.resetCustomExport(),console.error(i)}}resetCustomExport(){this._layoutTemplates=[],this._reportTemplates=[],this._segmentType="STANDARD"}async getTaskType(e,t){if(!e||!t)return Promise.resolve("");let i=`${t}/${e}`;try{let s=(await f(i,{authMode:"auto",responseType:"json",query:{f:"json"}}))?.data?.name||"";return Promise.resolve(s)}catch(s){return console.error(s),Promise.resolve("")}}async getTasksInfo(e){if(!e)return Promise.resolve({});let t=`${e}?f=json`,i={authMode:"auto",responseType:"json",query:{f:"json"}};try{let s=(await f(t,i))?.data,a=s?.tasks,o=s?.executionType==="esriExecutionTypeSynchronous"?"execute":"submitJob";return{tasks:a,supportedOperations:o,executionType:s?.executionType}}catch(s){return this.resetCustomExport(),console.error(s),{}}}async _fetchReportTemplates(e,t){if(e)try{if(t==="esriExecutionTypeSynchronous"){let i=(await u.execute(e,{}))?.results?.find(s=>s.paramName==="Output_JSON");this._reportTemplatesInfo=i?.value??[]}else{let i=await u.submitJob(e,{});await i.waitForJobCompletion();let s=await i.fetchResultData("Output_JSON");this._reportTemplatesInfo=s?.value??[]}this._reportTemplatesInfo=this._reportTemplatesInfo.filter(i=>{let s=i.reportOptions;if(s?.reportSectionOverrides){let a=0;return Object.keys(s.reportSectionOverrides).forEach(o=>{s.reportSectionOverrides[o].hasOwnProperty("sourceId")&&a++}),a<=1}else return!0})}catch(i){console.error("Failed to fetch report templates:",i)}}_getExportOptions(){let e=this._exportType==="PDF"?"display-block":"display-none",t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",a=this._addResults?"":"display-none";return l`<div class=${p(e)}><p class="instructional-text">${this._translations.selectContentTip}</p><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addResults} @calciteCheckboxChange=${()=>this._addResults=!this._addResults}></calcite-checkbox>${this._translations.addResults}</calcite-label></div><div class=${`indent-group margin-top-1 ${a}`}><div class="margin-bottom-0-5"><calcite-label class="label-margin-0">${this._translations.selectPDFLabelOption}</calcite-label></div><div><pdf-download .defaultNumLabelsPerPage=${Number.parseInt(this.defaultNumLabelsPerPage.toString(),10)} .disabled=${!this._downloadActive} ${h(this._downloadTools)}></pdf-download></div></div><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addTitle} @calciteCheckboxChange=${()=>this._addTitle=!this._addTitle}></calcite-checkbox>${this._translations.title}</calcite-label></div><div class=${`${t} indent-group margin-top-0-5`}><calcite-input-text class="padding-inline-start-0 padding-top-1-2" @calciteInputTextInput=${()=>this._changeTitle()} .placeholder=${this._translations.titlePlaceholder} .value=${s} ${h(this._titleElement)}></calcite-input-text></div><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addMap} @calciteCheckboxChange=${()=>this._handleAddMapChange()}></calcite-checkbox>${this._translations.includeMap}</calcite-label></div><div class=${`padding-top-sides-1 padding-inline-start-0 ${i}`}><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._exportGraphics} @calciteCheckboxChange=${()=>this._handleExportGraphicsChange()}></calcite-checkbox>${this._translations.listGraphics}</calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=list-graphics-icon scale=s></calcite-icon><calcite-popover closable label overlay-positioning=fixed reference-element=list-graphics-icon><span class="tooltip-message">${this._translations.listGraphicsTip}</span></calcite-popover></div></div>`}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(e){let t,i=this._pnStateContextProvider.value;return Object.keys(i.managedLayers).some(s=>{let a=this.mapView?.map.layers.findIndex(o=>o.title===s);return i.managedLayers[s]===e&&a!==void 0?(t=this.mapView?.map.layers.getItemAt(a),!0):!1}),t}_updateExportGraphics(e=!1){(e||!this._exportGraphics||!this._addMap)&&this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){let e=this._getManagedLayer("sketch"),t=this._getManagedLayer("buffer");e&&e.graphics.removeAll(),t&&t.graphics.removeAll()}_addExportGraphics(){let e=this._getManagedLayer("sketch"),t=this._getManagedLayer("buffer");this._refineGraphics.forEach(i=>{e?.add(i.drawnGraphic),t?.add(i.bufferGraphic)}),this._selectionSets.forEach(i=>{if(i.download&&(e&&i.sketchGraphic&&e.graphics.add(i.sketchGraphic),t)){let s={type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}},a=new A({geometry:i.buffer,symbol:s});a&&t.graphics.add(a)}})}_getRefinePage(){let e=this._hasSelections();return l`<calcite-panel>${this._getLabel(this._translations.refineSelection,!1,"header-label")}${e?l`<div>${this._getNotice(this._translations.refineTip,"padding-sides-1")}<refine-selection .enabledLayerIds=${this.selectionLayerIds} .mapView=${this.mapView} .drawnGraphicsArr=${this._refineGraphics} .selectionSets=${this._selectionSets} .sketchLineSymbol=${this.sketchLineSymbol} .sketchPointSymbol=${this.sketchPointSymbol} .sketchPolygonSymbol=${this.sketchPolygonSymbol} .bufferColor=${this.bufferColor} .bufferOutlineColor=${this.bufferOutlineColor} .defaultBufferDistance=${this.defaultBufferDistance} .defaultBufferUnit=${this.defaultBufferUnit} .enableSearchDistance=${this.enableSearchDistance} .enableSearchDistanceOnLoad=${this.enableSearchDistanceOnLoad} .searchDistanceEnabled=${this.enableSearchDistanceOnLoad} ${h(this._refineSelection)}></refine-selection></div>`:this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1")}</calcite-panel>`}_getPageNavButtons(e,t,i,s,a,o){return l`<div class="padding-bottom-1"><div class="display-flex padding-top-sides-1"><calcite-button .disabled=${t} @click=${i} width=full><span class="font-weight-500">${e}</span></calcite-button></div><div class="display-flex padding-top-1-2 padding-sides-1"><calcite-button appearance=outline .disabled=${a} @click=${o} width=full><span class="font-weight-500">${s}</span></calcite-button></div></div>`}_changeTitle(){this._titleElement.value?.value&&(this._titleValue=this._titleElement.value.value||"")}_getNotice(e,t="padding-1",i=""){return l`<calcite-notice class=${p(t)} icon=lightbulb kind=success open><div class=${p(i)} slot=message>${e}</div></calcite-notice>`}_getLabel(e,t=!1,i="font-bold",s="padding-top-sides-1"){return i+=t?" label-margin-0":"",l`<div class=${p(s)}><calcite-label class=${p(i)}>${e}</calcite-label></div>`}_getExportSelectionLists(){return this._selectionSets.reduce((e,t)=>{let i=this._getSelectionSetIds(t),s=t.workflowType!=="REFINE"||i.length>0;return!this._downloadActive&&t.download&&s&&(this._downloadActive=!0),s&&e.push(l`<div class="display-flex padding-sides-1 padding-bottom-1"><calcite-checkbox .checked=${t.download} class="align-center" @calciteCheckboxChange=${()=>{this._toggleDownload(t.id)}}></calcite-checkbox><calcite-list class="list-border margin-start-1-2 width-full" id=download-list label><calcite-list-item .disabled=${!t.download} .label=${t.label} @click=${()=>{this._toggleDownload(t.id)}}><div slot=content><div class="list-label">${t.label}</div><div class="list-description">${t.layerView?.layer.title}</div><div class="list-description">${this._translations.selectedFeatures.replace("{{n}}",i.length.toString())}</div></div></calcite-list-item></calcite-list></div>`),e},[])||l`<div></div>`}async _toggleDownload(e){let t=!1;this._selectionSets=this._selectionSets.map(i=>{let s=!1;return i.refineInfos&&Object.keys(i.refineInfos).forEach(a=>{i.refineInfos[a].addIds.length&&(s=!0)}),(i.workflowType!=="REFINE"||s)&&(i.download=i.id===e?!i.download:i.download,t=i.download?!0:t),i}),this._updateExportGraphics(!0),this._downloadActive=t,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _standardExport(){let e=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType==="PDF"){let t="";this._addMap&&this.mapView&&(t=(await this.mapView.takeScreenshot({width:1500,height:2e3}))?.dataUrl),this._fetchingData=!0,this._downloadTools.value&&this._removeDuplicates.value&&this.mapView?.map&&await this._downloadTools.value.downloadPDF(this.mapView.map,e,this._removeDuplicates.value.checked,this._addTitle&&this._titleElement.value?this._titleElement.value.value:"",t),this._fetchingData=!1}this._exportType==="CSV"&&(this._fetchingData=!0,this._downloadTools.value&&this.mapView?.map&&await this._downloadTools.value.downloadCSV(this.mapView.map,e,this._removeDuplicates.value?.checked||!1),this._fetchingData=!1)}_getSelectionIdsAndViews(e,t=!1){return(t?e.filter(i=>i.download):e).reduce((i,s)=>{if(s.workflowType==="REFINE")Object.keys(s.refineInfos).forEach(a=>{let o=s.refineInfos[a];if(o.addIds){let c=o.layerView.layer.id;i=this._updateExportInfos(i,c,s.label,o.addIds,o.layerView)}});else{let a=s?.layerView?.layer.id;a!==void 0&&s.layerView&&(i=this._updateExportInfos(i,a,s.label,s.selectedIds,s.layerView))}return i},{})}_updateExportInfos(e,t,i,s,a){return t&&Object.keys(e).indexOf(t)>-1?(e[t].ids=[...new Set([...e[t].ids,...s])],e[t].selectionSetNames.push(i)):t&&(e[t]={ids:s,layerView:a,selectionSetNames:[i]}),e}_getAction(e,t,i,s,a=!1,o=""){return l`<calcite-action appearance=solid .disabled=${!e} .icon=${t} icon-flip-rtl .indicator=${a} @click=${s} slot=${o??m} .text=${i}></calcite-action>`}_updateForSelection(e){this._numSelected=e.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType("LIST")}async _saveSelection(){let e=await this._selectTools.value?.getSelection();if(e){let t=this._selectTools.value?.isUpdate;this._selectionSets=t?this._selectionSets.map(i=>i.id===e.id?e:i):[...this._selectionSets,e]}return this._home()}async _clearSelection(){await this._selectTools.value?.clearSelection(),this._numSelected=0,this._activeSelection=void 0}async _deleteSelection(e,t){return t.stopPropagation(),this._selectionSets=this._selectionSets.filter((i,s)=>(i.workflowType==="REFINE"&&(this._refineGraphics=[]),s!==e?i:!1)),this._highlightFeatures()}_gotoSelection(e,t){e.selectedIds&&e.layerView&&I(e.selectedIds,e.layerView,t,this.featureHighlightEnabled,this.featureEffect)}_openSelection(e,t){t.stopPropagation(),this._activeSelection=e,this._pageType=e.workflowType==="REFINE"?"REFINE":"SELECT"}async _highlightFeatures(){let e=this._pnStateContextProvider.value;this._clearHighlight();let t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType==="EXPORT"),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){let a=t[i[s]];if(a.layerView&&this.mapView){let o=await C(a.ids,a.layerView,this.mapView);e.highlightHandles.push(o)}}}_checkPopups(){typeof this._popupsEnabled!="boolean"&&(this._popupsEnabled=!!this.mapView?.popupEnabled)}_clearHighlight(){let e=this._pnStateContextProvider.value;e&&e.highlightHandles&&e.removeHandles()}};T("public-notification",y);return y},"Graphic","rest/support/PrintTemplate","rest/support/PrintParameters","rest/print","rest/geoprocessor","request",a,b,c,e)
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a}from"./VU3OQQKP.js";import{v as e}from"./46DQNAMV.js";import"./OR4HXHSY.js";var o=e(a,{"arcgis-solutions-assistant":[()=>import("./DZUVI4S3.js"),"_translations:,open,serverRoot,userFirstName;handleSendMessage,loopRequest,requestAIServer;resetChat"],"buffer-tools":[()=>import("./ZYTKA3NP.js"),"_translations:,appearance,disabled,distance,geometries:,max,min,sliderTicks,unionResults,unit;getTranslatedUnit"],"card-manager":[()=>import("./MMZXFDQZ.js"),"_translations:,createBtnLabel,customInfoText,enableCreateFeatures,enableEditGeometry,enableSnapping,isMobile,layerOrTable:,mapView:,selectedFeaturesIds:,selectingFeatureFromMap,showSketchWidgets,zoomAndScrollToSelected"],"consent-manager":[()=>import("./FLK4LATH.js"),"_translations:,amazonAppId,amazonAppName,amazonUserPoolID,amazonVersion,firstUseVar,measurementIds:,portal:;getInstance"],"create-feature":[()=>import("./54WM76XB.js"),"_translations:,aiImageExtraction:,allowMultipleCreation,appName,customizeSubmit,enablePhotoLocation,enableSearch,enableSnapping,floorLevel,formElements,isMobile,mapView:,popupEnabled,reportingArea,reportingAreaLayer,reportingAreaMessage,searchConfiguration:,selectedLayerId,showGuidingMsg,showLayerVisibilityMsg,showSketchWidgets,submitNewReportsMessage,updateMapPosition;refresh,showForm,submit"],"create-related-feature":[()=>import("./C43NWBRR.js"),"_translations:,customizeSubmit,enableSnapping,mapView:,selectedFeature:,showGuidingMsg,table:;submit"],"crowdsource-manager":[()=>import("./4OZQG5MW.js"),"_translations:,appLayout,appProxies,basemapConfig:,coverPageEnabled,customInfoText,defaultAppLayout,defaultCenter,defaultGlobalId,defaultLayer,defaultLevel,defaultOid,defaultWebmap,enableAutoRefresh,enableBasemap,enableColumnReorder,enableCSV,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapList,enableSearch,enableSelectionTool,enableShare,enableSnapping,enableZoom,featureSelectionMode,honorMapFieldSettings,introductionWindowEnabled,mapInfos:,onlyShowUpdatableLayers,popupHeaderColor,popupHeaderHoverColor,popupHeaderHoverTextColor,popupHeaderTextColor,searchConfiguration:,shareIncludeEmbed,shareIncludeSocial,showNewestFirst,theme,visibilityIcon,zoomAndScrollToSelected,zoomToScale"],"crowdsource-reporter":[()=>import("./LTBO6VJF.js"),"_translations:,aiImageExtraction:,center,commentButtonText,commentSubmittedMessage,defaultWebmap,description,enableAnonymousAccess,enableAnonymousComments,enableComments,enableHome,enableLogin,enableNewReports,enablePhotoLocation,enableSearch,enableSnapping,enableZoom,filterByMapExtent,floorLevel,isMobile,layerExpressions:,layerId,level,loginTitle,mapInfos:,mapView:,objectId,reportButtonText,reportingArea,reportingAreaLayer,reportingAreaMessage,reportingOptions:,reportsHeader,reportSubmittedMessage,searchConfiguration:,showComments,showFeatureSymbol,showFullCommentTitle,showMyReportsOnly,showUserImageInCommentsList,sortOption,submitNewReportsMessage,theme,zoomToScale;updateLayerExpressionsT9n"],"deduct-calculator":[()=>import("./TBJLV2A3.js")],"delete-button":[()=>import("./BFHVGXZN.js"),"_translations:,buttonType,deleteDialog,disabled,icon,ids:,layer:,showDeleteCount"],"delete-dialog":[()=>import("./W53A2CNH.js"),"_translations:,ids:,layer:,open"],"edit-card":[()=>import("./ASSNR5JI.js"),"_translations:,allowMultipleEditing,enableEditGeometry,enableSnapping,graphicIndex,graphics:,mapView:,open"],"feature-details":[()=>import("./OLDYKR5E.js"),"enableSnapping,graphics:,layerItemsHash:,mapView:,reportingOptions:,showFullCommentTitle,showUserImageInCommentsList;back,next,refresh,toggleListView"],"feature-list":[()=>import("./D2QNPQWY.js"),"_translations:,applyLayerViewFilter,filterByMapExtent,highlightOnHover,highlightOnMap,mapView:,noFeaturesFoundMsg,pageSize,reportingOptions:,selectedLayerId,showErrorWhenNoFeatures,showFeatureSymbol,showFullTitle,showInitialLoading,showUserImageInList,sortingInfo:,textSize,whereClause;refresh"],"field-selection":[()=>import("./6LPOLFT7.js"),"_translations:,configExtraFields,layer:,mapView:,table:,tableRef:"],"info-card":[()=>import("./N5YBX6NM.js"),"_translations:,allowEditing,enableEditGeometry,enableSnapping,graphics:,highlightEnabled,isLoading,isMobile,mapView:,paginationEnabled,position,showCloseBtn;back,getSelectedFeature,next,refresh,toggleListView,updateCurrentGraphic"],"layer-list":[()=>import("./FUUWSZIZ.js"),"_translations:,applyLayerViewFilter,filterByMapExtent,layers:,mapView:,showFeatureCount,showNextIcon;refresh"],"layer-list-widget":[()=>import("./WZZG5H7Q.js"),"layerListWidget:,mapView:,visibilityIcon"],"layer-table":[()=>import("./VCH6XDEH.js"),"_translations:,appLayout,defaultGlobalId:,defaultLayerId,defaultOid:,enableAutoRefresh,enableColumnReorder,enableCSV,enableInlineEdit,enableShare,enableTableAutosave,featureSelectionMode,honorMapFieldSettings,isMobile,mapHidden,mapInfo:,mapView:,selectedIds:,selectedRelatedIds:,shareIncludeEmbed,shareIncludeSocial,showNewestFirst,showOnlyUpdatableLayers,zoomAndScrollToSelected,zoomToScale;closeFilter,filterReset,filterUpdate,refresh,setColumnOrder,validateActiveEdits,validateTableUpdate"],"map-basemap-gallery":[()=>import("./ZQJ2QLO5.js"),"basemapConfig:,basemapWidget:,mapView:"],"map-card":[()=>import("./3M6AYSM7.js"),"_translations:,appLayout,appProxies,basemapConfig:,defaultLayerId,defaultWebmapId,enableBasemap,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapLayerPicker,enableMapPicker,enableSearch,enableSelectionTool,enableShare,enableSingleExpand,featureSelectionMode,hide,isMapLayout,isMobile,mapInfo:,mapInfos:,mapToolsOrder:,mapView:,mapWidgetsIndex,mapWidgetsPosition,mapWidgetsSize,mobileMapWidgetsPosition,mobileToolsOrder:,selectedFeaturesIds:,selectedLayer:,shareIncludeEmbed,shareIncludeSocial,showOnlyUpdatableLayers,stackTools,theme,visibilityIcon,zoomToolsSize,zoomToScale;resetFilter,updateFilterState,updateLayer"],"map-draw-tools":[()=>import("./2J6ZHQEF.js"),"_translations:,active,drawMode,editGraphicsEnabled,graphics:,mapView:,pointSymbol:,polygonSymbol:,polylineSymbol:,redoEnabled,undoEnabled;clear,updateGraphics"],"map-floor-filter":[()=>import("./TUGGGATS.js"),"enabled,floorFilterWidget:,mapView:"],"map-fullscreen":[()=>import("./BGO3JXY3.js"),"fullscreenWidget:,mapView:"],"map-layer-picker":[()=>import("./QXLM22NS.js"),"_translations:,appearance,configLayerOrderDefined,defaultLayerId,disabled,display,enabledLayerIds:,height,isMobile,mapView:,placeholderIcon,referenceElement,scale,selectedIds:,showLayersListInPopover,showOnlyUpdatableLayers,showSingleLayerAsLabel,showTables,showTablesDisabled,type;setLayerById,setLayerByIds,updateLayer"],"map-legend":[()=>import("./B5SYTUTT.js"),"legendWidget:,mapView:"],"map-picker":[()=>import("./FZ4NFB5R.js"),"_translations:,height,isMapLayout,mapInfos:,referenceElement,selectedWebMapId,showMapListInPopover;close,setMapByID,toggle"],"map-search":[()=>import("./VDDTJAF2.js"),"mapView:,popupEnabled,resultGraphicEnabled,searchConfiguration:,searchTerm,searchWidget:"],"map-select-tools":[()=>import("./VYTGCKEU.js"),"_translations:,bufferColor,bufferOutlineColor,customLabelEnabled,defaultBufferDistance,defaultBufferUnit,enabledLayerIds:,enableLayerFeatures,enableLayerFeaturesOnLoad,enableSearchDistance,enableSearchDistanceOnLoad,enableSketchTools,geometries:,headerLabelClass,isUpdate,layerViews:,mapView:,noResultText,searchConfiguration:,searchDistanceEnabled,selectionLayerIds:,selectionSet:,selectLayerView:,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:,useLayerFeaturesEnabled;clearSelection,getSelection"],"map-tools":[()=>import("./ZRCMN3AQ.js"),"_translations:,basemapConfig:,defaultLayerId,enableBasemap,enabledLayerIds:,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapLayerPicker,enableMapPicker,enableSearch,enableSelectionTool,enableSingleExpand,isMobile,layout,mapInfo:,mapInfos:,mapView:,mapWidgetsSize,parentComponentHeight,parentComponentWidth,position,searchConfiguration:,selectedFeaturesIds:,selectedLayer:,selectedWebMapId,selectionTools:,showOnlyUpdatableLayers,stackTools,toolOrder:,visibilityIcon,zoomToolsSize"],"pci-calculator":[()=>import("./NQF577F4.js")],"pdf-download":[()=>import("./5VP4DXWE.js"),"_translations:,defaultNumLabelsPerPage,disabled;downloadCSV,downloadPDF"],"public-notification":[()=>import("./I2FILQIE.js"),"_translations:,addresseeLayerIds:,bufferColor,bufferOutlineColor,customExport,customExportURL,customLabelEnabled,defaultBufferDistance,defaultBufferUnit,defaultExportTitle,defaultNumLabelsPerPage,enableLayerFeatures,enableLayerFeaturesOnLoad,enableSearchDistance,enableSearchDistanceOnLoad,enableSketchTools,featureEffect:,featureHighlightEnabled,initialNotice,mapView:,noResultText,searchConfiguration:,selectionLayerIds:,showRefineSelection,showSearchSettings,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:"],"refine-selection":[()=>import("./NXG2TZQJ.js"),"_translations:,addresseeLayer:,bufferColor,bufferOutlineColor,defaultBufferDistance,defaultBufferUnit,drawnGraphicsArr:,enabledLayerIds:,enableSearchDistance,enableSearchDistanceOnLoad,geometries:,mapView:,searchDistanceEnabled,selectionSets:,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:"],"selection-tool":[()=>import("./HLPUNGB5.js"),"mapView:,selectedLayerId,tool;toggleSelectionTool"],"solution-configure-titles":[()=>import("./UR6OMPID.js"),"_translations:,card:,open,solutionData,source,templateInfos:"],"solution-delete-dialog":[()=>import("./XUFPQNGT.js"),"_translations:,card:,open,source;;close,delete"],"solution-deploy-dialog":[()=>import("./JQO5U72D.js"),"_translations:,card:,debugFailDeployment,open,userOptions:;;close,deploy"],"solution-deployed-card":[()=>import("./JN4HYWSX.js"),"_translations:,card:,deployedDate,description,diagramKey,heading,itemId,owner,templateInfos:,thumbnail,updateAvailable;getTemplates,renderDeleteDialog,renderDiagramDialog"],"solution-deployed-card-panel":[()=>import("./ERFCQNCV.js"),"_translations:,card:,cardRef,diagramKey,open,templateInfos:"],"solution-deploying-dialog":[()=>import("./NZYAEBC7.js"),"_translations:,abortController:,card:,deploymentProgress,isWaitingForCard,open;;cancelDeployment,close,confirmCancel"],"solution-details-card":[()=>import("./LGUC7DRT.js"),"_translations:,card:,referrerSolutionId,referrerSolutionTitle,referrerSolutionVersion,source"],"solution-details-panel":[()=>import("./HPBIBS4W.js"),"_translations:,card:"],"solution-item-accordion":[()=>import("./BHHQFUCH.js"),"_translations:,itemRelationshipDependencies:,linkType,listSelectionMode,reuseWarning,templateInfos:,typeKeywords:;collapseAll,deselectAll,expandFirstItem,expandItemById,expandItems,selectFirstItem,selectItem,selectItems"],"solution-item-diagram":[()=>import("./AJRYDDC7.js"),"_translations:,diagramKey,templateInfoGraph:,typeKeywords:"],"solution-item-icon":[()=>import("./UDPPJCXC.js"),"isPortal,type,typeKeywords:"],"solution-resource-card":[()=>import("./HNRZHAOD.js"),"_translations:,description,heading,headingEn,icon,meridianIcon,sectionHeadingEn,url"],"solution-snapshot-gallery":[()=>import("./BNQ63VOG.js"),"_translations:,card:,itemProperties:,open,screenshot:"],"solution-social-share":[()=>import("./RDWJHF5P.js"),"_translations:,actionApperance,autoUpdateShareUrl,buttonAppearance,inlineSuccessPopoverPlacement,mode,popoverButtonIconScale,popoverPositioning,removePopoverOffset,scale,shareButtonKind,shareButtonScale,shareButtonText,shareButtonType,shareIconsLayout,shareText,shareUrl,shortenShareUrl,socialMedia,solutionId,solutionTitle,solutionVersion,successMessage"],"solution-user-avatar":[()=>import("./HAAFUV3J.js"),"fullname,lookupProfile,thumbnailUrl,username"],"solutions-all-panel":[()=>import("./Y3FTYVXY.js"),"_translations:,sortType;searchSolutions,setSearchOptions"],"solutions-all-shell":[()=>import("./XFEOA56B.js"),"_translations:,solutionsCount;searchSolutions"],"solutions-deploy-app":[()=>import("./BF65YN5N.js"),"_translations:,appConfig,initTab,initTitleOrId,sortType,useLocalAppConfig;selectTab"],"solutions-deploy-app-nav":[()=>import("./N7RLYKQG.js"),"_translations:,appConfig,initTab;;activateMenuItem,clearMenuItems"],"solutions-deployed-panel":[()=>import("./KVR3XE7B.js"),"_translations:,sortType;reload,searchSolutions,setSearchOptions"],"solutions-deployed-shell":[()=>import("./E4L5GTBZ.js"),"_translations:,solutionsCount;searchSolutions"],"solutions-filter-panel":[()=>import("./2642PFUF.js"),"_translations:,hideIndustryFilter,isAIDialogOpen,showReset;;changeIndustryFilter,clearFilters"],"solutions-resources-section":[()=>import("./V65IKENN.js"),"cards,heading,subheading"],"solutions-resources-shell":[()=>import("./QKGOQ7EC.js"),"_translations:"],"solutions-searchsort-toolbar":[()=>import("./TAXUQXTN.js"),"_translations:,defaultSortType,isOrgSolutions,scope;;changeOwnerFilter,changeSearchFilter,sortChanged"]});o({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-solutions-assistant,buffer-tools,card-manager,consent-manager,create-feature,create-related-feature,crowdsource-manager,crowdsource-reporter,deduct-calculator,delete-button,delete-dialog,edit-card,feature-details,feature-list,field-selection,info-card,layer-list,layer-list-widget,layer-table,map-basemap-gallery,map-card,map-draw-tools,map-floor-filter,map-fullscreen,map-layer-picker,map-legend,map-picker,map-search,map-select-tools,map-tools,pci-calculator,pdf-download,public-notification,refine-selection,selection-tool,solution-configure-titles,solution-delete-dialog,solution-deploy-dialog,solution-deployed-card,solution-deployed-card-panel,solution-deploying-dialog,solution-details-card,solution-details-panel,solution-item-accordion,solution-item-diagram,solution-item-icon,solution-resource-card,solution-snapshot-gallery,solution-social-share,solution-user-avatar,solutions-all-panel,solutions-all-shell,solutions-deploy-app,solutions-deploy-app-nav,solutions-deployed-panel,solutions-deployed-shell,solutions-filter-panel,solutions-resources-section,solutions-resources-shell,solutions-searchsort-toolbar){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,a)
2
+ import{a}from"./VU3OQQKP.js";import{v as e}from"./46DQNAMV.js";import"./OR4HXHSY.js";var o=e(a,{"arcgis-solutions-assistant":[()=>import("./DZUVI4S3.js"),"_translations:,open,serverRoot,userFirstName;handleSendMessage,loopRequest,requestAIServer;resetChat"],"buffer-tools":[()=>import("./ZYTKA3NP.js"),"_translations:,appearance,disabled,distance,geometries:,max,min,sliderTicks,unionResults,unit;getTranslatedUnit"],"card-manager":[()=>import("./MMZXFDQZ.js"),"_translations:,createBtnLabel,customInfoText,enableCreateFeatures,enableEditGeometry,enableSnapping,isMobile,layerOrTable:,mapView:,selectedFeaturesIds:,selectingFeatureFromMap,showSketchWidgets,zoomAndScrollToSelected"],"consent-manager":[()=>import("./55CA3AGN.js"),"_translations:,amazonAppId,amazonAppName,amazonUserPoolID,amazonVersion,firstUseVar,measurementIds:,portal:;getInstance"],"create-feature":[()=>import("./54WM76XB.js"),"_translations:,aiImageExtraction:,allowMultipleCreation,appName,customizeSubmit,enablePhotoLocation,enableSearch,enableSnapping,floorLevel,formElements,isMobile,mapView:,popupEnabled,reportingArea,reportingAreaLayer,reportingAreaMessage,searchConfiguration:,selectedLayerId,showGuidingMsg,showLayerVisibilityMsg,showSketchWidgets,submitNewReportsMessage,updateMapPosition;refresh,showForm,submit"],"create-related-feature":[()=>import("./C43NWBRR.js"),"_translations:,customizeSubmit,enableSnapping,mapView:,selectedFeature:,showGuidingMsg,table:;submit"],"crowdsource-manager":[()=>import("./4OZQG5MW.js"),"_translations:,appLayout,appProxies,basemapConfig:,coverPageEnabled,customInfoText,defaultAppLayout,defaultCenter,defaultGlobalId,defaultLayer,defaultLevel,defaultOid,defaultWebmap,enableAutoRefresh,enableBasemap,enableColumnReorder,enableCSV,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapList,enableSearch,enableSelectionTool,enableShare,enableSnapping,enableZoom,featureSelectionMode,honorMapFieldSettings,introductionWindowEnabled,mapInfos:,onlyShowUpdatableLayers,popupHeaderColor,popupHeaderHoverColor,popupHeaderHoverTextColor,popupHeaderTextColor,searchConfiguration:,shareIncludeEmbed,shareIncludeSocial,showNewestFirst,theme,visibilityIcon,zoomAndScrollToSelected,zoomToScale"],"crowdsource-reporter":[()=>import("./LTBO6VJF.js"),"_translations:,aiImageExtraction:,center,commentButtonText,commentSubmittedMessage,defaultWebmap,description,enableAnonymousAccess,enableAnonymousComments,enableComments,enableHome,enableLogin,enableNewReports,enablePhotoLocation,enableSearch,enableSnapping,enableZoom,filterByMapExtent,floorLevel,isMobile,layerExpressions:,layerId,level,loginTitle,mapInfos:,mapView:,objectId,reportButtonText,reportingArea,reportingAreaLayer,reportingAreaMessage,reportingOptions:,reportsHeader,reportSubmittedMessage,searchConfiguration:,showComments,showFeatureSymbol,showFullCommentTitle,showMyReportsOnly,showUserImageInCommentsList,sortOption,submitNewReportsMessage,theme,zoomToScale;updateLayerExpressionsT9n"],"deduct-calculator":[()=>import("./TBJLV2A3.js")],"delete-button":[()=>import("./BFHVGXZN.js"),"_translations:,buttonType,deleteDialog,disabled,icon,ids:,layer:,showDeleteCount"],"delete-dialog":[()=>import("./W53A2CNH.js"),"_translations:,ids:,layer:,open"],"edit-card":[()=>import("./ASSNR5JI.js"),"_translations:,allowMultipleEditing,enableEditGeometry,enableSnapping,graphicIndex,graphics:,mapView:,open"],"feature-details":[()=>import("./OLDYKR5E.js"),"enableSnapping,graphics:,layerItemsHash:,mapView:,reportingOptions:,showFullCommentTitle,showUserImageInCommentsList;back,next,refresh,toggleListView"],"feature-list":[()=>import("./D2QNPQWY.js"),"_translations:,applyLayerViewFilter,filterByMapExtent,highlightOnHover,highlightOnMap,mapView:,noFeaturesFoundMsg,pageSize,reportingOptions:,selectedLayerId,showErrorWhenNoFeatures,showFeatureSymbol,showFullTitle,showInitialLoading,showUserImageInList,sortingInfo:,textSize,whereClause;refresh"],"field-selection":[()=>import("./6LPOLFT7.js"),"_translations:,configExtraFields,layer:,mapView:,table:,tableRef:"],"info-card":[()=>import("./N5YBX6NM.js"),"_translations:,allowEditing,enableEditGeometry,enableSnapping,graphics:,highlightEnabled,isLoading,isMobile,mapView:,paginationEnabled,position,showCloseBtn;back,getSelectedFeature,next,refresh,toggleListView,updateCurrentGraphic"],"layer-list":[()=>import("./FUUWSZIZ.js"),"_translations:,applyLayerViewFilter,filterByMapExtent,layers:,mapView:,showFeatureCount,showNextIcon;refresh"],"layer-list-widget":[()=>import("./WZZG5H7Q.js"),"layerListWidget:,mapView:,visibilityIcon"],"layer-table":[()=>import("./VCH6XDEH.js"),"_translations:,appLayout,defaultGlobalId:,defaultLayerId,defaultOid:,enableAutoRefresh,enableColumnReorder,enableCSV,enableInlineEdit,enableShare,enableTableAutosave,featureSelectionMode,honorMapFieldSettings,isMobile,mapHidden,mapInfo:,mapView:,selectedIds:,selectedRelatedIds:,shareIncludeEmbed,shareIncludeSocial,showNewestFirst,showOnlyUpdatableLayers,zoomAndScrollToSelected,zoomToScale;closeFilter,filterReset,filterUpdate,refresh,setColumnOrder,validateActiveEdits,validateTableUpdate"],"map-basemap-gallery":[()=>import("./ZQJ2QLO5.js"),"basemapConfig:,basemapWidget:,mapView:"],"map-card":[()=>import("./3M6AYSM7.js"),"_translations:,appLayout,appProxies,basemapConfig:,defaultLayerId,defaultWebmapId,enableBasemap,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapLayerPicker,enableMapPicker,enableSearch,enableSelectionTool,enableShare,enableSingleExpand,featureSelectionMode,hide,isMapLayout,isMobile,mapInfo:,mapInfos:,mapToolsOrder:,mapView:,mapWidgetsIndex,mapWidgetsPosition,mapWidgetsSize,mobileMapWidgetsPosition,mobileToolsOrder:,selectedFeaturesIds:,selectedLayer:,shareIncludeEmbed,shareIncludeSocial,showOnlyUpdatableLayers,stackTools,theme,visibilityIcon,zoomToolsSize,zoomToScale;resetFilter,updateFilterState,updateLayer"],"map-draw-tools":[()=>import("./2J6ZHQEF.js"),"_translations:,active,drawMode,editGraphicsEnabled,graphics:,mapView:,pointSymbol:,polygonSymbol:,polylineSymbol:,redoEnabled,undoEnabled;clear,updateGraphics"],"map-floor-filter":[()=>import("./TUGGGATS.js"),"enabled,floorFilterWidget:,mapView:"],"map-fullscreen":[()=>import("./BGO3JXY3.js"),"fullscreenWidget:,mapView:"],"map-layer-picker":[()=>import("./QXLM22NS.js"),"_translations:,appearance,configLayerOrderDefined,defaultLayerId,disabled,display,enabledLayerIds:,height,isMobile,mapView:,placeholderIcon,referenceElement,scale,selectedIds:,showLayersListInPopover,showOnlyUpdatableLayers,showSingleLayerAsLabel,showTables,showTablesDisabled,type;setLayerById,setLayerByIds,updateLayer"],"map-legend":[()=>import("./B5SYTUTT.js"),"legendWidget:,mapView:"],"map-picker":[()=>import("./FZ4NFB5R.js"),"_translations:,height,isMapLayout,mapInfos:,referenceElement,selectedWebMapId,showMapListInPopover;close,setMapByID,toggle"],"map-search":[()=>import("./VDDTJAF2.js"),"mapView:,popupEnabled,resultGraphicEnabled,searchConfiguration:,searchTerm,searchWidget:"],"map-select-tools":[()=>import("./VYTGCKEU.js"),"_translations:,bufferColor,bufferOutlineColor,customLabelEnabled,defaultBufferDistance,defaultBufferUnit,enabledLayerIds:,enableLayerFeatures,enableLayerFeaturesOnLoad,enableSearchDistance,enableSearchDistanceOnLoad,enableSketchTools,geometries:,headerLabelClass,isUpdate,layerViews:,mapView:,noResultText,searchConfiguration:,searchDistanceEnabled,selectionLayerIds:,selectionSet:,selectLayerView:,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:,useLayerFeaturesEnabled;clearSelection,getSelection"],"map-tools":[()=>import("./ZRCMN3AQ.js"),"_translations:,basemapConfig:,defaultLayerId,enableBasemap,enabledLayerIds:,enableFloorFilter,enableFullscreen,enableHome,enableLayerList,enableLegend,enableMapLayerPicker,enableMapPicker,enableSearch,enableSelectionTool,enableSingleExpand,isMobile,layout,mapInfo:,mapInfos:,mapView:,mapWidgetsSize,parentComponentHeight,parentComponentWidth,position,searchConfiguration:,selectedFeaturesIds:,selectedLayer:,selectedWebMapId,selectionTools:,showOnlyUpdatableLayers,stackTools,toolOrder:,visibilityIcon,zoomToolsSize"],"pci-calculator":[()=>import("./NQF577F4.js")],"pdf-download":[()=>import("./5VP4DXWE.js"),"_translations:,defaultNumLabelsPerPage,disabled;downloadCSV,downloadPDF"],"public-notification":[()=>import("./Y4YYE2LG.js"),"_translations:,addresseeLayerIds:,bufferColor,bufferOutlineColor,customExport,customExportURL,customLabelEnabled,defaultBufferDistance,defaultBufferUnit,defaultExportTitle,defaultNumLabelsPerPage,enableLayerFeatures,enableLayerFeaturesOnLoad,enableSearchDistance,enableSearchDistanceOnLoad,enableSketchTools,featureEffect:,featureHighlightEnabled,initialNotice,mapView:,noResultText,searchConfiguration:,selectionLayerIds:,showRefineSelection,showSearchSettings,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:"],"refine-selection":[()=>import("./NXG2TZQJ.js"),"_translations:,addresseeLayer:,bufferColor,bufferOutlineColor,defaultBufferDistance,defaultBufferUnit,drawnGraphicsArr:,enabledLayerIds:,enableSearchDistance,enableSearchDistanceOnLoad,geometries:,mapView:,searchDistanceEnabled,selectionSets:,sketchLineSymbol:,sketchPointSymbol:,sketchPolygonSymbol:"],"selection-tool":[()=>import("./HLPUNGB5.js"),"mapView:,selectedLayerId,tool;toggleSelectionTool"],"solution-configure-titles":[()=>import("./UR6OMPID.js"),"_translations:,card:,open,solutionData,source,templateInfos:"],"solution-delete-dialog":[()=>import("./XUFPQNGT.js"),"_translations:,card:,open,source;;close,delete"],"solution-deploy-dialog":[()=>import("./JQO5U72D.js"),"_translations:,card:,debugFailDeployment,open,userOptions:;;close,deploy"],"solution-deployed-card":[()=>import("./JN4HYWSX.js"),"_translations:,card:,deployedDate,description,diagramKey,heading,itemId,owner,templateInfos:,thumbnail,updateAvailable;getTemplates,renderDeleteDialog,renderDiagramDialog"],"solution-deployed-card-panel":[()=>import("./WDFQGUHD.js"),"_translations:,card:,cardRef,diagramKey,open,templateInfos:"],"solution-deploying-dialog":[()=>import("./NZYAEBC7.js"),"_translations:,abortController:,card:,deploymentProgress,isWaitingForCard,open;;cancelDeployment,close,confirmCancel"],"solution-details-card":[()=>import("./LGUC7DRT.js"),"_translations:,card:,referrerSolutionId,referrerSolutionTitle,referrerSolutionVersion,source"],"solution-details-panel":[()=>import("./HPBIBS4W.js"),"_translations:,card:"],"solution-item-accordion":[()=>import("./BHHQFUCH.js"),"_translations:,itemRelationshipDependencies:,linkType,listSelectionMode,reuseWarning,templateInfos:,typeKeywords:;collapseAll,deselectAll,expandFirstItem,expandItemById,expandItems,selectFirstItem,selectItem,selectItems"],"solution-item-diagram":[()=>import("./AJRYDDC7.js"),"_translations:,diagramKey,templateInfoGraph:,typeKeywords:"],"solution-item-icon":[()=>import("./UDPPJCXC.js"),"isPortal,type,typeKeywords:"],"solution-resource-card":[()=>import("./HNRZHAOD.js"),"_translations:,description,heading,headingEn,icon,meridianIcon,sectionHeadingEn,url"],"solution-snapshot-gallery":[()=>import("./BNQ63VOG.js"),"_translations:,card:,itemProperties:,open,screenshot:"],"solution-social-share":[()=>import("./RDWJHF5P.js"),"_translations:,actionApperance,autoUpdateShareUrl,buttonAppearance,inlineSuccessPopoverPlacement,mode,popoverButtonIconScale,popoverPositioning,removePopoverOffset,scale,shareButtonKind,shareButtonScale,shareButtonText,shareButtonType,shareIconsLayout,shareText,shareUrl,shortenShareUrl,socialMedia,solutionId,solutionTitle,solutionVersion,successMessage"],"solution-user-avatar":[()=>import("./HAAFUV3J.js"),"fullname,lookupProfile,thumbnailUrl,username"],"solutions-all-panel":[()=>import("./Y3FTYVXY.js"),"_translations:,sortType;searchSolutions,setSearchOptions"],"solutions-all-shell":[()=>import("./XFEOA56B.js"),"_translations:,solutionsCount;searchSolutions"],"solutions-deploy-app":[()=>import("./WFWPXGGK.js"),"_translations:,appConfig,initTab,initTitleOrId,sortType,useLocalAppConfig;selectTab"],"solutions-deploy-app-nav":[()=>import("./N7RLYKQG.js"),"_translations:,appConfig,initTab;;activateMenuItem,clearMenuItems"],"solutions-deployed-panel":[()=>import("./KVR3XE7B.js"),"_translations:,sortType;reload,searchSolutions,setSearchOptions"],"solutions-deployed-shell":[()=>import("./E4L5GTBZ.js"),"_translations:,solutionsCount;searchSolutions"],"solutions-filter-panel":[()=>import("./2642PFUF.js"),"_translations:,hideIndustryFilter,isAIDialogOpen,showReset;;changeIndustryFilter,clearFilters"],"solutions-resources-section":[()=>import("./V65IKENN.js"),"cards,heading,subheading"],"solutions-resources-shell":[()=>import("./QKGOQ7EC.js"),"_translations:"],"solutions-searchsort-toolbar":[()=>import("./TAXUQXTN.js"),"_translations:,defaultSortType,isOrgSolutions,scope;;changeOwnerFilter,changeSearchFilter,sortChanged"]});o({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-solutions-assistant,buffer-tools,card-manager,consent-manager,create-feature,create-related-feature,crowdsource-manager,crowdsource-reporter,deduct-calculator,delete-button,delete-dialog,edit-card,feature-details,feature-list,field-selection,info-card,layer-list,layer-list-widget,layer-table,map-basemap-gallery,map-card,map-draw-tools,map-floor-filter,map-fullscreen,map-layer-picker,map-legend,map-picker,map-search,map-select-tools,map-tools,pci-calculator,pdf-download,public-notification,refine-selection,selection-tool,solution-configure-titles,solution-delete-dialog,solution-deploy-dialog,solution-deployed-card,solution-deployed-card-panel,solution-deploying-dialog,solution-details-card,solution-details-panel,solution-item-accordion,solution-item-diagram,solution-item-icon,solution-resource-card,solution-snapshot-gallery,solution-social-share,solution-user-avatar,solutions-all-panel,solutions-all-shell,solutions-deploy-app,solutions-deploy-app-nav,solutions-deployed-panel,solutions-deployed-shell,solutions-filter-panel,solutions-resources-section,solutions-resources-shell,solutions-searchsort-toolbar){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,a)
@@ -3970,10 +3970,10 @@ class Jo extends bi {
3970
3970
  async _init() {
3971
3971
  if (!this._loaded) {
3972
3972
  const t = {
3973
- info: console.info.bind(console),
3974
- error: console.error.bind(console),
3973
+ info: console.info ? console.info.bind(console) : console.log.bind(console),
3974
+ error: console.error ? console.error.bind(console) : console.log.bind(console),
3975
3975
  warn: (n, ...i) => {
3976
- (!n.includes("non-primitive value") || !n.includes("userSince")) && console.warn(n, ...i);
3976
+ (!n.includes("non-primitive value") || !n.includes("userSince")) && (console.warn || console.log)(n, ...i);
3977
3977
  }
3978
3978
  }, r = {
3979
3979
  plugins: [],