// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built require({cache:{"esri/widgets/Feature/FeatureAttachments":function(){define("../../chunks/tslib.es6 ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../Attachments ../Widget ./FeatureAttachments/FeatureAttachmentsViewModel ./support/FeatureElementInfo ../support/widgetUtils ../support/jsxFactory".split(" "),function(c,p,h,C,H,G,F,M,Q,A,y,b,k){C=class extends Q{constructor(e, f){super(e,f);this._featureElementInfo=null;this.attachmentsWidget=new M;this.headingLevel=2;this.viewModel=new A}initialize(){this._featureElementInfo=new y;this.addHandles([p.watch(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),p.initial),p.watch(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,p.initial)])}destroy(){this.attachmentsWidget.viewModel=null;this.attachmentsWidget.destroy();this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description= e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const {attachmentsWidget:e}=this;return k.tsx("div",{class:"esri-feature-attachments"},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const {description:e,title:f,headingLevel:l}=this;this._featureElementInfo?.set({description:e, title:f,headingLevel:l})}};c.__decorate([h.property({readOnly:!0})],C.prototype,"attachmentsWidget",void 0);c.__decorate([h.property()],C.prototype,"description",null);c.__decorate([h.property()],C.prototype,"displayType",null);c.__decorate([h.property()],C.prototype,"graphic",null);c.__decorate([h.property()],C.prototype,"headingLevel",void 0);c.__decorate([h.property()],C.prototype,"title",null);c.__decorate([h.property({type:A})],C.prototype,"viewModel",void 0);return C=c.__decorate([F.subclass("esri.widgets.Feature.FeatureAttachments")], C)})},"esri/widgets/Attachments":function(){define("require ../chunks/tslib.es6 ../core/Error ../core/reactiveUtils ../core/unitFormatUtils ../core/accessorSupport/decorators/property ../core/accessorSupport/decorators/cast ../core/RandomLCG ../core/has ../core/accessorSupport/decorators/subclass ./Widget ./Attachments/AttachmentsViewModel ./Attachments/support/attachmentUtils ../chunks/componentsUtils ./support/globalCss ./support/legacyIcon ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b,k,e,f,l,m,v,r){const u={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},K=window.CSS;M=class extends y{constructor(d,n){super(d,n);this.displayType="auto";this.selectedFile=this.messagesUnits=this.messages=null;this.submitting=!1;this.viewModel=null;this.visibleElements={...u};this._supportsImageOrientation=K&&K.supports&&K.supports("image-orientation","from-image");this._updateAttachmentForm= this._addAttachmentForm=null}normalizeCtorArgs(d){d?.viewModel||(d={viewModel:new b,...d});return d}initialize(){this.addHandles([C.on(()=>this.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),C.on(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),C.watch(()=>this.viewModel?.mode,()=>this._modeChanged(),C.initial)])}loadDependencies(){return e.loadCalciteComponents({icon:()=>new Promise((d,n)=>c(["../chunks/calcite-icon"],d,n))})}get capabilities(){return this.viewModel.capabilities}set capabilities(d){this.viewModel.capabilities= d}get effectiveDisplayType(){const {displayType:d}=this;return d&&"auto"!==d?d:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(d){this.viewModel.graphic=d}get icon(){return"attachment"}set icon(d){this._overrideIfSome("icon",d)}get label(){return this.messages?.widgetLabel??""}set label(d){this._overrideIfSome("label",d)}castVisibleElements(d){return{...u,...d}}addAttachment(){const {_addAttachmentForm:d,viewModel:n}=this;this._set("submitting", !0);this._set("error",null);return n.addAttachment(d).then(a=>{this._set("submitting",!1);this._set("error",null);n.mode="view";return a}).catch(a=>{this._set("submitting",!1);this._set("error",new h("attachments:add-attachment",this.messages.addErrorMessage,a));throw a;})}deleteAttachment(d){const {viewModel:n}=this;this._set("submitting",!0);this._set("error",null);return n.deleteAttachment(d).then(a=>{this._set("submitting",!1);this._set("error",null);n.mode="view";return a}).catch(a=>{this._set("submitting", !1);this._set("error",new h("attachments:delete-attachment",this.messages.deleteErrorMessage,a));throw a;})}updateAttachment(){const {viewModel:d}=this,{_updateAttachmentForm:n}=this;this._set("submitting",!0);this._set("error",null);return d.updateAttachment(n).then(a=>{this._set("submitting",!1);this._set("error",null);d.mode="view";return a}).catch(a=>{this._set("submitting",!1);this._set("error",new h("attachments:update-attachment",this.messages.updateErrorMessage,a));throw a;})}addFile(){const d= this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);this.viewModel.mode="view";return d}updateFile(){const {viewModel:d}=this,n=d.updateFile(this.selectedFile,this._updateAttachmentForm,d.activeFileInfo);d.mode="view";return n}deleteFile(d){d=this.viewModel.deleteFile(d||this.viewModel.activeFileInfo?.file);this.viewModel.mode="view";return d}render(){const {submitting:d,viewModel:n}=this,{state:a}=n;return r.tsx("div",{class:this.classes("esri-attachments",f.globalCss.widget)},d?this._renderProgressBar(): null,"loading"===a?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const {error:d,visibleElements:n}=this;return d&&n.errorMessage?r.tsx("div",{class:"esri-attachments__error-message",key:"error-message"},d.message):null}_renderAttachments(){const {activeFileInfo:d,mode:n,activeAttachmentInfo:a}=this.viewModel;return"add"===n?this._renderAddForm():"edit"===n?this._renderDetailsForm(a||d):this._renderAttachmentContainer()}_renderLoading(){return r.tsx("div", {class:"esri-attachments__loader-container",key:"loader"},r.tsx("div",{class:"esri-attachments__loader"}))}_renderProgressBar(){return this.visibleElements.progressBar?r.tsx("div",{class:"esri-attachments__progress-bar",key:"progress-bar"}):null}_renderAddForm(){const {submitting:d,selectedFile:n}=this;var a=d||!n,g=this.visibleElements.cancelAddButton?r.tsx("button",{bind:this,class:this.classes(f.globalCss.button,f.globalCss.buttonTertiary,f.globalCss.buttonSmall,f.globalCss.buttonHalf,d&&f.globalCss.buttonDisabled), disabled:d,onclick:this._cancelForm,type:"button"},this.messages.cancel):null;a=this.visibleElements.addSubmitButton?r.tsx("button",{class:this.classes(f.globalCss.button,f.globalCss.buttonSecondary,f.globalCss.buttonSmall,f.globalCss.buttonHalf,{[f.globalCss.buttonDisabled]:a}),disabled:a,type:"submit"},this.messages.add):null;const w=n?r.tsx("span",{class:"esri-attachments__file-name",key:"file-name"},n.name):null;g=r.tsx("form",{afterCreate:m.storeNode,afterRemoved:m.discardNode,bind:this,"data-node-ref":"_addAttachmentForm", onsubmit:this._submitAddAttachment},r.tsx("fieldset",{class:"esri-attachments__file-fieldset"},w,r.tsx("label",{class:this.classes("esri-attachments__file-label",f.globalCss.button,f.globalCss.buttonSecondary)},n?this.messages.changeFile:this.messages.selectFile,r.tsx("input",{bind:this,class:"esri-attachments__file-input",name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),a,g);return r.tsx("div",{class:"esri-attachments__form-node",key:"add-form-container"},g)}_renderDetailsForm(d){const {visibleElements:n, viewModel:a,selectedFile:g,submitting:w}=this;var {capabilities:D}=a,I=w||!g;let z;if(g){var q=g.type;z=g.name;var B=g.size}else if(d&&"file"in d)q=d.file.type,z=d.file.name,B=d.file.size;else if(d&&"contentType"in d){q=d.contentType;z=d.name;B=d.size;var J=d.url}var L=D.editing&&D.operations?.delete&&n.deleteButton?r.tsx("button",{bind:this,class:this.classes(f.globalCss.button,f.globalCss.buttonSmall,f.globalCss.buttonTertiary,"esri-attachments__delete-button",{[f.globalCss.buttonDisabled]:w}), disabled:w,key:"delete-button",onclick:T=>this._submitDeleteAttachment(T,d),type:"button"},this.messages.delete):void 0;I=D.editing&&D.operations?.update&&n.updateButton?r.tsx("button",{class:this.classes(f.globalCss.button,f.globalCss.buttonSmall,f.globalCss.buttonThird,{[f.globalCss.buttonDisabled]:I}),disabled:I,key:"update-button",type:"submit"},this.messages.update):void 0;const O=this.visibleElements.cancelUpdateButton?r.tsx("button",{bind:this,class:this.classes(f.globalCss.button,f.globalCss.buttonSmall, f.globalCss.buttonTertiary,f.globalCss.buttonThird,{[f.globalCss.buttonDisabled]:w}),disabled:w,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0;D=D.editing&&D.operations?.update?r.tsx("fieldset",{class:"esri-attachments__file-fieldset",key:"file"},r.tsx("span",{class:"esri-attachments__file-name",key:"file-name"},z),r.tsx("label",{class:this.classes("esri-attachments__file-label",f.globalCss.button,f.globalCss.buttonSecondary)},this.messages.changeFile,r.tsx("input", {bind:this,class:"esri-attachments__file-input",name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0;B=r.tsx("fieldset",{class:"esri-attachments__metadata-fieldset",key:"size"},r.tsx("label",null,H.formatFileSize(this.messagesUnits,B??0)));q=r.tsx("fieldset",{class:"esri-attachments__metadata-fieldset",key:"content-type"},r.tsx("label",null,q));J=null!=J?r.tsx("a",{class:"esri-attachments__item-link",href:J,rel:"noreferrer",target:"_blank"},this._renderImageMask(d,400),r.tsx("div", {class:"esri-attachments__item-link-overlay"},r.tsx("span",{class:"esri-attachments__item-link-overlay-icon"},r.tsx("calcite-icon",{icon:"launch"})))):this._renderImageMask(d,400);L=r.tsx("form",{afterCreate:m.storeNode,afterRemoved:m.discardNode,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:T=>this._submitUpdateAttachment(T,d)},r.tsx("div",{class:"esri-attachments__metadata"},B,q),D,r.tsx("div",{class:"esri-attachments__actions"},L,O,I));return r.tsx("div",{class:"esri-attachments__form-node", key:"edit-form-container"},J,L)}_renderImageMask(d,n){return d?"file"in d?this._renderGenericImageMask(d.file.name,d.file.type):this._renderImageMaskForAttachment(d,n):null}_renderGenericImageMask(d,n){var {supportsResizeAttachments:a}=this.viewModel;n=k.getIconPath(n);a={["esri-attachments__image--resizable"]:a};return r.tsx("div",{class:this.classes("esri-attachments__item-mask--icon","esri-attachments__item-mask"),key:n},r.tsx("img",{alt:d,class:this.classes(a,"esri-attachments__image"),src:n, title:d}))}_renderImageMaskForAttachment(d,n){var {supportsResizeAttachments:a}=this.viewModel;if(!d)return null;const {contentType:g,name:w,url:D}=d;if(!a||!k.isSupportedImage(g))return this._renderGenericImageMask(w,g);d=(d=this._getCSSTransform(d))?{transform:d,"image-orientation":"none"}:{};n=`${D}${D?.includes("?")?"\x26":"?"}w=${n}`;a={["esri-attachments__image--resizable"]:a};return r.tsx("div",{class:this.classes("esri-attachments__item-mask"),key:n},r.tsx("img",{alt:w,class:this.classes(a, "esri-attachments__image"),src:n,styles:d,title:w}))}_renderFile(d){const {file:n}=d;return r.tsx("li",{class:"esri-attachments__item",key:n},r.tsx("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:"esri-attachments__item-button",key:"details-button",onclick:()=>this._startEditFile(d),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(d),r.tsx("label",{class:"esri-attachments__label"},r.tsx("span",{class:"esri-attachments__filename"},n.name||this.messages.noTitle), r.tsx("span",{"aria-hidden":"true",class:this.classes("esri-attachments__item-chevron-icon",m.isRTL(this.container)?l.legacyIcon.left:l.legacyIcon.right)}))))}_renderAttachmentInfo({attachmentInfo:d,displayType:n}){const {viewModel:a,effectiveDisplayType:g}=this,{capabilities:w,supportsResizeAttachments:D}=a,{contentType:I,name:z,url:q}=d;n=this._renderImageMask(d,"list"===n?48:400);var B=w.editing?r.tsx("span",{"aria-hidden":"true",class:this.classes("esri-attachments__item-chevron-icon",m.isRTL(this.container)? l.legacyIcon.left:l.legacyIcon.right)}):null;B="preview"===g&&D&&k.isSupportedImage(I)?null:r.tsx("label",{class:"esri-attachments__label"},r.tsx("span",{class:"esri-attachments__filename"},z||this.messages.noTitle),B);n=[n,B];n=w.editing?r.tsx("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:"esri-attachments__item-button","data-attachment-info-id":d.id,key:"details-button",onclick:()=>this._startEditAttachment(d),title:this.messages.attachmentDetails,type:"button"},n):r.tsx("a", {class:"esri-attachments__item-button",href:q??void 0,key:"details-link",rel:"noreferrer",target:"_blank"},n);return r.tsx("li",{class:"esri-attachments__item",key:d},n)}_renderAttachmentContainer(){const {effectiveDisplayType:d,viewModel:n,visibleElements:a}=this,{attachmentInfos:g,capabilities:w,fileInfos:D}=n;var I=!!g?.length;const z=!!D?.length,q={["esri-attachments__container--list"]:"preview"!==d,["esri-attachments__container--preview"]:"preview"===d},B=w.editing&&w.operations?.add&&a.addButton? r.tsx("button",{bind:this,class:this.classes(f.globalCss.button,f.globalCss.buttonTertiary,"esri-attachments__add-attachment-button"),onclick:()=>this._startAddAttachment(),type:"button"},r.tsx("span",{"aria-hidden":"true",class:this.classes("esri-attachments__item-add-icon",l.legacyIcon.plus)}),this.messages.add):void 0,J=I?r.tsx("ul",{class:"esri-attachments__items",key:"attachments-list"},g.toArray().map(O=>this._renderAttachmentInfo({attachmentInfo:O,displayType:d}))):void 0,L=z?r.tsx("ul",{class:"esri-attachments__items", key:"file-list"},D.toArray().map(O=>this._renderFile(O))):void 0;I=z||I?void 0:r.tsx("div",{class:f.globalCss.empty},this.messages.noAttachments);return r.tsx("div",{class:this.classes("esri-attachments__container",q),key:"attachments-container"},J,L,I,B)}_modeChanged(){this._set("error",null);this._set("selectedFile",null)}_handleFileInputChange(d){d=d.target.files?.item(0);this._set("selectedFile",d)}_submitDeleteAttachment(d,n){d.preventDefault();n&&("file"in n?this.deleteFile(n.file):n&&this.deleteAttachment(n))}_submitAddAttachment(d){d.preventDefault(); this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(d,n){d.preventDefault();n&&"file"in n?this.updateFile():this.updateAttachment()}_startEditAttachment(d){const {viewModel:n}=this;n.activeFileInfo=null;n.activeAttachmentInfo=d;n.mode="edit"}_startEditFile(d){const {viewModel:n}=this;n.activeAttachmentInfo=null;n.activeFileInfo=d;n.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(d){d.preventDefault();this.viewModel.mode="view"}_getCSSTransform(d){({orientationInfo:d}= d);return!this._supportsImageOrientation&&d?[d.rotation?`rotate(${d.rotation}deg)`:"",d.mirrored?"scaleX(-1)":""].join(" "):""}};p.__decorate([G.property()],M.prototype,"capabilities",null);p.__decorate([G.property()],M.prototype,"displayType",void 0);p.__decorate([G.property({readOnly:!0})],M.prototype,"effectiveDisplayType",null);p.__decorate([G.property()],M.prototype,"graphic",null);p.__decorate([G.property()],M.prototype,"icon",null);p.__decorate([G.property()],M.prototype,"label",null);p.__decorate([G.property(), v.messageBundle("esri/widgets/Attachments/t9n/Attachments")],M.prototype,"messages",void 0);p.__decorate([G.property(),v.messageBundle("esri/core/t9n/Units")],M.prototype,"messagesUnits",void 0);p.__decorate([G.property({readOnly:!0})],M.prototype,"selectedFile",void 0);p.__decorate([G.property({readOnly:!0})],M.prototype,"submitting",void 0);p.__decorate([G.property({readOnly:!0})],M.prototype,"error",void 0);p.__decorate([G.property({type:b})],M.prototype,"viewModel",void 0);p.__decorate([G.property()], M.prototype,"visibleElements",void 0);p.__decorate([F.cast("visibleElements")],M.prototype,"castVisibleElements",null);return M=p.__decorate([A.subclass("esri.widgets.Attachments")],M)})},"esri/core/unitFormatUtils":function(){define("exports ./ByteSizeUnit ./Cyclical ./mathUtils ./quantityUtils ./string ./unitUtils ../intl/number".split(" "),function(c,p,h,C,H,G,F,M){function Q(f,l,m){return f.units[l][m]}function A(f,l,m,v=2,r="abbr"){return`${M.formatNumber(l,{minimumFractionDigits:v,maximumFractionDigits:v, signDisplay:0p.convertUnit(f.value,f.unit,e.unit)?e:f};c.min=function(e,f){return null==e?f:null==f?e:e.valuethis.graphic,()=>this._graphicChanged(),G.initial))}destroy(){this.graphic=this._attachmentLayer= null}castCapabilities(m){return{...f,...m}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){var {graphic:m}=this;if(!m)return!1;m=m.layer||m.sourceLayer;return m?.loaded&&"capabilities"in m&&m.capabilities&&"operations"in m.capabilities&&"supportsResizeAttachments"in m.capabilities.operations&&m.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const {_attachmentLayer:m,attachmentInfos:v}=this;if(!m|| "function"!==typeof m.queryAttachments)throw new H("invalid-layer","getAttachments(): A valid layer is required.");const r=this._getObjectId();var u=new k({objectIds:[r],returnMetadata:!0});const K=[];this._getAttachmentsPromise=u=m.queryAttachments(u).then(d=>d[r]||K).catch(()=>K);this.notifyChange("state");u=await u;v.destroyAll();u.length&&v.addMany(u);this._getAttachmentsPromise=null;this.notifyChange("state");return u}async addAttachment(m,v=this.graphic){const {_attachmentLayer:r,attachmentInfos:u, capabilities:K}=this;if(!v)throw new H("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:v});if(!m)throw new H("invalid-attachment","addAttachment(): An attachment is required.",{attachment:m});if(!K.operations?.add)throw new H("invalid-capabilities","addAttachment(): add capabilities are required.");if(!r||"function"!==typeof r.addAttachment)throw new H("invalid-layer","addAttachment(): A valid layer is required.");m=await r.addAttachment(v,m).then(d=>this._queryAttachment(d.objectId, v));u.add(m);return m}async deleteAttachment(m){const {_attachmentLayer:v,attachmentInfos:r,graphic:u,capabilities:K}=this;if(!m)throw new H("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:m});if(!K.operations?.delete)throw new H("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!v||"function"!==typeof v.deleteAttachments)throw new H("invalid-layer","deleteAttachment(): A valid layer is required.");if(!u)throw new H("invalid-graphic", "deleteAttachment(): A graphic is required.");const d=await v.deleteAttachments(u,[m.id]).then(()=>m);r.remove(d);d.destroy();return d}async updateAttachment(m,v=this.activeAttachmentInfo){const {_attachmentLayer:r,attachmentInfos:u,graphic:K,capabilities:d}=this;if(!m)throw new H("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:m});if(!v)throw new H("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:v});if(!d.operations?.update)throw new H("invalid-capabilities", "updateAttachment(): Update capabilities are required.");const n=u.indexOf(v);if(!r||"function"!==typeof r.updateAttachment)throw new H("invalid-layer","updateAttachment(): A valid layer is required.");if(!K)throw new H("invalid-graphic","updateAttachment(): A graphic is required.");m=await r.updateAttachment(K,v.id,m).then(a=>this._queryAttachment(a.objectId));u.splice(n,1,m);return m}async commitFiles(){await Promise.all(this.fileInfos.items.map(m=>this.addAttachment(m.form)));this.fileInfos.removeAll(); return this.getAttachments()}addFile(m,v){if(!m||!v)return null;m={file:m,form:v};this.fileInfos.add(m);return m}updateFile(m,v,r=this.activeFileInfo){if(!m||!v||!r)return null;r=this.fileInfos.indexOf(r);-1r.file===m);return v?(this.fileInfos.remove(v),v):null}async _queryAttachment(m,v){const {_attachmentLayer:r}=this;if(!m||!r?.queryAttachments)throw new H("invalid-attachment-id", "Could not query attachment.");const u=this._getObjectId(v);m=new k({objectIds:[u],attachmentsWhere:`AttachmentId=${m}`,returnMetadata:!0});return r.queryAttachments(m).then(K=>K[u][0])}_getObjectId(m=this.graphic){return m?.getObjectId()??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>{}))}_setAttachmentLayer(){var {graphic:m}=this;this._attachmentLayer=(m=e.getSourceLayer(m))?"scene"===m.type&&null!=m.associatedLayer?m.associatedLayer:m:null}};c.__decorate([F.property()], h.prototype,"capabilities",void 0);c.__decorate([M.cast("capabilities")],h.prototype,"castCapabilities",null);c.__decorate([F.property()],h.prototype,"activeAttachmentInfo",void 0);c.__decorate([F.property()],h.prototype,"activeFileInfo",void 0);c.__decorate([F.property({readOnly:!0,type:l})],h.prototype,"attachmentInfos",void 0);c.__decorate([F.property()],h.prototype,"fileInfos",void 0);c.__decorate([F.property({type:p})],h.prototype,"graphic",void 0);c.__decorate([F.property()],h.prototype,"mode", void 0);c.__decorate([F.property({readOnly:!0})],h.prototype,"state",null);c.__decorate([F.property()],h.prototype,"filesEnabled",void 0);c.__decorate([F.property({readOnly:!0})],h.prototype,"supportsResizeAttachments",null);return h=c.__decorate([y.subclass("esri.widgets.Attachments.AttachmentsViewModel")],h)})},"esri/rest/query/support/AttachmentInfo":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/ensureType ../../../core/RandomLCG ../../../core/has ../../../core/accessorSupport/decorators/subclass ../../../layers/support/exifUtils".split(" "), function(c,p,h,C,H,G,F,M){var Q;const A={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};p=Q=class extends p.JSONSupport{constructor(y){super(y);this.url=this.size=this.parentObjectId=this.parentGlobalId=this.name=this.keywords=this.globalId=this.id=this.exifInfo=this.contentType=null}get orientationInfo(){var {exifInfo:y}= this;y=M.getExifValue({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:y});return A[y]||null}clone(){return new Q({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};c.__decorate([h.property({type:String})],p.prototype,"contentType",void 0);c.__decorate([h.property()],p.prototype,"exifInfo",void 0);c.__decorate([h.property({readOnly:!0})], p.prototype,"orientationInfo",null);c.__decorate([h.property({type:C.Integer})],p.prototype,"id",void 0);c.__decorate([h.property({type:String})],p.prototype,"globalId",void 0);c.__decorate([h.property({type:String})],p.prototype,"keywords",void 0);c.__decorate([h.property({type:String})],p.prototype,"name",void 0);c.__decorate([h.property({json:{read:!1}})],p.prototype,"parentGlobalId",void 0);c.__decorate([h.property({json:{read:!1}})],p.prototype,"parentObjectId",void 0);c.__decorate([h.property({type:C.Integer})], p.prototype,"size",void 0);c.__decorate([h.property({json:{read:!1}})],p.prototype,"url",void 0);return p=Q=c.__decorate([F.subclass("esri.rest.query.support.AttachmentInfo")],p)})},"esri/layers/support/exifUtils":function(){define(["exports"],function(c){function p(h){const {tagName:C,tags:H}=h;return H&&C?H.find(G=>G.name===C)?.value||null:null}c.getExifValue=function(h){const {exifInfo:C,exifName:H,tagName:G}=h;return C&&H&&G?(h=C.find(F=>F.name===H))?p({tagName:G,tags:h.tags}):null:null};Object.defineProperty(c, Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Feature/support/featureUtils":function(){define("exports ../../../core/Logger ../../../core/string ../../../intl/date ../../../intl/number ../../../layers/support/fieldUtils ../../../layers/support/layerUtils ../../../smartMapping/support/utils ../../../support/arcadeOnDemand ../../../time/timeZoneUtils".split(" "),function(c,p,h,C,H,G,F,M,Q,A){function y(t){return t?Z.test(t):!1}function b(t,x){if(x&&y(x)&&t){var E=x.replace(Z,"").toLowerCase(); return t.find(({name:N})=>N.toLowerCase()===E)}}function k(t,x){return(x=e(x,t))?x.name:t}function e(t,x){return t&&"function"===typeof t.getField&&x?t.getField(x)??null:null}function f({formattedAttributes:t,template:x,fieldInfoMap:E}){return`${h.replace(h.replace(x,N=>`{${E.get(N.toLowerCase())?.fieldName||N}}`),t).replaceAll(V,"")}`.trim()}function l(t,x,E=!1){const N=x[t];"string"===typeof N&&(E=(E?encodeURIComponent(N):N).replaceAll(W,"%27"),x[t]=E)}function m(t,x=!1){const E={...t};Object.keys(E).forEach(N=> l(N,E,x));return E}function v(t,x){return t.replaceAll(U,(E,N,P)=>(E=e(x,P))?`{${E.name}}`:N)}function r(t,x,E){return(t=v(t,E))?t.replaceAll(ba,(N,P,R)=>{P=`${P||R}`.trim();return h.replace(N,m(x,P&&"{"!==P[0]||!1))}):t}function u(t){return null!=t&&"object"===typeof t&&"fieldsIndex"in t&&"geometryType"in t&&"getField"in t&&"load"in t&&"loaded"in t&&"objectIdField"in t&&"spatialReference"in t&&"type"in t&&("feature"===t.type||"scene"===t.type||"sublayer"===t.type)&&"when"in t}function K(t){return null!= t&&"object"===typeof t&&"createQuery"in t&&"queryFeatureCount"in t&&"queryObjectIds"in t&&"queryRelatedFeatures"in t&&"queryRelatedFeaturesCount"in t&&"relationships"in t}function d(t){return u(t)&&K(t)}function n(t,x){const {fieldInfos:E,fieldName:N,preventPlacesFormatting:P,layer:R,timeZone:X}=x;x=g(E,N);var Y=e(R,N);if(x&&!G.isRasterPixelValueField(N)){Y=Y?.type;const aa=x.format?.dateFormat;if("date"===Y||"date-only"===Y||"time-only"===Y||"timestamp-offset"===Y||aa)return M.formatAnyDate(t,{format:aa, fieldType:Y,timeZoneOptions:{layerTimeZone:R&&"preferredTimeZone"in R?R.preferredTimeZone:null,viewTimeZone:X,datesInUnknownTimezone:R&&"datesInUnknownTimezone"in R?!!R.datesInUnknownTimezone:!1}})}x=x?.format;if("string"===typeof t&&G.isRasterPixelValueField(N)&&x)return t=t.trim(),/\d{2}-\d{2}/.test(t)?t:t.includes(",")?a(t,",",", ",x):t.includes(";")?a(t,";","; ",x):t.includes(" ")?a(t," "," ",x):H.formatNumber(Number(t),H.convertNumberFormatToIntlOptions(x));"string"!==typeof t||!x||null!=x.dateFormat|| null==x.places&&null==x.digitSeparator||(Y=Number(t),isNaN(Y)||(t=Y));return"string"===typeof t||null==t||null==x?I(t):P?H.formatNumber(t,{...H.convertNumberFormatToIntlOptions(x),minimumFractionDigits:0,maximumFractionDigits:20}):H.formatNumber(t,H.convertNumberFormatToIntlOptions(x))}function a(t,x,E,N){return t.trim().split(x).map(P=>H.formatNumber(Number(P),H.convertNumberFormatToIntlOptions(N))).join(E)}function g(t,x){if(t?.length&&x)return t.find(E=>E.fieldName?.toLowerCase()===x.toLowerCase())} function w({fieldName:t,graphic:x,layer:E}){if(J(t)||!E||"function"!==typeof E.getFeatureType)return null;const {typeIdField:N}=E;return N&&t===N?(t=E.getFeatureType(x))?t.name:null:null}function D({fieldName:t,value:x,graphic:E,layer:N}){return J(t)||!N||"function"!==typeof N.getFieldDomain?null:(t=E&&N.getFieldDomain(t,{feature:E}))&&"coded-value"===t.type?t.getName(x):null}function I(t){return"string"===typeof t?t.replaceAll(ca,'\x3cbr class\x3d"esri-text-new-line" /\x3e'):t}function z(t){const {value:x, fieldName:E,fieldInfos:N,fieldInfoMap:P,layer:R,graphic:X,timeZone:Y}=t;return null==x?"":(t=D({fieldName:E,value:x,graphic:X,layer:R}))||(t=w({fieldName:E,graphic:X,layer:R}))?t:P.get(E.toLowerCase())?n(x,{fieldInfos:N||Array.from(P.values()),fieldName:E,layer:R,timeZone:Y}):(t=R?.fieldsIndex?.get(E))&&(M.isAnyDateField(t)||G.isTimeOnlyField(t))?M.formatAnyDate(x,{fieldType:t.type,timeZoneOptions:{layerTimeZone:R&&"preferredTimeZone"in R?R.preferredTimeZone:null,viewTimeZone:Y,datesInUnknownTimezone:R&& "datesInUnknownTimezone"in R?!!R.datesInUnknownTimezone:!1}}):I(x)}async function q(t,x){const {layer:E,graphic:N,outFields:P,objectIds:R,returnGeometry:X,spatialReference:Y}=t;t=R[0];if("number"!==typeof t&&"string"!==typeof t)return x={layer:E,graphic:N,objectId:t,requiredFields:P},p.getLogger("esri.widgets.Feature.support.featureUtils").warn("Could not query required fields for the specified feature. The feature's ID is invalid.",x),null;if(!F.getEffectiveLayerCapabilities(E)?.operations?.supportsQuery)return x= {layer:E,graphic:N,requiredFields:P,returnGeometry:X},p.getLogger("esri.widgets.Feature.support.featureUtils").warn("The specified layer cannot be queried. The following fields will not be available.",x),null;t=E.createQuery();t.objectIds=R;t.outFields=P?.length?P:[E.objectIdField];t.returnGeometry=!!X;t.returnZ=!!X;t.returnM=!!X;t.outSpatialReference=Y;return(await E.queryFeatures(t,x)).features[0]}async function B(t){if(!t.expressionInfos?.length)return!1;var x=await Q.loadArcade();({arcadeUtils:{hasGeometryFunctions:x}}= x);return x(t)}function J(t=""){return t?t.includes("relationships/"):!1}function L({attributes:t,graphic:x,relatedInfo:E,fieldInfos:N,fieldInfoMap:P,layer:R,timeZone:X}){t&&x&&E&&Object.keys(x.attributes).forEach(Y=>{var aa=(aa={layerId:E.relation.id.toString(),fieldName:Y},`${"relationships/"}${aa.layerId}/${aa.fieldName}`);t[aa]=z({fieldName:aa,fieldInfos:N,fieldInfoMap:P,layer:R,value:x.attributes[Y],graphic:x,timeZone:X})})}function O({attributes:t,relatedInfo:x,fieldInfoMap:E,fieldInfos:N,layer:P, timeZone:R}){t&&x&&(x.relatedFeatures?.forEach(X=>L({attributes:t,graphic:X,relatedInfo:x,fieldInfoMap:E,fieldInfos:N,layer:P,timeZone:R})),x.relatedStatsFeatures?.forEach(X=>L({attributes:t,graphic:X,relatedInfo:x,fieldInfoMap:E,fieldInfos:N,layer:P,timeZone:R})))}function T(t,x){return t?.allTables.find(E=>"feature"===E.type&&E.layerId===x.id&&E.url===x.layer?.url)}function S({map:t,relationship:x,relationship:{relatedTableId:E},relatedLayer:N,layers:P}){if(!P)return null;for(const R of P)if("map-image"=== R.type){if(P=S({layers:R.sublayers,map:t,relatedLayer:N,relationship:x})||S({layers:R.subtables,map:t,relatedLayer:N,relationship:x}))return P}else if(d(R))if("sublayer"===N.type){if(R!==N&&R.id===E)return R.isTable?T(t,R):R}else{P="scene"===N.type&&N.associatedLayer?N.associatedLayer.url:N.url;if(!P)break;if("sublayer"===R.type){if(R!==N&&R.layer?.url===P&&R.id===E)return R.isTable?T(t,R):R}else if(R!==N&&R.url===P&&R.layerId===E)return R}return null}const V=/href=(""|'')/gi,U=/(\{([^{\r\n]+)\})/g, W=/'/g,Z=/^\s*expression\//i,ca=/(\n)/gi,da=/[\u00A0-\u9999<>&]/gim,ba=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,fa=/^(?:mailto:|tel:)/,ha=C.convertDateFormatToIntlOptions("short-date-short-time"),ia=t=>{if(!t)return!1;t=t.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},ea=({layer:t,method:x,query:E,definitionExpression:N})=>{t.capabilities?.query?.supportsCacheHint&&"attachments"!==x&&(t=null!=E.where?E.where:null,x=null!=E.geometry?E.geometry: null,ia(N)||ia(t)||"extent"===x?.type||"tile"===E.resultType||(E.cacheHint=!0))};c.applyTextFormattingHTML=I;c.createFieldInfoMap=function(t,x){const E=new Map;if(!t)return E;for(const N of t)N.fieldName&&(t=k(N.fieldName,x),N.fieldName=t,E.set(t.toLowerCase(),N));return E};c.findRelatedLayer=function(t,x,E){return t&&x&&E?"sublayer"===x.type?S({layers:x.layer?.sublayers,map:t,relatedLayer:x,relationship:E})||S({layers:x.layer?.subtables,map:t,relatedLayer:x,relationship:E}):S({layers:t.allLayers, map:t,relatedLayer:x,relationship:E})||S({layers:t.allTables,map:t,relatedLayer:x,relationship:E}):null};c.fixTokens=v;c.formatAttributes=function({fieldInfos:t,attributes:x,layer:E,graphic:N,fieldInfoMap:P,relatedInfos:R,timeZone:X}){const Y={};R?.forEach(aa=>O({attributes:Y,relatedInfo:aa,fieldInfoMap:P,fieldInfos:t,layer:E,timeZone:X}));x&&Object.keys(x).forEach(aa=>{Y[aa]=z({fieldName:aa,fieldInfos:t,fieldInfoMap:P,layer:E,value:x[aa],graphic:N,timeZone:X})});return Y};c.formatEditInfo=function(t, x,E,N){const {creatorField:P,creationDateField:R,editorField:X,editDateField:Y}=t;if(x){t=A.getTimeZoneFormattingOptions(N&&"preferredTimeZone"in N?N.preferredTimeZone:null,N&&"datesInUnknownTimezone"in N?!!N.datesInUnknownTimezone:!1,E,ha,"date");t={...ha,...t};E=x[Y];if("number"===typeof E)return x=x[X],{type:"edit",date:C.formatDate(E,t),user:x};E=x[R];return"number"===typeof E?(x=x[P],{type:"create",date:C.formatDate(E,t),user:x}):null}};c.formatValueToFieldInfo=n;c.getAllFieldInfos=function(t){const x= [];if(!t)return x;const {fieldInfos:E,content:N}=t;E&&x.push(...E);if(!N||!Array.isArray(N))return x;N.forEach(P=>{"fields"===P.type&&(P=P?.fieldInfos)&&x.push(...P)});return x};c.getFieldInfo=g;c.getFieldInfoLabel=function(t,x){return(x=b(x,t?.fieldName))?x.title||null:t?t.label||t.fieldName:null};c.getFixedFieldName=k;c.getFixedFieldNames=function(t,x){return t&&t.map(E=>k(E,x))};c.getHighlightKeyForFeature=function(t){const x=t.getObjectId();return null!=x?`oid:${x}`:`uid:${t.uid}`};c.getSourceLayer= function(t){if(null!=t)return(t.sourceLayer||t.layer)??void 0};c.graphicCallback=async function({type:t,value:x,event:E}){try{return"function"===typeof x?x(E):x}catch(N){p.getLogger("esri.widgets.Feature.support.featureUtils").error("error",`An error occurred when calling the "${t}" function`,{error:N,graphic:E.graphic,value:x})}};c.htmlEntities=function(t){return t.replaceAll(da,x=>`&#${x.charCodeAt(0)};`)};c.isExpressionField=y;c.isFeatureSupportedLayer=u;c.isGraphicForRelatableFeatureSupportedLayer= function(t){return!!t&&"object"===typeof t&&"sourceLayer"in t&&d(t.sourceLayer)};c.isRelatableFeatureSupportedLayer=d;c.isRelatableLayer=K;c.isRelatedField=J;c.preLayerQueryCallback=({query:t,layer:x,method:E})=>{ea({layer:x,method:E,query:t,definitionExpression:`${x.definitionExpression} ${x.serviceDefinitionExpression??""}`})};c.preRequestCallback=({queryPayload:t,layer:x,method:E})=>{ea({layer:x,method:E,query:t,definitionExpression:`${x.definitionExpression} ${x.serviceDefinitionExpression??""}`})}; c.querySourceLayer=q;c.queryUpdatedFeature=async function({graphic:t,popupTemplate:x,layer:E,spatialReference:N},P){if(E&&x&&("function"===typeof E.load&&await E.load(P),t.attributes)){var R=E.objectIdField,X=t.attributes[R];if(null!=X){X=[X];var Y=await x.getRequiredFields(E.fieldsIndex),aa=G.featureHasFields(Y,t);R=aa?[]:Y.includes(R)?Y:[...Y,R];x=x.returnGeometry||await B(x);if(!aa||x)if(E=await q({layer:E,graphic:t,outFields:R,objectIds:X,returnGeometry:x,spatialReference:N},P))E.geometry&&(t.geometry= E.geometry),E.attributes&&(t.attributes={...t.attributes,...E.attributes})}}};c.shouldOpenInNewTab=function(t=""){if(t)return!fa.test(t.trim().toLowerCase())};c.substituteAttributes=f;c.substituteFieldsInLinksAndAttributes=function({attributes:t,globalAttributes:x,layer:E,text:N,expressionAttributes:P,fieldInfoMap:R}){return N?f({formattedAttributes:x,template:r(N,{...x,...P,...t},E),fieldInfoMap:R}):""};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/smartMapping/support/utils":function(){define("exports ../../intl/date ../../layers/support/fieldUtils ../../support/arcadeOnDemand ../../support/basemapUtils ../../time/timeZoneUtils".split(" "), function(c,p,h,C,H,G){function F(e){return String(e).padStart(2,"0")}function M(e,f,l){if("date"===f||"number"===f){"number"===f&&(e=new Date(e));f=l?e.getFullYear():e.getUTCFullYear();const m=F((l?e.getMonth():e.getUTCMonth())+1),v=F(l?e.getDate():e.getUTCDate()),r=F(l?e.getHours():e.getUTCHours()),u=F(l?e.getMinutes():e.getUTCMinutes());e=F(l?e.getSeconds():e.getUTCSeconds());e=`TIMESTAMP'${f}-${m}-${v} ${r}:${u}:${e}'`}return e}function Q(e,f){if(f instanceof Date)return"date";if("number"===typeof f)return"number"; if("string"===typeof f&&(e=e.getField(f),"\x3cnow\x3e"!==f.toLowerCase()&&h.isDateField(e)))return"field"}const A={light:"streets gray topo terrain oceans osm gray-vector streets-vector topo-vector streets-relief-vector streets-navigation-vector topo-3d navigation-3d streets-3d osm-3d gray-3d arcgis-light-gray arcgis-navigation arcgis-streets arcgis-streets-relief arcgis-topographic arcgis-oceans osm-standard osm-standard-relief osm-streets osm-streets-relief osm-light-gray arcgis-terrain arcgis-charted-territory arcgis-community arcgis-colored-pencil arcgis-modern-antique arcgis-midcentury arcgis-newspaper arcgis-hillshade-light".split(" "), dark:"satellite hybrid dark-gray dark-gray-vector streets-night-vector navigation-dark-3d streets-dark-3d dark-gray-3d arcgis-imagery arcgis-imagery-standard arcgis-dark-gray arcgis-navigation-night arcgis-streets-night osm-dark-gray arcgis-nova arcgis-hillshade-dark".split(" ")},y={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864E5},b=new Set(["integer","small-integer"]);let k=null;c.castIntegerFieldToFloat=function(e){return`cast(${e} as float)`};c.dateTypes= ["date","date-only","timestamp-offset"];c.defaultBasemapGroups=A;c.fieldDelimiter=",";c.formatAnyDate=function(e,f){const {format:l,timeZoneOptions:m,fieldType:v}=f??{};let r;m&&({timeZone:u,timeZoneName:r}=G.getTimeZoneFormattingOptions(m.layerTimeZone,m.datesInUnknownTimezone,m.viewTimeZone,p.convertDateFormatToIntlOptions(l||"short-date-short-time"),v));if("string"===typeof e&&isNaN(Date.parse("time-only"===v?`1970-01-01T${e}Z`:e)))return e;switch(v){case "date-only":var u=p.convertDateFormatToIntlOptions(l|| "short-date");return"string"===typeof e?p.formatDateOnly(e,{...u}):p.formatDate(e,{...u,timeZone:G.utc});case "time-only":return u=p.convertDateFormatToIntlOptions(l||"short-time"),"string"===typeof e?p.formatTimeOnly(e,u):p.formatDate(e,{...u,timeZone:G.utc});case "timestamp-offset":if(!u&&"string"===typeof e&&(new Date(e)).toISOString()!==e)return e;u=(f=l||m?p.convertDateFormatToIntlOptions(l||"short-date-short-time"):void 0)?{...f,timeZone:u,timeZoneName:r}:void 0;return"string"===typeof e?p.formatTimestamp(e, u):p.formatDate(e,u);default:return f=l||m?p.convertDateFormatToIntlOptions(l||"short-date-short-time"):void 0,p.formatDate("string"===typeof e?new Date(e):e,f?{...f,timeZone:u,timeZoneName:r}:void 0)}};c.getBasemapGroup=function(e,f=A){for(const l in f)if(f[l].includes(e))return l};c.getBasemapId=function(e,f,l=!0){let m=null;e&&("string"===typeof e?f.includes(e)&&(m=e):m=H.getWellKnownBasemapId(e));return l?m||"gray":m};c.getDateDiffSQL=function(e,f,l,m){const {hasQueryEngine:v}=e;l=M(l,Q(e,l), v);e=M(f,Q(e,f),v);e=`(${l} - ${e})`;m=y[m];f="/";1>m&&(m=1/m,f="*");return{sqlExpression:1===m?e:`(${e} ${f} ${m})`,sqlWhere:null}};c.getDateType=Q;c.getFieldsList=async function(e){const {field:f,field2:l,field3:m,normalizationField:v,valueExpression:r}=e;e=[];r&&(k||({arcadeUtils:e}=await C.loadArcade(),k=e),e=k.extractFieldNames(r));f&&e.push(f);l&&e.push(l);m&&e.push(m);v&&e.push(v);return e};c.getNormalizationType=function(e){let f=e.normalizationType;f||(e.normalizationField?f="field":null!= e.normalizationTotal&&(f="percent-of-total"));return f??void 0};c.isAnyDateField=function(e){return h.isDateField(e)||h.isDateOnlyField(e)||h.isTimestampOffsetField(e)};c.isIntegerField=function(e,f){e=f&&e.getField(f);return!!e&&b.has(e.type)};c.unitValueInDays=y;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Attachments/support/attachmentUtils":function(){define(["exports","../../../assets"],function(c,p){c.getIconPath=function(h){const C=p.getAssetUrl("esri/themes/base/images/files/"); return h?"text/plain"===h?`${C}text-32.svg`:"application/pdf"===h?`${C}pdf-32.svg`:"text/csv"===h?`${C}csv-32.svg`:"application/gpx+xml"===h?`${C}gpx-32.svg`:"application/x-dwf"===h?`${C}cad-32.svg`:"application/postscript"===h||"application/json"===h||"text/xml"===h||"model/vrml"===h?`${C}code-32.svg`:"application/x-zip-compressed"===h||"application/x-7z-compressed"===h||"application/x-gzip"===h||"application/x-tar"===h||"application/x-gtar"===h||"application/x-bzip2"===h||"application/gzip"===h|| "application/x-compress"===h||"application/x-apple-diskimage"===h||"application/x-rar-compressed"===h||"application/zip"===h?`${C}zip-32.svg`:h.includes("image/")?`${C}image-32.svg`:h.includes("audio/")?`${C}sound-32.svg`:h.includes("video/")?`${C}video-32.svg`:h.includes("msexcel")||h.includes("ms-excel")||h.includes("spreadsheetml")?`${C}excel-32.svg`:h.includes("msword")||h.includes("ms-word")||h.includes("wordprocessingml")?`${C}word-32.svg`:h.includes("powerpoint")||h.includes("presentationml")? `${C}report-32.svg`:`${C}generic-32.svg`:`${C}generic-32.svg`};c.isSupportedImage=function(h){h=h.toLowerCase();return"image/bmp"===h||"image/emf"===h||"image/exif"===h||"image/gif"===h||"image/x-icon"===h||"image/jpeg"===h||"image/png"===h||"image/tiff"===h||"image/x-wmf"===h};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/globalCss":function(){define(["exports"],function(c){c.globalCss={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled", button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation", loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table", widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/legacyIcon":function(){define(["exports"],function(c){c.legacyIcon={checkMark:"esri-icon-check-mark",close:"esri-icon-close",collapse:"esri-icon-collapse",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical", duplicate:"esri-icon-duplicate",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",handleVertical:"esri-icon-handle-vertical",icon:"esri-icon",left:"esri-icon-left",loadingIndicator:"esri-icon-loading-indicator",locateCircled:"esri-icon-locate-circled",minus:"esri-icon-minus",noticeTriangle:"esri-icon-notice-triangle",pause:"esri-icon-pause",play:"esri-icon-play",plus:"esri-icon-plus",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked", refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",search:"esri-icon-search",swap:"esri-icon-swap",table:"esri-icon-table",trash:"esri-icon-trash",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomToObject:"esri-icon-zoom-to-object"};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Feature/FeatureAttachments/FeatureAttachmentsViewModel":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../Attachments/AttachmentsViewModel".split(" "), function(c,p,h,C,H,G,F){h=class extends F{constructor(M){super(M);this.title=this.description=null}};c.__decorate([p.property()],h.prototype,"description",void 0);c.__decorate([p.property()],h.prototype,"title",void 0);return h=c.__decorate([G.subclass("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],h)})},"esri/widgets/Feature/support/FeatureElementInfo":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../Widget ../../support/Heading ../../support/widgetUtils ../../support/jsxFactory".split(" "), function(c,p,h,C,H,G,F,M,Q,A){h=class extends F{constructor(y,b){super(y,b);this.description=null;this.headingLevel=2;this.title=null}render(){return A.tsx("div",{class:"esri-feature-element-info"},this._renderTitle(),this._renderDescription())}_renderTitle(){const {title:y}=this;return y?A.tsx(M.Heading,{class:"esri-feature-element-info__title",innerHTML:y,level:this.headingLevel}):null}_renderDescription(){const {description:y}=this;return y?A.tsx("div",{class:"esri-feature-element-info__description", innerHTML:y,key:"description"}):null}};c.__decorate([p.property()],h.prototype,"description",void 0);c.__decorate([p.property()],h.prototype,"headingLevel",void 0);c.__decorate([p.property()],h.prototype,"title",void 0);return h=c.__decorate([G.subclass("esri.widgets.Feature.support.FeatureElementInfo")],h)})},"esri/widgets/support/Heading":function(){define(["exports","../../core/mathUtils","./globalCss","./widgetUtils","./jsxFactory"],function(c,p,h,C,H){c.Heading=function({level:G,class:F,...M}, Q){G=p.clamp(Math.ceil(G),1,6);return H.tsx(`h${G}`,{...M,"aria-level":String(G),class:C.classes(h.globalCss.heading,F),role:"heading"},Q)};c.incrementHeadingLevel=function(G,F=1){return p.clamp(Math.ceil(G+F),1,6)};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Feature/FeatureContent":function(){define("../../chunks/tslib.es6 ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../Widget ./FeatureContent/FeatureContentViewModel ./support/featureUtils ../support/widget ../support/jsxFactory".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y){h=class extends F{constructor(b,k){super(b,k);this.viewModel=null;this._addTargetToAnchors=e=>{Array.from(e.querySelectorAll("a")).forEach(f=>{Q.shouldOpenInNewTab(f.href)&&!f.hasAttribute("target")&&f.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(b){this.viewModel&&(this.viewModel.creator=b)}get graphic(){return this.viewModel?.graphic}set graphic(b){this.viewModel&&(this.viewModel.graphic=b)}render(){return y.tsx("div", {class:"esri-feature-content"},"loading"===this.viewModel?.state?this._renderLoading():this._renderCreated())}_renderLoading(){return y.tsx("div",{class:"esri-feature-content__loader-container",key:"loader"},y.tsx("div",{class:"esri-feature-content__loader"}))}_renderCreated(){const b=this.viewModel?.created;return b?b instanceof HTMLElement?y.tsx("div",{afterCreate:this._attachToNode,bind:b,key:b}):A.isWidget(b)?y.tsx("div",{key:b},!b.destroyed&&b.render()):y.tsx("div",{afterCreate:this._addTargetToAnchors, innerHTML:b,key:b}):null}_attachToNode(b){b.appendChild(this)}};c.__decorate([p.property()],h.prototype,"creator",null);c.__decorate([p.property()],h.prototype,"graphic",null);c.__decorate([p.property({type:M})],h.prototype,"viewModel",void 0);return h=c.__decorate([G.subclass("esri.widgets.Feature.FeatureContent")],h)})},"esri/widgets/Feature/FeatureContent/FeatureContentViewModel":function(){define("../../../chunks/tslib.es6 ../../../Graphic ../../../core/Accessor ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../support/featureUtils".split(" "), function(c,p,h,C,H,G,F,M,Q,A){h=class extends h{constructor(y){super(y);this.graphic=this.destroyer=this.creator=this.created=this._loadingPromise=null;this.addHandles(C.watch(()=>this.creator,b=>{this._destroyContent();this._createContent(b)},C.initial))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const {created:y,graphic:b,destroyer:k}=this;y&&b&&(A.graphicCallback({type:"content",value:k,event:{graphic:b}}),this._set("created",null))}async _createContent(y){var b= this.graphic;b&&y&&(this._loadingPromise=y=A.graphicCallback({type:"content",value:y,event:{graphic:b}}),this.notifyChange("state"),b=await y,y===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",b)))}};c.__decorate([H.property({readOnly:!0})],h.prototype,"created",void 0);c.__decorate([H.property()],h.prototype,"creator",void 0);c.__decorate([H.property()],h.prototype,"destroyer",void 0);c.__decorate([H.property({type:p})],h.prototype,"graphic",void 0); c.__decorate([H.property({readOnly:!0})],h.prototype,"state",null);return h=c.__decorate([Q.subclass("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],h)})},"esri/widgets/Feature/FeatureExpression":function(){define("require ../../chunks/tslib.es6 ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../Widget ./FeatureContent ./FeatureFields ./FeatureMedia ./FeatureExpression/FeatureExpressionViewModel ../../chunks/componentsUtils ../support/widgetUtils ../support/jsxFactory".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b,k,e,f,l){H=class extends Q{constructor(m,v){super(m,v);this._contentWidget=null;this.viewModel=new k}initialize(){this.addHandles(h.watch(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),h.initial))}loadDependencies(){return e.loadCalciteComponents({loader:()=>new Promise((m,v)=>c(["../../chunks/calcite-loader"],m,v))})}destroy(){this._destroyContentWidget()}render(){const {state:m}=this.viewModel;return l.tsx("div",{class:"esri-feature-expression"}, "loading"===m?this._renderLoading():"disabled"===m?null:this._contentWidget?.render())}_renderLoading(){return l.tsx("div",{class:"esri-feature__loading-container",key:"loading-container"},l.tsx("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const {_contentWidget:m}=this;m&&(m.viewModel=null,m.destroy());this._contentWidget=null}_setupExpressionWidget(){const {contentElementViewModel:m,contentElement:v}=this.viewModel,r=v?.type;this._destroyContentWidget();this._contentWidget=m?"fields"=== r?new y({viewModel:m}):"media"===r?new b({viewModel:m}):"text"===r?new A({viewModel:m}):null:null;this.scheduleRender()}};p.__decorate([C.property({type:k})],H.prototype,"viewModel",void 0);return H=p.__decorate([M.subclass("esri.widgets.Feature.FeatureExpression")],H)})},"esri/widgets/Feature/FeatureFields":function(){define("../../chunks/tslib.es6 ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../Widget ./FeatureFields/FeatureFieldsViewModel ./support/FeatureElementInfo ../support/globalCss ../support/uriUtils ../support/widgetUtils ../support/decorators/messageBundle ../support/jsxFactory".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b,k,e,f){C=class extends M{constructor(l,m){super(l,m);this._featureElementInfo=null;this.viewModel=new Q;this.messagesURIUtils=this.messages=null}initialize(){this._featureElementInfo=new A;this.addHandles(p.watch(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),p.initial))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(l){this.viewModel.attributes=l}get description(){return this.viewModel.description}set description(l){this.viewModel.description= l}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(l){this.viewModel.expressionInfos=l}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(l){this.viewModel.fieldInfos=l}get title(){return this.viewModel.title}set title(l){this.viewModel.title=l}render(){return f.tsx("div",{class:"esri-feature-fields"},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(l,m){var {attributes:v}=this.viewModel;const r=l.fieldName||"",u=l.label||r;v=v? null==v[r]?"":v[r]:"";l=!!l.format?.dateFormat;v="number"!==typeof v||l?b.autoLink(this.messagesURIUtils,v):this._forceLTR(v);l={["esri-feature-fields__field-data--date"]:l};return f.tsx("tr",{key:`fields-element-info-row-${r}-${m}`},f.tsx("th",{class:"esri-feature-fields__field-header",innerHTML:u,key:`fields-element-info-row-header-${r}-${m}`}),f.tsx("td",{class:this.classes("esri-feature-fields__field-data",l),innerHTML:v,key:`fields-element-info-row-data-${r}-${m}`}))}_renderFields(){const {formattedFieldInfos:l}= this.viewModel;return l?.length?f.tsx("table",{class:y.globalCss.table,summary:this.messages.fieldsSummary},f.tsx("tbody",null,l.map((m,v)=>this._renderFieldInfo(m,v)))):null}_setupFeatureElementInfo(){const {description:l,title:m}=this;this._featureElementInfo?.set({description:l,title:m})}_forceLTR(l){return`‎${l}`}};c.__decorate([h.property()],C.prototype,"attributes",null);c.__decorate([h.property()],C.prototype,"description",null);c.__decorate([h.property()],C.prototype,"expressionInfos", null);c.__decorate([h.property()],C.prototype,"fieldInfos",null);c.__decorate([h.property()],C.prototype,"title",null);c.__decorate([h.property({type:Q,nonNullable:!0})],C.prototype,"viewModel",void 0);c.__decorate([h.property(),e.messageBundle("esri/widgets/Feature/t9n/Feature")],C.prototype,"messages",void 0);c.__decorate([h.property(),e.messageBundle("esri/widgets/support/t9n/uriUtils")],C.prototype,"messagesURIUtils",void 0);return C=c.__decorate([F.subclass("esri.widgets.Feature.FeatureFields")], C)})},"esri/widgets/Feature/FeatureFields/FeatureFieldsViewModel":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../popup/ExpressionInfo ../../../popup/FieldInfo ../support/featureUtils".split(" "),function(c,p,h,C,H,G,F,M,Q,A){p=class extends p{constructor(y){super(y);this.title=this.fieldInfos=this.description= this.expressionInfos=this.attributes=null}get formattedFieldInfos(){const {expressionInfos:y,fieldInfos:b}=this,k=[];b?.forEach(e=>{if(!e.hasOwnProperty("visible")||e.visible)e=e.clone(),e.label=A.getFieldInfoLabel(e,y),k.push(e)});return k}};c.__decorate([h.property()],p.prototype,"attributes",void 0);c.__decorate([h.property({type:[M]})],p.prototype,"expressionInfos",void 0);c.__decorate([h.property()],p.prototype,"description",void 0);c.__decorate([h.property({type:[Q]})],p.prototype,"fieldInfos", void 0);c.__decorate([h.property({readOnly:!0})],p.prototype,"formattedFieldInfos",null);c.__decorate([h.property()],p.prototype,"title",void 0);return p=c.__decorate([F.subclass("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],p)})},"esri/widgets/support/uriUtils":function(){define(["exports","../../core/string"],function(c,p){const h=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i, label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}", appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"}, {pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];c.autoLink=function(C,H){if("string"!==typeof H||!H)return H;const G=h.find(M=>M.pattern.test(H));if(!G)return H;const F=H.match(G.pattern);C=p.replace(p.replace(G.label,{messages:C,hierPart:F?.[2]}),{appName:G.appName});return H.replace(G.pattern,`${C}`)};Object.defineProperty(c,Symbol.toStringTag, {value:"Module"})})},"esri/widgets/Feature/FeatureMedia":function(){define("require ../../chunks/tslib.es6 ../../intl ../../core/a11yUtils ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../renderers/support/utils ../Widget ./FeatureMedia/FeatureMediaViewModel ./support/FeatureElementInfo ./support/featureUtils ../../chunks/componentsUtils ../support/widgetUtils ../support/decorators/messageBundle ../support/jsxFactory ../../support/themeUtils ../../intl/substitute".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b,k,e,f,l,m,v,r,u,K){h=class extends b{constructor(d,n){super(d,n);this._featureElementInfo=this._refreshIntervalInfo=this._refreshTimer=null;this._chartRootMap=new WeakMap;this.viewModel=new k;this.messages=null;this._disposeChart=a=>{this._chartRootMap.get(a)?.dispose();this._chartRootMap.delete(a)};this._createChart=async a=>{const {destroyed:g,viewModel:w}=this;if(!g&&w&&a){var {createRoot:D}=await new Promise((I,z)=>c(["../support/chartUtilsAm5"],I,z));D=await D(a); this._chartRootMap.set(a,D);this._renderChart({mediaInfo:w.activeMediaInfo,root:D})}}}initialize(){this._featureElementInfo=new e;this.addHandles([H.watch(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),H.initial),H.watch(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),H.initial)])}loadDependencies(){return l.loadCalciteComponents({icon:()=>new Promise((d,n)=>c(["../../chunks/calcite-icon"],d, n))})}destroy(){this._clearMediaRefreshTimer();this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(d){this.viewModel.attributes=d}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(d){this.viewModel.activeMediaInfoIndex=d}get description(){return this.viewModel.description}set description(d){this.viewModel.description=d}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(d){this.viewModel.fieldInfoMap= d}get layer(){return this.viewModel.layer}set layer(d){this.viewModel.layer=d}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(d){this.viewModel.mediaInfos=d}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(d){this.viewModel.popupTemplate=d}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(d){this.viewModel.relatedInfos=d}get title(){return this.viewModel.title}set title(d){this.viewModel.title=d}render(){return r.tsx("div",{bind:this, class:"esri-feature-media",onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const {formattedMediaInfoCount:d,activeMediaInfoIndex:n}=this.viewModel,a=this._renderMediaText();return d?r.tsx("div",{class:"esri-feature-media__container",key:"media-element-container"},this._renderMediaInfo(),r.tsx("div",{class:"esri-feature-media__item-navigation"},a,1this.viewModel.formattedMediaInfoCount)return null;const n=(d="previous"===d)?this.messages.previous:this.messages.next;return r.tsx("button",{"aria-label":n,bind:this,class:"esri-feature-media__pagination-button",key:d?"media-previous":"media-next",onclick:d? this._previous:this._next,tabIndex:0,title:n,type:"button"},r.tsx("calcite-icon",{class:"esri-feature-media__pagination-icon",icon:d?"chevron-left":"chevron-right",scale:"s"}))}_setupFeatureElementInfo(){const {description:d,title:n}=this;this._featureElementInfo?.set({description:d,title:n})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(this.viewModel){var {isAggregate:d,layer:n}=this.viewModel;return d&&n?.featureReduction&&"renderer"in n.featureReduction? n.featureReduction.renderer:n?.renderer}}async _getSeriesColors(d){const {colorAm5:n}=await new Promise((g,w)=>c(["./FeatureMedia/chartCommon"],g,w)),a=new Map;d.forEach(g=>{g.color&&a.set(g,n(g.color.toCss(!0)))});return a}async _getRendererColors(){const {colorAm5:d}=await new Promise((w,D)=>c(["./FeatureMedia/chartCommon"],w,D)),n=new Map,a=this._getRenderer();if(!a)return n;const g=await y.getColorsFromRenderer(a);g.delete("default");if(!Array.from(g.values()).every(w=>1===w?.length))return n; Array.from(g.keys()).forEach(w=>{const D=g.get(w)?.[0]?.toCss(!0);D&&n.set(w,d(D))});return n}_handleMediaKeyup(d){const {key:n}=d;"ArrowLeft"===n&&(d.stopPropagation(),this.viewModel.previous());"ArrowRight"===n&&(d.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return this.viewModel?!!this.viewModel.abilities.chartAnimation&&!C.prefersReducedMotion():!1}_getChartAnimationMS(){return this._canAnimateChart()?250:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?500:0}async _renderChart(d){const {root:n, mediaInfo:a}=d,{value:g,type:w}=a,{ResponsiveThemeAm5:D,DarkThemeAm5:I,AnimatedThemeAm5:z,ColorSetAm5:q,ThemeAm5:B,esriChartColorSet:J}=await new Promise((U,W)=>c(["./FeatureMedia/chartCommon"],U,W));var L=B.new(n);L.rule("ColorSet").set("colors",J);L.rule("ColorSet").set("reuse",!0);L=[D.new(n),L];u.isDarkTheme()&&L.push(I.new(n));this._canAnimateChart()&&L.push(z.new(n));n.setThemes(L);const O=await this._getRendererColors(),T=await this._getSeriesColors(g.series),S=q.new(n,{}),V=(L=T.get(g.series[0]))? {lineSettings:{stroke:L}}:void 0;L=g.series.map((U,W)=>{W=T.get(U)||O.get(U.fieldName)||S.getIndex(W);return{category:U.tooltip,value:U.value,columnSettings:{fill:W,stroke:W},...V}}).filter(U=>"pie-chart"===w?null!=U.value&&0 c(["./FeatureMedia/chartCommon"],g,w));d.setAll({pointerOrientation:n});d.get("background")?.setAll({stroke:a("rgba(50, 50, 50, 1)")});d.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:200})}async _createPieChart(d,n){var {TooltipAm5:a}=await new Promise((q,B)=>c(["./FeatureMedia/chartCommon"],q,B));const {PieChartAm5:g,PieSeriesAm5:w}=await new Promise((q,B)=>c(["./FeatureMedia/pieChart"],q,B)),{mediaInfo:D,root:I}=d;var {title:z}=D;d=I.container.children.push(g.new(I, {ariaLabel:D?.altText||D?.title||"",focusable:!0,paddingBottom:5,paddingTop:5,paddingLeft:5,paddingRight:5}));a=a.new(I,{labelText:"{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})"});z=d.series.push(w.new(I,{name:z,valueField:"value",categoryField:"category",tooltip:a}));z.ticks.template.set("forceHidden",!0);z.labels.template.set("forceHidden",!0);z.slices.template.states.create("active",{shiftRadius:5});this._customizeChartTooltip(a);z.slices.template.setAll({ariaLabel:"{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})", focusable:!0,templateField:"columnSettings"});z.data.setAll(n);z.appear(this._getChartSeriesAnimationMS());d.appear(this._getChartAnimationMS());d.root.dom.classList.toggle("esri-feature-media__chart--rendered",!0)}_getMinSeriesValue(d){let n=0;d.forEach(a=>n=Math.min(a.value,n));return n}async _createColumnChart(d,n,a){const {TooltipAm5:g,ScrollbarAm5:w}=await new Promise((U,W)=>c(["./FeatureMedia/chartCommon"],U,W)),{CategoryAxisAm5:D,AxisRendererXAm5:I,ValueAxisAm5:z,AxisRendererYAm5:q,ColumnSeriesAm5:B}= await new Promise((U,W)=>c(["./FeatureMedia/xyChart"],U,W)),{mediaInfo:J,root:L}=n,{value:O,title:T}=J;d.setAll({wheelX:"panX",wheelY:"zoomX"});n=d.xAxes.push(D.new(L,{renderer:I.new(L,{inversed:this._isInversed()}),categoryField:"category"}));n.get("renderer").labels.template.setAll({forceHidden:!0});var S=d.yAxes.push(z.new(L,{renderer:q.new(L,{inside:!1}),min:this._getMinSeriesValue(O.series)}));S.get("renderer").labels.template.setAll({direction:this._getDirection()});const V=g.new(L,{labelText:"{categoryX}"}); S=d.series.push(B.new(L,{name:T,xAxis:n,yAxis:S,valueYField:"value",categoryXField:"category",tooltip:V}));this._customizeChartTooltip(V);S.columns.template.setAll({ariaLabel:"{categoryX}",focusable:!0,templateField:"columnSettings"});15c(["./FeatureMedia/chartCommon"],U,W)),{CategoryAxisAm5:D,AxisRendererXAm5:I,ValueAxisAm5:z,AxisRendererYAm5:q,ColumnSeriesAm5:B}=await new Promise((U,W)=>c(["./FeatureMedia/xyChart"],U,W)),{mediaInfo:J,root:L}=n,{value:O,title:T}=J;d.setAll({wheelX:"panY",wheelY:"zoomY"});n=d.yAxes.push(D.new(L,{renderer:q.new(L,{inversed:!0}),categoryField:"category"}));n.get("renderer").labels.template.setAll({forceHidden:!0});var S=d.xAxes.push(z.new(L,{renderer:I.new(L,{inside:!1,inversed:this._isInversed()}), min:this._getMinSeriesValue(O.series)}));S.get("renderer").labels.template.setAll({direction:this._getDirection()});const V=g.new(L,{labelText:"{categoryY}"});S=d.series.push(B.new(L,{name:T,xAxis:S,yAxis:n,valueXField:"value",categoryYField:"category",tooltip:V}));this._customizeChartTooltip(V,"vertical");S.columns.template.setAll({ariaLabel:"{categoryY}",focusable:!0,templateField:"columnSettings"});15c(["./FeatureMedia/chartCommon"],W,Z)),{CategoryAxisAm5:D,AxisRendererXAm5:I,ValueAxisAm5:z,AxisRendererYAm5:q,LineSeriesAm5:B}=await new Promise((W,Z)=>c(["./FeatureMedia/xyChart"],W,Z)),{root:J,mediaInfo:L}=n,{value:O,title:T}=L;d.setAll({wheelX:"panX",wheelY:"zoomX"});n=d.xAxes.push(D.new(J,{renderer:I.new(J,{inversed:this._isInversed()}), categoryField:"category"}));n.get("renderer").labels.template.setAll({forceHidden:!0});var S=d.yAxes.push(z.new(J,{renderer:q.new(J,{inside:!1}),min:this._getMinSeriesValue(O.series)}));S.get("renderer").labels.template.setAll({direction:this._getDirection()});const V=a[0]?.lineSettings?.stroke,U=g.new(J,{getFillFromSprite:!V,labelText:"{categoryX}"});V&&U.get("background")?.setAll({fill:V});S=d.series.push(B.new(J,{name:T,xAxis:n,yAxis:S,valueYField:"value",categoryXField:"category",tooltip:U})); S.strokes.template.setAll({templateField:"lineSettings"});this._customizeChartTooltip(U,"vertical");15c(["./FeatureMedia/xyChart"],q,B)),{root:w,mediaInfo:D}=d,{type:I}=D,z=w.container.children.push(a.new(w,{ariaLabel:D?.altText|| D?.title||"",focusable:!0,panX:!0,panY:!0}));z.set("cursor",g.new(w,{}));"column-chart"===I&&await this._createColumnChart(z,d,n);"bar-chart"===I&&await this._createBarChart(z,d,n);"line-chart"===I&&await this._createLineChart(z,d,n);z.root.dom.classList.toggle("esri-feature-media__chart--rendered",!0)}_clearMediaRefreshTimer(){const {_refreshTimer:d}=this;d&&(clearTimeout(d),this._refreshTimer=null)}_updateMediaInfoTimestamp(d){const n=Date.now();this._refreshIntervalInfo={timestamp:n,sourceURL:d&& this._getImageSource(d,n)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const {activeMediaInfo:d}=this.viewModel;"image"===d?.type&&0{this._updateMediaInfoTimestamp(a.sourceURL)},d)}_getImageSource(d,n){const a=d.includes("?")?"\x26":"?",[g,w=""]=d.split("#");return`${g}${a}timestamp=${n}${w?"#": ""}${w}`}};p.__decorate([G.property()],h.prototype,"_refreshIntervalInfo",void 0);p.__decorate([G.property()],h.prototype,"attributes",null);p.__decorate([G.property()],h.prototype,"activeMediaInfoIndex",null);p.__decorate([G.property()],h.prototype,"description",null);p.__decorate([G.property()],h.prototype,"fieldInfoMap",null);p.__decorate([G.property()],h.prototype,"layer",null);p.__decorate([G.property()],h.prototype,"mediaInfos",null);p.__decorate([G.property()],h.prototype,"popupTemplate",null); p.__decorate([G.property()],h.prototype,"relatedInfos",null);p.__decorate([G.property()],h.prototype,"title",null);p.__decorate([G.property({type:k})],h.prototype,"viewModel",void 0);p.__decorate([G.property(),v.messageBundle("esri/widgets/Feature/t9n/Feature")],h.prototype,"messages",void 0);return h=p.__decorate([A.subclass("esri.widgets.Feature.FeatureMedia")],h)})},"esri/renderers/support/utils":function(){define("exports ../../core/arrayUtils ../../core/Logger ../../core/MapUtils ../../intl/date ../../layers/support/fieldUtils ./numberUtils ../visualVariables/support/ColorStop ../../smartMapping/support/utils ../../symbols/support/utils ../../widgets/Legend/support/colorRampUtils ../../widgets/Legend/support/heatmapRampUtils".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b){async function k(u,K,d){C.getOrCreateMapValue(u,K,()=>[]).push(...d)}async function e(u,K,d){u=C.getOrCreateMapValue(u,K,()=>new Map);for(const n of d)u.set(n.value,n.color)}function f(u){let K=u.minValue,d=u.maxValue;const n=u.isFirstBreak?"":m.gt+" ";u="percent-of-total"===u.normalizationType?m.pct:"";K=null==K?"":F.format(K);d=null==d?"":F.format(d);return n+K+u+" "+m.ld+" "+d+u}function l(u,K){return"normalizationField"in u&&u.normalizationField?{type:"normalized-field", field:u.field,normalizationField:u.normalizationField}:"field"in u&&u.field?{type:"field",field:u.field}:"valueExpression"in u&&u.valueExpression?{type:"expression",expression:u.valueExpression,title:u.valueExpressionTitle,returnType:K}:null}const m={lte:"\x3c\x3d",gte:"\x3e\x3d",lt:"\x3c",gt:"\x3e",pct:"%",ld:"\u2013"},v={millisecond:0,second:1,minute:2,hour:3,day:4,month:5,year:6},r=H.convertDateFormatToIntlOptions("short-date");c.calculateDateFormatInterval=function(u){u=u.map(g=>new Date(g)); const K=u.length;let d=Infinity,n=null;for(let g=0;g{var D=null;if(!n||n.includes(w)){const I=a?H.formatDate(g):F.format(g);I&&(D="",0===w?D=m.lt+" ":w===K.length-1&&(D=m.gt+" "),D+=I)}return new M({value:g,color:d[w],label:D})})};c.createUniqueValueLabel=function(u){const {value:K,domain:d,fieldInfo:n,dateFormatOptions:a}=u;u=String(K);const g=d&&"codedValues"in d&&d.codedValues?d.getName(K):null;g?u=g:null!=K&&n&&(Q.isAnyDateField(n)||G.isTimeOnlyField(n))?u=Q.formatAnyDate(K,a??{fieldType:n.type}): "number"===typeof K&&(u=F.format(K));return u};c.dateFormatIntervalOptions={millisecond:"long-month-day-year-long-time",second:"long-month-day-year-long-time",minute:"long-month-day-year-short-time",hour:"long-month-day-year-short-time",day:"long-month-day-year",month:"long-month-day-year",year:"year"};c.getAttribute=l;c.getAttributes=function(u,K){const d=[];if("class-breaks"===u.type||"heatmap"===u.type)d.push(l(u,"number"));else if("unique-value"===u.type){var n=u.authoringInfo;if(n&&"relationship"=== n.type){if(n.field1&&n.field2){var a=n.field2.field;const g=n.field2.normalizationField;d.push(l({field:n.field1.field,normalizationField:n.field1.normalizationField}));d.push(l({field:a,normalizationField:g}))}}else a=u.uniqueValueInfos?.[0],n=null,a?.value&&(a=typeof a.value,"string"===a||"number"===a)&&(n=a),d.push(l(u,n)),[u.field2,u.field3].forEach(g=>g&&d.push({type:"field",field:g}))}else"attributes"in u&&u.attributes?.forEach(g=>d.push(l(g,"number")));(u=K?K(u):"visualVariables"in u?u.visualVariables: null)&&u.forEach(g=>d.push(l(g,"number")));return p.unique(d.filter(p.isSome),(g,w)=>"field"===g.type&&"field"===w.type?g.field===w.field:"normalized-field"===g.type&&"normalized-field"===w.type?g.field===w.field&&g.normalizationField===w.normalizationField:"expression"===g.type&&"expression"===w.type?g.expression===w.expression:!1)};c.getColorsForRendererValues=async function(u){const K=new Map;if(!u)return K;if("unique-value"!==u.type||u.authoringInfo?.type)if("class-breaks"===u.type){var d=u.classBreakInfos.map(g=> ({value:g.minValue,color:A.getColorFromSymbol(g.symbol,null)})).reverse();const {field:n,valueExpression:a}=u;await e(K,n??a,d)}else"simple"===u.type&&await e(K,"default",[{value:"default",color:A.getColorFromSymbol(u.symbol,null)}]);else{d=(u.uniqueValueInfos??[]).map(z=>({value:z.value,color:A.getColorFromSymbol(z.symbol,null)}));const {field:n,field2:a,field3:g,valueExpression:w,fieldDelimiter:D}=u,I=[n,a,g].filter(Boolean).join(D||"");(I||w)&&await e(K,I||w,d)}"defaultSymbol"in u&&u.defaultSymbol&& await e(K,"default",[{value:"default",color:A.getColorFromSymbol(u.defaultSymbol,null)}]);if("visualVariables"in u&&u.visualVariables){u=u.visualVariables.filter(n=>"color"===n.type);for(const n of u)u=await y.getRampStops(n)??[],await e(K,n.field||n.valueExpression,u)}return K};c.getColorsFromRenderer=async function(u){const K=new Map;if(!u)return K;if("visualVariables"in u&&u.visualVariables){var d=u.visualVariables.filter(a=>"color"===a.type);for(var n of d)d=(await y.getRampStops(n)??[]).map(a=> a.color),await k(K,n.field||n.valueExpression,d)}if("heatmap"===u.type)n=b.getHeatmapRampStops(u).map(a=>a.color),await k(K,u.field||u.valueExpression,n);else if("pie-chart"===u.type){for(const a of u.attributes)await k(K,a.field||a.valueExpression,[a.color]);await k(K,"default",[u?.othersCategory?.color,A.getColorFromSymbol(u.backgroundFillSymbol,null)])}else if("dot-density"===u.type){for(const a of u.attributes)await k(K,a.field||a.valueExpression,[a.color]);await k(K,"default",[u.backgroundColor])}else if("unique-value"=== u.type)if("predominance"===u.authoringInfo?.type)for(const a of u.uniqueValueInfos??[])await k(K,a.value.toString(),[A.getColorFromSymbol(a.symbol,null)]);else{n=(u.uniqueValueInfos??[]).map(I=>A.getColorFromSymbol(I.symbol,null));const {field:a,field2:g,field3:w,valueExpression:D}=u;(a||D)&&await k(K,a||D,n);g&&await k(K,g,n);w&&await k(K,w,n)}else if("class-breaks"===u.type){n=u.classBreakInfos.map(w=>A.getColorFromSymbol(w.symbol,null));const {field:a,valueExpression:g}=u;await k(K,a??g,n)}else"simple"=== u.type&&await k(K,"default",[A.getColorFromSymbol(u.symbol,null)]);"defaultSymbol"in u&&u.defaultSymbol&&await k(K,"default",[A.getColorFromSymbol(u.defaultSymbol,null)]);K.forEach((a,g)=>{a=p.unique(a.filter(Boolean),(w,D)=>JSON.stringify(w)===JSON.stringify(D));K.set(g,a)});return K};c.setLabelsForClassBreaks=function(u){const K=u.classBreakInfos,d=u.normalizationType;let n=[];if(K?.length)if("standard-deviation"===u.classificationMethod)h.getLogger("esri.renderers.support.utils").warn("setLabelsForClassBreaks", "cannot set labels for class breaks generated using 'standard-deviation' method.");else if(u.round){n.push(K[0].minValue);for(const a of K)n.push(a.maxValue);n=F.round(n);K.forEach((a,g)=>{a.label=f({minValue:0===g?n[0]:n[g],maxValue:n[g+1],isFirstBreak:0===g,normalizationType:d})})}else K.forEach((a,g)=>{a.label=f({minValue:a.minValue,maxValue:a.maxValue,isFirstBreak:0===g,normalizationType:d})})};c.timelineDateFormatOptions=r;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/support/numberUtils":function(){define(["exports", "../../intl","../../intl/number"],function(c,p,h){function C(y,b){return y-b}function H(y,b){let k;k=Number(y.toFixed(b));ky.fractional?0:y.fractional-b):(y.fractional+=b,y.integer=b>y.integer?1:y.integer-b);return y}return{integer:0,fractional:0}}function M(y,b,k,e){const f={previous:null,next:null};if(null!=k){const l=y-k;f.previous=Math.floor(Math.abs(100*(b-k-l)/l))}null!=e&&(y=e-y,f.next=Math.floor(Math.abs(100*(e-b-y)/y)));return f}const Q=/^-?(\d+)(\.(\d+))?$/i,A={maximumFractionDigits:20}; c.format=function(y){return h.formatNumber(y,A)};c.numDigits=F;c.percentChange=M;c.round=function(y,b={}){y=y.slice(0);const {tolerance:k=2,strictBounds:e=!1,indexes:f=y.map((m,v)=>v)}=b;f.sort(C);for(b=0;b{"object"===w.type&&w.resource?.href||(g="water"===w.type?w.color:w.material?w.material.color:null)});return g?new h(g):null}function e(a,g){if(null==g||null==a)return a;a=a.toRgba();a[3]*=g;return new h(a)}function f(a,g,w){if(a=a.symbolLayers){var D=I=>{g=g??I??(null!=w?n:null);return e(g,w)};a.forEach(I=>{if("object"!==I.type||!I.resource?.href||g)if("water"===I.type)I.color=D(I.color);else{const z= D(null!=I.material?I.material.color:null);null==I.material?I.material=new b.Symbol3DMaterial({color:z}):I.material.color=z;null!=w&&"outline"in I&&null!=I.outline?.color&&(I.outline.color=e(I.outline.color,w))}})}}async function l(a,g){(a=a.symbolLayers)&&await H.forEach(a,async w=>m(w,g))}async function m(a,g){switch(a.type){case "extrude":a.size="number"===typeof g[2]?g[2]:0;break;case "icon":case "line":case "text":g=v(g);null!=g&&(a.size=g);break;case "path":const w=u(g,M.ONES,[a.width,void 0, a.height]);a.width=d(g[0],a.width,1,w);a.height=d(g[2],a.height,1,w);break;case "object":await r(a,g)}}function v(a){for(const g of a)if("number"===typeof g)return g;return null}async function r(a,g){const {resourceSize:w,symbolSize:D}=await K(a),I=u(g,w,D);a.width=d(g[0],D[0],w[0],I);a.depth=d(g[1],D[1],w[1],I);a.height=d(g[2],D[2],w[2],I)}function u(a,g,w){for(let D=0;3>D;D++){const I=a[D];switch(I){case "symbol-value":return a=w[D],null!=a?a/g[D]:1;case "proportional":break;default:if(I&&g[D])return I/ g[D]}}return 1}async function K(a){var {computeObjectLayerResourceSize:g}=await new Promise((B,J)=>c(["./symbolLayerUtils"],B,J));g=await g(a,10);const {width:w,height:D,depth:I}=a;a=[w,I,D];let z=1;for(var q=0;3>q;q++){const B=a[q];if(null!=B){z=B/g[q];break}}for(q=0;3>q;q++)null==a[q]&&(a[q]=g[q]*z);return{resourceSize:g,symbolSize:a}}function d(a,g,w,D){switch(a){case "proportional":return w*D;case "symbol-value":return null!=g?g:w;default:return a}}const n=new h("white");p.applyColorToSymbol= function(a,g,w){if(a&&(g||null!=w))if(g&&=new h(g),C.isSymbol3D(a))f(a,g,w);else if(C.isSymbol2D(a)){if(g=g??a.color)a.color=e(g,w);null!=w&&"outline"in a&&a.outline?.color&&(a.outline.color=e(a.outline.color,w))}};p.applyOpacityToColor=e;p.applyRotationToSymbol=function(a,g,w){a&&null!=g&&(C.isSymbol3D(a)?(a=a.symbolLayers)&&a.forEach(D=>{if(D&&"object"===D.type)switch(w){case "tilt":D.tilt=(D.tilt??0)+g;break;case "roll":D.roll=(D.roll??0)+g;break;default:D.heading=(D.heading??0)+g}}):!C.isSymbol2D(a)|| "simple-marker"!==a.type&&"picture-marker"!==a.type&&"text"!==a.type||(a.angle+=g))};p.applySizesToSymbol=async function(a,g){if(a&&g){if(C.isSymbol3D(a))return l(a,g);if(C.isSymbol2D(a)&&(g=v(g),null!=g))switch(a.type){case "simple-marker":a.size=g;break;case "picture-marker":const w=a.width/a.height;1"bloom"!==g.type).map(g=>g.toJSON());return Q.effectFunctionsFromJSON(a)};p.getColorFromSymbol=function(a,g){if(!a)return null;let w=null;C.isSymbol3D(a)?w=k(a):C.isSymbol2D(a)&&(w="cim"===a.type?A.getCIMSymbolColor(a):a.color?new h(a.color):null);return w?e(w,g):null};p.getIconHref=function(a){return a.resource?.href??""};p.getSymbolOutlineSize=function(a){return a?C.isSymbol3D(a)?(a=(a=a.symbolLayers?.at(-1))&& "outline"in a?a?.outline?.size:void 0,null!=a?a:0):F.px2pt(y.getStroke(a)?.width):0};p.isVolumetricSymbol=function(a){if(null==a||!("symbolLayers"in a)||null==a.symbolLayers)return!1;switch(a.type){case "point-3d":return a.symbolLayers.some(g=>"object"===g.type);case "line-3d":return a.symbolLayers.some(g=>"path"===g.type);case "polygon-3d":return a.symbolLayers.some(g=>"object"===g.type||"extrude"===g.type);default:return!1}};p.symbolHasExtrudeSymbolLayer=function(a){return null!=a&&"polygon-3d"=== a.type&&a.symbolLayers.some(g=>"extrude"===g.type)};Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/cimSymbolUtils":function(){define(["exports","../../Color","../cim/utils"],function(c,p,h){function C(b){b=h.toCIMSymbolJSON(b);if("CIMTextSymbol"===b?.type)return b.height??0;let k=0;if(b?.symbolLayers)for(const e of b.symbolLayers)h.isCIMMarker(e)&&null!=e.size&&e.size>k?k=e.size:h.isCIMStroke(e)&&null!=e.width&&e.width>k?k=e.width:h.isCIMFill(e);return k}function H(b, k,e,f){if(b)if("CIMTextSymbol"===b.type)null!=b.height&&(b.height*=k);else{if(e&&b.effects)for(const l of b.effects)M(l,k);if(b.symbolLayers)for(const l of b.symbolLayers)switch(l.type){case "CIMPictureMarker":case "CIMVectorMarker":G(l,k,f);break;case "CIMPictureStroke":case "CIMSolidStroke":!f?.preserveOutlineWidth&&l.width&&(l.width*=k);break;case "CIMPictureFill":l.height&&(l.height*=k);l.offsetX&&(l.offsetX*=k);l.offsetY&&(l.offsetY*=k);break;case "CIMHatchFill":H(l.lineSymbol,k,!0,{...f,preserveOutlineWidth:!1}), l.offsetX&&(l.offsetX*=k),l.offsetY&&(l.offsetY*=k),l.separation&&(l.separation*=k)}}}function G(b,k,e){if(b&&(b.markerPlacement&&F(b.markerPlacement,k),b.offsetX&&(b.offsetX*=k),b.offsetY&&(b.offsetY*=k),b.anchorPoint&&"Absolute"===b.anchorPointUnits&&(b.anchorPoint={x:b.anchorPoint.x*k,y:b.anchorPoint.y*k}),b.size=null!=b.size?b.size*k:0,"CIMVectorMarker"===b.type&&b.markerGraphics))for(const f of b.markerGraphics)b.scaleSymbolsProportionally||H(f.symbol,k,!0,e)}function F(b,k){h.isCIMMarkerStrokePlacement(b)&& b.offset&&(b.offset*=k);switch(b.type){case "CIMMarkerPlacementAlongLineRandomSize":case "CIMMarkerPlacementAlongLineSameSize":b.customEndingOffset&&(b.customEndingOffset*=k);b.offsetAlongLine&&(b.offsetAlongLine*=k);if(b.placementTemplate&&b.placementTemplate.length){var e=b.placementTemplate.map(f=>f*k);b.placementTemplate=e}break;case "CIMMarkerPlacementAlongLineVariableSize":b.maxRandomOffset&&(b.maxRandomOffset*=k);b.placementTemplate&&b.placementTemplate.length&&(e=b.placementTemplate.map(f=> f*k),b.placementTemplate=e);break;case "CIMMarkerPlacementOnLine":b.startPointOffset&&(b.startPointOffset*=k);break;case "CIMMarkerPlacementAtExtremities":b.offsetAlongLine&&(b.offsetAlongLine*=k);break;case "CIMMarkerPlacementAtRatioPositions":b.beginPosition&&(b.beginPosition*=k);b.endPosition&&(b.endPosition*=k);break;case "CIMMarkerPlacementPolygonCenter":b.offsetX&&(b.offsetX*=k);b.offsetY&&(b.offsetY*=k);break;case "CIMMarkerPlacementInsidePolygon":b.offsetX&&(b.offsetX*=k),b.offsetY&&(b.offsetY*= k),b.stepX&&(b.stepX*=k),b.stepY&&(b.stepY*=k)}}function M(b,k){switch(b.type){case "CIMGeometricEffectArrow":case "CIMGeometricEffectDonut":b.width&&(b.width*=k);break;case "CIMGeometricEffectBuffer":b.size&&(b.size*=k);break;case "CIMGeometricEffectCut":b.beginCut&&(b.beginCut*=k);b.endCut&&(b.endCut*=k);b.middleCut&&(b.middleCut*=k);break;case "CIMGeometricEffectDashes":b.customEndingOffset&&(b.customEndingOffset*=k);b.offsetAlongLine&&(b.offsetAlongLine*=k);if(b.dashTemplate&&b.dashTemplate.length){const e= b.dashTemplate.map(f=>f*k);b.dashTemplate=e}break;case "CIMGeometricEffectExtension":case "CIMGeometricEffectJog":case "CIMGeometricEffectRadial":b.length&&(b.length*=k);break;case "CIMGeometricEffectMove":b.offsetX&&(b.offsetX*=k);b.offsetY&&(b.offsetY*=k);break;case "CIMGeometricEffectOffset":case "CIMGeometricEffectOffsetTangent":b.offset&&(b.offset*=k);break;case "CIMGeometricEffectRegularPolygon":b.radius&&(b.radius*=k);break;case "CIMGeometricEffectTaperedPolygon":b.fromWidth&&(b.fromWidth*= k);b.length&&(b.length*=k);b.toWidth&&(b.toWidth*=k);break;case "CIMGeometricEffectWave":b.amplitude&&(b.amplitude*=k),b.period&&(b.period*=k)}}function Q(b,k){if(b){var e="CIMTextSymbol"===b.type?b.symbol:b;b="CIMPolygonSymbol"===b.type;if(e?.symbolLayers)for(const f of e.symbolLayers)if(!(f.colorLocked||b&&(h.isCIMStroke(f)||h.isCIMMarker(f)&&f.markerPlacement&&h.isCIMMarkerStrokePlacement(f.markerPlacement))))switch(f.type){case "CIMPictureMarker":case "CIMPictureStroke":case "CIMPictureFill":f.tintColor&& A(k,f.tintColor);break;case "CIMVectorMarker":f.markerGraphics?.forEach(l=>{Q(l.symbol,k)});break;case "CIMSolidStroke":case "CIMSolidFill":A(k,f.color);break;case "CIMHatchFill":Q(f.lineSymbol,k)}}}function A(b,k){for(const e of b)if(e.join(".")===k.join("."))return;b.push(k)}function y(b,k,e){if(b){var f="CIMTextSymbol"===b.type?b.symbol:b;b="CIMPolygonSymbol"===f?.type;if(f?.symbolLayers)for(const l of f.symbolLayers)if(!l.colorLocked){if(b)if(e){if({layersToColor:f}=e,(h.isCIMStroke(l)||h.isCIMMarker(l)&& l.markerPlacement&&h.isCIMMarkerStrokePlacement(l.markerPlacement))&&"fill"===f||h.isCIMFill(l)&&"outline"===f)continue}else if(h.isCIMStroke(l)||h.isCIMMarker(l)&&l.markerPlacement&&h.isCIMMarkerStrokePlacement(l.markerPlacement))continue;f=k.toArray();switch(l.type){case "CIMPictureMarker":case "CIMPictureStroke":case "CIMPictureFill":l.tintColor=f;break;case "CIMVectorMarker":l.markerGraphics?.forEach(m=>{y(m.symbol,k,e)});break;case "CIMSolidStroke":case "CIMSolidFill":l.color=f;break;case "CIMHatchFill":y(l.lineSymbol, k,e)}}}}c.applyCIMSymbolColor=function(b,k,e){k instanceof p||(k=new p(k));(b=h.toCIMSymbolJSON(b))&&y(b,k,e)};c.applyCIMSymbolRotation=function(b,k,e=!1){b=h.toCIMSymbolJSON(b);e&&(k=360-k);if("CIMTextSymbol"===b?.type)b.angle=k;else if("CIMPointSymbol"===b?.type&&b.symbolLayers){e=k-(b.angle||0);for(const f of b.symbolLayers)if(h.isCIMMarker(f)){let l=f.rotation||0;l=f.rotateClockwise?l-e:l+e;f.rotation=l}b.angle=k}};c.getCIMSymbolColor=function(b){b=h.toCIMSymbolJSON(b);const k=[];Q(b,k);return k.length? new p(h.normalizeAlpha(k[0])):null};c.getCIMSymbolRotation=function(b,k=!1){b=h.toCIMSymbolJSON(b);return"CIMTextSymbol"===b?.type||"CIMPointSymbol"===b?.type?(b=b.angle,null!=b&&k?360-b:b??0):0};c.getCIMSymbolSize=C;c.getCIMSymbolType=function(b){b=h.toCIMSymbolJSON(b);if(!b)return null;switch(b.type){case "CIMPointSymbol":return"CIMPointSymbol";case "CIMLineSymbol":return"CIMLineSymbol";case "CIMPolygonSymbol":return"CIMPolygonSymbol";case "CIMTextSymbol":return"CIMTextSymbol";case "CIMMeshSymbol":return"CIMMeshSymbol"; default:return null}};c.scaleCIMMarker=G;c.scaleCIMSymbol=H;c.scaleCIMSymbolTo=function(b,k,e){if(b){var f=h.toCIMSymbolJSON(b);b=C(b);if(0===b){if(f)if("CIMTextSymbol"===f.type)f.height=k;else if(f.symbolLayers)for(const l of f.symbolLayers)switch(l.type){case "CIMPictureMarker":case "CIMVectorMarker":l.size=k;break;case "CIMPictureStroke":case "CIMSolidStroke":l.width=k}}else H(f,k/b,!1,e)}};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/gfxUtils":function(){define("exports ../../assets ../../Color ../../request ../../core/LRUCache ../../core/screenUtils ./cimSymbolUtils".split(" "), function(c,p,h,C,H,G,F){function M(k){if(!k)return null;let e=null;switch(k.type){case "simple-fill":case "picture-fill":case "simple-marker":e=M(k.outline);break;case "simple-line":const f=G.pt2px(k.width);null!=k.style&&"none"!==k.style&&0!==f&&(e={color:k.color,style:b(k.style),width:f,cap:k.cap,join:"miter"===k.join?G.pt2px(k.miterLimit):k.join},e.dashArray=Q(e).join(",")||"none");break;default:e=null}return e}function Q(k){if(!k?.style)return[];const {dashArray:e,style:f,width:l}=k;if("string"=== typeof e&&"none"!==e)return e.split(",").map(r=>Number(r));const m=l??0,v=A.has(f)?A.get(f).map(r=>r*m):[];if("butt"!==k.cap)for(const [r,u]of v.entries())v[r]=1===r%2?u+m:Math.max(u-m,1);return v}const A=new Map([["dash",[4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),y=new H.LRUCache(1E3),b=(()=>{const k={};return e=> {if(k[e])return k[e];const f=e.replaceAll("-","");return k[e]=f}})();h=new h([128,128,128]);c.defaultThematicColor=h;c.dekebabifyLineStyle=b;c.getDashArray=Q;c.getFill=function(k){const e=k.style;let f=null;if(k)switch(k.type){case "simple-marker":"cross"!==e&&"x"!==e&&(f=k.color);break;case "simple-fill":e&&"solid"!==e?"none"!==e&&(f={type:"pattern",x:0,y:0,src:p.getAssetUrl(`esri/symbols/patterns/${e}.png`),width:5,height:5}):f=k.color;break;case "picture-fill":f={type:"pattern",src:k.url,width:G.pt2px(k.width)* k.xscale,height:G.pt2px(k.height)*k.yscale,x:G.pt2px(k.xoffset),y:G.pt2px(k.yoffset)};break;case "text":f=k.color;break;case "cim":f=F.getCIMSymbolColor(k)}return f};c.getPatternUrlWithColor=function(k,e){const f=k+"-"+e;return void 0!==y.get(f)?Promise.resolve(y.get(f)):C(k,{responseType:"image"}).then(l=>{l=l.data;const m=l.naturalWidth,v=l.naturalHeight,r=document.createElement("canvas");r.width=m;r.height=v;const u=r.getContext("2d");u.fillStyle=e;u.fillRect(0,0,m,v);u.globalCompositeOperation= "destination-in";u.drawImage(l,0,0);l=r.toDataURL();y.put(f,l);return l})};c.getStroke=M;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Legend/support/colorRampUtils":function(){define(["require","exports","../../../Color","./utils"],function(c,p,h,C){function H(A,y){const b=[],k=A.length-1;5===A.length?b.push(0,2,4):b.push(0,k);return A.map((e,f)=>b.includes(f)?C.createStopLabel(e,f,k,y):null)}async function G(A,y,b){b=new h(b??Q);A=(await new Promise((k,e)=>c(["../../../renderers/visualVariables/support/visualVariableUtils"], k,e))).getOpacity(y,A);null!=A&&(b.a=A);return b}function F(A,y){const {startIndex:b,endIndex:k,weight:e}=M(A,y);if(b===k)return y[b].color;A=h.blendColors(y[b].color,y[k].color,e);return new h(A)}function M(A,y){let b=0,k=y.length-1;y.some((e,f)=>{if(Av.value);(k=l.some(v=>!!v.label))&&(f=l.map(v=>v.label))}l=e[e.length-1];if(null==e[0]&&null==l)return null;const m=k?null:H(e,b);return(await Promise.all(e.map(async(v,r)=>{const u="opacity"===A.type?await G(v,A,y):(await new Promise((K,d)=>c(["../../../renderers/visualVariables/support/visualVariableUtils"],K,d))).getColor(A,v);return{value:v,color:u,label:k?f[r]:m?.[r]??""}}))).reverse()};p.getRampStopsForPointCloud=function(A){let y=!1,b=[],k=[];b=A.map(l=>l.value);(y=A.some(l=> !!l.label))&&(k=A.map(l=>l.label??""));const e=b[b.length-1];if(null==b[0]&&null==e)return null;const f=y?null:H(b);return b.map((l,m)=>{const v=F(l,A);return{value:l,color:v,label:y?k[m]:f?.[m]??""}}).reverse()};p.getStretchRampStops=function(A,y){let b=[];if(A&&"multipart"===A.type)A.colorRamps.reverse().forEach((k,e)=>{0===e?b.push({value:y.max,color:new h(k.toColor),label:"high"}):b.push({value:null,color:new h(k.toColor),label:""});e===A.colorRamps.length-1?b.push({value:y.min,color:new h(k.fromColor), label:"low"}):b.push({value:null,color:new h(k.fromColor),label:""})});else{let k,e;A&&"algorithmic"===A.type?(k=A.fromColor,e=A.toColor):(k=[0,0,0,1],e=[255,255,255,1]);b=[{value:y.max,color:new h(e),label:"high"},{value:y.min,color:new h(k),label:"low"}]}return b};Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Legend/support/utils":function(){define("require exports ../../../symbols ../../../core/timeUtils ../../../layers/support/fieldUtils ../../../renderers/support/numberUtils ../../../smartMapping/support/utils ../../../symbols/SimpleLineSymbol".split(" "), function(c,p,h,C,H,G,F,M){async function Q(b){if(!("visualVariables"in b&&b.visualVariables))return null;b=b.visualVariables.find(f=>"color"===f.type);if(!b)return null;var k=null,e=null;if(b.stops){if(1===b.stops.length)return b.stops[0].color;k=b.stops[0].value;e=b.stops[b.stops.length-1].value}k=null!=k&&null!=e?k+(e-k)/2:0;({getColor:e}=await new Promise((f,l)=>c(["../../../renderers/visualVariables/support/visualVariableUtils"],f,l)));return e(b,k)??null}function A(b,k){if(!k.field)return null; if("featureReduction"in b)switch(b.featureReduction?.type){case "cluster":case "binning":const e=b.featureReduction.fields.find(({name:f})=>f.toLowerCase()===k.field.toLowerCase());return e&&"getField"in b?b.getField(e.onStatisticField):null}return"getField"in b?b.getField?.(k.field):null}function y(b,k){b="popupTemplate"in b?b.popupTemplate?.fieldInfos:null;if(b?.length&&k)return b.find(e=>e.fieldName?.toLowerCase()===k.toLowerCase())?.format?.dateFormat}p.createStopLabel=function(b,k,e,f){let l= "";0===k?l="\x3c ":k===e&&(l="\x3e ");b=f?F.formatAnyDate(b,f):G.format(b);return l+b};p.getDateFormatOptions=function(b,k,e){const f=A(b,k);if(!f||!F.isAnyDateField(f)&&!H.isTimeOnlyField(f))return null;var l=y(b,f.name);if(!l&&"date"===f.type){let m=l=0;k.stops?(l=k.stops?.at(0)?.value??l,m=k.stops?.at(-1)?.value??m):"minDataValue"in k&&"maxDataValue"in k&&(l=k.minDataValue??l,m=k.maxDataValue??m);l=m-l>2*C.millisecondsPerTimeUnit.days?"short-date":"short-date-short-time"}return{fieldType:f.type, format:l,timeZoneOptions:{layerTimeZone:"preferredTimeZone"in b?b.preferredTimeZone:null,viewTimeZone:e,datesInUnknownTimezone:"datesInUnknownTimezone"in b&&b.datesInUnknownTimezone}}};p.getMedianColor=Q;p.getReferenceSizeAuthoringInfoVisualVariable=function(b){if("authoringInfo"in b)return b.authoringInfo?.visualVariables?.find(({theme:k})=>"reference-size"===k)};p.getSymbolForFlowRenderer=async function(b,k){const e=b.trailCap,f=b.trailWidth||1;b=k||await Q(b)||b.color;return new M({cap:e,color:b, width:f})};p.isRasterBandStatistics=function(b){return null!=b&&"object"===typeof b&&"min"in b&&"max"in b};p.rgbImgSource=["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAAHqZRakAAAANUlEQVQ4jWPMy8v7z0BFwMLAwMAwcdIkqhiWn5fHwEQVk5DAqIGjBo4aOGrgqIEQwEjtKgAATl0Hu6JrzFUAAAAASUVORK5CYII\x3d","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAAHqZRakAAAANUlEQVQ4jWPMy8v7z0BFwMLAwMAwaeIkqhiWl5/HwEQVk5DAqIGjBo4aOGrgqIEQwEjtKgAATl0Hu6sKxboAAAAASUVORK5CYII\x3d", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAAHqZRakAAAANUlEQVQ4jWPMy8v7z0BFwMLAwMAwadJEqhiWl5fPwEQVk5DAqIGjBo4aOGrgqIEQwEjtKgAATl0Hu75+IUcAAAAASUVORK5CYII\x3d"];p.specialCharsGreaterThan="\x3e";p.specialCharsLessThan="\x3c";Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Legend/support/heatmapRampUtils":function(){define(["exports","../../../renderers/support/HeatmapColorStop"],function(c,p){c.getHeatmapRampStops=function(h){if(!h.colorStops)return[]; const C=[...h.colorStops].filter(G=>0{let M="";0===F?M=h.legendOptions?.minLabel||"low":F===H&&(M=h.legendOptions?.maxLabel||"high");return{color:G.color,label:M,ratio:G.ratio}}).reverse()};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Feature/FeatureMedia/FeatureMediaViewModel":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/arrayUtils ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/cast ../../../core/has ../../../core/accessorSupport/decorators/subclass ../../../popup/FieldInfo ../../../popup/content/support/ChartMediaInfoValueSeries ../support/featureUtils ../support/relatedFeatureUtils".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y){const b={chartAnimation:!0};p=class extends p{constructor(k){super(k);this.abilities={...b};this.activeMediaInfoIndex=0;this.expressionAttributes=this.formattedAttributes=this.fieldInfoMap=this.description=this.attributes=null;this.isAggregate=!1;this.title=this.relatedInfos=this.popupTemplate=this.mediaInfos=this.layer=null}castAbilities(k){return{...b,...k}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()|| []}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(k){this._setContentElementMedia(k)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(k){const {formattedMediaInfoCount:e}=this;this.activeMediaInfoIndex=(k+e)%e}_pageContentElementMedia(k){const {activeMediaInfoIndex:e}=this;this._setContentElementMedia(e+k)}_formatMediaInfos(){const {mediaInfos:k,layer:e}=this,f=this.attributes??{},l=this.formattedAttributes?? {},m=this.expressionAttributes??{},v=this.fieldInfoMap??new Map;return k?.map(r=>{r=r?.clone();if(!r)return null;r.title=A.substituteFieldsInLinksAndAttributes({attributes:f,fieldInfoMap:v,globalAttributes:l,expressionAttributes:m,layer:e,text:r.title});r.caption=A.substituteFieldsInLinksAndAttributes({attributes:f,fieldInfoMap:v,globalAttributes:l,expressionAttributes:m,layer:e,text:r.caption});r.altText=A.substituteFieldsInLinksAndAttributes({attributes:f,fieldInfoMap:v,globalAttributes:l,expressionAttributes:m, layer:e,text:r.altText});if("image"===r.type){if(!r.value)return;this._setImageValue({value:r.value,formattedAttributes:l,layer:e});return r.value.sourceURL?r:void 0}if("pie-chart"===r.type||"line-chart"===r.type||"column-chart"===r.type||"bar-chart"===r.type){if(!r.value)return;this._setChartValue({value:r.value,chartType:r.type,attributes:f,formattedAttributes:l,layer:e,expressionAttributes:m});return r}return null}).filter(h.isSome)??[]}_setImageValue(k){const e=this.fieldInfoMap??new Map,{value:f, formattedAttributes:l,layer:m}=k,{linkURL:v,sourceURL:r}=f;r&&(k=A.fixTokens(r,m),f.sourceURL=A.substituteAttributes({formattedAttributes:l,template:k,fieldInfoMap:e}));v&&(k=A.fixTokens(v,m),f.linkURL=A.substituteAttributes({formattedAttributes:l,template:k,fieldInfoMap:e}))}_setChartValue(k){const {value:e,attributes:f,formattedAttributes:l,chartType:m,layer:v,expressionAttributes:r}=k,{popupTemplate:u,relatedInfos:K}=this,{fields:d,normalizeField:n}=e;e.fields=A.getFixedFieldNames(d,v);n&&(e.normalizeField= A.getFixedFieldName(n,v));if(d.some(g=>!!(null!=l[g]||A.isRelatedField(g)&&K?.size))){var a=u?.fieldInfos??[];d.forEach((g,w)=>{w=e.colors?.[w];A.isRelatedField(g)?e.series=[...e.series,...this._getRelatedChartInfos({fieldInfos:a,fieldName:g,formattedAttributes:l,chartType:m,value:e,color:w})]:(g=this._getChartOption({value:e,attributes:f,chartType:m,formattedAttributes:l,expressionAttributes:r,fieldName:g,fieldInfos:a,color:w}),e.series.push(g))})}}_getRelatedChartInfos(k){const {fieldInfos:e,fieldName:f, formattedAttributes:l,chartType:m,value:v,color:r}=k,u=[],K=y.getRelatedFieldInfo(f);k=K&&this.relatedInfos?.get(K.layerId.toString());if(!k)return u;const {relatedFeatures:d,relation:n}=k;if(!n||!d)return u;({cardinality:k}=n);d.forEach(a=>{const {attributes:g}=a;g&&Object.keys(g).forEach(w=>{w===K.fieldName&&u.push(this._getChartOption({value:v,attributes:g,formattedAttributes:l,fieldName:f,chartType:m,relatedFieldName:w,hasMultipleRelatedFeatures:1N.id===parseInt(t,10)?(E=N,!0):!1);return E}function W({originRelationship:t,relationships:x,layerId:E}){return x.find(({relatedTableId:N,id:P})=>`${N}`===E&&P===t?.id)??null}function Z(t,x){x=x.toLowerCase();for(const E in t)if(E.toLowerCase()===x)return t[E];return null}function ca(t,x,E,N){const P=new O;P.outFields=["*"]; P.relationshipId="number"===typeof x.id?x.id:parseInt(x.id,10);P.objectIds=[t.attributes[E.objectIdField]];P.gdbVersion=E.gdbVersion??null;P.historicMoment=E.historicMoment??null;return E.queryRelatedFeatures?.(P,N)??Promise.resolve({})}function da(t,x,E){let N=0;const P=[];for(;NJSON.stringify(x.toJSON())===JSON.stringify(E.toJSON())):void 0} async function ha(t,x,E,N){var P=E.layerId.toString();const {layerInfo:R,relation:X,relatedFields:Y,outStatistics:aa,url:la,sourceSpatialReference:ma}=x;x=ba(Y);const ja=fa(aa);if(!R||!X)return null;const ka=W({originRelationship:X,relationships:R.relationships,layerId:P});if(ka?.relationshipTableId&&ka.keyFieldInRelationshipTable){P=(await ca(t,ka,E,N))[t.attributes[E.objectIdField]];if(!P)return null;var na=P.features.map(oa=>oa.attributes[R.objectIdField]);if(ja?.length&&R.supportsStatistics)return N= new B,N.where=da(R.objectIdField,na,1E3),N.outFields=x,N.outStatistics=ja,N.sourceSpatialReference=ma,N={features:Promise.resolve(P),statsFeatures:A.executeQueryJSON(la,N)},G.eachAlways(N)}return(P=ka?.keyField)?(na=F.isNumericField(ia(R.fields,P)),t=Z(t.attributes,X.keyField),t=na?`${P}=${t}`:`${P}='${t}'`,E=A.executeQueryJSON(la,new B({where:t,outFields:x,sourceSpatialReference:ma,historicMoment:E.historicMoment,gdbVersion:E.gdbVersion}),N),N=ja?.length&&R.supportsStatistics?A.executeQueryJSON(la, new B({where:t,outFields:x,outStatistics:ja,sourceSpatialReference:ma}),N):null,x={features:E},N&&(x.statsFeatures=N),G.eachAlways(x)):null}function ia(t,x){if(null!=t){x=x.toLowerCase();for(const E of t)if(E&&E.name.toLowerCase()===x)return E}return null}const ea=new Map;c.createRelatedInfo=function(t,x){if(t=U(t,x))return{url:`${x.url}/${t.relatedTableId}`,sourceSpatialReference:x.spatialReference,relation:t,relatedFields:[],outStatistics:[]}};c.getDestinationRelation=W;c.getRelatedFieldInfo=function(t){if(!V.isRelatedField(t))return null; const [x,E]=t.split("/").slice(1);return{layerId:x,fieldName:E}};c.getUniqueOutFields=ba;c.getUniqueOutStatistics=fa;c.queryLayerInfos=function({relatedInfos:t,layer:x},E){const N={};t.forEach((P,R)=>{({relation:P}=P);if(!P)throw R=new C("relation-required","A relation is required on a layer to retrieve related records."),H.getLogger("esri.widgets.Feature.support.relatedFeatureUtils").error(R),R;({relatedTableId:P}=P);if("number"!==typeof P)throw R=new C("A related table ID is required on a layer to retrieve related records."), H.getLogger("esri.widgets.Feature.support.relatedFeatureUtils").error(R),R;P=`${x.url}/${P}`;const X=ea.get(P),Y=X??p(P,{query:{f:"json"},signal:(void 0)?.signal});X||ea.set(P,Y);N[R]=Y});return G.whenOrAbort(G.eachAlways(N),E)};c.queryRelatedFeatures=function({graphic:t,relatedInfos:x,layer:E},N){const P={};x.forEach((R,X)=>{R.layerInfo&&(P[X]=ha(t,R,E,N))});return G.eachAlways(P)};c.setRelatedFeatures=function(t,x){if(x&&t){var {features:E,statsFeatures:N}=t;t=E?.value;x.relatedFeatures=t?t.features: [];t=N?.value;x.relatedStatsFeatures=t?t.features:[]}};c.updateRelatedInfo=function({relatedInfo:t,fieldName:x,fieldInfo:E}){t.relatedFields?.push(x);E.statisticType&&(x=new S({statisticType:E.statisticType,onStatisticField:x,outStatisticFieldName:x}),t.outStatistics?.push(x))};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Feature/FeatureExpression/FeatureExpressionViewModel":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../Graphic ../../../core/Accessor ../../../core/reactiveUtils ../../../core/throttle ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../popup/content/AttachmentsContent ../../../popup/content/Content ../../../popup/content/CustomContent ../../../popup/content/ExpressionContent ../../../popup/content/FieldsContent ../../../popup/content/MediaContent ../../../popup/content/RelationshipContent ../../../popup/content/TextContent ../../../popup/ElementExpressionInfo ../FeatureContent/FeatureContentViewModel ../FeatureFields/FeatureFieldsViewModel ../FeatureMedia/FeatureMediaViewModel ../support/arcadeFeatureUtils ../../../geometry/Point".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b,k,e,f,l,m,v,r,u,K,d,n,a,g){p=class extends C{constructor(w){super(w);this.view=this.location=this.interceptor=this.contentElementViewModel=this.contentElement=this.graphic=this.expressionInfo=this._abortController=null;this._cancelQuery=()=>{const {_abortController:D}=this;D&&D.abort();this._abortController=null};this._createVM=()=>{var D=this.contentElement?.type;this.contentElementViewModel?.destroy();D="fields"===D?new d:"media"===D?new n:"text"===D?new K:null; this._set("contentElementViewModel",D)};this._compile=async()=>{this._cancelQuery();const D=new AbortController;this._abortController=D;await this._compileExpression();this._abortController===D&&(this._abortController=null)};this._compileThrottled=G.throttle(this._compile,1,this);this._compileExpression=async()=>{const {expressionInfo:D,graphic:I,interceptor:z,spatialReference:q,map:B,location:J,view:L,_abortController:O}=this;if(D&&I){var T=await a.loadArcade();if(O===this._abortController)if((T= await a.createCompiledExpression({arcade:T,expressionInfo:D,graphic:I,location:J,interceptor:z,map:B,spatialReference:q,view:L}))&&"esri.arcade.Dictionary"===T.declaredClass){T=await T.castAsJsonAsync(O?.signal);var S=T?.type;T="media"===S?m.fromJSON(T):"text"===S?r.fromJSON(T):"fields"===S?l.fromJSON(T):null;this._set("contentElement",T)}else this._set("contentElement",null)}else this._set("contentElement",null)};this.addHandles([H.watch(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference, this.view],()=>this._compileThrottled(),H.initial),H.watch(()=>[this.contentElement],()=>this._createVM(),H.initial)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){this._cancelQuery();this.contentElementViewModel?.destroy();this._set("contentElementViewModel",null);this._set("contentElement",null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(w){this._override("spatialReference",w)}get state(){const {_abortController:w,contentElement:D,contentElementViewModel:I}= this;return w?"loading":D||I?"ready":"disabled"}get map(){return this.view?.map??null}set map(w){this._override("map",w)}};c.__decorate([F.property()],p.prototype,"_abortController",void 0);c.__decorate([F.property({type:u})],p.prototype,"expressionInfo",void 0);c.__decorate([F.property({type:h})],p.prototype,"graphic",void 0);c.__decorate([F.property({readOnly:!0})],p.prototype,"contentElement",void 0);c.__decorate([F.property({readOnly:!0})],p.prototype,"contentElementViewModel",void 0);c.__decorate([F.property()], p.prototype,"interceptor",void 0);c.__decorate([F.property({type:g})],p.prototype,"location",void 0);c.__decorate([F.property()],p.prototype,"spatialReference",null);c.__decorate([F.property({readOnly:!0})],p.prototype,"state",null);c.__decorate([F.property()],p.prototype,"map",null);c.__decorate([F.property()],p.prototype,"view",void 0);return p=c.__decorate([y.subclass("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],p)})},"esri/core/throttle":function(){define(["exports"], function(c){c.throttle=function(p,h,C,H){let G=null,F=1E3;"number"===typeof h?(F=h,H=C):(G=h??null,F=C);let M=0,Q;const A=()=>{M=0;p.apply(H,Q)};h=(...y)=>{G&&G.apply(H,y);Q=y;F?M||=setTimeout(A,F):A()};h.remove=()=>{M&&(clearTimeout(M),M=0)};h.forceUpdate=()=>{M&&(clearTimeout(M),A())};h.hasPendingUpdates=()=>!!M;return h};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Feature/support/arcadeFeatureUtils":function(){define("require exports ../../../core/Logger ../../../core/promiseUtils ../../../layers/FeatureLayer ./featureUtils ../../support/globalCss".split(" "), function(c,p,h,C,H,G,F){function M(e){return`
    ${e.map(f=>`
  • ${"string"===typeof f?G.applyTextFormattingHTML(G.htmlEntities(f)):f}
  • `).join("")}
