@esri/solutions-components 5.0.6-next.1 → 5.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/cdn/{FCRKDTT7.js → 22U34PQB.js} +1 -1
  2. package/dist/cdn/{DYW2SU7R.js → 3RZXRWAP.js} +1 -1
  3. package/dist/cdn/{VQZ5PAL6.js → 3YFIPADZ.js} +1 -1
  4. package/dist/cdn/{3PRSB2WR.js → 43CYPIMQ.js} +1 -1
  5. package/dist/cdn/{OFJ2VFW7.js → 43IA3DL4.js} +1 -1
  6. package/dist/cdn/{VYS6Q3TC.js → 4EPDGSS3.js} +1 -1
  7. package/dist/cdn/{XSUHVXCX.js → 4MCRCBXP.js} +1 -1
  8. package/dist/cdn/{RN52WDXY.js → 4S6JHZXI.js} +1 -1
  9. package/dist/cdn/{SWWGEAN4.js → 5D5V3CBT.js} +1 -1
  10. package/dist/cdn/{AX25AFSB.js → 5KFPWHQK.js} +1 -1
  11. package/dist/cdn/{I4Z6ZYWZ.js → 5U76VYOV.js} +1 -1
  12. package/dist/cdn/{25PMTP3B.js → 5Z4JZB7T.js} +1 -1
  13. package/dist/cdn/{7GFJCKLV.js → 675G5KQQ.js} +1 -1
  14. package/dist/cdn/{2DQVL4PQ.js → 6ERK6VPZ.js} +1 -1
  15. package/dist/cdn/{P37VIDKK.js → 6XUVGEDV.js} +1 -1
  16. package/dist/cdn/{U5UZNUM3.js → 73QBDSXH.js} +1 -1
  17. package/dist/cdn/{3F54GEFA.js → 74ZSZVS6.js} +1 -1
  18. package/dist/cdn/{DV2GHKER.js → 7JYPKH72.js} +2 -2
  19. package/dist/cdn/{KUAZAYII.js → 7REPJ4XS.js} +1 -1
  20. package/dist/cdn/{3EQGUDZX.js → 7ZBCFESJ.js} +1 -1
  21. package/dist/cdn/{AYHK3JMP.js → A26I5EAX.js} +1 -1
  22. package/dist/cdn/{D2GJ4T5F.js → B2DK4LWH.js} +1 -1
  23. package/dist/cdn/{VSUINSCJ.js → BNNZ2ZGX.js} +1 -1
  24. package/dist/cdn/{72IO4UYP.js → BRG4WNOI.js} +1 -1
  25. package/dist/cdn/{GFTF6RL4.js → C3QDGTJR.js} +1 -1
  26. package/dist/cdn/{OOQS6ORV.js → CEYUKUGR.js} +1 -1
  27. package/dist/cdn/DKFXHHUI.js +2 -0
  28. package/dist/cdn/{LNSJ2ZWF.js → DTI2O2YX.js} +1 -1
  29. package/dist/cdn/{QP2PUPF2.js → EBQJE5IR.js} +1 -1
  30. package/dist/cdn/EEGVKRAE.js +2 -0
  31. package/dist/cdn/{J5QSDMW3.js → ENQQNV7P.js} +1 -1
  32. package/dist/cdn/{6QCS7IPP.js → ERCXFIQA.js} +1 -1
  33. package/dist/cdn/{4573HUN4.js → EYM3QUBY.js} +1 -1
  34. package/dist/cdn/{FB22NJZE.js → FJ6NF35F.js} +1 -1
  35. package/dist/cdn/{UJMP6BUY.js → G7HBG2UF.js} +1 -1
  36. package/dist/cdn/{OSIVL3Y2.js → HNRSOVZ3.js} +1 -1
  37. package/dist/cdn/{RPVEVHKH.js → HYX7BODW.js} +1 -1
  38. package/dist/cdn/{EMNCN6KS.js → ICP6A2TW.js} +1 -1
  39. package/dist/cdn/{NCT25XQN.js → IRTMH4CU.js} +1 -1
  40. package/dist/cdn/{BMPHKAGI.js → JAP5VDRT.js} +1 -1
  41. package/dist/cdn/{CVDB3QYI.js → JVBVZ7SO.js} +1 -1
  42. package/dist/cdn/{CYPPGLZ3.js → KMVYKYBM.js} +1 -1
  43. package/dist/cdn/{RIYBW73O.js → KZHT2SRK.js} +1 -1
  44. package/dist/cdn/{5QKEOPB7.js → LFAWVGKM.js} +1 -1
  45. package/dist/cdn/{NWPFF4JA.js → MDAQ5K75.js} +1 -1
  46. package/dist/cdn/{M4JIHV72.js → NFXWBAXX.js} +1 -1
  47. package/dist/cdn/{GBI67V7K.js → NG4ZFNHE.js} +1 -1
  48. package/dist/cdn/{QDB6OFX7.js → NPR6G5AX.js} +1 -1
  49. package/dist/cdn/{BS4VUABM.js → NWSKMX7S.js} +1 -1
  50. package/dist/cdn/{SQX3V4JQ.js → OM6BG2BU.js} +1 -1
  51. package/dist/cdn/{DNJQPNJ3.js → OX5ZGUUP.js} +1 -1
  52. package/dist/cdn/{7SJMHEHX.js → PGDVHQVF.js} +1 -1
  53. package/dist/cdn/{OD3XSVPE.js → PNJZAUGF.js} +1 -1
  54. package/dist/cdn/{ARCFSWJ6.js → PTKWOS3W.js} +1 -1
  55. package/dist/cdn/{XDWBG3UR.js → QHBHKUDJ.js} +1 -1
  56. package/dist/cdn/{FWQFXM4U.js → QJFN3RCP.js} +1 -1
  57. package/dist/cdn/QLZRRDLM.js +2 -0
  58. package/dist/cdn/{CLTYMWDG.js → QMZKZWSS.js} +1 -1
  59. package/dist/cdn/{N2A3DN7Q.js → RBNSS2LC.js} +1 -1
  60. package/dist/cdn/{VDV3ULRF.js → RJEWER4Y.js} +1 -1
  61. package/dist/cdn/{YQYASRD5.js → RJJJCTWH.js} +1 -1
  62. package/dist/cdn/{IGVKJKZ2.js → RVY7I3GY.js} +1 -1
  63. package/dist/cdn/{6F7LDQBQ.js → S2O7THHA.js} +1 -1
  64. package/dist/cdn/{UIUEU6HZ.js → S36FP6V3.js} +1 -1
  65. package/dist/cdn/{4G6KHS4L.js → SA6VZSQH.js} +1 -1
  66. package/dist/cdn/{OX2MZA6F.js → SKRTPLGN.js} +1 -1
  67. package/dist/cdn/{RMAKST5E.js → SL4JGIFV.js} +1 -1
  68. package/dist/cdn/{T63EH4IH.js → SZGK2TKC.js} +1 -1
  69. package/dist/cdn/{I5NNLEMS.js → THFNJ23N.js} +1 -1
  70. package/dist/cdn/{J3QFN6BO.js → UHIWQ5QU.js} +1 -1
  71. package/dist/cdn/{Z2OGHOS2.js → UKPIHN6B.js} +1 -1
  72. package/dist/cdn/{LC7RF2LP.js → UQ7NCQ5J.js} +1 -1
  73. package/dist/cdn/{FANNDI5E.js → UZR3P2OU.js} +1 -1
  74. package/dist/cdn/{ZEEVP73V.js → WFL6AMNM.js} +1 -1
  75. package/dist/cdn/{ORNE3UXL.js → XBVKGREH.js} +1 -1
  76. package/dist/cdn/{26TMYOYZ.js → XFYS4DBD.js} +1 -1
  77. package/dist/cdn/{NCDWEPYU.js → XXUIQTGS.js} +1 -1
  78. package/dist/cdn/{PKMTEIHQ.js → Y4ZKMRDR.js} +1 -1
  79. package/dist/cdn/{M4OFY7R4.js → Y6MSFH7B.js} +1 -1
  80. package/dist/cdn/{LHEE2HNJ.js → YKT6FAYV.js} +1 -1
  81. package/dist/cdn/{U6YFX3FW.js → YTSRCWM5.js} +1 -1
  82. package/dist/cdn/{AR4OZU5R.js → ZW6PR32J.js} +1 -1
  83. package/dist/cdn/{P26AU4WZ.js → ZWZFY2XW.js} +1 -1
  84. package/dist/cdn/index.js +1 -1
  85. package/dist/chunks/runtime.js +1 -1
  86. package/dist/components/create-feature/customElement.js +1 -1
  87. package/dist/components/layer-table/customElement.js +1 -1
  88. package/dist/docs/api.json +1 -1
  89. package/dist/docs/docs.json +1 -1
  90. package/dist/docs/web-types.json +1 -1
  91. package/dist/solutions-components_commit.txt +7 -7
  92. package/package.json +1 -1
  93. package/dist/cdn/6T2CYQFT.js +0 -2
  94. package/dist/cdn/PXMCZFXG.js +0 -2
  95. package/dist/cdn/S5YGWXQI.js +0 -2
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as pn}from"./RPVEVHKH.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as dn}from"./D2GJ4T5F.js";import{H as fn,h as cn,r as ln}from"./46DQNAMV.js";import"./OR4HXHSY.js";function Pi(){var e;return!!(!((e=window?.navigator)===null||e===void 0)&&e.globalPrivacyControl)}function ji(e={}){let{disabled:t,portal:n,requireConsent:r,userPrivacySettings:i}=e;if(r)if(i?.accepted){if(i?.functional===!1&&i?.performance===!1&&i?.targeting===!1)return!0}else return!0;return i?.accepted===!0&&i?.functional===!1&&i?.performance===!1&&i?.targeting===!1||t||n?.eueiEnabled===!1||Pi()?!0:!(!n||Ti(n)||Ni(n)||_i(n))}function Ti(e){return e.eueiEnabled&&e.user&&e.user.orgId===e.id}function Ni(e){return e.user&&!e.user.orgId&&e.ipCntryCode==="US"}function _i(e){return!e.user&&e.ipCntryCode==="US"}var Ue={storage:{},memory:!0,get(e){let t;try{t=window.localStorage&&window.localStorage.getItem(e)||this.storage[e]}catch{t=this.storage[e]}if(t)try{return JSON.parse(t)}catch{return}else return},set(e,t){let n=JSON.stringify(t);try{window.localStorage.setItem(e,n)}catch{this.memory||(console.error("setting local storage failed, falling back to in-memory storage"),this.memory=!0),this.storage[e]=t}},delete(e){try{window.localStorage.removeItem(e)}catch{this.memory||(console.error("setting local storage failed, falling back to in-memory storage"),this.memory=!0),delete this.storage[e]}}},Er="esri-telemetry";function Ci(e){return new Promise((t,n)=>{e.onload=t,e.onerror=n,(!Ui(e)||e.body)&&t()})}function Mi(e){let{id:t,dataAttribute:n}=e;return!!document.getElementById(t)||!!document.querySelector(`[data-${Er}="${n}"]`)}function Ui(e){let{body:t,src:n,id:r,dataAttribute:i,section:o="body",type:s="text/javascript",async:a=!1,defer:u=!1,onload:c,onerror:p}=e;if(typeof window>"u")throw new Fe("Window is undefined: Cannot add script element.");if(Mi(e)){console.log(`script (${r||i}) is already present, skipping`);return}let l=Di({id:r,dataAttribute:i,type:s,async:a,defer:u,body:t,src:n,onload:c,onerror:p});return o==="body"?document.body.appendChild(l):document.head.appendChild(l)}var Fe=class extends Error{};function Di({id:e,dataAttribute:t,type:n,async:r,defer:i,body:o,src:s,onload:a,onerror:u}){let c=document.createElement("script");return e&&(c.id=e),t&&c.setAttribute(`data-${Er}`,t),s&&(c.src=s),o&&(c.innerText=o),c.type=n,c.async=r,c.defer=i,a&&(c.onload=a),u&&(c.onerror=u),c}function Ri(e){return e.map(t=>{let n=[];return["src","id","dataAttribute","type"].forEach(r=>{let i=r;r==="dataAttribute"&&(i="data-esri-telemetry"),t[r]&&n.push(`${i}="${t[r]}"`)}),["async","defer"].forEach(r=>{t[r]&&n.push(`${r}`)}),`<script ${n.join(" ")}>${t.body?t.body:""}<\/script>`}).join("")}var zi=["esri.com","esriuk.com","esri.de","esri.ca","esrifrance.fr","esri.nl","esri-portugal.pt","esribulgaria.com","esri.fi","esri.kr","esrimalaysia.com.my","esri.es","esriaustralia.com.au","esri-southafrica.com","esri.cl","esrichina.com.cn","esri.co","esriturkey.com.tr","geodata.no","esriitalia.it","esri.pl"],kt=class{constructor(t){var n,r,i;this.trackers=[],this.options=t,this.debug=t.debug,this.suppressDisabledWarnings=t.suppressDisabledWarnings,this.logger=t.logger||console,t.userPrivacySettings&&(this._userPrivacySettings=t.userPrivacySettings),t.requireConsent&&!t.userPrivacySettings&&(this._userPrivacySettings={accepted:!1,performance:!1,targeting:!1,functional:!1,id:Vi(),timestamp:Date.now()},t.userPrivacySettings=this._userPrivacySettings),this.disabled=ji(t),this.disabled&&!this.suppressDisabledWarnings&&this.logger.info("Telemetry Disabled");let o=((n=t.portal)===null||n===void 0?void 0:n.user)||t.user;o&&this.setUser(o,(i=(r=t.portal)===null||r===void 0?void 0:r.subscriptionInfo)===null||i===void 0?void 0:i.type),this.disabled||this.initializeTrackers()}shouldInitializeTrackers(t,n,r){let i=!n&&!t?.accepted,o=r.every(s=>t?.[s]);return i||o}filterTrackers(t){return this.options.plugins.filter(n=>t.includes(n.name))}initializeTrackers(){let t=this._userPrivacySettings,n=this.options.requireConsent;this.trackers=[],this.options.plugins&&(t?(this.shouldInitializeTrackers(t,n,["performance"])&&this.trackers.push(...this.filterTrackers(["amazon"])),this.shouldInitializeTrackers(t,n,["performance","targeting","functional"])&&this.trackers.push(...this.filterTrackers(["adobe-analytics","googleAnalytics","siteimprove"]))):this.trackers.push(...this.options.plugins)),this.trackers.length||this.logger.info("No trackers configured")}getScriptTags(){return this.trackers.map(t=>t.getScriptTags&&t.getScriptTags()).join("")}async init(){let t=this.trackers.map(n=>n.init());await Promise.all(t)}setUser(t={},n="Public"){t=typeof t=="string"?{username:t}:t,this.user=t,this.user.accountType=n;let r;if(t.email&&t.email.split){let i=t.email.split("@")[1];r=zi.filter(o=>i===o).length>0}(r||["In House","Demo and Marketing"].indexOf(n)>-1)&&(this.user.internalUser=!0)}async updateUserPrivacySettings(t){let{accepted:n,performance:r,targeting:i,functional:o}=this._userPrivacySettings,s=t.accepted&&!n&&!this.options.requireConsent&&(!t.performance||!t.targeting||!t.functional)||!t.performance&&r||!t.targeting&&i||!t.functional&&o;return this._userPrivacySettings=t,s||(this.disabled=!1,this.initializeTrackers(),await this.init()),{reload:s}}logPageView(t,n={},r={}){if(this.disabled&&!this.suppressDisabledWarnings)return this.logger.info("Page view was not logged because telemetry is disabled."),!1;let i=this.trackers.filter(({disabled:a,hasError:u})=>!a&&!u);if(!i.length)return this.logger.info("Page view was not logged because no enabled telemetry-plugins are registered."),!1;let o=this.preProcess(n,r);this.debug&&this.logger.info("Tracking page view",JSON.stringify(o));let s=i.map(a=>a.logPageView(t,o));return Promise.all(s).then(),!0}logEvent(t,n={}){if(this.disabled&&!this.suppressDisabledWarnings)return this.logger.info("Event was not logged because telemetry is disabled."),!1;let r=this.trackers.filter(({disabled:s,hasError:a})=>!s&&!a);if(!r.length)return this.logger.info("Event was not logged because no enabled telemetry-plugins are registered."),!1;let i=this.preProcess(t,n);this.debug&&this.logger.info("Tracking event",JSON.stringify(i));let o=r.map(s=>s.logEvent(i));return Promise.all(o).then(),!0}logError(t={}){t=Object.assign({eventType:"error"},t),this.logEvent(t)}startWorkflow(t,n={}){let r={name:t,start:Date.now(),steps:[],workflowId:Math.floor((1+Math.random())*17592186044416).toString(16)};this.saveWorkflow(r);let i=Object.assign({name:t,step:"start"},n);return this.logWorkflow(i),r}stepWorkflow(t,n,r={}){let i=typeof r=="string"?r:r.details,o=Object.assign({name:t,step:n,details:i},r);this.logWorkflow(o)}endWorkflow(t,n={}){let r=Object.assign({name:t,step:"finish"},n);this.logWorkflow(r)}cancelWorkflow(t,n={}){let r=Object.assign({name:t,step:"cancel"},n);this.logWorkflow(r)}getWorkflow(t){let n=Ue.get(`TELEMETRY-WORKFLOW:${t}`);if(n){let r=Date.now()-n.start,i=1800*1e3;if(r<i)return n;this.deleteWorkflow(n)}}saveWorkflow(t){Ue.set(`TELEMETRY-WORKFLOW:${t.name}`,t)}deleteWorkflow(t){Ue.delete(`TELEMETRY-WORKFLOW:${t.name}`)}logWorkflow(t={}){t=this.preProcess(t);let n=this.getWorkflow(t.name);n||(this.startWorkflow(t.name),n=this.getWorkflow(t.name)),n.steps.push(t.step),n.duration=(Date.now()-n.start)/1e3,["cancel","finish"].indexOf(t.step)>-1?this.deleteWorkflow(n):this.saveWorkflow(n);let r=Object.assign(t,{eventType:"workflow",category:t.name,action:t.step,label:t.details,duration:n.duration,workflowId:n.workflowId});this.logEvent(r)}preProcess(t={},n={}){let r={};return this.user&&(r={user:"unknown",org:"unknown",lastLogin:this.user.lastLogin,userSince:this.user.created,internalUser:this.user.internalUser||!1,accountType:this.user.accountType}),Object.entries(Object.assign(Object.assign({},t),r)).reduce(Li(n.omitComplexData,this.logger),{})}disable(){this.disabled=!0,this.trackers.forEach(t=>{var n;t.hasError||(t.disabled=!0,(n=t.disable)===null||n===void 0||n.call(t))})}disableTracker(t){var n;let r=this.trackers.find(({name:i})=>i===t);r&&!r.hasError&&(r.disabled=!0,(n=r.disable)===null||n===void 0||n.call(r))}enableTracker(t){var n;let r=this.trackers.find(({name:i})=>i===t);r&&!r.hasError&&(r.disabled=!1,(n=r.enable)===null||n===void 0||n.call(r))}};function Li(e,t){return function(n,[r,i]){return $i(i)?n[r]=i:e||(t.warn(`You are trying to log a non-primitive value, ${r}:${JSON.stringify(i)}. This will get logged as [object Object]`),n[r]=i),n}}function $i(e){return["string","number","boolean","undefined"].includes(typeof e)||e&&typeof e.valueOf()=="string"}function Vi(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Gt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var At=class{constructor(t){var n;if(this.name="googleAnalytics",this.dimensions={},this.metrics={},this.isInitialized=!1,typeof window<"u"&&!(!((n=t?.measurementIds)===null||n===void 0)&&n.length))throw new Error("at least one measurementId needs to be provided in your configuration");Object.assign(this,t)}_getScripts(){return[{dataAttribute:"google-analytics",async:!0,src:`https://www.googletagmanager.com/gtag/js?id=${this.measurementIds?this.measurementIds[0]:""}`}]}getScriptTags(){return Ri(this._getScripts())}async init(){if(!this.isInitialized){if(typeof window>"u")throw new Fe("Window is undefined: Cannot add script element.");await Promise.all(this._getScripts().map(t=>Ci(t))),this.injectConfig(),this.isInitialized=!0}}logPageView(t,n={}){let r=this.buildCustomParams(n),i=Object.assign({page_title:t||window.location.pathname},r);return window.gtag("event","page_view",i),!0}logEvent(t){let{action:n}=t,r=Gt(t,["action"]),i=n||"other",o=this.buildCustomParams(r);return window.gtag("event",i,o),!0}disable(){this.measurementIds&&this.measurementIds.forEach(t=>{window[`ga-disable-${t}`]=!0})}enable(){this.measurementIds&&this.measurementIds.forEach(t=>{window[`ga-disable-${t}`]=void 0})}injectConfig(){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date);let t={custom_map:this.createDimensionsAndMetricsCustomMap(this.dimensions,this.metrics),send_page_view:!1,anonymize_ip:!0};this.measurementIds.forEach(n=>{window.gtag("config",n,t)})}buildCustomParams(t){let n,{category:r,label:i}=t;return n=this.verifyCustomDimensionAndMetrics(t),r&&(n=Object.assign(Object.assign({},n),{event_category:r})),i&&(n=Object.assign(Object.assign({},n),{event_label:i})),n}verifyCustomDimensionAndMetrics(t){let n=this.createDimensionsAndMetricsCustomMap(this.dimensions,this.metrics),r=Object.values(n);return Object.keys(t).filter(i=>r.includes(i)).reduce((i,o)=>Object.assign(i,{[o]:t[o]}),{})}createDimensionsAndMetricsCustomMap(t={},n={}){let r=this.createMetricCustomMap(n),i=this.createDimensionCustomMap(t);return Object.assign(Object.assign({},r),i)}createMetricCustomMap(t={}){return Object.keys(t).map(function(n){return{key:`metric${t[n]}`,value:n}}).filter(n=>n).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}createDimensionCustomMap(t={}){return Object.keys(t).map(function(n){return{key:`dimension${t[n]}`,value:n}}).filter(n=>n).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}},gn="TELEMETRY_COGNITO_CREDENTIALS";function Wi(e,t={}){let n=`https://cognito-identity${t.fips===!0?"-fips":""}.us-east-1.amazonaws.com/`,r=Ue.get(gn);if(r&&Date.now()/1e3<r.Expiration)return Promise.resolve(r);let i={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetId"},body:JSON.stringify({IdentityPoolId:e})};return fetch(n,i).then(o=>{if(!o.ok)throw new Error(o.statusText);return o.json()}).then(o=>{let{IdentityId:s}=o,a={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},body:JSON.stringify({IdentityId:s})};return fetch(n,a)}).then(o=>{if(!o.ok)throw new Error(o.statusText);return o.json()}).then(({Credentials:o})=>(Ue.set(gn,o),o))}function Pr({telemetryData:e,dimensionLookup:t={},excludeKeys:n=[]}){return Object.keys(e).filter(r=>!n.includes(r)).map(r=>t[r]?{key:Hi(t,r),value:e[r]}:{key:r,value:qi(e,r)}).reduce((r,{key:i,value:o})=>(r[i]=o,r),{})}function qi(e,t){return t==="json"?e[t]?JSON.stringify(e[t]):"null":e[t]===void 0?"null":e[t].toString()}function Hi(e,t){return`dimension${e[t]}`}var Ki=["size","duration","position","number","count"];function jr(e,t={}){return Object.keys(e).filter(n=>t[n]||Ki.includes(n)).map(n=>t[n]?{key:Gi(t,n),value:e[n]}:{key:n,value:e[n]}).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}function Gi(e,t){return`metric${e[t]}`}function Ji({event:e={},dimensionLookup:t={},metricLookup:n={}}){var r,i;let{pathname:o,eventType:s="other"}=e,a=jr(e,n),u=Pr({telemetryData:Object.assign({eventType:s},e),dimensionLookup:t,excludeKeys:["workflow","pathname",...Object.keys(a),...Object.keys(n)]}),c=Object.assign(Object.assign({name:s},u),a);return typeof document<"u"&&document.referrer&&(c.referrer=document.referrer),typeof window<"u"&&!c.hostname&&(c.hostname=(r=window.location)===null||r===void 0?void 0:r.hostname),c.path=typeof window<"u"&&window.location.pathname?(i=window.location)===null||i===void 0?void 0:i.pathname:o,c}function Xi({page:e,previousPage:t={},options:n={},dimensionLookup:r={},metricLookup:i={}}){let o=jr(n,i),s=Pr({telemetryData:n,dimensionLookup:r,excludeKeys:["workflow",...Object.keys(o),...Object.keys(i)]}),{referrer:a,title:u}=document||{},{hostname:c,pathname:p}=window&&window.location?window.location:{};return Object.assign(Object.assign({name:"pageView",referrer:a,hostname:c,path:e||p,pageUrl:e||p,pageName:u,previousPageUrl:t.pageUrl,previousPageName:t.pageName},s),o)}function hn(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var Fi="function",Bi="string",ne="undefined",Qi="boolean",Be="object",Yi="array",Zi="number",eo="symbol",to="null",no=function(){},Tr="any",Nr="*",we="__",ro="form",io="input",oo="button",so="select",Qe=typeof process!==ne?process:{};Qe.env&&Qe.env.NODE_ENV;var Z=typeof document!==ne;Qe.versions!=null&&Qe.versions.node!=null;typeof Deno!==ne&&Deno.core;Z&&window.name==="nodejs"||typeof navigator!==ne&&typeof navigator.userAgent!==ne&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function _r(e,t){return t.charAt(0)[e]()+t.slice(1)}var ao=_r.bind(null,"toUpperCase"),uo=_r.bind(null,"toLowerCase");function co(e){return Cr(e)?ao(to):typeof e===Be?go(e):Object.prototype.toString.call(e).slice(8,-1)}function Ye(e,t){t===void 0&&(t=!0);var n=co(e);return t?uo(n):n}function $e(e,t){return typeof t===e}var ee=$e.bind(null,Fi),le=$e.bind(null,Bi),Se=$e.bind(null,ne),lo=$e.bind(null,Qi);$e.bind(null,eo);function Cr(e){return e===null}function fo(e){return Ye(e)===Zi&&!isNaN(e)}function Mr(e){return Ye(e)===Yi}function Q(e){if(!po(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function po(e){return e&&(typeof e===Be||e!==null)}function go(e){return ee(e.constructor)?e.constructor.name:null}function ho(e){return e instanceof Error||le(e.message)&&e.constructor&&fo(e.constructor.stackTraceLimit)}function Ur(e,t){if(typeof t!="object"||Cr(t))return!1;if(t instanceof e)return!0;var n=Ye(new e(""));if(ho(t))for(;t;){if(Ye(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}Ur.bind(null,TypeError);Ur.bind(null,SyntaxError);function nt(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?mo(e,t):n}function mo(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function rt(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}rt(nt,ro);rt(nt,oo);rt(nt,io);rt(nt,so);function yo(e){return e?Mr(e)?e:[e]:[]}function mn(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function vo(){if(Z){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function bo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function wo(e){return(function(t){for(var n,r=Object.create(null),i=/([^&=]+)=?([^&]*)/g;n=i.exec(t);){var o=mn(n[1]),s=mn(n[2]);if(o)if(o.substring(o.length-2)==="[]"){var a=r[o=o.substring(0,o.length-2)]||(r[o]=[]);r[o]=Array.isArray(a)?a:[],r[o].push(s)}else r[o]=s===""||s}for(var u in r){var c=u.split("[");c.length>1&&(xo(r,c.map(function(p){return p.replace(/[?[\]\\ ]/g,"")}),r[u]),delete r[u])}return r})((function(t){return Z&&window.location.search.substring(1)})())}function xo(e,t,n){for(var r=t.length-1,i=0;i<r;++i){var o=t[i];if(o==="__proto__"||o==="constructor")break;o in e||(e[o]={}),e=e[o]}e[t[r]]=n}function xe(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+=r=="-"||r=="4"?r:(r=="x"?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}var me="global",Ee=we+me+we,Pe=typeof self===Be&&self.self===self&&self||typeof global===Be&&global[me]===global&&global||void 0;function pe(e){return Pe[Ee][e]}function ge(e,t){return Pe[Ee][e]=t}function Te(e){delete Pe[Ee][e]}function Ne(e,t,n){var r;try{if(Jt(e)){var i=window[e];r=i[t].bind(i)}}catch{}return r||n}Pe[Ee]||(Pe[Ee]={});var We={};function Jt(e){if(typeof We[e]!==ne)return We[e];try{var t=window[e];t.setItem(ne,ne),t.removeItem(ne)}catch{return We[e]=!1}return We[e]=!0}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(null,arguments)}var ce="function",oe="undefined",De="reducer",Dr="@@redux/",It=Dr+"INIT",So=Dr+Math.random().toString(36),yn=(function(){return typeof Symbol===ce&&Symbol.observable||"@@observable"})(),qe=" != "+ce;function Rr(e,t,n){var r;if(typeof t===ce&&typeof n===oe&&(n=t,t=void 0),typeof n!==oe){if(typeof n!==ce)throw new Error("enhancer"+qe);return n(Rr)(e,t)}if(typeof e!==ce)throw new Error(De+qe);var i=e,o=t,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function p(){return o}function l(y){if(typeof y!==ce)throw new Error("Listener"+qe);var b=!0;return c(),a.push(y),function(){if(b){b=!1,c();var S=a.indexOf(y);a.splice(S,1)}}}function x(y){if(!Q(y))throw new Error("Act != obj");if(typeof y.type===oe)throw new Error("ActType "+oe);if(u)throw new Error("Dispatch in "+De);try{u=!0,o=i(o,y)}finally{u=!1}for(var b=s=a,S=0;S<b.length;S++)(0,b[S])();return y}return x({type:It}),(r={dispatch:x,subscribe:l,getState:p,replaceReducer:function(y){if(typeof y!==ce)throw new Error("next "+De+qe);i=y,x({type:It})}})[yn]=function(){var y,b=l;return(y={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function h(){S.next&&S.next(p())}return h(),{unsubscribe:b(h)}}})[yn]=function(){return this},y},r}function Oo(e,t){var n=t&&t.type;return"action "+(n&&n.toString()||"?")+De+" "+e+" returns "+oe}function je(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,n){return function(){return t(n.apply(void 0,[].slice.call(arguments)))}})}function ko(){var e=arguments;return function(t){return function(n,r,i){var o,s=t(n,r,i),a=s.dispatch,u={getState:s.getState,dispatch:function(c){return a(c)}};return o=[].slice.call(e).map(function(c){return c(u)}),T({},s,{dispatch:a=je.apply(void 0,o)(s.dispatch)})}}}var fe=we+"anon_id",ye=we+"user_id",ke=we+"user_traits",Et="analytics",ue="userId",Oe="anonymousId",Je=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],Pt=["name","EVENTS","config","loaded"],j=Je.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),vn=/^utm_/,bn=/^an_prop_/,wn=/^an_trait_/;function Ao(e){var t=e.storage.setItem;return function(n){return function(r){return function(i){if(i.type===j.bootstrap){var o=i.params,s=i.user,a=i.persistedUser,u=i.initialUser,c=a.userId===s.userId;a.anonymousId!==s.anonymousId&&t(fe,s.anonymousId),c||t(ye,s.userId),u.traits&&t(ke,T({},c&&a.traits?a.traits:{},u.traits));var p=Object.keys(i.params);if(p.length){var l=o.an_uid,x=o.an_event,y=p.reduce(function(b,S){if(S.match(vn)||S.match(/^(d|g)clid/)){var h=S.replace(vn,"");b.campaign[h==="campaign"?"name":h]=o[S]}return S.match(bn)&&(b.props[S.replace(bn,"")]=o[S]),S.match(wn)&&(b.traits[S.replace(wn,"")]=o[S]),b},{campaign:{},props:{},traits:{}});n.dispatch(T({type:j.params,raw:o},y,l?{userId:l}:{})),l&&setTimeout(function(){return e.identify(l,y.traits)},0),x&&setTimeout(function(){return e.track(x,y.props)},0),Object.keys(y.campaign).length&&n.dispatch({type:j.campaign,campaign:y.campaign})}}return r(i)}}}}function Io(e){return function(t,n){if(t===void 0&&(t={}),n===void 0&&(n={}),n.type===j.setItemEnd){if(n.key===fe)return T({},t,{anonymousId:n.value});if(n.key===ye)return T({},t,{userId:n.value})}switch(n.type){case j.identify:return Object.assign({},t,{userId:n.userId,traits:T({},t.traits,n.traits)});case j.reset:return[ye,fe,ke].forEach(function(r){e.removeItem(r)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function xn(e){return{userId:e.getItem(ye),anonymousId:e.getItem(fe),traits:e.getItem(ke)}}var jt=function(e){return we+"TEMP"+we+e};function Eo(e){var t=e.storage,n=t.setItem,r=t.removeItem,i=t.getItem;return function(o){return function(s){return function(a){var u=a.userId,c=a.traits,p=a.options;if(a.type===j.reset&&([ye,ke,fe].forEach(function(y){r(y)}),[ue,Oe,"traits"].forEach(function(y){Te(jt(y))})),a.type===j.identify){i(fe)||n(fe,xe());var l=i(ye),x=i(ke)||{};l&&l!==u&&o.dispatch({type:j.userIdChanged,old:{userId:l,traits:x},new:{userId:u,traits:c},options:p}),u&&n(ye,u),c&&n(ke,T({},x,c))}return s(a)}}}}var Me={};function Sn(e,t){Me[e]&&ee(Me[e])&&(Me[e](t),delete Me[e])}function zr(e,t,n){return new Promise(function(r,i){return t()?r(e):n<1?i(T({},e,{queue:!0})):new Promise(function(o){return setTimeout(o,10)}).then(function(o){return zr(e,t,n-10).then(r,i)})})}function Po(e){return{abort:e}}function Lr(e,t,n){var r={},i=t(),o=e.getState(),s=o.plugins,a=o.queue,u=o.user;if(!o.context.offline&&a&&a.actions&&a.actions.length){var c=a.actions.reduce(function(l,x,y){return s[x.plugin].loaded?(l.process.push(x),l.processIndex.push(y)):(l.requeue.push(x),l.requeueIndex.push(y)),l},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(l){var x=a.actions[l],y=x.plugin,b=x.payload.type,S=i[y][b];if(S&&ee(S)){var h,f=(function(w,v){return w===void 0&&(w={}),v===void 0&&(v={}),[ue,Oe].reduce(function(A,k){return w.hasOwnProperty(k)&&v[k]&&v[k]!==w[k]&&(A[k]=v[k]),A},w)})(x.payload,u),m=r[f.meta.rid];if(!m&&(h=S({payload:f,config:s[y].config,instance:n,abort:Po}))&&Q(h)&&h.abort)return void(r[f.meta.rid]=!0);if(!m){var O=b+":"+y;e.dispatch(T({},f,{type:O,_:{called:O,from:"queueDrain"}}))}}});var p=a.actions.filter(function(l,x){return!~c.processIndex.indexOf(x)});a.actions=p}}}var dt=function(e){var t=e.data,n=e.action,r=e.instance,i=e.state,o=e.allPlugins,s=e.allMatches,a=e.store,u=e.EVENTS;try{var c=i.plugins,p=i.context,l=n.type,x=l.match(Ae),y=t.exact.map(function(h){return h.pluginName});x&&(y=s.during.map(function(h){return h.pluginName}));var b=(function(h,f){return function(m,O,w){var v=O.config,A=O.name,k=A+"."+m.type;w&&(k=w.event);var C=m.type.match(Ae)?(function(M,P,z,U,q){return function($,E){var H=U?U.name:M,D=E&&ze(E)?E:z;if(U&&(!(D=E&&ze(E)?E:[M]).includes(M)||D.length!==1))throw new Error("Method "+P+" can only abort "+M+" plugin. "+JSON.stringify(D)+" input valid");return T({},q,{abort:{reason:$,plugins:D,caller:P,_:H}})}})(A,k,f,w,m):(function(M,P){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+P)}})(m,k);return{payload:jo(m),instance:h,config:v||{},abort:C}}})(r,y),S=t.exact.reduce(function(h,f){var m=f.pluginName,O=f.methodName,w=!1;return O.match(/^initialize/)||O.match(/^reset/)||(w=!c[m].loaded),p.offline&&O.match(/^(page|track|identify)/)&&(w=!0),h[""+m]=w,h},{});return Promise.resolve(t.exact.reduce(function(h,f,m){var O=f.pluginName;return Promise.resolve(h).then(function(w){function v(){return Promise.resolve(w)}var A=(function(){if(t.namespaced&&t.namespaced[O])return Promise.resolve(t.namespaced[O].reduce(function(k,C,M){return Promise.resolve(k).then(function(P){return C.method&&ee(C.method)?((function($,E){var H=jn($);if(H&&H.name===E){var D=jn(H.method);throw new Error([E+" plugin is calling method "+$,"Plugins cant call self","Use "+H.method+" "+(D?"or "+D.method:"")+" in "+E+" plugin insteadof "+$].join(`
2
+ import{a as pn}from"./HYX7BODW.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as dn}from"./B2DK4LWH.js";import{H as fn,h as cn,r as ln}from"./46DQNAMV.js";import"./OR4HXHSY.js";function Pi(){var e;return!!(!((e=window?.navigator)===null||e===void 0)&&e.globalPrivacyControl)}function ji(e={}){let{disabled:t,portal:n,requireConsent:r,userPrivacySettings:i}=e;if(r)if(i?.accepted){if(i?.functional===!1&&i?.performance===!1&&i?.targeting===!1)return!0}else return!0;return i?.accepted===!0&&i?.functional===!1&&i?.performance===!1&&i?.targeting===!1||t||n?.eueiEnabled===!1||Pi()?!0:!(!n||Ti(n)||Ni(n)||_i(n))}function Ti(e){return e.eueiEnabled&&e.user&&e.user.orgId===e.id}function Ni(e){return e.user&&!e.user.orgId&&e.ipCntryCode==="US"}function _i(e){return!e.user&&e.ipCntryCode==="US"}var Ue={storage:{},memory:!0,get(e){let t;try{t=window.localStorage&&window.localStorage.getItem(e)||this.storage[e]}catch{t=this.storage[e]}if(t)try{return JSON.parse(t)}catch{return}else return},set(e,t){let n=JSON.stringify(t);try{window.localStorage.setItem(e,n)}catch{this.memory||(console.error("setting local storage failed, falling back to in-memory storage"),this.memory=!0),this.storage[e]=t}},delete(e){try{window.localStorage.removeItem(e)}catch{this.memory||(console.error("setting local storage failed, falling back to in-memory storage"),this.memory=!0),delete this.storage[e]}}},Er="esri-telemetry";function Ci(e){return new Promise((t,n)=>{e.onload=t,e.onerror=n,(!Ui(e)||e.body)&&t()})}function Mi(e){let{id:t,dataAttribute:n}=e;return!!document.getElementById(t)||!!document.querySelector(`[data-${Er}="${n}"]`)}function Ui(e){let{body:t,src:n,id:r,dataAttribute:i,section:o="body",type:s="text/javascript",async:a=!1,defer:u=!1,onload:c,onerror:p}=e;if(typeof window>"u")throw new Fe("Window is undefined: Cannot add script element.");if(Mi(e)){console.log(`script (${r||i}) is already present, skipping`);return}let l=Di({id:r,dataAttribute:i,type:s,async:a,defer:u,body:t,src:n,onload:c,onerror:p});return o==="body"?document.body.appendChild(l):document.head.appendChild(l)}var Fe=class extends Error{};function Di({id:e,dataAttribute:t,type:n,async:r,defer:i,body:o,src:s,onload:a,onerror:u}){let c=document.createElement("script");return e&&(c.id=e),t&&c.setAttribute(`data-${Er}`,t),s&&(c.src=s),o&&(c.innerText=o),c.type=n,c.async=r,c.defer=i,a&&(c.onload=a),u&&(c.onerror=u),c}function Ri(e){return e.map(t=>{let n=[];return["src","id","dataAttribute","type"].forEach(r=>{let i=r;r==="dataAttribute"&&(i="data-esri-telemetry"),t[r]&&n.push(`${i}="${t[r]}"`)}),["async","defer"].forEach(r=>{t[r]&&n.push(`${r}`)}),`<script ${n.join(" ")}>${t.body?t.body:""}<\/script>`}).join("")}var zi=["esri.com","esriuk.com","esri.de","esri.ca","esrifrance.fr","esri.nl","esri-portugal.pt","esribulgaria.com","esri.fi","esri.kr","esrimalaysia.com.my","esri.es","esriaustralia.com.au","esri-southafrica.com","esri.cl","esrichina.com.cn","esri.co","esriturkey.com.tr","geodata.no","esriitalia.it","esri.pl"],kt=class{constructor(t){var n,r,i;this.trackers=[],this.options=t,this.debug=t.debug,this.suppressDisabledWarnings=t.suppressDisabledWarnings,this.logger=t.logger||console,t.userPrivacySettings&&(this._userPrivacySettings=t.userPrivacySettings),t.requireConsent&&!t.userPrivacySettings&&(this._userPrivacySettings={accepted:!1,performance:!1,targeting:!1,functional:!1,id:Vi(),timestamp:Date.now()},t.userPrivacySettings=this._userPrivacySettings),this.disabled=ji(t),this.disabled&&!this.suppressDisabledWarnings&&this.logger.info("Telemetry Disabled");let o=((n=t.portal)===null||n===void 0?void 0:n.user)||t.user;o&&this.setUser(o,(i=(r=t.portal)===null||r===void 0?void 0:r.subscriptionInfo)===null||i===void 0?void 0:i.type),this.disabled||this.initializeTrackers()}shouldInitializeTrackers(t,n,r){let i=!n&&!t?.accepted,o=r.every(s=>t?.[s]);return i||o}filterTrackers(t){return this.options.plugins.filter(n=>t.includes(n.name))}initializeTrackers(){let t=this._userPrivacySettings,n=this.options.requireConsent;this.trackers=[],this.options.plugins&&(t?(this.shouldInitializeTrackers(t,n,["performance"])&&this.trackers.push(...this.filterTrackers(["amazon"])),this.shouldInitializeTrackers(t,n,["performance","targeting","functional"])&&this.trackers.push(...this.filterTrackers(["adobe-analytics","googleAnalytics","siteimprove"]))):this.trackers.push(...this.options.plugins)),this.trackers.length||this.logger.info("No trackers configured")}getScriptTags(){return this.trackers.map(t=>t.getScriptTags&&t.getScriptTags()).join("")}async init(){let t=this.trackers.map(n=>n.init());await Promise.all(t)}setUser(t={},n="Public"){t=typeof t=="string"?{username:t}:t,this.user=t,this.user.accountType=n;let r;if(t.email&&t.email.split){let i=t.email.split("@")[1];r=zi.filter(o=>i===o).length>0}(r||["In House","Demo and Marketing"].indexOf(n)>-1)&&(this.user.internalUser=!0)}async updateUserPrivacySettings(t){let{accepted:n,performance:r,targeting:i,functional:o}=this._userPrivacySettings,s=t.accepted&&!n&&!this.options.requireConsent&&(!t.performance||!t.targeting||!t.functional)||!t.performance&&r||!t.targeting&&i||!t.functional&&o;return this._userPrivacySettings=t,s||(this.disabled=!1,this.initializeTrackers(),await this.init()),{reload:s}}logPageView(t,n={},r={}){if(this.disabled&&!this.suppressDisabledWarnings)return this.logger.info("Page view was not logged because telemetry is disabled."),!1;let i=this.trackers.filter(({disabled:a,hasError:u})=>!a&&!u);if(!i.length)return this.logger.info("Page view was not logged because no enabled telemetry-plugins are registered."),!1;let o=this.preProcess(n,r);this.debug&&this.logger.info("Tracking page view",JSON.stringify(o));let s=i.map(a=>a.logPageView(t,o));return Promise.all(s).then(),!0}logEvent(t,n={}){if(this.disabled&&!this.suppressDisabledWarnings)return this.logger.info("Event was not logged because telemetry is disabled."),!1;let r=this.trackers.filter(({disabled:s,hasError:a})=>!s&&!a);if(!r.length)return this.logger.info("Event was not logged because no enabled telemetry-plugins are registered."),!1;let i=this.preProcess(t,n);this.debug&&this.logger.info("Tracking event",JSON.stringify(i));let o=r.map(s=>s.logEvent(i));return Promise.all(o).then(),!0}logError(t={}){t=Object.assign({eventType:"error"},t),this.logEvent(t)}startWorkflow(t,n={}){let r={name:t,start:Date.now(),steps:[],workflowId:Math.floor((1+Math.random())*17592186044416).toString(16)};this.saveWorkflow(r);let i=Object.assign({name:t,step:"start"},n);return this.logWorkflow(i),r}stepWorkflow(t,n,r={}){let i=typeof r=="string"?r:r.details,o=Object.assign({name:t,step:n,details:i},r);this.logWorkflow(o)}endWorkflow(t,n={}){let r=Object.assign({name:t,step:"finish"},n);this.logWorkflow(r)}cancelWorkflow(t,n={}){let r=Object.assign({name:t,step:"cancel"},n);this.logWorkflow(r)}getWorkflow(t){let n=Ue.get(`TELEMETRY-WORKFLOW:${t}`);if(n){let r=Date.now()-n.start,i=1800*1e3;if(r<i)return n;this.deleteWorkflow(n)}}saveWorkflow(t){Ue.set(`TELEMETRY-WORKFLOW:${t.name}`,t)}deleteWorkflow(t){Ue.delete(`TELEMETRY-WORKFLOW:${t.name}`)}logWorkflow(t={}){t=this.preProcess(t);let n=this.getWorkflow(t.name);n||(this.startWorkflow(t.name),n=this.getWorkflow(t.name)),n.steps.push(t.step),n.duration=(Date.now()-n.start)/1e3,["cancel","finish"].indexOf(t.step)>-1?this.deleteWorkflow(n):this.saveWorkflow(n);let r=Object.assign(t,{eventType:"workflow",category:t.name,action:t.step,label:t.details,duration:n.duration,workflowId:n.workflowId});this.logEvent(r)}preProcess(t={},n={}){let r={};return this.user&&(r={user:"unknown",org:"unknown",lastLogin:this.user.lastLogin,userSince:this.user.created,internalUser:this.user.internalUser||!1,accountType:this.user.accountType}),Object.entries(Object.assign(Object.assign({},t),r)).reduce(Li(n.omitComplexData,this.logger),{})}disable(){this.disabled=!0,this.trackers.forEach(t=>{var n;t.hasError||(t.disabled=!0,(n=t.disable)===null||n===void 0||n.call(t))})}disableTracker(t){var n;let r=this.trackers.find(({name:i})=>i===t);r&&!r.hasError&&(r.disabled=!0,(n=r.disable)===null||n===void 0||n.call(r))}enableTracker(t){var n;let r=this.trackers.find(({name:i})=>i===t);r&&!r.hasError&&(r.disabled=!1,(n=r.enable)===null||n===void 0||n.call(r))}};function Li(e,t){return function(n,[r,i]){return $i(i)?n[r]=i:e||(t.warn(`You are trying to log a non-primitive value, ${r}:${JSON.stringify(i)}. This will get logged as [object Object]`),n[r]=i),n}}function $i(e){return["string","number","boolean","undefined"].includes(typeof e)||e&&typeof e.valueOf()=="string"}function Vi(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Gt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var At=class{constructor(t){var n;if(this.name="googleAnalytics",this.dimensions={},this.metrics={},this.isInitialized=!1,typeof window<"u"&&!(!((n=t?.measurementIds)===null||n===void 0)&&n.length))throw new Error("at least one measurementId needs to be provided in your configuration");Object.assign(this,t)}_getScripts(){return[{dataAttribute:"google-analytics",async:!0,src:`https://www.googletagmanager.com/gtag/js?id=${this.measurementIds?this.measurementIds[0]:""}`}]}getScriptTags(){return Ri(this._getScripts())}async init(){if(!this.isInitialized){if(typeof window>"u")throw new Fe("Window is undefined: Cannot add script element.");await Promise.all(this._getScripts().map(t=>Ci(t))),this.injectConfig(),this.isInitialized=!0}}logPageView(t,n={}){let r=this.buildCustomParams(n),i=Object.assign({page_title:t||window.location.pathname},r);return window.gtag("event","page_view",i),!0}logEvent(t){let{action:n}=t,r=Gt(t,["action"]),i=n||"other",o=this.buildCustomParams(r);return window.gtag("event",i,o),!0}disable(){this.measurementIds&&this.measurementIds.forEach(t=>{window[`ga-disable-${t}`]=!0})}enable(){this.measurementIds&&this.measurementIds.forEach(t=>{window[`ga-disable-${t}`]=void 0})}injectConfig(){window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date);let t={custom_map:this.createDimensionsAndMetricsCustomMap(this.dimensions,this.metrics),send_page_view:!1,anonymize_ip:!0};this.measurementIds.forEach(n=>{window.gtag("config",n,t)})}buildCustomParams(t){let n,{category:r,label:i}=t;return n=this.verifyCustomDimensionAndMetrics(t),r&&(n=Object.assign(Object.assign({},n),{event_category:r})),i&&(n=Object.assign(Object.assign({},n),{event_label:i})),n}verifyCustomDimensionAndMetrics(t){let n=this.createDimensionsAndMetricsCustomMap(this.dimensions,this.metrics),r=Object.values(n);return Object.keys(t).filter(i=>r.includes(i)).reduce((i,o)=>Object.assign(i,{[o]:t[o]}),{})}createDimensionsAndMetricsCustomMap(t={},n={}){let r=this.createMetricCustomMap(n),i=this.createDimensionCustomMap(t);return Object.assign(Object.assign({},r),i)}createMetricCustomMap(t={}){return Object.keys(t).map(function(n){return{key:`metric${t[n]}`,value:n}}).filter(n=>n).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}createDimensionCustomMap(t={}){return Object.keys(t).map(function(n){return{key:`dimension${t[n]}`,value:n}}).filter(n=>n).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}},gn="TELEMETRY_COGNITO_CREDENTIALS";function Wi(e,t={}){let n=`https://cognito-identity${t.fips===!0?"-fips":""}.us-east-1.amazonaws.com/`,r=Ue.get(gn);if(r&&Date.now()/1e3<r.Expiration)return Promise.resolve(r);let i={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetId"},body:JSON.stringify({IdentityPoolId:e})};return fetch(n,i).then(o=>{if(!o.ok)throw new Error(o.statusText);return o.json()}).then(o=>{let{IdentityId:s}=o,a={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},body:JSON.stringify({IdentityId:s})};return fetch(n,a)}).then(o=>{if(!o.ok)throw new Error(o.statusText);return o.json()}).then(({Credentials:o})=>(Ue.set(gn,o),o))}function Pr({telemetryData:e,dimensionLookup:t={},excludeKeys:n=[]}){return Object.keys(e).filter(r=>!n.includes(r)).map(r=>t[r]?{key:Hi(t,r),value:e[r]}:{key:r,value:qi(e,r)}).reduce((r,{key:i,value:o})=>(r[i]=o,r),{})}function qi(e,t){return t==="json"?e[t]?JSON.stringify(e[t]):"null":e[t]===void 0?"null":e[t].toString()}function Hi(e,t){return`dimension${e[t]}`}var Ki=["size","duration","position","number","count"];function jr(e,t={}){return Object.keys(e).filter(n=>t[n]||Ki.includes(n)).map(n=>t[n]?{key:Gi(t,n),value:e[n]}:{key:n,value:e[n]}).reduce((n,{key:r,value:i})=>(n[r]=i,n),{})}function Gi(e,t){return`metric${e[t]}`}function Ji({event:e={},dimensionLookup:t={},metricLookup:n={}}){var r,i;let{pathname:o,eventType:s="other"}=e,a=jr(e,n),u=Pr({telemetryData:Object.assign({eventType:s},e),dimensionLookup:t,excludeKeys:["workflow","pathname",...Object.keys(a),...Object.keys(n)]}),c=Object.assign(Object.assign({name:s},u),a);return typeof document<"u"&&document.referrer&&(c.referrer=document.referrer),typeof window<"u"&&!c.hostname&&(c.hostname=(r=window.location)===null||r===void 0?void 0:r.hostname),c.path=typeof window<"u"&&window.location.pathname?(i=window.location)===null||i===void 0?void 0:i.pathname:o,c}function Xi({page:e,previousPage:t={},options:n={},dimensionLookup:r={},metricLookup:i={}}){let o=jr(n,i),s=Pr({telemetryData:n,dimensionLookup:r,excludeKeys:["workflow",...Object.keys(o),...Object.keys(i)]}),{referrer:a,title:u}=document||{},{hostname:c,pathname:p}=window&&window.location?window.location:{};return Object.assign(Object.assign({name:"pageView",referrer:a,hostname:c,path:e||p,pageUrl:e||p,pageName:u,previousPageUrl:t.pageUrl,previousPageName:t.pageName},s),o)}function hn(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var Fi="function",Bi="string",ne="undefined",Qi="boolean",Be="object",Yi="array",Zi="number",eo="symbol",to="null",no=function(){},Tr="any",Nr="*",we="__",ro="form",io="input",oo="button",so="select",Qe=typeof process!==ne?process:{};Qe.env&&Qe.env.NODE_ENV;var Z=typeof document!==ne;Qe.versions!=null&&Qe.versions.node!=null;typeof Deno!==ne&&Deno.core;Z&&window.name==="nodejs"||typeof navigator!==ne&&typeof navigator.userAgent!==ne&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function _r(e,t){return t.charAt(0)[e]()+t.slice(1)}var ao=_r.bind(null,"toUpperCase"),uo=_r.bind(null,"toLowerCase");function co(e){return Cr(e)?ao(to):typeof e===Be?go(e):Object.prototype.toString.call(e).slice(8,-1)}function Ye(e,t){t===void 0&&(t=!0);var n=co(e);return t?uo(n):n}function $e(e,t){return typeof t===e}var ee=$e.bind(null,Fi),le=$e.bind(null,Bi),Se=$e.bind(null,ne),lo=$e.bind(null,Qi);$e.bind(null,eo);function Cr(e){return e===null}function fo(e){return Ye(e)===Zi&&!isNaN(e)}function Mr(e){return Ye(e)===Yi}function Q(e){if(!po(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function po(e){return e&&(typeof e===Be||e!==null)}function go(e){return ee(e.constructor)?e.constructor.name:null}function ho(e){return e instanceof Error||le(e.message)&&e.constructor&&fo(e.constructor.stackTraceLimit)}function Ur(e,t){if(typeof t!="object"||Cr(t))return!1;if(t instanceof e)return!0;var n=Ye(new e(""));if(ho(t))for(;t;){if(Ye(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}Ur.bind(null,TypeError);Ur.bind(null,SyntaxError);function nt(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?mo(e,t):n}function mo(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function rt(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}rt(nt,ro);rt(nt,oo);rt(nt,io);rt(nt,so);function yo(e){return e?Mr(e)?e:[e]:[]}function mn(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function vo(){if(Z){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function bo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function wo(e){return(function(t){for(var n,r=Object.create(null),i=/([^&=]+)=?([^&]*)/g;n=i.exec(t);){var o=mn(n[1]),s=mn(n[2]);if(o)if(o.substring(o.length-2)==="[]"){var a=r[o=o.substring(0,o.length-2)]||(r[o]=[]);r[o]=Array.isArray(a)?a:[],r[o].push(s)}else r[o]=s===""||s}for(var u in r){var c=u.split("[");c.length>1&&(xo(r,c.map(function(p){return p.replace(/[?[\]\\ ]/g,"")}),r[u]),delete r[u])}return r})((function(t){return Z&&window.location.search.substring(1)})())}function xo(e,t,n){for(var r=t.length-1,i=0;i<r;++i){var o=t[i];if(o==="__proto__"||o==="constructor")break;o in e||(e[o]={}),e=e[o]}e[t[r]]=n}function xe(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+=r=="-"||r=="4"?r:(r=="x"?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}var me="global",Ee=we+me+we,Pe=typeof self===Be&&self.self===self&&self||typeof global===Be&&global[me]===global&&global||void 0;function pe(e){return Pe[Ee][e]}function ge(e,t){return Pe[Ee][e]=t}function Te(e){delete Pe[Ee][e]}function Ne(e,t,n){var r;try{if(Jt(e)){var i=window[e];r=i[t].bind(i)}}catch{}return r||n}Pe[Ee]||(Pe[Ee]={});var We={};function Jt(e){if(typeof We[e]!==ne)return We[e];try{var t=window[e];t.setItem(ne,ne),t.removeItem(ne)}catch{return We[e]=!1}return We[e]=!0}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(null,arguments)}var ce="function",oe="undefined",De="reducer",Dr="@@redux/",It=Dr+"INIT",So=Dr+Math.random().toString(36),yn=(function(){return typeof Symbol===ce&&Symbol.observable||"@@observable"})(),qe=" != "+ce;function Rr(e,t,n){var r;if(typeof t===ce&&typeof n===oe&&(n=t,t=void 0),typeof n!==oe){if(typeof n!==ce)throw new Error("enhancer"+qe);return n(Rr)(e,t)}if(typeof e!==ce)throw new Error(De+qe);var i=e,o=t,s=[],a=s,u=!1;function c(){a===s&&(a=s.slice())}function p(){return o}function l(y){if(typeof y!==ce)throw new Error("Listener"+qe);var b=!0;return c(),a.push(y),function(){if(b){b=!1,c();var S=a.indexOf(y);a.splice(S,1)}}}function x(y){if(!Q(y))throw new Error("Act != obj");if(typeof y.type===oe)throw new Error("ActType "+oe);if(u)throw new Error("Dispatch in "+De);try{u=!0,o=i(o,y)}finally{u=!1}for(var b=s=a,S=0;S<b.length;S++)(0,b[S])();return y}return x({type:It}),(r={dispatch:x,subscribe:l,getState:p,replaceReducer:function(y){if(typeof y!==ce)throw new Error("next "+De+qe);i=y,x({type:It})}})[yn]=function(){var y,b=l;return(y={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function h(){S.next&&S.next(p())}return h(),{unsubscribe:b(h)}}})[yn]=function(){return this},y},r}function Oo(e,t){var n=t&&t.type;return"action "+(n&&n.toString()||"?")+De+" "+e+" returns "+oe}function je(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,n){return function(){return t(n.apply(void 0,[].slice.call(arguments)))}})}function ko(){var e=arguments;return function(t){return function(n,r,i){var o,s=t(n,r,i),a=s.dispatch,u={getState:s.getState,dispatch:function(c){return a(c)}};return o=[].slice.call(e).map(function(c){return c(u)}),T({},s,{dispatch:a=je.apply(void 0,o)(s.dispatch)})}}}var fe=we+"anon_id",ye=we+"user_id",ke=we+"user_traits",Et="analytics",ue="userId",Oe="anonymousId",Je=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],Pt=["name","EVENTS","config","loaded"],j=Je.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),vn=/^utm_/,bn=/^an_prop_/,wn=/^an_trait_/;function Ao(e){var t=e.storage.setItem;return function(n){return function(r){return function(i){if(i.type===j.bootstrap){var o=i.params,s=i.user,a=i.persistedUser,u=i.initialUser,c=a.userId===s.userId;a.anonymousId!==s.anonymousId&&t(fe,s.anonymousId),c||t(ye,s.userId),u.traits&&t(ke,T({},c&&a.traits?a.traits:{},u.traits));var p=Object.keys(i.params);if(p.length){var l=o.an_uid,x=o.an_event,y=p.reduce(function(b,S){if(S.match(vn)||S.match(/^(d|g)clid/)){var h=S.replace(vn,"");b.campaign[h==="campaign"?"name":h]=o[S]}return S.match(bn)&&(b.props[S.replace(bn,"")]=o[S]),S.match(wn)&&(b.traits[S.replace(wn,"")]=o[S]),b},{campaign:{},props:{},traits:{}});n.dispatch(T({type:j.params,raw:o},y,l?{userId:l}:{})),l&&setTimeout(function(){return e.identify(l,y.traits)},0),x&&setTimeout(function(){return e.track(x,y.props)},0),Object.keys(y.campaign).length&&n.dispatch({type:j.campaign,campaign:y.campaign})}}return r(i)}}}}function Io(e){return function(t,n){if(t===void 0&&(t={}),n===void 0&&(n={}),n.type===j.setItemEnd){if(n.key===fe)return T({},t,{anonymousId:n.value});if(n.key===ye)return T({},t,{userId:n.value})}switch(n.type){case j.identify:return Object.assign({},t,{userId:n.userId,traits:T({},t.traits,n.traits)});case j.reset:return[ye,fe,ke].forEach(function(r){e.removeItem(r)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function xn(e){return{userId:e.getItem(ye),anonymousId:e.getItem(fe),traits:e.getItem(ke)}}var jt=function(e){return we+"TEMP"+we+e};function Eo(e){var t=e.storage,n=t.setItem,r=t.removeItem,i=t.getItem;return function(o){return function(s){return function(a){var u=a.userId,c=a.traits,p=a.options;if(a.type===j.reset&&([ye,ke,fe].forEach(function(y){r(y)}),[ue,Oe,"traits"].forEach(function(y){Te(jt(y))})),a.type===j.identify){i(fe)||n(fe,xe());var l=i(ye),x=i(ke)||{};l&&l!==u&&o.dispatch({type:j.userIdChanged,old:{userId:l,traits:x},new:{userId:u,traits:c},options:p}),u&&n(ye,u),c&&n(ke,T({},x,c))}return s(a)}}}}var Me={};function Sn(e,t){Me[e]&&ee(Me[e])&&(Me[e](t),delete Me[e])}function zr(e,t,n){return new Promise(function(r,i){return t()?r(e):n<1?i(T({},e,{queue:!0})):new Promise(function(o){return setTimeout(o,10)}).then(function(o){return zr(e,t,n-10).then(r,i)})})}function Po(e){return{abort:e}}function Lr(e,t,n){var r={},i=t(),o=e.getState(),s=o.plugins,a=o.queue,u=o.user;if(!o.context.offline&&a&&a.actions&&a.actions.length){var c=a.actions.reduce(function(l,x,y){return s[x.plugin].loaded?(l.process.push(x),l.processIndex.push(y)):(l.requeue.push(x),l.requeueIndex.push(y)),l},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(l){var x=a.actions[l],y=x.plugin,b=x.payload.type,S=i[y][b];if(S&&ee(S)){var h,f=(function(w,v){return w===void 0&&(w={}),v===void 0&&(v={}),[ue,Oe].reduce(function(A,k){return w.hasOwnProperty(k)&&v[k]&&v[k]!==w[k]&&(A[k]=v[k]),A},w)})(x.payload,u),m=r[f.meta.rid];if(!m&&(h=S({payload:f,config:s[y].config,instance:n,abort:Po}))&&Q(h)&&h.abort)return void(r[f.meta.rid]=!0);if(!m){var O=b+":"+y;e.dispatch(T({},f,{type:O,_:{called:O,from:"queueDrain"}}))}}});var p=a.actions.filter(function(l,x){return!~c.processIndex.indexOf(x)});a.actions=p}}}var dt=function(e){var t=e.data,n=e.action,r=e.instance,i=e.state,o=e.allPlugins,s=e.allMatches,a=e.store,u=e.EVENTS;try{var c=i.plugins,p=i.context,l=n.type,x=l.match(Ae),y=t.exact.map(function(h){return h.pluginName});x&&(y=s.during.map(function(h){return h.pluginName}));var b=(function(h,f){return function(m,O,w){var v=O.config,A=O.name,k=A+"."+m.type;w&&(k=w.event);var C=m.type.match(Ae)?(function(M,P,z,U,q){return function($,E){var H=U?U.name:M,D=E&&ze(E)?E:z;if(U&&(!(D=E&&ze(E)?E:[M]).includes(M)||D.length!==1))throw new Error("Method "+P+" can only abort "+M+" plugin. "+JSON.stringify(D)+" input valid");return T({},q,{abort:{reason:$,plugins:D,caller:P,_:H}})}})(A,k,f,w,m):(function(M,P){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+P)}})(m,k);return{payload:jo(m),instance:h,config:v||{},abort:C}}})(r,y),S=t.exact.reduce(function(h,f){var m=f.pluginName,O=f.methodName,w=!1;return O.match(/^initialize/)||O.match(/^reset/)||(w=!c[m].loaded),p.offline&&O.match(/^(page|track|identify)/)&&(w=!0),h[""+m]=w,h},{});return Promise.resolve(t.exact.reduce(function(h,f,m){var O=f.pluginName;return Promise.resolve(h).then(function(w){function v(){return Promise.resolve(w)}var A=(function(){if(t.namespaced&&t.namespaced[O])return Promise.resolve(t.namespaced[O].reduce(function(k,C,M){return Promise.resolve(k).then(function(P){return C.method&&ee(C.method)?((function($,E){var H=jn($);if(H&&H.name===E){var D=jn(H.method);throw new Error([E+" plugin is calling method "+$,"Plugins cant call self","Use "+H.method+" "+(D?"or "+D.method:"")+" in "+E+" plugin insteadof "+$].join(`
3
3
  `))}})(C.methodName,C.pluginName),Promise.resolve(C.method({payload:P,instance:r,abort:(z=P,U=O,q=C.pluginName,function($,E){return T({},z,{abort:{reason:$,plugins:E||[U],caller:l,from:q||U}})}),config:An(C.pluginName,c,o),plugins:c})).then(function($){var E=Q($)?$:{};return Promise.resolve(T({},P,E))})):P;var z,U,q})},Promise.resolve(n))).then(function(k){w[O]=k});w[O]=n})();return A&&A.then?A.then(v):v()})},Promise.resolve({}))).then(function(h){return Promise.resolve(t.exact.reduce(function(f,m,O){try{var w=t.exact.length===O+1,v=m.pluginName,A=o[v];return Promise.resolve(f).then(function(k){var C=h[v]?h[v]:{};if(x&&(C=k),gt(C,v))return pt({data:C,method:l,instance:r,pluginName:v,store:a}),Promise.resolve(k);if(gt(k,v))return w&&pt({data:k,method:l,instance:r,store:a}),Promise.resolve(k);if(S.hasOwnProperty(v)&&S[v]===!0)return a.dispatch({type:"queue",plugin:v,payload:C,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(k);var M=b(h[v],o[v]);return Promise.resolve(A[l]({abort:M.abort,payload:C,instance:r,config:An(v,c,o),plugins:c})).then(function(P){var z=Q(P)?P:{},U=T({},k,z),q=h[v];if(gt(q,v))pt({data:q,method:l,instance:r,pluginName:v,store:a});else{var $=l+":"+v;($.match(/:/g)||[]).length<2&&!l.match(On)&&!l.match(kn)&&r.dispatch(T({},x?U:C,{type:$,_:{called:$,from:"submethod"}}))}return Promise.resolve(U)})})}catch(k){return Promise.reject(k)}},Promise.resolve(n))).then(function(f){if(!(l.match(Ae)||l.match(/^registerPlugin/)||l.match(kn)||l.match(On)||l.match(/^params/)||l.match(/^userIdChanged/))){if(u.plugins.includes(l),f._&&f._.originalAction===l)return f;var m=T({},f,{_:{originalAction:f.type,called:f.type,from:"engineEnd"}});$r(f,t.exact.length)&&!l.match(/End$/)&&(m=T({},m,{type:f.type+"Aborted"})),a.dispatch(m)}return f})})}catch(h){return Promise.reject(h)}},Ae=/Start$/,On=/^bootstrap/,kn=/^ready/;function pt(e){var t=e.pluginName,n=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(T({},e.data,{type:n,_:{called:n,from:"abort"}}))}function An(e,t,n){var r=t[e]||n[e];return r&&r.config?r.config:{}}function In(e,t){return t.reduce(function(n,r){return r[e]?n.concat({methodName:e,pluginName:r.name,method:r[e]}):n},[])}function En(e,t){var n=e.replace(Ae,""),r=t?":"+t:"";return[""+e+r,""+n+r,n+"End"+r]}function gt(e,t){var n=e.abort;return!!n&&(n===!0||Pn(n,t)||n&&Pn(n.plugins,t))}function $r(e,t){var n=e.abort;if(!n)return!1;if(n===!0||le(n))return!0;var r=n.plugins;return ze(n)&&n.length===t||ze(r)&&r.length===t}function ze(e){return Array.isArray(e)}function Pn(e,t){return!(!e||!ze(e))&&e.includes(t)}function jn(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function jo(e){return Object.keys(e).reduce(function(t,n){return n==="type"||(t[n]=Q(e[n])?Object.assign({},e[n]):e[n]),t},{})}function To(e,t,n){var r={};return function(i){return function(o){return function(s){try{var a,u=function(w){return a?w:o(l)},c=s.type,p=s.plugins,l=s;if(s.abort)return Promise.resolve(o(s));if(c===j.enablePlugin&&i.dispatch({type:j.initializeStart,plugins:p,disabled:[],fromEnable:!0,meta:s.meta}),c===j.disablePlugin&&setTimeout(function(){return Sn(s.meta.rid,{payload:s})},0),c===j.initializeEnd){var x=t(),y=Object.keys(x),b=y.filter(function(w){return p.includes(w)}).map(function(w){return x[w]}),S=[],h=[],f=s.disabled,m=b.map(function(w){var v=w.loaded,A=w.name,k=w.config;return zr(w,function(){return v({config:k})},1e4).then(function(C){return r[A]||(i.dispatch({type:j.pluginReadyType(A),name:A,events:Object.keys(w).filter(function(M){return!Pt.includes(M)})}),r[A]=!0),S=S.concat(A),w}).catch(function(C){if(C instanceof Error)throw new Error(C);return h=h.concat(C.name),C})});Promise.all(m).then(function(w){var v={plugins:S,failed:h,disabled:f};setTimeout(function(){y.length===m.length+f.length&&i.dispatch(T({},{type:j.ready},v))},0)})}var O=(function(){if(c!==j.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){return Lr(i,t,e)},0),Promise.resolve((function(w,v,A,k,C){try{var M=ee(v)?v():v,P=w.type,z=P.replace(Ae,"");if(w._&&w._.called)return Promise.resolve(w);var U=A.getState(),q=(H=M,(D=U.plugins)===void 0&&(D={}),(N=w.options)===void 0&&(N={}),Object.keys(H).filter(function(d){var g=N.plugins||{};return lo(g[d])?g[d]:g.all!==!1&&(!D[d]||D[d].enabled!==!1)}).map(function(d){return H[d]}));P===j.initializeStart&&w.fromEnable&&(q=Object.keys(U.plugins).filter(function(d){var g=U.plugins[d];return w.plugins.includes(d)&&!g.initialized}).map(function(d){return M[d]}));var $=q.map(function(d){return d.name}),E=(function(d,g){var I=En(d).map(function(_){return In(_,g)});return g.reduce(function(_,L){var R=L.name,X=En(d,R).map(function(ie){return In(ie,g)}),W=X[0],G=X[1],V=X[2];return W.length&&(_.beforeNS[R]=W),G.length&&(_.duringNS[R]=G),V.length&&(_.afterNS[R]=V),_},{before:I[0],beforeNS:{},during:I[1],duringNS:{},after:I[2],afterNS:{}})})(P,q);return Promise.resolve(dt({action:w,data:{exact:E.before,namespaced:E.beforeNS},state:U,allPlugins:M,allMatches:E,instance:A,store:k,EVENTS:C})).then(function(d){function g(){var L=(function(){if(P.match(Ae))return Promise.resolve(dt({action:T({},I,{type:z+"End"}),data:{exact:E.after,namespaced:E.afterNS},state:U,allPlugins:M,allMatches:E,instance:A,store:k,EVENTS:C})).then(function(R){R.meta&&R.meta.hasCallback&&Sn(R.meta.rid,{payload:R})})})();return L&&L.then?L.then(function(){return d}):d}if($r(d,$.length))return d;var I,_=(function(){if(P!==z)return Promise.resolve(dt({action:T({},d,{type:z}),data:{exact:E.during,namespaced:E.duringNS},state:U,allPlugins:M,allMatches:E,instance:A,store:k,EVENTS:C})).then(function(L){I=L});I=d})();return _&&_.then?_.then(g):g()})}catch(d){return Promise.reject(d)}var H,D,N})(s,t,e,i,n)).then(function(w){var v=o(w);return a=1,v})})();return Promise.resolve(O&&O.then?O.then(u):u(O))}catch(w){return Promise.reject(w)}}}}}function No(e){return function(t){return function(n){return function(r){var i=r.type,o=r.key,s=r.value,a=r.options;if(i===j.setItem||i===j.removeItem){if(r.abort)return n(r);i===j.setItem?e.setItem(o,s,a):e.removeItem(o,a)}return n(r)}}}}var _o=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,n){e[n]=e[n].concat(t)},this.removeMiddleware=function(t,n){var r=e[n].findIndex(function(i){return i===t});r!==-1&&(e[n]=[].concat(e[n].slice(0,r),e[n].slice(r+1)))},this.dynamicMiddlewares=function(t){return function(n){return function(r){return function(i){var o={getState:n.getState,dispatch:function(a){return n.dispatch(a)}},s=e[t].map(function(a){return a(o)});return je.apply(void 0,s)(r)(i)}}}}};function Co(e){return function(t,n){t===void 0&&(t={});var r={};if(n.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(n.type)){var i=Tn(n.type,"registerPlugin"),o=e()[i];if(!o||!i)return t;var s=n.enabled,a=o.config;return r[i]={enabled:s,initialized:!!s&&!o.initialize,loaded:!!s&&!!o.loaded({config:a}),config:a},T({},t,r)}if(/^initialize:([^:]*)$/.test(n.type)){var u=Tn(n.type,j.initialize),c=e()[u];return c&&u?(r[u]=T({},t[u],{initialized:!0,loaded:!!c.loaded({config:c.config})}),T({},t,r)):t}if(/^ready:([^:]*)$/.test(n.type))return r[n.name]=T({},t[n.name],{loaded:!0}),T({},t,r);switch(n.type){case j.disablePlugin:return T({},t,Nn(n.plugins,!1,t));case j.enablePlugin:return T({},t,Nn(n.plugins,!0,t));default:return t}}}function Tn(e,t){return e.substring(t.length+1,e.length)}function Nn(e,t,n){return e.reduce(function(r,i){return r[i]=T({},n[i],{enabled:t}),r},n)}function Vr(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var Mo={last:{},history:[]};function Uo(e,t){e===void 0&&(e=Mo);var n=t.options,r=t.meta;if(t.type===j.track){var i=Vr(T({event:t.event,properties:t.properties},Object.keys(n).length&&{options:n},{meta:r}));return T({},e,{last:i,history:e.history.concat(i)})}return e}var Do={actions:[]};function Ro(e,t){e===void 0&&(e=Do);var n=t.payload;switch(t.type){case"queue":var r;return r=n&&n.type&&n.type===j.identify?[t].concat(e.actions):e.actions.concat(t),T({},e,{actions:r});case"dequeue":return[];default:return e}}var Wr=/#.*$/;function zo(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Wr,""):"")}var qr,Hr,Kr,Gr,Lo=function(e){if(e===void 0&&(e={}),!Z)return e;var t=document,n=t.title,r=t.referrer,i=window,o=i.location,s=i.innerWidth,a=i.innerHeight,u=o.hash,c=o.search,p=(function(x){var y=(function(){if(Z){for(var b,S=document.getElementsByTagName("link"),h=0;b=S[h];h++)if(b.getAttribute("rel")==="canonical")return b.getAttribute("href")}})();return y?y.match(/\?/)?y:y+x:window.location.href.replace(Wr,"")})(c),l={title:n,url:p,path:zo(p),hash:u,search:c,width:s,height:a};return r&&r!==""&&(l.referrer=r),T({},l,e)},$o={last:{},history:[]};function Vo(e,t){e===void 0&&(e=$o);var n=t.options;if(t.type===j.page){var r=Vr(T({properties:t.properties,meta:t.meta},Object.keys(n).length&&{options:n}));return T({},e,{last:r,history:e.history.concat(r)})}return e}qr=(function(){if(!Z)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"})(),Hr=Z?document.referrer:null,Kr=vo(),Gr=bo();var _n={initialized:!1,sessionId:xe(),app:null,version:null,debug:!1,offline:!!Z&&!navigator.onLine,os:{name:qr},userAgent:Z?navigator.userAgent:"node",library:{name:Et,version:"0.13.1"},timezone:Gr,locale:Kr,campaign:{},referrer:Hr};function Wo(e,t){e===void 0&&(e=_n);var n=e.initialized,r=t.campaign;switch(t.type){case j.campaign:return T({},e,{campaign:r});case j.offline:return T({},e,{offline:!0});case j.online:return T({},e,{offline:!1});default:return n?e:T({},_n,e,{initialized:!0})}}var qo=["plugins","reducers","storage"];function Ho(e,t,n){if(Z){var r=window[(n?"add":"remove")+"EventListener"];e.split(" ").forEach(function(i){r(i,t)})}}function Ko(e){var t=Ho.bind(null,"online offline",function(n){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(n){return t(!1)}}function Jr(){return ge(Et,[]),function(e){return function(t,n,r){var i=e(t,n,r),o=i.dispatch;return Object.assign(i,{dispatch:function(s){return Pe[Ee][Et].push(s.action||s),o(s)}})}}}function Cn(e){return function(){return je(je.apply(null,arguments),Jr())}}function ht(e){return e?Mr(e)?e:[e]:[]}function Mn(e,t,n){e===void 0&&(e={});var r,i,o=xe();return t&&(Me[o]=(r=t,i=(function(s){for(var a,u=s||Array.prototype.slice.call(arguments),c=0;c<u.length;c++)if(ee(u[c])){a=u[c];break}return a})(n),function(s){i&&i(s),r(s)})),T({},e,{rid:o,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function Go(e){e===void 0&&(e={});var t=e.reducers||{},n=e.initialUser||{},r=(e.plugins||[]).reduce(function(d,g){if(ee(g))return d.middlewares=d.middlewares.concat(g),d;if(g.NAMESPACE&&(g.name=g.NAMESPACE),!g.name)throw new Error("https://lytics.dev/errors/1");g.config||(g.config={});var I=g.EVENTS?Object.keys(g.EVENTS).map(function(R){return g.EVENTS[R]}):[];d.pluginEnabled[g.name]=!(g.enabled===!1||g.config.enabled===!1),delete g.enabled,g.methods&&(d.methods[g.name]=Object.keys(g.methods).reduce(function(R,X){var W;return R[X]=(W=g.methods[X],function(){for(var G=Array.prototype.slice.call(arguments),V=new Array(W.length),ie=0;ie<G.length;ie++)V[ie]=G[ie];return V[V.length]=v,W.apply({instance:v},V)}),R},{}),delete g.methods);var _=Object.keys(g).concat(I),L=new Set(d.events.concat(_));if(d.events=Array.from(L),d.pluginsArray=d.pluginsArray.concat(g),d.plugins[g.name])throw new Error(g.name+"AlreadyLoaded");return d.plugins[g.name]=g,d.plugins[g.name].loaded||(d.plugins[g.name].loaded=function(){return!0}),d},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),i=e.storage?e.storage:{getItem:pe,setItem:ge,removeItem:Te},o=(function(d){return function(g,I,_){return I.getState("user")[g]||(_&&Q(_)&&_[g]?_[g]:xn(d)[g]||pe(jt(g))||null)}})(i),s=r.plugins,a=r.events.filter(function(d){return!Pt.includes(d)}).sort(),u=new Set(a.concat(Je).filter(function(d){return!Pt.includes(d)})),c=Array.from(u).sort(),p=function(){return s},l=new _o,x=l.addMiddleware,y=l.removeMiddleware,b=l.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},h=wo(),f=xn(i),m=T({},f,n,h.an_uid?{userId:h.an_uid}:{},h.an_aid?{anonymousId:h.an_aid}:{});m.anonymousId||(m.anonymousId=xe());var O=T({enable:function(d,g){return new Promise(function(I){E.dispatch({type:j.enablePlugin,plugins:ht(d),_:{originalAction:j.enablePlugin}},I,[g])})},disable:function(d,g){return new Promise(function(I){E.dispatch({type:j.disablePlugin,plugins:ht(d),_:{originalAction:j.disablePlugin}},I,[g])})}},r.methods),w=!1,v={identify:function(d,g,I,_){try{var L=le(d)?d:null,R=Q(d)?d:g,X=I||{},W=v.user();ge(jt(ue),L);var G=L||R.userId||o(ue,v,R);return Promise.resolve(new Promise(function(V){E.dispatch(T({type:j.identifyStart,userId:G,traits:R||{},options:X,anonymousId:W.anonymousId},W.id&&W.id!==L&&{previousId:W.id}),V,[g,I,_])}))}catch(V){return Promise.reject(V)}},track:function(d,g,I,_){try{var L=Q(d)?d.event:d;if(!L||!le(L))throw new Error("EventMissing");var R=Q(d)?d:g||{},X=Q(I)?I:{};return Promise.resolve(new Promise(function(W){E.dispatch({type:j.trackStart,event:L,properties:R,options:X,userId:o(ue,v,g),anonymousId:o(Oe,v,g)},W,[g,I,_])}))}catch(W){return Promise.reject(W)}},page:function(d,g,I){try{var _=Q(d)?d:{},L=Q(g)?g:{};return Promise.resolve(new Promise(function(R){E.dispatch({type:j.pageStart,properties:Lo(_),options:L,userId:o(ue,v,_),anonymousId:o(Oe,v,_)},R,[d,g,I])}))}catch(R){return Promise.reject(R)}},user:function(d){if(d===ue||d==="id")return o(ue,v);if(d===Oe||d==="anonId")return o(Oe,v);var g=v.getState("user");return d?hn(g,d):g},reset:function(d){return new Promise(function(g){E.dispatch({type:j.resetStart},g,d)})},ready:function(d){return w&&d({plugins:O,instance:v}),v.on(j.ready,function(g){d&&d(g),w=!0})},on:function(d,g){if(!d||!ee(g))return!1;if(d===j.bootstrap)throw new Error(".on disabled for "+d);var I=/Start$|Start:/;if(d==="*"){var _=function(W){return function(G){return function(V){return V.type.match(I)&&g({payload:V,instance:v,plugins:s}),G(V)}}},L=function(W){return function(G){return function(V){return V.type.match(I)||g({payload:V,instance:v,plugins:s}),G(V)}}};return x(_,He),x(L,Ke),function(){y(_,He),y(L,Ke)}}var R=d.match(I)?He:Ke,X=function(W){return function(G){return function(V){return V.type===d&&g({payload:V,instance:v,plugins:s,abort:S}),G(V)}}};return x(X,R),function(){return y(X,R)}},once:function(d,g){if(!d||!ee(g))return!1;if(d===j.bootstrap)throw new Error(".once disabled for "+d);var I=v.on(d,function(_){g({payload:_.payload,instance:v,plugins:s,abort:S}),I()});return I},getState:function(d){var g=E.getState();return d?hn(g,d):Object.assign({},g)},dispatch:function(d){var g=le(d)?{type:d}:d;if(Je.includes(g.type))throw new Error("reserved action "+g.type);var I=T({},g,{_:T({originalAction:g.type},d._||{})});E.dispatch(I)},enablePlugin:O.enable,disablePlugin:O.disable,plugins:O,storage:{getItem:i.getItem,setItem:function(d,g,I){E.dispatch({type:j.setItemStart,key:d,value:g,options:I})},removeItem:function(d,g){E.dispatch({type:j.removeItemStart,key:d,options:g})}},setAnonymousId:function(d,g){v.storage.setItem(fe,d,g)},events:{core:Je,plugins:a}},A=r.middlewares.concat([function(d){return function(g){return function(I){return I.meta||(I.meta=Mn()),g(I)}}},b(He),To(v,p,{all:c,plugins:a}),No(i),Ao(v),Eo(v),b(Ke)]),k={context:Wo,user:Io(i),page:Vo,track:Uo,plugins:Co(p),queue:Ro},C=je,M=je;if(Z&&e.debug){var P=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;P&&(C=P({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Jr():Q(typeof arguments[0])?Cn():Cn().apply(null,arguments)}}var z,U=(function(d){return Object.keys(d).reduce(function(g,I){return qo.includes(I)||(g[I]=d[I]),g},{})})(e),q=r.pluginsArray.reduce(function(d,g){var I=g.name,_=g.config,L=g.loaded,R=r.pluginEnabled[I];return d[I]={enabled:R,initialized:!!R&&!g.initialize,loaded:!!L({config:_}),config:_},d},{}),$={context:U,user:m,plugins:q},E=Rr((function(d){for(var g=Object.keys(d),I={},_=0;_<g.length;_++){var L=g[_];typeof d[L]===ce&&(I[L]=d[L])}var R,X=Object.keys(I);try{(function(W){Object.keys(W).forEach(function(G){var V=W[G];if(typeof V(void 0,{type:It})===oe||typeof V(void 0,{type:So})===oe)throw new Error(De+" "+G+" "+oe)})})(I)}catch(W){R=W}return function(W,G){if(W===void 0&&(W={}),R)throw R;for(var V=!1,ie={},lt=0;lt<X.length;lt++){var Ve=X[lt],un=W[Ve],ft=(0,I[Ve])(un,G);if(typeof ft===oe){var Ei=Oo(Ve,G);throw new Error(Ei)}ie[Ve]=ft,V=V||ft!==un}return V?ie:W}})(T({},k,t)),$,M(C(ko.apply(void 0,A))));E.dispatch=(z=E.dispatch,function(d,g,I){var _=T({},d,{meta:Mn(d.meta,g,ht(I))});return z.apply(null,[_])});var H=Object.keys(s);E.dispatch({type:j.bootstrap,plugins:H,config:U,params:h,user:m,initialUser:n,persistedUser:f});var D=H.filter(function(d){return r.pluginEnabled[d]}),N=H.filter(function(d){return!r.pluginEnabled[d]});return E.dispatch({type:j.registerPlugins,plugins:H,enabled:r.pluginEnabled}),r.pluginsArray.map(function(d,g){var I=d.bootstrap,_=d.config,L=d.name;I&&ee(I)&&I({instance:v,config:_,payload:d}),E.dispatch({type:j.registerPluginType(L),name:L,enabled:r.pluginEnabled[L],plugin:d}),r.pluginsArray.length===g+1&&E.dispatch({type:j.initializeStart,plugins:D,disabled:N})}),Ko(function(d){E.dispatch({type:d?j.offline:j.online})}),(function(d,g,I){setInterval(function(){return Lr(d,g,I)},3e3)})(E,p,v),v}var He="before",Ke="after",ve="cookie",he=Br(),Xt=it,Xr=it;function Fr(e){return he?it(e,"",-1):Te(e)}function Br(){if(he!==void 0)return he;var e=ve+ve;try{it(e,e),he=document.cookie.indexOf(e)!==-1,Fr(e)}catch{he=!1}return he}function it(e,t,n,r,i,o){if(typeof window<"u"){var s=arguments.length>1;return he===!1&&(s?ge(e,t):pe(e)),s?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(i?"; domain="+i:"")+(o?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var se="localStorage",Jo=Jt.bind(null,se),Ft=Ne(se,"getItem",pe),Xo=Ne(se,"setItem",ge),Qr=Ne(se,"removeItem",Te),ae="sessionStorage",Fo=Jt.bind(null,ae),Bo=Ne(ae,"getItem",pe),Qo=Ne(ae,"setItem",ge);Ne(ae,"removeItem",Te);function Ie(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(Q(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var Yo=Jo(),Zo=Fo(),es=Br();function Yr(e,t){if(e){var n=Bt(t),r=!en(n),i=Qt(n)?Ie(localStorage.getItem(e)):void 0;if(r&&!Se(i))return i;var o=Yt(n)?Ie(Xt(e)):void 0;if(r&&o)return o;var s=Zt(n)?Ie(sessionStorage.getItem(e)):void 0;if(r&&s)return s;var a=pe(e);return r?a:{localStorage:i,sessionStorage:s,cookie:o,global:a}}}function ts(e,t,n){if(e&&!Se(t)){var r={},i=Bt(n),o=JSON.stringify(t),s=!en(i);return Qt(i)&&(r[se]=Ge(se,t,Ie(localStorage.getItem(e))),localStorage.setItem(e,o),s)?r[se]:Yt(i)&&(r[ve]=Ge(ve,t,Ie(Xt(e))),Xr(e,o),s)?r[ve]:Zt(i)&&(r[ae]=Ge(ae,t,Ie(sessionStorage.getItem(e))),sessionStorage.setItem(e,o),s)?r[ae]:(r[me]=Ge(me,t,pe(e)),ge(e,t),s?r[me]:r)}}function ns(e,t){if(e){var n=Bt(t),r=Yr(e,Nr),i={};return!Se(r.localStorage)&&Qt(n)&&(localStorage.removeItem(e),i[se]=r.localStorage),!Se(r.cookie)&&Yt(n)&&(Fr(e),i[ve]=r.cookie),!Se(r.sessionStorage)&&Zt(n)&&(sessionStorage.removeItem(e),i[ae]=r.sessionStorage),!Se(r.global)&&ot(n,me)&&(Te(e),i[me]=r.global),i}}function Bt(e){return e?le(e)?e:e.storage:Tr}function Qt(e){return Yo&&ot(e,se)}function Yt(e){return es&&ot(e,ve)}function Zt(e){return Zo&&ot(e,ae)}function en(e){return e===Nr||e==="all"}function ot(e,t){return e===Tr||e===t||en(e)}function Ge(e,t,n){return{location:e,current:t,previous:n}}var rs={setItem:ts,getItem:Yr,removeItem:ns};function is(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Un(Object(n),!0).forEach(function(r){is(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Un(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function os(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:rs};return Go(Dn(Dn({},t),e))}function te(e){"@babel/helpers - typeof";return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},te(e)}function ss(e,t){if(te(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(te(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function as(e){var t=ss(e,"string");return te(t)=="symbol"?t:t+""}function tn(e,t,n){return(t=as(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rn(Object(n),!0).forEach(function(r){tn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}},Ln={exports:{}},$n;function ei(){return $n||($n=1,(function(e){function t(n,r){this.v=n,this.k=r}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ln)),Ln.exports}var Vn={exports:{}},Wn={exports:{}},qn;function ti(){return qn||(qn=1,(function(e){function t(n,r,i,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}e.exports=t=function(a,u,c,p){function l(x,y){t(a,x,function(b){return this._invoke(x,y,b)})}u?s?s(a,u,{value:c,enumerable:!p,configurable:!p,writable:!p}):a[u]=c:(l("next",0),l("throw",1),l("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,i,o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Wn)),Wn.exports}var Hn;function ni(){return Hn||(Hn=1,(function(e){var t=ti();function n(){var r,i,o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function u(h,f,m,O){var w=f&&f.prototype instanceof p?f:p,v=Object.create(w.prototype);return t(v,"_invoke",(function(A,k,C){var M,P,z,U=0,q=C||[],$=!1,E={p:0,n:0,v:r,a:H,f:H.bind(r,4),d:function(D,N){return M=D,P=0,z=r,E.n=N,c}};function H(D,N){for(P=D,z=N,i=0;!$&&U&&!d&&i<q.length;i++){var d,g=q[i],I=E.p,_=g[2];D>3?(d=_===N)&&(z=g[(P=g[4])?5:(P=3,3)],g[4]=g[5]=r):g[0]<=I&&((d=D<2&&I<g[1])?(P=0,E.v=N,E.n=g[1]):I<_&&(d=D<3||g[0]>N||N>_)&&(g[4]=D,g[5]=N,E.n=_,P=0))}if(d||D>1)return c;throw $=!0,N}return function(D,N,d){if(U>1)throw TypeError("Generator is already running");for($&&N===1&&H(N,d),P=N,z=d;(i=P<2?r:z)||!$;){M||(P?P<3?(P>1&&(E.n=-1),H(P,z)):E.n=z:E.v=z);try{if(U=2,M){if(P||(D="next"),i=M[D]){if(!(i=i.call(M,z)))throw TypeError("iterator result is not an object");if(!i.done)return i;z=i.value,P<2&&(P=0)}else P===1&&(i=M.return)&&i.call(M),P<2&&(z=TypeError("The iterator does not provide a '"+D+"' method"),P=1);M=r}else if((i=($=E.n<0)?z:A.call(k,E))!==c)break}catch(g){M=r,P=1,z=g}finally{U=1}}return{value:i,done:$}}})(h,m,O),!0),v}var c={};function p(){}function l(){}function x(){}i=Object.getPrototypeOf;var y=[][s]?i(i([][s]())):(t(i={},s,function(){return this}),i),b=x.prototype=p.prototype=Object.create(y);function S(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,x):(h.__proto__=x,t(h,a,"GeneratorFunction")),h.prototype=Object.create(b),h}return l.prototype=x,t(b,"constructor",x),t(x,"constructor",l),l.displayName="GeneratorFunction",t(x,a,"GeneratorFunction"),t(b),t(b,a,"Generator"),t(b,s,function(){return this}),t(b,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:u,m:S}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Vn)),Vn.exports}var Kn={exports:{}},Gn={exports:{}},Jn={exports:{}},Xn;function ri(){return Xn||(Xn=1,(function(e){var t=ei(),n=ti();function r(i,o){function s(u,c,p,l){try{var x=i[u](c),y=x.value;return y instanceof t?o.resolve(y.v).then(function(b){s("next",b,p,l)},function(b){s("throw",b,p,l)}):o.resolve(y).then(function(b){x.value=b,p(x)},function(b){return s("throw",b,p,l)})}catch(b){l(b)}}var a;this.next||(n(r.prototype),n(r.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(u,c,p){function l(){return new o(function(x,y){s(u,p,x,y)})}return a=a?a.then(l,l):l()},!0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Jn)),Jn.exports}var Fn;function ii(){return Fn||(Fn=1,(function(e){var t=ni(),n=ri();function r(i,o,s,a,u){return new n(t().w(i,o,s,a),u||Promise)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Gn)),Gn.exports}var Bn;function us(){return Bn||(Bn=1,(function(e){var t=ii();function n(r,i,o,s,a){var u=t(r,i,o,s,a);return u.next().then(function(c){return c.done?c.value:u.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Kn)),Kn.exports}var Qn={exports:{}},Yn;function cs(){return Yn||(Yn=1,(function(e){function t(n){var r=Object(n),i=[];for(var o in r)i.unshift(o);return function s(){for(;i.length;)if((o=i.pop())in r)return s.value=o,s.done=!1,s;return s.done=!0,s}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Qn)),Qn.exports}var Zn={exports:{}},er={exports:{}},tr;function ls(){return tr||(tr=1,(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(er)),er.exports}var nr;function fs(){return nr||(nr=1,(function(e){var t=ls().default;function n(r){if(r!=null){var i=r[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],o=0;if(i)return i.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length))return{next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}}}throw new TypeError(t(r)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Zn)),Zn.exports}var rr;function ds(){return rr||(rr=1,(function(e){var t=ei(),n=ni(),r=us(),i=ii(),o=ri(),s=cs(),a=fs();function u(){var c=n(),p=c.m(u),l=(Object.getPrototypeOf?Object.getPrototypeOf(p):p.__proto__).constructor;function x(S){var h=typeof S=="function"&&S.constructor;return!!h&&(h===l||(h.displayName||h.name)==="GeneratorFunction")}var y={throw:1,return:2,break:3,continue:3};function b(S){var h,f;return function(m){h||(h={stop:function(){return f(m.a,2)},catch:function(){return m.v},abrupt:function(O,w){return f(m.a,y[O],w)},delegateYield:function(O,w,v){return h.resultName=w,f(m.d,a(O),v)},finish:function(O){return f(m.f,O)}},f=function(O,w,v){m.p=h.prev,m.n=h.next;try{return O(w,v)}finally{h.next=m.n}}),h.resultName&&(h[h.resultName]=m.v,h.resultName=void 0),h.sent=m.v,h.next=m.n;try{return S.call(this,h)}finally{m.p=h.prev,m.n=h.next}}}return(e.exports=u=function(){return{wrap:function(S,h,f,m){return c.w(b(S),h,f,m&&m.reverse())},isGeneratorFunction:x,mark:c.m,awrap:function(S,h){return new t(S,h)},AsyncIterator:o,async:function(S,h,f,m,O){return(x(h)?i:r)(b(S),h,f,m,O)},keys:s,values:a}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports})(zn)),zn.exports}var mt,ir;function ps(){if(ir)return mt;ir=1;var e=ds()();mt=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return mt}var gs=ps(),K=Zr(gs);function or(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(c){return void n(c)}a.done?t(u):Promise.resolve(u).then(r,i)}function re(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(u){or(o,r,i,s,a,"next",u)}function a(u){or(o,r,i,s,a,"throw",u)}s(void 0)})}}var sr=function(){};function hs(e,t){var n,r,i,o=(t=t||{}).initial||[],s=t.max||1/0,a=t.interval||1e4,u=t.onEmpty||sr,c=t.onPause||sr;function p(x){clearInterval(n);var y=o.splice(0,s);return y.length&&e(y,o),o.length?x?p():l():(i=!1,u(o))}function l(){i=!0,n=setInterval(p,a)}return o.length&&l(),{flush:function(x){p(x)},resume:p,push:function(x){return(r=o.push(x))>=s&&!t.throttle&&p(),i||l(),r},size:function(){return o.length},pause:function(x){x&&p(),clearInterval(n),i=!1,c(o)}}}var Xe="__",st="session",oi=Xe+st,si="page",ar=["id","createdAt","created"];function Tt(e){var t=e?new Date(e):new Date;return[t.toISOString(),t.getTime()]}function ai(){var e=Tt(),t=e[0],n=e[1];return{id:xe(),created:n,createdAt:t}}var ms={session:[Bo,Qo],page:[pe,ge]};function at(e,t){for(var n=ms[e],r=n[0],i=n[1],o=ai(),s=!1,a={},u=0;u<ar.length;u++){var c=ar[u],p=Xe+e+Xe+st+Xe+c,l=r(p);s=t||!l,(t||!t&&!l)&&i(p,o[c]);var x=l&&!t?l:o[c],y=c!=="created"?x:Number(x);a[c]=y}return nn(a,s)}function nn(e,t){var n=Date.now();return e.elapsed=n-e.created,e.expires&&(e.remaining=Math.max(e.expires-n,0),e.isExpired=e.remaining===0),e.isNew=t,e}function Le(e,t){e===void 0&&(e=30);var n=Xt(oi),r=n?JSON.parse(n):Ze(e);return t?r:nn(r,!n)}function Ze(e,t,n){e===void 0&&(e=30);var r=n?Le(e,!0):ai(),i=60*e,o=r.created;if(n){var s=Tt(),a=s[0],u=s[1];r.modified=u,r.modifiedAt=a,o=u}var c=Tt(o+1e3*i),p=c[0];return r.expires=c[1],r.expiresAt=p,r.duration=1e3*i,t&&(r=Object.assign(r,t)),Xr(oi,JSON.stringify(r),i),nn(r,!n)}var ys=function(e,t){return Ze(e,t,!0)},ui=at.bind(null,st),vs=at.bind(null,st,!0),rn=at.bind(null,si),ur=at.bind(null,si,!0),be=typeof window<"u";function bs(e){return typeof e=="string"}function cr(e){return typeof e=="boolean"}var yt,lr;function ws(){if(lr)return yt;lr=1;var e=function(f){return t(f)&&!n(f)};function t(f){return!!f&&typeof f=="object"}function n(f){var m=Object.prototype.toString.call(f);return m==="[object RegExp]"||m==="[object Date]"||o(f)}var r=typeof Symbol=="function"&&Symbol.for,i=r?Symbol.for("react.element"):60103;function o(f){return f.$$typeof===i}function s(f){return Array.isArray(f)?[]:{}}function a(f,m){return m.clone!==!1&&m.isMergeableObject(f)?S(s(f),f,m):f}function u(f,m,O){return f.concat(m).map(function(w){return a(w,O)})}function c(f,m){if(!m.customMerge)return S;var O=m.customMerge(f);return typeof O=="function"?O:S}function p(f){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(f).filter(function(m){return Object.propertyIsEnumerable.call(f,m)}):[]}function l(f){return Object.keys(f).concat(p(f))}function x(f,m){try{return m in f}catch{return!1}}function y(f,m){return x(f,m)&&!(Object.hasOwnProperty.call(f,m)&&Object.propertyIsEnumerable.call(f,m))}function b(f,m,O){var w={};return O.isMergeableObject(f)&&l(f).forEach(function(v){w[v]=a(f[v],O)}),l(m).forEach(function(v){y(f,v)||(x(f,v)&&O.isMergeableObject(m[v])?w[v]=c(v,O)(f[v],m[v],O):w[v]=a(m[v],O))}),w}function S(f,m,O){O=O||{},O.arrayMerge=O.arrayMerge||u,O.isMergeableObject=O.isMergeableObject||e,O.cloneUnlessOtherwiseSpecified=a;var w=Array.isArray(m),v=Array.isArray(f),A=w===v;return A?w?O.arrayMerge(f,m,O):b(f,m,O):a(m,O)}S.all=function(f,m){if(!Array.isArray(f))throw new Error("first argument should be an array");return f.reduce(function(O,w){return S(O,w,m)},{})};var h=S;return yt=h,yt}var xs=ws(),Ss=Zr(xs),Nt=new TextEncoder,Os={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},ks=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]),_t=class{constructor({accessKeyId:t,secretAccessKey:n,sessionToken:r,service:i,region:o,cache:s,retries:a,initRetryMs:u}){if(t==null)throw new TypeError("accessKeyId is a required option");if(n==null)throw new TypeError("secretAccessKey is a required option");this.accessKeyId=t,this.secretAccessKey=n,this.sessionToken=r,this.service=i,this.region=o,this.cache=s||new Map,this.retries=a??10,this.initRetryMs=u||50}async sign(t,n){if(t instanceof Request){let{method:o,url:s,headers:a,body:u}=t;n=Object.assign({method:o,url:s,headers:a},n),n.body==null&&a.has("Content-Type")&&(n.body=u!=null&&a.has("X-Amz-Content-Sha256")?u:await t.clone().arrayBuffer()),t=s}let r=new Ct(Object.assign({url:t.toString()},n,this,n&&n.aws)),i=Object.assign({},n,await r.sign());delete i.aws;try{return new Request(i.url.toString(),i)}catch(o){if(o instanceof TypeError)return new Request(i.url.toString(),Object.assign({duplex:"half"},i));throw o}}async fetch(t,n){for(let r=0;r<=this.retries;r++){let i=fetch(await this.sign(t,n));if(r===this.retries)return i;let o=await i;if(o.status<500&&o.status!==429)return o;await new Promise(s=>setTimeout(s,Math.random()*this.initRetryMs*Math.pow(2,r)))}throw new Error("An unknown error occurred, ensure retries is not negative")}},Ct=class{constructor({method:t,url:n,headers:r,body:i,accessKeyId:o,secretAccessKey:s,sessionToken:a,service:u,region:c,cache:p,datetime:l,signQuery:x,appendSessionToken:y,allHeaders:b,singleEncode:S}){if(n==null)throw new TypeError("url is a required option");if(o==null)throw new TypeError("accessKeyId is a required option");if(s==null)throw new TypeError("secretAccessKey is a required option");this.method=t||(i?"POST":"GET"),this.url=new URL(n),this.headers=new Headers(r||{}),this.body=i,this.accessKeyId=o,this.secretAccessKey=s,this.sessionToken=a;let h,f;(!u||!c)&&([h,f]=As(this.url,this.headers)),this.service=u||h||"",this.region=c||f||"us-east-1",this.cache=p||new Map,this.datetime=l||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=x,this.appendSessionToken=y||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256")&&this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let m=this.signQuery?this.url.searchParams:this.headers;if(m.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken&&m.set("X-Amz-Security-Token",this.sessionToken),this.signableHeaders=["host",...this.headers.keys()].filter(w=>b||!ks.has(w)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map(w=>w+":"+(w==="host"?this.url.host:(this.headers.get(w)||"").replace(/\s+/g," "))).join(`
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+`
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as S}from"./JOQDD4HN.js";import"./JM5FJEHU.js";import d from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as $}from"./RPVEVHKH.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as I}from"./D2GJ4T5F.js";import{F as c,G as o,H as F,J as u,h as y,i as l,l as p,r as b,u as L}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([E,V,k,O,{b:v},{a:C,c:m,d:d,e:_,f:f,g:x}])=>{var M=y`@layer{:host{display:block;--calcite-label-margin-bottom: 0px;--solutions-theme-foreground-color: var(--calcite-color-foreground-1)}.width-full{width:100%!important}.height-full{height:100%!important}.notice-msg{padding:10px;width:calc(100% - 20px)}.progress-bar{padding:12px}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.feature-pagination{background-color:var(--calcite-color-foreground-1)!important;border-block-end:1px solid var(--calcite-color-border-3);display:flex;justify-content:center;padding:5px 0}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:700}.report-submitted-msg{position:absolute;z-index:1000}.share-node{display:flex}.overflow-auto{overflow:auto}}`,g=class extends F{constructor(){super(),this.center="",this.commentButtonText="",this.commentSubmittedMessage="",this.defaultWebmap="",this.description="",this.enableAnonymousAccess=!1,this.enableAnonymousComments=!1,this.enableComments=!1,this.enableHome=!0,this.enableLogin=!1,this.enableNewReports=!1,this.enableSearch=!0,this.enableSnapping=!1,this.enableZoom=!0,this.isMobile=!1,this.layerExpressions=[],this.layerId="",this.level="",this.loginTitle="",this.mapInfos=[],this.objectId="",this.reportButtonText="",this.reportsHeader="",this.reportSubmittedMessage="",this.showComments=!1,this.showUserImageInCommentsList=!1,this.showFeatureSymbol=!1,this.showMyReportsOnly=!1,this.submitNewReportsMessage="",this.theme="light",this.floorLevel="",this.showFullCommentTitle=!0,this.filterByMapExtent=!1,this.sortOption="newest",this.reportingArea=!1,this.reportingAreaLayer="",this.reportingAreaMessage="",this.enablePhotoLocation=!1,this.aiImageExtraction=[],this._featureCreationFailedErrorMsg="",this._filterActive=!1,this._flowItems=[],this._hasValidLayers=!1,this._reportSubmitted=!1,this._selectedLayerName="",this._showSubmitCancelButton=!1,this._showLoadingIndicator=!1,this._sidePanelCollapsed=!1,this._translations=$({name:"crowdsource-reporter",blocking:!0}),this._updatedProgressBarStatus=25,this._updatedSortOption="newest",this._commentSubmitted=!1,this._addingCommentFailed=!1,this._filterOpen=!1,this._showNextButton=!1,this._submitNextButtonDisabled=!1,this._showFilterIcon=!1,this._createFeature=c(),this._currentFeatureId="",this._editableLayerIds=[],this._featureDetails=c(),this._featureList=c(),this._selectedRelatedFeature=[],this._layerList=c(),this._createRelatedFeature=c(),this._layers=[],this._mapImageryLayersId=[],this._selectedFeature=[],this._selectedFeatureIndex=0,this._selectedLayerId="",this._shareNode=c(),this._urlParamsLoaded=!1,this._validLayers=[],this._nonVisibleValidLayers=[],this._showFullPanel=!1,this._floorExpression="",this._formElements=[],this._prevSelectedLayerId="",this._t9nLayerExpressions=[],this._reportSubmittedAlertNode=c(),this._commentSubmittedAlertNode=c(),this._sortPopoverNode=c(),this.togglePanel=b(),S(window)}static{this.properties={center:1,commentButtonText:1,commentSubmittedMessage:1,defaultWebmap:1,description:1,enableAnonymousAccess:5,enableAnonymousComments:5,enableComments:5,enableHome:5,enableLogin:5,enableNewReports:5,enableSearch:5,enableSnapping:5,enableZoom:5,isMobile:5,layerExpressions:0,layerId:1,level:1,loginTitle:1,mapInfos:0,mapView:0,objectId:1,reportButtonText:1,reportingOptions:0,reportsHeader:1,reportSubmittedMessage:1,searchConfiguration:0,showComments:5,showUserImageInCommentsList:5,showFeatureSymbol:5,showMyReportsOnly:5,submitNewReportsMessage:1,theme:1,zoomToScale:9,floorLevel:1,showFullCommentTitle:5,filterByMapExtent:5,sortOption:1,reportingArea:5,reportingAreaLayer:1,reportingAreaMessage:1,enablePhotoLocation:5,aiImageExtraction:0,_featureCreationFailedErrorMsg:16,_filterActive:16,_flowItems:16,_hasValidLayers:16,_mapInfo:16,_reportSubmitted:16,_selectedLayerName:16,_showSubmitCancelButton:16,_showLoadingIndicator:16,_sidePanelCollapsed:16,_translations:16,_updatedProgressBarStatus:16,_updatedSorting:16,_updatedSortOption:16,_commentSubmitted:16,_addingCommentFailed:16,_filterOpen:16,_showNextButton:16,_submitNextButtonDisabled:16,_showFilterIcon:16}}static{this.styles=M}static{this.shadowRootOptions=L}willUpdate(e){e.has("isMobile")&&this.isMobileWatchHandler(this.isMobile),e.has("mapView")&&this.hasUpdated&&this.mapViewWatchHandler(),e.has("floorLevel")&&this.floorLevelWatchHandler(),(e.has("reportingAreaLayer")||e.has("reportingArea")&&this.hasUpdated)&&setTimeout(()=>{this._createFeature.value&&this._createFeature.value.refresh(this.floorLevel)},50),e.has("showMyReportsOnly")&&(this.hasUpdated||this.showMyReportsOnly!==!1)&&this.showMyReportsOnlyWatchHandler(),e.has("sortOption")&&(this.hasUpdated||this.sortOption!=="newest")&&this.sortOptionWatchHandler(),e.has("filterByMapExtent")&&(this.hasUpdated||this.filterByMapExtent!==!1)&&this.filterByMapExtentChangeWatchHandler(),e.has("layerExpressions")&&(this.hasUpdated||this.layerExpressions?.length>0)&&this.layerExpressionsWatchHandler(),e.has("showFeatureSymbol")&&(this.hasUpdated||this.showFeatureSymbol!==!1)&&this.showFeatureSymbolWatchHandler(),(this._flowItems.includes("filter-panel")||this._filterOpen)&&this._filterList?.updateInitDefExpressions({initDefExpressions:this._initDefExpressions})}async isMobileWatchHandler(e){this.updatePanelState(!1,this._showFullPanel),e&&this._flowItems[this._flowItems.length-1]==="filter-panel"?(await this.backFromFilterPanel(),this._filterOpen=!0):!e&&this._filterOpen&&(await this._closeFilter(),this._flowItems=[...this._flowItems,"filter-panel"])}async mapViewWatchHandler(){await this.mapView?.when(async()=>{this.setInitExpressions(),await this.setMapView()})}async floorLevelWatchHandler(){if(this._editableLayerIds)for(let e of this._editableLayerIds){let t=this.mapView&&await d(this.mapView,e);t&&t.floorInfo?.floorField&&this._updateFloorDefinitionExpression(t)}this._flowItems[this._flowItems.length-1]==="layer-list"&&this._layerList.value&&await this._layerList.value.refresh(),this._featureList.value&&this._featureList.value.refresh(),this._createFeature.value&&this._createFeature.value.refresh(this.floorLevel)}async showMyReportsOnlyWatchHandler(){this._editableLayerIds&&(await this._updateFeatures(),this.refreshLists())}async sortOptionWatchHandler(){this.updateSortingOptions()}filterByMapExtentChangeWatchHandler(){this.refreshLists()}async layerExpressionsWatchHandler(){await this.resetFilterList(),await this.handleSelectedLayersFilter(),await this._featureList.value?.refresh()}async showFeatureSymbolWatchHandler(){await this._featureList.value?.refresh()}async updateLayerExpressionsT9n(e){if(this._t9nLayerExpressions=e||this.layerExpressions,this._filterList!=null)await this._filterList.handleUpdatingT9nData(this._t9nLayerExpressions);else if(this._currentLayerExpressions!=null){let t=structuredClone(this._currentLayerExpressions);this.handleLayerExpressionsT9n(t,this._t9nLayerExpressions),this._currentLayerExpressions=t,this._showFilterIcon=this._currentLayerExpressions?.length>0}return Promise.resolve()}async load(){this._urlParamsLoaded=!1,await this.mapView?.when(async()=>{this._layers=this.reportingOptions?Object.keys(this.reportingOptions).filter(e=>{let t=e&&this.reportingOptions&&this.reportingOptions[e];return t&&t.visible}):[],this.setInitExpressions(),await this.setMapView()})}render(){let e=this.theme==="dark"?"calcite-mode-dark":"calcite-mode-light";return l`${this._reportSubmitted&&l`<calcite-alert auto-close class=${`${e} report-submitted-msg`} icon=check-circle kind=success label @calciteAlertClose=${()=>{this._reportSubmitted=!1}} open placement=top><div slot=message .innerHTML=${(this.reportSubmittedMessage||this._translations.submitMsg)??""} ${o(this._reportSubmittedAlertNode)}></div></calcite-alert>`||""}${this._featureCreationFailedErrorMsg&&l`<calcite-alert auto-close class=${u(e)} icon=x-octagon kind=danger label @calciteAlertClose=${()=>{this._featureCreationFailedErrorMsg=""}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${this._featureCreationFailedErrorMsg}</div></calcite-alert>`||""}${this._commentSubmitted&&l`<calcite-alert auto-close class=${`report-submitted ${e}`} icon=check-circle kind=success label @calciteAlertClose=${()=>{this._commentSubmitted=!1}} open placement=top><div slot=message .innerHTML=${(this.commentSubmittedMessage||this._translations.commentSubmittedMsg)??""} ${o(this._commentSubmittedAlertNode)}></div></calcite-alert>`||""}${this._addingCommentFailed&&l`<calcite-alert auto-close class=${u(e)} icon=x-octagon kind=danger label @calciteAlertClose=${()=>{this._addingCommentFailed=!1}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${this._translations.addingCommentFailedMsg}</div></calcite-alert>`||""}<div><calcite-shell content-behind>${this._getReporter()}</calcite-shell></div>${this.isMobile&&this.filterModal()||""}`}updated(){this._adjustAlertStyles()}async setSelectedLayer(e,t){this._selectedLayerId=e,this._selectedLayer=this.mapView&&await d(this.mapView,e),this._selectedLayerName=t,this._validLayers.forEach(i=>{this._nonVisibleValidLayers.find(s=>s.id===i.id)||i.set("visible",!e||i.id===e)})}_getLayersConfig(e){return this.reportingOptions&&this.reportingOptions[e]?this.reportingOptions[e]:null}_getReporter(){let e=[];this._flowItems.forEach(i=>{switch(i){case"layer-list":e.push(this.getLayerListFlowItem());break;case"feature-list":e.push(this.getFeatureListFlowItem(this._selectedLayerId,this._selectedLayerName));break;case"filter-panel":e.push(this.getFilterPanel());break;case"feature-details":e.push(this.getFeatureDetailsFlowItem());break;case"reporting-layer-list":e.push(this.getChooseCategoryFlowItem());break;case"feature-create":e.push(this.getFeatureCreateFlowItem());break;case"comment-details":e.push(this.getCommentDetailsFlowItem());break;case"add-comment":e.push(this.getAddCommentFlowItem());break}});let t=this.theme==="dark"?"calcite-mode-dark":"calcite-mode-light";return l`<calcite-panel class=${`width-full ${t}`}>${this.mapView?l`<calcite-flow>${e?.length>0&&e||""}</calcite-flow>`:l`<calcite-loader label scale=m></calcite-loader>`}</calcite-panel>`}filterModal(){return(this.layerExpressions?this.layerExpressions.filter(e=>e.id===this._selectedLayerId):[]).length>0&&l`<calcite-dialog aria-labelledby=modal-title class="modal" .heading=${this._translations.filterLayerTitle.replace("{{title}}",this._selectedLayerName)} kind=brand @calciteDialogClose=${()=>{this._closeFilter()}} .open=${this._filterOpen} width=s><div>${this.mapView&&l`<instant-apps-filter-list close-btn .closeBtnOnClick=${()=>{this._closeFilter()}} combobox-overlay-positioning=fixed .layerExpressions=${this._currentLayerExpressions} @filterListReset=${()=>{this._filterActive=!1,this._featureList.value&&this._featureList.value.refresh()}} @filterUpdate=${()=>{this._filterList?.filterCount!==void 0&&this._handleFilterUpdate(this._filterList?.filterCount>0)}} .view=${this.mapView} ${o(this._setFilterList)}></instant-apps-filter-list>`||""}</div></calcite-dialog>`||""}_setFilterList(e){this._filterList=e,e&&(e.autoUpdateUrl=!1,e.resetBtn=this.isMobile,e.resetFiltersOnDisconnect=!1,e.zoomBtn=!1)}_adjustAlertStyles(){this.reportSubmittedMessage&&this._reportSubmittedAlertNode.value?.children[0]&&(this._reportSubmittedAlertNode.value.children[0].style.margin="0px"),this.commentSubmittedMessage&&this._commentSubmittedAlertNode.value?.children[0]&&(this._commentSubmittedAlertNode.value.children[0].style.margin="0px")}_toggleFilter(){this._filterOpen=!this._filterOpen}async _closeFilter(){this._filterOpen=!1,this._filterList!=null&&(this._currentLayerExpressions=await this._filterList.getCurrentLayerExpressions(),this._showFilterIcon=this._currentLayerExpressions?.length>0)}async sortOptionClick(e,t,i){this._updatedSorting={field:e,order:t},this._updatedSortOption=i,this._sortPopoverNode.value&&(this._sortPopoverNode.value.open=!1)}_toggleSort(){let e=this.reportingOptions&&this.reportingOptions[this._selectedLayerId]&&this.reportingOptions[this._selectedLayerId].like&&this.reportingOptions[this._selectedLayerId].likeField;return l`<calcite-popover auto-close label offset-distance=0 .placement=${this.isMobile?"leading-start":"bottom-start"} pointer-disabled reference-element=sort-popover ${o(this._sortPopoverNode)}><calcite-list label selection-mode=single-persist><calcite-list-item .label=${this._translations.sortNewest} @calciteListItemSelect=${()=>{this._selectedLayer&&this.sortOptionClick(this._selectedLayer.objectIdField,"desc","newest")}} .selected=${this._updatedSortOption==="newest"} value=newest></calcite-list-item><calcite-list-item .label=${this._translations.sortOldest} @calciteListItemSelect=${()=>{this._selectedLayer&&this.sortOptionClick(this._selectedLayer.objectIdField,"asc","oldest")}} .selected=${this._updatedSortOption==="oldest"} value=oldest></calcite-list-item>${e&&l`<calcite-list-item .label=${this._translations.sortHighestVoted} @calciteListItemSelect=${()=>{let t=this.reportingOptions&&this.reportingOptions[this._selectedLayerId].likeField;t!==void 0&&this.sortOptionClick(t,"desc","highestVoted")}} .selected=${this._updatedSortOption==="highestVoted"} value=highestVoted></calcite-list-item><calcite-list-item .label=${this._translations.sortLowestVoted} @calciteListItemSelect=${()=>{let t=this.reportingOptions&&this.reportingOptions[this._selectedLayerId].likeField;t&&this.sortOptionClick(t,"asc","lowestVoted")}} .selected=${this._updatedSortOption==="lowestVoted"} value=lowestVoted></calcite-list-item>`||""}</calcite-list></calcite-popover>`}async _handleFilterListReset(){this._filterActive=!1}async _handleFilterUpdate(e){this._showLoadingIndicator=!0,this._filterActive=e,this._featureList.value&&await this._featureList.value.refresh(),this._showLoadingIndicator=!1}getLayerListFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this.reportsHeader} .loading=${this._showLoadingIndicator} .selected=${this._flowItems[this._flowItems.length-1]==="layer-list"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this._hasValidLayers&&this.enableNewReports&&l`<calcite-button appearance=solid @click=${this.navigateToChooseCategory} slot=footer width=full>${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText}</calcite-button>`||""}<calcite-panel><layer-list .applyLayerViewFilter=${this.showMyReportsOnly} class="height-full" .filterByMapExtent=${this.filterByMapExtent} .layers=${this._editableLayerIds?.length>0?this._editableLayerIds:this._layers} .mapView=${this.mapView} @layerSelect=${this.displayFeaturesList} @layersListLoaded=${this.layerListLoaded} show-feature-count show-next-icon ${o(this._layerList)}></layer-list></calcite-panel></calcite-flow-item>`}getChooseCategoryFlowItem(){let e=this.reportingOptions?Object.keys(this.reportingOptions).filter(t=>this.reportingOptions&&this.reportingOptions[t].visible&&this.reportingOptions[t].reporting&&this._layerItemsHash&&this._layerItemsHash[t]&&this._layerItemsHash[t].supportsAdd):[];return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="reporting-layer-list"}><calcite-panel><div class="progress-bar"><calcite-progress type=determinate .value=${this._updatedProgressBarStatus}></calcite-progress></div><calcite-notice class="notice-msg" icon=lightbulb kind=success open><div slot=message>${this._translations.chooseCategoryMsg}</div></calcite-notice><layer-list class="height-full" .layers=${e} .mapView=${this.mapView} @layerSelect=${this.navigateToCreateFeature}></layer-list></calcite-panel></calcite-flow-item>`}getFeatureCreateFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._selectedLayerName} @calciteFlowItemBack=${this.backFromCreateFeaturePanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-create"}>${this._showSubmitCancelButton&&l`<div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" .disabled=${this._submitNextButtonDisabled} @click=${this._showNextButton?this.onNextButtonClick.bind(this):this.onCreateFeatureSubmitButtonClick.bind(this)} width=full>${this._showNextButton?this._translations.next:this._translations.submit}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromCreateFeaturePanel} width=full>${this._translations.cancel}</calcite-button></div>`||""}<calcite-panel><div class="progress-bar"><calcite-progress type=determinate .value=${this._updatedProgressBarStatus}></calcite-progress></div><create-feature app-name=reporter .aiImageExtraction=${this.aiImageExtraction} class="height-full overflow-auto" customize-submit enable-search .enablePhotoLocation=${this.enablePhotoLocation} .enableSnapping=${this.enableSnapping} .floorLevel=${this.floorLevel} .formElements=${this._formElements.find(e=>e.id===this._selectedLayerId)} .reportingAreaLayer=${this.reportingAreaLayer} .isMobile=${this.isMobile} .mapView=${this.mapView} @drawComplete=${this.onFormReady} @editingLocation=${this.editingLocation} @editingAttachment=${this.showSubmitCancelButton} @fail=${this.createFeatureFailed} @modeChanged=${this.backFromCreateFeaturePanel} @progressStatus=${this.updatedProgressStatus} @success=${this.onReportSubmitted} .searchConfiguration=${this.searchConfiguration} .selectedLayerId=${this._selectedLayerId} .reportingArea=${this.reportingArea} .reportingAreaMessage=${this.reportingAreaMessage} .submitNewReportsMessage=${this.submitNewReportsMessage} update-map-position ${o(this._createFeature)}></create-feature></calcite-panel></calcite-flow-item>`}updatedProgressStatus(e){this._updatedProgressBarStatus=e.detail}onFormReady(e){this._submitNextButtonDisabled=e.detail,this._showSubmitCancelButton=!0}editingLocation(){this._showNextButton=!0}showSubmitCancelButton(e){this._showSubmitCancelButton=!e.detail}onCreateFeatureSubmitButtonClick(){this._createFeature.value&&(this._showNextButton=!1,this._createFeature.value.submit())}backFromCreateFeaturePanel(){this._createFeature.value&&(this._showSubmitCancelButton=!1,this._showNextButton=!1,this.updateNonVisibleLayersOnMap(!1)),this.backFromSelectedPanel()}onNextButtonClick(){this._createFeature.value&&(this._showNextButton=!1,this._showSubmitCancelButton=!0,this._createFeature.value.showForm())}onCreateRelatedFeatureSubmitButtonClick(){this._createRelatedFeature.value&&this._createRelatedFeature.value.submit()}backFromCreateRelatedFeaturePanel(){this._createRelatedFeature.value&&(this._showSubmitCancelButton=!1),this.backFromSelectedPanel()}createFeatureFailed(e){console.error(e.detail),this._featureCreationFailedErrorMsg=e.detail.message}async onReportSubmitted(){this._showSubmitCancelButton=!1,this.updateNonVisibleLayersOnMap(!1),await this.navigateToHomePage(),this._reportSubmitted=!0,this._updatedProgressBarStatus=25,this._showFullPanel&&this.updatePanelState(this._sidePanelCollapsed,!1)}addCommentFailed(e){console.error(e.detail),this._addingCommentFailed=!0}async onCommentSubmitted(){this._commentSubmitted=!0,this.backFromCreateRelatedFeaturePanel(),this._showLoadingIndicator=!0,this._featureDetails.value&&await this._featureDetails.value.refresh(this._currentFeature),setTimeout(()=>{this._showLoadingIndicator=!1},300)}async navigateToHomePage(){await this.setSelectedFeatures([]),this._layerList.value&&await this._layerList.value.refresh(),this._editableLayerIds.length===1?(this._featureList.value&&await this._featureList.value.refresh(),this._flowItems=["feature-list"]):this._flowItems=["layer-list"]}async navigateToCreateFeature(e){e.detail.layerId&&e.detail.layerName&&await this.setSelectedLayer(e.detail.layerId,e.detail.layerName),this.updateNonVisibleLayersOnMap(!0),this._getFormElements(),this._showSubmitCancelButton=!1,this._showNextButton=!1,this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"feature-create"]}navigateToChooseCategory(){this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"reporting-layer-list"]}updateNonVisibleLayersOnMap(e){this._nonVisibleValidLayers.find(t=>t.id===this._selectedLayerId)&&this._selectedLayer&&this._selectedLayer.set("visible",e)}async layerListLoaded(e){if(this._layerList.value&&this._flowItems[this._flowItems.length-1]==="layer-list"||this._flowItems[0]==="feature-list"){let t=e.detail,i=this.mapView&&await _(this.mapView),s=[];if(this._validLayers=[],this._nonVisibleValidLayers=[],i?.forEach(a=>{t.includes(a.id)&&(this._validLayers.push(a),a.visible||this._nonVisibleValidLayers.push(a),this._getLayersConfig(a.id)?.reporting&&this._layerItemsHash&&this._layerItemsHash[a.id]&&this._layerItemsHash[a.id].supportsAdd&&s.push(a.id))}),this.handleMapClick(),this._hasValidLayers=s.length>0,!this._urlParamsLoaded&&this._editableLayerIds.length>1&&this.layerId&&this.objectId){let a=this.mapView&&await d(this.mapView,this.layerId);a&&await this.displayFeaturesList({detail:{layerId:a.id,layerName:a.title}}),this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams()}}}async displayFeaturesList(e){this._showLoadingIndicator=!0,await this.setSelectedLayer(e.detail.layerId,e.detail.layerName),this.updateSortingOptions(),this.handleSelectedLayersFilter(),this._flowItems=[...this._flowItems,"feature-list"],this._prevSelectedLayerId=this._selectedLayerId,this._showLoadingIndicator=!1}updateSortingOptions(){let e=this.sortOption===""?"newest":this.sortOption,t=e==="oldest"||e==="lowestVoted"?"asc":"desc",i=this.reportingOptions?.[this._selectedLayerId]?.like?this.reportingOptions?.[this._selectedLayerId]?.likeField:"",s=this._selectedLayer&&(e==="newest"||e==="oldest")?this._selectedLayer?.objectIdField:i;this._updatedSorting={field:s||"",order:t},this._updatedSortOption=!i&&(e==="highestVoted"||e==="lowestVoted")?"newest":e}async backFromFilterPanel(){this._filterList!=null&&(this._currentLayerExpressions=await this._filterList.getCurrentLayerExpressions(),this._showFilterIcon=this._currentLayerExpressions?.length>0),this._featureList.value&&await this._featureList.value.refresh(),this.backFromSelectedPanel()}backFromSelectedPanel(){this._updatedProgressBarStatus=25;let e=[...this._flowItems];if(e[e.length-1]==="comment-details"||e[e.length-1]==="add-comment"||this.clearHighlights(),(e[e.length-1]==="reporting-layer-list"||e[e.length-1]==="feature-create"&&(e[0]==="feature-list"||e[e.length-2]==="feature-list"))&&this.updatePanelState(this._sidePanelCollapsed,!1),e.pop(),e.length===1&&e[0]==="layer-list"){this.navigateToHomePage();return}this._flowItems=[...e]}toggleSidePanel(){this._sidePanelCollapsed=!this._sidePanelCollapsed,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}updatePanelState(e,t){this._sidePanelCollapsed=e,this._showFullPanel=t,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}async onFeatureSelectFromList(e){await this.setSelectedFeatures([e.detail]),this._flowItems=[...this._flowItems,"feature-details"]}async getRelatedTable(){let e=this._currentFeature?.layer,t=this.mapView&&await f(this.mapView);e.relationships?.some(i=>{let s=t?.filter(a=>e.url===a.url&&a.layerId===i.relatedTableId);return s&&s.length>0?(this._relatedTable=s[0],!0):!1})}async updatingFeatureDetails(e){this._showLoadingIndicator=e}async selectionChanged(e){this.updatingFeatureDetails(!0),await this.setCurrentFeature(e.detail.selectedFeature[0]),this.highlightOnMap(e.detail.selectedFeature[0]),this._selectedFeatureIndex=e.detail.selectedFeatureIndex,this._featureDetails.value&&await this._featureDetails.value.refresh(e.detail.selectedFeature[0])}showAddCommentsPanel(){this._flowItems=[...this._flowItems,"add-comment"]}async onCommentSelectFromList(e){this._selectedRelatedFeature=[e.detail],this._flowItems=[...this._flowItems,"comment-details"]}getFeatureListFlowItem(e,t){let i=this._getLayersConfig(this._selectedLayerId)?.reporting&&this._layerItemsHash&&this._layerItemsHash[this._selectedLayerId].supportsAdd,s=this._showFilterIcon;return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${t} .loading=${!this.isMobile&&this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-list"}>${this._toggleSort()}<calcite-action appearance=solid icon=sort-ascending-arrow id=sort-popover slot=header-actions-end .text=${this._translations.sort} title=${this._translations.sort??p}></calcite-action>${s&&l`<calcite-action appearance=solid icon=filter .indicator=${this._filterActive} @click=${()=>{this.isMobile?this._toggleFilter():this._flowItems=[...this._flowItems,"filter-panel"]}} slot=header-actions-end .text=${this._translations.filter} title=${this._translations.filter??p}></calcite-action>`||""}${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this.enableNewReports&&i&&l`<calcite-button appearance=solid @click=${this.navigateToCreateFeature} slot=footer width=full>${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText}</calcite-button>`||""}<calcite-panel>${l`<feature-list .applyLayerViewFilter=${this.showMyReportsOnly} class="height-full" .filterByMapExtent=${this.filterByMapExtent} highlight-on-hover .mapView=${this.mapView} .noFeaturesFoundMsg=${this._translations.featureErrorMsg} @featureClick=${()=>{this._showLoadingIndicator=!0}} @featureSelect=${this.onFeatureSelectFromList} page-size=30 .reportingOptions=${this.reportingOptions} .selectedLayerId=${e} .showFeatureSymbol=${this.showFeatureSymbol} .sortingInfo=${this._updatedSorting} ${o(this._featureList)}></feature-list>`}</calcite-panel></calcite-flow-item>`}getFilterPanel(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._translations.filterLayerTitle.replace("{{title}}",this._selectedLayerName)} .loading=${this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromFilterPanel} .selected=${this._flowItems[this._flowItems.length-1]==="filter-panel"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<div class=width-full slot=footer><div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" .disabled=${!this._filterActive} @click=${this.resetFilterList} width=full>${this._translations.resetFilter}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromFilterPanel} width=full>${this._translations.close}</calcite-button></div></div><calcite-panel>${this.mapView&&l`<instant-apps-filter-list .closeBtnOnClick=${()=>{}} combobox-overlay-positioning=fixed .layerExpressions=${this._currentLayerExpressions} @filterListReset=${()=>{this._handleFilterListReset()}} @filterUpdate=${()=>{let e=this._filterList?.filterCount;e!==void 0&&this._handleFilterUpdate(e>0)}} .view=${this.mapView} ${o(this._setFilterList)}></instant-apps-filter-list>`||""}</calcite-panel></calcite-flow-item>`}getFeatureDetailsFlowItem(){let e=this._selectedLayer?.relationships,t=this._getLayersConfig(this._selectedLayerId)?.comment&&e&&e.length>0&&this._relatedTable;return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._selectedLayerName} .loading=${this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-details"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this.mapView&&l`<instant-apps-social-share class=share-node flip-rtl popover-button-icon-scale=s remove-popover-offset scale=m share-button-color=neutral share-button-type=action slot=header-actions-end social-media .view=${this.mapView} ${o(this._shareNode)}></instant-apps-social-share>`||""}${this._selectedFeature.length>1&&this.getFeaturesPagination()||""}<calcite-panel><feature-details class=full-height .enableSnapping=${this.enableSnapping} .graphics=${this._selectedFeature} .layerItemsHash=${this._layerItemsHash} .mapView=${this.mapView} @addComment=${this.showAddCommentsPanel} @commentClick=${()=>{this._showLoadingIndicator=!0}} @commentSelect=${this.onCommentSelectFromList} @featureSelectionChange=${this.selectionChanged} @likeOrDislikeClicked=${()=>{this._featureList.value&&this._featureList.value.refresh(!0)}} @loadingStatus=${i=>{this.updatingFeatureDetails(i.detail)}} .reportingOptions=${this.reportingOptions} .showFullCommentTitle=${this.showFullCommentTitle} .showUserImageInCommentsList=${this.showUserImageInCommentsList} ${o(this._featureDetails)}></feature-details>${t&&l`<calcite-button appearance=solid @click=${this.showAddCommentsPanel} slot=footer width=full>${this.commentButtonText||this._translations.comment}</calcite-button>`||""}</calcite-panel></calcite-flow-item>`}getFeaturesPagination(){return l`<div class="feature-pagination"><div><calcite-button appearance=transparent icon-start=chevron-left icon-flip-rtl=both id=solutions-back @click=${()=>this._featureDetails.value&&void this._featureDetails.value.back()} scale=s width=full></calcite-button><calcite-tooltip placement=top reference-element=solutions-back><span>${this._translations.back}</span></calcite-tooltip></div><calcite-button appearance=transparent @click=${()=>this._featureDetails.value&&void this._featureDetails.value.toggleListView()} scale=s><span class="pagination-count">${this._getCount()}</span></calcite-button><div><calcite-button appearance=transparent icon-flip-rtl=both icon-start=chevron-right id=solutions-next @click=${()=>this._featureDetails.value&&void this._featureDetails.value.next()} scale=s width=full></calcite-button><calcite-tooltip placement=top reference-element=solutions-next><span>${this._translations.next}</span></calcite-tooltip></div></div>`}getCommentDetailsFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._relatedTable?.title||""} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="comment-details"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<calcite-panel><info-card .enableSnapping=${this.enableSnapping} .graphics=${this._selectedRelatedFeature} .mapView=${this.mapView} @selectionChanged=${()=>{this._showLoadingIndicator=!1}}></info-card></calcite-panel></calcite-flow-item>`}getAddCommentFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._relatedTable?.title||""} @calciteFlowItemBack=${this.backFromCreateRelatedFeaturePanel} .selected=${this._flowItems[this._flowItems.length-1]==="add-comment"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<div class=width-full slot=footer>${this._showSubmitCancelButton&&l`<div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" @click=${this.onCreateRelatedFeatureSubmitButtonClick} width=full>${this._translations.submit}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromCreateRelatedFeaturePanel} width=full>${this._translations.cancel}</calcite-button></div>`||""}</div><calcite-panel><create-related-feature customize-submit .enableSnapping=${this.enableSnapping} .mapView=${this.mapView} @fail=${this.addCommentFailed} @formReady=${this.onFormReady} @isActionPending=${this.showSubmitCancelButton} @success=${this.onCommentSubmitted} .selectedFeature=${this._currentFeature} .table=${this._relatedTable} ${o(this._createRelatedFeature)}></create-related-feature></calcite-panel></calcite-flow-item>`}async setSelectedFeatures(e){this._selectedFeature=e,await this.setCurrentFeature(this._selectedFeature.length?this._selectedFeature[0]:void 0)}async setCurrentFeature(e){if(this._currentFeature=e,e&&e.layer){let t=e.layer;t.title&&this.setSelectedLayer(t.id,t.title),this._currentFeatureId=e.attributes[t.objectIdField],this._getLayersConfig(t.id)?.comment&&t.relationships&&t.relationships.length>0&&await this.getRelatedTable()}else this._editableLayerIds.length>1&&(this.setSelectedLayer("",""),this.handlePrevLayersFilter()),this._currentFeatureId="";this._updateShareURL()}async highlightOnMap(e){if(this.clearHighlights(),e&&e.geometry&&e.layer&&e.layer.id!==void 0){let t=this.mapView&&await m(this.mapView,e.layer.id.toString());if(t){let i=Number(e.getObjectId());this._highlightHandle=this.mapView&&await x([i],t,this.mapView,!0,this.zoomToScale)}}this.updatingFeatureDetails(!1)}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}getActionToExpandCollapsePanel(){return l`<calcite-action appearance=solid .icon=${this._sidePanelCollapsed?"chevrons-up":"chevrons-down"} @click=${this.toggleSidePanel} slot=header-actions-end .text=${(this._sidePanelCollapsed?this._translations.expand:this._translations.collapse)||""}></calcite-action>`}async setMapView(){this.mapView&&await f(this.mapView),await this.getLayersToShowInList(),await this._updateFeatures(),this._editableLayerIds?.length===1?await this.renderFeaturesList():this._flowItems=["layer-list"],this.mapView&&(this.mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this.mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0))}handleMapClick(){this._mapClickHandle&&this._mapClickHandle.remove(),this._mapClickHandle=E.on(()=>this.mapView,"click",e=>{this.mapView&&(this.mapView.popupEnabled=!1),this.onMapClick(e)})}async onMapClick(e){if(!(this._flowItems[this._flowItems.length-1]==="feature-create"||this._flowItems[this._flowItems.length-1]==="add-comment")&&this.mapView){let t=await this.mapView.hitTest(e),i=[],s=[],a=[],n=!1;t.results.length>0&&t.results.forEach(r=>{r.type==="graphic"&&i.push(r.graphic)}),i.length>0&&(await this._setReportingGraphics(i),s=this._getNonReportingLayerGraphics(i)),this._mapImageryLayersId.length>0&&(a=await this._getIdentifiedGraphics(e.mapPoint),n=a.length>0);let h=s.concat(a);if(h.length>0){this.mapView.popupEnabled=!0;let r={features:h,location:e.mapPoint,updateLocationEnabled:!n};await this.mapView.openPopup(r)}}}async _setReportingGraphics(e){let t=e.filter(i=>{if(i.layer?.type==="feature"){let s=i.layer;return this._validLayers.includes(s)}else return!1});this._selectedLayer&&this._selectedFeature.length>0&&this._selectedLayer.id===t[0]?.layer?.id&&t[0].attributes[this._selectedLayer.objectIdField]===this._selectedFeature[0].attributes[this._selectedLayer.objectIdField]||t.length>0&&(await this.setSelectedFeatures(t),this._flowItems.length&&this._flowItems.includes("feature-details")?(this._flowItems=[...this._flowItems.slice(0,this._flowItems.indexOf("feature-details")+1)],await this.highlightOnMap(e[0])):this._flowItems=[...this._flowItems,"feature-details"])}_getNonReportingLayerGraphics(e){return e.filter(t=>{if(t.layer?.type==="feature"){let i=t.layer;return!this._validLayers.includes(i)&&i?.popupEnabled&&i?.id}else return!1})}async _getIdentifiedGraphics(e){let t=new O({geometry:e,tolerance:3,mapExtent:this.mapView?.extent}),i,s=[];for(let n of this._mapImageryLayersId){let h=this.mapView&&await d(this.mapView,n);if(h?.url&&t)try{let r=await k?.identify(h.url,t);if(r?.results?.length){s=r.results,i=h;break}}catch(r){console.error(r)}}let a=[];return s.forEach(n=>{let h=n.layerId,r=i?.sublayers?.items.find(P=>P.id===h),w=r?.popupTemplate;r?.popupEnabled&&w&&(n.feature.popupTemplate=w,a.push(n.feature))}),a}_getCount(){let e=(this._selectedFeatureIndex+1).toString(),t=this._selectedFeature.length.toString();return this._translations.indexOfTotal.replace("{{index}}",e).replace("{{total}}",t)}_updateFloorDefinitionExpression(e){let t=`${e?.floorInfo?.floorField} = '${this.floorLevel}'`,i=e.definitionExpression;e.definitionExpression=i&&i?.indexOf(this._floorExpression)>-1?i.replace(this._floorExpression,t):t,this._floorExpression=t}_getFormElements(){let e=this._selectedLayer;if(e?.floorInfo?.floorField&&this.floorLevel&&e?.formTemplate){let t=this._formElements.find(i=>i.id===e.id);(this._formElements.length===0||!t)&&this._formElements.push({id:e.id,orgElements:e.formTemplate.elements,orgExpressionInfos:e.formTemplate.expressionInfos})}}reduceToConfiguredLayers(e,t){return Object.keys(e).reduce((i,s)=>{let a=this.reportingOptions?this._getLayersConfig(s)?.visible:e[s].supportsAdd;return!t.includes(s)&&a&&i.push(s),i},[])}refreshLists(){setTimeout(()=>{this._layerList.value&&this._flowItems[this._flowItems.length-1]==="layer-list"&&this._layerList.value.refresh(),this._featureList.value&&this._featureList.value.refresh()},50)}async _updateFeatures(){for(let e of this._editableLayerIds){let t=this.mapView&&await m(this.mapView,e);t&&(await this._showMyFeaturesOnly(t),t.layer?.floorInfo?.floorField&&this.floorLevel&&this._updateFloorDefinitionExpression(t.layer))}}async _showMyFeaturesOnly(e){let t=(this.mapView?.map).portalItem.portal?.credential?.userId;if(t&&e){let i=e.layer.editFieldsInfo?.creatorField.toLowerCase();e.filter=this.showMyReportsOnly&&i?new V({where:`${i} = '${t}'`}):null}}async getLayersToShowInList(){let e=this.mapView&&await C(this.mapView,!1),t=this.mapView&&await _(this.mapView),i=[];t?.forEach(s=>{s?.type==="feature"&&s?.editingEnabled&&s?.capabilities?.operations?.supportsAdd&&(e[s.id].supportsAdd=!0),s?.editingEnabled||i.push(s.id)}),this._editableLayerIds=this.reduceToConfiguredLayers(e,i),this._layerItemsHash=e}async renderFeaturesList(){this._flowItems=["feature-list"];let e={detail:this._editableLayerIds};await this.layerListLoaded(e),await this.setSelectedLayer(this._validLayers[0].id,this._validLayers[0]?.title||""),this.updateSortingOptions(),await this.handleSelectedLayersFilter(),this._urlParamsLoaded||(this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams())}_updateShareURL(){let e=this._shareNode.value?.shareUrl;if(!e)return;let t=new URL(e);this._selectedLayerId?t.searchParams.set("layerid",this._selectedLayerId):t.searchParams.delete("layerid"),this._selectedFeature?.length?t.searchParams.set("oid",this._currentFeatureId):t.searchParams.delete("oid"),this._shareNode.value&&(this._shareNode.value.autoUpdateShareUrl=!1,this._shareNode.value.shareUrl=t.href)}async loadFeatureFromURLParams(){if(this.center&&this.level&&await this.mapView?.goTo({center:this.center.split(";").map(Number),zoom:parseInt(this.level,10)}),this.layerId&&this.objectId){let e=this.mapView&&await d(this.mapView,this.layerId);if(e){let t=this.mapView&&await v([Number(this.objectId)],e,[],!0,this.mapView.spatialReference);t?.length&&(await this.setSelectedFeatures(t),this._flowItems.length&&this._flowItems[this._flowItems.length-1]!=="feature-details"?this._flowItems=[...this._flowItems,"feature-details"]:this._flowItems=[...this._flowItems])}}}async handleSelectedLayersFilter(){if(this._selectedLayer){let e=this.layerExpressions?structuredClone(this.layerExpressions.filter(t=>t.id===this._selectedLayerId)):[];this._t9nLayerExpressions!=null&&this.handleLayerExpressionsT9n(e,this._t9nLayerExpressions),this._currentLayerExpressions=e,this._showFilterIcon=this._currentLayerExpressions?.length>0,this.setActiveDefinitionExpressions()}}async handlePrevLayersFilter(){if(this._prevSelectedLayerId){let e=this.mapView&&await d(this.mapView,this._prevSelectedLayerId);e&&this._initDefExpressions&&(e.definitionExpression=this._initDefExpressions[this._prevSelectedLayerId])}}async resetFilterList(){await this._filterList?.forceReset(),this._selectedLayer!==void 0&&this._initDefExpressions&&(this._selectedLayer.definitionExpression=this._initDefExpressions[this._selectedLayerId],this._filterActive=!1)}setActiveDefinitionExpressions(){if(this._selectedLayer===void 0)return;let e=[];if(this._currentLayerExpressions&&this._currentLayerExpressions?.length>0){let t=this._currentLayerExpressions[0];for(let i of t.expressions){let{active:s,definitionExpression:a}=i;s&&a&&e.push(`(${a})`)}this._filterActive=e.length>0,this.updateFilterLayerDefExpression(e,t.operator)}}updateFilterLayerDefExpression(e,t){let i=this._initDefExpressions&&this._initDefExpressions[this._selectedLayerId],s=e?.length>0&&i?`(${e.join(t)}) AND (${i})`:e.length>0?e.join(t):i;this._selectedLayer&&(this._selectedLayer.definitionExpression=s)}setInitExpressions(){if(this._initDefExpressions={},this.mapView==null)return;let e=this.mapView.map;e.allLayers.concat(e.allTables.toArray()).forEach(t=>{if(t.type==="map-image"&&t.popupEnabled&&!this._mapImageryLayersId.includes(t.id)){this._mapImageryLayersId.push(t.id);return}if(t.type!=="feature")return;let i=t;this._initDefExpressions&&(this._initDefExpressions[i.id]=i.definitionExpression||"")})}handleLayerExpressionsT9n(e,t){e?.forEach(i=>{let s=t?.find(a=>a.id===i.id);s!=null&&(i.title=s.title,i.expressions?.forEach(a=>{let n=s.expressions?.find(h=>h.id===a.id);n!=null&&(a.name=n.name)}))})}};I("crowdsource-reporter",g);return g},"core/reactiveUtils","layers/support/FeatureFilter","rest/identify","rest/support/IdentifyParameters",a,d)
2
+ import{a as S}from"./JOQDD4HN.js";import"./JM5FJEHU.js";import d from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as $}from"./HYX7BODW.js";import"./36I27Q5R.js";import"./GDPFKW75.js";import{b as I}from"./B2DK4LWH.js";import{F as c,G as o,H as F,J as u,h as y,i as l,l as p,r as b,u as L}from"./46DQNAMV.js";import"./OR4HXHSY.js";export default $arcgis.t(([E,V,k,O,{b:v},{a:C,c:m,d:d,e:_,f:f,g:x}])=>{var M=y`@layer{:host{display:block;--calcite-label-margin-bottom: 0px;--solutions-theme-foreground-color: var(--calcite-color-foreground-1)}.width-full{width:100%!important}.height-full{height:100%!important}.notice-msg{padding:10px;width:calc(100% - 20px)}.progress-bar{padding:12px}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.feature-pagination{background-color:var(--calcite-color-foreground-1)!important;border-block-end:1px solid var(--calcite-color-border-3);display:flex;justify-content:center;padding:5px 0}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:700}.report-submitted-msg{position:absolute;z-index:1000}.share-node{display:flex}.overflow-auto{overflow:auto}}`,g=class extends F{constructor(){super(),this.center="",this.commentButtonText="",this.commentSubmittedMessage="",this.defaultWebmap="",this.description="",this.enableAnonymousAccess=!1,this.enableAnonymousComments=!1,this.enableComments=!1,this.enableHome=!0,this.enableLogin=!1,this.enableNewReports=!1,this.enableSearch=!0,this.enableSnapping=!1,this.enableZoom=!0,this.isMobile=!1,this.layerExpressions=[],this.layerId="",this.level="",this.loginTitle="",this.mapInfos=[],this.objectId="",this.reportButtonText="",this.reportsHeader="",this.reportSubmittedMessage="",this.showComments=!1,this.showUserImageInCommentsList=!1,this.showFeatureSymbol=!1,this.showMyReportsOnly=!1,this.submitNewReportsMessage="",this.theme="light",this.floorLevel="",this.showFullCommentTitle=!0,this.filterByMapExtent=!1,this.sortOption="newest",this.reportingArea=!1,this.reportingAreaLayer="",this.reportingAreaMessage="",this.enablePhotoLocation=!1,this.aiImageExtraction=[],this._featureCreationFailedErrorMsg="",this._filterActive=!1,this._flowItems=[],this._hasValidLayers=!1,this._reportSubmitted=!1,this._selectedLayerName="",this._showSubmitCancelButton=!1,this._showLoadingIndicator=!1,this._sidePanelCollapsed=!1,this._translations=$({name:"crowdsource-reporter",blocking:!0}),this._updatedProgressBarStatus=25,this._updatedSortOption="newest",this._commentSubmitted=!1,this._addingCommentFailed=!1,this._filterOpen=!1,this._showNextButton=!1,this._submitNextButtonDisabled=!1,this._showFilterIcon=!1,this._createFeature=c(),this._currentFeatureId="",this._editableLayerIds=[],this._featureDetails=c(),this._featureList=c(),this._selectedRelatedFeature=[],this._layerList=c(),this._createRelatedFeature=c(),this._layers=[],this._mapImageryLayersId=[],this._selectedFeature=[],this._selectedFeatureIndex=0,this._selectedLayerId="",this._shareNode=c(),this._urlParamsLoaded=!1,this._validLayers=[],this._nonVisibleValidLayers=[],this._showFullPanel=!1,this._floorExpression="",this._formElements=[],this._prevSelectedLayerId="",this._t9nLayerExpressions=[],this._reportSubmittedAlertNode=c(),this._commentSubmittedAlertNode=c(),this._sortPopoverNode=c(),this.togglePanel=b(),S(window)}static{this.properties={center:1,commentButtonText:1,commentSubmittedMessage:1,defaultWebmap:1,description:1,enableAnonymousAccess:5,enableAnonymousComments:5,enableComments:5,enableHome:5,enableLogin:5,enableNewReports:5,enableSearch:5,enableSnapping:5,enableZoom:5,isMobile:5,layerExpressions:0,layerId:1,level:1,loginTitle:1,mapInfos:0,mapView:0,objectId:1,reportButtonText:1,reportingOptions:0,reportsHeader:1,reportSubmittedMessage:1,searchConfiguration:0,showComments:5,showUserImageInCommentsList:5,showFeatureSymbol:5,showMyReportsOnly:5,submitNewReportsMessage:1,theme:1,zoomToScale:9,floorLevel:1,showFullCommentTitle:5,filterByMapExtent:5,sortOption:1,reportingArea:5,reportingAreaLayer:1,reportingAreaMessage:1,enablePhotoLocation:5,aiImageExtraction:0,_featureCreationFailedErrorMsg:16,_filterActive:16,_flowItems:16,_hasValidLayers:16,_mapInfo:16,_reportSubmitted:16,_selectedLayerName:16,_showSubmitCancelButton:16,_showLoadingIndicator:16,_sidePanelCollapsed:16,_translations:16,_updatedProgressBarStatus:16,_updatedSorting:16,_updatedSortOption:16,_commentSubmitted:16,_addingCommentFailed:16,_filterOpen:16,_showNextButton:16,_submitNextButtonDisabled:16,_showFilterIcon:16}}static{this.styles=M}static{this.shadowRootOptions=L}willUpdate(e){e.has("isMobile")&&this.isMobileWatchHandler(this.isMobile),e.has("mapView")&&this.hasUpdated&&this.mapViewWatchHandler(),e.has("floorLevel")&&this.floorLevelWatchHandler(),(e.has("reportingAreaLayer")||e.has("reportingArea")&&this.hasUpdated)&&setTimeout(()=>{this._createFeature.value&&this._createFeature.value.refresh(this.floorLevel)},50),e.has("showMyReportsOnly")&&(this.hasUpdated||this.showMyReportsOnly!==!1)&&this.showMyReportsOnlyWatchHandler(),e.has("sortOption")&&(this.hasUpdated||this.sortOption!=="newest")&&this.sortOptionWatchHandler(),e.has("filterByMapExtent")&&(this.hasUpdated||this.filterByMapExtent!==!1)&&this.filterByMapExtentChangeWatchHandler(),e.has("layerExpressions")&&(this.hasUpdated||this.layerExpressions?.length>0)&&this.layerExpressionsWatchHandler(),e.has("showFeatureSymbol")&&(this.hasUpdated||this.showFeatureSymbol!==!1)&&this.showFeatureSymbolWatchHandler(),(this._flowItems.includes("filter-panel")||this._filterOpen)&&this._filterList?.updateInitDefExpressions({initDefExpressions:this._initDefExpressions})}async isMobileWatchHandler(e){this.updatePanelState(!1,this._showFullPanel),e&&this._flowItems[this._flowItems.length-1]==="filter-panel"?(await this.backFromFilterPanel(),this._filterOpen=!0):!e&&this._filterOpen&&(await this._closeFilter(),this._flowItems=[...this._flowItems,"filter-panel"])}async mapViewWatchHandler(){await this.mapView?.when(async()=>{this.setInitExpressions(),await this.setMapView()})}async floorLevelWatchHandler(){if(this._editableLayerIds)for(let e of this._editableLayerIds){let t=this.mapView&&await d(this.mapView,e);t&&t.floorInfo?.floorField&&this._updateFloorDefinitionExpression(t)}this._flowItems[this._flowItems.length-1]==="layer-list"&&this._layerList.value&&await this._layerList.value.refresh(),this._featureList.value&&this._featureList.value.refresh(),this._createFeature.value&&this._createFeature.value.refresh(this.floorLevel)}async showMyReportsOnlyWatchHandler(){this._editableLayerIds&&(await this._updateFeatures(),this.refreshLists())}async sortOptionWatchHandler(){this.updateSortingOptions()}filterByMapExtentChangeWatchHandler(){this.refreshLists()}async layerExpressionsWatchHandler(){await this.resetFilterList(),await this.handleSelectedLayersFilter(),await this._featureList.value?.refresh()}async showFeatureSymbolWatchHandler(){await this._featureList.value?.refresh()}async updateLayerExpressionsT9n(e){if(this._t9nLayerExpressions=e||this.layerExpressions,this._filterList!=null)await this._filterList.handleUpdatingT9nData(this._t9nLayerExpressions);else if(this._currentLayerExpressions!=null){let t=structuredClone(this._currentLayerExpressions);this.handleLayerExpressionsT9n(t,this._t9nLayerExpressions),this._currentLayerExpressions=t,this._showFilterIcon=this._currentLayerExpressions?.length>0}return Promise.resolve()}async load(){this._urlParamsLoaded=!1,await this.mapView?.when(async()=>{this._layers=this.reportingOptions?Object.keys(this.reportingOptions).filter(e=>{let t=e&&this.reportingOptions&&this.reportingOptions[e];return t&&t.visible}):[],this.setInitExpressions(),await this.setMapView()})}render(){let e=this.theme==="dark"?"calcite-mode-dark":"calcite-mode-light";return l`${this._reportSubmitted&&l`<calcite-alert auto-close class=${`${e} report-submitted-msg`} icon=check-circle kind=success label @calciteAlertClose=${()=>{this._reportSubmitted=!1}} open placement=top><div slot=message .innerHTML=${(this.reportSubmittedMessage||this._translations.submitMsg)??""} ${o(this._reportSubmittedAlertNode)}></div></calcite-alert>`||""}${this._featureCreationFailedErrorMsg&&l`<calcite-alert auto-close class=${u(e)} icon=x-octagon kind=danger label @calciteAlertClose=${()=>{this._featureCreationFailedErrorMsg=""}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${this._featureCreationFailedErrorMsg}</div></calcite-alert>`||""}${this._commentSubmitted&&l`<calcite-alert auto-close class=${`report-submitted ${e}`} icon=check-circle kind=success label @calciteAlertClose=${()=>{this._commentSubmitted=!1}} open placement=top><div slot=message .innerHTML=${(this.commentSubmittedMessage||this._translations.commentSubmittedMsg)??""} ${o(this._commentSubmittedAlertNode)}></div></calcite-alert>`||""}${this._addingCommentFailed&&l`<calcite-alert auto-close class=${u(e)} icon=x-octagon kind=danger label @calciteAlertClose=${()=>{this._addingCommentFailed=!1}} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${this._translations.addingCommentFailedMsg}</div></calcite-alert>`||""}<div><calcite-shell content-behind>${this._getReporter()}</calcite-shell></div>${this.isMobile&&this.filterModal()||""}`}updated(){this._adjustAlertStyles()}async setSelectedLayer(e,t){this._selectedLayerId=e,this._selectedLayer=this.mapView&&await d(this.mapView,e),this._selectedLayerName=t,this._validLayers.forEach(i=>{this._nonVisibleValidLayers.find(s=>s.id===i.id)||i.set("visible",!e||i.id===e)})}_getLayersConfig(e){return this.reportingOptions&&this.reportingOptions[e]?this.reportingOptions[e]:null}_getReporter(){let e=[];this._flowItems.forEach(i=>{switch(i){case"layer-list":e.push(this.getLayerListFlowItem());break;case"feature-list":e.push(this.getFeatureListFlowItem(this._selectedLayerId,this._selectedLayerName));break;case"filter-panel":e.push(this.getFilterPanel());break;case"feature-details":e.push(this.getFeatureDetailsFlowItem());break;case"reporting-layer-list":e.push(this.getChooseCategoryFlowItem());break;case"feature-create":e.push(this.getFeatureCreateFlowItem());break;case"comment-details":e.push(this.getCommentDetailsFlowItem());break;case"add-comment":e.push(this.getAddCommentFlowItem());break}});let t=this.theme==="dark"?"calcite-mode-dark":"calcite-mode-light";return l`<calcite-panel class=${`width-full ${t}`}>${this.mapView?l`<calcite-flow>${e?.length>0&&e||""}</calcite-flow>`:l`<calcite-loader label scale=m></calcite-loader>`}</calcite-panel>`}filterModal(){return(this.layerExpressions?this.layerExpressions.filter(e=>e.id===this._selectedLayerId):[]).length>0&&l`<calcite-dialog aria-labelledby=modal-title class="modal" .heading=${this._translations.filterLayerTitle.replace("{{title}}",this._selectedLayerName)} kind=brand @calciteDialogClose=${()=>{this._closeFilter()}} .open=${this._filterOpen} width=s><div>${this.mapView&&l`<instant-apps-filter-list close-btn .closeBtnOnClick=${()=>{this._closeFilter()}} combobox-overlay-positioning=fixed .layerExpressions=${this._currentLayerExpressions} @filterListReset=${()=>{this._filterActive=!1,this._featureList.value&&this._featureList.value.refresh()}} @filterUpdate=${()=>{this._filterList?.filterCount!==void 0&&this._handleFilterUpdate(this._filterList?.filterCount>0)}} .view=${this.mapView} ${o(this._setFilterList)}></instant-apps-filter-list>`||""}</div></calcite-dialog>`||""}_setFilterList(e){this._filterList=e,e&&(e.autoUpdateUrl=!1,e.resetBtn=this.isMobile,e.resetFiltersOnDisconnect=!1,e.zoomBtn=!1)}_adjustAlertStyles(){this.reportSubmittedMessage&&this._reportSubmittedAlertNode.value?.children[0]&&(this._reportSubmittedAlertNode.value.children[0].style.margin="0px"),this.commentSubmittedMessage&&this._commentSubmittedAlertNode.value?.children[0]&&(this._commentSubmittedAlertNode.value.children[0].style.margin="0px")}_toggleFilter(){this._filterOpen=!this._filterOpen}async _closeFilter(){this._filterOpen=!1,this._filterList!=null&&(this._currentLayerExpressions=await this._filterList.getCurrentLayerExpressions(),this._showFilterIcon=this._currentLayerExpressions?.length>0)}async sortOptionClick(e,t,i){this._updatedSorting={field:e,order:t},this._updatedSortOption=i,this._sortPopoverNode.value&&(this._sortPopoverNode.value.open=!1)}_toggleSort(){let e=this.reportingOptions&&this.reportingOptions[this._selectedLayerId]&&this.reportingOptions[this._selectedLayerId].like&&this.reportingOptions[this._selectedLayerId].likeField;return l`<calcite-popover auto-close label offset-distance=0 .placement=${this.isMobile?"leading-start":"bottom-start"} pointer-disabled reference-element=sort-popover ${o(this._sortPopoverNode)}><calcite-list label selection-mode=single-persist><calcite-list-item .label=${this._translations.sortNewest} @calciteListItemSelect=${()=>{this._selectedLayer&&this.sortOptionClick(this._selectedLayer.objectIdField,"desc","newest")}} .selected=${this._updatedSortOption==="newest"} value=newest></calcite-list-item><calcite-list-item .label=${this._translations.sortOldest} @calciteListItemSelect=${()=>{this._selectedLayer&&this.sortOptionClick(this._selectedLayer.objectIdField,"asc","oldest")}} .selected=${this._updatedSortOption==="oldest"} value=oldest></calcite-list-item>${e&&l`<calcite-list-item .label=${this._translations.sortHighestVoted} @calciteListItemSelect=${()=>{let t=this.reportingOptions&&this.reportingOptions[this._selectedLayerId].likeField;t!==void 0&&this.sortOptionClick(t,"desc","highestVoted")}} .selected=${this._updatedSortOption==="highestVoted"} value=highestVoted></calcite-list-item><calcite-list-item .label=${this._translations.sortLowestVoted} @calciteListItemSelect=${()=>{let t=this.reportingOptions&&this.reportingOptions[this._selectedLayerId].likeField;t&&this.sortOptionClick(t,"asc","lowestVoted")}} .selected=${this._updatedSortOption==="lowestVoted"} value=lowestVoted></calcite-list-item>`||""}</calcite-list></calcite-popover>`}async _handleFilterListReset(){this._filterActive=!1}async _handleFilterUpdate(e){this._showLoadingIndicator=!0,this._filterActive=e,this._featureList.value&&await this._featureList.value.refresh(),this._showLoadingIndicator=!1}getLayerListFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this.reportsHeader} .loading=${this._showLoadingIndicator} .selected=${this._flowItems[this._flowItems.length-1]==="layer-list"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this._hasValidLayers&&this.enableNewReports&&l`<calcite-button appearance=solid @click=${this.navigateToChooseCategory} slot=footer width=full>${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText}</calcite-button>`||""}<calcite-panel><layer-list .applyLayerViewFilter=${this.showMyReportsOnly} class="height-full" .filterByMapExtent=${this.filterByMapExtent} .layers=${this._editableLayerIds?.length>0?this._editableLayerIds:this._layers} .mapView=${this.mapView} @layerSelect=${this.displayFeaturesList} @layersListLoaded=${this.layerListLoaded} show-feature-count show-next-icon ${o(this._layerList)}></layer-list></calcite-panel></calcite-flow-item>`}getChooseCategoryFlowItem(){let e=this.reportingOptions?Object.keys(this.reportingOptions).filter(t=>this.reportingOptions&&this.reportingOptions[t].visible&&this.reportingOptions[t].reporting&&this._layerItemsHash&&this._layerItemsHash[t]&&this._layerItemsHash[t].supportsAdd):[];return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="reporting-layer-list"}><calcite-panel><div class="progress-bar"><calcite-progress type=determinate .value=${this._updatedProgressBarStatus}></calcite-progress></div><calcite-notice class="notice-msg" icon=lightbulb kind=success open><div slot=message>${this._translations.chooseCategoryMsg}</div></calcite-notice><layer-list class="height-full" .layers=${e} .mapView=${this.mapView} @layerSelect=${this.navigateToCreateFeature}></layer-list></calcite-panel></calcite-flow-item>`}getFeatureCreateFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._selectedLayerName} @calciteFlowItemBack=${this.backFromCreateFeaturePanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-create"}>${this._showSubmitCancelButton&&l`<div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" .disabled=${this._submitNextButtonDisabled} @click=${this._showNextButton?this.onNextButtonClick.bind(this):this.onCreateFeatureSubmitButtonClick.bind(this)} width=full>${this._showNextButton?this._translations.next:this._translations.submit}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromCreateFeaturePanel} width=full>${this._translations.cancel}</calcite-button></div>`||""}<calcite-panel><div class="progress-bar"><calcite-progress type=determinate .value=${this._updatedProgressBarStatus}></calcite-progress></div><create-feature app-name=reporter .aiImageExtraction=${this.aiImageExtraction} class="height-full overflow-auto" customize-submit enable-search .enablePhotoLocation=${this.enablePhotoLocation} .enableSnapping=${this.enableSnapping} .floorLevel=${this.floorLevel} .formElements=${this._formElements.find(e=>e.id===this._selectedLayerId)} .reportingAreaLayer=${this.reportingAreaLayer} .isMobile=${this.isMobile} .mapView=${this.mapView} @drawComplete=${this.onFormReady} @editingLocation=${this.editingLocation} @editingAttachment=${this.showSubmitCancelButton} @fail=${this.createFeatureFailed} @modeChanged=${this.backFromCreateFeaturePanel} @progressStatus=${this.updatedProgressStatus} @success=${this.onReportSubmitted} .searchConfiguration=${this.searchConfiguration} .selectedLayerId=${this._selectedLayerId} .reportingArea=${this.reportingArea} .reportingAreaMessage=${this.reportingAreaMessage} .submitNewReportsMessage=${this.submitNewReportsMessage} update-map-position ${o(this._createFeature)}></create-feature></calcite-panel></calcite-flow-item>`}updatedProgressStatus(e){this._updatedProgressBarStatus=e.detail}onFormReady(e){this._submitNextButtonDisabled=e.detail,this._showSubmitCancelButton=!0}editingLocation(){this._showNextButton=!0}showSubmitCancelButton(e){this._showSubmitCancelButton=!e.detail}onCreateFeatureSubmitButtonClick(){this._createFeature.value&&(this._showNextButton=!1,this._createFeature.value.submit())}backFromCreateFeaturePanel(){this._createFeature.value&&(this._showSubmitCancelButton=!1,this._showNextButton=!1,this.updateNonVisibleLayersOnMap(!1)),this.backFromSelectedPanel()}onNextButtonClick(){this._createFeature.value&&(this._showNextButton=!1,this._showSubmitCancelButton=!0,this._createFeature.value.showForm())}onCreateRelatedFeatureSubmitButtonClick(){this._createRelatedFeature.value&&this._createRelatedFeature.value.submit()}backFromCreateRelatedFeaturePanel(){this._createRelatedFeature.value&&(this._showSubmitCancelButton=!1),this.backFromSelectedPanel()}createFeatureFailed(e){console.error(e.detail),this._featureCreationFailedErrorMsg=e.detail.message}async onReportSubmitted(){this._showSubmitCancelButton=!1,this.updateNonVisibleLayersOnMap(!1),await this.navigateToHomePage(),this._reportSubmitted=!0,this._updatedProgressBarStatus=25,this._showFullPanel&&this.updatePanelState(this._sidePanelCollapsed,!1)}addCommentFailed(e){console.error(e.detail),this._addingCommentFailed=!0}async onCommentSubmitted(){this._commentSubmitted=!0,this.backFromCreateRelatedFeaturePanel(),this._showLoadingIndicator=!0,this._featureDetails.value&&await this._featureDetails.value.refresh(this._currentFeature),setTimeout(()=>{this._showLoadingIndicator=!1},300)}async navigateToHomePage(){await this.setSelectedFeatures([]),this._layerList.value&&await this._layerList.value.refresh(),this._editableLayerIds.length===1?(this._featureList.value&&await this._featureList.value.refresh(),this._flowItems=["feature-list"]):this._flowItems=["layer-list"]}async navigateToCreateFeature(e){e.detail.layerId&&e.detail.layerName&&await this.setSelectedLayer(e.detail.layerId,e.detail.layerName),this.updateNonVisibleLayersOnMap(!0),this._getFormElements(),this._showSubmitCancelButton=!1,this._showNextButton=!1,this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"feature-create"]}navigateToChooseCategory(){this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"reporting-layer-list"]}updateNonVisibleLayersOnMap(e){this._nonVisibleValidLayers.find(t=>t.id===this._selectedLayerId)&&this._selectedLayer&&this._selectedLayer.set("visible",e)}async layerListLoaded(e){if(this._layerList.value&&this._flowItems[this._flowItems.length-1]==="layer-list"||this._flowItems[0]==="feature-list"){let t=e.detail,i=this.mapView&&await _(this.mapView),s=[];if(this._validLayers=[],this._nonVisibleValidLayers=[],i?.forEach(a=>{t.includes(a.id)&&(this._validLayers.push(a),a.visible||this._nonVisibleValidLayers.push(a),this._getLayersConfig(a.id)?.reporting&&this._layerItemsHash&&this._layerItemsHash[a.id]&&this._layerItemsHash[a.id].supportsAdd&&s.push(a.id))}),this.handleMapClick(),this._hasValidLayers=s.length>0,!this._urlParamsLoaded&&this._editableLayerIds.length>1&&this.layerId&&this.objectId){let a=this.mapView&&await d(this.mapView,this.layerId);a&&await this.displayFeaturesList({detail:{layerId:a.id,layerName:a.title}}),this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams()}}}async displayFeaturesList(e){this._showLoadingIndicator=!0,await this.setSelectedLayer(e.detail.layerId,e.detail.layerName),this.updateSortingOptions(),this.handleSelectedLayersFilter(),this._flowItems=[...this._flowItems,"feature-list"],this._prevSelectedLayerId=this._selectedLayerId,this._showLoadingIndicator=!1}updateSortingOptions(){let e=this.sortOption===""?"newest":this.sortOption,t=e==="oldest"||e==="lowestVoted"?"asc":"desc",i=this.reportingOptions?.[this._selectedLayerId]?.like?this.reportingOptions?.[this._selectedLayerId]?.likeField:"",s=this._selectedLayer&&(e==="newest"||e==="oldest")?this._selectedLayer?.objectIdField:i;this._updatedSorting={field:s||"",order:t},this._updatedSortOption=!i&&(e==="highestVoted"||e==="lowestVoted")?"newest":e}async backFromFilterPanel(){this._filterList!=null&&(this._currentLayerExpressions=await this._filterList.getCurrentLayerExpressions(),this._showFilterIcon=this._currentLayerExpressions?.length>0),this._featureList.value&&await this._featureList.value.refresh(),this.backFromSelectedPanel()}backFromSelectedPanel(){this._updatedProgressBarStatus=25;let e=[...this._flowItems];if(e[e.length-1]==="comment-details"||e[e.length-1]==="add-comment"||this.clearHighlights(),(e[e.length-1]==="reporting-layer-list"||e[e.length-1]==="feature-create"&&(e[0]==="feature-list"||e[e.length-2]==="feature-list"))&&this.updatePanelState(this._sidePanelCollapsed,!1),e.pop(),e.length===1&&e[0]==="layer-list"){this.navigateToHomePage();return}this._flowItems=[...e]}toggleSidePanel(){this._sidePanelCollapsed=!this._sidePanelCollapsed,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}updatePanelState(e,t){this._sidePanelCollapsed=e,this._showFullPanel=t,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}async onFeatureSelectFromList(e){await this.setSelectedFeatures([e.detail]),this._flowItems=[...this._flowItems,"feature-details"]}async getRelatedTable(){let e=this._currentFeature?.layer,t=this.mapView&&await f(this.mapView);e.relationships?.some(i=>{let s=t?.filter(a=>e.url===a.url&&a.layerId===i.relatedTableId);return s&&s.length>0?(this._relatedTable=s[0],!0):!1})}async updatingFeatureDetails(e){this._showLoadingIndicator=e}async selectionChanged(e){this.updatingFeatureDetails(!0),await this.setCurrentFeature(e.detail.selectedFeature[0]),this.highlightOnMap(e.detail.selectedFeature[0]),this._selectedFeatureIndex=e.detail.selectedFeatureIndex,this._featureDetails.value&&await this._featureDetails.value.refresh(e.detail.selectedFeature[0])}showAddCommentsPanel(){this._flowItems=[...this._flowItems,"add-comment"]}async onCommentSelectFromList(e){this._selectedRelatedFeature=[e.detail],this._flowItems=[...this._flowItems,"comment-details"]}getFeatureListFlowItem(e,t){let i=this._getLayersConfig(this._selectedLayerId)?.reporting&&this._layerItemsHash&&this._layerItemsHash[this._selectedLayerId].supportsAdd,s=this._showFilterIcon;return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${t} .loading=${!this.isMobile&&this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-list"}>${this._toggleSort()}<calcite-action appearance=solid icon=sort-ascending-arrow id=sort-popover slot=header-actions-end .text=${this._translations.sort} title=${this._translations.sort??p}></calcite-action>${s&&l`<calcite-action appearance=solid icon=filter .indicator=${this._filterActive} @click=${()=>{this.isMobile?this._toggleFilter():this._flowItems=[...this._flowItems,"filter-panel"]}} slot=header-actions-end .text=${this._translations.filter} title=${this._translations.filter??p}></calcite-action>`||""}${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this.enableNewReports&&i&&l`<calcite-button appearance=solid @click=${this.navigateToCreateFeature} slot=footer width=full>${this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText}</calcite-button>`||""}<calcite-panel>${l`<feature-list .applyLayerViewFilter=${this.showMyReportsOnly} class="height-full" .filterByMapExtent=${this.filterByMapExtent} highlight-on-hover .mapView=${this.mapView} .noFeaturesFoundMsg=${this._translations.featureErrorMsg} @featureClick=${()=>{this._showLoadingIndicator=!0}} @featureSelect=${this.onFeatureSelectFromList} page-size=30 .reportingOptions=${this.reportingOptions} .selectedLayerId=${e} .showFeatureSymbol=${this.showFeatureSymbol} .sortingInfo=${this._updatedSorting} ${o(this._featureList)}></feature-list>`}</calcite-panel></calcite-flow-item>`}getFilterPanel(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._translations.filterLayerTitle.replace("{{title}}",this._selectedLayerName)} .loading=${this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromFilterPanel} .selected=${this._flowItems[this._flowItems.length-1]==="filter-panel"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<div class=width-full slot=footer><div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" .disabled=${!this._filterActive} @click=${this.resetFilterList} width=full>${this._translations.resetFilter}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromFilterPanel} width=full>${this._translations.close}</calcite-button></div></div><calcite-panel>${this.mapView&&l`<instant-apps-filter-list .closeBtnOnClick=${()=>{}} combobox-overlay-positioning=fixed .layerExpressions=${this._currentLayerExpressions} @filterListReset=${()=>{this._handleFilterListReset()}} @filterUpdate=${()=>{let e=this._filterList?.filterCount;e!==void 0&&this._handleFilterUpdate(e>0)}} .view=${this.mapView} ${o(this._setFilterList)}></instant-apps-filter-list>`||""}</calcite-panel></calcite-flow-item>`}getFeatureDetailsFlowItem(){let e=this._selectedLayer?.relationships,t=this._getLayersConfig(this._selectedLayerId)?.comment&&e&&e.length>0&&this._relatedTable;return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._selectedLayerName} .loading=${this._showLoadingIndicator} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="feature-details"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}${this.mapView&&l`<instant-apps-social-share class=share-node flip-rtl popover-button-icon-scale=s remove-popover-offset scale=m share-button-color=neutral share-button-type=action slot=header-actions-end social-media .view=${this.mapView} ${o(this._shareNode)}></instant-apps-social-share>`||""}${this._selectedFeature.length>1&&this.getFeaturesPagination()||""}<calcite-panel><feature-details class=full-height .enableSnapping=${this.enableSnapping} .graphics=${this._selectedFeature} .layerItemsHash=${this._layerItemsHash} .mapView=${this.mapView} @addComment=${this.showAddCommentsPanel} @commentClick=${()=>{this._showLoadingIndicator=!0}} @commentSelect=${this.onCommentSelectFromList} @featureSelectionChange=${this.selectionChanged} @likeOrDislikeClicked=${()=>{this._featureList.value&&this._featureList.value.refresh(!0)}} @loadingStatus=${i=>{this.updatingFeatureDetails(i.detail)}} .reportingOptions=${this.reportingOptions} .showFullCommentTitle=${this.showFullCommentTitle} .showUserImageInCommentsList=${this.showUserImageInCommentsList} ${o(this._featureDetails)}></feature-details>${t&&l`<calcite-button appearance=solid @click=${this.showAddCommentsPanel} slot=footer width=full>${this.commentButtonText||this._translations.comment}</calcite-button>`||""}</calcite-panel></calcite-flow-item>`}getFeaturesPagination(){return l`<div class="feature-pagination"><div><calcite-button appearance=transparent icon-start=chevron-left icon-flip-rtl=both id=solutions-back @click=${()=>this._featureDetails.value&&void this._featureDetails.value.back()} scale=s width=full></calcite-button><calcite-tooltip placement=top reference-element=solutions-back><span>${this._translations.back}</span></calcite-tooltip></div><calcite-button appearance=transparent @click=${()=>this._featureDetails.value&&void this._featureDetails.value.toggleListView()} scale=s><span class="pagination-count">${this._getCount()}</span></calcite-button><div><calcite-button appearance=transparent icon-flip-rtl=both icon-start=chevron-right id=solutions-next @click=${()=>this._featureDetails.value&&void this._featureDetails.value.next()} scale=s width=full></calcite-button><calcite-tooltip placement=top reference-element=solutions-next><span>${this._translations.next}</span></calcite-tooltip></div></div>`}getCommentDetailsFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._relatedTable?.title||""} @calciteFlowItemBack=${this.backFromSelectedPanel} .selected=${this._flowItems[this._flowItems.length-1]==="comment-details"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<calcite-panel><info-card .enableSnapping=${this.enableSnapping} .graphics=${this._selectedRelatedFeature} .mapView=${this.mapView} @selectionChanged=${()=>{this._showLoadingIndicator=!1}}></info-card></calcite-panel></calcite-flow-item>`}getAddCommentFlowItem(){return l`<calcite-flow-item .collapsed=${this.isMobile&&this._sidePanelCollapsed} .heading=${this._relatedTable?.title||""} @calciteFlowItemBack=${this.backFromCreateRelatedFeaturePanel} .selected=${this._flowItems[this._flowItems.length-1]==="add-comment"}>${this.isMobile&&this.getActionToExpandCollapsePanel()||""}<div class=width-full slot=footer>${this._showSubmitCancelButton&&l`<div class=width-full slot=footer><calcite-button appearance=solid class="footer-top-button footer-button" @click=${this.onCreateRelatedFeatureSubmitButtonClick} width=full>${this._translations.submit}</calcite-button><calcite-button appearance=outline class=footer-button @click=${this.backFromCreateRelatedFeaturePanel} width=full>${this._translations.cancel}</calcite-button></div>`||""}</div><calcite-panel><create-related-feature customize-submit .enableSnapping=${this.enableSnapping} .mapView=${this.mapView} @fail=${this.addCommentFailed} @formReady=${this.onFormReady} @isActionPending=${this.showSubmitCancelButton} @success=${this.onCommentSubmitted} .selectedFeature=${this._currentFeature} .table=${this._relatedTable} ${o(this._createRelatedFeature)}></create-related-feature></calcite-panel></calcite-flow-item>`}async setSelectedFeatures(e){this._selectedFeature=e,await this.setCurrentFeature(this._selectedFeature.length?this._selectedFeature[0]:void 0)}async setCurrentFeature(e){if(this._currentFeature=e,e&&e.layer){let t=e.layer;t.title&&this.setSelectedLayer(t.id,t.title),this._currentFeatureId=e.attributes[t.objectIdField],this._getLayersConfig(t.id)?.comment&&t.relationships&&t.relationships.length>0&&await this.getRelatedTable()}else this._editableLayerIds.length>1&&(this.setSelectedLayer("",""),this.handlePrevLayersFilter()),this._currentFeatureId="";this._updateShareURL()}async highlightOnMap(e){if(this.clearHighlights(),e&&e.geometry&&e.layer&&e.layer.id!==void 0){let t=this.mapView&&await m(this.mapView,e.layer.id.toString());if(t){let i=Number(e.getObjectId());this._highlightHandle=this.mapView&&await x([i],t,this.mapView,!0,this.zoomToScale)}}this.updatingFeatureDetails(!1)}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}getActionToExpandCollapsePanel(){return l`<calcite-action appearance=solid .icon=${this._sidePanelCollapsed?"chevrons-up":"chevrons-down"} @click=${this.toggleSidePanel} slot=header-actions-end .text=${(this._sidePanelCollapsed?this._translations.expand:this._translations.collapse)||""}></calcite-action>`}async setMapView(){this.mapView&&await f(this.mapView),await this.getLayersToShowInList(),await this._updateFeatures(),this._editableLayerIds?.length===1?await this.renderFeaturesList():this._flowItems=["layer-list"],this.mapView&&(this.mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this.mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0))}handleMapClick(){this._mapClickHandle&&this._mapClickHandle.remove(),this._mapClickHandle=E.on(()=>this.mapView,"click",e=>{this.mapView&&(this.mapView.popupEnabled=!1),this.onMapClick(e)})}async onMapClick(e){if(!(this._flowItems[this._flowItems.length-1]==="feature-create"||this._flowItems[this._flowItems.length-1]==="add-comment")&&this.mapView){let t=await this.mapView.hitTest(e),i=[],s=[],a=[],n=!1;t.results.length>0&&t.results.forEach(r=>{r.type==="graphic"&&i.push(r.graphic)}),i.length>0&&(await this._setReportingGraphics(i),s=this._getNonReportingLayerGraphics(i)),this._mapImageryLayersId.length>0&&(a=await this._getIdentifiedGraphics(e.mapPoint),n=a.length>0);let h=s.concat(a);if(h.length>0){this.mapView.popupEnabled=!0;let r={features:h,location:e.mapPoint,updateLocationEnabled:!n};await this.mapView.openPopup(r)}}}async _setReportingGraphics(e){let t=e.filter(i=>{if(i.layer?.type==="feature"){let s=i.layer;return this._validLayers.includes(s)}else return!1});this._selectedLayer&&this._selectedFeature.length>0&&this._selectedLayer.id===t[0]?.layer?.id&&t[0].attributes[this._selectedLayer.objectIdField]===this._selectedFeature[0].attributes[this._selectedLayer.objectIdField]||t.length>0&&(await this.setSelectedFeatures(t),this._flowItems.length&&this._flowItems.includes("feature-details")?(this._flowItems=[...this._flowItems.slice(0,this._flowItems.indexOf("feature-details")+1)],await this.highlightOnMap(e[0])):this._flowItems=[...this._flowItems,"feature-details"])}_getNonReportingLayerGraphics(e){return e.filter(t=>{if(t.layer?.type==="feature"){let i=t.layer;return!this._validLayers.includes(i)&&i?.popupEnabled&&i?.id}else return!1})}async _getIdentifiedGraphics(e){let t=new O({geometry:e,tolerance:3,mapExtent:this.mapView?.extent}),i,s=[];for(let n of this._mapImageryLayersId){let h=this.mapView&&await d(this.mapView,n);if(h?.url&&t)try{let r=await k?.identify(h.url,t);if(r?.results?.length){s=r.results,i=h;break}}catch(r){console.error(r)}}let a=[];return s.forEach(n=>{let h=n.layerId,r=i?.sublayers?.items.find(P=>P.id===h),w=r?.popupTemplate;r?.popupEnabled&&w&&(n.feature.popupTemplate=w,a.push(n.feature))}),a}_getCount(){let e=(this._selectedFeatureIndex+1).toString(),t=this._selectedFeature.length.toString();return this._translations.indexOfTotal.replace("{{index}}",e).replace("{{total}}",t)}_updateFloorDefinitionExpression(e){let t=`${e?.floorInfo?.floorField} = '${this.floorLevel}'`,i=e.definitionExpression;e.definitionExpression=i&&i?.indexOf(this._floorExpression)>-1?i.replace(this._floorExpression,t):t,this._floorExpression=t}_getFormElements(){let e=this._selectedLayer;if(e?.floorInfo?.floorField&&this.floorLevel&&e?.formTemplate){let t=this._formElements.find(i=>i.id===e.id);(this._formElements.length===0||!t)&&this._formElements.push({id:e.id,orgElements:e.formTemplate.elements,orgExpressionInfos:e.formTemplate.expressionInfos})}}reduceToConfiguredLayers(e,t){return Object.keys(e).reduce((i,s)=>{let a=this.reportingOptions?this._getLayersConfig(s)?.visible:e[s].supportsAdd;return!t.includes(s)&&a&&i.push(s),i},[])}refreshLists(){setTimeout(()=>{this._layerList.value&&this._flowItems[this._flowItems.length-1]==="layer-list"&&this._layerList.value.refresh(),this._featureList.value&&this._featureList.value.refresh()},50)}async _updateFeatures(){for(let e of this._editableLayerIds){let t=this.mapView&&await m(this.mapView,e);t&&(await this._showMyFeaturesOnly(t),t.layer?.floorInfo?.floorField&&this.floorLevel&&this._updateFloorDefinitionExpression(t.layer))}}async _showMyFeaturesOnly(e){let t=(this.mapView?.map).portalItem.portal?.credential?.userId;if(t&&e){let i=e.layer.editFieldsInfo?.creatorField.toLowerCase();e.filter=this.showMyReportsOnly&&i?new V({where:`${i} = '${t}'`}):null}}async getLayersToShowInList(){let e=this.mapView&&await C(this.mapView,!1),t=this.mapView&&await _(this.mapView),i=[];t?.forEach(s=>{s?.type==="feature"&&s?.editingEnabled&&s?.capabilities?.operations?.supportsAdd&&(e[s.id].supportsAdd=!0),s?.editingEnabled||i.push(s.id)}),this._editableLayerIds=this.reduceToConfiguredLayers(e,i),this._layerItemsHash=e}async renderFeaturesList(){this._flowItems=["feature-list"];let e={detail:this._editableLayerIds};await this.layerListLoaded(e),await this.setSelectedLayer(this._validLayers[0].id,this._validLayers[0]?.title||""),this.updateSortingOptions(),await this.handleSelectedLayersFilter(),this._urlParamsLoaded||(this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams())}_updateShareURL(){let e=this._shareNode.value?.shareUrl;if(!e)return;let t=new URL(e);this._selectedLayerId?t.searchParams.set("layerid",this._selectedLayerId):t.searchParams.delete("layerid"),this._selectedFeature?.length?t.searchParams.set("oid",this._currentFeatureId):t.searchParams.delete("oid"),this._shareNode.value&&(this._shareNode.value.autoUpdateShareUrl=!1,this._shareNode.value.shareUrl=t.href)}async loadFeatureFromURLParams(){if(this.center&&this.level&&await this.mapView?.goTo({center:this.center.split(";").map(Number),zoom:parseInt(this.level,10)}),this.layerId&&this.objectId){let e=this.mapView&&await d(this.mapView,this.layerId);if(e){let t=this.mapView&&await v([Number(this.objectId)],e,[],!0,this.mapView.spatialReference);t?.length&&(await this.setSelectedFeatures(t),this._flowItems.length&&this._flowItems[this._flowItems.length-1]!=="feature-details"?this._flowItems=[...this._flowItems,"feature-details"]:this._flowItems=[...this._flowItems])}}}async handleSelectedLayersFilter(){if(this._selectedLayer){let e=this.layerExpressions?structuredClone(this.layerExpressions.filter(t=>t.id===this._selectedLayerId)):[];this._t9nLayerExpressions!=null&&this.handleLayerExpressionsT9n(e,this._t9nLayerExpressions),this._currentLayerExpressions=e,this._showFilterIcon=this._currentLayerExpressions?.length>0,this.setActiveDefinitionExpressions()}}async handlePrevLayersFilter(){if(this._prevSelectedLayerId){let e=this.mapView&&await d(this.mapView,this._prevSelectedLayerId);e&&this._initDefExpressions&&(e.definitionExpression=this._initDefExpressions[this._prevSelectedLayerId])}}async resetFilterList(){await this._filterList?.forceReset(),this._selectedLayer!==void 0&&this._initDefExpressions&&(this._selectedLayer.definitionExpression=this._initDefExpressions[this._selectedLayerId],this._filterActive=!1)}setActiveDefinitionExpressions(){if(this._selectedLayer===void 0)return;let e=[];if(this._currentLayerExpressions&&this._currentLayerExpressions?.length>0){let t=this._currentLayerExpressions[0];for(let i of t.expressions){let{active:s,definitionExpression:a}=i;s&&a&&e.push(`(${a})`)}this._filterActive=e.length>0,this.updateFilterLayerDefExpression(e,t.operator)}}updateFilterLayerDefExpression(e,t){let i=this._initDefExpressions&&this._initDefExpressions[this._selectedLayerId],s=e?.length>0&&i?`(${e.join(t)}) AND (${i})`:e.length>0?e.join(t):i;this._selectedLayer&&(this._selectedLayer.definitionExpression=s)}setInitExpressions(){if(this._initDefExpressions={},this.mapView==null)return;let e=this.mapView.map;e.allLayers.concat(e.allTables.toArray()).forEach(t=>{if(t.type==="map-image"&&t.popupEnabled&&!this._mapImageryLayersId.includes(t.id)){this._mapImageryLayersId.push(t.id);return}if(t.type!=="feature")return;let i=t;this._initDefExpressions&&(this._initDefExpressions[i.id]=i.definitionExpression||"")})}handleLayerExpressionsT9n(e,t){e?.forEach(i=>{let s=t?.find(a=>a.id===i.id);s!=null&&(i.title=s.title,i.expressions?.forEach(a=>{let n=s.expressions?.find(h=>h.id===a.id);n!=null&&(a.name=n.name)}))})}};I("crowdsource-reporter",g);return g},"core/reactiveUtils","layers/support/FeatureFilter","rest/identify","rest/support/IdentifyParameters",a,d)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
+ import e from"./QMZKZWSS.js";import{a as H}from"./JOQDD4HN.js";import d from"./XBVKGREH.js";import c from"./KDIUYXBA.js";import a from"./UUYUTETH.js";import{a as S}from"./HYX7BODW.js";import{b as E}from"./B2DK4LWH.js";import{F as f,G as g,H as x,J as b,h as v,i as o,l as _,r as p,u as T}from"./46DQNAMV.js";export default $arcgis.t(([L,c,M,w,{c:O},{c:C,d:A,j:y},{G:F,k:m},{b:$}])=>{var R=v`@layer{:host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.display-none{display:none}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51-px{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir=rtl] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none!important}vaadin-grid-cell-content{font-size:14px!important;color:var(--calcite-color-text-3)!important}.absolute-right{position:absolute;right:0;left:unset}html[dir=rtl] .absolute-right{left:0;right:unset}.disabled{cursor:default!important;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.actions-end{height:50px!important;display:inline-flex}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-dialog-content-space: 0}.esri-feature-table__table-container{height:100%}.search-container{background-color:var(--calcite-color-foreground-1)!important}.search{--calcite-color-border-input: var(--calcite-color-border-3);width:60%;padding:10px}.delete-red{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-color-text-1: var(--calcite-color-status-danger);--calcite-color-text-3: var(--calcite-color-status-danger)}.label-override{white-space:nowrap}.padding-start-1-4{padding-inline-start:.5rem}.panel-header-override{--calcite-panel-header-content-space: 0px}.danger-label-color{color:var(--calcite-color-status-danger)}.danger-icon-color{--calcite-icon-color: var(--calcite-color-status-danger)}.width-51{width:51px}.height-51{height:51px}calcite-action-bar{--calcite-internal-action-bar-gap: 0px;--calcite-internal-action-bar-padding: 0px}}`,I=class extends x{constructor(){super(),this.defaultGlobalId=[],this.defaultLayerId="",this.defaultOid=[],this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!1,this.enableInlineEdit=!1,this.enableShare=!1,this.enableTableAutosave=!0,this.featureSelectionMode="multiple",this.selectedRelatedIds=[],this.honorMapFieldSettings=!1,this.isMobile=!1,this.mapHidden=!1,this.showOnlyUpdatableLayers=!1,this.selectedIds=[],this.shareIncludeEmbed=!1,this.shareIncludeSocial=!1,this.showNewestFirst=!1,this.zoomAndScrollToSelected=!1,this._allIds=[],this._configLayerOrderDefined=!1,this._csvExporting=!1,this._fetchingData=!1,this._hideTable=!1,this._filterActive=!1,this._selectAllActive=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=[],this._translations=S({name:"layer-table",blocking:!0}),this._fullTextSearchInfo=[],this._searchPlaceHolder="",this._size=0,this._queryingData=!1,this._editEnabled=!1,this._enabledLayerIds=[],this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._deleteEnabled=!1,this._floorExpression="",this._floorField="",this._floorLevel="",this._loaded=!1,this._shareNode=f(),this._toolbar=f(),this._searchExpression="",this._skipEditCheck=!1,this._tempSelectedIds=[],this._outOFExtentOids=[],this._shouldUpdateTableOnExtentChange=!0,this._creatingFeature=!1,this._searchNode=f(),this.columnReorder=p(),this.featureSelectionChange=p(),this.toggleFilter=p(),this.showDelete=p(),this.relatedRecordToggled=p(),this.editMultipleFeatures=p(),this.listenOn(window,"beforeMapInfoChange",this.beforeMapInfoChange,{capture:!0}),this.listenOn(window,"editorInitialized",this.editorInitialized),this.listenOn(window,"closeEdit",this.closeEdit),this.listenOn(window,"selectionChanged",this.selectionChanged),this.listenOn(window,"beforeLayerSelectionChange",this.beforeLayerSelectionChange),this.listenOn(window,"layerSelectionChange",this.layerSelectionChange),this.listenOn(window,"editsComplete",this.editsComplete),this.listenOn(window,"facilityChanged",this.facilityChanged),this.listenOn(window,"levelChanged",this.levelChanged),this.listenOn(window,"siteChanged",this.siteChanged),this.listenOn(window,"noLayersFound",this.noLayersFound),this.listenOn(window,"clearSelection",this.clearSelection),this.listenOn(window,"mapChanged",this.mapChanged),this.listenOn(window,"featuresSelected",this.featuresSelected),this.listenOn(window,"createWorkFlowStarted",this.createWorkFlowStarted),this.listenOn(window,"backFromCreateWorkFlow",this.backFromCreateWorkFlow),H(window)}static{this.properties={appLayout:1,defaultGlobalId:0,defaultLayerId:1,defaultOid:0,enableAutoRefresh:5,enableColumnReorder:5,enableCSV:5,enableInlineEdit:5,enableShare:5,enableTableAutosave:5,featureSelectionMode:1,selectedRelatedIds:0,honorMapFieldSettings:5,isMobile:5,mapHidden:5,mapInfo:0,mapView:0,showOnlyUpdatableLayers:5,selectedIds:0,shareIncludeEmbed:5,shareIncludeSocial:5,showNewestFirst:5,zoomAndScrollToSelected:5,zoomToScale:9,_allIds:16,_configLayerOrderDefined:16,_csvExporting:16,_fetchingData:16,_hideTable:16,_filterActive:16,_layer:16,_selectAllActive:16,_showHideOpen:16,_showOnlySelected:16,_toolInfos:16,_translations:16,_fullTextSearchInfo:16,_searchPlaceHolder:16,_size:16,_queryingData:16}}static{this.styles=R}static{this.shadowRootOptions=T}willUpdate(e){if(e.has("appLayout")&&this.appLayoutWatchHandler(),e.has("defaultOid")&&this.defaultOidWatchHandler(),e.has("defaultGlobalId")&&this.defaultGlobalIdWatchHandler(),e.has("enableCSV")&&this.enableCSVWatchHandler(),e.has("enableInlineEdit")&&this.enableInlineEditWatchHandler(),e.has("mapHidden")&&this.mapHiddenWatchHandler(),e.has("isMobile")&&this.isMobileWatchHandler(),e.has("mapInfo")&&this.mapInfoWatchHandler(),e.has("mapView")&&this.mapViewWatchHandler(),e.has("_layer")&&this._layerWatchHandler(),e.has("selectedIds")&&(this.hasUpdated||JSON.stringify(e.get("selectedIds"))!==JSON.stringify(this.selectedIds))&&this.selectedIdsWatchHandler(),e.has("selectedRelatedIds")&&(this.hasUpdated||JSON.stringify(e.get("selectedRelatedIds"))!==JSON.stringify(this.selectedRelatedIds))&&this.selectedRelatedIdsWatchHandler(),e.has("enableTableAutosave")&&this.hasUpdated&&this._table&&(this._table.autoSaveEnabled=this.enableTableAutosave),e.has("_translations")){let t=this._translations._lang,i=e.get("_translations")?._lang;t&&i&&t!==i&&this._initToolInfos()}}async appLayoutWatchHandler(){await this._initToolInfos(),this._updateShareUrl()}async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}async enableCSVWatchHandler(){this._toolInfos?.length>0&&await this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}async mapHiddenWatchHandler(){this._toolInfos?.length>0&&await this._initToolInfos()}async isMobileWatchHandler(){!this._toolInfos&&!this.isMobile&&await this._initToolInfos()}async mapInfoWatchHandler(){this._configLayerOrderDefined="configLayerOrder"in(this.mapInfo?.layerOptions||{}),this._enabledLayerIds=F(this.mapInfo?.layerOptions?.layers||[],this.mapInfo?.layerOptions?.configLayerOrder),this._table&&(this._resetColumnTemplates(),this._sortTable(),await this._initToolInfos())}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression="",this._searchExpression="undefined",this.mapView.highlights=[{name:"default",color:"#00FFFF"},{name:"current-selection",color:"#ff00ff"},{name:"temporary",color:"#FFFF00"}],this._updateShareUrl(),this._mapClickHandle=c.on(()=>this.mapView,"click",e=>{this._creatingFeature||this._mapClicked(e)}))}async _layerWatchHandler(){if(this._hideTable=!1,this._fetchingData=!0,!this._layer){this._fetchingData=!1,this._hideTable=!0;return}try{await this._layer.when(),this._floorField=this._layer.floorInfo?.floorField||"",this._updateFloorDefinitionExpression(),await this._resetTable(),this._updateShareUrl()}catch(e){console.error(e),this._hideTable=!0}finally{this._fetchingData=!1}}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1),this.selectedIds.length>0&&(this._table.rowHighlightIds.removeAll(),this._table.rowHighlightIds.add(this.selectedIds[0])),this.selectedIds.length===0&&setTimeout(()=>{this.featureSelectionChange.emit(this.selectedIds)},700)}async selectedRelatedIdsWatchHandler(){this._validateEnabledActions(),this.selectedRelatedIds.length>0&&(this._relatedFeatureTable?.rowHighlightIds.removeAll(),this._relatedFeatureTable?.rowHighlightIds.add(this.selectedRelatedIds[0]))}async closeFilter(){await this._closeFilter()}async filterReset(){this._filterByExtentHandle&&(this._table&&(this._table.filterGeometry=void 0),this._filterByExtentHandle.remove(),this._filterByExtentHandle=void 0),await this._handleFilterListReset()}async filterUpdate(e,t){await this._handleFilterUpdate(e),t?(this._shouldUpdateTableOnExtentChange=!0,this._handleTableOnMapExtent()):t===!1&&(this._table&&(this._table.filterGeometry=void 0),this._filterByExtentHandle?.remove(),this._filterByExtentHandle=void 0,await this._updateAllIds())}async validateTableUpdate(e){this._shouldUpdateTableOnExtentChange=e}async validateActiveEdits(){return this._validateActiveEdits([],this.selectedIds)}async refresh(){this._table&&await this._refresh()}async setColumnOrder(e){this._setColumnTemplates(e)}async beforeMapInfoChange(e){let t=e.detail.ref,i=e.detail.mapInfo;if(this._hasPendingEdits()){e.preventDefault();let s=await this._validateActiveEdits([],this.selectedIds);await t.setMapByID(s?i.id:e.detail.currentId,!s)}}async editorInitialized(e){this._shouldUpdateTableOnExtentChange=!1,this._editor=e.detail}async closeEdit(){this._shouldUpdateTableOnExtentChange=!0,this._filterByExtentHandle&&this._handleTableOnMapExtent()}async selectionChanged(e){let t=e.detail.selectedFeature[0],i=Number(t.getObjectId()),s=this._table;if(s.rowHighlightIds.length&&s.rowHighlightIds.removeAll(),s.rowHighlightIds.add(i),this._highlightFeatures(i),this.zoomAndScrollToSelected&&s&&this.mapView){let a=s.viewModel.getObjectIdIndex(i);s.scrollToIndex(a);let l=t.layer,h=this.mapView.allLayerViews.toArray(),n;h.some(async r=>r.layer.title===l?.title&&r.layer.type==="feature"?(n=r,this.mapView&&await y([i],n,this.mapView,!0,void 0,this.zoomToScale),!0):!1)}}async beforeLayerSelectionChange(e){if(this._hasPendingEdits()){e.preventDefault();let t=e.detail.ref,i=await this._validateActiveEdits([],this.selectedIds);return e.detail.selectedIds?await t.setLayerByIds(i?e.detail.newIds:e.detail.currentIds,!0):await t.setLayerById(i?e.detail.newId:e.detail.currentId,!0)}}async layerSelectionChange(e){await this._layerSelectionChanged(e)}async editsComplete(e){let t=e.detail;(t==="delete"||t==="add")&&(this._allIds=await this.queryAllIds()),await this._refresh()}async facilityChanged(e){this._updateFloorDefinitionExpression()}async levelChanged(e){this._floorLevel=e.detail,this._updateFloorDefinitionExpression()}async siteChanged(e){this._updateFloorDefinitionExpression()}async noLayersFound(){this._layer=void 0,this._allIds=[],this._size=0,this._clearSelection()}async clearSelection(){await this._validateActiveEdits([],this.selectedIds)&&this._clearSelection()}async mapChanged(){this._queryingData=!1,this._creatingFeature=!1,this._clearSelection()}async featuresSelected(e){e.detail.forEach(t=>{let i=this._table?.highlightIds.indexOf(t);i&&i<0&&this._table?.highlightIds.add(t)})}createWorkFlowStarted(){this._creatingFeature=!0}backFromCreateWorkFlow(){this._creatingFeature=!1}async load(){await this._initToolInfos()}render(){let e=this._fetchingData||this._hideTable?"display-none":"",t=this._fetchingData?"":"display-none",i=this._queryingData?"":"display-none",s=this._size.toString(),a=this.selectedIds.length.toString(),l=this.isMobile?"height-full":"height-full-adjusted",h=this._canShowFullTextSearch();return this._validateActiveActions(),o`<div><calcite-scrim class=${b(i)} .loading=${this._queryingData}></calcite-scrim><calcite-shell><div class=${`width-full ${l}`}><calcite-panel class="height-full width-full panel-header-override">${this._getMapLayerPicker("header-actions-start")}${!this.isMobile&&o`${this._getTableControlRow("header-content")}${this._getActionsEnd("header-actions-end")}`||""}${h&&o`<div class="search-container border-bottom"><calcite-input class=search clearable icon=search @calciteInputChange=${n=>{this._searchTextChanged(n)}} .placeholder=${this._searchPlaceHolder} title=${this._searchPlaceHolder??_} type=search ${g(this._searchNode)}></calcite-input></div>`||""}<calcite-loader class=${b(t)} .label=${this._translations.fetchingData} scale=l></calcite-loader><div class=${b(e)} ${g(this.onTableNodeCreate)}></div></calcite-panel></div>${this.isMobile?void 0:o`<div class="bottom-left text-color height-19" id=solutions-selected-count-div>${(this._translations.recordsTotal?.replace("{{total-number-of-records}}",s)+" | "+this._translations.recordsSelected.replace("{{selected-number-of-records}}",a)).replace("{{total}}",s).replace("{{selected}}",a)}</div>`}</calcite-shell></div>`}updated(){this._table&&this.updateRelatedAttachmentColumns()}async _searchTextChanged(e){this._fullTextSearchInfo.forEach(t=>{t.searchTerm=e.target.value}),this._searchFullText()}async _searchFullText(){let e=[],t=!1;if(this._showOnlySelected)e=this._tempSelectedIds,t=!0;else if(await this._validateActiveEdits([],this.selectedIds))this._clearSelection(),this._tempSelectedIds=[];else return;this._searchExpression&&this._clearSearchDefinitionExpression();let i=[];if(this._fullTextSearchInfo?.length&&this._fullTextSearchInfo[0].searchTerm){let s=this._layer?.createQuery();s.fullText=this._fullTextSearchInfo,i=this._layer?await this._layer.queryObjectIds(s):[],t&&e?.length&&(i=i.filter(a=>e.includes(a))),await this._updateSearchDefinitionExpression(i?.length?i:[-1])}t&&i?.length&&(this._showOnlySelected=!0,this._table?.highlightIds.addMany(i.reverse())),await new Promise(s=>setTimeout(s,800)),await this._updateAllIds()}_clearSearchDefinitionExpression(){let e=this._layer?.definitionExpression;this._searchExpression&&e&&e?.indexOf(this._searchExpression)>-1&&this._layer&&(e?.indexOf(" AND ("+this._searchExpression)>-1?this._layer.definitionExpression=e.replace(` AND (${this._searchExpression})`,""):this._layer.definitionExpression=e.replace(this._searchExpression,"")),this._searchExpression=""}async _updateSearchDefinitionExpression(e){let t=this._layer?.definitionExpression;if(this._layer)if(e?.length){let i=`objectId in(${e})`;this._layer.definitionExpression=this._searchExpression&&t&&t.includes(this._searchExpression)?t.replace(this._searchExpression,i):t?`${t} AND (${i})`:i,this._searchExpression=i}else this._clearSearchDefinitionExpression()}_canShowFullTextSearch(){return this._layer?.capabilities?.query?.supportsFullTextSearch&&this._layer.indexes.items.filter(e=>e.indexType=="FullText").length>0}_getFullTextSearchInfo(){if(this._fullTextSearchInfo=[],this._layer?.capabilities?.query?.supportsFullTextSearch){let e=this._layer.indexes?.filter(t=>t.indexType=="FullText");if(e?.length){let t=[];e.forEach(s=>{t.push(...s.fields.split(","))});let i=[];t.forEach(s=>{let a=this._layer?.getField(s.trim());a?.alias&&i.push(a.alias)}),this._searchPlaceHolder=this._translations.searchPlaceholder.replace("{{field_names}}",i.join(", ")),this._fullTextSearchInfo.push({onFields:["*"],searchTerm:"",searchType:"prefix"})}}}_getMapLayerPicker(e){let t=this.isMobile?"display-none":"";return o`<div class=${`border-end ${t}`} id=solutions-map-layer-picker-container slot=${e??_}><map-layer-picker appearance=transparent .configLayerOrderDefined=${this._configLayerOrderDefined} .defaultLayerId=${this.defaultLayerId} display=inline-flex .enabledLayerIds=${this._enabledLayerIds} height=50 .isMobile=${this.isMobile} .mapView=${this.mapView} .showOnlyUpdatableLayers=${this.showOnlyUpdatableLayers} placeholder-icon=layers scale=l .selectedIds=${this._layer?[this._layer?.id]:[]} show-single-layer-as-label show-tables type=dropdown></map-layer-picker></div>`}_getLayerOption(e){let t;return this.mapInfo?.layerOptions?.layers.some(i=>i.id===e?(t=i,!0):!1),t}_getActionsEnd(e){let t=this._relatedFeatureTable?this._relatedFeatureTable.layer:this._layer,i=this._relatedFeatureTable||this._table,s=this._getLayerOption(t?.id||"");return o`<div class="display-flex" slot=${e??_}><field-selection .configExtraFields=${s?.extraFields} .layer=${t} .mapView=${this.mapView} .table=${i} .tableRef=${this.el}></field-selection>${this.enableShare&&!this.isMobile?this._getShare("share"):void 0}</div>`}_getTableControlRow(e){return o`<div class=${"height-51-px width-full display-flex"} slot=${e??_} ${g(this._toolbar)}>${this._getActionBar()}</div>`}_getActionBar(){return o`<calcite-action-bar class=width-full expand-disabled id=${this._getId("bar")??_} layout=horizontal><calcite-action-group>${this.isMobile?void 0:this._getActions()}</calcite-action-group></calcite-action-bar>`}_getActions(){return this._toolInfos?.reduce((e,t)=>(t&&e.push(t.isDanger?this._getDangerAction(t.icon,t.label,t.func,t.disabled):this._getAction(t.active,t.icon,t.indicator,t.label,t.func,t.disabled,!!t.loading,t.toolTip)),e),[])}_validateEnabledActions(){let e=this._getIds().length,t=["zoom-to-object","pencil","trash","erase","selected-items-filter"];this._toolInfos?.forEach(i=>{i&&t.indexOf(i.icon)>-1&&(i.disabled=i.icon==="pencil"?e<2||e>m:e<1,i.toolTip=i.icon==="pencil"?e>m?this._translations.featureEditLimitNotice:this._translations.editMultiple:i.toolTip)})}_validateActiveActions(){let e=["filter","list-check-all","selected-items-filter"];this._toolInfos?.forEach(t=>{t&&e.indexOf(t.icon)>-1&&(t.icon==="filter"&&(t.indicator=this._filterActive),t.icon==="list-check-all"&&(t.active=this._selectAllActive),t.icon==="selected-items-filter"&&(t.active=this._showOnlySelected,t.label=this._showOnlySelected?this._translations.showAll:this._translations.showSelected))})}async _initToolInfos(){let e=this._getIds().length>0,t=this._relatedFeatureTable?this._relatedFeatureTable.layer.isTable:this._layer?.isTable,i=this.featureSelectionMode==="multiple"&&this._layer?.capabilities?.operations.supportsUpdate,s=this._getSelectedIds().length<2||this._getSelectedIds().length>m,a=!this.mapHidden&&!t,l=!this._relatedFeatureTable&&(!this._layer?.isTable||this._hasFilterExpressions()),h=this._featuresEmpty(),n=this.featureSelectionMode==="single",r=this.enableCSV;if(this._relatedFeatureTable){let u=await this._queryRelatedFeatures();r=u&&Object.keys(u).length>0}let d=[];l&&d.push({active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this.toggleFilter.emit(),disabled:!1,toolTip:this._translations.filters}),a&&d.push({active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!e,toolTip:this._translations.zoom}),i&&d.push({active:!1,icon:"pencil",indicator:!1,label:this._translations.editMultiple,func:()=>this.editMultipleFeatures.emit(this._getSelectedIds()),disabled:s,toolTip:this._translations.editMultiple}),this._deleteEnabled&&d.push({active:!1,icon:"trash",indicator:!1,label:this._translations.delete,func:()=>this._showDelete(),disabled:!e,isDanger:!0,toolTip:this._translations.delete}),d.push({active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>{this.clearSelection()},disabled:!e,toolTip:this._translations.clearSelection}),this._relatedFeatureTable||d.push({active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!e,toolTip:this._showOnlySelected?this._translations.showAll:this._translations.showSelected}),!n&&!this._relatedFeatureTable&&d.push({active:!1,icon:"list-check-all",indicator:!1,func:async()=>await this._selectAll(),label:this._translations.selectAll,disabled:h,toolTip:this._translations.selectAll}),!n&&!this._relatedFeatureTable&&d.push({active:!1,icon:"compare",indicator:!1,func:async()=>await this._switchSelected(),label:this._translations.switchSelected,disabled:h,toolTip:this._translations.switchSelected}),d.push({active:!1,icon:"refresh",indicator:!1,func:()=>{this._refresh()},label:this._translations.refresh,disabled:!1,toolTip:this._translations.refresh}),r&&d.push({active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:h,toolTip:this._translations.exportCSV}),this._toolInfos=[...d]}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){let e=`${this._floorField} = '${this._floorLevel}'`,t=this._layer?.definitionExpression;this._layer&&(this._layer.definitionExpression=t&&this._floorExpression&&t?.indexOf(this._floorExpression)>-1?t.replace(this._floorExpression,e):t?`${t} AND (${e})`:e),this._floorExpression=e}}_featuresEmpty(){return this._allIds?.length===0}_hasFilterExpressions(){let e=[],t=this._layer?.id;return this.mapInfo?.filterConfig?.layerExpressions&&t!==void 0&&(e=this.mapInfo.filterConfig.layerExpressions.filter(i=>i.id===t)),e.length>0}_getAction(e,t,i,s,a,l,h,n){let r=this._layer===void 0?!0:l;return o`<calcite-action .active=${e} appearance=solid .disabled=${r} .icon=${t} .id=${`layer-table-${t}`} .indicator=${i} .label=${s} .loading=${h} @click=${a} text text-enabled><div class="display-flex"><span class="label-override padding-start-1-4">${s}</span></div></calcite-action>${this._getToolTip("auto",`layer-table-${t}`,n)}`}_showDelete(){this.showDelete.emit({ids:this._getIds()})}_getShare(e){return o`<div id=${this._getId(e)??_}><instant-apps-social-share class="height-51 width-51 display-flex" .embed=${this.shareIncludeEmbed} flip-rtl popover-button-icon-scale=s scale=m share-button-color=neutral share-button-type=action .socialMedia=${this.shareIncludeSocial} .view=${this.mapView} ${g(this._shareNode)}></instant-apps-social-share>${this._getToolTip("bottom",e,this._translations.share)}</div>`}_updateShareUrl(){let e=this._shareNode.value?.shareUrl;if(!e)return;let t=new URL(e);this.mapInfo?.id?t.searchParams.set("webmap",this.mapInfo.id):t.searchParams.delete("webmap"),this._layer?.id?t.searchParams.set("layer",this._layer.id):t.searchParams.delete("layer"),this.selectedIds?.length>0?t.searchParams.set("oid",this.selectedIds.reverse().join(",")):t.searchParams.delete("oid"),this.appLayout&&t.searchParams.set("applayout",this.appLayout),this.selectedRelatedIds?.length>0&&this._relatedFeatureTable?.layer?.id&&(t.searchParams.set("oid",this.selectedRelatedIds.join(",")),t.searchParams.set("layer",this._relatedFeatureTable?.layer?.id.toString())),this._shareNode.value&&(this._shareNode.value.autoUpdateShareUrl=!1,this._shareNode.value.shareUrl=t.href)}_getToolTip(e,t,i){return o`<calcite-tooltip .placement=${e} .referenceElement=${t}><span>${i}</span></calcite-tooltip>`}_getId(e){return`solutions-action-${e}`}_getDangerAction(e,t,i,s){let a=this._layer===void 0?!0:s;return o`<div class="display-flex" id=${this._getId(e)??_}>${o`<calcite-action appearance=solid .disabled=${a} .id=${`layer-table-${e}`} @click=${i} text><calcite-icon class="danger-icon-color" .icon=${e} scale=s></calcite-icon><span class="label-override padding-start-1-4 danger-label-color">${t}</span></calcite-action>`}${this._getToolTip("bottom",`layer-table-${e}`,t)}</div>`}_getIds(){let e=this._relatedFeatureTable??this._table;return this._relatedFeatureTable&&this._table&&this._table.highlightIds.getItemAt(0)!==this.selectedIds[0]&&(e=this._table),e?.highlightIds.map(t=>Number.parseInt(t.toString(),10)).toArray()??[]}onTableNodeCreate(e){this._tableNode=e}async _getTable(e,t){this._layer&&(await this._layer.when(()=>{this._table=new L({autoRefreshEnabled:this.enableAutoRefresh,autoSaveEnabled:this.enableTableAutosave,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,relatedRecordsEnabled:!0,attachmentsEnabled:!0,highlightEnabled:!1,multiSortEnabled:!1,visibleElements:{columnDescriptions:!1,header:!1,menu:!1,progress:!1},tableTemplate:{columnTemplates:t},container:e})}),await this._table?.when(()=>{this._table?.viewModel.addHandles(this._table.highlightIds.on("change",i=>{this._handleOnChange(i)})),this._table?.viewModel.addHandles(this._table.on("cell-pointerover",this.tempHighlightOnHover.bind(this))),this._table?.viewModel.addHandles(this._table.on("cell-pointerout",this._removeTempHighlight.bind(this))),this._table?.viewModel.addHandles(this._table.on("column-reorder",this._handleColumnReorder.bind(this))),this.listenOn(this._tableNode,"mouseleave",this._removeTempHighlight),this._table?.viewModel.addHandles(c.watch(()=>this._table.size,i=>{this._size=i})),c?.watch(()=>this._table?.relatedTable,async i=>{if(i){if(i.rowHighlightIds.length){let a={added:[i.rowHighlightIds.getItemAt(0)],removed:[]};this._handleOnChange(a)}let s=i.layer;if(this._layerEditHandle=s.on("edits",async()=>{await new Promise(a=>setTimeout(a,50)),await this._refresh(!0)}),this._checkEditEnabled(s),i.editingEnabled=this._editEnabled&&this.enableInlineEdit,i.autoSaveEnabled=this.enableTableAutosave,this._relatedFeatureTable=i,typeof i.layer?.id=="string"&&i.layer?.fields){let a=i.layer.popupTemplate?.fieldInfos,l=this._getColumnTemplates(i.layer.id,i.layer.fields,a);this._relatedFeatureTable.tableTemplate=new w({columnTemplates:l})}i.highlightIds.on("change",a=>{this._handleRelatedRecordsChange(a)})}else{this.selectedRelatedIds=[],this._relatedFeatureTable=void 0,this._layerEditHandle&&this._layerEditHandle.remove();let s=this._layer;this._refresh(),s&&this.relatedRecordToggled.emit(s),this._finishOnChange()}await this._initToolInfos()})}))}async _handleRelatedRecordsChange(e){await this._handleOnChange(e),this._updateShareUrl()}hasAttachmentsEnabled(e){if(!e?.capabilities)return!1;let{capabilities:{data:{supportsAttachment:t},operations:{supportsQueryAttachments:i}}}=e;return t&&i}async _handleOnChange(e){if(!await this._validateActiveEdits([...e.added],[...e.removed]))return;let t=[...this._getIds()],i=this._getSelectedLayer(t);this._relatedFeatureTable&&this._table?.highlightIds.getItemAt(0)!==this.selectedIds[0]&&(i=this._layer,await this._initToolInfos()),i&&this.relatedRecordToggled.emit(i),this.featureSelectionMode==="single"&&(this._relatedFeatureTable&&t.length>1?(this._relatedFeatureTable.highlightIds.remove(t[0]),t.shift()):t.length>1&&!this._selectAllActive&&(this._table?.highlightIds.remove(t[0]),t.shift())),!this._relatedFeatureTable||this._relatedFeatureTable&&this._table?.highlightIds.getItemAt(0)!==this.selectedIds[0]?(this.selectedRelatedIds=[],this.selectedIds=t.reverse(),this._tempSelectedIds=[...this.selectedIds],this._highlightFeatures(this.selectedIds[0])):this.selectedRelatedIds=t.reverse(),this._finishOnChange()}async _validateActiveEdits(e,t){let i=!0;if(this._editor&&!this._skipEditCheck){if(this._hasPendingEdits()){let s=!1;try{this._editor.viewModel.activeWorkflow&&await this._editor.viewModel.activeWorkflow.cancel({force:!1})}catch(a){s=a?.name==="workflow:cancel-denied"}if(s){let a=this._relatedFeatureTable&&this._relatedFeatureTable.highlightIds.length>0?this._relatedFeatureTable:this._table;i=!1,this._skipEditCheck=!0,e.length>0?a?.highlightIds.removeMany(e):t.length>0&&a?.highlightIds.addMany(t)}}}else i=!this._skipEditCheck,this._skipEditCheck=!1;return this._shouldUpdateTableOnExtentChange=i,i}_hasPendingEdits(){let e=this._editor?.viewModel?.hasPendingEdits,t=this._editor?.activeWorkflow?.activeWorkflow?.hasPendingEdits;return e||t}_finishOnChange(){this._showOnlySelected&&!this._relatedFeatureTable&&(this._table&&this._getSelectedIds().length>0?this._table.filterBySelectionEnabled=!0:this._toggleShowSelected());let e=this._getSelectedIds();setTimeout(()=>{this.featureSelectionChange.emit(e)},50)}_handleColumnReorder(){this.columnReorder.emit()}tempHighlightOnHover(e){if(this._removeTempHighlight(),this._selectedLayerView){let t=e.feature;this._temporaryFeatureHandle=this._selectedLayerView?.highlight([t],{name:"temporary"})}}_removeTempHighlight(){this._temporaryFeatureHandle&&this._temporaryFeatureHandle.remove()}_highlightFeatures(e){if(this._clearHighlights(),this.selectedIds.length>0&&this._selectedLayerView&&(this._currentFeatureHighlightHandle=this._selectedLayerView?.highlight([e],{name:"current-selection"}),this.selectedIds.length>1)){let t=this.selectedIds.filter(i=>i!==e);this._defaultFeaturesHandle=this._selectedLayerView?.highlight(t,{name:"default"})}}_clearHighlights(){this._removeTempHighlight(),this._currentFeatureHighlightHandle&&this._currentFeatureHighlightHandle.remove(),this._defaultFeaturesHandle&&this._defaultFeaturesHandle.remove()}_resetColumnTemplates(){if(this._layer){let e=this._layer.popupTemplate?.fieldInfos,t=this._getColumnTemplates(this._layer.id,this._layer.fields,e);t?.length===0?this._tableNode?.classList.add("display-none"):this._tableNode?.classList.remove("display-none");let i=this._table?.tableTemplate?.columnTemplates,s=i&&t&&i.length!==t.length||t?.some((a,l)=>i&&i[l]?JSON.stringify(i[l])!==JSON.stringify(a):!1);if(this._table&&t&&(s||!this._columnsInfo)){this._table.tableTemplate=new w({columnTemplates:t});let a=t.map(l=>l.fieldName);this._initColumnsInfo(a)}}}_setColumnTemplates(e){this._table&&e&&(this._table.tableTemplate=new w({columnTemplates:e}))}async _resetTable(){if(this._loaded=!1,this._clearSelection(),this._allIds=await this.queryAllIds(),!this._table&&this._layer){let e=this._layer.popupTemplate?.fieldInfos,t=this._getColumnTemplates(this._layer.id,this._layer.fields,e);this._tableNode&&await this._getTable(this._tableNode,t)}else this._table&&(this._table.view=this.mapView,this._table.layer=this._layer);await this._initLayerRefresh(),this._checkEditEnabled(this._layer),this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,this._table.autoSaveEnabled=this.enableTableAutosave,await this._table.when(),setTimeout(()=>{this._loaded||this.finishLoading()},1e3),await c.once(()=>this._table?.state==="loaded").then(async()=>{await this.finishLoading()}))}async finishLoading(){try{this._loaded=!0,this._table?.highlightIds.removeAll(),this._table.objectIds.removeAll(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),await this._initToolInfos(),["esri-feature-table","esri-widget"].forEach(e=>{this._tableNode&&!this._tableNode.classList.contains(e)&&this._tableNode.classList.add(e)})}catch(e){console.log(e)}}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._layer&&(this._refreshHandle=this._layer.on("refresh",e=>{e.dataChanged&&this._updateAllIds()}))}async _updateAllIds(){let e=await this.queryAllIds(),t=this.selectedIds.filter(i=>this._allIds.indexOf(i)>-1);(JSON.stringify(e)!==JSON.stringify(this._allIds)||JSON.stringify(this.selectedIds)!==JSON.stringify(t))&&(this._allIds=e,this.selectedIds=t,await this._refresh())}async _handleDefaults(){if(!this._defaultOidHonored&&this.defaultOid?.length>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=[],this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&this.defaultGlobalId&&this.defaultGlobalId?.length>0&&this._table&&this._layer){let e=await O(this.defaultGlobalId,this._layer),t=e?.length>0?e.map(i=>Number(i.getObjectId())):void 0;t&&await this._selectDefaultFeature(t),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=[],this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(e){let t=this._table?.columns.reduce((s,a)=>((!e||e?.indexOf(a.name)>-1)&&(s[a.name]=!a.hidden),s),{}),i=this._table?.columns.map(s=>s.name);(e&&i?e.filter(s=>i.indexOf(s)<0):[]).forEach(s=>{t[s]=!0}),this._columnsInfo=e?e.reduce((s,a)=>(s[a]=t[a],s),{}):t}async _selectDefaultFeature(e){e.length>0&&this._table?.highlightIds.addMany(e)}_checkEditEnabled(e){this._editEnabled=!!(e?.editingEnabled&&e?.capabilities?.operations.supportsUpdate),this._deleteEnabled=!!(e?.editingEnabled&&e?.capabilities?.operations.supportsDelete)}async _sortTable(){let e=this._layer?.objectIdField,t="desc",i,s=this.mapInfo?.layerOptions?.layers,a=this._layer?.id;s&&s.length>0&&a!==void 0&&(i=s.filter(l=>l.id===a),i&&i.length>0&&(i=i[0],i.sortField&&i.fields?.includes(i.sortField)&&(e=i.sortField),t=i?.sortOrder?i.sortOrder:"desc")),this._table&&this._layer&&(await this._table.when(),await this._layer.when(()=>{e&&this._table?.sortColumn(e,t)}))}async _handleFilterListReset(){this._filterActive=!1,this._updateShareUrl(),await this._searchFullText()}async _handleFilterUpdate(e){if(this._floorExpression&&this._layer){let t=this._layer.definitionExpression,i=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=t&&this._floorField&&t.indexOf(`${this._floorField} = '`)>-1?t.replace(i,this._floorExpression):t?`${t} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=e,this._updateShareUrl(),await this._searchFullText()}_handleTableOnMapExtent(){this._table&&(this._filterByExtentHandle=c.when(()=>this.mapView?.stationary,async()=>{if(this._shouldUpdateTableOnExtentChange&&this.appLayout==="splitView"){if(await new Promise(e=>setTimeout(e,800)),this._table&&this.mapView){this._table.filterGeometry=this.mapView.extent;let e={geometry:this.mapView.extent},t=this._layer&&await this._layer.queryObjectIds(e),i=this.selectedIds.filter(a=>!t?.includes(a)),s=this._outOFExtentOids.filter(a=>t?.includes(a));i.length>0&&(this._table&&this._table?.viewModel?.attachmentsViewOptions?.objectId&&this._table.viewModel.hideAttachmentsView(),this._table.highlightIds.removeMany(i),this._outOFExtentOids=[...this._outOFExtentOids,...i]),s.length>0&&(this.selectedIds=[...new Set([...this.selectedIds,...s])],this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(this.selectedIds.reverse()),this._outOFExtentOids=this._outOFExtentOids.filter(a=>!s.includes(a)))}this._allIds=await this.queryAllIds()}},{initial:!0}))}async _closeFilter(){this._allIds=await this.queryAllIds()}async queryAllIds(){if(this._layer){let e=this._layer.createQuery();return e.geometry=this._filterByExtentHandle&&this.mapView?this.mapView.extent:null,e.where=this._layer.definitionExpression||"1=1",await this._layer.queryObjectIds(e)}else return[]}async _mapClicked(e){let t={include:this._layer},i=await this.mapView?.hitTest(e.screenPoint,t);if(i&&i.results.length>0){let s=i.results;if(this.featureSelectionMode==="single"){this._table?.highlightIds.removeAll();let a=s[0].graphic.getObjectId();if(a){let l=this._table?.highlightIds.indexOf(a);l!==void 0&&l<0&&this._table?.highlightIds.add(a)}}else s.forEach(a=>{let l=Number(a.graphic.getObjectId()),h=this._table?.highlightIds.indexOf(l);h&&h<0&&l&&this._table?.highlightIds.add(l)});this._showOnlySelected&&this._table&&(this._table.filterBySelectionEnabled=!0)}else await this.clearSelection()}async _selectAll(){let e=this._allIds,t=e.filter(i=>this.selectedIds.indexOf(i)<0);await this._validateActiveEdits(t,this.selectedIds)&&this._table?(this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(e),this.selectedIds=e,this._finishOnChange(),this._selectAllActive=!0):this._skipEditCheck=!1}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._table&&(this._table.filterBySelectionEnabled=this._showOnlySelected)}_clearSelection(){this._relatedFeatureTable||(this.selectedIds=[],this._outOFExtentOids=[],this._table&&this._table?.viewModel?.attachmentsViewOptions?.objectId&&this._table.viewModel.hideAttachmentsView(),this._table?.highlightIds.removeAll(),this._clearHighlights(),this._table?.rowHighlightIds.removeAll()),this._relatedFeatureTable&&(this._relatedFeatureTable?.highlightIds.removeAll(),this.selectedRelatedIds=[]),this._finishOnChange()}async _switchSelected(){let e=[...this.selectedIds],t=this._allIds.reduce((i,s)=>(e.indexOf(s)<0&&i.push(s),i),[]).sort((i,s)=>i-s);await this._validateActiveEdits(t,e)&&this._table?(this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange()):this._skipEditCheck=!1}async _exportToCSV(){let e=this._relatedFeatureTable?this._relatedFeatureTable.layer:this._layer;if(!e)return;let t={},i=this._getIds();if(this._relatedFeatureTable?.tableParent&&this._relatedFeatureTable.highlightIds.length===0){let l=this._relatedFeatureTable.tableParent.highlightIds?.getItemAt(0);if(l!==void 0){let h=await this._queryRelatedFeatures(),n=[];h&&h[l]?.features&&(h[l].features.forEach(r=>{r.attributes&&n.push(r.attributes[e.objectIdField])}),i=n.length>0?n:[])}}t[e.id]={selectionSetNames:[e.title||""],ids:i,layer:e};let s=this._relatedFeatureTable??this._table;if(!s)return;let a=s&&s.columns.toArray().reduce((l,h)=>{if(!h.hidden){let n=h?.name||h?.fieldName;n&&l.push(n.toLocaleLowerCase())}return l},[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,this.mapView?.map&&await $(this.mapView.map,t,!1,!1,!0,a,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}async _queryRelatedFeatures(){let e=this._relatedFeatureTable?this._relatedFeatureTable?this._relatedFeatureTable.layer:this._relatedFeatureTable.tableParent?.layer:this._layer,t=this._relatedFeatureTable?.tableParent?.highlightIds?.items[0],i=this._relatedFeatureTable?.tableParent?.layer,s=e?.relationships?.find(l=>i.relationships?.some(h=>h.id===l.id)),a=new M({objectIds:[t],outFields:["*"],relationshipId:s?.id});return t&&a&&await i.queryRelatedFeatures(a).catch(async l=>{console.error(l)})}_updateToolInfoLoading(e,t){this._toolInfos.some(i=>i?.icon===e?(i.loading=t,!0):!1)}async _refresh(e){if(await this._validateActiveEdits([],this.selectedIds)){this._table&&await this._table.refresh(),this._relatedFeatureTable&&await this._relatedFeatureTable.refresh(),this._allIds=await this.queryAllIds();let t=this._getSelectedLayer(this.selectedRelatedIds);if(t&&this.relatedRecordToggled.emit(t),!e){let i=this._getSelectedIds();this.featureSelectionChange.emit(i)}}}_getSelectedIds(){let e;return this._relatedFeatureTable?this.selectedRelatedIds.length>0?e=this.selectedRelatedIds:e=this._relatedFeatureTable.tableParent?.highlightIds.toArray()??[]:e=this.selectedIds,e}_getSelectedLayer(e){let t;return this._relatedFeatureTable?e.length>0?t=this._relatedFeatureTable.layer:t=this._relatedFeatureTable.tableParent?.layer:t=this._layer,t}async _clearSearchText(){if(this._searchNode.value){this._searchNode.value.value="";let e={target:{value:""}};await this._searchTextChanged(e)}}async _zoom(){this._layer&&this.mapView&&await y(this.selectedIds,this._selectedLayerView,this.mapView,!0,void 0,this.zoomToScale)}async _layerSelectionChanged(e){let t=e.detail[0];if(t!==this._layer?.id||this._featuresEmpty()){this._fetchingData=!0,await this._clearSearchText();let i=this.mapView&&await A(this.mapView,t);i&&await i.when(async()=>{this._selectedLayerView=!i.isTable&&this.mapView?await C(this.mapView,i.id):null,this._table&&this._table?.viewModel?.attachmentsViewOptions?.objectId&&this._table.viewModel.hideAttachmentsView(),this._shouldUpdateTableOnExtentChange=!0,this._layer=i,await this._initToolInfos(),this._getFullTextSearchInfo()})}this._creatingFeature=!1,this._fetchingData=!1}_getColumnTemplates(e,t,i){let s=this._getLayerOption(e),a=this._layer?.attributeTableTemplate?.elements,l=[];a?.length>0&&this.honorMapFieldSettings&&(l=a.map(r=>r.fieldName));let h=s?.fields&&s?.fieldOrder?s.fieldOrder.filter(r=>s?.fields&&s.fields.indexOf(r)>-1):l.length>0?l:void 0,n;return t&&(n=t.reduce((r,d)=>{let u={type:"field",fieldName:d.name,label:this.getFieldLabel(d,i),menuConfig:this._getMenuConfig(d.name)};return s&&s.fields&&s?.fields?.length>0?s.fields.indexOf(d.name)>-1&&r.push(u):l.length>0?l.indexOf(d.name)>-1&&r.push(u):r.push(u),r},[])),n?h?n?.sort(this._sortFields.bind(this,h)):n:[]}updateRelatedAttachmentColumns(){let e=this._getLayerOption(this._layer?.id||""),t=this.hasAttachmentsEnabled(this._layer),i=!0,s="attachments",a=(e?.extraFields||[]).reduce((h,n)=>(n.startsWith("related:")?h.related.push(n.split("related:")[1]):h.extra.push(n),h),{related:[],extra:[]}),l=a.extra.some(h=>h.toLowerCase()===s);a&&(t=l&&t,i=a.related.length>0,this._table?.columns.forEach(h=>{h.fieldName.startsWith("EsriFeatureTableRelationshipColumn")&&(h.hidden=!a.related.includes(h.effectiveLabel)),h.fieldName.startsWith("EsriFeatureTableAttachmentsColumn")&&(h.hidden=!a.extra.some(n=>n.toLowerCase()===h.effectiveLabel.toLowerCase()))})),this._table.relatedRecordsEnabled=i,this._table.attachmentsEnabled=t}getFieldLabel(e,t){let i=e.alias?e.alias:e.name;return t?.some(s=>s.fieldName===e.name?(i=s.label,!0):!1),i||e.name}_sortFields(e,t,i){return e?.indexOf(t.fieldName)-e.indexOf(i.fieldName)}_getMenuConfig(e){return{items:[{label:this._translations.hideField,icon:"view-hide",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(e)}}]}}_handleHideClick(e){this._columnsInfo&&this._table&&(this._columnsInfo[e]=!1,this._table.hideColumn(e),this._table.tableTemplate&&this._table.tableTemplate.columnTemplates.forEach(t=>{t.fieldName===e&&(t.visible=!1)}))}};E("layer-table",I);return I},"widgets/FeatureTable","core/reactiveUtils","rest/support/RelationshipQuery","widgets/FeatureTable/support/TableTemplate",a,c,d,e)