@arkitektum/altinn-studio-custom-components 11.12.0 → 11.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -98,6 +98,7 @@ These components are tailored to display specific data types consistently across
98
98
  - [ValidationMessages](src/components/data-components/custom-feedbacklist-validation-messages/) – Displays lists of feedback messages for all feedback types.
99
99
  - **Group lists**
100
100
  - [Ettersending](src/components/data-components/custom-grouplist-ettersending/) – Displays a list of [`Ettersending`](src/classes/data-classes/Ettersending.js) component groups.
101
+ - [Sjekklistekrav](src/components/data-components/custom-grouplist-sjekklistekrav/) – Displays a list of [`Sjekklistekrav`](src/classes/data-classes/Sjekklistekrav.js) component groups.
101
102
  - [Utfall svar](src/components/data-components/custom-grouplist-utfall-svar-type/) – Displays a list of [`Utfallsvar`](src/classes/data-classes/UtfallSvar.js) component groups.
102
103
  - **Tables**
103
104
  - [Data](src/components/data-components/custom-table-data/) – Displays data table with customizable columns and rows.
package/dist/main.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";class e{constructor(e){e?.tagName&&(this.tagName=e.tagName),e?.inline&&(this.inline=e.inline),e?.hideTitle&&(this.hideTitle=e.hideTitle),e?.size&&(this.size=e.size),e?.hideIfEmpty&&(this.hideIfEmpty=e.hideIfEmpty),e?.styleOverride&&(this.styleOverride=e.styleOverride),e?.isChildComponent&&(this.isChildComponent=e.isChildComponent),e?.feedbackType&&(this.feedbackType=e.feedbackType),e?.hideOrgNr&&(this.hideOrgNr=e.hideOrgNr),e?.format&&(this.format=e.format),e?.enableLinks&&(this.enableLinks=e.enableLinks)}}const t=["custom-divider","custom-feedback","custom-field","custom-header","custom-list","custom-paragraph","custom-table","custom-dispensasjoner-list-data","custom-dispensasjoner-unit-in-list","custom-feedback-data","custom-feedbacklist-data","custom-feedbacklist-validation-messages","custom-field-adresse","custom-field-boolean-data","custom-field-boolean-text","custom-field-count-data","custom-field-data","custom-field-list-data","custom-field-kommunens-saksnummer","custom-field-part-navn","custom-field-prosjekt","custom-field-telefonnummer","custom-field-utfall-svar-status","custom-grouplist-ettersending","custom-grouplist-utfall-svar-type","custom-grouplist-utfall-svar","custom-group-ettersending","custom-group-utfall-svar-type","custom-group-utfall-svar","custom-header-text","custom-header-text-data","custom-list-data","custom-list-vedlegg","custom-paragraph-text","custom-paragraph-text-data","custom-subheader-text","custom-table-arbeidsplasser","custom-table-data","custom-table-eiendom","custom-table-part","custom-dispensasjon","custom-gjennomfoeringsplan"];function s(e){if(null==e)return!1;if("string"==typeof e)return e.length>0;if("number"==typeof e)return!1===isNaN(e);if("boolean"==typeof e)return!0===e;if(Array.isArray(e))return e.length>0;for(let t in e)if(!!e?.[t]?.toString().length>0)return!0;return!1}function n(e){const t="number"==typeof e?e:Number(e);return"number"==typeof t&&!isNaN(t)&&t>0}function i(e,t){for(let s in t)e.style[s]=t[s]}function r(e){const t=e?.resourceValues?.emptyFieldText;return t||""}function a(e,s){if(!function(e){return t.includes(e)}(e))throw new Error(`Invalid tag name ${e}. Must be one of: ${t.join(", ")}`);const n=document.createElement(e);return function(e,t){for(const s in t)e.setAttribute(s,t[s])}(n,{...s,tagName:e}),n}function o(e,t){const n=document.createElement("div"),r=document.createElement("div");return r.appendChild(e),n.appendChild(r),i(n,{...s(t)?{flexGrow:"0",maxWidth:"50%",flexBasis:"50%"}:{flexBasis:"100%",maxWidth:"100%"},padding:"0.75rem 0px"}),n}function l(){return"undefined"!=typeof window&&window.textResources?window.textResources:[]}function u(e,t,s,n){s.forEach(s=>{void 0!==e[s]&&null!==e[s]||(null!=t?.[s]?console.warn(`Missing textResourceBindings.${s} for "${n}". Using fallback text: "${t[s]}"`):console.warn(`Missing textResourceBindings.${s} for "${n}".`))})}function d(e){const t="true"===e.getAttribute("isChildComponent"),s=e?.parentElement?.parentElement;return t?e:s||null}function c(e){const t=l(),s=t?.resources?.find(t=>t.id===e)?.value;return s||e}function m(e){const t={};for(const s in e)t[s]=c(e[s]);return t}function h(e){return e.isChildComponent?e.resourceValues?.data:e.formData?.simpleBinding||e.formData?.data}function p(e){return e.isChildComponent?e.resourceValues?.dataTitle:null!=e.formData?.dataTitle?e.formData?.dataTitle:void 0}function g(e,t){return s(e?.resourceValues?.[t])?e.resourceValues?.[t]:c(e?.resourceBindings?.[t])}function f(e,t){return t.filter(e=>!!e).forEach(t=>{t instanceof HTMLElement?e.appendChild(t):e.innerHTML+=t}),e}customElements.define("custom-divider",class extends HTMLElement{connectedCallback(){const t=new e(this),s=document.createElement("hr");i(s,t?.styleOverride),this.innerHTML="",this.appendChild(s)}});class y{constructor(e){this.effekt=e?.effekt}}class k{constructor(e){this.effekt=e?.effekt}}class b{constructor(e){this.hensynBakBestemmelsen=e?.hensynBakBestemmelsen,this.vurderingHensynBakBestemmelsen=e?.vurderingHensynBakBestemmelsen,this.vurderingHensynOverordnet=e?.vurderingHensynOverordnet,this.fordeler=e?.fordeler&&new y(e.fordeler),this.ulemper=e?.ulemper&&new k(e.ulemper),this.samletBegrunnelse=e?.samletBegrunnelse}}class T{constructor(e){this.kodebeskrivelse=e?.kodebeskrivelse}}class v{constructor(e){this.dispensasjonTittel=e?.dispensasjonTittel&&new T(e.dispensasjonTittel),this.inngangsbeskrivelse=e?.inngangsbeskrivelse&&new T(e.inngangsbeskrivelse),this.annenInngangsbeskrivelse=e?.annenInngangsbeskrivelse,this.beskrivelse=e?.beskrivelse}}class B{constructor(e){this.planidentifikasjon=e?.planidentifikasjon}}class C{constructor(e){this.nummerering=e?.nummerering}}class E{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new B(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new C(e.planbestemmelse)}}class x{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new T(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new E(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class V{constructor(e){this.adresselinje1=e?.adresselinje1,this.adresselinje2=e?.adresselinje2,this.adresselinje3=e?.adresselinje3,this.postnr=e?.postnr,this.poststed=e?.poststed}}class F{constructor(e){this.gaardsnummer=e?.gaardsnummer,this.bruksnummer=e?.bruksnummer,this.seksjonsnummer=e?.seksjonsnummer,this.festenummer=e?.festenummer}}class w{constructor(e){this.adresse=e?.adresse&&new V(e.adresse),this.eiendomsidentifikasjon=e?.eiendomsidentifikasjon&&new F(e.eiendomsidentifikasjon),this.bolignummer=e?.bolignummer,this.bygningsnummer=e?.bygningsnummer}}class j{constructor(e){this.eiendom=e?.eiendom&&e.eiendom.map(e=>new w(e))}}class M{constructor(e){this.saksaar=e?.saksaar,this.sakssekvensnummer=e?.sakssekvensnummer}}class L{constructor(e){this.ftbId=e?.ftbId,this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class I{constructor(e){const t=this.getAdresse(e);this.navn=e?.navn,this.organisasjonsnummer=e?.organisasjonsnummer,this.epost=e?.epost,this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer,t&&(this.adresse=t)}getAdresse(e){if(s(e?.adresse))return new V(e.adresse)}}class D{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new T(e.koordinatsystem),this.koordinater=e?.koordinater}}class H{constructor(e){this.posisjon=e?.posisjon&&new D(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new T(e.vertikalnivaa)}}class A{constructor(e){const t=e?this.getTypeFromProps(e):null;t&&(this.type=t)}getTypeFromProps(e){return e&&s(e?.type)?{kode:this.getKodeFromType(e.type)}:null}getKodeFromType(e){return Array.isArray(e?.kode)&&e?.kode?.length?e?.kode?.map(e=>new T(e)):null}}class S{constructor(e){this.oenskesVarigDispensasjon=e?.oenskesVarigDispensasjon,this.oensketVarighetTil=e?.oensketVarighetTil}}class P{constructor(e){this.dispensasjonBeskrivelse=e?.dispensasjonBeskrivelse&&new v(e.dispensasjonBeskrivelse),this.dispensasjonReferanse=e?.dispensasjonReferanse,this.soeknadstype=e?.soeknadstype&&new T(e.soeknadstype),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new M(e.kommunensSaksnummer),this.metadata=e?.metadata&&new L(e.metadata),this.eiendomByggested=e?.eiendomByggested&&new j(e.eiendomByggested),this.tiltakstyper=e?.tiltakstyper&&new A(e.tiltakstyper),this.tiltakshaver=e?.tiltakshaver&&new I(e.tiltakshaver),this.dispensasjonFra=e?.dispensasjonFra&&new x(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new H(e.stedfesting),this.varighet=e?.varighet&&new S(e.varighet),this.begrunnelse=e?.begrunnelse&&new b(e.begrunnelse),this.generelleVilkaar=e?.generelleVilkaar}}class N{constructor(e){this.error=e?.error||[],this.warning=e?.warning||[],this.info=e?.info||[],this.success=e?.success||[],this.default=e?.default||[]}}function O(e){return!!e&&Object.values(e).some(e=>e.length>0)}function R(e,t,s=new N){for(const n in t)for(const i in t[n]){const r=t[n][i],a=e?.resources?.find(e=>e.id===r);a?""===a.value&&s.info.push(`Empty text resource for "${i}" with id: "${r}" in component "${n}"`):s.error.push(`Missing text resource for "${i}" with id: "${r}" in component "${n}"`)}return s}class K extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(),n=!this.hasContent(t),i=this.dataIsPlanBestemmelseType(t),r=this.getValidationMessages(s);this.isEmpty=n,this.isPlanBestemmelseType=i,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings=s,this.resourceValues={data:n?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return s(e?.formData)&&new P(e.formData)}getValidationMessages(e){return R("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}dataIsPlanBestemmelseType(e){return["reguleringsplan","kommuneplan","kommunedelplan"].includes(e?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse?.toLowerCase())}getResourceBindings(){return{dispensasjonReferanse:{title:"resource.dispensasjon.dispensasjonReferanse.title"},metadataFtbId:{title:"resource.metadata.ftbId.title"},kommunensSaksnummer:{title:"resource.kommunensSaksnummer.title"},soeknadGjelderHeader:{title:"resource.soeknadGjelder.header"},tiltakstyperTypeHeader:{title:"resource.tiltakstyper.type.header"},tiltakstyperTypeKode:{title:"resource.tiltakstyper.type.kode.title"},tiltakshaverAdresse:{title:"resource.tiltakshaver.adresse.title"},dispensasjonBeskrivelseBeskrivelse:{title:"resource.dispensasjonBeskrivelse.beskrivelse.title"},dispensasjonFraHeader:{title:"resource.dispensasjonFra.header"},dispensasjonPlanBestemmelseNavn:{title:"resource.dispensasjonFra.dispensasjonPlanBestemmelse.navn.title"},nasjonalArealplanIdPlanIdentifikasjon:{title:"resource.dispensasjonFra.nasjonalArealplanId.planidentifikasjon.title"},bestemmelserType:{title:"resource.dispensasjonFra.bestemmelserType.title"},planBestemmelseNummerering:{title:"resource.dispensasjonFra.dispensasjonPlanBestemmelse.planbestemmelse.nummerering.title"},stedfestingHeader:{title:"resource.stedfesting.header"},stedfestingPosisjonKoordinatsystem:{title:"resource.stedfesting.posisjon.koordinatsystem.title"},stedfestingPosisjonKoordinater:{title:"resource.stedfesting.posisjon.koordinater.title"},stedfestingVertikalnivaa:{title:"resource.stedfesting.vertikalnivaa.title"},varighetHeader:{title:"resource.varighet.header"},varighetOenskesVarigDispensasjon:{trueText:"resource.varighet.oenskesVarigDispensasjon.true.title"},varighetOensketVarighetTil:{title:"resource.varighet.oensketVarighetTil.title"},begrunnelseHeader:{title:"resource.begrunnelse.header"},begrunnelseHensynBakBestemmelsen:{title:"resource.begrunnelse.hensynBakBestemmelsen.title"},begrunnelseVurderingHensynBakBestemmelsen:{title:"resource.begrunnelse.vurderingHensynBakBestemmelsen.title"},begrunnelseVurderingHensynOverordnet:{title:"resource.begrunnelse.vurderingHensynOverordnet.title"},begrunnelseFordeler:{title:"resource.begrunnelse.fordeler.title"},begrunnelseUlemper:{title:"resource.begrunnelse.ulemper.title"},begrunnelseSamletBegrunnelse:{title:"resource.begrunnelse.samletBegrunnelse.title"},generelleVilkaarNorskSvenskDansk:{title:"resource.generelleVilkaar.norskSvenskDansk.header",trueText:"resource.generelleVilkaar.norskSvenskDansk.true.title"}}}}const $=["default"],z={dateTime:{default:{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}},date:{default:{day:"2-digit",month:"2-digit",year:"numeric"}},time:{default:{hour:"2-digit",minute:"2-digit",second:"2-digit"}}},U={dateTime:{default:"no-NO"},date:{default:"no-NO"},time:{default:"no-NO"}},J=["h1","h2","h3","h4","h5","h6"];function G(e){return $.includes(e)?e:"default"}function Z(e){const t=new Date(e);return!!e&&!isNaN(t.getTime())}function W(e,t,s="default"){switch(t){case"dateTime":return function(e,t="default"){if(!Z(e))return"Ugyldig datoformat";t=G(t),e.includes("T")||(e+="T00:00:00");const s=U.dateTime[t],n=z.dateTime[s]||z.dateTime.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);case"date":return function(e,t="default"){Z(e)||(e=function(e){const t=e.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!t)return null;const s=parseInt(t[1],10),n=parseInt(t[2],10)-1,i=parseInt(t[3],10),r=new Date(Date.UTC(i,n,s));return r.getFullYear()===i&&r.getMonth()===n&&r.getDate()===s?r.toISOString():null}(e)),t=G(t);const s=U.date[t],n=z.date[s]||z.date.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);case"time":return function(e,t="default"){e.includes("T")||(e="1970-01-01T"+e),Z(e)||(e=function(e){const t=e.match(/^(\d{2}):(\d{2})(?::(\d{2}))?$/);if(!t)return null;const s=parseInt(t[1],10),n=parseInt(t[2],10),i=t[3]?parseInt(t[3],10):0;return s<0||s>23||n<0||n>59||i<0||i>59?null:new Date(Date.UTC(1970,0,1,s,n,i)).toISOString()}(e)),t=G(t);const s=U.time[t],n=z.time[s]||z.time.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);default:return e}}function Y(e){return s(e)&&J.includes(e.toLowerCase())}class _ extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return W(h(e),e?.format)}}class q extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceBindings=s,this.isEmpty=n,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}getValidationMessages(e){return R("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}getTextResourceBindings(e){const t={dispensasjonPlanBestemmelseNavn:{title:e?.resourceBindings?.dispensasjonPlanBestemmelseNavn?.title||"resource.dispensasjonEllerTillatelse.dispensasjonPlanBestemmelseNavn.title"},dispensasjonPlanBestemmelseNasjonalArealPlanId:{title:e?.resourceBindings?.dispensasjonPlanBestemmelseNasjonalArealPlanId?.title||"resource.dispensasjonEllerTillatelse.dispensasjonPlanBestemmelseNasjonalArealPlanId.title"},dispensasjonPlanBestemmelsePlanBestemmelse:{title:e?.resourceBindings?.dispensasjonPlanBestemmelsePlanBestemmelse?.title||"resource.dispensasjonEllerTillatelse.dispensasjonPlanBestemmelsePlanBestemmelse.title"},lovbestemmelse:{title:e?.resourceBindings?.lovbestemmelse?.title||"resource.dispensasjonEllerTillatelse.lovbestemmelse.title"},begrunnelse:{title:e?.resourceBindings?.begrunnelse?.title||"resource.dispensasjonEllerTillatelse.begrunnelse.title"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.dispensasjonEllerTillatelse={title:e?.resourceBindings?.title||"resource.dispensasjonEllerTillatelse.header"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.eiendomByggested={...t.eiendomByggested,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Q extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class X extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class ee extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:e?.resourceValues?.title||"Messages",data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return h(e)}}class te extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=h(e);return new N(t)}}class se extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class ne extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}formatAdresselinje(e){return[e.adresselinje1,e.adresselinje2,e.adresselinje3].filter(e=>e?.length).join("\n")}formatZipCity(e){return[e.postnr,e.poststed].filter(e=>e?.length).join(" ")}formatAdresse(e){const t=this.formatAdresselinje(e),s=this.formatZipCity(e);return t.length&&s.length?`${t}\n${s}`:t.length?t:s.length?s:""}getValueFromFormData(e){const t=h(e),s=new V(t);return this.formatAdresse(s)}hasContent(e){return s(e)}}class ie extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=e?.id?.length&&"string"==typeof e?.id?e.id:"custom-field-boolean-data",s=h(e),i=n(s),r=function(e){return e.isChildComponent?{trueData:e.resourceValues?.trueData,falseData:e.resourceValues?.falseData,defaultData:e.resourceValues?.defaultData}:{trueData:e.formData?.trueData,falseData:e.formData?.falseData,defaultData:e.formData?.defaultData}}(e);return function(e,t,s){["trueData","falseData","defaultData"].forEach(t=>{void 0!==e[t]&&null!==e[t]||console.warn(`Missing dataModelBindings.${t} for "${s}".`)})}(r,0,t),!0===s||"true"===s||i?void 0!==r?.trueData&&null!==r.trueData?r.trueData:"":!1===s||"false"===s?void 0!==r?.falseData&&null!==r.falseData?r.falseData:"":r?.defaultData?r.defaultData:""}}class re extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=e?.id||"custom-field-boolean-text",s=h(e),n=function(e){return{trueText:e.resourceValues?.trueText||c(e?.resourceBindings?.trueText),falseText:e.resourceValues?.falseText||c(e?.resourceBindings?.falseText),defaultText:e.resourceValues?.defaultText||c(e?.resourceBindings?.defaultText)}}(e),i={trueText:"Ja",falseText:"Nei",defaultText:""};return u(n,i,["trueText","falseText","defaultText"],t),!0===s||"true"===s?void 0!==n?.trueText&&null!==n.trueText?n.trueText:i.trueText:!1===s||"false"===s?void 0!==n?.falseText&&null!==n.falseText?n.falseText:i.falseText:n?.defaultText?n.defaultText:i.defaultText}}class ae extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return n(e)}getValueFromFormData(e){const t=h(e);return t&&Array.isArray(t)?t.length:0}}class oe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=p(e),n=!this.hasContent(t),i=!this.hasContent(s);this.isEmpty=n,this.resourceValues={title:!e?.hideTitle&&(!i&&s||g(e,"title")),data:n?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return W(h(e),e?.format)}}class le extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}formatKommunensSaksnummer(e){return[e?.saksaar?.toString(),e?.sakssekvensnummer?.toString()].filter(e=>e?.length).join("/")}getValueFromFormData(e){const t=h(e),s=new M(t);return this.formatKommunensSaksnummer(s)}}class ue extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,Array.isArray(t)&&t.length&&(this.resourceValues={data:t})}hasContent(e){return s(e)}getListItemsFromKey(e,t){if(!Array.isArray(e)||!e.length)return[];const s=t.split(".");return e.map(e=>s.reduce((e,t)=>e?.[t],e))}getValueFromFormData(e){const t=this.hasContent(e?.dataItemKey),n=this.hasContent(e?.dataTitleItemKey),i=h(e);if(t&&n){const t=s(e?.dataTitleItemKey)?this.getListItemsFromKey(i,e?.dataTitleItemKey):i,n=s(e?.dataItemKey)?this.getListItemsFromKey(i,e?.dataItemKey):i,r=Math.min(t.length,n.length);return Array.from({length:r},(e,s)=>({title:t[s],data:n[s]}))}}}class de extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}formatName(e,t){if(!e?.navn)return"";let s=e.navn;return!t&&e.organisasjonsnummer&&(s+=`\nOrganisasjonsnummer: ${e.organisasjonsnummer}`),s}getValueFromFormData(e){const t=h(e),s=new I(t);return this.formatName(s,this.hideOrgNr)}hasContent(e){return s(e)}}class ce{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class me extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}hasContent(e){return s(e)}formatProsjekt(e){const t=s(e?.prosjektnr)&&`(${e.prosjektnr?.toString()})`;return[e?.prosjektnavn?.toString(),t].filter(e=>e?.length).join(" ")}getValueFromFormData(e){const t=new ce(e?.formData?.data);return this.formatProsjekt(t)}}class he{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}class pe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}formatPhoneNumbers(e){return[e.telefonnummer,e.mobilnummer].filter(e=>e?.length).join("\n")}getValueFromFormData(e){const t=h(e),s=new he(t);return this.formatPhoneNumbers(s)}hasContent(e){return s(e)}}class ge{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}class fe extends e{constructor(e){super(e);const t=this.getResourceBindings(e),s=this.getValueFromFormData(e,t?.utfallSvarStatus),n=!this.hasContent(s),i=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceValues={title:c(t?.utfallSvarStatus?.title),data:n?g(e,"emptyFieldText"):s}}hasContent(e){return s(e)}getValidationMessages(e){return R(l(),e)}getStatusText(e,t,s){const n=m(t),i={erUtfallBesvaresSenere:"Besvares senere",erUtfallBesvart:"Svar innsendt tidligere",status:"Besvares nå"};return u(n,i,["erUtfallBesvaresSenere","erUtfallBesvart","status"],s),e?.erUtfallBesvaresSenere?null!=n?.erUtfallBesvaresSenere?n.erUtfallBesvaresSenere:i.erUtfallBesvaresSenere:e?.erUtfallBesvart?null!=n?.erUtfallBesvart?n.erUtfallBesvart:i.erUtfallBesvart:n?.status?n.status:i.status}getValueFromFormData(e,t){const s=h(e),n=new ge(s);return this.getStatusText(n,t,e?.id)}getResourceBindings(e){return{utfallSvarStatus:{title:e?.resourceBindings?.title||"resource.utfallBesvarelse.utfallSvar.status.title",erUtfallBesvaresSenere:"resource.utfallBesvarelse.utfallSvar.erUtfallBesvaresSenere",erUtfallBesvart:"resource.utfallBesvarelse.utfallSvar.erUtfallBesvart",status:"resource.utfallBesvarelse.utfallSvar.status"}}}}class ye{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new T(e.vedleggstype)}}class ke{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map(e=>new ye(e)):void 0}}class be{constructor(e){this.kommentar=e?.kommentar,this.tema=e?.tema?new T(e.tema):void 0,this.tittel=e?.tittel,this.vedleggsliste=e?.vedleggsliste?new ke(e.vedleggsliste):void 0}}class Te extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceBindings=s?.ettersending||{},this.resourceValues={data:n?c(s?.ettersending?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return R(l(),e)}getValueFromFormData(e){const t=h(e);return new be(t)}getResourceBindings(e){const t={"tema.kodebeskrivelse.title":"resource.ettersendinger.ettersending.tema.kodebeskrivelse.title","kommentar.title":"resource.ettersendinger.ettersending.kommentar.title","vedleggsliste.vedlegg.title":"resource.ettersendinger.ettersending.vedleggsliste.vedlegg.title"};return 1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{ettersending:t}}}class ve extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceValues={title:c(s?.ettersendinger?.title),data:n?c(s?.ettersendinger?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return R(l(),e)}getValueFromFormData(e){return h(e)}getResourceBindings(e){const t={};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.title=e?.resourceBindings?.title||"resource.ettersendinger.title"),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{ettersendinger:t}}}class Be extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceValues={title:c(s?.utfallSvar?.title),data:n?c(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return R(l(),e)}getValueFromFormData(e){return h(e)}getResourceBindings(e){const t={};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.title=e?.resourceBindings?.title),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{utfallSvar:t}}}class Ce{constructor(e){this.kodeverdi=e?.kodeverdi}}class Ee{constructor(e){this.beskrivelse=e?.beskrivelse,this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart,this.kommentar=e?.kommentar,this.tema=e?.tema?new T(e.tema):void 0,this.tittel=e?.tittel,this.utfallType=e?.utfallType?new Ce(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new ke(e.vedleggsliste):void 0}}class xe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return R(l(),e)}getValueFromFormData(e){const t=h(e);return this.groupArrayItemsByUtfallType(t)}groupArrayItemsByUtfallType(e){return s(e)?e.reduce((e,t)=>{const s=t?.utfallType?.kodeverdi;return s?.length?(e[s]||(e[s]=[]),e[s].push(new Ee(t)),e):e},{}):{}}}class Ve extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceBindings=s?.utfallSvar||{},this.resourceValues={data:n?c(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return R(l(),e)}getValueFromFormData(e){const t=h(e);return new Ee(t)}getResourceBindings(e){const t={"status.title":"resource.utfallBesvarelse.utfallSvar.status.title","tema.kodebeskrivelse.title":"resource.utfallBesvarelse.utfallSvar.tema.kodebeskrivelse.title","kommentar.title":"resource.utfallBesvarelse.utfallSvar.kommentar.title","vedleggsliste.vedlegg.title":"resource.utfallBesvarelse.utfallSvar.vedleggsliste.vedlegg.title"};return 1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{utfallSvar:t}}}class Fe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceBindings={title:s?.utfallSvarType?.title},this.resourceValues={data:n?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return R(l(),e)}getValueFromFormData(e){return h(e)}getResourceBindings(e){const t=e?.resourceValues?.utfallType;return{utfallSvarType:{title:`resource.utfallBesvarelse.utfallSvar.${t?.toLowerCase()}.header`}}}}class we extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues,this.size=e?.size}hasContent(e){return s(e?.resourceValues?.title)}}class je extends e{constructor(e){super(e),this.size=e?.size,this.resourceValues={title:g(e,"title")}}}class Me extends e{constructor(e){super(e),this.size=e?.size;const t=g(e,"title"),s=p(e);this.resourceValues={title:[t||"",s||""].filter(Boolean).join(" ")}}}class Le extends e{constructor(e){super(e),this.isEmpty=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class Ie extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getListItemsFromKey(e,t){return Array.isArray(e)&&e.length?e.map(e=>e?.[t]):[]}getValueFromFormData(e){const t=h(e);return s(e?.itemKey)?this.getListItemsFromKey(t,e?.itemKey):t}}class De extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:g(e,"title"),data:s?g(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getAttachmentFileName(e){return e?.filnavn}getAttachmentDescription(e){return e?.vedleggstype?.kodebeskrivelse}getAttachmentListItems(e){return e&&Array.isArray(e)&&e?.length?e.map(e=>{const t=new ye(e),s=this.getAttachmentDescription(t),n=this.getAttachmentFileName(t);return s?.length&&n?.length?`${s} (${n})`:s?.length?s:n?.length?n:null}).filter(e=>e):[]}getValueFromFormData(e){const t=h(e);return this.getAttachmentListItems(t)}}class He extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues}hasContent(e){return s(e?.resourceValues?.title)}}class Ae extends e{constructor(e){super(e),this.resourceValues={title:g(e,"title")}}}class Se extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=g(e,"body"),n=this.hasContent(e?.endSymbol)?e?.endSymbol:"",i=this.getTextDataCombination(t,s||"",n),r=!this.hasContent(t);this.isEmpty=r,this.resourceValues={title:r?g(e,"emptyFieldText"):i}}hasContent(e){return s(e)}getTextDataCombination(e,t,s){const n=`${t} ${e}${s}`.trim();return n?.length>0?`${n}`:""}getValueFromFormData(e){return W(h(e),e?.format)}}class Pe extends e{constructor(e){super(e),this.resourceValues={title:g(e,"title")}}}class Ne extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class Oe{constructor(e){this.antallAnsatte=e?.antallAnsatte,this.antallVirksomheter=e?.antallVirksomheter,this.beskrivelse=e?.beskrivelse,this.eksisterende=e?.eksisterende,this.faste=e?.faste,this.framtidige=e?.framtidige,this.midlertidige=e?.midlertidige,this.utleieBygg=e?.utleieBygg,this.veiledning=e?.veiledning}}class Re extends e{constructor(e){super(e);const t=["eksisterende","faste","framtidige","midlertidige","utleieBygg"],s=this.getTextResourceBindings(e,t),n=this.getValueFromFormData(e,t,s),i=!this.hasContent(n),r=this.getValidationMessages(s);this.isEmpty=i,this.validationMessages=r,this.hasValidationMessages=O(r),this.resourceBindings=s,this.resourceValues={data:i?c(e?.resourceBindings?.emptyFieldText):n}}getValueFromFormData(e,t,n){const i=h(e);if(!s(i))return;const r=new Oe(i);return this.hasArbeidsplasserBeroertProps(r,t)?this.getArbeidsplasserBeroertArray(r,t,n):void 0}getArbeidsplasserBeroertArray(e,t,s){return t.map(t=>({title:c(s[t]?.title),value:e[t]?c(s[t]?.trueText):c(s[t]?.falseText)}))}getValidationMessages(e){return R("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasArbeidsplasserBeroertProps(e,t){return t.some(t=>void 0!==e?.[t])}getTextResourceBindings(e,t){const s={arbeidsplasser:{},arbeidsplasserKey:{title:e?.resourceBindings?.arbeidsplasserKey?.title||"resource.arbeidsplasser.arbeidsplasserKey.title"},beroertAvTiltaket:{title:e?.resourceBindings?.beroertAvTiltaket?.title||"resource.arbeidsplasser.beroertAvTiltaket.title"}};return t.forEach(t=>{s[t]={title:e?.resourceBindings?.[t]?.title||`resource.arbeidsplasser.${t}.title`,trueText:e?.resourceBindings?.[t]?.trueText||"resource.trueText.default",falseText:e?.resourceBindings?.[t]?.falseText||"resource.falseText.default"}}),1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(s.arbeidsplasser={title:e?.resourceBindings?.title||"resource.arbeidsplasser.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(s.arbeidsplasser={...s.arbeidsplasser,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),s}}class Ke extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t),n=this.getValidationMessagesFromProps(e);this.isEmpty=s,this.validationMessages=n,this.hasValidationMessages=O(n),this.resourceValues={title:c(e?.resourceBindings?.title),data:s?c(e?.resourceBindings?.emptyFieldText):t}}getValueFromFormData(e){const t=h(e);return{tableHeaders:this.getTableHeadersFromProps(e),tableRows:this.getTableRowsFromProps(e,t)}}getTableHeadersFromProps(e){const t=e?.tableColumns||[];if(0===t.length)return[];const s=function(e){return e.map(e=>{const t=e?.resourceBindings?.title;return{text:c(t),props:e.props}})}(t);var n;return e.showRowNumbers&&s.unshift({text:(n=e,c(n?.resourceBindings?.rowNumberTitle)||"#")}),s}getTableRowsFromProps(e,t){const n=function(e,t){return!Array.isArray(t)&&(t=[t]),t.map(t=>{const n=[];return e.forEach(e=>{const i=function(e,t){return t?null==e||/(\.\.|^\.)/.test(t)?void 0:t.split(/\.|\[|\]/).filter(Boolean).reduce((e,t)=>e&&e[t],e):e}(t,e.dataKey),r=e?.resourceBindings?.emptyFieldText,a=c(r),o={resourceBindings:e.resourceBindings,resourceValues:{data:i},format:e.format,hideTitle:!0,tagName:e.tagName,isChildComponent:!0};s(a)&&(o.resourceValues.emptyFieldText=a),n.push(o)}),n})}(e?.tableColumns||[],t),i=this.removeEmptyTableRows(n);return e.showRowNumbers?i.map((e,t)=>[{tagName:"custom-field-data",hideTitle:!0,isChildComponent:!0,resourceValues:{data:t+1}},...e]):i}getValidationMessagesFromProps(e){return function(e,t=new N){const s=l();return e.forEach((e,n)=>{Object.keys(e?.textResourceBindings||{}).forEach(i=>{const r=s?.resources?.find(t=>t.id===e.textResourceBindings[i]);r?""===r.value&&t.info.push(`Empty text resource binding with id: "${e.textResourceBindings[i]}" for "${i}" at table column [${n}]`):t.error.push(`Missing text resource binding with id: "${e.textResourceBindings[i]}" for "${i}" at table column [${n}]`)})}),t}(e?.tableColumns)}removeEmptyTableRows(e){return Array.isArray(e)?e.map(e=>{const t=e.map(e=>ht(e));return t.filter(e=>!e?.isEmpty).length>0?t:null}).filter(e=>null!==e):[]}hasContent(e){return s(e)}}class $e extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceBindings=s,this.resourceValues={data:n?c(s?.eiendomByggested?.emptyFieldText):t}}getValueFromFormData(e){const t=h(e);return this.getEiendomListFromData(t)}getEiendomListFromData(e){if(s(e))return e.map(e=>new w(e)).filter(e=>this.hasEiendomValue(e))}getValidationMessages(e){return R("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasZipCodeOrCity(e){return s(e?.adresse?.postnr)||s(e?.adresse?.poststed)}hasAdresseLinje(e){return s(e?.adresse?.adresselinje1)||s(e?.adresse?.adresselinje2)||s(e?.adresse?.adresselinje3)}hasAdresse(e){return this.hasAdresseLinje(e)||this.hasZipCodeOrCity(e)}hasEiendomNummerField(e){return s(e?.bolignummer)||s(e?.bygningsnummer)||s(e?.eiendomsidentifikasjon?.gaardsnummer)||s(e?.eiendomsidentifikasjon?.bruksnummer)||s(e?.eiendomsidentifikasjon?.seksjonsnummer)||s(e?.eiendomsidentifikasjon?.festenummer)}hasEiendomValue(e){return this.hasAdresse(e)||this.hasEiendomNummerField(e)}getTextResourceBindings(e){const t={adresse:{title:e?.resourceBindings?.adresse?.title||"resource.eiendomByggested.eiendom.adresse.title",emptyFieldText:e?.resourceBindings?.adresse?.emptyFieldText||"resource.eiendomByggested.eiendom.adresse.emptyFieldText"},eiendomsidentifikasjonGaardsnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.gaardsnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.gaardsnummer?.emptyFieldText||"resource.emptyFieldText.default"},eiendomsidentifikasjonBruksnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.bruksnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.bruksnummer?.emptyFieldText||"resource.emptyFieldText.default"},eiendomsidentifikasjonSeksjonsnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.seksjonsnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.seksjonsnummer?.emptyFieldText||"resource.emptyFieldText.default"},eiendomsidentifikasjonFestenummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.festenummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.festenummer?.emptyFieldText||"resource.emptyFieldText.default"},bolignummer:{title:e?.resourceBindings?.bolignummer?.title||"resource.eiendomByggested.eiendom.bolignummer.title",emptyFieldText:e?.resourceBindings?.bolignummer?.emptyFieldText||"resource.emptyFieldText.default"},bygningsnummer:{title:e?.resourceBindings?.bygningsnummer?.title||"resource.eiendomByggested.eiendom.bygningsnummer.title",emptyFieldText:e?.resourceBindings?.bygningsnummer?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.eiendomByggested={title:e?.resourceBindings?.title||"resource.eiendomByggested.eiendom.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.eiendomByggested={...t.eiendomByggested,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class ze extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.partType=e?.partType,this.validationMessages=i,this.hasValidationMessages=O(i),this.resourceBindings=s,this.resourceValues={data:n?c(e?.resourceBindings?.emptyFieldText):t}}getPartTypeFromElementAttributes(e){return e.getAttribute("parttype")||"tiltakshaver"}getValueFromFormData(e){const t=h(e);if(!s(t))return;const n=new I(t);return this.hasPartValue(n)?n:void 0}getValidationMessages(e){return R("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasNavnOrOrganisasjonsnummer(e){return s(e?.navn)||s(e?.organisasjonsnummer)}hasTelefonnummer(e){return s(e?.telefonnummer)||s(e?.mobilnummer)}hasEpost(e){return s(e?.epost)}hasPartValue(e){return this.hasNavnOrOrganisasjonsnummer(e)||this.hasTelefonnummer(e)||this.hasEpost(e)}getTextResourceBindings(e){const t=e?.partType||"tiltakshaver",s={navn:{title:e?.resourceBindings?.navn?.title||`resource.${t}.navn.title`,emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText||"resource.emptyFieldText.default"},telefonnummer:{title:e?.resourceBindings?.telefonnummer?.title||`resource.${t}.telefonnummer.title`,emptyFieldText:e?.resourceBindings?.telefonnummer?.emptyFieldText||"resource.emptyFieldText.default"},epost:{title:e?.resourceBindings?.epost?.title||`resource.${t}.epost.title`,emptyFieldText:e?.resourceBindings?.epost?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(s.part={title:e?.resourceBindings?.title||`resource.${t}.header`}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(s.part={...s.part,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),s}}function Ue(e){const t=JSON.parse(e?.getAttribute("formdata"));return s(t)&&t}function Je(e){const t=e?.getAttribute("tagName")||e?.tagName?.toLowerCase();return s(t)&&t}function Ge(e){const t=e?.getAttribute("text");return s(t)&&t}function Ze(e){const t=JSON.parse(e?.getAttribute("texts"));return s(t)&&t}function We(e){return"true"===e?.getAttribute("inline")}function Ye(e){return"true"===e?.getAttribute("hideTitle")}function _e(e){const t=e?.getAttribute("size");return Y(t)?t?.toString().toLowerCase():void 0}function qe(e){return"true"===e?.getAttribute("hideIfEmpty")}function Qe(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return s(t)&&t}function Xe(e){return"true"===e?.getAttribute("isChildComponent")}function et(e){const t=e?.getAttribute("feedbackType");return s(t)&&t}function tt(e){const t=e?.getAttribute("itemKey");return s(t)&&t}function st(e){const t=e?.getAttribute("dataItemKey");return s(t)&&t}function nt(e){const t=e?.getAttribute("dataTitleItemKey");return s(t)&&t}function it(e){return"true"===e?.getAttribute("hideOrgNr")}function rt(e){const t=e?.getAttribute("format");return s(t)&&t}function at(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return s(t)&&t}function ot(e){return"true"===e?.getAttribute("showRowNumbers")}function lt(e){const t=JSON.parse(e?.getAttribute("resourceBindings"));return s(t)&&t}function ut(e){const t=JSON.parse(e?.getAttribute("resourceValues"));return s(t)&&t}function dt(e){const t=e?.getAttribute("partType");return s(t)?t:"tiltakshaver"}function ct(e){return"true"===e?.getAttribute("enableLinks")}function mt(e){const t=e?.getAttribute("endSymbol");return s(t)&&t}function ht(t){const s=t instanceof HTMLElement?function(e){return{formData:Ue(e),tagName:Je(e),text:Ge(e),texts:Ze(e),inline:We(e),hideTitle:Ye(e),size:_e(e),hideIfEmpty:qe(e),styleOverride:Qe(e),isChildComponent:Xe(e),feedbackType:et(e),itemKey:tt(e),dataItemKey:st(e),dataTitleItemKey:nt(e),hideOrgNr:it(e),format:rt(e),tableColumns:at(e),showRowNumbers:ot(e),resourceBindings:lt(e),resourceValues:ut(e),partType:dt(e),enableLinks:ct(e),endSymbol:mt(e)}}(t):t,n=s?.tagName||s?.getAttribute("tagname")||"custom-component";switch(n?.toLowerCase()){case"custom-component":return new e(s);case"custom-dispensasjon":return new K(s);case"custom-dispensasjoner-list-data":return new _(s);case"custom-dispensasjoner-unit-in-list":return new q(s);case"custom-feedback":return new Q(s);case"custom-feedback-data":return new X(s);case"custom-feedbacklist-data":return new ee(s);case"custom-feedbacklist-validation-messages":return new te(s);case"custom-field":return new se(s);case"custom-field-adresse":return new ne(s);case"custom-field-boolean-data":return new ie(s);case"custom-field-boolean-text":return new re(s);case"custom-field-count-data":return new ae(s);case"custom-field-data":return new oe(s);case"custom-field-list-data":return new ue(s);case"custom-field-kommunens-saksnummer":return new le(s);case"custom-field-part-navn":return new de(s);case"custom-field-prosjekt":return new me(s);case"custom-field-telefonnummer":return new pe(s);case"custom-field-utfall-svar-status":return new fe(s);case"custom-group-ettersending":return new Te(s);case"custom-group-utfall-svar":return new Ve(s);case"custom-group-utfall-svar-type":return new Fe(s);case"custom-grouplist-ettersending":return new ve(s);case"custom-grouplist-utfall-svar":return new Be(s);case"custom-grouplist-utfall-svar-type":return new xe(s);case"custom-header":return new we(s);case"custom-header-text":return new je(s);case"custom-header-text-data":return new Me(s);case"custom-list":return new Le(s);case"custom-list-data":return new Ie(s);case"custom-list-vedlegg":return new De(s);case"custom-paragraph":return new He(s);case"custom-paragraph-text":return new Ae(s);case"custom-paragraph-text-data":return new Se(s);case"custom-subheader-text":return new Pe(s);case"custom-table":return new Ne(s);case"custom-table-arbeidsplasser":return new Re(s);case"custom-table-data":return new Ke(s);case"custom-table-eiendom":return new $e(s);case"custom-table-part":return new ze(s);default:return console.warn(`Unknown component type: ${n}`),null}}function pt(e,t,n){n={returnHtml:!0,inline:!1,styleOverride:{},...n};const r=document.createElement("div");r.classList.add("field"),e?.length&&r.appendChild(function(e,t){const s=document.createElement("label");return s.innerText=`${e}${t?":":""}`,s}(e,n.inline)),n?.inline&&r.classList.add("inline");const a=function(e,t){const n=document.createElement("span");return Array.isArray(e)&&(e=e.join(", ")),"object"==typeof e&&(e=JSON.stringify(e,null,2)),s(e)?n.innerHTML=t?function(e){const t="(?:https?:\\/\\/(?:www\\.)?[a-zA-Z0-9][a-zA-Z0-9-]*\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]*\\.[^\\s]{2,})",s=new RegExp(`(${t})`,"g"),n=new RegExp(`^${t}$`),i=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return e.toString().split(s).map(e=>{if(!e)return"";if(n.test(e)){const t=e.match(/^(.*?)([).,!?:;]+)?$/),s=t[1],n=t[2]??"";return`<a href="${s.startsWith("http")?s:`https://${s}`}" target="_blank" rel="noopener noreferrer">${s}</a>${i(n)}`}return i(e)}).join("")}(e):e:n.innerHTML="",n}(t,n.enableLinks);return e?.length&&a.classList.add("has-title"),r.appendChild(a),i(r,{...n.styleOverride}),n.returnHtml?r.outerHTML:r}function gt(e,t,s=!0){const n=document.createElement(t||"ul");return e.forEach(e=>{const t=document.createElement("li");t.innerHTML=e,n.appendChild(t)}),s?n.outerHTML:n}customElements.define("custom-feedback",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this),s=e?.resourceValues?.data;e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e,t){const s=document.createElement("p");return s.innerHTML=e,s.classList.add(t),s.outerHTML}(s,e?.feedbackType)}}),customElements.define("custom-field",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t={inline:e?.inline,styleOverride:e?.styleOverride,enableLinks:e?.enableLinks};this.innerHTML=pt(e?.resourceValues?.title,e?.resourceValues?.data,t)}}}),customElements.define("custom-header",class extends HTMLElement{connectedCallback(){const e=ht(this);e?.isEmpty||(this.innerHTML=function(e){const t=e?.resourceValues?.title,s=e?.size,n=e?.styleOverride,r=document.createElement(Y(s)?s:"h2");return r.innerHTML=t,i(r,n),r.outerHTML}(e),i(this,e?.styleOverride))}}),customElements.define("custom-list",class extends HTMLElement{connectedCallback(){const e=new ht(this);this.innerHTML=e?.resourceValues?.title?.length?function(e,t,s){const n=document.createElement("div");n.classList.add("field"),e?.length&&n.appendChild(function(e){const t=document.createElement("label");return t.innerText=e,t}(e));const i=gt(t,s,!1);return e?.length&&i.classList.add("has-title"),n.appendChild(i),n.outerHTML}(e?.resourceValues?.title,e?.resourceValues?.data):gt(e?.resourceValues?.data),i(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=ht(this);if(!e?.isEmpty){const t=function(e){const t=e?.resourceValues?.title,s=e?.styleOverride,n=document.createElement("p");return n.innerHTML=t,i(n,s),n.outerHTML}(e);this.innerHTML=t}}});class ft{constructor(e){const t=this.getIsChildComponentAttributeFromProps(e),s=this.getFormDataAttributeFromProps(e),n=this.getTagNameAttributeFromProps(e),i=this.getSizeAttributeFromProps(e),r=this.getHideTitleAttributeFromProps(e),a=this.getHideIfEmptyAttributeFromProps(e),o=this.getIsEmptyAttributeFromProps(e),l=this.getInlineAttributeFromProps(e),u=this.getStyleOverrideAttributeFromProps(e),d=this.getGridAttributeFromProps(e),c=this.getTableColumnsAttributeFromProps(e),m=this.getItemKeyAttributeFromProps(e),h=this.getDataItemKeyAttributeFromProps(e),p=this.getDataTitleItemKeyAttributeFromProps(e),g=this.getIdAttributeFromProps(e),f=this.getFeedbackTypeAttributeFromProps(e),y=this.getHideOrgNr(e),k=this.getFormatAttributeFromProps(e),b=this.getShowRowNumbersAttributeFromProps(e),T=this.getPartTypeAttributeFromProps(e),v=this.getResourceBindingsFromProps(e),B=this.getResourceValuesFromProps(e),C=this.getEnableLinksFromProps(e),E=this.getEndSymbolAttributeFromProps(e);t&&(this.isChildComponent=t),s&&(this.formData=s),n&&(this.tagName=n),i&&(this.size=i),r&&(this.hideTitle=r),a&&(this.hideIfEmpty=a),o&&(this.isEmpty=o),l&&(this.inline=l),u&&(this.styleOverride=u),d&&(this.grid=d),c&&(this.tableColumns=c),m&&(this.itemKey=m),h&&(this.dataItemKey=h),p&&(this.dataTitleItemKey=p),g&&(this.id=g),f&&(this.feedbackType=f),y&&(this.hideOrgNr=y),k&&(this.format=k),b&&(this.showRowNumbers=b),T&&(this.partType=T),v&&(this.resourceBindings=v),B&&(this.resourceValues=B),C&&(this.enableLinks=C),E&&(this.endSymbol=E)}getFormDataAttributeFromProps(e){if(!s(e?.formData))return null;if("string"==typeof e?.formData){const t=e?.formData;return JSON.stringify(t)}if("number"==typeof e?.formData){const t=e?.formData.toString();return JSON.stringify(t)}if("object"==typeof e?.formData){const t={};return Object.keys(e.formData).forEach(s=>{t[s]=e.formData[s]}),JSON.stringify(t)}}getIsChildComponentAttributeFromProps(e){return e?.isChildComponent?"true":void 0}getTagNameAttributeFromProps(e){return e?.tagName?e?.tagName.toString():void 0}getSizeAttributeFromProps(e){return Y(e?.size)?e?.size?.toString().toLowerCase():void 0}getHideTitleAttributeFromProps(e){return"true"===e?.hideTitle?.toString()?"true":void 0}getHideIfEmptyAttributeFromProps(e){return"true"===e?.hideIfEmpty?.toString()?"true":void 0}getIsEmptyAttributeFromProps(e){return"true"===e?.isEmpty?.toString()?"true":void 0}getInlineAttributeFromProps(e){return"true"===e?.inline?.toString()?"true":void 0}getStyleOverrideAttributeFromProps(e){return s(e?.styleOverride)?JSON.stringify(e?.styleOverride):void 0}getGridAttributeFromProps(e){return s(e?.grid)&&JSON.stringify(e?.grid)}getTableColumnsAttributeFromProps(e){return s(e?.tableColumns)&&JSON.stringify(e?.tableColumns)}getItemKeyAttributeFromProps(e){return s(e?.itemKey)&&e?.itemKey}getDataItemKeyAttributeFromProps(e){return s(e?.dataItemKey)&&e?.dataItemKey}getDataTitleItemKeyAttributeFromProps(e){return s(e?.dataTitleItemKey)&&e?.dataTitleItemKey}getIdAttributeFromProps(e){return s(e?.id)&&e?.id}getFeedbackTypeAttributeFromProps(e){return s(e?.feedbackType)?["error","warning","success","info","default"].includes(e?.feedbackType)?e?.feedbackType:"default":null}getHideOrgNr(e){return"true"===e?.hideOrgNr?.toString()?"true":void 0}getFormatAttributeFromProps(e){return s(e?.format)&&e?.format?.toString()}getShowRowNumbersAttributeFromProps(e){return"true"===e?.showRowNumbers?.toString()?"true":void 0}getPartTypeAttributeFromProps(e){return s(e?.partType)&&e?.partType}getResourceBindingsFromProps(e){return s(e?.resourceBindings)&&JSON.stringify(e?.resourceBindings)}getResourceValuesFromProps(e){return s(e?.resourceValues)?JSON.stringify(e?.resourceValues):null}getEnableLinksFromProps(e){return"true"===e?.enableLinks?.toString()?"true":void 0}getEndSymbolAttributeFromProps(e){return s(e?.endSymbol)&&e?.endSymbol}}function yt(e){const t=e?.resourceValues?.data,s=e?.styleOverride,n=document.createElement("table"),o=document.createElement("thead"),l=document.createElement("tr");if(t?.tableHeaders?.length&&t?.tableRows?.length){t.tableHeaders.forEach(e=>{l.appendChild(function(e){const t=document.createElement("th");return t.textContent=e.text,i(t,e?.props?.styleOverride),t}(e))}),o.appendChild(l),n.appendChild(o);const e=document.createElement("tbody");t.tableRows.forEach(t=>{e.appendChild(function(e){const t=document.createElement("tr");return e.forEach(e=>{t.appendChild(function(e){const t=document.createElement("td"),s=new ft(e);return t.innerHTML=a("custom-field-data",s).outerHTML,t}(e))}),t}(t))}),n.appendChild(e)}else{const t=r(e);if(t?.length){const e=document.createElement("tr"),s=document.createElement("td");s.textContent=t,e.appendChild(s),n.appendChild(e)}}return i(n,s),n}function kt(e){return a("custom-feedbacklist-validation-messages",new ft({isChildComponent:!0,resourceValues:{data:e}}))}function bt(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}function Tt(e,t){return a("custom-group-ettersending",new ft({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceValues:{data:e}}))}function vt(e,t){return a("custom-group-utfall-svar",new ft({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceValues:{data:e}}))}function Bt(e,t="h1"){const n=e?.resourceValues?.data,i=n?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return s(i)?a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceValues:{title:i}})):null}customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e,t){const s=new ft({size:t,resourceValues:{title:e}});if(e)return a("custom-header",s)}(e?.resourceValues?.title,e?.size),s=yt(e);this.innerHTML="",t&&this.appendChild(t),this.appendChild(s)}}}),customElements.define("custom-dispensasjoner-list-data",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);e?.hideIfEmpty&&e.isEmpty&&t?t.style.display="none":e?.resourceValues?.data&&this.appendChild(function(e){const t=document.createElement("div");return e?.resourceValues?.data?.forEach(e=>{t.appendChild(function(e){return a("custom-dispensasjoner-unit-in-list",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e}}))}(e))}),t}(e))}}),customElements.define("custom-dispensasjoner-unit-in-list",class extends HTMLElement{connectedCallback(){const e=ht(this);if(!e.isEmpty){const t=e.hasValidationMessages&&kt(e?.validationMessages),s=function(e){const t=document.createElement("div");t.appendChild(function(e){return a("custom-header-text-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{dataTitle:e?.resourceValues?.data?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse},resourceBindings:{title:e?.resourceBindings?.dispensasjonEllerTillatelse?.title}}))}(e)),t.appendChild(function(e){return a("custom-subheader-text",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.dispensasjonPlanBestemmelseNavn?.title}}))}(e));const s=document.createElement("div"),n=function(e){return a("custom-paragraph-text-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e?.resourceValues?.data?.dispensasjonFra?.dispensasjonPlanBestemmelse?.navn}}))}(e),i=function(e){return a("custom-paragraph-text-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e?.resourceValues?.data?.dispensasjonFra?.dispensasjonPlanBestemmelse?.nasjonalArealplanId?.planidentifikasjon},resourceBindings:{body:e?.resourceBindings?.dispensasjonPlanBestemmelseNasjonalArealPlanId?.title},endSymbol:")"}))}(e);return n.style.display="inline-block",i.style.display="inline-block",s.appendChild(n),s.appendChild(document.createTextNode(" ")),s.appendChild(i),t.appendChild(s),t.appendChild(function(e){const t=e?.resourceValues?.data?.dispensasjonFra?.lovbestemmelse;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:t?e?.resourceBindings?.lovbestemmelse?.title:e?.resourceBindings?.dispensasjonPlanBestemmelsePlanBestemmelse?.title},resourceValues:{data:t||e?.resourceValues?.data?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e)),t.appendChild(function(e){return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.begrunnelse?.title},resourceValues:{data:e?.resourceValues?.data?.begrunnelse?.hensynBakBestemmelsen}})))}(e)),t}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-feedback-data",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e.isEmpty&&t)t.style.display="none";else{const t=new ft(e);this.innerHTML=a("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this),s=e?.resourceValues?.data,n=e?.resourceValues?.title||"Messages";e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e,t,s,n){const r=document.createElement("details");r.classList.add("feedback-details"),r.classList.add(s),r.setAttribute("open",!0),i(n);const o=document.createElement("summary");o.classList.add("feedback-summary"),o.innerHTML=e,r.appendChild(o);const l=document.createElement("div");return l.classList.add("feedback-list"),t.forEach(e=>{const t=document.createElement("div");t.classList.add("feedback-list-item");const s=new ft({isChildComponent:!0,feedbackType:"default",resourceValues:{data:e}});t.appendChild(a("custom-feedback-data",s)),l.appendChild(t)}),r.appendChild(l),r.outerHTML}(n,s,e?.feedbackType,e?.styleOverride)}}),customElements.define("custom-feedbacklist-validation-messages",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this),s=new N(e?.resourceValues?.data);e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e){const t=document.createElement("div");return t.classList.add("validation-messages-container"),Object.keys(e).forEach(s=>{const n=e[s];if(n?.length){const e=a("custom-feedbacklist-data",new ft({isChildComponent:!0,feedbackType:s,resourceValues:{title:bt(s,n.length),data:n}}));t.appendChild(e)}}),t.outerHTML}(s)}}),customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=r(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new ft(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=r(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new ft(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new ft(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new ft(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new ft(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new ft(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-list-data",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e){const t=document.createElement("div");return e?.resourceValues?.data?.forEach(e=>{t.appendChild(o(a("custom-field-data",new ft({isChildComponent:!0,resourceValues:e}))))}),t}(e);this.innerHTML=t.outerHTML}}}),customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new ft(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new ft(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=r(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new ft(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new ft(e);this.innerHTML=a("custom-field",t).outerHTML;const s=e.hasValidationMessages&&kt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-ettersending",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new ft({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{this.appendChild(function(e,t="h2"){return a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e,"h2"));for(const t of e?.resourceValues?.data){const s=Tt(t,e);this.appendChild(s);const n=a("custom-divider");this.appendChild(n)}const t=e.hasValidationMessages&&kt(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new ft({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{this.appendChild(function(e,t="h2"){return a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e,"h2"));for(const t of e?.resourceValues?.data){const s=vt(t,e);this.appendChild(s);const n=a("custom-divider");this.appendChild(n)}const t=e.hasValidationMessages&&kt(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);e?.hideIfEmpty&&e.isEmpty&&t?t.style.display="none":e?.resourceValues?.data&&Object.keys(e?.resourceValues?.data).forEach(t=>{const s=function(e,t){const s=e?.resourceValues?.data[t];return a("custom-group-utfall-svar-type",new ft({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceValues:{data:s,utfallType:t}}))}(e,t);this.appendChild(s)})}}),customElements.define("custom-group-ettersending",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new ft({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=document.createElement("div");t.appendChild(function(e,t="h3"){return a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.data?.tittel}}))}(e,"h3")),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["tema.kodebeskrivelse.title"]},resourceValues:{data:t?.tema?.kodebeskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!1,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["kommentar.title"]},resourceValues:{data:t?.kommentar,emptyFieldText:"-"}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-list-vedlegg",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&kt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=document.createElement("div");t.appendChild(function(e,t="h3"){return a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.data?.tittel}}))}(e,"h3")),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceValues:{data:t?.beskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-utfall-svar-status",new ft({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["status.title"]},resourceValues:{data:t}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["tema.kodebeskrivelse.title"]},resourceValues:{data:t?.tema?.kodebeskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!1,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["kommentar.title"]},resourceValues:{data:t?.kommentar,emptyFieldText:"-"}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-list-vedlegg",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&kt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=ht(this);if(!e.isEmpty){const t=function(e){return a("custom-grouplist-utfall-svar",new ft({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.title},resourceValues:{data:e?.resourceValues?.data,title:e?.resourceValues?.title}}))}(e);this.appendChild(t);const s=e.hasValidationMessages&&kt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new ht(this);e?.isChildComponent||i(d(this),{padding:"0 0.75rem"});const t=new ft(e);this.innerHTML=a("custom-header",t).outerHTML}}),customElements.define("custom-header-text-data",class extends HTMLElement{connectedCallback(){const e=new ht(this);e?.isChildComponent||i(d(this),{padding:"0 0.75rem"});const t=new ft(e);this.innerHTML=a("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new ht(this),t=d(this);var s,n;if(e?.itemKey?.length&&(s=e?.formData?.data,n=e?.itemKey,Array.isArray(s)&&s.length&&s.map(e=>e?.[n])),e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new ft(e),s=e.isEmpty?"custom-field":"custom-list";this.innerHTML=a(s,t).outerHTML}}}),customElements.define("custom-list-vedlegg",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new ft(e);this.innerHTML=a("custom-field",t).outerHTML}else{const t=new ft(e);this.innerHTML=a("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=ht(this),t=new ft(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-paragraph-text-data",class extends HTMLElement{connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new ft(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=ht(this),t=new ft(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-table-arbeidsplasser",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&kt(e?.validationMessages),s=function(e){const t=[{tagName:"custom-field-data",dataKey:"title",resourceBindings:{title:e?.resourceBindings?.arbeidsplasserKey?.title}},{tagName:"custom-field-data",dataKey:"value",resourceBindings:{title:e?.resourceBindings?.beroertAvTiltaket?.title}}];return a("custom-table-data",new ft({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.arbeidsplasser?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-data",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&kt(e?.validationMessages),s=function(e){return a("custom-table",new ft(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&kt(e?.validationMessages),s=function(e){const t=[{dataKey:"adresse",tagName:"custom-field-adresse",resourceBindings:{title:e?.resourceBindings?.adresse?.title,emptyFieldText:e?.resourceBindings?.adresse?.emptyFieldText},props:{styleOverride:{width:"116px"}}},{dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonGaardsnummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonGaardsnummer?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonBruksnummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonBruksnummer?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonSeksjonsnummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonSeksjonsnummer?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonFestenummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonFestenummer?.emptyFieldText}},{dataKey:"bolignummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.bolignummer?.title,emptyFieldText:e?.resourceBindings?.bolignummer?.emptyFieldText}},{dataKey:"bygningsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.bygningsnummer?.title,emptyFieldText:e?.resourceBindings?.bygningsnummer?.emptyFieldText}}];return a("custom-table-data",new ft({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.eiendomByggested?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-part",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&kt(e?.validationMessages),s=function(e){const t=[{tagName:"custom-field-part-navn",resourceBindings:{title:e?.resourceBindings?.navn?.title,emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText}},{tagName:"custom-field-telefonnummer",resourceBindings:{title:e?.resourceBindings?.telefonnummer?.title,emptyFieldText:e?.resourceBindings?.telefonnummer?.emptyFieldText}},{tagName:"custom-field-data",dataKey:"epost",resourceBindings:{title:e?.resourceBindings?.epost?.title,emptyFieldText:e?.resourceBindings?.epost?.emptyFieldText}}];return a("custom-table-data",new ft({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.part?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=ht(this),t=d(this);if(e.isEmpty&&t)t.style.display="none";else{const t=function(){const e=document.createElement("div");return i(e,{display:"flex",flexFlow:"wrap",justifyContent:"start",alignItems:"flex-start"}),e}(),n=Bt(e),r=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.dispensasjonReferanse?.title},resourceValues:{data:t?.dispensasjonReferanse}})),s)}(e),l=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.metadataFtbId?.title},resourceValues:{data:t?.metadata?.ftbId}})),s)}(e),u=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-kommunens-saksnummer",new ft({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.kommunensSaksnummer?.title},resourceValues:{data:t?.kommunensSaksnummer}})),s)}(e),d=function(e,t="h2"){return a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.soeknadGjelderHeader?.title}}))}(e),c=function(e){const t=e?.resourceValues?.data;return a("custom-table-eiendom",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.eiendomByggested?.title},resourceValues:{data:t?.eiendomByggested?.eiendom}}))}(e),m=function(e,t="h3"){const s=e?.resourceValues?.data;return s?.tiltakstyper?.type?.kode?.length>0?a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeHeader?.title}})):null}(e),h=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new ft({isChildComponent:!0,hideIfEmpty:!0,itemKey:"kodebeskrivelse",resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeKode?.title},resourceValues:{data:t?.tiltakstyper?.type?.kode}})))}(e),p=function(e){const t=e?.resourceValues?.data;return a("custom-table-part",new ft({isChildComponent:!0,partType:"tiltakshaver",hideIfEmpty:!0,resourceValues:{data:t?.tiltakshaver}}))}(e),g=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-adresse",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.tiltakshaverAdresse?.title},resourceValues:{data:t?.tiltakshaver?.adresse}})))}(e),y=Bt(e,"h2"),k=function(e){const t=e?.resourceValues?.data;return s(t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse)||s(t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse)?o(a("custom-field-boolean-data",new ft({isChildComponent:!0,hideIfEmpty:!1,resourceValues:{data:"Annet"===t?.soeknadstype?.kodebeskrivelse,trueData:t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse,falseData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse,defaultData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse}}))):null}(e),b=function(e){const t=e?.resourceValues?.data;return a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonBeskrivelseBeskrivelse?.title},resourceValues:{data:t?.dispensasjonBeskrivelse?.beskrivelse}}))}(e),T=function(e,t="h2"){return a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.dispensasjonFraHeader?.title}}))}(e),v=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonPlanBestemmelseNavn?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.navn}})))}(e),B=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.nasjonalArealplanIdPlanIdentifikasjon?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.nasjonalArealplanId?.planidentifikasjon}})))}(e),C=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.bestemmelserType?.title},resourceValues:{data:e.isPlanBestemmelseType?t?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:t?.dispensasjonFra?.lovbestemmelse}})))}(e),E=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.planBestemmelseNummerering?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e),x=function(e){return a("custom-header-text",new ft({isChildComponent:!0,size:"h2",resourceBindings:{title:e.resourceBindings?.stedfestingHeader?.title}}))}(e),V=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinatsystem?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinatsystem?.kodebeskrivelse}})))}(e),F=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinater?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinater?.koordinat}})))}(e),w=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingVertikalnivaa?.title},resourceValues:{data:t?.stedfesting?.vertikalnivaa?.kodebeskrivelse}})))}(e),j=function(e,t="h2"){return a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.varighetHeader?.title}}))}(e),M=function(e){const t=e?.resourceValues?.data;return t?.varighet?.oenskesVarigDispensasjon?o(a("custom-paragraph-text",new ft({isChildComponent:!0,resourceBindings:{title:e.resourceBindings?.varighetOenskesVarigDispensasjon?.trueText}}))):s(t?.varighet?.oensketVarighetTil)?o(a("custom-field-data",new ft({isChildComponent:!0,format:"date",resourceBindings:{title:e.resourceBindings?.varighetOensketVarighetTil?.title},resourceValues:{data:t?.varighet?.oensketVarighetTil}}))):null}(e),L=function(e,t="h2"){return a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.begrunnelseHeader?.title}}))}(e),I=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.hensynBakBestemmelsen}})))}(e),D=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynBakBestemmelsen}})))}(e),H=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynOverordnet?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynOverordnet}})))}(e),A=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseFordeler?.title},resourceValues:{data:t?.begrunnelse?.fordeler?.effekt}})))}(e),S=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseUlemper?.title},resourceValues:{data:t?.begrunnelse?.ulemper?.effekt}})))}(e),P=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseSamletBegrunnelse?.title},resourceValues:{data:t?.begrunnelse?.samletBegrunnelse}})))}(e),N=function(e,t="h2"){const s=e?.resourceValues?.data,n=s?.generelleVilkaar?.norskSvenskDansk;return n?a("custom-header-text",new ft({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.title}})):null}(e),O=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-boolean-text",new ft({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{trueText:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.trueText,falseText:"",defaultText:""},resourceValues:{data:t?.generelleVilkaar?.norskSvenskDansk}})))}(e),R=kt(e?.validationMessages);f(t,[n,r,l,u]),f(t,[d,c,m,h]),f(t,[p,g]),f(t,[y,k,b]),e.isPlanBestemmelseType?f(t,[T,v,B,C,E]):f(t,[T,C]),f(t,[x,V,F,w]),f(t,[j,M]),f(t,[L,I,D,H,A,S,P]),f(t,[N,O]),f(t,[R]),this.appendChild(t)}}});class Ct{constructor(e){this.eiendomByggested=e?.eiendomByggested&&new j(e.eiendomByggested),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new M(e.kommunensSaksnummer),this.metadata=e?.metadata&&new L(e.metadata),this.versjon=e?.versjon}}function Et(e){return m(e)}const xt={eiendomTable:{title:"resource.eiendomByggested.eiendom.title","col-1":"resource.eiendomByggested.eiendom.adresse.title","col-2":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title","col-3":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title","col-4":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title","col-5":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title","col-6":"resource.eiendomByggested.eiendom.bolignummer.title","col-7":"resource.eiendomByggested.eiendom.bygningsnummer.title"},gjenomfoeringsplanNummer:{title:"resource.gjennomfoeringsplan.versjon.title"}};customElements.define("custom-gjennomfoeringsplan",class extends HTMLElement{async connectedCallback(){const e=JSON.parse(this.getAttribute("textResources")),t=function(e){const t=JSON.parse(e.getAttribute("formdata"));return new Ct({eiendomByggested:s(t?.eiendomByggested)?t.eiendomByggested:null,kommunensSaksnummer:s(t?.kommunensSaksnummer)?t.kommunensSaksnummer:null,metadata:s(t?.metadata)?t.metadata:null,versjon:t?.versjon?t.versjon:null})}(this),n=R(e,xt),i=d(this);if(!s(t)&&i)i.style.display="none";else{const s=function(e,t){return a("custom-field-data",{formData:{simpleBinding:e?.versjon},text:c(t),emptyFieldText:"(gjennomfoeringsplanNummer mangler)"})}(t,e),i=function(e,t){return a("custom-table-data",{formData:{data:e},text:"Eiendom/Byggested",hideIfEmpty:!0,size:"h3",tableColumns:[{titleResourceKey:"col-1",dataKey:"adresse",tagName:"custom-field-adresse",props:{emptyFieldText:"(adresse mangler)",styleOverride:{}}},{titleResourceKey:"col-2",dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-3",dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-4",dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"96px"}}},{titleResourceKey:"col-5",dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-6",dataKey:"bolignummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"120px"}}},{titleResourceKey:"col-7",dataKey:"bygningsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"96px"}}}],texts:Et(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),r=kt(n);this.appendChild(s),this.appendChild(i),this.appendChild(r)}}}),window.addEventListener("load",async()=>{const e=window.location.pathname.split("/"),t=window.location.origin,n=e?.[1],i=e?.[2];if(![t?.length,n?.length,i?.length].every(Boolean))return void console.error("Could not determine the origin, organization, or application from the URL.");const r=`${t}/${n}/${i}/api/v1/profile/user`,a=await fetch(r).then(e=>e.json());if(!a?.profileSettingPreference?.language)return void console.error("Could not determine the user's language preference.");const o=a?.profileSettingPreference?.language;window.selectedLanguage=o;const l=`${t}/${n}/${i}/api/v1/texts/${o}`,u=await fetch(l).then(e=>e.json());if(s(u))window.textResources=u;else{console.error("Could not retrieve text resources for the selected language.");const e=`${t}/${n}/${i}/api/v1/texts/nb`,r=await fetch(e).then(e=>e.json());if(window.textResources=r,!s(r))return void console.error("Could not retrieve text resources for the fallback language.")}})})();
1
+ (()=>{"use strict";class e{constructor(e){e?.tagName&&(this.tagName=e.tagName),e?.inline&&(this.inline=e.inline),e?.hideTitle&&(this.hideTitle=e.hideTitle),e?.size&&(this.size=e.size),e?.hideIfEmpty&&(this.hideIfEmpty=e.hideIfEmpty),e?.styleOverride&&(this.styleOverride=e.styleOverride),e?.isChildComponent&&(this.isChildComponent=e.isChildComponent),e?.feedbackType&&(this.feedbackType=e.feedbackType),e?.hideOrgNr&&(this.hideOrgNr=e.hideOrgNr),e?.format&&(this.format=e.format),e?.enableLinks&&(this.enableLinks=e.enableLinks)}}const t=["custom-divider","custom-feedback","custom-field","custom-header","custom-list","custom-paragraph","custom-table","custom-dispensasjoner-list-data","custom-dispensasjoner-unit-in-list","custom-feedback-data","custom-feedbacklist-data","custom-feedbacklist-validation-messages","custom-field-adresse","custom-field-boolean-data","custom-field-boolean-text","custom-field-count-data","custom-field-data","custom-field-list-data","custom-field-kommunens-saksnummer","custom-field-part-navn","custom-field-prosjekt","custom-field-telefonnummer","custom-field-utfall-svar-status","custom-grouplist-ettersending","custom-grouplist-sjekklistekrav","custom-grouplist-utfall-svar-type","custom-grouplist-utfall-svar","custom-group-ettersending","custom-group-sjekklistekrav","custom-group-utfall-svar-type","custom-group-utfall-svar","custom-header-text","custom-header-text-data","custom-list-data","custom-list-vedlegg","custom-paragraph-text","custom-subheader-text","custom-table-arbeidsplasser","custom-table-data","custom-table-eiendom","custom-table-part","custom-dispensasjon","custom-gjennomfoeringsplan"];function s(e){if(null==e)return!1;if("string"==typeof e)return e.length>0;if("number"==typeof e)return!1===isNaN(e);if("boolean"==typeof e)return!0===e;if(Array.isArray(e))return e.length>0;for(let t in e)if(!!e?.[t]?.toString().length>0)return!0;return!1}function n(e){const t="number"==typeof e?e:Number(e);return"number"==typeof t&&!isNaN(t)&&t>0}function i(e,t){for(let s in t)e.style[s]=t[s]}function r(e){const t=e?.resourceValues?.emptyFieldText;return t||""}function a(e,s){if(!function(e){return t.includes(e)}(e))throw new Error(`Invalid tag name ${e}. Must be one of: ${t.join(", ")}`);const n=document.createElement(e);return function(e,t){for(const s in t)e.setAttribute(s,t[s])}(n,{...s,tagName:e}),n}function o(e,t){const n=document.createElement("div"),r=document.createElement("div");r.appendChild(e),n.appendChild(r);const a={flexBasis:"100%",maxWidth:"100%"};if(s(t)){const e=function(e){if(e){const t=e.xs||12,s=e.sm||t,n=e.md||s,i=e.lg||n,r=e.xl||i;return Math.min(t/12*100,s/12*100,n/12*100,i/12*100,r/12*100)}return 100}(t);a.flexBasis=`${e}%`,a.maxWidth=`${e}%`,a.flexGrow="0"}return i(n,{...a,padding:"0.75rem 0px"}),n}function l(){const e=document.createElement("div");return i(e,{display:"flex",flexFlow:"wrap",justifyContent:"start",alignItems:"flex-start"}),e}function u(){return"undefined"!=typeof window&&window.textResources?window.textResources:[]}function d(e,t,s,n){s.forEach(s=>{void 0!==e[s]&&null!==e[s]||(null!=t?.[s]?console.warn(`Missing textResourceBindings.${s} for "${n}". Using fallback text: "${t[s]}"`):console.warn(`Missing textResourceBindings.${s} for "${n}".`))})}function c(e){const t="true"===e.getAttribute("isChildComponent"),s=e?.parentElement?.parentElement;return t?e:s||null}function m(e){const t=u(),s=t?.resources?.find(t=>t.id===e)?.value;return s||e}function h(e){const t={};for(const s in e)t[s]=m(e[s]);return t}function g(e){return e.isChildComponent?e.resourceValues?.data:e.formData?.simpleBinding||e.formData?.data}function p(e){return e.isChildComponent?e.resourceValues?.dataTitle:null!=e.formData?.dataTitle?e.formData?.dataTitle:void 0}function f(e,t){return s(e?.resourceValues?.[t])?e.resourceValues?.[t]:m(e?.resourceBindings?.[t])}function y(e,t){return t.filter(e=>!!e).forEach(t=>{t instanceof HTMLElement?e.appendChild(t):e.innerHTML+=t}),e}customElements.define("custom-divider",class extends HTMLElement{connectedCallback(){const t=new e(this),s=document.createElement("hr");i(s,t?.styleOverride),this.innerHTML="",this.appendChild(s)}});class k{constructor(e){this.effekt=e?.effekt}}class T{constructor(e){this.effekt=e?.effekt}}class b{constructor(e){this.hensynBakBestemmelsen=e?.hensynBakBestemmelsen,this.vurderingHensynBakBestemmelsen=e?.vurderingHensynBakBestemmelsen,this.vurderingHensynOverordnet=e?.vurderingHensynOverordnet,this.fordeler=e?.fordeler&&new k(e.fordeler),this.ulemper=e?.ulemper&&new T(e.ulemper),this.samletBegrunnelse=e?.samletBegrunnelse}}class v{constructor(e){this.kodebeskrivelse=e?.kodebeskrivelse}}class C{constructor(e){this.dispensasjonTittel=e?.dispensasjonTittel&&new v(e.dispensasjonTittel),this.inngangsbeskrivelse=e?.inngangsbeskrivelse&&new v(e.inngangsbeskrivelse),this.annenInngangsbeskrivelse=e?.annenInngangsbeskrivelse,this.beskrivelse=e?.beskrivelse}}class B{constructor(e){this.planidentifikasjon=e?.planidentifikasjon}}class x{constructor(e){this.nummerering=e?.nummerering}}class V{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new B(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new x(e.planbestemmelse)}}class E{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new v(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new V(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class F{constructor(e){this.adresselinje1=e?.adresselinje1,this.adresselinje2=e?.adresselinje2,this.adresselinje3=e?.adresselinje3,this.postnr=e?.postnr,this.poststed=e?.poststed}}class w{constructor(e){this.gaardsnummer=e?.gaardsnummer,this.bruksnummer=e?.bruksnummer,this.seksjonsnummer=e?.seksjonsnummer,this.festenummer=e?.festenummer}}class j{constructor(e){this.adresse=e?.adresse&&new F(e.adresse),this.eiendomsidentifikasjon=e?.eiendomsidentifikasjon&&new w(e.eiendomsidentifikasjon),this.bolignummer=e?.bolignummer,this.bygningsnummer=e?.bygningsnummer}}class M{constructor(e){this.eiendom=e?.eiendom&&e.eiendom.map(e=>new j(e))}}class L{constructor(e){this.saksaar=e?.saksaar,this.sakssekvensnummer=e?.sakssekvensnummer}}class I{constructor(e){this.ftbId=e?.ftbId,this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class D{constructor(e){const t=this.getAdresse(e);this.navn=e?.navn,this.organisasjonsnummer=e?.organisasjonsnummer,this.epost=e?.epost,this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer,t&&(this.adresse=t)}getAdresse(e){if(s(e?.adresse))return new F(e.adresse)}}class H{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new v(e.koordinatsystem),this.koordinater=e?.koordinater}}class A{constructor(e){this.posisjon=e?.posisjon&&new H(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new v(e.vertikalnivaa)}}class S{constructor(e){const t=e?this.getTypeFromProps(e):null;t&&(this.type=t)}getTypeFromProps(e){return e&&s(e?.type)?{kode:this.getKodeFromType(e.type)}:null}getKodeFromType(e){return Array.isArray(e?.kode)&&e?.kode?.length?e?.kode?.map(e=>new v(e)):null}}class N{constructor(e){this.oenskesVarigDispensasjon=e?.oenskesVarigDispensasjon,this.oensketVarighetTil=e?.oensketVarighetTil}}class P{constructor(e){this.dispensasjonBeskrivelse=e?.dispensasjonBeskrivelse&&new C(e.dispensasjonBeskrivelse),this.dispensasjonReferanse=e?.dispensasjonReferanse,this.soeknadstype=e?.soeknadstype&&new v(e.soeknadstype),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new L(e.kommunensSaksnummer),this.metadata=e?.metadata&&new I(e.metadata),this.eiendomByggested=e?.eiendomByggested&&new M(e.eiendomByggested),this.tiltakstyper=e?.tiltakstyper&&new S(e.tiltakstyper),this.tiltakshaver=e?.tiltakshaver&&new D(e.tiltakshaver),this.dispensasjonFra=e?.dispensasjonFra&&new E(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new A(e.stedfesting),this.varighet=e?.varighet&&new N(e.varighet),this.begrunnelse=e?.begrunnelse&&new b(e.begrunnelse),this.generelleVilkaar=e?.generelleVilkaar}}class O{constructor(e){this.error=e?.error||[],this.warning=e?.warning||[],this.info=e?.info||[],this.success=e?.success||[],this.default=e?.default||[]}}function R(e){return!!e&&Object.values(e).some(e=>e.length>0)}function K(e,t,s=new O){for(const n in t)for(const i in t[n]){const r=t[n][i],a=e?.resources?.find(e=>e.id===r);a?""===a.value&&s.info.push(`Empty text resource for "${i}" with id: "${r}" in component "${n}"`):s.error.push(`Missing text resource for "${i}" with id: "${r}" in component "${n}"`)}return s}class $ extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(),n=!this.hasContent(t),i=this.dataIsPlanBestemmelseType(t),r=this.getValidationMessages(s);this.isEmpty=n,this.isPlanBestemmelseType=i,this.validationMessages=r,this.hasValidationMessages=R(r),this.resourceBindings=s,this.resourceValues={data:n?f(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return s(e?.formData)&&new P(e.formData)}getValidationMessages(e){return K("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}dataIsPlanBestemmelseType(e){return["reguleringsplan","kommuneplan","kommunedelplan"].includes(e?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse?.toLowerCase())}getResourceBindings(){return{dispensasjonReferanse:{title:"resource.dispensasjon.dispensasjonReferanse.title"},metadataFtbId:{title:"resource.metadata.ftbId.title"},kommunensSaksnummer:{title:"resource.kommunensSaksnummer.title"},soeknadGjelderHeader:{title:"resource.soeknadGjelder.header"},tiltakstyperTypeHeader:{title:"resource.tiltakstyper.type.header"},tiltakstyperTypeKode:{title:"resource.tiltakstyper.type.kode.title"},tiltakshaverAdresse:{title:"resource.tiltakshaver.adresse.title"},dispensasjonBeskrivelseBeskrivelse:{title:"resource.dispensasjonBeskrivelse.beskrivelse.title"},dispensasjonFraHeader:{title:"resource.dispensasjonFra.header"},dispensasjonPlanBestemmelseNavn:{title:"resource.dispensasjonFra.dispensasjonPlanBestemmelse.navn.title"},nasjonalArealplanIdPlanIdentifikasjon:{title:"resource.dispensasjonFra.nasjonalArealplanId.planidentifikasjon.title"},bestemmelserType:{title:"resource.dispensasjonFra.bestemmelserType.title"},planBestemmelseNummerering:{title:"resource.dispensasjonFra.dispensasjonPlanBestemmelse.planbestemmelse.nummerering.title"},stedfestingHeader:{title:"resource.stedfesting.header"},stedfestingPosisjonKoordinatsystem:{title:"resource.stedfesting.posisjon.koordinatsystem.title"},stedfestingPosisjonKoordinater:{title:"resource.stedfesting.posisjon.koordinater.title"},stedfestingVertikalnivaa:{title:"resource.stedfesting.vertikalnivaa.title"},varighetHeader:{title:"resource.varighet.header"},varighetOenskesVarigDispensasjon:{trueText:"resource.varighet.oenskesVarigDispensasjon.true.title"},varighetOensketVarighetTil:{title:"resource.varighet.oensketVarighetTil.title"},begrunnelseHeader:{title:"resource.begrunnelse.header"},begrunnelseHensynBakBestemmelsen:{title:"resource.begrunnelse.hensynBakBestemmelsen.title"},begrunnelseVurderingHensynBakBestemmelsen:{title:"resource.begrunnelse.vurderingHensynBakBestemmelsen.title"},begrunnelseVurderingHensynOverordnet:{title:"resource.begrunnelse.vurderingHensynOverordnet.title"},begrunnelseFordeler:{title:"resource.begrunnelse.fordeler.title"},begrunnelseUlemper:{title:"resource.begrunnelse.ulemper.title"},begrunnelseSamletBegrunnelse:{title:"resource.begrunnelse.samletBegrunnelse.title"},generelleVilkaarNorskSvenskDansk:{title:"resource.generelleVilkaar.norskSvenskDansk.header",trueText:"resource.generelleVilkaar.norskSvenskDansk.true.title"}}}}const z=["default"],U={dateTime:{default:{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}},date:{default:{day:"2-digit",month:"2-digit",year:"numeric"}},time:{default:{hour:"2-digit",minute:"2-digit",second:"2-digit"}}},J={dateTime:{default:"no-NO"},date:{default:"no-NO"},time:{default:"no-NO"}},G=["h1","h2","h3","h4","h5","h6"];function Z(e){return z.includes(e)?e:"default"}function W(e){const t=new Date(e);return!!e&&!isNaN(t.getTime())}function Y(e,t,s="default"){switch(t){case"dateTime":return function(e,t="default"){if(!W(e))return"Ugyldig datoformat";t=Z(t),e.includes("T")||(e+="T00:00:00");const s=J.dateTime[t],n=U.dateTime[s]||U.dateTime.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);case"date":return function(e,t="default"){W(e)||(e=function(e){const t=e.match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!t)return null;const s=parseInt(t[1],10),n=parseInt(t[2],10)-1,i=parseInt(t[3],10),r=new Date(Date.UTC(i,n,s));return r.getFullYear()===i&&r.getMonth()===n&&r.getDate()===s?r.toISOString():null}(e)),t=Z(t);const s=J.date[t],n=U.date[s]||U.date.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);case"time":return function(e,t="default"){e.includes("T")||(e="1970-01-01T"+e),W(e)||(e=function(e){const t=e.match(/^(\d{2}):(\d{2})(?::(\d{2}))?$/);if(!t)return null;const s=parseInt(t[1],10),n=parseInt(t[2],10),i=t[3]?parseInt(t[3],10):0;return s<0||s>23||n<0||n>59||i<0||i>59?null:new Date(Date.UTC(1970,0,1,s,n,i)).toISOString()}(e)),t=Z(t);const s=J.time[t],n=U.time[s]||U.time.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);default:return e}}function _(e){return s(e)&&G.includes(e.toLowerCase())}class q extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return Y(g(e),e?.format)}}class Q extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceBindings=s,this.isEmpty=n,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return g(e)}getValidationMessages(e){return K("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}getTextResourceBindings(e){const t={bestemmelse:{title:e?.resourceBindings?.bestemmelse?.title||"resource.dispensasjon.bestemmelse.title"},begrunnelse:{title:e?.resourceBindings?.begrunnelse?.title||"resource.dispensasjon.begrunnelse.title"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.bestemmelsestype={title:e?.resourceBindings?.title||"resource.bestemmelsestype.header"}),t}}class X extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return g(e)}}class ee extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return g(e)}}class te extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:e?.resourceValues?.title||"Messages",data:t}}hasContent(e){return s(e)}getValueFromFormData(e){return g(e)}}class se extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={data:t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=g(e);return new O(t)}}class ne extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class ie extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:f(e,"title"),data:s?f(e,"emptyFieldText"):t}}formatAdresselinje(e){return[e.adresselinje1,e.adresselinje2,e.adresselinje3].filter(e=>e?.length).join("\n")}formatZipCity(e){return[e.postnr,e.poststed].filter(e=>e?.length).join(" ")}formatAdresse(e){const t=this.formatAdresselinje(e),s=this.formatZipCity(e);return t.length&&s.length?`${t}\n${s}`:t.length?t:s.length?s:""}getValueFromFormData(e){const t=g(e),s=new F(t);return this.formatAdresse(s)}hasContent(e){return s(e)}}class re extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:f(e,"title"),data:s?f(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=e?.id?.length&&"string"==typeof e?.id?e.id:"custom-field-boolean-data",s=g(e),i=n(s),r=function(e){return e.isChildComponent?{trueData:e.resourceValues?.trueData,falseData:e.resourceValues?.falseData,defaultData:e.resourceValues?.defaultData}:{trueData:e.formData?.trueData,falseData:e.formData?.falseData,defaultData:e.formData?.defaultData}}(e);return function(e,t,s){["trueData","falseData","defaultData"].forEach(t=>{void 0!==e[t]&&null!==e[t]||console.warn(`Missing dataModelBindings.${t} for "${s}".`)})}(r,0,t),!0===s||"true"===s||i?void 0!==r?.trueData&&null!==r.trueData?r.trueData:"":!1===s||"false"===s?void 0!==r?.falseData&&null!==r.falseData?r.falseData:"":r?.defaultData?r.defaultData:""}}class ae extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:f(e,"title"),data:s?f(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){const t=e?.id||"custom-field-boolean-text",s=g(e),n=function(e){return{trueText:e.resourceValues?.trueText||m(e?.resourceBindings?.trueText),falseText:e.resourceValues?.falseText||m(e?.resourceBindings?.falseText),defaultText:e.resourceValues?.defaultText||m(e?.resourceBindings?.defaultText)}}(e),i={trueText:"Ja",falseText:"Nei",defaultText:""};return d(n,i,["trueText","falseText","defaultText"],t),!0===s||"true"===s?void 0!==n?.trueText&&null!==n.trueText?n.trueText:i.trueText:!1===s||"false"===s?void 0!==n?.falseText&&null!==n.falseText?n.falseText:i.falseText:n?.defaultText?n.defaultText:i.defaultText}}class oe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&f(e,"title"),data:s?f(e,"emptyFieldText"):t}}hasContent(e){return n(e)}getValueFromFormData(e){const t=g(e);return t&&Array.isArray(t)?t.length:0}}class le extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=p(e),n=!this.hasContent(t),i=!this.hasContent(s);this.isEmpty=n,this.resourceValues={title:!e?.hideTitle&&(!i&&s||f(e,"title")),data:n?f(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValueFromFormData(e){return Y(g(e),e?.format)}}class ue extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:f(e,"title"),data:s?f(e,"emptyFieldText"):t}}hasContent(e){return s(e)}formatKommunensSaksnummer(e){return[e?.saksaar?.toString(),e?.sakssekvensnummer?.toString()].filter(e=>e?.length).join("/")}getValueFromFormData(e){const t=g(e),s=new L(t);return this.formatKommunensSaksnummer(s)}}class de extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,Array.isArray(t)&&t.length&&(this.resourceValues={data:t})}hasContent(e){return s(e)}getListItemsFromKey(e,t){if(!Array.isArray(e)||!e.length)return[];const s=t.split(".");return e.map(e=>s.reduce((e,t)=>e?.[t],e))}getValueFromFormData(e){const t=this.hasContent(e?.dataItemKey),n=this.hasContent(e?.dataTitleItemKey),i=g(e);if(t&&n){const t=s(e?.dataTitleItemKey)?this.getListItemsFromKey(i,e?.dataTitleItemKey):i,n=s(e?.dataItemKey)?this.getListItemsFromKey(i,e?.dataItemKey):i,r=Math.min(t.length,n.length);return Array.from({length:r},(e,s)=>({title:t[s],data:n[s]}))}}}class ce extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:m(e?.resourceBindings?.title),data:s?m(e?.resourceBindings?.emptyFieldText):t}}formatName(e,t){if(!e?.navn)return"";let s=e.navn;return!t&&e.organisasjonsnummer&&(s+=`\nOrganisasjonsnummer: ${e.organisasjonsnummer}`),s}getValueFromFormData(e){const t=g(e),s=new D(t);return this.formatName(s,this.hideOrgNr)}hasContent(e){return s(e)}}class me{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class he extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:m(e?.resourceBindings?.title),data:s?m(e?.resourceBindings?.emptyFieldText):t}}hasContent(e){return s(e)}formatProsjekt(e){const t=s(e?.prosjektnr)&&`(${e.prosjektnr?.toString()})`;return[e?.prosjektnavn?.toString(),t].filter(e=>e?.length).join(" ")}getValueFromFormData(e){const t=new me(e?.formData?.data);return this.formatProsjekt(t)}}class ge{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}class pe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:m(e?.resourceBindings?.title),data:s?m(e?.resourceBindings?.emptyFieldText):t}}formatPhoneNumbers(e){return[e.telefonnummer,e.mobilnummer].filter(e=>e?.length).join("\n")}getValueFromFormData(e){const t=g(e),s=new ge(t);return this.formatPhoneNumbers(s)}hasContent(e){return s(e)}}class fe{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}class ye extends e{constructor(e){super(e);const t=this.getResourceBindings(e),s=this.getValueFromFormData(e,t?.utfallSvarStatus),n=!this.hasContent(s),i=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceValues={title:m(t?.utfallSvarStatus?.title),data:n?f(e,"emptyFieldText"):s}}hasContent(e){return s(e)}getValidationMessages(e){return K(u(),e)}getStatusText(e,t,s){const n=h(t),i={erUtfallBesvaresSenere:"Besvares senere",erUtfallBesvart:"Svar innsendt tidligere",status:"Besvares nå"};return d(n,i,["erUtfallBesvaresSenere","erUtfallBesvart","status"],s),e?.erUtfallBesvaresSenere?null!=n?.erUtfallBesvaresSenere?n.erUtfallBesvaresSenere:i.erUtfallBesvaresSenere:e?.erUtfallBesvart?null!=n?.erUtfallBesvart?n.erUtfallBesvart:i.erUtfallBesvart:n?.status?n.status:i.status}getValueFromFormData(e,t){const s=g(e),n=new fe(s);return this.getStatusText(n,t,e?.id)}getResourceBindings(e){return{utfallSvarStatus:{title:e?.resourceBindings?.title||"resource.utfallBesvarelse.utfallSvar.status.title",erUtfallBesvaresSenere:"resource.utfallBesvarelse.utfallSvar.erUtfallBesvaresSenere",erUtfallBesvart:"resource.utfallBesvarelse.utfallSvar.erUtfallBesvart",status:"resource.utfallBesvarelse.utfallSvar.status"}}}}class ke{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new v(e.vedleggstype)}}class Te{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map(e=>new ke(e)):void 0}}class be{constructor(e){this.kommentar=e?.kommentar,this.tema=e?.tema?new v(e.tema):void 0,this.tittel=e?.tittel,this.vedleggsliste=e?.vedleggsliste?new Te(e.vedleggsliste):void 0}}class ve extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceBindings=s?.ettersending||{},this.resourceValues={data:n?m(s?.ettersending?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return K(u(),e)}getValueFromFormData(e){const t=g(e);return new be(t)}getResourceBindings(e){const t={"tema.kodebeskrivelse.title":"resource.ettersendinger.ettersending.tema.kodebeskrivelse.title","kommentar.title":"resource.ettersendinger.ettersending.kommentar.title","vedleggsliste.vedlegg.title":"resource.ettersendinger.ettersending.vedleggsliste.vedlegg.title"};return 1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{ettersending:t}}}class Ce extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceValues={title:m(s?.ettersendinger?.title),data:n?m(s?.ettersendinger?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return K(u(),e)}getValueFromFormData(e){return g(e)}getResourceBindings(e){const t={};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.title=e?.resourceBindings?.title||"resource.ettersendinger.title"),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{ettersendinger:t}}}class Be extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceBindings=s?.sjekklistekrav||{},this.resourceValues={title:m(s?.sjekklistekrav?.title),data:n?m(s?.sjekklistekrav?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return K(u(),e)}getValueFromFormData(e){return g(e)}getResourceBindings(e){const t={trueText:e?.resourceBindings?.trueText||"resource.trueText.default",falseText:e?.resourceBindings?.falseText||"resource.falseText.default",defaultText:e?.resourceBindings?.defaultText||"resource.defaultText.default"};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.title=e?.resourceBindings?.title||"resource.krav.sjekklistekrav.title"),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{sjekklistekrav:t}}}class xe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceValues={title:m(s?.utfallSvar?.title),data:n?m(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return K(u(),e)}getValueFromFormData(e){return g(e)}getResourceBindings(e){const t={};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.title=e?.resourceBindings?.title),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{utfallSvar:t}}}class Ve{constructor(e){this.kodeverdi=e?.kodeverdi}}class Ee{constructor(e){this.beskrivelse=e?.beskrivelse,this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart,this.kommentar=e?.kommentar,this.tema=e?.tema?new v(e.tema):void 0,this.tittel=e?.tittel,this.utfallType=e?.utfallType?new Ve(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new Te(e.vedleggsliste):void 0}}class Fe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&f(e,"title"),data:s?f(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return K(u(),e)}getValueFromFormData(e){const t=g(e);return this.groupArrayItemsByUtfallType(t)}groupArrayItemsByUtfallType(e){return s(e)?e.reduce((e,t)=>{const s=t?.utfallType?.kodeverdi;return s?.length?(e[s]||(e[s]=[]),e[s].push(new Ee(t)),e):e},{}):{}}}class we{constructor(e){this.sjekklistepunktsvar=e?.sjekklistepunktsvar,this.sjekklistepunkt=e?.sjekklistepunkt&&new v(e.sjekklistepunkt),this.dokumentasjon=e?.dokumentasjon}}class je extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceBindings=s?.sjekklistekrav||{},this.resourceValues={data:n?m(s?.sjekklistekrav?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return K(u(),e)}getValueFromFormData(e){const t=g(e);return new we(t)}getResourceBindings(e){const t={trueText:e?.resourceBindings?.trueText||"resource.trueText.default",falseText:e?.resourceBindings?.falseText||"resource.falseText.default",defaultText:e?.resourceBindings?.defaultText||"resource.defaultText.default"};return 1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{sjekklistekrav:t}}}class Me extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceBindings=s?.utfallSvar||{},this.resourceValues={data:n?m(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return s(e)}getValidationMessages(e){return K(u(),e)}getValueFromFormData(e){const t=g(e);return new Ee(t)}getResourceBindings(e){const t={"status.title":"resource.utfallBesvarelse.utfallSvar.status.title","tema.kodebeskrivelse.title":"resource.utfallBesvarelse.utfallSvar.tema.kodebeskrivelse.title","kommentar.title":"resource.utfallBesvarelse.utfallSvar.kommentar.title","vedleggsliste.vedlegg.title":"resource.utfallBesvarelse.utfallSvar.vedleggsliste.vedlegg.title"};return 1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.emptyFieldText=e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"),{utfallSvar:t}}}class Le extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceBindings={title:s?.utfallSvarType?.title},this.resourceValues={data:n?f(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getValidationMessages(e){return K(u(),e)}getValueFromFormData(e){return g(e)}getResourceBindings(e){const t=e?.resourceValues?.utfallType;return{utfallSvarType:{title:`resource.utfallBesvarelse.utfallSvar.${t?.toLowerCase()}.header`}}}}class Ie extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues,this.size=e?.size}hasContent(e){return s(e?.resourceValues?.title)}}class De extends e{constructor(e){super(e),this.size=e?.size,this.resourceValues={title:f(e,"title")}}}class He extends e{constructor(e){super(e),this.size=e?.size;const t=f(e,"title"),s=p(e);this.resourceValues={title:[t||"",s||""].filter(Boolean).join(" ")}}}class Ae extends e{constructor(e){super(e),this.isEmpty=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class Se extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:f(e,"title"),data:s?f(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getListItemsFromKey(e,t){return Array.isArray(e)&&e.length?e.map(e=>e?.[t]):[]}getValueFromFormData(e){const t=g(e);return s(e?.itemKey)?this.getListItemsFromKey(t,e?.itemKey):t}}class Ne extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:f(e,"title"),data:s?f(e,"emptyFieldText"):t}}hasContent(e){return s(e)}getAttachmentFileName(e){return e?.filnavn}getAttachmentDescription(e){return e?.vedleggstype?.kodebeskrivelse}getAttachmentListItems(e){return e&&Array.isArray(e)&&e?.length?e.map(e=>{const t=new ke(e),s=this.getAttachmentDescription(t),n=this.getAttachmentFileName(t);return s?.length&&n?.length?`${s} (${n})`:s?.length?s:n?.length?n:null}).filter(e=>e):[]}getValueFromFormData(e){const t=g(e);return this.getAttachmentListItems(t)}}class Pe extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues}hasContent(e){return s(e?.resourceValues?.title)}}class Oe extends e{constructor(e){super(e),this.resourceValues={title:this.getTextData(e)}}getTextData(e){const t=f(e,"title"),n=e?.text;return s(t)?t:n}}class Re extends e{constructor(e){super(e),this.resourceValues={title:f(e,"title")}}}class Ke extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return s(e?.resourceValues?.data)}}class $e{constructor(e){this.antallAnsatte=e?.antallAnsatte,this.antallVirksomheter=e?.antallVirksomheter,this.beskrivelse=e?.beskrivelse,this.eksisterende=e?.eksisterende,this.faste=e?.faste,this.framtidige=e?.framtidige,this.midlertidige=e?.midlertidige,this.utleieBygg=e?.utleieBygg,this.veiledning=e?.veiledning}}class ze extends e{constructor(e){super(e);const t=["eksisterende","faste","framtidige","midlertidige","utleieBygg"],s=this.getTextResourceBindings(e,t),n=this.getValueFromFormData(e,t,s),i=!this.hasContent(n),r=this.getValidationMessages(s);this.isEmpty=i,this.validationMessages=r,this.hasValidationMessages=R(r),this.resourceBindings=s,this.resourceValues={data:i?m(e?.resourceBindings?.emptyFieldText):n}}getValueFromFormData(e,t,n){const i=g(e);if(!s(i))return;const r=new $e(i);return this.hasArbeidsplasserBeroertProps(r,t)?this.getArbeidsplasserBeroertArray(r,t,n):void 0}getArbeidsplasserBeroertArray(e,t,s){return t.map(t=>({title:m(s[t]?.title),value:e[t]?m(s[t]?.trueText):m(s[t]?.falseText)}))}getValidationMessages(e){return K("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasArbeidsplasserBeroertProps(e,t){return t.some(t=>void 0!==e?.[t])}getTextResourceBindings(e,t){const s={arbeidsplasser:{},arbeidsplasserKey:{title:e?.resourceBindings?.arbeidsplasserKey?.title||"resource.arbeidsplasser.arbeidsplasserKey.title"},beroertAvTiltaket:{title:e?.resourceBindings?.beroertAvTiltaket?.title||"resource.arbeidsplasser.beroertAvTiltaket.title"}};return t.forEach(t=>{s[t]={title:e?.resourceBindings?.[t]?.title||`resource.arbeidsplasser.${t}.title`,trueText:e?.resourceBindings?.[t]?.trueText||"resource.trueText.default",falseText:e?.resourceBindings?.[t]?.falseText||"resource.falseText.default"}}),1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(s.arbeidsplasser={title:e?.resourceBindings?.title||"resource.arbeidsplasser.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(s.arbeidsplasser={...s.arbeidsplasser,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),s}}class Ue extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t),n=this.getValidationMessagesFromProps(e);this.isEmpty=s,this.validationMessages=n,this.hasValidationMessages=R(n),this.resourceValues={title:m(e?.resourceBindings?.title),data:s?m(e?.resourceBindings?.emptyFieldText):t}}getValueFromFormData(e){const t=g(e);return{tableHeaders:this.getTableHeadersFromProps(e),tableRows:this.getTableRowsFromProps(e,t)}}getTableHeadersFromProps(e){const t=e?.tableColumns||[];if(0===t.length)return[];const s=function(e){return e.map(e=>{const t=e?.resourceBindings?.title;return{text:m(t),props:e.props}})}(t);var n;return e.showRowNumbers&&s.unshift({text:(n=e,m(n?.resourceBindings?.rowNumberTitle)||"#")}),s}getTableRowsFromProps(e,t){const n=function(e,t){return!Array.isArray(t)&&(t=[t]),t.map(t=>{const n=[];return e.forEach(e=>{const i=function(e,t){return t?null==e||/(\.\.|^\.)/.test(t)?void 0:t.split(/\.|\[|\]/).filter(Boolean).reduce((e,t)=>e&&e[t],e):e}(t,e.dataKey),r=e?.resourceBindings?.emptyFieldText,a=m(r),o={resourceBindings:e.resourceBindings,resourceValues:{data:i},format:e.format,hideTitle:!0,tagName:e.tagName,isChildComponent:!0};s(a)&&(o.resourceValues.emptyFieldText=a),n.push(o)}),n})}(e?.tableColumns||[],t),i=this.removeEmptyTableRows(n);return e.showRowNumbers?i.map((e,t)=>[{tagName:"custom-field-data",hideTitle:!0,isChildComponent:!0,resourceValues:{data:t+1}},...e]):i}getValidationMessagesFromProps(e){return function(e,t=new O){const s=u();return e.forEach((e,n)=>{Object.keys(e?.textResourceBindings||{}).forEach(i=>{const r=s?.resources?.find(t=>t.id===e.textResourceBindings[i]);r?""===r.value&&t.info.push(`Empty text resource binding with id: "${e.textResourceBindings[i]}" for "${i}" at table column [${n}]`):t.error.push(`Missing text resource binding with id: "${e.textResourceBindings[i]}" for "${i}" at table column [${n}]`)})}),t}(e?.tableColumns)}removeEmptyTableRows(e){return Array.isArray(e)?e.map(e=>{const t=e.map(e=>pt(e));return t.filter(e=>!e?.isEmpty).length>0?t:null}).filter(e=>null!==e):[]}hasContent(e){return s(e)}}class Je extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceBindings=s,this.resourceValues={data:n?m(s?.eiendomByggested?.emptyFieldText):t}}getValueFromFormData(e){const t=g(e);return this.getEiendomListFromData(t)}getEiendomListFromData(e){if(s(e))return e.map(e=>new j(e)).filter(e=>this.hasEiendomValue(e))}getValidationMessages(e){return K("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasZipCodeOrCity(e){return s(e?.adresse?.postnr)||s(e?.adresse?.poststed)}hasAdresseLinje(e){return s(e?.adresse?.adresselinje1)||s(e?.adresse?.adresselinje2)||s(e?.adresse?.adresselinje3)}hasAdresse(e){return this.hasAdresseLinje(e)||this.hasZipCodeOrCity(e)}hasEiendomNummerField(e){return s(e?.bolignummer)||s(e?.bygningsnummer)||s(e?.eiendomsidentifikasjon?.gaardsnummer)||s(e?.eiendomsidentifikasjon?.bruksnummer)||s(e?.eiendomsidentifikasjon?.seksjonsnummer)||s(e?.eiendomsidentifikasjon?.festenummer)}hasEiendomValue(e){return this.hasAdresse(e)||this.hasEiendomNummerField(e)}getTextResourceBindings(e){const t={adresse:{title:e?.resourceBindings?.adresse?.title||"resource.eiendomByggested.eiendom.adresse.title",emptyFieldText:e?.resourceBindings?.adresse?.emptyFieldText||"resource.eiendomByggested.eiendom.adresse.emptyFieldText"},eiendomsidentifikasjonGaardsnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.gaardsnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.gaardsnummer?.emptyFieldText||"resource.emptyFieldText.default"},eiendomsidentifikasjonBruksnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.bruksnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.bruksnummer?.emptyFieldText||"resource.emptyFieldText.default"},eiendomsidentifikasjonSeksjonsnummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.seksjonsnummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.seksjonsnummer?.emptyFieldText||"resource.emptyFieldText.default"},eiendomsidentifikasjonFestenummer:{title:e?.resourceBindings?.eiendomsidentifikasjon?.festenummer?.title||"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title",emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjon?.festenummer?.emptyFieldText||"resource.emptyFieldText.default"},bolignummer:{title:e?.resourceBindings?.bolignummer?.title||"resource.eiendomByggested.eiendom.bolignummer.title",emptyFieldText:e?.resourceBindings?.bolignummer?.emptyFieldText||"resource.emptyFieldText.default"},bygningsnummer:{title:e?.resourceBindings?.bygningsnummer?.title||"resource.eiendomByggested.eiendom.bygningsnummer.title",emptyFieldText:e?.resourceBindings?.bygningsnummer?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.eiendomByggested={title:e?.resourceBindings?.title||"resource.eiendomByggested.eiendom.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.eiendomByggested={...t.eiendomByggested,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Ge extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),i=this.getValidationMessages(s);this.isEmpty=n,this.partType=e?.partType,this.validationMessages=i,this.hasValidationMessages=R(i),this.resourceBindings=s,this.resourceValues={data:n?m(e?.resourceBindings?.emptyFieldText):t}}getPartTypeFromElementAttributes(e){return e.getAttribute("parttype")||"tiltakshaver"}getValueFromFormData(e){const t=g(e);if(!s(t))return;const n=new D(t);return this.hasPartValue(n)?n:void 0}getValidationMessages(e){return K("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return s(e)}hasNavnOrOrganisasjonsnummer(e){return s(e?.navn)||s(e?.organisasjonsnummer)}hasTelefonnummer(e){return s(e?.telefonnummer)||s(e?.mobilnummer)}hasEpost(e){return s(e?.epost)}hasPartValue(e){return this.hasNavnOrOrganisasjonsnummer(e)||this.hasTelefonnummer(e)||this.hasEpost(e)}getTextResourceBindings(e){const t=e?.partType||"tiltakshaver",s={navn:{title:e?.resourceBindings?.navn?.title||`resource.${t}.navn.title`,emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText||"resource.emptyFieldText.default"},telefonnummer:{title:e?.resourceBindings?.telefonnummer?.title||`resource.${t}.telefonnummer.title`,emptyFieldText:e?.resourceBindings?.telefonnummer?.emptyFieldText||"resource.emptyFieldText.default"},epost:{title:e?.resourceBindings?.epost?.title||`resource.${t}.epost.title`,emptyFieldText:e?.resourceBindings?.epost?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(s.part={title:e?.resourceBindings?.title||`resource.${t}.header`}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(s.part={...s.part,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),s}}function Ze(e){const t=JSON.parse(e?.getAttribute("formdata"));return s(t)&&t}function We(e){const t=e?.getAttribute("tagName")||e?.tagName?.toLowerCase();return s(t)&&t}function Ye(e){const t=e?.getAttribute("text");return s(t)&&t}function _e(e){const t=JSON.parse(e?.getAttribute("texts"));return s(t)&&t}function qe(e){return"true"===e?.getAttribute("inline")}function Qe(e){return"true"===e?.getAttribute("hideTitle")}function Xe(e){const t=e?.getAttribute("size");return _(t)?t?.toString().toLowerCase():void 0}function et(e){return"true"===e?.getAttribute("hideIfEmpty")}function tt(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return s(t)&&t}function st(e){return"true"===e?.getAttribute("isChildComponent")}function nt(e){const t=e?.getAttribute("feedbackType");return s(t)&&t}function it(e){const t=e?.getAttribute("itemKey");return s(t)&&t}function rt(e){const t=e?.getAttribute("dataItemKey");return s(t)&&t}function at(e){const t=e?.getAttribute("dataTitleItemKey");return s(t)&&t}function ot(e){return"true"===e?.getAttribute("hideOrgNr")}function lt(e){const t=e?.getAttribute("format");return s(t)&&t}function ut(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return s(t)&&t}function dt(e){return"true"===e?.getAttribute("showRowNumbers")}function ct(e){const t=JSON.parse(e?.getAttribute("resourceBindings"));return s(t)&&t}function mt(e){const t=JSON.parse(e?.getAttribute("resourceValues"));return s(t)&&t}function ht(e){const t=e?.getAttribute("partType");return s(t)?t:"tiltakshaver"}function gt(e){return"true"===e?.getAttribute("enableLinks")}function pt(t){const s=t instanceof HTMLElement?function(e){return{formData:Ze(e),tagName:We(e),text:Ye(e),texts:_e(e),inline:qe(e),hideTitle:Qe(e),size:Xe(e),hideIfEmpty:et(e),styleOverride:tt(e),isChildComponent:st(e),feedbackType:nt(e),itemKey:it(e),dataItemKey:rt(e),dataTitleItemKey:at(e),hideOrgNr:ot(e),format:lt(e),tableColumns:ut(e),showRowNumbers:dt(e),resourceBindings:ct(e),resourceValues:mt(e),partType:ht(e),enableLinks:gt(e)}}(t):t,n=s?.tagName||s?.getAttribute("tagname")||"custom-component";switch(n?.toLowerCase()){case"custom-component":return new e(s);case"custom-dispensasjon":return new $(s);case"custom-dispensasjoner-list-data":return new q(s);case"custom-dispensasjoner-unit-in-list":return new Q(s);case"custom-feedback":return new X(s);case"custom-feedback-data":return new ee(s);case"custom-feedbacklist-data":return new te(s);case"custom-feedbacklist-validation-messages":return new se(s);case"custom-field":return new ne(s);case"custom-field-adresse":return new ie(s);case"custom-field-boolean-data":return new re(s);case"custom-field-boolean-text":return new ae(s);case"custom-field-count-data":return new oe(s);case"custom-field-data":return new le(s);case"custom-field-list-data":return new de(s);case"custom-field-kommunens-saksnummer":return new ue(s);case"custom-field-part-navn":return new ce(s);case"custom-field-prosjekt":return new he(s);case"custom-field-telefonnummer":return new pe(s);case"custom-field-utfall-svar-status":return new ye(s);case"custom-group-ettersending":return new ve(s);case"custom-group-sjekklistekrav":return new je(s);case"custom-group-utfall-svar":return new Me(s);case"custom-group-utfall-svar-type":return new Le(s);case"custom-grouplist-ettersending":return new Ce(s);case"custom-grouplist-sjekklistekrav":return new Be(s);case"custom-grouplist-utfall-svar":return new xe(s);case"custom-grouplist-utfall-svar-type":return new Fe(s);case"custom-header":return new Ie(s);case"custom-header-text":return new De(s);case"custom-header-text-data":return new He(s);case"custom-list":return new Ae(s);case"custom-list-data":return new Se(s);case"custom-list-vedlegg":return new Ne(s);case"custom-paragraph":return new Pe(s);case"custom-paragraph-text":return new Oe(s);case"custom-subheader-text":return new Re(s);case"custom-table":return new Ke(s);case"custom-table-arbeidsplasser":return new ze(s);case"custom-table-data":return new Ue(s);case"custom-table-eiendom":return new Je(s);case"custom-table-part":return new Ge(s);default:return console.warn(`Unknown component type: ${n}`),null}}function ft(e,t,n){n={returnHtml:!0,inline:!1,styleOverride:{},...n};const r=document.createElement("div");r.classList.add("field"),e?.length&&r.appendChild(function(e,t){const s=document.createElement("label");return s.innerText=`${e}${t?":":""}`,s}(e,n.inline)),n?.inline&&r.classList.add("inline");const a=function(e,t){const n=document.createElement("span");return Array.isArray(e)&&(e=e.join(", ")),"object"==typeof e&&(e=JSON.stringify(e,null,2)),s(e)?n.innerHTML=t?function(e){const t="(?:https?:\\/\\/(?:www\\.)?[a-zA-Z0-9][a-zA-Z0-9-]*\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]*\\.[^\\s]{2,})",s=new RegExp(`(${t})`,"g"),n=new RegExp(`^${t}$`),i=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return e.toString().split(s).map(e=>{if(!e)return"";if(n.test(e)){const t=e.match(/^(.*?)([).,!?:;]+)?$/),s=t[1],n=t[2]??"";return`<a href="${s.startsWith("http")?s:`https://${s}`}" target="_blank" rel="noopener noreferrer">${s}</a>${i(n)}`}return i(e)}).join("")}(e):e:n.innerHTML="",n}(t,n.enableLinks);return e?.length&&a.classList.add("has-title"),r.appendChild(a),i(r,{...n.styleOverride}),n.returnHtml?r.outerHTML:r}function yt(e,t,s=!0){const n=document.createElement(t||"ul");return e.forEach(e=>{const t=document.createElement("li");t.innerHTML=e,n.appendChild(t)}),s?n.outerHTML:n}customElements.define("custom-feedback",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this),s=e?.resourceValues?.data;e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e,t){const s=document.createElement("p");return s.innerHTML=e,s.classList.add(t),s.outerHTML}(s,e?.feedbackType)}}),customElements.define("custom-field",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t={inline:e?.inline,styleOverride:e?.styleOverride,enableLinks:e?.enableLinks};this.innerHTML=ft(e?.resourceValues?.title,e?.resourceValues?.data,t)}}}),customElements.define("custom-header",class extends HTMLElement{connectedCallback(){const e=pt(this);e?.isEmpty||(this.innerHTML=function(e){const t=e?.resourceValues?.title,s=e?.size,n=e?.styleOverride,r=document.createElement(_(s)?s:"h2");return r.innerHTML=t,i(r,n),r.outerHTML}(e),i(this,e?.styleOverride))}}),customElements.define("custom-list",class extends HTMLElement{connectedCallback(){const e=new pt(this);this.innerHTML=e?.resourceValues?.title?.length?function(e,t,s){const n=document.createElement("div");n.classList.add("field"),e?.length&&n.appendChild(function(e){const t=document.createElement("label");return t.innerText=e,t}(e));const i=yt(t,s,!1);return e?.length&&i.classList.add("has-title"),n.appendChild(i),n.outerHTML}(e?.resourceValues?.title,e?.resourceValues?.data):yt(e?.resourceValues?.data),i(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=pt(this);if(!e?.isEmpty){const t=function(e){const t=e?.resourceValues?.title,s=e?.styleOverride,n=document.createElement("p");return n.innerHTML=t,i(n,s),n.outerHTML}(e);this.innerHTML=t}}});class kt{constructor(e){const t=this.getIsChildComponentAttributeFromProps(e),s=this.getFormDataAttributeFromProps(e),n=this.getTagNameAttributeFromProps(e),i=this.getSizeAttributeFromProps(e),r=this.getHideTitleAttributeFromProps(e),a=this.getHideIfEmptyAttributeFromProps(e),o=this.getIsEmptyAttributeFromProps(e),l=this.getInlineAttributeFromProps(e),u=this.getStyleOverrideAttributeFromProps(e),d=this.getGridAttributeFromProps(e),c=this.getTableColumnsAttributeFromProps(e),m=this.getItemKeyAttributeFromProps(e),h=this.getDataItemKeyAttributeFromProps(e),g=this.getDataTitleItemKeyAttributeFromProps(e),p=this.getIdAttributeFromProps(e),f=this.getFeedbackTypeAttributeFromProps(e),y=this.getHideOrgNr(e),k=this.getFormatAttributeFromProps(e),T=this.getShowRowNumbersAttributeFromProps(e),b=this.getPartTypeAttributeFromProps(e),v=this.getResourceBindingsFromProps(e),C=this.getResourceValuesFromProps(e),B=this.getEnableLinksFromProps(e),x=this.getTextAttributeFromProps(e);t&&(this.isChildComponent=t),s&&(this.formData=s),n&&(this.tagName=n),i&&(this.size=i),r&&(this.hideTitle=r),a&&(this.hideIfEmpty=a),o&&(this.isEmpty=o),l&&(this.inline=l),u&&(this.styleOverride=u),d&&(this.grid=d),c&&(this.tableColumns=c),m&&(this.itemKey=m),h&&(this.dataItemKey=h),g&&(this.dataTitleItemKey=g),p&&(this.id=p),f&&(this.feedbackType=f),y&&(this.hideOrgNr=y),k&&(this.format=k),T&&(this.showRowNumbers=T),b&&(this.partType=b),v&&(this.resourceBindings=v),C&&(this.resourceValues=C),B&&(this.enableLinks=B),x&&(this.text=x)}getFormDataAttributeFromProps(e){if(!s(e?.formData))return null;if("string"==typeof e?.formData){const t=e?.formData;return JSON.stringify(t)}if("number"==typeof e?.formData){const t=e?.formData.toString();return JSON.stringify(t)}if("object"==typeof e?.formData){const t={};return Object.keys(e.formData).forEach(s=>{t[s]=e.formData[s]}),JSON.stringify(t)}}getIsChildComponentAttributeFromProps(e){return e?.isChildComponent?"true":void 0}getTagNameAttributeFromProps(e){return e?.tagName?e?.tagName.toString():void 0}getSizeAttributeFromProps(e){return _(e?.size)?e?.size?.toString().toLowerCase():void 0}getHideTitleAttributeFromProps(e){return"true"===e?.hideTitle?.toString()?"true":void 0}getHideIfEmptyAttributeFromProps(e){return"true"===e?.hideIfEmpty?.toString()?"true":void 0}getIsEmptyAttributeFromProps(e){return"true"===e?.isEmpty?.toString()?"true":void 0}getInlineAttributeFromProps(e){return"true"===e?.inline?.toString()?"true":void 0}getStyleOverrideAttributeFromProps(e){return s(e?.styleOverride)?JSON.stringify(e?.styleOverride):void 0}getGridAttributeFromProps(e){return s(e?.grid)&&JSON.stringify(e?.grid)}getTableColumnsAttributeFromProps(e){return s(e?.tableColumns)&&JSON.stringify(e?.tableColumns)}getItemKeyAttributeFromProps(e){return s(e?.itemKey)&&e?.itemKey}getDataItemKeyAttributeFromProps(e){return s(e?.dataItemKey)&&e?.dataItemKey}getDataTitleItemKeyAttributeFromProps(e){return s(e?.dataTitleItemKey)&&e?.dataTitleItemKey}getIdAttributeFromProps(e){return s(e?.id)&&e?.id}getFeedbackTypeAttributeFromProps(e){return s(e?.feedbackType)?["error","warning","success","info","default"].includes(e?.feedbackType)?e?.feedbackType:"default":null}getHideOrgNr(e){return"true"===e?.hideOrgNr?.toString()?"true":void 0}getFormatAttributeFromProps(e){return s(e?.format)&&e?.format?.toString()}getShowRowNumbersAttributeFromProps(e){return"true"===e?.showRowNumbers?.toString()?"true":void 0}getPartTypeAttributeFromProps(e){return s(e?.partType)&&e?.partType}getResourceBindingsFromProps(e){return s(e?.resourceBindings)&&JSON.stringify(e?.resourceBindings)}getResourceValuesFromProps(e){return s(e?.resourceValues)?JSON.stringify(e?.resourceValues):null}getEnableLinksFromProps(e){return"true"===e?.enableLinks?.toString()?"true":void 0}getTextAttributeFromProps(e){return s(e?.text)&&e?.text}}function Tt(e){const t=e?.resourceValues?.data,s=e?.styleOverride,n=document.createElement("table"),o=document.createElement("thead"),l=document.createElement("tr");if(t?.tableHeaders?.length&&t?.tableRows?.length){t.tableHeaders.forEach(e=>{l.appendChild(function(e){const t=document.createElement("th");return t.textContent=e.text,i(t,e?.props?.styleOverride),t}(e))}),o.appendChild(l),n.appendChild(o);const e=document.createElement("tbody");t.tableRows.forEach(t=>{e.appendChild(function(e){const t=document.createElement("tr");return e.forEach(e=>{t.appendChild(function(e){const t=document.createElement("td"),s=new kt(e);return t.innerHTML=a("custom-field-data",s).outerHTML,t}(e))}),t}(t))}),n.appendChild(e)}else{const t=r(e);if(t?.length){const e=document.createElement("tr"),s=document.createElement("td");s.textContent=t,e.appendChild(s),n.appendChild(e)}}return i(n,s),n}function bt(e){return a("custom-feedbacklist-validation-messages",new kt({isChildComponent:!0,resourceValues:{data:e}}))}function vt(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}function Ct(e,t){return a("custom-group-ettersending",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceValues:{data:e}}))}function Bt(e,t){return a("custom-group-sjekklistekrav",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceBindings:{trueText:t?.resourceBindings?.trueText,falseText:t?.resourceBindings?.falseText,defaultText:t?.resourceBindings?.defaultText},resourceValues:{data:e}}))}function xt(e,t){return a("custom-group-utfall-svar",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceValues:{data:e}}))}function Vt(e,t="h1"){const n=e?.resourceValues?.data,i=n?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return s(i)?a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceValues:{title:i}})):null}customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e,t){const s=new kt({size:t,resourceValues:{title:e}});if(e)return a("custom-header",s)}(e?.resourceValues?.title,e?.size),s=Tt(e);this.innerHTML="",t&&this.appendChild(t),this.appendChild(s)}}}),customElements.define("custom-dispensasjoner-list-data",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);e?.hideIfEmpty&&e.isEmpty&&t?t.style.display="none":e?.resourceValues?.data&&this.appendChild(function(e){const t=document.createElement("div");return e?.resourceValues?.data?.forEach(e=>{t.appendChild(function(e){return a("custom-dispensasjoner-unit-in-list",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e}}))}(e))}),t}(e))}}),customElements.define("custom-dispensasjoner-unit-in-list",class extends HTMLElement{connectedCallback(){const e=pt(this);if(!e.isEmpty){const t=e.hasValidationMessages&&bt(e?.validationMessages),s=function(e){const t=document.createElement("div");return t.appendChild(function(e){return a("custom-header-text-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{dataTitle:e?.resourceValues?.data?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse},resourceBindings:{title:e?.resourceBindings?.bestemmelsestype?.title},styleOverride:{textDecoration:"underline"}}))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data?.dispensasjonFra?.lovbestemmelse;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.bestemmelse?.title},resourceValues:{data:t||e?.resourceValues?.data?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e)),t.appendChild(function(e){return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.begrunnelse?.title},resourceValues:{data:e?.resourceValues?.data?.begrunnelse?.hensynBakBestemmelsen}})))}(e)),t}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-feedback-data",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e.isEmpty&&t)t.style.display="none";else{const t=new kt(e);this.innerHTML=a("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this),s=e?.resourceValues?.data,n=e?.resourceValues?.title||"Messages";e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e,t,s,n){const r=document.createElement("details");r.classList.add("feedback-details"),r.classList.add(s),r.setAttribute("open",!0),i(n);const o=document.createElement("summary");o.classList.add("feedback-summary"),o.innerHTML=e,r.appendChild(o);const l=document.createElement("div");return l.classList.add("feedback-list"),t.forEach(e=>{const t=document.createElement("div");t.classList.add("feedback-list-item");const s=new kt({isChildComponent:!0,feedbackType:"default",resourceValues:{data:e}});t.appendChild(a("custom-feedback-data",s)),l.appendChild(t)}),r.appendChild(l),r.outerHTML}(n,s,e?.feedbackType,e?.styleOverride)}}),customElements.define("custom-feedbacklist-validation-messages",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this),s=new O(e?.resourceValues?.data);e.isEmpty&&t?t.style.display="none":this.innerHTML=function(e){const t=document.createElement("div");return t.classList.add("validation-messages-container"),Object.keys(e).forEach(s=>{const n=e[s];if(n?.length){const e=a("custom-feedbacklist-data",new kt({isChildComponent:!0,feedbackType:s,resourceValues:{title:vt(s,n.length),data:n}}));t.appendChild(e)}}),t.outerHTML}(s)}}),customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=r(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new kt(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=r(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new kt(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new kt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new kt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new kt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new kt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-list-data",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e){const t=document.createElement("div");return e?.resourceValues?.data?.forEach(e=>{t.appendChild(o(a("custom-field-data",new kt({isChildComponent:!0,resourceValues:e}))))}),t}(e);this.innerHTML=t.outerHTML}}}),customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new kt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new kt(e);this.innerHTML=a("custom-field",t).outerHTML}}}),customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=r(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new kt(e);this.innerHTML=a("custom-field",s).outerHTML}}}),customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new kt(e);this.innerHTML=a("custom-field",t).outerHTML;const s=e.hasValidationMessages&&bt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-ettersending",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new kt({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{this.appendChild(function(e,t="h2"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e,"h2"));for(const t of e?.resourceValues?.data){const s=Ct(t,e);this.appendChild(s);const n=a("custom-divider");this.appendChild(n)}const t=e.hasValidationMessages&&bt(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-sjekklistekrav",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new kt({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{this.appendChild(function(e,t="h2"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e,"h2"));for(const t of e?.resourceValues?.data){const s=Bt(t,e);this.appendChild(s);const n=a("custom-divider");this.appendChild(n)}const t=e.hasValidationMessages&&bt(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new kt({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{this.appendChild(function(e,t="h2"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.title}}))}(e,"h2"));for(const t of e?.resourceValues?.data){const s=xt(t,e);this.appendChild(s);const n=a("custom-divider");this.appendChild(n)}const t=e.hasValidationMessages&&bt(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);e?.hideIfEmpty&&e.isEmpty&&t?t.style.display="none":e?.resourceValues?.data&&Object.keys(e?.resourceValues?.data).forEach(t=>{const s=function(e,t){const s=e?.resourceValues?.data[t];return a("custom-group-utfall-svar-type",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceValues:{data:s,utfallType:t}}))}(e,t);this.appendChild(s)})}}),customElements.define("custom-group-ettersending",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new kt({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=document.createElement("div");t.appendChild(function(e,t="h3"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.data?.tittel}}))}(e,"h3")),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["tema.kodebeskrivelse.title"]},resourceValues:{data:t?.tema?.kodebeskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!1,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["kommentar.title"]},resourceValues:{data:t?.kommentar,emptyFieldText:"-"}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-list-vedlegg",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&bt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-sjekklistekrav",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return a("custom-paragraph",new kt({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=document.createElement("div");t.appendChild(function(e,t="h3"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.data?.tittel}}))}(e,"h3")),t.appendChild(function(e){const t=l();return t.appendChild(function(e){const t=e?.resourceValues?.data,s={xs:11};return o(a("custom-field",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,grid:s,resourceValues:{title:t?.sjekklistepunkt?.kodebeskrivelse,data:t?.dokumentasjon}})),s)}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data,s={xs:1};return o(a("custom-field-boolean-text",new kt({isChildComponent:!0,hideIfEmpty:!0,hideTitle:!0,grid:s,resourceBindings:{trueText:e?.resourceBindings?.trueText,falseText:e?.resourceBindings?.falseText,defaultText:e?.resourceBindings?.defaultText},resourceValues:{data:t?.sjekklistepunktsvar}})),s)}(e)),t}(e)),this.appendChild(t);const s=e.hasValidationMessages&&bt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=document.createElement("div");t.appendChild(function(e,t="h3"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceValues:{title:e?.resourceValues?.data?.tittel}}))}(e,"h3")),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceValues:{data:t?.beskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-utfall-svar-status",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["status.title"]},resourceValues:{data:t}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["tema.kodebeskrivelse.title"]},resourceValues:{data:t?.tema?.kodebeskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!1,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.["kommentar.title"]},resourceValues:{data:t?.kommentar,emptyFieldText:"-"}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return o(a("custom-list-vedlegg",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&bt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=pt(this);if(!e.isEmpty){const t=function(e){return a("custom-grouplist-utfall-svar",new kt({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceBindings:{title:e?.resourceBindings?.title},resourceValues:{data:e?.resourceValues?.data,title:e?.resourceValues?.title}}))}(e);this.appendChild(t);const s=e.hasValidationMessages&&bt(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new pt(this);e?.isChildComponent||i(c(this),{padding:"0 0.75rem"});const t=new kt(e);this.innerHTML=a("custom-header",t).outerHTML}}),customElements.define("custom-header-text-data",class extends HTMLElement{connectedCallback(){const e=new pt(this);e?.isChildComponent||i(c(this),{padding:"0 0.75rem"});const t=new kt(e);this.innerHTML=a("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new pt(this),t=c(this);var s,n;if(e?.itemKey?.length&&(s=e?.formData?.data,n=e?.itemKey,Array.isArray(s)&&s.length&&s.map(e=>e?.[n])),e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new kt(e),s=e.isEmpty?"custom-field":"custom-list";this.innerHTML=a(s,t).outerHTML}}}),customElements.define("custom-list-vedlegg",class extends HTMLElement{connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new kt(e);this.innerHTML=a("custom-field",t).outerHTML}else{const t=new kt(e);this.innerHTML=a("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=pt(this),t=new kt(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=pt(this),t=new kt(e);this.innerHTML=a("custom-paragraph",t).outerHTML}}),customElements.define("custom-table-arbeidsplasser",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&bt(e?.validationMessages),s=function(e){const t=[{tagName:"custom-field-data",dataKey:"title",resourceBindings:{title:e?.resourceBindings?.arbeidsplasserKey?.title}},{tagName:"custom-field-data",dataKey:"value",resourceBindings:{title:e?.resourceBindings?.beroertAvTiltaket?.title}}];return a("custom-table-data",new kt({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.arbeidsplasser?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-data",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&bt(e?.validationMessages),s=function(e){return a("custom-table",new kt(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&bt(e?.validationMessages),s=function(e){const t=[{dataKey:"adresse",tagName:"custom-field-adresse",resourceBindings:{title:e?.resourceBindings?.adresse?.title,emptyFieldText:e?.resourceBindings?.adresse?.emptyFieldText},props:{styleOverride:{width:"116px"}}},{dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonGaardsnummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonGaardsnummer?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonBruksnummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonBruksnummer?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonSeksjonsnummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonSeksjonsnummer?.emptyFieldText}},{dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.eiendomsidentifikasjonFestenummer?.title,emptyFieldText:e?.resourceBindings?.eiendomsidentifikasjonFestenummer?.emptyFieldText}},{dataKey:"bolignummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.bolignummer?.title,emptyFieldText:e?.resourceBindings?.bolignummer?.emptyFieldText}},{dataKey:"bygningsnummer",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.bygningsnummer?.title,emptyFieldText:e?.resourceBindings?.bygningsnummer?.emptyFieldText}}];return a("custom-table-data",new kt({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.eiendomByggested?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-part",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&bt(e?.validationMessages),s=function(e){const t=[{tagName:"custom-field-part-navn",resourceBindings:{title:e?.resourceBindings?.navn?.title,emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText}},{tagName:"custom-field-telefonnummer",resourceBindings:{title:e?.resourceBindings?.telefonnummer?.title,emptyFieldText:e?.resourceBindings?.telefonnummer?.emptyFieldText}},{tagName:"custom-field-data",dataKey:"epost",resourceBindings:{title:e?.resourceBindings?.epost?.title,emptyFieldText:e?.resourceBindings?.epost?.emptyFieldText}}];return a("custom-table-data",new kt({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.part?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=pt(this),t=c(this);if(e.isEmpty&&t)t.style.display="none";else{const t=l(),n=Vt(e),i=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.dispensasjonReferanse?.title},resourceValues:{data:t?.dispensasjonReferanse}})),s)}(e),r=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.metadataFtbId?.title},resourceValues:{data:t?.metadata?.ftbId}})),s)}(e),u=function(e){const t=e?.resourceValues?.data,s={xs:6};return o(a("custom-field-kommunens-saksnummer",new kt({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.kommunensSaksnummer?.title},resourceValues:{data:t?.kommunensSaksnummer}})),s)}(e),d=function(e,t="h2"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.soeknadGjelderHeader?.title}}))}(e),c=function(e){const t=e?.resourceValues?.data;return a("custom-table-eiendom",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.eiendomByggested?.title},resourceValues:{data:t?.eiendomByggested?.eiendom}}))}(e),m=function(e,t="h3"){const s=e?.resourceValues?.data;return s?.tiltakstyper?.type?.kode?.length>0?a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeHeader?.title}})):null}(e),h=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new kt({isChildComponent:!0,hideIfEmpty:!0,itemKey:"kodebeskrivelse",resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeKode?.title},resourceValues:{data:t?.tiltakstyper?.type?.kode}})))}(e),g=function(e){const t=e?.resourceValues?.data;return a("custom-table-part",new kt({isChildComponent:!0,partType:"tiltakshaver",hideIfEmpty:!0,resourceValues:{data:t?.tiltakshaver}}))}(e),p=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-adresse",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.tiltakshaverAdresse?.title},resourceValues:{data:t?.tiltakshaver?.adresse}})))}(e),f=Vt(e,"h2"),k=function(e){const t=e?.resourceValues?.data;return s(t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse)||s(t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse)?o(a("custom-field-boolean-data",new kt({isChildComponent:!0,hideIfEmpty:!1,resourceValues:{data:"Annet"===t?.soeknadstype?.kodebeskrivelse,trueData:t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse,falseData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse,defaultData:t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse}}))):null}(e),T=function(e){const t=e?.resourceValues?.data;return a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonBeskrivelseBeskrivelse?.title},resourceValues:{data:t?.dispensasjonBeskrivelse?.beskrivelse}}))}(e),b=function(e,t="h2"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.dispensasjonFraHeader?.title}}))}(e),v=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonPlanBestemmelseNavn?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.navn}})))}(e),C=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.nasjonalArealplanIdPlanIdentifikasjon?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.nasjonalArealplanId?.planidentifikasjon}})))}(e),B=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.bestemmelserType?.title},resourceValues:{data:e.isPlanBestemmelseType?t?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:t?.dispensasjonFra?.lovbestemmelse}})))}(e),x=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.planBestemmelseNummerering?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e),V=function(e){return a("custom-header-text",new kt({isChildComponent:!0,size:"h2",resourceBindings:{title:e.resourceBindings?.stedfestingHeader?.title}}))}(e),E=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinatsystem?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinatsystem?.kodebeskrivelse}})))}(e),F=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinater?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinater?.koordinat}})))}(e),w=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingVertikalnivaa?.title},resourceValues:{data:t?.stedfesting?.vertikalnivaa?.kodebeskrivelse}})))}(e),j=function(e,t="h2"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.varighetHeader?.title}}))}(e),M=function(e){const t=e?.resourceValues?.data;return t?.varighet?.oenskesVarigDispensasjon?o(a("custom-paragraph-text",new kt({isChildComponent:!0,resourceBindings:{title:e.resourceBindings?.varighetOenskesVarigDispensasjon?.trueText}}))):s(t?.varighet?.oensketVarighetTil)?o(a("custom-field-data",new kt({isChildComponent:!0,format:"date",resourceBindings:{title:e.resourceBindings?.varighetOensketVarighetTil?.title},resourceValues:{data:t?.varighet?.oensketVarighetTil}}))):null}(e),L=function(e,t="h2"){return a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.begrunnelseHeader?.title}}))}(e),I=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.hensynBakBestemmelsen}})))}(e),D=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynBakBestemmelsen}})))}(e),H=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynOverordnet?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynOverordnet}})))}(e),A=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseFordeler?.title},resourceValues:{data:t?.begrunnelse?.fordeler?.effekt}})))}(e),S=function(e){const t=e?.resourceValues?.data;return o(a("custom-list-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseUlemper?.title},resourceValues:{data:t?.begrunnelse?.ulemper?.effekt}})))}(e),N=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-data",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseSamletBegrunnelse?.title},resourceValues:{data:t?.begrunnelse?.samletBegrunnelse}})))}(e),P=function(e,t="h2"){const s=e?.resourceValues?.data,n=s?.generelleVilkaar?.norskSvenskDansk;return n?a("custom-header-text",new kt({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.title}})):null}(e),O=function(e){const t=e?.resourceValues?.data;return o(a("custom-field-boolean-text",new kt({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{trueText:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.trueText,falseText:"",defaultText:""},resourceValues:{data:t?.generelleVilkaar?.norskSvenskDansk}})))}(e),R=bt(e?.validationMessages);y(t,[n,i,r,u]),y(t,[d,c,m,h]),y(t,[g,p]),y(t,[f,k,T]),e.isPlanBestemmelseType?y(t,[b,v,C,B,x]):y(t,[b,B]),y(t,[V,E,F,w]),y(t,[j,M]),y(t,[L,I,D,H,A,S,N]),y(t,[P,O]),y(t,[R]),this.appendChild(t)}}});class Et{constructor(e){this.eiendomByggested=e?.eiendomByggested&&new M(e.eiendomByggested),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new L(e.kommunensSaksnummer),this.metadata=e?.metadata&&new I(e.metadata),this.versjon=e?.versjon}}function Ft(e){return h(e)}const wt={eiendomTable:{title:"resource.eiendomByggested.eiendom.title","col-1":"resource.eiendomByggested.eiendom.adresse.title","col-2":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.gaardsnummer.title","col-3":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.bruksnummer.title","col-4":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.seksjonsnummer.title","col-5":"resource.eiendomByggested.eiendom.eiendomsidentifikasjon.festenummer.title","col-6":"resource.eiendomByggested.eiendom.bolignummer.title","col-7":"resource.eiendomByggested.eiendom.bygningsnummer.title"},gjenomfoeringsplanNummer:{title:"resource.gjennomfoeringsplan.versjon.title"}};customElements.define("custom-gjennomfoeringsplan",class extends HTMLElement{async connectedCallback(){const e=JSON.parse(this.getAttribute("textResources")),t=function(e){const t=JSON.parse(e.getAttribute("formdata"));return new Et({eiendomByggested:s(t?.eiendomByggested)?t.eiendomByggested:null,kommunensSaksnummer:s(t?.kommunensSaksnummer)?t.kommunensSaksnummer:null,metadata:s(t?.metadata)?t.metadata:null,versjon:t?.versjon?t.versjon:null})}(this),n=K(e,wt),i=c(this);if(!s(t)&&i)i.style.display="none";else{const s=function(e,t){return a("custom-field-data",{formData:{simpleBinding:e?.versjon},text:m(t),emptyFieldText:"(gjennomfoeringsplanNummer mangler)"})}(t,e),i=function(e,t){return a("custom-table-data",{formData:{data:e},text:"Eiendom/Byggested",hideIfEmpty:!0,size:"h3",tableColumns:[{titleResourceKey:"col-1",dataKey:"adresse",tagName:"custom-field-adresse",props:{emptyFieldText:"(adresse mangler)",styleOverride:{}}},{titleResourceKey:"col-2",dataKey:"eiendomsidentifikasjon.gaardsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-3",dataKey:"eiendomsidentifikasjon.bruksnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-4",dataKey:"eiendomsidentifikasjon.seksjonsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"96px"}}},{titleResourceKey:"col-5",dataKey:"eiendomsidentifikasjon.festenummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"85px"}}},{titleResourceKey:"col-6",dataKey:"bolignummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"120px"}}},{titleResourceKey:"col-7",dataKey:"bygningsnummer",tagName:"custom-field-data",props:{emptyFieldText:"-",styleOverride:{width:"96px"}}}],texts:Ft(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),r=bt(n);this.appendChild(s),this.appendChild(i),this.appendChild(r)}}}),window.addEventListener("load",async()=>{const e=window.location.pathname.split("/"),t=window.location.origin,n=e?.[1],i=e?.[2];if(![t?.length,n?.length,i?.length].every(Boolean))return void console.error("Could not determine the origin, organization, or application from the URL.");const r=`${t}/${n}/${i}/api/v1/profile/user`,a=await fetch(r).then(e=>e.json());if(!a?.profileSettingPreference?.language)return void console.error("Could not determine the user's language preference.");const o=a?.profileSettingPreference?.language;window.selectedLanguage=o;const l=`${t}/${n}/${i}/api/v1/texts/${o}`,u=await fetch(l).then(e=>e.json());if(s(u))window.textResources=u;else{console.error("Could not retrieve text resources for the selected language.");const e=`${t}/${n}/${i}/api/v1/texts/nb`,r=await fetch(e).then(e=>e.json());if(window.textResources=r,!s(r))return void console.error("Could not retrieve text resources for the fallback language.")}})})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektum/altinn-studio-custom-components",
3
- "version": "11.12.0",
3
+ "version": "11.13.0",
4
4
  "description": "Custom components for Altinn Studio",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/main.js",