`}function Q(e){const f=e.keys().map(l=>{var m=e.field(l);m="string"===typeof m?G.applyTextFormattingHTML(G.htmlEntities(m)):m;return`${l}${m}`}).join("");return`${f}
`}function A(){return new Promise((e,f)=>c(["../../../arcade"],e,f))}async function y({graphic:e, view:f,options:l}){const {isAggregate:m,layer:v}=e;if(!m||!v||"2d"!==f?.type)return[];f=await f.whenLayerView(v);if(!("createQuery"in f&&"queryFeatures"in f))return[];const r=f.createQuery();e=e.getObjectId();r.aggregateIds=null!=e?[e]:[];({features:l}=await f.queryFeatures(r,l));return l}function b({layer:e,aggregatedFeatures:f,interceptor:l}){const {fields:m,objectIdField:v,geometryType:r,spatialReference:u,displayField:K}=e;return new H({fields:m,objectIdField:v,geometryType:r,spatialReference:u, displayField:K,interceptor:l,...("feature"===e.type?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null),source:f})}async function k({expressionInfo:e,arcade:f,interceptor:l,spatialReference:m,map:v,graphic:r,location:u,view:K,options:d}){if(!e?.expression)return null;var {isAggregate:n}=r;const a=(r.sourceLayer||r.layer)??void 0;n=n?"feature-reduction-popup":"popup";const g=f.createArcadeProfile(n);f=f.createArcadeExecutor(e.expression,g).catch(z=>h.getLogger("esri.widgets.Feature.support.arcadeFeatureUtils").error("arcade-executor-error", {error:z,expressionInfo:e}));const [w,D]=await Promise.all([y({graphic:r,view:K,options:d}),f]);if(!D)return null;const I="feature-reduction-popup"===n?b({layer:a,aggregatedFeatures:w,interceptor:l}):void 0;return await D.executeAsync({...("feature-reduction-popup"===n?{$aggregatedFeatures:I}:{$datastore:a?.url,$layer:"feature"===a?.type||"subtype-sublayer"===a?.type||"catalog-footprint"===a?.type||"oriented-imagery"===a?.type?a:"scene"===a?.type&&null!=a.associatedLayer?a.associatedLayer:void 0, $map:v,$userInput:u,$graph:"knowledge-graph-sublayer"===a?.type?a?.parentCompositeLayer?.knowledgeGraph:void 0}),$feature:r},{abortSignal:d?.signal??void 0,interceptor:l??void 0,rawOutput:!0,spatialReference:m??void 0,timeZone:K?.timeZone}).catch(z=>h.getLogger("esri.widgets.Feature.support.arcadeFeatureUtils").error("arcade-execution-error",{error:z,graphic:r,expressionInfo:e})).finally(()=>I?.destroy())}p.createCompiledExpression=k;p.createCompiledExpressions=async function({expressionInfos:e,spatialReference:f, graphic:l,interceptor:m,map:v,view:r,location:u,options:K}){if(!e?.length)return{};const d=await A(),n={};for(const a of e)n[`expression/${a.name}`]=k({expressionInfo:a,arcade:d,interceptor:m,spatialReference:f,map:v,graphic:l,location:u,view:r,options:K});e=await C.eachAlways(n);f={};for(const a in e)l=e[a].value,l="string"===typeof l?G.applyTextFormattingHTML(G.htmlEntities(l)):Array.isArray(l)?M(l):"esri.arcade.Dictionary"===l?.declaredClass?Q(l):l,f[a]=l;return f};p.loadArcade=A;Object.defineProperty(p, Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Feature/FeatureRelationship":function(){define("require ../../chunks/tslib.es6 ../../intl ../../core/maybe ../../core/promiseUtils ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass ../Widget ./FeatureRelationship/FeatureRelationshipViewModel ./support/FeatureElementInfo ../../chunks/componentsUtils ../support/globalCss ../support/widgetUtils ../support/decorators/messageBundle ../support/jsxFactory ../../intl/substitute".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b,k,e,f,l,m,v,r,u){const K={title:!0,description:!0};h=class extends b{constructor(d,n){super(d,n);this._relatedFeatureIntersectionObserverNode=this._featureElementInfo=null;this._relatedFeatureIntersectionObserver=new IntersectionObserver(([a])=>{a?.isIntersecting&&this._increaseFeaturePage()},{root:window.document});this.headingLevel=2;this.viewModel=new k;this.messagesCommon=this.messages=null;this.visibleElements={...K};this._increaseFeaturePage=()=>{const {state:a, showAllEnabled:g,relatedFeatures:w,featuresPerPage:D,featurePage:I}=this.viewModel;"ready"===a&&g&&w.length>=D*I&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new e;this.addHandles([G.watch(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),G.initial),G.watch(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),G.on(()=>this.viewModel.relatedFeatureViewModels, "change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return f.loadCalciteComponents({icon:()=>new Promise((d,n)=>c(["../../chunks/calcite-icon"],d,n)),list:()=>new Promise((d,n)=>c(["../../chunks/calcite-list"],d,n)),"list-item":()=>new Promise((d,n)=>c(["../../chunks/calcite-list-item"],d,n)),loader:()=>new Promise((d,n)=>c(["../../chunks/calcite-loader"],d,n)),notice:()=>new Promise((d,n)=>c(["../../chunks/calcite-notice"],d,n))})}destroy(){this._unobserveRelatedFeatureObserver(); this._featureElementInfo=C.destroyMaybe(this._featureElementInfo)}get displayShowAllButton(){const {showAllEnabled:d,featureCount:n,displayCount:a,state:g}=this.viewModel;return!d&&!!n&&"ready"===g&&(n>a||0===a)}get displayListItems(){return this.displayShowAllButton||0this.emit("select-record",{featureViewModel:d})},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton? r.tsx("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this.emit("show-all-records")},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return r.tsx("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},r.tsx("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return r.tsx("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated, bind:this,class:"esri-feature__feature-observer",key:"feature-observer"})}_renderList(){const {relatedFeatureViewModels:d}=this.viewModel;return r.tsx("calcite-list",null,d.toArray().map(n=>this._renderRelatedFeature(n)),this._renderShowAllListItem())}_renderRelatedFeatures(){const {displayListItems:d}=this,{state:n}=this.viewModel;return r.tsx("div",{class:this.classes("esri-feature-relationship__list",{["esri-feature-relationship__list--querying"]:"querying"===n}),key:"list-container"},d?this._renderList(): "ready"===n?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return r.tsx("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},r.tsx("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const {relatedFeatureViewModels:d}=this.viewModel;this.removeHandles("related-feature-viewmodels");d?.forEach(n=>{this.addHandles(G.watch(()=> [n.title,n.state],()=>this.scheduleRender(),G.initial),"related-feature-viewmodels")});this.scheduleRender()}_setupFeatureElementInfo(){const {headingLevel:d,visibleElements:n}=this,a=n.description&&this.description,g=n.title&&this.title;this._featureElementInfo?.set({description:a,title:g,headingLevel:d})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const {state:d,showAllEnabled:n}=this.viewModel;await H.after(0);this._relatedFeatureIntersectionObserverNode&& "ready"===d&&n&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(d){this._relatedFeatureIntersectionObserverNode=d}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};p.__decorate([F.property()],h.prototype,"_relatedFeatureIntersectionObserverNode",void 0);p.__decorate([F.property({readOnly:!0})], h.prototype,"displayShowAllButton",null);p.__decorate([F.property({readOnly:!0})],h.prototype,"displayListItems",null);p.__decorate([F.property()],h.prototype,"description",null);p.__decorate([F.property({readOnly:!0})],h.prototype,"featureCountDescription",null);p.__decorate([F.property()],h.prototype,"headingLevel",void 0);p.__decorate([F.property()],h.prototype,"title",null);p.__decorate([F.property({type:k})],h.prototype,"viewModel",void 0);p.__decorate([F.property(),v.messageBundle("esri/widgets/Feature/t9n/Feature")], h.prototype,"messages",void 0);p.__decorate([F.property(),v.messageBundle("esri/t9n/common")],h.prototype,"messagesCommon",void 0);p.__decorate([F.property()],h.prototype,"visibleElements",void 0);p.__decorate([M.cast("visibleElements")],h.prototype,"castVisibleElements",null);return h=p.__decorate([y.subclass("esri.widgets.Feature.FeatureRelationship")],h)})},"esri/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel":function(){define("../../../chunks/tslib.es6 ../../../Graphic ../../../core/Accessor ../../../core/arrayUtils ../../../core/Clonable ../../../core/Collection ../../../core/Identifiable ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ../../../rest/support/RelationshipQuery ../support/featureUtils ../../FeatureForm/featureFormUtils".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b,k,e,f,l){h=class extends H.ClonableMixin(F.IdentifiableMixin(h)){constructor(m){super(m);this._loaded=!1;this._queryFeatureCountAbortController=this._queryPageAbortController=this._queryAbortController=null;this.featuresPerPage=10;this.orderByFields=this.map=this.layer=this.graphic=this.description=null;this.featureCount=0;this.relationshipId=null;this.showAllEnabled=!1;this.title=null;this._cancelQuery=()=>{const {_queryAbortController:v}=this;v&&v.abort();this._queryAbortController= null};this._cancelQueryFeatureCount=()=>{const {_queryFeatureCountAbortController:v}=this;v&&v.abort();this._queryFeatureCountAbortController=null};this._cancelQueryPage=()=>{const {_queryPageAbortController:v}=this;v&&v.abort();this._queryPageAbortController=null};this._queryController=async()=>{this._cancelQuery();const v=new AbortController;this._queryAbortController=v;await M.ignoreAbortErrors(this._query());this._queryAbortController===v&&(this._queryAbortController=null)};this._queryFeatureCountController= async()=>{this._loaded=!1;this._cancelQueryFeatureCount();const v=new AbortController;this._queryFeatureCountAbortController=v;await M.ignoreAbortErrors(this._queryFeatureCount());this._queryFeatureCountAbortController===v&&(this._queryFeatureCountAbortController=null);this._loaded=!0};this._queryPageController=async()=>{const v=new AbortController;this._queryPageAbortController=v;await M.ignoreAbortErrors(this._queryPage());this._queryPageAbortController===v&&(this._queryPageAbortController=null)}; this._queryDebounced=M.debounce(this._queryController,100);this._queryFeatureCountDebounced=M.debounce(this._queryFeatureCountController,100);this._queryPageDebounced=M.debounce(this._queryPageController,100);this._query=async()=>{const {_queryAbortController:v,relatedFeatures:r}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,r.destroyAll(),this.destroyed||r.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:v?.signal}))))};this.addHandles([Q.watch(()=> [this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryDebounced(),Q.initial),Q.watch(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),Q.watch(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels();this.relatedFeatures.destroyAll(); this._cancelQuery();this._cancelQueryFeatureCount();this._cancelQueryPage()}set featurePage(m){const {featuresPerPage:v,featureCount:r}=this;this._set("featurePage",Math.min(Math.max(m,1),Math.ceil(r/v)||1))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const {orderByFields:m,relatedLayer:v}=this;return m&&v?.loaded?m.map(r=>{const u=r.clone();u.field=f.getFixedFieldName(r.field,v);return u}):m??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&& null!=this.relationshipId&&"number"===typeof this.objectId}get canQuery(){const m=this.layer?.capabilities?.queryRelated;return!!this.relatedLayer&&!!this.relationship&&null!=this.relationshipId&&null!=this.objectId&&!!m?.supportsCount&&!!m?.supportsPagination}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}set displayCount(m){this._set("displayCount",Math.min(Math.max(m,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&& this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new G}get relatedLayer(){const {layer:m,map:v,relationship:r}=this;return m?.loaded&&v&&r?f.findRelatedLayer(v,m,r)??null:null}get relationship(){const {relationshipId:m,layer:v}=this;return null!=m?v?.relationships?.find(({id:r})=>r===m)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new G}get state(){const {_queryAbortController:m, _queryFeatureCountAbortController:v,_queryPageAbortController:r,canQuery:u,_loaded:K,canLoad:d}=this;return v||d&&!K?"loading":m||r?"querying":u?"ready":"disabled"}getRelatedFeatureByObjectId(m){return this.relatedFeatures.find(v=>v.getObjectId()===m)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const {layer:m,relatedLayer:v,relationshipId:r,objectId:u,_queryFeatureCountAbortController:K,canQuery:d, supportsCacheHint:n}=this;await m?.load();await v?.load();if(d&&m&&v&&null!=u){var a=v.createQuery(),{historicMoment:g,gdbVersion:w}=m;a=new e({cacheHint:n,gdbVersion:w,historicMoment:g,relationshipId:r,returnGeometry:!1,objectIds:[u],where:a.where??void 0});a=await m.queryRelatedFeaturesCount(a,{signal:K?.signal});this._set("featureCount",a[u]||0)}else this._set("featureCount",0)}_sliceFeatures(m){const {showAllEnabled:v,displayCount:r}=this;return v?m:r?m.slice(0,r):[]}async _queryPage(){const {relatedFeatures:m, featurePage:v,showAllEnabled:r,_queryPageAbortController:u,featureCount:K}=this;!r||2>v||!K||m.addMany(await this._queryRelatedFeatures({signal:u?.signal}))}async _queryRelatedFeatures(m){const {orderByFieldsFixedCasing:v,showAllEnabled:r,featuresPerPage:u,displayCount:K,layer:d,relationshipId:n,featurePage:a,featureCount:g,relatedLayer:w,supportsCacheHint:D}=this,{canQuery:I,objectId:z}=this;if(!I||!d||!w||null==z)return[];var q=r?((a-1)*u+g)%g:0;const B=r?u:K;var J=w.objectIdField;J=[...v.map(V=> V.field),...l.getFieldsInTitleAndDesc(w),J].filter(C.isSome);const L=v.map(V=>`${V.field} ${V.order}`),O=w.createQuery(),{historicMoment:T,gdbVersion:S}=d;q=new e({orderByFields:L,start:q,num:B,outFields:J,cacheHint:D,historicMoment:T,gdbVersion:S,relationshipId:n,returnGeometry:!1,objectIds:[z],where:O.where??void 0});m=(await d.queryRelatedFeatures(q,{signal:m?.signal}))[z]?.features||[];m.forEach(V=>{V.sourceLayer=w;V.layer=w});return m}};c.__decorate([A.property()],h.prototype,"_loaded",void 0); c.__decorate([A.property()],h.prototype,"_queryAbortController",void 0);c.__decorate([A.property()],h.prototype,"_queryPageAbortController",void 0);c.__decorate([A.property()],h.prototype,"_queryFeatureCountAbortController",void 0);c.__decorate([A.property({value:1})],h.prototype,"featurePage",null);c.__decorate([A.property()],h.prototype,"featuresPerPage",void 0);c.__decorate([A.property({readOnly:!0})],h.prototype,"orderByFieldsFixedCasing",null);c.__decorate([A.property({readOnly:!0})],h.prototype, "supportsCacheHint",null);c.__decorate([A.property({readOnly:!0})],h.prototype,"canLoad",null);c.__decorate([A.property({readOnly:!0})],h.prototype,"canQuery",null);c.__decorate([A.property()],h.prototype,"description",void 0);c.__decorate([A.property({readOnly:!0})],h.prototype,"itemDescriptionFieldName",null);c.__decorate([A.property({value:3})],h.prototype,"displayCount",null);c.__decorate([A.property({type:p})],h.prototype,"graphic",void 0);c.__decorate([A.property()],h.prototype,"layer",void 0); c.__decorate([A.property()],h.prototype,"map",void 0);c.__decorate([A.property({readOnly:!0})],h.prototype,"objectId",null);c.__decorate([A.property({readOnly:!0})],h.prototype,"objectIdField",null);c.__decorate([A.property()],h.prototype,"orderByFields",void 0);c.__decorate([A.property({readOnly:!0})],h.prototype,"relatedFeatures",null);c.__decorate([A.property({readOnly:!0})],h.prototype,"relatedLayer",null);c.__decorate([A.property({readOnly:!0})],h.prototype,"relationship",null);c.__decorate([A.property()], h.prototype,"featureCount",void 0);c.__decorate([A.property({readOnly:!0})],h.prototype,"relatedFeatureViewModels",null);c.__decorate([A.property()],h.prototype,"relationshipId",void 0);c.__decorate([A.property()],h.prototype,"showAllEnabled",void 0);c.__decorate([A.property()],h.prototype,"state",null);c.__decorate([A.property()],h.prototype,"title",void 0);return h=c.__decorate([k.subclass("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],h)})},"esri/widgets/FeatureForm/featureFormUtils":function(){define("exports ../../intl ../../core/arrayUtils ../../core/compilerUtils ../../core/lang ../../core/Logger ../../core/string ../../form/support/formUtils ../../layers/support/domainUtils ../../layers/support/fieldUtils ../../smartMapping/support/utils ../support/dateUtils ../../intl/substitute".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b,k){function e(a){const {fields:g,values:w}=a,D=a.timeZone??void 0;a=g.map((I,z)=>{let q=w[z];I.domain&&"coded-value"===I.domain.type&&(z=I.domain.codedValues.find(B=>B.code===q),z?.name&&(q=z.name));if(y.isAnyDateField(I)||A.isTimeOnlyField(I))q=b.getLabelForDateFieldValue(I,q,{timeZone:D,...b.getIntlOptionsForField(I)});return[I.name,q]});return Object.fromEntries(a)}function f(a,g){return F.replace(F.replace(a,w=>`{${w.toLowerCase()}}`),Object.fromEntries(Object.entries(g).map(([w, D])=>[w.toLowerCase(),D])))}function l(a){return 1E7<=a||-1E7>=a}function m(a,{validationErrors:g}){return null!=a.max&&null!=a.min?g.outsideRange:null!=a.max?g.outsideRangeMax:g.outsideRangeMin}const v=a=>"field"===a?.type,r=a=>"relationship"===a?.type,u=a=>a.reduce((g,w)=>"group"===w?.type?[...g,...w.inputs]:[...g,w],[]),K=(a,g)=>null!=a&&a.input?.type===g;c.LengthValidationError=void 0;(function(a){a.TOO_SHORT="length-validation-error::too-short";a.TOO_LONG="length-validation-error::too-long"})(c.LengthValidationError|| (c.LengthValidationError={}));const d={type:"number"},n={type:"number",intlOptions:{notation:"scientific"}};c.capabilitiesAllowEditType=(a,g)=>{if(!a)return!0;({operations:a}=a);switch(g){case "INSERT":return a.supportsAdd;case "UPDATE":case "DELETE":return a.supportsUpdate;default:return!0}};c.extractExpressionNameFromString=function(a){const [g,w]=a.split("expression/");return""===g&&w?w:(G.getLogger("esri.widgets.FeatureForm/featureFormUtils").error("extractExpressionNameFromString:invalid-input", `The string ${a} is not a valid expression reference of the form '${"expression/"}/expressionName'`),"")};c.flattenFieldInputs=a=>u(a).filter(v);c.flattenInputs=u;c.flattenRelationshipInputs=a=>u(a).filter(r);c.formTemplateHasInvalidFields=function(a,g){return(g=g??("formTemplate"in a&&a.formTemplate))?(g.elements?.filter(M.isFieldElement)??[]).some(({fieldName:w})=>!a.fieldsIndex.get(w)):!1};c.getComputedAttributes=e;c.getErrorMessageForFieldInput=(a,g,w)=>{const {dataType:D,error:I,minLength:z, value:q,required:B}=a,J=g?.validationErrors;if(!J||!I)return null;if(B&&null===q)return J.cannotBeNull;if(I===Q.DomainValidationError.VALUE_OUT_OF_RANGE||I===A.NumericRangeValidationError.OUT_OF_RANGE){const {field:L,range:O}=a;a={type:"date",intlOptions:{timeZone:"date"===L.type&&w?w:void 0,...b.getIntlOptionsForField(L)}};g=m(O,g);return k.substitute(g,O,{format:{max:"date"===D?a:null!=O.max&&l(O.max)?n:d,min:"date"===D?a:null!=O.min&&l(O.min)?n:d}})}return I===Q.DomainValidationError.INVALID_CODED_VALUE? J.invalidCodedValue:I===A.TypeValidationError.INVALID_TYPE?J.invalidType:I===c.LengthValidationError.TOO_SHORT?k.substitute(J.tooShort,{min:z}):null};c.getFieldsInTitleAndDesc=a=>{const g=[];if(a.formTemplate){const {description:w,title:D}=a.formTemplate;a.fields?.forEach(I=>{const z=D&&F.templateHasKey(D,I.name),q=w&&F.templateHasKey(w,I.name);(z||q)&&g.push(I.name)})}return g};c.getIconForFeature=a=>{if(a){var g=a.layer;g=g&&"geometryType"in g?g.geometryType:void 0;a=a.geometry?.type;return"polyline"=== a||"polyline"===g?"line":"mesh"===a||"mesh"===g||"multipatch"===g?"cube":"multipoint"===a||"multipoint"===g?"point":a||g||"table"}};c.getNormalizedFeatureTypeInfo=a=>{const g={typeFieldName:null,types:[]};if(!a)return g;"subtype-sublayer"===a.type?(g.typeFieldName=a.parent?.subtypeField,g.types=a.parent?.subtypes??[]):"subtype-group"===a.type||"feature"===a.type&&a.subtypes?.length?(g.typeFieldName=a.subtypeField,g.types=a.subtypes??[]):"types"in a&&a.types&&(g.typeFieldName=a.typeIdField,g.types= a.types.map(({id:w,name:D,domains:I})=>({code:w,name:D,domains:I})));null!=g.typeFieldName&&(g.typeFieldName=a.getField(g.typeFieldName)?.name??g.typeFieldName);return g};c.isExpressionReference=function(a){return a.startsWith("expression/")};c.isFieldElementWithInputType=K;c.isFieldElementWithShowNoValueOptionInput=a=>null!=a&&(K(a,"combo-box")||K(a,"radio-buttons"));c.isFieldElementWithTextInput=a=>null!=a&&(K(a,"text-box")||K(a,"text-area"));c.isFieldInput=v;c.isGroupInput=a=>"group"===a?.type; c.isInputInGroupInput=a=>"group"!==a?.type&&null!=a.group;c.isLegacyFieldMapsExpressionReference=function(a){return a.startsWith("expr/")};c.isNumberFieldInput=({domain:a,inputType:g="text-box",dataType:w})=>"number"===w&&"text-box"===g&&(!a||"coded-value"!==a.type);c.isRelationshipInput=r;c.isTemplateItemGroup=a=>"items"in a;c.isTextElementInput=a=>"text"===a.type;c.parseFormTemplateString=function(a){const {attributes:g,fieldsIndex:w,label:D,timeZone:I}=a;if(!g||"object"!==typeof g)return D;var z= Object.keys(g).filter(q=>F.templateHasKey(D,q));a=z.map(q=>g[q]);z=z.map(q=>w.get(q)).filter(h.isSome);return f(D,e({values:a,fields:z,timeZone:I}))};c.prependExpressionPrefix=function(a){return`${"expression/"}${a}`};c.prependFieldPrefix=function(a){return`${"field/"}${a}`};c.substituteFieldTemplatesInString=f;c.subtypeChangeShouldPrompt=function(a,g,w){if(!(a&&"subtypes"in a))return!1;const D=a.subtypes?.find(I=>I.code===w);if(!D)return!1;a=a.subtypes?.find(I=>I.code===g);return H.equalsShallow(D.defaultValues, a?.defaultValues)?!1:Object.values(D.defaultValues).some(I=>null!=I)};c.valueIsInvalidSwitchValue=function(a,g){return null==a||g.onValue!==a&&g.offValue!==a};c.valueIsValidContingentValue=function(a,g){switch(g.objectType){case "any":return!0;case "null":return null==a;case "code":return a===g.codedValue?.code;case "range":return null!=a&&null!=g.minValue&&null!=g.maxValue&&+a>=g.minValue&&+a<=g.maxValue;default:return C.neverReached(g.objectType),!1}};Object.defineProperty(c,Symbol.toStringTag, {value:"Module"})})},"esri/widgets/Feature/FeatureViewModel":function(){define("../../chunks/tslib.es6 ../../geometry ../../Graphic ../../arcade/featureset/support/FeatureSetQueryInterceptor ../../core/Accessor ../../core/arrayUtils ../../core/Identifiable ../../core/Logger ../../core/promiseUtils ../../core/reactiveUtils ../../core/throttle ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/has ../../core/accessorSupport/decorators/subclass ../../popup/content/TextContent ../../time/timeZoneUtils ./FeatureAttachments/FeatureAttachmentsViewModel ./FeatureContent/FeatureContentViewModel ./FeatureExpression/FeatureExpressionViewModel ./FeatureFields/FeatureFieldsViewModel ./FeatureMedia/FeatureMediaViewModel ./FeatureRelationship/FeatureRelationshipViewModel ./support/arcadeFeatureUtils ./support/featureUtils ./support/relatedFeatureUtils ../../geometry/Point".split(" "), function(c,p,h,C,H,G,F,M,Q,A,y,b,k,e,f,l,m,v,r,u,K,d,n,a,g,w,D){var I;const z={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};p=I=class extends F.IdentifiableMixin(H){constructor(q){super(q);this._featureAbortController=this._error=null;this._graphicChangedThrottled=y.throttle(this._graphicChanged,1,this);this._graphicExpressionAttributes=this._expressionAttributes=null;this.abilities={...z};this.content= null;this.contentViewModels=[];this.description=null;this.defaultPopupTemplateEnabled=!1;this.location=this.lastEditInfo=this.formattedAttributes=null;this.relatedInfos=new Map;this.title="";this.view=null;this._isAllowedContentType=B=>{const {abilities:J}=this;return"attachments"===B.type&&!!J.attachmentsContent||"custom"===B.type&&!!J.customContent||"fields"===B.type&&!!J.fieldsContent||"media"===B.type&&!!J.mediaContent||"text"===B.type&&!!J.textContent||"expression"===B.type&&!!J.expressionContent|| "relationship"===B.type&&!!J.relationshipContent};this.addHandles(A.watch(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),A.initial))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear();this._cancelFeatureQuery();this.graphic=this._error=null;this._destroyContentViewModels();this.relatedInfos.clear()}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled): null}get _fieldInfoMap(){return g.createFieldInfoMap(g.getAllFieldInfos(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return g.getSourceLayer(this.graphic)}castAbilities(q){return{...z,...q}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(q){this._set("graphic",q?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(q){this._override("spatialReference", q)}get timeZone(){return this.view?.timeZone??m.system}set timeZone(q){this._overrideIfSome("timeZone",q)}get map(){return this.view?.map||null}set map(q){this._override("map",q)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(q,B){q=this.contentViewModels[q];q instanceof d&&q.setActiveMedia(B)}nextMedia(q){q=this.contentViewModels[q];q instanceof d&&q.next()}previousMedia(q){q=this.contentViewModels[q];q instanceof d&&q.previous()}async updateGeometry(){const {graphic:q, spatialReference:B,_sourceLayer:J}=this;await J?.load();var L=J?.objectIdField;L&&q&&J&&(L=q?.attributes?.[L],null!=L&&(L=[L],!q.geometry&&(L=(await g.querySourceLayer({layer:J,graphic:q,outFields:[],objectIds:L,returnGeometry:!0,spatialReference:B}))?.geometry)))&&(q.geometry=L)}_clear(){this._set("title","");this._set("content",null);this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery();this._error=null;this._clear();const {graphic:q}=this;if(q){var B=new AbortController; this._featureAbortController=B;try{await this._queryFeature({signal:B.signal})}catch(J){Q.isAbortError(J)||(this._error=J,M.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:J,graphic:q,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===B&&(this._featureAbortController=null)}}_cancelFeatureQuery(){const {_featureAbortController:q}=this;q&&q.abort();this._featureAbortController=null}_compileContentElement(q,B){if("attachments"=== q.type)return this._compileAttachments(q,B);if("custom"===q.type)return this._compileCustom(q,B);if("fields"===q.type)return this._compileFields(q,B);if("media"===q.type)return this._compileMedia(q,B);if("text"===q.type)return this._compileText(q,B);if("expression"===q.type)return this._compileExpression(q,B);if("relationship"===q.type)return this._compileRelationship(q,B)}_compileContent(q){this._destroyContentViewModels();if(this.graphic)return Array.isArray(q)?q.filter(this._isAllowedContentType).map((B, J)=>this._compileContentElement(B,J)).filter(G.isSome):"string"===typeof q?this._compileText(new l({text:q}),0).text:q}_destroyContentViewModels(){this.removeHandles("relationship-view-models");this.removeHandles("content-view-models");this.contentViewModels.forEach(q=>q&&!q.destroyed&&q.destroy());this._set("contentViewModels",[])}_matchesFeature(q,B){q=q?.graphic?.getObjectId();B=B?.getObjectId();return null!=q&&null!=B&&q===B}_setRelatedFeaturesViewModels({relatedFeatureViewModels:q,relatedFeatures:B, map:J}){const {view:L,spatialReference:O,timeZone:T}=this;B?.filter(Boolean).forEach(S=>{q.some(V=>this._matchesFeature(V,S))||q.add(new I({abilities:{relationshipContent:!1},map:J,view:L,spatialReference:O,timeZone:T,graphic:S}))});q.forEach(S=>{B?.find(V=>this._matchesFeature(S,V))||q.remove(S)})}_setExpressionContentVM(q,B){const J=this.formattedAttributes,{contentElement:L,contentElementViewModel:O}=q;q=L?.type;O&&q&&("fields"===q&&(this._createFieldsFormattedAttributes({contentElement:L,contentElementIndex:B, formattedAttributes:J}),O.set(this._createFieldsVMParams(L,B))),"media"===q&&(this._createMediaFormattedAttributes({contentElement:L,contentElementIndex:B,formattedAttributes:J}),O.set(this._createMediaVMParams(L,B))),"text"===q&&O.set(this._createTextVMParams(L)))}_compileRelationship(q,B){const {displayCount:J,orderByFields:L,relationshipId:O,title:T,description:S}=q,{_sourceLayer:V,graphic:U,map:W}=this;if(g.isRelatableFeatureSupportedLayer(V)){var Z=new n({displayCount:J,graphic:U,orderByFields:L, relationshipId:O,layer:V,map:W,...this._compileTitleAndDesc({title:T,description:S})});this.contentViewModels[B]=Z;this.addHandles(A.on(()=>Z.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(Z)),"relationship-view-models");return q}}_compileExpression(q,B){const {expressionInfo:J}=q,{graphic:L,map:O,spatialReference:T,view:S,location:V}=this,U=new u({expressionInfo:J,graphic:L,interceptor:I.interceptor,map:O,spatialReference:T,view:S,location:V});this.contentViewModels[B]=U;this.addHandles(A.watch(()=> U.contentElementViewModel,()=>this._setExpressionContentVM(U,B),A.initial),"content-view-models");return q}_compileAttachments(q,B){const {graphic:J}=this,{description:L,title:O}=q;this.contentViewModels[B]=new v({graphic:J,...this._compileTitleAndDesc({title:O,description:L})});return q}_compileCustom(q,B){const {graphic:J}=this,{creator:L,destroyer:O}=q;this.contentViewModels[B]=new r({graphic:J,creator:L,destroyer:O});return q}_compileTitleAndDesc({title:q,description:B}){const {_fieldInfoMap:J, _sourceLayer:L,graphic:O,formattedAttributes:T}=this,S=O?.attributes,V=this._expressionAttributes,U=T.global;return{title:g.substituteFieldsInLinksAndAttributes({attributes:S,fieldInfoMap:J,globalAttributes:U,expressionAttributes:V,layer:L,text:q}),description:g.substituteFieldsInLinksAndAttributes({attributes:S,fieldInfoMap:J,globalAttributes:U,expressionAttributes:V,layer:L,text:B})}}_createFieldsVMParams(q,B){const J=this._effectivePopupTemplate,L=this.formattedAttributes,O={...L?.global,...L?.content[B]}; B=(q?.fieldInfos||J?.fieldInfos)?.filter(({fieldName:V})=>!!V&&(g.isExpressionField(V)||g.isRelatedField(V)||O.hasOwnProperty(V)));const {description:T,title:S}=q;return{attributes:O,expressionInfos:J?.expressionInfos,fieldInfos:B,...this._compileTitleAndDesc({title:S,description:T})}}_compileFields(q,B){const J=q.clone();q=new K(this._createFieldsVMParams(q,B));this.contentViewModels[B]=q;J.fieldInfos=q.formattedFieldInfos.slice(0);return J}_createMediaVMParams(q,B){const {abilities:J,graphic:L, _fieldInfoMap:O,_effectivePopupTemplate:T,relatedInfos:S,_sourceLayer:V,_expressionAttributes:U}=this,W=this.formattedAttributes,Z=L?.attributes??{},{description:ca,mediaInfos:da,title:ba}=q;return{abilities:{chartAnimation:J.chartAnimation},activeMediaInfoIndex:q.activeMediaInfoIndex||0,attributes:Z,isAggregate:L?.isAggregate,layer:V,fieldInfoMap:O,formattedAttributes:{...W?.global,...W?.content[B]},expressionAttributes:U,mediaInfos:da,popupTemplate:T,relatedInfos:S,...this._compileTitleAndDesc({title:ba, description:ca})}}_compileMedia(q,B){const J=q.clone();q=new d(this._createMediaVMParams(q,B));J.mediaInfos=q.formattedMediaInfos.slice(0);this.contentViewModels[B]=q;return J}_createTextVMParams(q){const {graphic:B,_fieldInfoMap:J,_sourceLayer:L,_expressionAttributes:O}=this;q&&q.text&&(q.text=g.substituteFieldsInLinksAndAttributes({attributes:B?.attributes??{},fieldInfoMap:J,globalAttributes:this.formattedAttributes?.global??{},expressionAttributes:O,layer:L,text:q.text}));return{graphic:B,creator:q.text}}_compileText(q, B){q=q.clone();this.contentViewModels[B]=new r(this._createTextVMParams(q));return q}_compileLastEditInfo(){const {_effectivePopupTemplate:q,_sourceLayer:B,graphic:J,timeZone:L}=this;if(q){var {lastEditInfoEnabled:O}=q,T=B?.editFieldsInfo;if(O&&T)return g.formatEditInfo(T,J?.attributes,L,B)}}_compileTitle(q){const {_fieldInfoMap:B,_sourceLayer:J,graphic:L,_expressionAttributes:O}=this;return g.substituteFieldsInLinksAndAttributes({attributes:L?.attributes??{},fieldInfoMap:B,globalAttributes:this.formattedAttributes?.global?? {},expressionAttributes:O,layer:J,text:q})}async _getTitle(){const {_effectivePopupTemplate:q,graphic:B}=this;return B?g.graphicCallback({type:"title",value:q?.title,event:{graphic:B}}):null}async _getContent(){const {_effectivePopupTemplate:q,graphic:B}=this;return B?g.graphicCallback({type:"content",value:q?.content,event:{graphic:B}}):null}async _queryFeature(q){const {_featureAbortController:B,_sourceLayer:J,graphic:L,_effectivePopupTemplate:O}=this,T=this.map,S=this.view,V=this.spatialReference, U=this.location;if(B===this._featureAbortController&&L){await g.queryUpdatedFeature({graphic:L,popupTemplate:O,layer:J,spatialReference:V},q);var {content:{value:W},title:{value:Z}}=await Q.eachAlways({content:this._getContent(),title:this._getTitle()});({expressionAttributes:{value:q}}=await Q.eachAlways({checkForRelatedFeatures:this._checkForRelatedFeatures(q),expressionAttributes:a.createCompiledExpressions({expressionInfos:O?.expressionInfos,spatialReference:V,graphic:L,map:T,interceptor:I.interceptor, view:S,options:q,location:U})}));B===this._featureAbortController&&L&&(this._expressionAttributes=q,this._graphicExpressionAttributes={...L.attributes,...q},this._set("formattedAttributes",this._createFormattedAttributes(W)),this._set("title",this._compileTitle(Z)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(W)||null))}}_createMediaFormattedAttributes({contentElement:q,contentElementIndex:B,formattedAttributes:J}){const {_effectivePopupTemplate:L, graphic:O,relatedInfos:T,_sourceLayer:S,_fieldInfoMap:V,_graphicExpressionAttributes:U,timeZone:W}=this;J.content[B]=g.formatAttributes({fieldInfos:L?.fieldInfos,graphic:O,attributes:{...U,...q.attributes},layer:S,fieldInfoMap:V,relatedInfos:T,timeZone:W})}_createFieldsFormattedAttributes({contentElement:q,contentElementIndex:B,formattedAttributes:J}){if(q.fieldInfos){const {graphic:L,relatedInfos:O,_sourceLayer:T,_fieldInfoMap:S,_graphicExpressionAttributes:V,timeZone:U}=this;J.content[B]=g.formatAttributes({fieldInfos:q.fieldInfos, graphic:L,attributes:{...V,...q.attributes},layer:T,fieldInfoMap:S,relatedInfos:O,timeZone:U})}}_createFormattedAttributes(q){const {_effectivePopupTemplate:B,graphic:J,relatedInfos:L,_sourceLayer:O,_fieldInfoMap:T,_graphicExpressionAttributes:S,timeZone:V}=this,U={global:g.formatAttributes({fieldInfos:B?.fieldInfos,graphic:J,attributes:S,layer:O,fieldInfoMap:T,relatedInfos:L,timeZone:V}),content:[]};Array.isArray(q)&&q.forEach((W,Z)=>{"fields"===W.type&&this._createFieldsFormattedAttributes({contentElement:W, contentElementIndex:Z,formattedAttributes:U});"media"===W.type&&this._createMediaFormattedAttributes({contentElement:W,contentElementIndex:Z,formattedAttributes:U})});return U}_checkForRelatedFeatures(q){const {graphic:B,_effectivePopupTemplate:J}=this;return this._queryRelatedInfos(B,g.getAllFieldInfos(J),q)}async _queryRelatedInfos(q,B,J){const {relatedInfos:L,_sourceLayer:O}=this;L.clear();const T=null!=O?.associatedLayer?await O?.associatedLayer.load(J):O;if(T&&q&&B.filter(U=>!!U.fieldName&&g.isRelatedField(U.fieldName))?.length){B.forEach(U=> this._configureRelatedInfo(U,T));var S=await w.queryLayerInfos({relatedInfos:L,layer:T},J);Object.keys(S).forEach(U=>{const W=L.get(U.toString());U=S[U]?.value;W&&U&&(W.layerInfo=U.data)});var V=await w.queryRelatedFeatures({graphic:q,relatedInfos:L,layer:T},J);Object.keys(V).forEach(U=>{w.setRelatedFeatures(V[U]?.value,L.get(U.toString()))})}}_configureRelatedInfo(q,B){const {relatedInfos:J}=this,L=w.getRelatedFieldInfo(q.fieldName||"");if(L){var {layerId:O,fieldName:T}=L;O&&(B=J.get(O.toString())|| w.createRelatedInfo(O,B))&&(w.updateRelatedInfo({relatedInfo:B,fieldName:T,fieldInfo:q}),this.relatedInfos.set(O,B))}}};p.interceptor=new C.FeatureSetQueryInterceptor(g.preLayerQueryCallback,g.preRequestCallback);c.__decorate([b.property()],p.prototype,"_error",void 0);c.__decorate([b.property()],p.prototype,"_featureAbortController",void 0);c.__decorate([b.property({readOnly:!0})],p.prototype,"_effectivePopupTemplate",null);c.__decorate([b.property({readOnly:!0})],p.prototype,"_fieldInfoMap",null); c.__decorate([b.property({readOnly:!0})],p.prototype,"_sourceLayer",null);c.__decorate([b.property()],p.prototype,"abilities",void 0);c.__decorate([k.cast("abilities")],p.prototype,"castAbilities",null);c.__decorate([b.property({readOnly:!0})],p.prototype,"content",void 0);c.__decorate([b.property({readOnly:!0})],p.prototype,"contentViewModels",void 0);c.__decorate([b.property()],p.prototype,"description",void 0);c.__decorate([b.property({type:Boolean})],p.prototype,"defaultPopupTemplateEnabled", void 0);c.__decorate([b.property({readOnly:!0})],p.prototype,"isTable",null);c.__decorate([b.property({readOnly:!0})],p.prototype,"state",null);c.__decorate([b.property({readOnly:!0})],p.prototype,"formattedAttributes",void 0);c.__decorate([b.property({type:h,value:null})],p.prototype,"graphic",null);c.__decorate([b.property({readOnly:!0})],p.prototype,"lastEditInfo",void 0);c.__decorate([b.property({type:D})],p.prototype,"location",void 0);c.__decorate([b.property({readOnly:!0})],p.prototype,"relatedInfos", void 0);c.__decorate([b.property()],p.prototype,"spatialReference",null);c.__decorate([b.property()],p.prototype,"timeZone",null);c.__decorate([b.property({readOnly:!0})],p.prototype,"title",void 0);c.__decorate([b.property()],p.prototype,"map",null);c.__decorate([b.property({readOnly:!0})],p.prototype,"waitingForContent",null);c.__decorate([b.property()],p.prototype,"view",void 0);return p=I=c.__decorate([f.subclass("esri.widgets.Feature.FeatureViewModel")],p)})},"esri/arcade/featureset/support/FeatureSetQueryInterceptor":function(){define(["exports"], function(c){class p{constructor(h,C){this.preLayerQueryCallback=h;this.preRequestCallback=C;this.preLayerQueryCallback||(this.preLayerQueryCallback=H=>{});this.preRequestCallback||(this.preLayerQueryCallback=H=>{})}}c.FeatureSetQueryInterceptor=p;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Feature/resources":function(){define(["exports"],function(c){c.css={base:"esri-feature",container:"esri-feature__size-container",title:"esri-feature__title",main:"esri-feature__main-container", btn:"esri-feature__button",icon:"esri-feature__icon",content:"esri-feature__content",contentNode:"esri-feature__content-node",contentNodeText:"esri-feature__content-node--text",contentElement:"esri-feature__content-element",text:"esri-feature__text",lastEditedInfo:"esri-feature__last-edited-info",fields:"esri-feature__fields",fieldHeader:"esri-feature__field-header",fieldData:"esri-feature__field-data",fieldDataDate:"esri-feature__field-data--date",loadingSpinnerContainer:"esri-feature__loading-container"}; Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Feature/support/FeatureContentMixin":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Logger ../../../core/has ../../../core/RandomLCG ../../../core/Error ../../../core/accessorSupport/decorators/subclass ../resources ../../support/widget ../../support/jsxFactory".split(" "),function(c,p,h,C,H,G,F,M,Q,A){c.FeatureContentMixin=y=>{y=class extends y{constructor(){super(...arguments);this.renderNodeContent= b=>Q.isWidget(b)&&!b.destroyed?A.tsx("div",{class:M.css.contentNode,key:b},b.render()):b instanceof HTMLElement?A.tsx("div",{afterCreate:this._attachToNode,bind:b,class:M.css.contentNode,key:b}):Q.hasDomNode(b)?A.tsx("div",{afterCreate:this._attachToNode,bind:b.domNode,class:M.css.contentNode,key:b}):null}_attachToNode(b){b.appendChild(this)}};return y=p.__decorate([F.subclass("esri.widgets.Feature.support.FeatureContentMixin")],y)};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})}, "*noref":1}}); define("require ../chunks/tslib.es6 ../intl ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/accessorSupport/decorators/cast ../core/RandomLCG ../core/has ../core/accessorSupport/decorators/subclass ./Widget ./Feature/FeatureAttachments ./Feature/FeatureContent ./Feature/FeatureExpression ./Feature/FeatureFields ./Feature/FeatureMedia ./Feature/FeatureRelationship ./Feature/FeatureViewModel ./Feature/resources ./Feature/support/FeatureContentMixin ../chunks/componentsUtils ./support/globalCss ./support/Heading ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory ../intl/substitute".split(" "),function(c, p,h,C,H,G,F,M,Q,A,y,b,k,e,f,l,m,v,r,u,K,d,n,a,g,w){var D;const I={title:!0,content:!0,lastEditedInfo:!0};h=D=class extends r.FeatureContentMixin(A){constructor(z,q){super(z,q);this._contentWidgets=[];this.flowItems=null;this.headingLevel=2;this.messagesCommon=this.messages=null;this.visibleElements={...I};this.viewModel=new m}initialize(){this.addHandles(C.watch(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),C.initial))}loadDependencies(){return u.loadCalciteComponents({notice:()=> new Promise((z,q)=>c(["../chunks/calcite-notice"],z,q)),loader:()=>new Promise((z,q)=>c(["../chunks/calcite-loader"],z,q))})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(z){this.viewModel.graphic=z}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(z){this.viewModel.defaultPopupTemplateEnabled=z}get isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(z){this._overrideIfSome("icon", z)}get label(){return this.messages?.widgetLabel??""}set label(z){this._overrideIfSome("label",z)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(z){this.viewModel.spatialReference=z}get timeZone(){return this.viewModel.timeZone}set timeZone(z){this.viewModel.timeZone=z}get title(){return this.viewModel.title}castVisibleElements(z){return{...I,...z}}get map(){return this.viewModel.map}set map(z){this.viewModel.map=z}get view(){return this.viewModel.view}set view(z){this.viewModel.view= z}setActiveMedia(z,q){return this.viewModel.setActiveMedia(z,q)}nextMedia(z){return this.viewModel.nextMedia(z)}previousMedia(z){return this.viewModel.previousMedia(z)}render(){var {state:z}=this.viewModel;z=g.tsx("div",{class:v.css.container,key:"container"},this._renderTitle(),"error"===z?this._renderError():"loading"===z?this._renderLoading():this._renderContentContainer());return g.tsx("div",{class:this.classes(v.css.base,K.globalCss.widget)},z)}_renderError(){const {messagesCommon:z,messages:q, visibleElements:B}=this;return g.tsx("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},B.title?g.tsx("div",{key:"error-title",slot:"title"},z.errorMessage):null,g.tsx("div",{key:"error-message",slot:"message"},q.loadingError))}_renderLoading(){return g.tsx("div",{class:v.css.loadingSpinnerContainer,key:"loading-container"},g.tsx("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const {visibleElements:z}=this;return z.content?g.tsx("div",{class:v.css.main}, [this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const {visibleElements:z,title:q}=this;return z.title?g.tsx(d.Heading,{class:v.css.title,innerHTML:q,level:this.headingLevel}):null}_renderContent(){var z=this.viewModel.content;return z?Array.isArray(z)?z.length?g.tsx("div",{class:v.css.contentNode,key:"content-content-elements"},z.map(this._renderContentElement,this)):null:"string"===typeof z?(z=this._contentWidgets[0],!z||z.destroyed?null:g.tsx("div",{class:this.classes(v.css.contentNode, v.css.contentNodeText),key:"content-content"},z.render())):this.renderNodeContent(z):null}_renderContentElement(z,q){const {visibleElements:B}=this;if("boolean"!==typeof B.content&&!B.content?.[z.type])return null;switch(z.type){case "attachments":return this._renderAttachments(q);case "custom":return this._renderCustom(z,q);case "fields":return this._renderFields(q);case "media":return this._renderMedia(q);case "text":return this._renderText(z,q);case "expression":return this._renderExpression(q); case "relationship":return this._renderRelationship(q);default:return null}}_renderAttachments(z){const q=this._contentWidgets[z];if(!q||q.destroyed)return null;const {state:B,attachmentInfos:J}=q.viewModel;return"loading"===B||0this._destroyContentWidget(z));this._contentWidgets=[]}_addFeatureRelationshipHandles(z){const {flowItems:q,visibleElements:B}=this;this.addHandles([C.on(()=>z,"select-record",({featureViewModel:J})=>{q&&(J.abilities={relationshipContent:!0},q.push(new D({flowItems:q,viewModel:J,visibleElements:B})))}),C.on(()=>z,"show-all-records",()=>{if(q){var {viewModel:J}=z;J.showAllEnabled=!0;J=new l({visibleElements:{title:!1,description:!1},viewModel:J});this._addFeatureRelationshipHandles(J); q.push(J)}})],"relationship-handles")}_setupContentWidgets(){this._destroyContentWidgets();const {headingLevel:z,visibleElements:q}=this;var B=this.viewModel?.content;const {contentViewModels:J}=this.viewModel;Array.isArray(B)?B.forEach((L,O)=>{"attachments"===L.type&&(this._contentWidgets[O]=new y({displayType:L.displayType,headingLevel:q.title&&6>z?z+1:z,viewModel:J[O]}));"fields"===L.type&&(this._contentWidgets[O]=new e({viewModel:J[O]}));"media"===L.type&&(this._contentWidgets[O]=new f({viewModel:J[O]})); "text"===L.type&&(this._contentWidgets[O]=new b({viewModel:J[O]}));"custom"===L.type&&(this._contentWidgets[O]=new b({viewModel:J[O]}));"expression"===L.type&&(this._contentWidgets[O]=new k({viewModel:J[O]}));"relationship"===L.type&&(L=new l({viewModel:J[O]}),this._addFeatureRelationshipHandles(L),this._contentWidgets[O]=L)},this):(B=J[0])&&!B.destroyed&&(this._contentWidgets[0]=new b({viewModel:B}));this.scheduleRender()}};p.__decorate([H.property()],h.prototype,"graphic",null);p.__decorate([H.property()], h.prototype,"defaultPopupTemplateEnabled",null);p.__decorate([H.property()],h.prototype,"flowItems",void 0);p.__decorate([H.property()],h.prototype,"headingLevel",void 0);p.__decorate([H.property({readOnly:!0})],h.prototype,"isTable",null);p.__decorate([H.property()],h.prototype,"icon",null);p.__decorate([H.property()],h.prototype,"label",null);p.__decorate([H.property(),a.messageBundle("esri/widgets/Feature/t9n/Feature")],h.prototype,"messages",void 0);p.__decorate([H.property(),a.messageBundle("esri/t9n/common")], h.prototype,"messagesCommon",void 0);p.__decorate([H.property()],h.prototype,"spatialReference",null);p.__decorate([H.property()],h.prototype,"timeZone",null);p.__decorate([H.property({readOnly:!0})],h.prototype,"title",null);p.__decorate([H.property()],h.prototype,"visibleElements",void 0);p.__decorate([G.cast("visibleElements")],h.prototype,"castVisibleElements",null);p.__decorate([H.property()],h.prototype,"map",null);p.__decorate([H.property()],h.prototype,"view",null);p.__decorate([H.property({type:m})], h.prototype,"viewModel",void 0);return h=D=p.__decorate([Q.subclass("esri.widgets.Feature")],h)});