/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import a from"./R3ACKBE3.js";import"./7TXQADKX.js";import{A as f,O as h,U as b,a as m,b as l}from"./IWZQMWZ5.js";import"./ALDX5YZO.js";export default $arcgis.t(([{renderingSanitizer:p},{replace:$},{k:u,l:v,m:I}])=>{var w=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/iu,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/iu,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/iu,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/iu,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function F(d,t){let e=w.find(s=>s.pattern.test(t));if(!e)return t;let r=t.match(e.pattern)?.[2],n=$($(e.label,{messages:d,hierPart:r}),{appName:e.appName}),a=e.target?` target="${e.target}"`:"",o=e.target==="_blank"?' rel="noreferrer"':"";return p.sanitizeUrl(new URL(t,window.location.origin==="null"?void 0:window.location.origin).toString()).replace(e.pattern,`<a${a} href="$1"${o}>${n}</a>`)}var N=m`.table{border:none;width:100%;border-collapse:collapse;color:var(--calcite-color-text-2)}.table caption{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.table tr:nth-child(odd){background-color:var(--calcite-color-foreground-1)}.table tr:nth-child(2n){background-color:var(--calcite-color-foreground-2)}.table tr a{color:var(--calcite-color-text-link)}.table tr a:hover,.table tr a:focus{color:var(--calcite-color-brand-hover)}.table tr td,.table tr th{padding:var(--calcite-spacing-xs) var(--calcite-spacing-sm);vertical-align:top;word-break:break-word;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular);line-height:var(--calcite-font-line-height-relative-normal)}.table tr th{border-inline-end:var(--calcite-border-width-md) solid var(--calcite-color-border-3);width:50%;text-align:start}.table tr td{width:50%}`,c=class extends h{constructor(){super(...arguments),this.headingLevel=2}static{this.properties={values:0,description:1,expressionInfos:0,fieldInfos:0,heading:1,isContentFieldInfos:5,graphic:0,layer:0,headingLevel:9,messages:0}}static{this.styles=N}get formattedFieldInfos(){let{expressionInfos:t,fieldInfos:e,layer:r,graphic:n,isContentFieldInfos:a}=this,o=[];return e?.forEach(s=>{if(!(!("visible"in s)||s.visible))return;let i=s.clone();i.label=v({fieldInfo:i,expressionInfos:t,layer:r,graphic:n,isContentFieldInfos:a});let g=u({fieldInfo:s,graphic:n,layer:r});g&&(i.fieldFormat=I({configurableFieldsContainer:g,fieldInfo:i,isContentFieldInfos:a})),o.push(i)}),o}render(){return l`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .description=${this.description} .headingLevel=${this.headingLevel}></arcgis-feature-element-info>${this._renderFields()}</div>`}_renderFieldInfo(t){let{values:e}=this,r=t.fieldName||"",n=t.label||r,a=e?e[r]==null?"":e[r]:"",o=t?.fieldFormat?.type==="date-time",s={openInApp:this.messages?.openInApp??"",view:this.messages?.view??""},i=typeof a=="number"&&!o?f(`${a}`):typeof a=="string"?F(s,a):`${a}`;return l`<tr><th .innerHTML=${p.sanitize(n)??""}></th><td .innerHTML=${p.sanitize(i)??""}></td></tr>`}_renderFields(){let{formattedFieldInfos:t}=this;return t?.length?l`<table class="table"><caption>${this.messages?.fieldsSummary}</caption><tbody>${t.map(e=>this._renderFieldInfo(e))}</tbody></table>`:null}};b("arcgis-feature-fields",c);return c},"applications/Components/sanitizerUtils","applications/Components/stringUtils",a)