@arkitektum/altinn-studio-custom-components 11.26.0 → 11.26.2

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/dist/main.css CHANGED
@@ -1 +1 @@
1
- custom-divider{page-break-before:avoid;display:block;& hr{background-color:var(--color-default-dark);border:none;display:block;height:1px;margin:20px 0;page-break-before:avoid;&:before{content:"";display:block;height:50px;margin-top:-50px}}}custom-feedback{display:block;& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);margin-block:0;&.error{color:var(--color-error-default)}&.success{color:var(--color-success-default)}&.warning{color:var(--color-warning-default)}&.info{color:var(--color-info-default)}}}custom-field{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .field{&.inline{align-items:baseline;display:flex;flex-direction:row;gap:.5rem}& span.field-title{display:block;font-weight:var(--font-weight-bold);page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:50px;margin-bottom:-50px}}& span.field-value{display:block;white-space:pre-line;& a{color:var(--color-text-link)}}&:not(.inline){& span.field-value{&.has-title{page-break-before:avoid}}}}}custom-header{color:var(--color-text-default);display:block;font-family:var(--font-family-default);font-weight:var(--font-weight-default);width:100%;page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:100px;margin-bottom:-100px}& h1,& h2,& h3,& h4{page-break-after:avoid;display:inline-block;line-height:1.1em;margin-block-end:0;margin-block-start:1em}& h1{font-size:var(--font-size-h1);font-weight:var(--font-weight-semibold)}& h2{font-size:var(--font-size-h2)}& h2,& h3{font-weight:var(--font-weight-default)}& h3{font-size:var(--font-size-h3)}& h4{font-size:var(--font-size-h4);font-weight:var(--font-weight-semibold)}}custom-list{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .field{& span.field-title{display:block;font-weight:var(--font-weight-bold);page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:50px;margin-bottom:-50px}}}& ul{display:block;margin-block:0;padding-inline-start:0;padding-left:1.5em;&.has-title{page-break-before:avoid}}}custom-paragraph{display:block;& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);margin-block:0;a{color:var(--color-text-link)}}}custom-summation{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .custom-summation{border:1px solid var(--color-default-dark);border-radius:4px;margin:.75rem 0;overflow:hidden;& .summation-item{align-items:center;display:flex;margin:0;padding:.25rem 10px;&:nth-child(2n){background-color:var(--color-default-muted)}&.total{background-color:var(--color-default-default);border-top:1px solid var(--color-default-dark)}.summation-item-operator{margin-right:.5rem;text-align:center;width:1rem}.summation-item-title{flex:1;font-weight:var(--font-weight-default)}.summation-item-data{margin-left:8px}}}}custom-table{color:var(--color-text-default);display:block;font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& table{border:1px solid var(--color-default-dark);border-radius:4px;border-spacing:0;margin:.75rem 0;overflow:hidden;width:100%;& tr{page-break-inside:avoid}& td,& th{padding:8px 10px;page-break-inside:avoid;&:after{content:"";display:block;height:30px;margin-bottom:-30px}}& thead{& th{page-break-after:avoid;background-color:var(--color-default-default);border-bottom:1px solid var(--color-default-dark);font-weight:var(--font-weight-bold);line-height:var(--line-height-table-header);text-align:left}}& tbody{& tr{&:nth-child(2n){background-color:var(--color-default-muted)}}& tr:not(:last-of-type){& td{border-bottom:1px solid var(--color-default-dark)}}}}}custom-feedbacklist-data{@media screen{display:block}@media print{display:none}color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& details.feedback-details{border-radius:4px;margin:.75rem 0;overflow:hidden;& summary{cursor:pointer;padding:8px 16px;transition:var(--background-transition-default)}& .feedback-list{& .feedback-list-item{border-block-style:inset;border-bottom:1px solid rgba(0,0,0,.075);border-top:1px solid hsla(0,0%,100%,.075);padding:8px 16px;&:last-child{border-bottom:none}}}&.error{background-color:var(--color-error-muted);& summary{background-color:var(--color-error-default);color:#fff;&:hover{background-color:var(--color-error-light)}}}&.warning{background-color:var(--color-warning-muted);& summary{background-color:var(--color-warning-default);color:#fff;&:hover{background-color:var(--color-warning-light)}}}&.info{background-color:var(--color-info-muted);& summary{background-color:var(--color-info-default);color:#fff;&:hover{background-color:var(--color-info-light)}}}&.success{background-color:var(--color-success-muted);& summary{background-color:var(--color-success-default);color:#fff;&:hover{background-color:var(--color-success-light)}}}&.default{background-color:var(--color-default-muted);border:1px solid var(--color-default-dark);& summary{background-color:var(--color-default-default);color:var(--color-text-default);&:hover{background-color:var(--color-default-light)}}& .feedback-list{& .feedback-list-item{border-bottom:1px solid var(--color-default-dark);border-top:none;&:nth-child(odd){background-color:#fff}&:last-child{border-bottom:none}}}}}}custom-feedbacklist-validation-messages{@media screen{display:block;width:100%}@media print{display:none}}custom-field-adresse{display:block;page-break-inside:avoid}custom-grouplist-sjekklistekrav{& .sjekklistekrav-list{border:1px solid var(--color-default-dark);border-radius:4px;margin:.75rem 0;overflow:hidden}}custom-group-sjekklistekrav{&>div{padding:0 10px}&:nth-of-type(2n){&>div{background-color:var(--color-default-muted)}}}custom-header-text{display:block;width:100%;page-break-after:avoid;page-break-inside:avoid}custom-subheader-text{display:block;margin-top:-32px}custom-table-arbeidsplasser,custom-table-data,custom-table-eiendom,custom-table-omraaderisiko,custom-table-part,custom-table-plan{display:block;width:100%}@font-face{font-family:Roboto Flex;src:url(49c816770b639989d28b.woff2) format("woff2")}:root{--font-family-default:"Roboto Flex",Arial,sans-serif;--color-text-default:#1c1b1d;--color-text-link:#01579b;--background-muted:#f7f4f4;--color-error-muted:#ef535030;--color-error-light:#ef5350;--color-error-default:#d32f2f;--color-error-dark:#c62828;--color-warning-muted:#ff980030;--color-warning-light:#ff9800;--color-warning-default:#ed6c02;--color-warning-dark:#e65100;--color-success-muted:#4caf5030;--color-success-light:#4caf50;--color-success-default:#2e7d32;--color-success-dark:#1b5e20;--color-info-muted:#03a9f430;--color-info-light:#03a9f4;--color-info-default:#0288d1;--color-info-dark:#01579b;--color-default-muted:#fdfbfb;--color-default-light:#f9f7f7;--color-default-default:#f6f4f4;--color-default-dark:#e7e4e4;--font-size-default:16px;--font-size-h1:34px;--font-size-h2:28px;--font-size-h3:22px;--font-size-h4:18px;--font-weight-default:400;--font-weight-semibold:500;--font-weight-bold:600;--line-height-default:24px;--line-height-heading:1.1em;--line-height-table-header:20px;--margin-block-start-heading:1em;--margin-block-end-heading:0;--background-transition-default:background-color 150ms}body{background-color:#fff;color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);letter-spacing:normal;line-height:var(--line-height-default);-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;& main{& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);line-height:var(--line-height-default);&[class^=fds-]{font-family:var(--font-family-default)}}& a{color:var(--color-text-link)}& .fds-label{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-h3);font-weight:var(--font-weight-default);line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);page-break-after:avoid;page-break-inside:avoid}& .fds-table{border:1px solid var(--color-default-dark);border-radius:4px;border-spacing:0;overflow:hidden;width:100%;& tr{page-break-inside:avoid}& td,& th{padding:8px 12px;page-break-inside:avoid;&:after{content:"";display:block;height:30px;margin-bottom:-30px}}& thead{& th{font-family:var(--font-family-default);font-size:var(--font-size-default);page-break-after:avoid;background-color:var(--color-default-default);border-bottom:1px solid var(--color-default-dark);font-weight:var(--font-weight-bold);line-height:var(--line-height-table-header);text-align:left;&:first-of-type{border-top-left-radius:5px}&:last-of-type{border-top-right-radius:5px}}}& tbody{& tr{&:nth-child(2n){background-color:var(--color-default-muted)}&:not(:last-of-type){& td{border-bottom:1px solid var(--color-default-dark)}}&:last-of-type{& td{border-bottom:none;&:first-of-type{border-bottom-left-radius:5px}&:last-of-type{border-bottom-right-radius:5px}}}& td{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default)}}}}}& h1,& h2,& h3,& h4,& h5,& h6{color:var(--color-text-default);page-break-after:avoid;display:inline-block;line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);&[class^=fds-]{font-family:var(--font-family-default)}}& h1{font-size:var(--font-size-h1);font-weight:var(--font-weight-semibold)}& h2{font-size:var(--font-size-h2)}& h2,& h3{font-weight:var(--font-weight-default)}& h3{font-size:var(--font-size-h3)}& h4{font-size:var(--font-size-h4);font-weight:var(--font-weight-semibold)}& a{color:var(--color-text-link)}& div[data-componenttype=AttachmentList] ul{margin-top:.3em;& li{margin-bottom:0;& [class^=fds-],& a,& span{color:var(--color-text-default);cursor:default;font-family:var(--font-family-default);font-size:1.1rem;font-weight:var(--font-weight-default);line-height:var(--line-height-default);pointer-events:none}}}}@media print{html{font-size:inherit!important;& body{& .fds-label{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-h3);font-weight:var(--font-weight-default);line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);page-break-after:avoid;page-break-inside:avoid}}}}@page{size:A4 portrait;margin-bottom:1.5cm;margin-left:1.25cm;margin-right:1.25cm;margin-top:1cm}#pdfView{&>h1:first-of-type{min-height:68px}&>div[data-testid=pdf-logo]{display:block;margin-bottom:0;min-height:68px;& h1{margin-top:0}& img{height:auto;position:absolute;right:0;top:0;width:85px}&:after{content:"";display:block}}}
1
+ custom-divider{page-break-before:avoid;display:block;& hr{background-color:var(--color-default-dark);border:none;display:block;height:1px;margin:20px 0;page-break-before:avoid;&:before{content:"";display:block;height:50px;margin-top:-50px}}}custom-feedback{display:block;& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);margin-block:0;&.error{color:var(--color-error-default)}&.success{color:var(--color-success-default)}&.warning{color:var(--color-warning-default)}&.info{color:var(--color-info-default)}}}custom-field{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .field{&.inline{align-items:baseline;display:flex;flex-direction:row;gap:.5rem}& span.field-title{display:block;font-weight:var(--font-weight-bold);page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:50px;margin-bottom:-50px}}& span.field-value{display:block;white-space:pre-line;& a{color:var(--color-text-link)}}&:not(.inline){& span.field-value{&.has-title{page-break-before:avoid}}}}}custom-header{color:var(--color-text-default);display:block;font-family:var(--font-family-default);font-weight:var(--font-weight-default);width:100%;page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:100px;margin-bottom:-100px}& h1,& h2,& h3,& h4{page-break-after:avoid;display:inline-block;line-height:1.1em;margin-block-end:0;margin-block-start:1em}& h1{font-size:var(--font-size-h1);font-weight:var(--font-weight-semibold)}& h2{font-size:var(--font-size-h2)}& h2,& h3{font-weight:var(--font-weight-default)}& h3{font-size:var(--font-size-h3)}& h4{font-size:var(--font-size-h4);font-weight:var(--font-weight-semibold)}}custom-list{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .field{& span.field-title{display:block;font-weight:var(--font-weight-bold);page-break-after:avoid;page-break-inside:avoid;&:after{content:"";display:block;height:50px;margin-bottom:-50px}}}& ul{display:block;margin-block:0;padding-inline-start:0;padding-left:1.5em;&.has-title{page-break-before:avoid}}}custom-paragraph{display:block;& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);margin-block:0;a{color:var(--color-text-link)}}}custom-summation{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& .custom-summation{border:1px solid var(--color-default-dark);border-radius:4px;margin:.75rem 0;overflow:hidden;& .summation-item{align-items:center;display:flex;margin:0;padding:.25rem 10px;&:nth-child(2n){background-color:var(--color-default-muted)}&.total{background-color:var(--color-default-default);border-top:1px solid var(--color-default-dark)}.summation-item-operator{margin-right:.5rem;text-align:center;width:1rem}.summation-item-title{flex:1;font-weight:var(--font-weight-default)}.summation-item-data{margin-left:8px}}}}custom-table{color:var(--color-text-default);display:block;font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& table{border:1px solid var(--color-default-dark);border-radius:4px;border-spacing:0;margin:.75rem 0;overflow:hidden;width:100%;& tr{page-break-inside:avoid}& td,& th{padding:8px 10px;page-break-inside:avoid;&:after{content:"";display:block;height:30px;margin-bottom:-30px}}& thead{& th{page-break-after:avoid;background-color:var(--color-default-default);border-bottom:1px solid var(--color-default-dark);font-weight:var(--font-weight-bold);line-height:var(--line-height-table-header);text-align:left}}& tbody{& tr{&:nth-child(2n){background-color:var(--color-default-muted)}}& tr:not(:last-of-type){& td{border-bottom:1px solid var(--color-default-dark)}}}}}custom-feedbacklist-data{@media screen{display:block}@media print{display:none}color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default);& details.feedback-details{border-radius:4px;margin:.75rem 0;overflow:hidden;& summary{cursor:pointer;padding:8px 16px;transition:var(--background-transition-default)}& .feedback-list{& .feedback-list-item{border-block-style:inset;border-bottom:1px solid rgba(0,0,0,.075);border-top:1px solid hsla(0,0%,100%,.075);padding:8px 16px;&:last-child{border-bottom:none}}}&.error{background-color:var(--color-error-muted);& summary{background-color:var(--color-error-default);color:#fff;&:hover{background-color:var(--color-error-light)}}}&.warning{background-color:var(--color-warning-muted);& summary{background-color:var(--color-warning-default);color:#fff;&:hover{background-color:var(--color-warning-light)}}}&.info{background-color:var(--color-info-muted);& summary{background-color:var(--color-info-default);color:#fff;&:hover{background-color:var(--color-info-light)}}}&.success{background-color:var(--color-success-muted);& summary{background-color:var(--color-success-default);color:#fff;&:hover{background-color:var(--color-success-light)}}}&.default{background-color:var(--color-default-muted);border:1px solid var(--color-default-dark);& summary{background-color:var(--color-default-default);color:var(--color-text-default);&:hover{background-color:var(--color-default-light)}}& .feedback-list{& .feedback-list-item{border-bottom:1px solid var(--color-default-dark);border-top:none;&:nth-child(odd){background-color:#fff}&:last-child{border-bottom:none}}}}}}custom-feedbacklist-validation-messages{@media screen{display:block;width:100%}@media print{display:none}}custom-field-adresse{display:block;page-break-inside:avoid}custom-grouplist-sjekklistekrav{& .sjekklistekrav-list{border:1px solid var(--color-default-dark);border-radius:4px;margin:.75rem 0;overflow:hidden}}custom-group-sjekklistekrav{&>div{padding:0 10px}&:nth-of-type(2n){&>div{background-color:var(--color-default-muted)}}}custom-header-text{display:block;width:100%;page-break-after:avoid;page-break-inside:avoid}custom-subheader-text{display:block;margin-top:-32px}custom-table-arbeidsplasser,custom-table-data,custom-table-eiendom,custom-table-omraaderisiko,custom-table-part,custom-table-plan{display:block;width:100%}@font-face{font-family:Roboto Flex;src:url(49c816770b639989d28b.woff2) format("woff2")}:root{--font-family-default:"Roboto Flex",Arial,sans-serif;--color-text-default:#1c1b1d;--color-text-link:#01579b;--background-muted:#f7f4f4;--color-error-muted:#ef535030;--color-error-light:#ef5350;--color-error-default:#d32f2f;--color-error-dark:#c62828;--color-warning-muted:#ff980030;--color-warning-light:#ff9800;--color-warning-default:#ed6c02;--color-warning-dark:#e65100;--color-success-muted:#4caf5030;--color-success-light:#4caf50;--color-success-default:#2e7d32;--color-success-dark:#1b5e20;--color-info-muted:#03a9f430;--color-info-light:#03a9f4;--color-info-default:#0288d1;--color-info-dark:#01579b;--color-default-muted:#fdfbfb;--color-default-light:#f9f7f7;--color-default-default:#f6f4f4;--color-default-dark:#e7e4e4;--font-size-default:16px;--font-size-h1:34px;--font-size-h2:28px;--font-size-h3:22px;--font-size-h4:18px;--font-weight-default:400;--font-weight-semibold:500;--font-weight-bold:600;--line-height-default:24px;--line-height-heading:1.1em;--line-height-table-header:20px;--margin-block-start-heading:1em;--margin-block-end-heading:0;--background-transition-default:background-color 150ms}body{background-color:#fff;color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);letter-spacing:normal;line-height:var(--line-height-default);-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;& main{& p{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);line-height:var(--line-height-default);&[class^=fds-]{font-family:var(--font-family-default)}}& a{color:var(--color-text-link)}& .fds-label{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-h3);font-weight:var(--font-weight-default);line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);page-break-after:avoid;page-break-inside:avoid}& .fds-table{border:1px solid var(--color-default-dark);border-radius:4px;border-spacing:0;overflow:hidden;width:100%;& tr{page-break-inside:avoid}& td,& th{padding:8px 12px;page-break-inside:avoid;&:after{content:"";display:block;height:30px;margin-bottom:-30px}}& thead{& th{font-family:var(--font-family-default);font-size:var(--font-size-default);page-break-after:avoid;background-color:var(--color-default-default);border-bottom:1px solid var(--color-default-dark);font-weight:var(--font-weight-bold);line-height:var(--line-height-table-header);text-align:left;&:first-of-type{border-top-left-radius:5px}&:last-of-type{border-top-right-radius:5px}}}& tbody{& tr{&:nth-child(2n){background-color:var(--color-default-muted)}&:not(:last-of-type){& td{border-bottom:1px solid var(--color-default-dark)}}&:last-of-type{& td{border-bottom:none;&:first-of-type{border-bottom-left-radius:5px}&:last-of-type{border-bottom-right-radius:5px}}}& td{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-default);font-weight:var(--font-weight-default);line-height:var(--line-height-default)}}}}}& h1,& h2,& h3,& h4,& h5,& h6{color:var(--color-text-default);page-break-after:avoid;display:inline-block;line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);&[class^=fds-]{font-family:var(--font-family-default)}}& h1{font-size:var(--font-size-h1)}& h1,& h2{font-weight:var(--font-weight-default)}& h2{font-size:var(--font-size-h2)}& h3{font-size:var(--font-size-h3);font-weight:var(--font-weight-default)}& h4{font-size:var(--font-size-h4);font-weight:var(--font-weight-semibold)}& a{color:var(--color-text-link)}& div[data-componenttype=AttachmentList] ul{margin-top:.3em;& li{margin-bottom:0;& [class^=fds-],& a,& span{color:var(--color-text-default);cursor:default;font-family:var(--font-family-default);font-size:1.1rem;font-weight:var(--font-weight-default);line-height:var(--line-height-default);pointer-events:none}}}}@media print{html{font-size:inherit!important;& body{& .fds-label{color:var(--color-text-default);font-family:var(--font-family-default);font-size:var(--font-size-h3);font-weight:var(--font-weight-default);line-height:var(--line-height-heading);margin-block-end:var(--margin-block-end-heading);margin-block-start:var(--margin-block-start-heading);page-break-after:avoid;page-break-inside:avoid}}}}@page{size:A4 portrait;margin-bottom:1.5cm;margin-left:1.25cm;margin-right:1.25cm;margin-top:1cm}#pdfView{&>h1:first-of-type{min-height:68px}&>div[data-testid=pdf-logo]{display:block;margin-bottom:0;min-height:68px;& h1{margin-top:0}& img{height:auto;position:absolute;right:0;top:0;width:85px}&:after{content:"";display:block}}}
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)}}class t{constructor(e){this.effekt=e?.effekt}}class s{constructor(e){this.effekt=e?.effekt}}class n{constructor(e){this.hensynBakBestemmelsen=e?.hensynBakBestemmelsen,this.vurderingHensynBakBestemmelsen=e?.vurderingHensynBakBestemmelsen,this.vurderingHensynOverordnet=e?.vurderingHensynOverordnet,this.fordeler=e?.fordeler&&new t(e.fordeler),this.ulemper=e?.ulemper&&new s(e.ulemper),this.samletBegrunnelse=e?.samletBegrunnelse}}class r{constructor(e){this.kodeverdi=e?.kodeverdi,this.kodebeskrivelse=e?.kodebeskrivelse}}class i{constructor(e){this.dispensasjonTittel=e?.dispensasjonTittel&&new r(e.dispensasjonTittel),this.inngangsbeskrivelse=e?.inngangsbeskrivelse&&new r(e.inngangsbeskrivelse),this.annenInngangsbeskrivelse=e?.annenInngangsbeskrivelse,this.beskrivelse=e?.beskrivelse}}class a{constructor(e){this.planidentifikasjon=e?.planidentifikasjon}}class o{constructor(e){this.nummerering=e?.nummerering}}class l{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new a(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new o(e.planbestemmelse)}}class u{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new r(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new l(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class d{constructor(e){this.adresselinje1=e?.adresselinje1,this.adresselinje2=e?.adresselinje2,this.adresselinje3=e?.adresselinje3,this.postnr=e?.postnr,this.poststed=e?.poststed,this.kommunenavn=e?.kommunenavn||null}}class c{constructor(e){this.gaardsnummer=e?.gaardsnummer,this.bruksnummer=e?.bruksnummer,this.seksjonsnummer=e?.seksjonsnummer,this.festenummer=e?.festenummer}}class m{constructor(e){this.adresse=new d(e?.adresse?e.adresse:e),this.eiendomsidentifikasjon=e?.eiendomsidentifikasjon&&new c(e.eiendomsidentifikasjon),this.bolignummer=e?.bolignummer,this.bygningsnummer=e?.bygningsnummer,this.kommunenavn=e?.kommunenavn||null}}class g{constructor(e){this.eiendom=e?.eiendom&&e.eiendom.map(e=>new m(e))}}class p{constructor(e){this.saksaar=e?.saksaar,this.sakssekvensnummer=e?.sakssekvensnummer}}class h{constructor(e){this.ftbId=e?.ftbId,this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}const f=["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-kode","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-grouplist-varsling","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-planlagte-loefteinnretninger","custom-list-tiltaks-formaal","custom-list-vedlegg","custom-paragraph-text","custom-subheader-text","custom-summation","custom-summation-arealdisponering","custom-summation-data","custom-table-arbeidsplasser","custom-table-data","custom-table-eiendom","custom-table-omraaderisiko","custom-table-part","custom-table-plan","custom-dispensasjon","custom-gjennomfoeringsplan"];function y(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 k(e){const t="number"==typeof e?e:Number(e);return"number"==typeof t&&!isNaN(t)&&t>0}function T(e,t){for(let s in t)e.style[s]=t[s]}function B(e){const t=e?.resourceValues?.emptyFieldText;return t||""}function b(e=""){return`${e}${Date.now().toString(36)}${Math.random().toString(36).substring(2,10)}`}function v(e,t){if(!function(e){return f.includes(e)}(e))throw new Error(`Invalid tag name ${e}. Must be one of: ${f.join(", ")}`);const s=document.createElement(e);return function(e,t){for(const s in t)e.setAttribute(s,t[s])}(s,{...t,tagName:e}),s}function x(e,t){const s=document.createElement("div"),n=document.createElement("div");n.appendChild(e),s.appendChild(n);const r={flexBasis:"100%",maxWidth:"100%"};if(y(t)){const e=function(e){if(e){const t=e.xs||12,s=e.sm||t,n=e.md||s,r=e.lg||n,i=e.xl||r;return Math.min(t/12*100,s/12*100,n/12*100,r/12*100,i/12*100)}return 100}(t);r.flexBasis=`${e}%`,r.maxWidth=`${e}%`,r.flexGrow="0"}return T(s,{...r,padding:"0.75rem 0px"}),s}function F(){const e=document.createElement("div");return T(e,{display:"flex",flexFlow:"wrap",justifyContent:"start",alignItems:"flex-start"}),e}function V(){return"undefined"!=typeof window&&window.textResources?window.textResources:[]}function C(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 E(e){const t="true"===e.getAttribute("isChildComponent"),s=e?.parentElement?.parentElement;return t?e:s||null}function w(e){const t=V(),s=t?.resources?.find(t=>t.id===e)?.value;return s||e}function M(e){const t={};for(const s in e)t[s]=w(e[s]);return t}function j(e){return e.isChildComponent?e.resourceValues?.data:e.formData?.simpleBinding||e.formData?.data}function L(e){return e.isChildComponent?e.resourceValues?.dataTitle:null!=e.formData?.dataTitle?e.formData?.dataTitle:void 0}function I(e,t){return y(e?.resourceValues?.[t])?e.resourceValues?.[t]:w(e?.resourceBindings?.[t])}function D(e,t){return t.filter(e=>!!e).forEach(t=>{t instanceof HTMLElement?e.appendChild(t):e.innerHTML+=t}),e}class S{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(y(e?.adresse))return new d(e.adresse)}}class H{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new r(e.koordinatsystem),this.koordinater=e?.koordinater}}class A{constructor(e){this.posisjon=e?.posisjon&&new H(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new r(e.vertikalnivaa)}}class R{constructor(e){const t=e?this.getTypeFromProps(e):null;t&&(this.type=t)}getTypeFromProps(e){return e&&y(e?.type)?{kode:this.getKodeFromType(e.type)}:null}getKodeFromType(e){return Array.isArray(e?.kode)&&e?.kode?.length?e?.kode?.map(e=>new r(e)):null}}class N{constructor(e){this.oenskesVarigDispensasjon=e?.oenskesVarigDispensasjon,this.oensketVarighetTil=e?.oensketVarighetTil}}class P{constructor(e){this.dispensasjonBeskrivelse=e?.dispensasjonBeskrivelse&&new i(e.dispensasjonBeskrivelse),this.dispensasjonReferanse=e?.dispensasjonReferanse,this.soeknadstype=e?.soeknadstype&&new r(e.soeknadstype),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new p(e.kommunensSaksnummer),this.metadata=e?.metadata&&new h(e.metadata),this.eiendomByggested=e?.eiendomByggested&&new g(e.eiendomByggested),this.tiltakstyper=e?.tiltakstyper&&new R(e.tiltakstyper),this.tiltakshaver=e?.tiltakshaver&&new S(e.tiltakshaver),this.ansvarligSoeker=e?.ansvarligSoeker&&new S(e.ansvarligSoeker),this.dispensasjonFra=e?.dispensasjonFra&&new u(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new A(e.stedfesting),this.varighet=e?.varighet&&new N(e.varighet),this.begrunnelse=e?.begrunnelse&&new n(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 K(e){return!!e&&Object.values(e).some(e=>e.length>0)}function $(e,t,s=new O){for(const n in t)for(const r in t[n]){const i=t[n][r],a=e?.resources?.find(e=>e.id===i);a?""===a.value&&s.info.push(`Empty text resource for "${r}" with id: "${i}" in component "${n}"`):s.error.push(`Missing text resource for "${r}" with id: "${i}" in component "${n}"`)}return s}class z extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(),n=!this.hasContent(t),r=this.dataIsPlanBestemmelseType(t),i=this.getValidationMessages(s);this.isEmpty=n,this.isPlanBestemmelseType=r,this.validationMessages=i,this.hasValidationMessages=K(i),this.resourceBindings=s,this.resourceValues={data:n?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValueFromFormData(e){return y(e?.formData)&&new P(e.formData)}getValidationMessages(e){return $("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"},ansvarligSoekerAdresse:{title:"resource.ansvarligSoeker.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 U=["default"],J={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"}}},q={dateTime:{default:"no-NO"},date:{default:"no-NO"},time:{default:"no-NO"}},G=["h1","h2","h3","h4","h5","h6"];function Z(e){return U.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=q.dateTime[t],n=J.dateTime[s]||J.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,r=parseInt(t[3],10),i=new Date(Date.UTC(r,n,s));return i.getFullYear()===r&&i.getMonth()===n&&i.getDate()===s?i.toISOString():null}(e)),t=Z(t);const s=q.date[t],n=J.date[s]||J.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),r=t[3]?parseInt(t[3],10):0;return s<0||s>23||n<0||n>59||r<0||r>59?null:new Date(Date.UTC(1970,0,1,s,n,r)).toISOString()}(e)),t=Z(t);const s=q.time[t],n=J.time[s]||J.time.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);default:return e}}function _(e){return y(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 y(e)}getValueFromFormData(e){return Y(j(e),e?.format)}}class X extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.isEmpty=n,this.resourceValues={data:t}}hasContent(e){return y(e)}getValueFromFormData(e){return j(e)}getValidationMessages(e){return $("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 ee extends e{constructor(e){super(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 y(e)}getValueFromFormData(e){return j(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 y(e)}getValueFromFormData(e){return j(e)}}class ne 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 y(e)}getValueFromFormData(e){return j(e)}}class re 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 y(e)}getValueFromFormData(e){const t=j(e);return new O(t)}}class ie extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return y(e?.resourceValues?.data)}}class ae extends e{constructor(e){super(e);const t=this.getTextResourceBindings(e),s=this.getValueFromFormData(e,t?.adresse),n=this.getValidationMessages(t);this.validationMessages=n,this.hasValidationMessages=K(n);const r=!this.hasContent(s);this.isEmpty=r,this.resourceValues={title:I(e,"title"),data:r?w(t?.adresse?.emptyFieldText):s}}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(" ")}formatKommunenavn(e){return e?.kommunenavn?`${e?.kommunenavn}`:""}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}formatAdresse(e,t){const s=this.formatAdresselinje(e),n=this.formatZipCity(e),r=this.formatKommunenavn(e),i=w(t?.emptyFieldText)||"";return s?.length&&n?.length?`${s}\n${n}`:s?.length?s:n?.length?n:r?.length?`${i}\n${r}`:""}getValueFromFormData(e,t){const s=j(e),n=new d(s);return this.formatAdresse(n,t)}hasContent(e){return y(e)}getTextResourceBindings(e){const t={adresse:{}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.adresse={title:e?.resourceBindings?.title||"resource.adresse.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.adresse={...t?.adresse,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.adresse.emptyFieldText.default"}),t}}class oe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValueFromFormData(e){const t=e?.id?.length&&"string"==typeof e?.id?e.id:"custom-field-boolean-data",s=j(e),n=k(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||n?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 le extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValueFromFormData(e){const t=e?.id||"custom-field-boolean-text",s=j(e),n=function(e){return{trueText:e.resourceValues?.trueText||w(e?.resourceBindings?.trueText),falseText:e.resourceValues?.falseText||w(e?.resourceBindings?.falseText),defaultText:e.resourceValues?.defaultText||w(e?.resourceBindings?.defaultText)}}(e),r={trueText:"Ja",falseText:"Nei",defaultText:""};return C(n,r,["trueText","falseText","defaultText"],t),!0===s||"true"===s?void 0!==n?.trueText&&null!==n.trueText?n.trueText:r.trueText:!1===s||"false"===s?void 0!==n?.falseText&&null!==n.falseText?n.falseText:r.falseText:n?.defaultText?n.defaultText:r.defaultText}}class ue extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return k(e)}getValueFromFormData(e){const t=j(e);return t&&Array.isArray(t)?t.length:0}}class de extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=L(e),n=!this.hasContent(t),r=!this.hasContent(s);this.isEmpty=n,this.resourceValues={title:!e?.hideTitle&&(!r&&s||this.getTextData(e)),data:n?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValueFromFormData(e){return Y(j(e),e?.format)}getTextData(e){const t=I(e,"title"),s=e?.text;return y(t)?t:s}}class ce extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}formatKode(e){return y(e?.kodeverdi)&&y(e?.kodebeskrivelse)?`${e.kodeverdi}: ${e.kodebeskrivelse}`:y(e?.kodeverdi)?e.kodeverdi:y(e?.kodebeskrivelse)?e.kodebeskrivelse:""}getValueFromFormData(e){const t=j(e),s=new r(t);return this.formatKode(s)}}class me extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}formatKommunensSaksnummer(e){return[e?.saksaar?.toString(),e?.sakssekvensnummer?.toString()].filter(e=>e?.length).join("/")}getValueFromFormData(e){const t=j(e),s=new p(t);return this.formatKommunensSaksnummer(s)}}class ge 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 y(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),s=this.hasContent(e?.dataTitleItemKey),n=j(e);if(t&&s){const t=y(e?.dataTitleItemKey)?this.getListItemsFromKey(n,e?.dataTitleItemKey):n,s=y(e?.dataItemKey)?this.getListItemsFromKey(n,e?.dataItemKey):n,r=Math.min(t.length,s.length);return Array.from({length:r},(e,n)=>({title:t[n],data:s[n]}))}}}class pe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:w(e?.resourceBindings?.title),data:s?w(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=j(e),s=new S(t);return this.formatName(s,this.hideOrgNr)}hasContent(e){return y(e)}}class he{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class fe 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:w(e?.resourceBindings?.title),data:s?w(e?.resourceBindings?.emptyFieldText):t}}hasContent(e){return y(e)}formatProsjekt(e){const t=y(e?.prosjektnr)&&`(${e.prosjektnr?.toString()})`;return[e?.prosjektnavn?.toString(),t].filter(e=>e?.length).join(" ")}getValueFromFormData(e){const t=new he(e?.formData?.data);return this.formatProsjekt(t)}}class ye{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}class ke extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:w(e?.resourceBindings?.title),data:s?w(e?.resourceBindings?.emptyFieldText):t}}formatPhoneNumbers(e){return[e.telefonnummer,e.mobilnummer].filter(e=>e?.length).join("\n")}getValueFromFormData(e){const t=j(e),s=new ye(t);return this.formatPhoneNumbers(s)}hasContent(e){return y(e)}}class Te{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}class Be extends e{constructor(e){super(e);const t=this.getResourceBindings(e),s=this.getValueFromFormData(e,t?.utfallSvarStatus),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceValues={title:w(t?.utfallSvarStatus?.title),data:n?I(e,"emptyFieldText"):s}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getStatusText(e,t,s){const n=M(t),r={erUtfallBesvaresSenere:"Besvares senere",erUtfallBesvart:"Svar innsendt tidligere",status:"Besvares nå"};return C(n,r,["erUtfallBesvaresSenere","erUtfallBesvart","status"],s),e?.erUtfallBesvaresSenere?null!=n?.erUtfallBesvaresSenere?n.erUtfallBesvaresSenere:r.erUtfallBesvaresSenere:e?.erUtfallBesvart?null!=n?.erUtfallBesvart?n.erUtfallBesvart:r.erUtfallBesvart:n?.status?n.status:r.status}getValueFromFormData(e,t){const s=j(e),n=new Te(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 be{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new r(e.vedleggstype)}}class ve{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map(e=>new be(e)):void 0}}class xe{constructor(e){this.kommentar=e?.kommentar,this.tema=e?.tema?new r(e.tema):void 0,this.tittel=e?.tittel,this.vedleggsliste=e?.vedleggsliste?new ve(e.vedleggsliste):void 0}}class Fe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s?.ettersending||{},this.resourceValues={data:n?w(s?.ettersending?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return new xe(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),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceValues={title:w(s?.ettersendinger?.title),data:n?w(s?.ettersendinger?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){return j(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 Ce{constructor(e){this.navn=e?.navn,this.plantype=e?.plantype&&new r(e.plantype)}}class Ee{constructor(e){this.plan=e?.plan?e.plan.map(e=>new Ce(e)):void 0}}class we extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={navn:s?.navn,plantype:s?.plantype},this.resourceValues={title:w(s?.andrePlaner?.title),data:n?w(s?.andrePlaner?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e),s=new Ee({plan:t});return s?.plan}getResourceBindings(e){const t={andrePlaner:{},navn:{title:e?.resourceBindings?.navn?.title||"resource.planer.andrePlaner.plan.navn.title"},plantype:{title:e?.resourceBindings?.plantype?.title||"resource.planer.andrePlaner.plan.plantype.title"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.andrePlaner={...t.andrePlaner,title:e?.resourceBindings?.title||"resource.planer.andrePlaner.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.andrePlaner={...t.andrePlaner,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Me{constructor(e){this.sjekklistepunktsvar=e?.sjekklistepunktsvar,this.sjekklistepunkt=e?.sjekklistepunkt&&new r(e.sjekklistepunkt),e?.dokumentasjon&&(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),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s?.sjekklistekrav||{},this.resourceValues={title:w(s?.sjekklistekrav?.title),data:n?w(s?.sjekklistekrav?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e),s=t?.map(e=>new Me(e));return s}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 Le extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceValues={title:w(s?.utfallSvar?.title),data:n?w(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){return j(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 Ie{constructor(e){this.kodeverdi=e?.kodeverdi}}class De{constructor(e){this.beskrivelse=e?.beskrivelse,this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart,this.kommentar=e?.kommentar,this.tema=e?.tema?new r(e.tema):void 0,this.tittel=e?.tittel,this.utfallType=e?.utfallType?new Ie(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new ve(e.vedleggsliste):void 0}}class Se extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return this.groupArrayItemsByUtfallType(t)}groupArrayItemsByUtfallType(e){return y(e)?e.reduce((e,t)=>{const s=t?.utfallType?.kodeverdi;return s?.length?(e[s]||(e[s]=[]),e[s].push(new De(t)),e):e},{}):{}}}class He{constructor(e){this.foreliggerMerknader=e?.foreliggerMerknader,this.fritattFraNabovarsling=e?.fritattFraNabovarsling}}class Ae extends e{constructor(e){super(e);const t=this.getResourceBindings(e),s=this.getValueFromFormData(e,t),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={title:t?.varsling?.title,emptyFieldText:t?.varsling?.emptyFieldText,trueText:t?.varsling?.trueText,falseText:t?.varsling?.falseText,defaultText:t?.varsling?.defaultText},this.resourceValues={data:n?w(t?.varsling?.emptyFieldText):s}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e,t){const s=j(e),n=new He(s);return this.getSjekklistekravItems(n,t)}getSjekklistekravItems(e,t){const s=[],n=this.getSjekklistekravForFritattFraNabovarsling(e,t),r=this.getSjekklistekravForForeliggerMerknader(e,t);return n&&s.push(n),r&&s.push(r),s.length>0?s:null}getSjekklistekravForFritattFraNabovarsling(e,t){if(y(e.fritattFraNabovarsling)){const s=e.fritattFraNabovarsling,n=w(t?.fritattFraNabovarsling?.title);return new Me({sjekklistepunktsvar:s,sjekklistepunkt:{kodebeskrivelse:n}})}}getSjekklistekravForForeliggerMerknader(e,t){if(y(e.foreliggerMerknader)){const s=e.foreliggerMerknader,n=w(t?.foreliggerMerknader?.title);return new Me({sjekklistepunktsvar:s,sjekklistepunkt:{kodebeskrivelse:n}})}}getResourceBindings(e){const t={varsling:{trueText:e?.resourceBindings?.trueText||"resource.trueText.default",falseText:e?.resourceBindings?.falseText||"resource.falseText.default",defaultText:e?.resourceBindings?.defaultText||"resource.defaultText.default"},fritattFraNabovarsling:{title:e?.resourceBindings?.fritattFraNabovarsling?.title||"resource.varsling.fritattFraNabovarsling.title"},foreliggerMerknader:{title:e?.resourceBindings?.foreliggerMerknader?.title||"resource.varsling.foreliggerMerknader.title"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.varsling={...t.varsling,title:e?.resourceBindings?.title||"resource.varsling.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.varsling={...t.varsling,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Re extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s||{},this.resourceValues={data:n?w(s?.plan?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return new Ce(t)}getResourceBindings(e){const t={navn:{title:e?.resourceBindings?.navn?.title||"resource.planer.andrePlaner.plan.navn.title"},plantype:{title:e?.resourceBindings?.plantype?.title||"resource.planer.andrePlaner.plan.plantype.title"}};return 1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.plan={emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Ne extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s?.sjekklistekrav||{},this.resourceValues={data:n?w(s?.sjekklistekrav?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return new Me(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 Pe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s?.utfallSvar||{},this.resourceValues={data:n?w(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return new De(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 Oe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={title:s?.utfallSvarType?.title},this.resourceValues={data:n?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){return j(e)}getResourceBindings(e){const t=e?.resourceValues?.utfallType;return{utfallSvarType:{title:`resource.utfallBesvarelse.utfallSvar.${t?.toLowerCase()}.header`}}}}class Ke extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues,this.size=e?.size}hasContent(e){return y(e?.resourceValues?.title)}}class $e extends e{constructor(e){super(e),this.size=e?.size,this.resourceValues={title:I(e,"title")}}}class ze extends e{constructor(e){super(e),this.size=e?.size;const t=I(e,"title"),s=L(e);this.resourceValues={title:[t||"",s||""].filter(Boolean).join(" ")}}}class Ue extends e{constructor(e){super(e),this.isEmpty=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return y(e?.resourceValues?.data)}}class Je extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getListItemsFromKey(e,t){return Array.isArray(e)&&e.length?e.map(e=>e?.[t]):[]}getValueFromFormData(e){const t=j(e);return y(e?.itemKey)?this.getListItemsFromKey(t,e?.itemKey):t}}class qe{constructor(e){this.erLoefteinnretningIBygning=e?.erLoefteinnretningIBygning,this.planleggesLoefteinnretningIBygning=e?.planleggesLoefteinnretningIBygning,this.planleggesHeis=e?.planleggesHeis,this.planleggesTrappeheis=e?.planleggesTrappeheis,this.planleggesRulletrapp=e?.planleggesRulletrapp,this.planleggesLoefteplattform=e?.planleggesLoefteplattform}}class Ge{constructor(e,t){this.resourceValues={data:this.getPlanlagteLoefteinnretningItems(e,t)}}getPlanlagteLoefteinnretningItems(e,t){return[!0===e?.planleggesHeis?w(t?.planleggesHeis?.title):null,!0===e?.planleggesLoefteplattform?w(t?.planleggesLoefteplattform?.title):null,!0===e?.planleggesRulletrapp?w(t?.planleggesRulletrapp?.title):null,!0===e?.planleggesTrappeheis?w(t?.planleggesTrappeheis?.title):null].filter(e=>null!==e)}}class Ze extends e{constructor(e){super(e);const t=this.getTextResourceBindings(e),s=this.getValueFromFormData(e,t),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={emptyFieldText:t?.loefteinnretninger?.emptyFieldText||void 0},this.resourceValues={title:!e?.hideTitle&&w(t?.loefteinnretninger?.title),data:n?w(t?.loefteinnretninger?.emptyFieldText):s}}getValueFromFormData(e,t){const s=j(e);if(!y(s))return;const n=new qe(s),r=new Ge(n,t);return y(r?.resourceValues?.data)?r.resourceValues.data:void 0}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}getTextResourceBindings(e){const t={planleggesHeis:{title:e?.resourceBindings?.planleggesHeis?.title||"resource.rammebetingelser.loefteinnretninger.planleggesHeis.title"},planleggesLoefteplattform:{title:e?.resourceBindings?.planleggesLoefteplattform?.title||"resource.rammebetingelser.loefteinnretninger.planleggesLoefteplattform.title"},planleggesRulletrapp:{title:e?.resourceBindings?.planleggesRulletrapp?.title||"resource.rammebetingelser.loefteinnretninger.planleggesRulletrapp.title"},planleggesTrappeheis:{title:e?.resourceBindings?.planleggesTrappeheis?.title||"resource.rammebetingelser.loefteinnretninger.planleggesTrappeheis.title"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.loefteinnretninger={title:e?.resourceBindings?.title||"resource.loefteinnretninger.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.loefteinnretninger={...t.loefteinnretninger,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class We extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getListItemsFromKey(e){const t=e?.data;return Array.isArray(t)&&t.length?t.map(t=>"Annet"===t?.kodebeskrivelse?`${t?.kodebeskrivelse}: ${e?.simpleBinding}`:t?.kodebeskrivelse):[]}getValueFromFormData(e){const t=this.getComponentDataValue(e);return this.getListItemsFromKey(t,e?.itemKey)}getComponentDataValue(e){return e.isChildComponent?e.resourceValues?.data:{simpleBinding:e.formData?.simpleBinding,data:e.formData?.data}}}class Ye extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(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 be(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=j(e);return this.getAttachmentListItems(t)}}class _e extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues}hasContent(e){return y(e?.resourceValues?.title)}}class Qe extends e{constructor(e){super(e),this.resourceValues={title:this.getTextData(e)}}getTextData(e){const t=I(e,"title"),s=e?.text;return y(t)?t:s}}class Xe extends e{constructor(e){super(e),this.resourceValues={title:I(e,"title")}}}class et extends e{constructor(e){super(e),this.isEmpty=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return y(e?.resourceValues?.data)}}class tt{constructor(e){this.tomtearealByggeomraade=e?.tomtearealByggeomraade,this.tomtearealSomTrekkesFra=e?.tomtearealSomTrekkesFra,this.tomtearealBeregnet=e?.tomtearealBeregnet,this.beregnetMaksByggeareal=e?.beregnetMaksByggeareal,this.arealBebyggelseEksisterende=e?.arealBebyggelseEksisterende,this.arealBebyggelseSomSkalRives=e?.arealBebyggelseSomSkalRives,this.arealBebyggelseNytt=e?.arealBebyggelseNytt,this.parkeringsarealTerreng=e?.parkeringsarealTerreng,this.arealSumByggesak=e?.arealSumByggesak,this.beregnetGradAvUtnytting=e?.beregnetGradAvUtnytting}}class st{constructor(e,t){this.tomtearealet={resourceBindings:{title:t?.tomtearealet?.title},resourceValues:{data:this.getTomtearealetItems(e,t)}},this.bebyggelsen={resourceBindings:{title:t?.bebyggelsen?.title},resourceValues:{data:this.getBebyggelsenItems(e,t)}}}getBebyggelsenItems(e,t){return[y(e?.beregnetMaksByggeareal)?{resourceValues:{data:e?.beregnetMaksByggeareal,isTotal:!1},resourceBindings:t?.beregnetMaksByggeareal}:null,y(e?.arealBebyggelseEksisterende)?{resourceValues:{data:e?.arealBebyggelseEksisterende,isTotal:!1},resourceBindings:t?.arealBebyggelseEksisterende}:null,y(e?.arealBebyggelseSomSkalRives)?{resourceValues:{data:e?.arealBebyggelseSomSkalRives,isTotal:!1},resourceBindings:t?.arealBebyggelseSomSkalRives}:null,y(e?.arealBebyggelseNytt)?{resourceValues:{data:e?.arealBebyggelseNytt,isTotal:!1},resourceBindings:t?.arealBebyggelseNytt}:null,y(e?.parkeringsarealTerreng)?{resourceValues:{data:e?.parkeringsarealTerreng,isTotal:!1},resourceBindings:t?.parkeringsarealTerreng}:null,y(e?.arealSumByggesak)?{resourceValues:{data:e?.arealSumByggesak,isTotal:!0},resourceBindings:t?.arealSumByggesak}:null].filter(e=>null!==e)}getTomtearealetItems(e,t){return[y(e?.tomtearealByggeomraade)?{resourceValues:{data:e?.tomtearealByggeomraade,isTotal:!1},resourceBindings:t?.tomtearealByggeomraade}:null,y(e?.tomtearealSomTrekkesFra)?{resourceValues:{data:e?.tomtearealSomTrekkesFra,isTotal:!1},resourceBindings:t?.tomtearealSomTrekkesFra}:null,y(e?.tomtearealBeregnet)?{resourceValues:{data:e?.tomtearealBeregnet,isTotal:!0},resourceBindings:t?.tomtearealBeregnet}:null].filter(e=>null!==e)}}class nt extends e{constructor(e){super(e);const t=this.getTextResourceBindings(e),s=this.getValueFromFormData(e,t),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={emptyFieldText:t?.arealdisponering?.emptyFieldText||void 0},this.resourceValues={title:!e?.hideTitle&&w(t?.arealdisponering?.title),data:n?w(t?.arealdisponering?.emptyFieldText):s}}getValueFromFormData(e,t){const s=j(e);if(!y(s))return;const n=new tt(s),r=new st(n,t);return this.hasArealdisponeringSummationProps(r)?r:void 0}hasArealdisponeringSummationProps(e){return this.hasBebyggelsenData(e)||this.hasTomtearealetData(e)}hasBebyggelsenData(e){return y(e?.bebyggelsen?.resourceValues?.data)}hasTomtearealetData(e){return y(e?.tomtearealet?.resourceValues?.data)}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}getTextResourceBindings(e){const t={tomtearealet:{title:e?.resourceBindings?.tomtearealet?.title||"resource.rammebetingelser.arealdisponering.tomtearealet.title"},bebyggelsen:{title:e?.resourceBindings?.bebyggelsen?.title||"resource.rammebetingelser.arealdisponering.bebyggelsen.title"},arealBebyggelseEksisterende:{title:e?.resourceBindings?.arealBebyggelseEksisterende?.title||"resource.rammebetingelser.arealdisponering.arealBebyggelseEksisterende.title",emptyFieldText:e?.resourceBindings?.arealBebyggelseEksisterende?.emptyFieldText||"resource.emptyFieldText.default",unit:"resource.unit.meterSquared"},arealBebyggelseNytt:{title:e?.resourceBindings?.arealBebyggelseNytt?.title||"resource.rammebetingelser.arealdisponering.arealBebyggelseNytt.title",emptyFieldText:e?.resourceBindings?.arealBebyggelseNytt?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.plus",unit:"resource.unit.meterSquared"},arealBebyggelseSomSkalRives:{title:e?.resourceBindings?.arealBebyggelseSomSkalRives?.title||"resource.rammebetingelser.arealdisponering.arealBebyggelseSomSkalRives.title",emptyFieldText:e?.resourceBindings?.arealBebyggelseSomSkalRives?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.minus",unit:"resource.unit.meterSquared"},arealSumByggesak:{title:e?.resourceBindings?.arealSumByggesak?.title||"resource.rammebetingelser.arealdisponering.arealSumByggesak.title",emptyFieldText:e?.resourceBindings?.arealSumByggesak?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.equals",unit:"resource.unit.meterSquared"},beregnetMaksByggeareal:{title:e?.resourceBindings?.beregnetMaksByggeareal?.title||"resource.rammebetingelser.arealdisponering.beregnetMaksByggeareal.title",emptyFieldText:e?.resourceBindings?.beregnetMaksByggeareal?.emptyFieldText||"resource.emptyFieldText.default",unit:"resource.unit.meterSquared"},parkeringsarealTerreng:{title:e?.resourceBindings?.parkeringsarealTerreng?.title||"resource.rammebetingelser.arealdisponering.parkeringsarealTerreng.title",emptyFieldText:e?.resourceBindings?.parkeringsarealTerreng?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.plus",unit:"resource.unit.meterSquared"},tomtearealBeregnet:{title:e?.resourceBindings?.tomtearealBeregnet?.title||"resource.rammebetingelser.arealdisponering.tomtearealBeregnet.title",emptyFieldText:e?.resourceBindings?.tomtearealBeregnet?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.equals",unit:"resource.unit.meterSquared"},tomtearealByggeomraade:{title:e?.resourceBindings?.tomtearealByggeomraade?.title||"resource.rammebetingelser.arealdisponering.tomtearealByggeomraade.title",emptyFieldText:e?.resourceBindings?.tomtearealByggeomraade?.emptyFieldText||"resource.emptyFieldText.default",unit:"resource.unit.meterSquared"},tomtearealSomTrekkesFra:{title:e?.resourceBindings?.tomtearealSomTrekkesFra?.title||"resource.rammebetingelser.arealdisponering.tomtearealSomTrekkesFra.title",emptyFieldText:e?.resourceBindings?.tomtearealSomTrekkesFra?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.minus",unit:"resource.unit.meterSquared"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.arealdisponering={...t.arealdisponering,title:e?.resourceBindings?.title||"resource.arealdisponering.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.arealdisponering={...t.arealdisponering,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class rt extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:w(e?.resourceBindings?.title),data:s?w(e?.resourceBindings?.emptyFieldText):t}}getResourcesForDataItems(e){return Array.isArray(e)?e.map(e=>({resourceValues:{...e.resourceValues,...M(e?.resourceBindings)}})):[]}getValueFromFormData(e){const t=j(e),s=this.getResourcesForDataItems(t);return y(s)?s:[]}hasContent(e){return y(e)}}class it extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return y(e?.resourceValues?.data)}}class at{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 ot extends e{constructor(e){super(e);const t=["eksisterende","faste","framtidige","midlertidige","utleieBygg"],s=this.getTextResourceBindings(e,t),n=this.getValueFromFormData(e,t,s),r=!this.hasContent(n),i=this.getValidationMessages(s);this.isEmpty=r,this.validationMessages=i,this.hasValidationMessages=K(i),this.resourceBindings=s,this.resourceValues={data:r?w(e?.resourceBindings?.emptyFieldText):n}}getValueFromFormData(e,t,s){const n=j(e);if(!y(n))return;const r=new at(n);return this.hasArbeidsplasserBeroertProps(r,t)?this.getArbeidsplasserBeroertArray(r,t,s):void 0}getArbeidsplasserBeroertArray(e,t,s){return t.map(t=>({title:w(s[t]?.title),value:e[t]?w(s[t]?.trueText):w(s[t]?.falseText)}))}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(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 lt 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=K(n),this.resourceValues={title:w(e?.resourceBindings?.title),data:s?w(e?.resourceBindings?.emptyFieldText):t}}getValueFromFormData(e){const t=j(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:w(t),props:e.props}})}(t);var n;return e.showRowNumbers&&s.unshift({text:(n=e,w(n?.resourceBindings?.rowNumberTitle)||"#")}),s}getTableRowsFromProps(e,t){const s=function(e,t){return!Array.isArray(t)&&(t=[t]),t.map(t=>{const s=[];return e.forEach(e=>{const n=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,i=w(r),a={resourceBindings:e.resourceBindings,resourceValues:{data:n},format:e.format,hideTitle:!0,tagName:e.tagName,isChildComponent:!0};y(i)&&(a.resourceValues.emptyFieldText=i),s.push(a)}),s})}(e?.tableColumns||[],t),n=this.removeEmptyTableRows(s);return e.showRowNumbers?n.map((e,t)=>[{tagName:"custom-field-data",hideTitle:!0,isChildComponent:!0,resourceValues:{data:t+1}},...e]):n}getValidationMessagesFromProps(e){return function(e,t=new O){const s=V();return e.forEach((e,n)=>{Object.keys(e?.textResourceBindings||{}).forEach(r=>{const i=s?.resources?.find(t=>t.id===e.textResourceBindings[r]);i?""===i.value&&t.info.push(`Empty text resource binding with id: "${e.textResourceBindings[r]}" for "${r}" at table column [${n}]`):t.error.push(`Missing text resource binding with id: "${e.textResourceBindings[r]}" for "${r}" at table column [${n}]`)})}),t}(e?.tableColumns)}removeEmptyTableRows(e){return Array.isArray(e)?e.map(e=>{const t=e.map(e=>Rt(e));return t.filter(e=>!e?.isEmpty).length>0?t:null}).filter(e=>null!==e):[]}hasContent(e){return y(e)}}class ut extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.resourceValues={data:n?w(s?.eiendomByggested?.emptyFieldText):t}}getValueFromFormData(e){const t=j(e);return this.getEiendomListFromData(t)}getEiendomListFromData(e){if(y(e))return e.map(e=>new m(e)).filter(e=>this.hasEiendomValue(e))}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}hasKommunenavn(e){return y(e?.kommunenavn)}hasZipCodeOrCity(e){return y(e?.adresse?.postnr)||y(e?.adresse?.poststed)}hasAdresseLinje(e){return y(e?.adresse?.adresselinje1)||y(e?.adresse?.adresselinje2)||y(e?.adresse?.adresselinje3)}hasAdresse(e){return this.hasAdresseLinje(e)||this.hasZipCodeOrCity(e)||this.hasKommunenavn(e)}hasEiendomNummerField(e){return y(e?.bolignummer)||y(e?.bygningsnummer)||y(e?.eiendomsidentifikasjon?.gaardsnummer)||y(e?.eiendomsidentifikasjon?.bruksnummer)||y(e?.eiendomsidentifikasjon?.seksjonsnummer)||y(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 dt{constructor(e){this.risikotype=e?.risikotype&&new r(e.risikotype),this.sikkerhetsklasse=e?.sikkerhetsklasse&&new r(e.sikkerhetsklasse)}}class ct extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.resourceValues={data:n?w(s?.eiendomByggested?.emptyFieldText):t}}getValueFromFormData(e){const t=j(e);return this.getOmraaderisikoListFromData(t)}getOmraaderisikoListFromData(e){if(y(e))return Array.isArray(e)?e.map(e=>new dt(e)).filter(e=>this.hasOmraaderisikoValue(e)):[]}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}hasRisikotype(e){return y(e?.risikotype?.kodebeskrivelse)}hasSikkerhetsklasse(e){return y(e?.sikkerhetsklasse?.kodebeskrivelse)}hasOmraaderisikoValue(e){return this.hasRisikotype(e)||this.hasSikkerhetsklasse(e)}getTextResourceBindings(e){const t={risikotype:{title:e?.resourceBindings?.risikotype?.title||"resource.kravTilByggegrunn.muligeOmraadeRisikoer.omraadeRisiko.risikotype.title",emptyFieldText:e?.resourceBindings?.risikotype?.emptyFieldText||"resource.emptyFieldText.default"},sikkerhetsklasse:{title:e?.resourceBindings?.sikkerhetsklasse?.title||"resource.kravTilByggegrunn.muligeOmraadeRisikoer.omraadeRisiko.sikkerhetsklasse.title",emptyFieldText:e?.resourceBindings?.sikkerhetsklasse?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.omraadeRisiko={title:e?.resourceBindings?.title||"resource.kravTilByggegrunn.muligeOmraadeRisikoer.omraadeRisiko.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.omraadeRisiko={...t.omraadeRisiko,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class mt extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.partType=e?.partType,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.resourceValues={data:n?w(e?.resourceBindings?.emptyFieldText):t}}getPartTypeFromElementAttributes(e){return e.getAttribute("parttype")||"tiltakshaver"}getValueFromFormData(e){const t=j(e);if(!y(t))return;const s=new S(t);return this.hasPartValue(s)?s:void 0}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}hasNavnOrOrganisasjonsnummer(e){return y(e?.navn)||y(e?.organisasjonsnummer)}hasTelefonnummer(e){return y(e?.telefonnummer)||y(e?.mobilnummer)}hasEpost(e){return y(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}}class gt extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.resourceValues={data:n?w(s?.plan?.emptyFieldText):t}}getValueFromFormData(e){const t=j(e),s=new Ee({plan:t});return s?.plan}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}getTextResourceBindings(e){const t={plan:{},navn:{title:e?.resourceBindings?.navn?.title||"resource.planer.andrePlaner.plan.navn.title",emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText||"resource.emptyFieldText.default"},plantype:{title:e?.resourceBindings?.plantype?.title||"resource.planer.andrePlaner.plan.plantype.title",emptyFieldText:e?.resourceBindings?.plantype?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.plan={title:e?.resourceBindings?.title||"resource.planer.andrePlaner.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.plan={...t.plan,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}function pt(e,t){const s=e?.getAttribute(t);return"true"===s||""===s}function ht(e){const t=JSON.parse(e?.getAttribute("formdata"));return y(t)&&t}function ft(e){const t=e?.getAttribute("tagName")||e?.tagName?.toLowerCase();return y(t)&&t}function yt(e){const t=e?.getAttribute("text");return y(t)&&t}function kt(e){const t=JSON.parse(e?.getAttribute("texts"));return y(t)&&t}function Tt(e){return pt(e,"inline")}function Bt(e){return pt(e,"hideTitle")}function bt(e){const t=e?.getAttribute("size");return _(t)?t?.toString().toLowerCase():void 0}function vt(e){return pt(e,"hideIfEmpty")}function xt(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return y(t)&&t}function Ft(e){return pt(e,"isChildComponent")}function Vt(e){const t=e?.getAttribute("feedbackType");return y(t)&&t}function Ct(e){const t=e?.getAttribute("itemKey");return y(t)&&t}function Et(e){const t=e?.getAttribute("dataItemKey");return y(t)&&t}function wt(e){const t=e?.getAttribute("dataTitleItemKey");return y(t)&&t}function Mt(e){return pt(e,"hideOrgNr")}function jt(e){const t=e?.getAttribute("format");return y(t)&&t}function Lt(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return y(t)&&t}function It(e){return pt(e,"showRowNumbers")}function Dt(e){const t=JSON.parse(e?.getAttribute("resourceBindings"));return y(t)&&t}function St(e){const t=JSON.parse(e?.getAttribute("resourceValues"));return y(t)&&t}function Ht(e){const t=e?.getAttribute("partType");return y(t)?t:"tiltakshaver"}function At(e){return pt(e,"enableLinks")}function Rt(t){const s=t instanceof HTMLElement?function(e){return{formData:ht(e),tagName:ft(e),text:yt(e),texts:kt(e),inline:Tt(e),hideTitle:Bt(e),size:bt(e),hideIfEmpty:vt(e),styleOverride:xt(e),isChildComponent:Ft(e),feedbackType:Vt(e),itemKey:Ct(e),dataItemKey:Et(e),dataTitleItemKey:wt(e),hideOrgNr:Mt(e),format:jt(e),tableColumns:Lt(e),showRowNumbers:It(e),resourceBindings:Dt(e),resourceValues:St(e),partType:Ht(e),enableLinks:At(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 z(s);case"custom-dispensasjoner-list-data":return new Q(s);case"custom-dispensasjoner-unit-in-list":return new X(s);case"custom-divider":return new ee(s);case"custom-feedback":return new te(s);case"custom-feedback-data":return new se(s);case"custom-feedbacklist-data":return new ne(s);case"custom-feedbacklist-validation-messages":return new re(s);case"custom-field":return new ie(s);case"custom-field-adresse":return new ae(s);case"custom-field-boolean-data":return new oe(s);case"custom-field-boolean-text":return new le(s);case"custom-field-count-data":return new ue(s);case"custom-field-data":return new de(s);case"custom-field-list-data":return new ge(s);case"custom-field-kode":return new ce(s);case"custom-field-kommunens-saksnummer":return new me(s);case"custom-field-part-navn":return new pe(s);case"custom-field-prosjekt":return new fe(s);case"custom-field-telefonnummer":return new ke(s);case"custom-field-utfall-svar-status":return new Be(s);case"custom-group-ettersending":return new Fe(s);case"custom-group-plan":return new Re(s);case"custom-group-sjekklistekrav":return new Ne(s);case"custom-group-utfall-svar":return new Pe(s);case"custom-group-utfall-svar-type":return new Oe(s);case"custom-grouplist-ettersending":return new Ve(s);case"custom-grouplist-plan":return new we(s);case"custom-grouplist-sjekklistekrav":return new je(s);case"custom-grouplist-utfall-svar":return new Le(s);case"custom-grouplist-utfall-svar-type":return new Se(s);case"custom-grouplist-varsling":return new Ae(s);case"custom-header":return new Ke(s);case"custom-header-text":return new $e(s);case"custom-header-text-data":return new ze(s);case"custom-list":return new Ue(s);case"custom-list-data":return new Je(s);case"custom-list-planlagte-loefteinnretninger":return new Ze(s);case"custom-list-tiltaks-formaal":return new We(s);case"custom-list-vedlegg":return new Ye(s);case"custom-paragraph":return new _e(s);case"custom-paragraph-text":return new Qe(s);case"custom-subheader-text":return new Xe(s);case"custom-summation":return new et(s);case"custom-summation-arealdisponering":return new nt(s);case"custom-summation-data":return new rt(s);case"custom-table":return new it(s);case"custom-table-arbeidsplasser":return new ot(s);case"custom-table-data":return new lt(s);case"custom-table-eiendom":return new ut(s);case"custom-table-omraaderisiko":return new ct(s);case"custom-table-part":return new mt(s);case"custom-table-plan":return new gt(s);default:return console.warn(`Unknown component type: ${n}`),null}}function Nt(e,t,s){s={returnHtml:!0,inline:!1,styleOverride:{},...s};const n=document.createElement("div");n.classList.add("field");const r=e?.length?b("custom-field-"):null;e?.length&&n.appendChild(function(e,t,s){const n=document.createElement("span");return t&&(n.id=t),n.classList.add("field-title"),n.innerText=`${e}${s?":":""}`,n}(e,r,s.inline)),s?.inline&&n.classList.add("inline");const i=function(e,t){const s=document.createElement("span");return s.classList.add("field-value"),Array.isArray(e)&&(e=e.join(", ")),"object"==typeof e&&(e=JSON.stringify(e,null,2)),y(e)?s.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}$`),r=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>${r(n)}`}return r(e)}).join("")}(e):e:s.innerHTML="",s}(t,s.enableLinks);return e?.length&&(i.classList.add("has-title"),i.setAttribute("aria-labelledby",r)),n.appendChild(i),T(n,{...s.styleOverride}),s.returnHtml?n.outerHTML:n}function Pt(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-divider",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=document.createElement("hr");T(t,e?.styleOverride),this.innerHTML="",this.appendChild(t)}}),customElements.define("custom-feedback",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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=Rt(this),t=E(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=Nt(e?.resourceValues?.title,e?.resourceValues?.data,t)}}}),customElements.define("custom-header",class extends HTMLElement{connectedCallback(){const e=Rt(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,T(r,n),r.outerHTML}(e),T(this,e?.styleOverride))}}),customElements.define("custom-list",class extends HTMLElement{connectedCallback(){const e=new Rt(this);this.innerHTML=e?.resourceValues?.title?.length?function(e,t,s){const n=document.createElement("div");n.classList.add("field");const r=e?.length?b("custom-field-"):null;e?.length&&n.appendChild(function(e,t){const s=document.createElement("span");return t&&(s.id=t),s.classList.add("field-title"),s.innerText=e,s}(e,r));const i=Pt(t,s,!1);return e?.length&&(i.classList.add("has-title"),i.setAttribute("aria-labelledby",r)),n.appendChild(i),n.outerHTML}(e?.resourceValues?.title,e?.resourceValues?.data):Pt(e?.resourceValues?.data),T(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=Rt(this);if(!e?.isEmpty){const t=function(e){const t=e?.resourceValues?.title,s=e?.styleOverride,n=document.createElement("p");return n.innerHTML=t,T(n,s),n.outerHTML}(e);this.innerHTML=t}}});class Ot{constructor(e){const t=this.getIsChildComponentAttributeFromProps(e),s=this.getFormDataAttributeFromProps(e),n=this.getTagNameAttributeFromProps(e),r=this.getSizeAttributeFromProps(e),i=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),g=this.getDataItemKeyAttributeFromProps(e),p=this.getDataTitleItemKeyAttributeFromProps(e),h=this.getIdAttributeFromProps(e),f=this.getFeedbackTypeAttributeFromProps(e),y=this.getHideOrgNr(e),k=this.getFormatAttributeFromProps(e),T=this.getShowRowNumbersAttributeFromProps(e),B=this.getPartTypeAttributeFromProps(e),b=this.getResourceBindingsFromProps(e),v=this.getResourceValuesFromProps(e),x=this.getEnableLinksFromProps(e),F=this.getTextAttributeFromProps(e);t&&(this.isChildComponent=t),s&&(this.formData=s),n&&(this.tagName=n),r&&(this.size=r),i&&(this.hideTitle=i),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),g&&(this.dataItemKey=g),p&&(this.dataTitleItemKey=p),h&&(this.id=h),f&&(this.feedbackType=f),y&&(this.hideOrgNr=y),k&&(this.format=k),T&&(this.showRowNumbers=T),B&&(this.partType=B),b&&(this.resourceBindings=b),v&&(this.resourceValues=v),x&&(this.enableLinks=x),F&&(this.text=F)}getFormDataAttributeFromProps(e){if(!y(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 y(e?.styleOverride)?JSON.stringify(e?.styleOverride):void 0}getGridAttributeFromProps(e){return y(e?.grid)&&JSON.stringify(e?.grid)}getTableColumnsAttributeFromProps(e){return y(e?.tableColumns)&&JSON.stringify(e?.tableColumns)}getItemKeyAttributeFromProps(e){return y(e?.itemKey)&&e?.itemKey}getDataItemKeyAttributeFromProps(e){return y(e?.dataItemKey)&&e?.dataItemKey}getDataTitleItemKeyAttributeFromProps(e){return y(e?.dataTitleItemKey)&&e?.dataTitleItemKey}getIdAttributeFromProps(e){return y(e?.id)&&e?.id}getFeedbackTypeAttributeFromProps(e){return y(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 y(e?.format)&&e?.format?.toString()}getShowRowNumbersAttributeFromProps(e){return"true"===e?.showRowNumbers?.toString()?"true":void 0}getPartTypeAttributeFromProps(e){return y(e?.partType)&&e?.partType}getResourceBindingsFromProps(e){return y(e?.resourceBindings)&&JSON.stringify(e?.resourceBindings)}getResourceValuesFromProps(e){return y(e?.resourceValues)?JSON.stringify(e?.resourceValues):null}getEnableLinksFromProps(e){return"true"===e?.enableLinks?.toString()?"true":void 0}getTextAttributeFromProps(e){return y(e?.text)&&e?.text}}function Kt(e){const t=e?.resourceValues?.data,s=e?.styleOverride,n=document.createElement("table"),r=document.createElement("thead"),i=document.createElement("tr");if(t?.tableHeaders?.length&&t?.tableRows?.length){t.tableHeaders.forEach(e=>{i.appendChild(function(e){const t=document.createElement("th");return t.textContent=e.text,T(t,e?.props?.styleOverride),t}(e))}),r.appendChild(i),n.appendChild(r);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 Ot(e);return t.innerHTML=v("custom-field-data",s).outerHTML,t}(e))}),t}(t))}),n.appendChild(e)}else{const t=B(e);if(t?.length){const e=document.createElement("tr"),s=document.createElement("td");s.textContent=t,e.appendChild(s),n.appendChild(e)}}return T(n,s),n}function $t(e){return v("custom-feedbacklist-validation-messages",new Ot({isChildComponent:!0,resourceValues:{data:e}}))}function zt(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}function Ut(e,t){return v("custom-group-ettersending",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceValues:{data:e}}))}function Jt(e,t){return v("custom-group-sjekklistekrav",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceBindings:{trueText:t?.resourceBindings?.trueText,falseText:t?.resourceBindings?.falseText,defaultText:t?.resourceBindings?.defaultText},resourceValues:{data:e}}))}function qt(){return v("custom-divider",new Ot({styleOverride:{margin:0}}))}function Gt(e,t){return v("custom-group-utfall-svar",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceValues:{data:e}}))}function Zt(e){return x(v("custom-summation-data",new Ot({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:e?.resourceBindings})))}function Wt(e,t="h1"){const s=e?.resourceValues?.data,n=s?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return y(n)?v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:n}})):null}customElements.define("custom-summation",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e){const t=document.createElement("div");return t.classList.add("custom-summation"),e&&Array.isArray(e)&&e.length&&e.forEach(e=>{const s=function(e){const t=document.createElement("div");t.classList.add("summation-item");const s=e?.resourceValues?.operator||"",n=e?.resourceValues?.title||"",r=n?.length?b("custom-field-"):null,i=y(e?.resourceValues?.data)?e?.resourceValues?.data:"0",a=e?.resourceValues?.unit||"";(!0===e?.resourceValues?.isTotal||"true"===e?.resourceValues?.isTotal)&&t.classList.add("total"),t.appendChild(function(e){const t=document.createElement("span");return t.classList.add("summation-item-operator"),t.innerText=e,t}(s)),t.appendChild(function(e,t){const s=document.createElement("span");return t&&(s.id=t),s.classList.add("summation-item-title"),s.innerText=e,s}(n,r));const o=function(e,t){const s=document.createElement("span");return y(e)?(s.classList.add("summation-item-data"),s.innerText=e+(t?.length?` ${t}`:""),s):s}(i,a);return n?.length&&(o.classList.add("has-title"),o.setAttribute("aria-labelledby",r)),t.appendChild(o),t.outerHTML}(e);t.innerHTML+=s}),t}(e?.resourceValues?.data);this.innerHTML="",y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t){const s=new Ot({size:t,resourceValues:{title:e}});if(e)return v("custom-header",s)}(e?.resourceValues?.title,e?.size)),this.appendChild(t)}}}),customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=Kt(e);this.innerHTML="",y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t){const s=new Ot({size:t,resourceValues:{title:e}});if(e)return v("custom-header",s)}(e?.resourceValues?.title,e?.size)),this.appendChild(t)}}}),customElements.define("custom-dispensasjoner-list-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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 v("custom-dispensasjoner-unit-in-list",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e}}))}(e))}),t}(e))}}),customElements.define("custom-dispensasjoner-unit-in-list",class extends HTMLElement{connectedCallback(){const e=Rt(this);if(!e.isEmpty){const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){const t=document.createElement("div");return t.appendChild(function(e){return v("custom-header-text-data",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({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=Rt(this),t=E(this);if(e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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),T(n);const i=document.createElement("summary");i.classList.add("feedback-summary"),i.innerHTML=e,r.appendChild(i);const a=document.createElement("div");return a.classList.add("feedback-list"),t.forEach(e=>{const t=document.createElement("div");t.classList.add("feedback-list-item");const s=new Ot({isChildComponent:!0,feedbackType:"default",resourceValues:{data:e}});t.appendChild(v("custom-feedback-data",s)),a.appendChild(t)}),r.appendChild(a),r.outerHTML}(n,s,e?.feedbackType,e?.styleOverride)}}),customElements.define("custom-feedbacklist-validation-messages",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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=v("custom-feedbacklist-data",new Ot({isChildComponent:!0,feedbackType:s,resourceValues:{title:zt(s,n.length),data:n}}));t.appendChild(e)}}),t.outerHTML}(s)}}),customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=new Ot(e);this.innerHTML=v("custom-field",s).outerHTML,t&&this.appendChild(t)}}}),customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=B(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new Ot(e);this.innerHTML=v("custom-field",s).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-list-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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(x(v("custom-field-data",new Ot({isChildComponent:!0,resourceValues:e}))))}),t}(e);this.innerHTML=t.outerHTML}}}),customElements.define("custom-field-kode",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=B(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new Ot(e);this.innerHTML=v("custom-field",s).outerHTML}}}),customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML;const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-ettersending",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.title,e?.size));for(const t of e?.resourceValues?.data??[]){const s=Ut(t,e);this.appendChild(s);const n=v("custom-divider");this.appendChild(n)}const t=e.hasValidationMessages&&$t(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-sjekklistekrav",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.title,e?.size));const t=document.createElement("div");t.className="sjekklistekrav-list";for(const s of e?.resourceValues?.data??[]){const n=Jt(s,e);t.appendChild(n);const r=qt();t.appendChild(r)}this.appendChild(t),t.lastChild&&t.removeChild(t.lastChild);const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.title,e?.size));for(const t of e?.resourceValues?.data??[]){const s=Gt(t,e);this.appendChild(s);const n=v("custom-divider");this.appendChild(n)}const t=e.hasValidationMessages&&$t(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(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 v("custom-group-utfall-svar-type",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceValues:{data:s,utfallType:t}}))}(e,t);this.appendChild(s)})}}),customElements.define("custom-grouplist-varsling",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e){return v("custom-grouplist-sjekklistekrav",new Ot({isChildComponent:!0,hideIfEmpty:e?.hideIfEmpty,enableLinks:e?.enableLinks,resourceBindings:e?.resourceBindings,resourceValues:e?.resourceValues}))}(e);this.appendChild(t);const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-ettersending",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=document.createElement("div");y(e?.resourceValues?.data?.tittel)&&!0!==e?.hideTitle&&t.appendChild(function(e,t="h3"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.data?.tittel,e?.size)),t.appendChild(function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-list-vedlegg",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-sjekklistekrav",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=document.createElement("div");y(e?.resourceValues?.data?.tittel)&&!0!==e?.hideTitle&&t.appendChild(function(e,t="h3"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.data?.tittel,e?.size)),t.appendChild(function(e){const t=F();return t.appendChild(function(e){const t=e?.resourceValues?.data,s={xs:11};return x(v("custom-field",new Ot({isChildComponent:!0,hideIfEmpty:!1,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 x(v("custom-field-boolean-text",new Ot({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&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=document.createElement("div");y(e?.resourceValues?.data?.tittel)&&!0!==e?.hideTitle&&t.appendChild(function(e,t="h3"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.data?.tittel,e?.size)),t.appendChild(function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceValues:{data:t?.beskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return x(v("custom-field-utfall-svar-status",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-list-vedlegg",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=Rt(this);if(!e.isEmpty){const t=function(e){return v("custom-grouplist-utfall-svar",new Ot({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&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new Rt(this);e?.isChildComponent||T(E(this),{padding:"0 0.75rem"});const t=new Ot(e);this.innerHTML=v("custom-header",t).outerHTML}}),customElements.define("custom-header-text-data",class extends HTMLElement{connectedCallback(){const e=new Rt(this);e?.isChildComponent||T(E(this),{padding:"0 0.75rem"});const t=new Ot(e);this.innerHTML=v("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e),s=e.isEmpty?"custom-field":"custom-list";this.innerHTML=v(s,t).outerHTML}}}),customElements.define("custom-list-planlagte-loefteinnretninger",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){return v("custom-list",new Ot(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-list-tiltaks-formaal",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e),s=e.isEmpty?"custom-field":"custom-list";this.innerHTML=v(s,t).outerHTML}}}),customElements.define("custom-list-vedlegg",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}else{const t=new Ot(e);this.innerHTML=v("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=new Ot(e);this.innerHTML=v("custom-paragraph",t).outerHTML}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=new Ot(e);this.innerHTML=v("custom-paragraph",t).outerHTML}}),customElements.define("custom-summation-arealdisponering",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){const t=e?.resourceValues?.data?.bebyggelsen,s=e?.resourceValues?.data?.tomtearealet;if(t||s){const e=document.createElement("div");if(s){const t=Zt({resourceValues:s?.resourceValues,resourceBindings:s?.resourceBindings});e.appendChild(t)}if(t){const s=Zt({resourceValues:t?.resourceValues,resourceBindings:t?.resourceBindings});e.appendChild(s)}return e}return null}(e);e?.resourceValues?.title&&!0!==e?.hideTitle&&this.appendChild(function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.title,e?.size)),this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-summation-data",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){return v("custom-summation",new Ot({size:"h3",hideIfEmpty:e?.hideIfEmpty,hideTitle:e?.hideTitle,isChildComponent:!0,resourceValues:e?.resourceValues}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-arbeidsplasser",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(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 v("custom-table-data",new Ot({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=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){return v("custom-table",new Ot(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(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 v("custom-table-data",new Ot({size:e?.size,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-omraaderisiko",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){const t=[{dataKey:"risikotype.kodebeskrivelse",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.risikotype?.title,emptyFieldText:e?.resourceBindings?.risikotype?.emptyFieldText}},{dataKey:"sikkerhetsklasse.kodebeskrivelse",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.sikkerhetsklasse?.title,emptyFieldText:e?.resourceBindings?.sikkerhetsklasse?.emptyFieldText}}];return v("custom-table-data",new Ot({size:e?.size,hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.omraadeRisiko?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-part",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(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 v("custom-table-data",new Ot({size:e?.size,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-table-plan",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){const t=[{dataKey:"navn",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.navn?.title,emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText}},{dataKey:"plantype.kodebeskrivelse",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.plantype?.title,emptyFieldText:e?.resourceBindings?.plantype?.emptyFieldText}}];return v("custom-table-data",new Ot({size:e?.size,hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.plan?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e.isEmpty&&t)t.style.display="none";else{const t=F(),s=Wt(e),n=function(e){const t=e?.resourceValues?.data,s={xs:6};return x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.metadataFtbId?.title},resourceValues:{data:t?.metadata?.ftbId}})),s)}(e),i=function(e){const t=e?.resourceValues?.data,s={xs:6};return x(v("custom-field-kommunens-saksnummer",new Ot({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.kommunensSaksnummer?.title},resourceValues:{data:t?.kommunensSaksnummer}})),s)}(e),a=function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.soeknadGjelderHeader?.title}}))}(e),o=function(e){const t=e?.resourceValues?.data;return v("custom-table-eiendom",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.eiendomByggested?.title},resourceValues:{data:t?.eiendomByggested?.eiendom}}))}(e),l=function(e,t="h3"){const s=e?.resourceValues?.data;return s?.tiltakstyper?.type?.kode?.length>0?v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeHeader?.title}})):null}(e),u=function(e){const t=e?.resourceValues?.data;return x(v("custom-list-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,itemKey:"kodebeskrivelse",resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeKode?.title},resourceValues:{data:t?.tiltakstyper?.type?.kode}})))}(e),d=function(e){const t=e?.resourceValues?.data;return v("custom-table-part",new Ot({isChildComponent:!0,partType:"tiltakshaver",hideIfEmpty:!0,resourceValues:{data:t?.tiltakshaver}}))}(e),c=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-adresse",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.tiltakshaverAdresse?.title},resourceValues:{data:t?.tiltakshaver?.adresse}})))}(e),m=function(e){const t=e?.resourceValues?.data;return v("custom-table-part",new Ot({isChildComponent:!0,partType:"ansvarligSoeker",hideIfEmpty:!0,resourceValues:{data:t?.ansvarligSoeker}}))}(e),g=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-adresse",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.ansvarligSoekerAdresse?.title},resourceValues:{data:t?.ansvarligSoeker?.adresse}})))}(e),p=Wt(e,"h2"),h=function(e){const t=e?.resourceValues?.data;return y(t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse)||y(t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse)?x(v("custom-field-boolean-data",new Ot({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),f=function(e){const t=e?.resourceValues?.data;return v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonBeskrivelseBeskrivelse?.title},resourceValues:{data:t?.dispensasjonBeskrivelse?.beskrivelse}}))}(e),k=function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.dispensasjonFraHeader?.title}}))}(e),T=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.bestemmelserType?.title},resourceValues:{data:e.isPlanBestemmelseType?t?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:t?.dispensasjonFra?.lovbestemmelse}})))}(e),V=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.planBestemmelseNummerering?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e),C=function(e){return v("custom-header-text",new Ot({isChildComponent:!0,size:"h2",resourceBindings:{title:e.resourceBindings?.stedfestingHeader?.title}}))}(e),E=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinatsystem?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinatsystem?.kodebeskrivelse}})))}(e),w=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinater?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinater?.koordinat}})))}(e),M=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingVertikalnivaa?.title},resourceValues:{data:t?.stedfesting?.vertikalnivaa?.kodebeskrivelse}})))}(e),j=function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.varighetHeader?.title}}))}(e),L=function(e){const t=e?.resourceValues?.data;return t?.varighet?.oenskesVarigDispensasjon?x(v("custom-paragraph-text",new Ot({isChildComponent:!0,resourceBindings:{title:e.resourceBindings?.varighetOenskesVarigDispensasjon?.trueText}}))):y(t?.varighet?.oensketVarighetTil)?x(v("custom-field-data",new Ot({isChildComponent:!0,format:"date",resourceBindings:{title:e.resourceBindings?.varighetOensketVarighetTil?.title},resourceValues:{data:t?.varighet?.oensketVarighetTil}}))):null}(e),I=function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.begrunnelseHeader?.title}}))}(e),S=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.hensynBakBestemmelsen}})))}(e),H=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynBakBestemmelsen}})))}(e),A=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynOverordnet?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynOverordnet}})))}(e),R=function(e){const t=e?.resourceValues?.data;return x(v("custom-list-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseFordeler?.title},resourceValues:{data:t?.begrunnelse?.fordeler?.effekt}})))}(e),N=function(e){const t=e?.resourceValues?.data;return x(v("custom-list-data",new Ot({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 x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseSamletBegrunnelse?.title},resourceValues:{data:t?.begrunnelse?.samletBegrunnelse}})))}(e),O=function(e,t="h2"){const s=e?.resourceValues?.data,n=s?.generelleVilkaar?.norskSvenskDansk;return n?v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.title}})):null}(e),K=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-boolean-text",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{trueText:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.trueText,falseText:"",defaultText:""},resourceValues:{data:t?.generelleVilkaar?.norskSvenskDansk}})))}(e),$=$t(e?.validationMessages);D(t,[s,n,r,i]),D(t,[a,o,l,u]),y(e?.resourceValues?.data?.ansvarligSoeker)?D(t,[m,g]):y(e?.resourceValues?.data?.tiltakshaver)&&D(t,[d,c]),D(t,[p,h,f]),e.isPlanBestemmelseType?D(t,[k,T,B,b,V]):D(t,[k,b]),D(t,[C,E,w,M]),D(t,[j,L]),D(t,[I,S,H,A,R,N,P]),D(t,[O,K]),D(t,[$]),this.appendChild(t)}}});class Yt{constructor(e){this.eiendomByggested=e?.eiendomByggested&&new g(e.eiendomByggested),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new p(e.kommunensSaksnummer),this.metadata=e?.metadata&&new h(e.metadata),this.versjon=e?.versjon}}function _t(e){return M(e)}const Qt={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 Yt({eiendomByggested:y(t?.eiendomByggested)?t.eiendomByggested:null,kommunensSaksnummer:y(t?.kommunensSaksnummer)?t.kommunensSaksnummer:null,metadata:y(t?.metadata)?t.metadata:null,versjon:t?.versjon?t.versjon:null})}(this),s=$(e,Qt),n=E(this);if(!y(t)&&n)n.style.display="none";else{const n=function(e,t){return v("custom-field-data",{formData:{simpleBinding:e?.versjon},text:w(t),emptyFieldText:"(gjennomfoeringsplanNummer mangler)"})}(t,e),r=function(e,t){return v("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:_t(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),i=$t(s);this.appendChild(n),this.appendChild(r),this.appendChild(i)}}}),window.addEventListener("load",async()=>{const e=window.location.pathname.split("/"),t=window.location.origin,s=e?.[1],n=e?.[2];if(![t?.length,s?.length,n?.length].every(Boolean))return void console.error("Could not determine the origin, organization, or application from the URL.");const r=`${t}/${s}/${n}/api/v1/profile/user`,i=await fetch(r).then(e=>e.json());if(!i?.profileSettingPreference?.language)return void console.error("Could not determine the user's language preference.");const a=i?.profileSettingPreference?.language;window.selectedLanguage=a;const o=`${t}/${s}/${n}/api/v1/texts/${a}`,l=await fetch(o).then(e=>e.json());if(y(l))window.textResources=l;else{console.error("Could not retrieve text resources for the selected language.");const e=`${t}/${s}/${n}/api/v1/texts/nb`,r=await fetch(e).then(e=>e.json());if(window.textResources=r,!y(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)}}class t{constructor(e){this.effekt=e?.effekt}}class s{constructor(e){this.effekt=e?.effekt}}class n{constructor(e){this.hensynBakBestemmelsen=e?.hensynBakBestemmelsen,this.vurderingHensynBakBestemmelsen=e?.vurderingHensynBakBestemmelsen,this.vurderingHensynOverordnet=e?.vurderingHensynOverordnet,this.fordeler=e?.fordeler&&new t(e.fordeler),this.ulemper=e?.ulemper&&new s(e.ulemper),this.samletBegrunnelse=e?.samletBegrunnelse}}class r{constructor(e){this.kodeverdi=e?.kodeverdi,this.kodebeskrivelse=e?.kodebeskrivelse}}class i{constructor(e){this.dispensasjonTittel=e?.dispensasjonTittel&&new r(e.dispensasjonTittel),this.inngangsbeskrivelse=e?.inngangsbeskrivelse&&new r(e.inngangsbeskrivelse),this.annenInngangsbeskrivelse=e?.annenInngangsbeskrivelse,this.beskrivelse=e?.beskrivelse}}class a{constructor(e){this.planidentifikasjon=e?.planidentifikasjon}}class o{constructor(e){this.nummerering=e?.nummerering}}class l{constructor(e){this.navn=e?.navn,this.nasjonalArealplanId=e?.nasjonalArealplanId&&new a(e.nasjonalArealplanId),this.planbestemmelse=e?.planbestemmelse&&new o(e.planbestemmelse)}}class u{constructor(e){this.bestemmelserType=e?.bestemmelserType&&new r(e.bestemmelserType),this.dispensasjonPlanBestemmelse=e?.dispensasjonPlanBestemmelse&&new l(e.dispensasjonPlanBestemmelse),this.lovbestemmelse=e?.lovbestemmelse}}class d{constructor(e){this.adresselinje1=e?.adresselinje1,this.adresselinje2=e?.adresselinje2,this.adresselinje3=e?.adresselinje3,this.postnr=e?.postnr,this.poststed=e?.poststed,this.kommunenavn=e?.kommunenavn||null}}class c{constructor(e){this.gaardsnummer=e?.gaardsnummer,this.bruksnummer=e?.bruksnummer,this.seksjonsnummer=e?.seksjonsnummer,this.festenummer=e?.festenummer}}class m{constructor(e){this.adresse=new d(e?.adresse?e.adresse:e),this.eiendomsidentifikasjon=e?.eiendomsidentifikasjon&&new c(e.eiendomsidentifikasjon),this.bolignummer=e?.bolignummer,this.bygningsnummer=e?.bygningsnummer,this.kommunenavn=e?.kommunenavn||null}}class g{constructor(e){this.eiendom=e?.eiendom&&e.eiendom.map(e=>new m(e))}}class p{constructor(e){this.saksaar=e?.saksaar,this.sakssekvensnummer=e?.sakssekvensnummer}}class h{constructor(e){this.ftbId=e?.ftbId,this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}const f=["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-kode","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-grouplist-varsling","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-planlagte-loefteinnretninger","custom-list-tiltaks-formaal","custom-list-vedlegg","custom-paragraph-text","custom-subheader-text","custom-summation","custom-summation-arealdisponering","custom-summation-data","custom-table-arbeidsplasser","custom-table-data","custom-table-eiendom","custom-table-omraaderisiko","custom-table-part","custom-table-plan","custom-dispensasjon","custom-gjennomfoeringsplan"];function y(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 k(e){const t="number"==typeof e?e:Number(e);return"number"==typeof t&&!isNaN(t)&&t>0}function T(e,t){for(let s in t)e.style[s]=t[s]}function B(e){const t=e?.resourceValues?.emptyFieldText;return t||""}function b(e=""){return`${e}${Date.now().toString(36)}${Math.random().toString(36).substring(2,10)}`}function v(e,t){if(!function(e){return f.includes(e)}(e))throw new Error(`Invalid tag name ${e}. Must be one of: ${f.join(", ")}`);const s=document.createElement(e);return function(e,t){for(const s in t)e.setAttribute(s,t[s])}(s,{...t,tagName:e}),s}function x(e,t){const s=document.createElement("div"),n=document.createElement("div");n.appendChild(e),s.appendChild(n);const r={flexBasis:"100%",maxWidth:"100%"};if(y(t)){const e=function(e){if(e){const t=e.xs||12,s=e.sm||t,n=e.md||s,r=e.lg||n,i=e.xl||r;return Math.min(t/12*100,s/12*100,n/12*100,r/12*100,i/12*100)}return 100}(t);r.flexBasis=`${e}%`,r.maxWidth=`${e}%`,r.flexGrow="0"}return T(s,{...r,padding:"0.75rem 0px"}),s}function F(){const e=document.createElement("div");return T(e,{display:"flex",flexFlow:"wrap",justifyContent:"start",alignItems:"flex-start"}),e}function V(){return"undefined"!=typeof window&&window.textResources?window.textResources:[]}function C(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 E(e){const t="true"===e.getAttribute("isChildComponent"),s=e?.parentElement?.parentElement;return t?e:s||null}function w(e){const t=V(),s=t?.resources?.find(t=>t.id===e)?.value;return s||e}function M(e){const t={};for(const s in e)t[s]=w(e[s]);return t}function j(e){return e.isChildComponent?e.resourceValues?.data:e.formData?.simpleBinding||e.formData?.data}function L(e){return e.isChildComponent?e.resourceValues?.dataTitle:null!=e.formData?.dataTitle?e.formData?.dataTitle:void 0}function I(e,t){return y(e?.resourceValues?.[t])?e.resourceValues?.[t]:w(e?.resourceBindings?.[t])}function D(e,t){return t.filter(e=>!!e).forEach(t=>{t instanceof HTMLElement?e.appendChild(t):e.innerHTML+=t}),e}class S{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(y(e?.adresse))return new d(e.adresse)}}class H{constructor(e){this.koordinatsystem=e?.koordinatsystem&&new r(e.koordinatsystem),this.koordinater=e?.koordinater}}class A{constructor(e){this.posisjon=e?.posisjon&&new H(e.posisjon),this.vertikalnivaa=e?.vertikalnivaa&&new r(e.vertikalnivaa)}}class R{constructor(e){const t=e?this.getTypeFromProps(e):null;t&&(this.type=t)}getTypeFromProps(e){return e&&y(e?.type)?{kode:this.getKodeFromType(e.type)}:null}getKodeFromType(e){return Array.isArray(e?.kode)&&e?.kode?.length?e?.kode?.map(e=>new r(e)):null}}class N{constructor(e){this.oenskesVarigDispensasjon=e?.oenskesVarigDispensasjon,this.oensketVarighetTil=e?.oensketVarighetTil}}class P{constructor(e){this.dispensasjonBeskrivelse=e?.dispensasjonBeskrivelse&&new i(e.dispensasjonBeskrivelse),this.dispensasjonReferanse=e?.dispensasjonReferanse,this.soeknadstype=e?.soeknadstype&&new r(e.soeknadstype),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new p(e.kommunensSaksnummer),this.metadata=e?.metadata&&new h(e.metadata),this.eiendomByggested=e?.eiendomByggested&&new g(e.eiendomByggested),this.tiltakstyper=e?.tiltakstyper&&new R(e.tiltakstyper),this.tiltakshaver=e?.tiltakshaver&&new S(e.tiltakshaver),this.ansvarligSoeker=e?.ansvarligSoeker&&new S(e.ansvarligSoeker),this.dispensasjonFra=e?.dispensasjonFra&&new u(e.dispensasjonFra),this.stedfesting=e?.stedfesting&&new A(e.stedfesting),this.varighet=e?.varighet&&new N(e.varighet),this.begrunnelse=e?.begrunnelse&&new n(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 K(e){return!!e&&Object.values(e).some(e=>e.length>0)}function $(e,t,s=new O){for(const n in t)for(const r in t[n]){const i=t[n][r],a=e?.resources?.find(e=>e.id===i);a?""===a.value&&s.info.push(`Empty text resource for "${r}" with id: "${i}" in component "${n}"`):s.error.push(`Missing text resource for "${r}" with id: "${i}" in component "${n}"`)}return s}class z extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(),n=!this.hasContent(t),r=this.dataIsPlanBestemmelseType(t),i=this.getValidationMessages(s);this.isEmpty=n,this.isPlanBestemmelseType=r,this.validationMessages=i,this.hasValidationMessages=K(i),this.resourceBindings=s,this.resourceValues={data:n?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValueFromFormData(e){return y(e?.formData)&&new P(e.formData)}getValidationMessages(e){return $("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"},ansvarligSoekerAdresse:{title:"resource.ansvarligSoeker.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 U=["default"],J={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"}}},q={dateTime:{default:"no-NO"},date:{default:"no-NO"},time:{default:"no-NO"}},G=["h1","h2","h3","h4","h5","h6"];function Z(e){return U.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=q.dateTime[t],n=J.dateTime[s]||J.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,r=parseInt(t[3],10),i=new Date(Date.UTC(r,n,s));return i.getFullYear()===r&&i.getMonth()===n&&i.getDate()===s?i.toISOString():null}(e)),t=Z(t);const s=q.date[t],n=J.date[s]||J.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),r=t[3]?parseInt(t[3],10):0;return s<0||s>23||n<0||n>59||r<0||r>59?null:new Date(Date.UTC(1970,0,1,s,n,r)).toISOString()}(e)),t=Z(t);const s=q.time[t],n=J.time[s]||J.time.default;return new Intl.DateTimeFormat(s,n).format(new Date(e))}(e,s);default:return e}}function _(e){return y(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 y(e)}getValueFromFormData(e){return Y(j(e),e?.format)}}class X extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.isEmpty=n,this.resourceValues={data:t}}hasContent(e){return y(e)}getValueFromFormData(e){return j(e)}getValidationMessages(e){return $("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 ee extends e{constructor(e){super(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 y(e)}getValueFromFormData(e){return j(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 y(e)}getValueFromFormData(e){return j(e)}}class ne 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 y(e)}getValueFromFormData(e){return j(e)}}class re 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 y(e)}getValueFromFormData(e){const t=j(e);return new O(t)}}class ie extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return y(e?.resourceValues?.data)}}class ae extends e{constructor(e){super(e);const t=this.getTextResourceBindings(e),s=this.getValueFromFormData(e,t?.adresse),n=this.getValidationMessages(t);this.validationMessages=n,this.hasValidationMessages=K(n);const r=!this.hasContent(s);this.isEmpty=r,this.resourceValues={title:I(e,"title"),data:r?w(t?.adresse?.emptyFieldText):s}}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(" ")}formatKommunenavn(e){return e?.kommunenavn?`${e?.kommunenavn}`:""}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}formatAdresse(e,t){const s=this.formatAdresselinje(e),n=this.formatZipCity(e),r=this.formatKommunenavn(e),i=w(t?.emptyFieldText)||"";return s?.length&&n?.length?`${s}\n${n}`:s?.length?s:n?.length?n:r?.length?`${i}\n${r}`:""}getValueFromFormData(e,t){const s=j(e),n=new d(s);return this.formatAdresse(n,t)}hasContent(e){return y(e)}getTextResourceBindings(e){const t={adresse:{}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.adresse={title:e?.resourceBindings?.title||"resource.adresse.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.adresse={...t?.adresse,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.adresse.emptyFieldText.default"}),t}}class oe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValueFromFormData(e){const t=e?.id?.length&&"string"==typeof e?.id?e.id:"custom-field-boolean-data",s=j(e),n=k(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||n?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 le extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValueFromFormData(e){const t=e?.id||"custom-field-boolean-text",s=j(e),n=function(e){return{trueText:e.resourceValues?.trueText||w(e?.resourceBindings?.trueText),falseText:e.resourceValues?.falseText||w(e?.resourceBindings?.falseText),defaultText:e.resourceValues?.defaultText||w(e?.resourceBindings?.defaultText)}}(e),r={trueText:"Ja",falseText:"Nei",defaultText:""};return C(n,r,["trueText","falseText","defaultText"],t),!0===s||"true"===s?void 0!==n?.trueText&&null!==n.trueText?n.trueText:r.trueText:!1===s||"false"===s?void 0!==n?.falseText&&null!==n.falseText?n.falseText:r.falseText:n?.defaultText?n.defaultText:r.defaultText}}class ue extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return k(e)}getValueFromFormData(e){const t=j(e);return t&&Array.isArray(t)?t.length:0}}class de extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=L(e),n=!this.hasContent(t),r=!this.hasContent(s);this.isEmpty=n,this.resourceValues={title:!e?.hideTitle&&(!r&&s||this.getTextData(e)),data:n?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValueFromFormData(e){return Y(j(e),e?.format)}getTextData(e){const t=I(e,"title"),s=e?.text;return y(t)?t:s}}class ce extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}formatKode(e){return y(e?.kodeverdi)&&y(e?.kodebeskrivelse)?`${e.kodeverdi}: ${e.kodebeskrivelse}`:y(e?.kodeverdi)?e.kodeverdi:y(e?.kodebeskrivelse)?e.kodebeskrivelse:""}getValueFromFormData(e){const t=j(e),s=new r(t);return this.formatKode(s)}}class me extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}formatKommunensSaksnummer(e){return[e?.saksaar?.toString(),e?.sakssekvensnummer?.toString()].filter(e=>e?.length).join("/")}getValueFromFormData(e){const t=j(e),s=new p(t);return this.formatKommunensSaksnummer(s)}}class ge 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 y(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),s=this.hasContent(e?.dataTitleItemKey),n=j(e);if(t&&s){const t=y(e?.dataTitleItemKey)?this.getListItemsFromKey(n,e?.dataTitleItemKey):n,s=y(e?.dataItemKey)?this.getListItemsFromKey(n,e?.dataItemKey):n,r=Math.min(t.length,s.length);return Array.from({length:r},(e,n)=>({title:t[n],data:s[n]}))}}}class pe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:w(e?.resourceBindings?.title),data:s?w(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=j(e),s=new S(t);return this.formatName(s,this.hideOrgNr)}hasContent(e){return y(e)}}class he{constructor(e){this.prosjektnavn=e?.prosjektnavn,this.prosjektnr=e?.prosjektnr}}class fe 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:w(e?.resourceBindings?.title),data:s?w(e?.resourceBindings?.emptyFieldText):t}}hasContent(e){return y(e)}formatProsjekt(e){const t=y(e?.prosjektnr)&&`(${e.prosjektnr?.toString()})`;return[e?.prosjektnavn?.toString(),t].filter(e=>e?.length).join(" ")}getValueFromFormData(e){const t=new he(e?.formData?.data);return this.formatProsjekt(t)}}class ye{constructor(e){this.telefonnummer=e?.telefonnummer,this.mobilnummer=e?.mobilnummer}}class ke extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:w(e?.resourceBindings?.title),data:s?w(e?.resourceBindings?.emptyFieldText):t}}formatPhoneNumbers(e){return[e.telefonnummer,e.mobilnummer].filter(e=>e?.length).join("\n")}getValueFromFormData(e){const t=j(e),s=new ye(t);return this.formatPhoneNumbers(s)}hasContent(e){return y(e)}}class Te{constructor(e){this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart}}class Be extends e{constructor(e){super(e);const t=this.getResourceBindings(e),s=this.getValueFromFormData(e,t?.utfallSvarStatus),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceValues={title:w(t?.utfallSvarStatus?.title),data:n?I(e,"emptyFieldText"):s}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getStatusText(e,t,s){const n=M(t),r={erUtfallBesvaresSenere:"Besvares senere",erUtfallBesvart:"Svar innsendt tidligere",status:"Besvares nå"};return C(n,r,["erUtfallBesvaresSenere","erUtfallBesvart","status"],s),e?.erUtfallBesvaresSenere?null!=n?.erUtfallBesvaresSenere?n.erUtfallBesvaresSenere:r.erUtfallBesvaresSenere:e?.erUtfallBesvart?null!=n?.erUtfallBesvart?n.erUtfallBesvart:r.erUtfallBesvart:n?.status?n.status:r.status}getValueFromFormData(e,t){const s=j(e),n=new Te(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 be{constructor(e){this.filnavn=e?.filnavn,this.vedleggstype=e?.vedleggstype&&new r(e.vedleggstype)}}class ve{constructor(e){this.vedlegg=e?.vedlegg?e.vedlegg.map(e=>new be(e)):void 0}}class xe{constructor(e){this.kommentar=e?.kommentar,this.tema=e?.tema?new r(e.tema):void 0,this.tittel=e?.tittel,this.vedleggsliste=e?.vedleggsliste?new ve(e.vedleggsliste):void 0}}class Fe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s?.ettersending||{},this.resourceValues={data:n?w(s?.ettersending?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return new xe(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),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceValues={title:w(s?.ettersendinger?.title),data:n?w(s?.ettersendinger?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){return j(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 Ce{constructor(e){this.navn=e?.navn,this.plantype=e?.plantype&&new r(e.plantype)}}class Ee{constructor(e){this.plan=e?.plan?e.plan.map(e=>new Ce(e)):void 0}}class we extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={navn:s?.navn,plantype:s?.plantype},this.resourceValues={title:w(s?.andrePlaner?.title),data:n?w(s?.andrePlaner?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e),s=new Ee({plan:t});return s?.plan}getResourceBindings(e){const t={andrePlaner:{},navn:{title:e?.resourceBindings?.navn?.title||"resource.planer.andrePlaner.plan.navn.title"},plantype:{title:e?.resourceBindings?.plantype?.title||"resource.planer.andrePlaner.plan.plantype.title"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.andrePlaner={...t.andrePlaner,title:e?.resourceBindings?.title||"resource.planer.andrePlaner.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.andrePlaner={...t.andrePlaner,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Me{constructor(e){this.sjekklistepunktsvar=e?.sjekklistepunktsvar,this.sjekklistepunkt=e?.sjekklistepunkt&&new r(e.sjekklistepunkt),e?.dokumentasjon&&(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),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s?.sjekklistekrav||{},this.resourceValues={title:w(s?.sjekklistekrav?.title),data:n?w(s?.sjekklistekrav?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e),s=t?.map(e=>new Me(e));return s}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 Le extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceValues={title:w(s?.utfallSvar?.title),data:n?w(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){return j(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 Ie{constructor(e){this.kodeverdi=e?.kodeverdi}}class De{constructor(e){this.beskrivelse=e?.beskrivelse,this.erUtfallBesvaresSenere=e?.erUtfallBesvaresSenere,this.erUtfallBesvart=e?.erUtfallBesvart,this.kommentar=e?.kommentar,this.tema=e?.tema?new r(e.tema):void 0,this.tittel=e?.tittel,this.utfallType=e?.utfallType?new Ie(e.utfallType):void 0,this.vedleggsliste=e?.vedleggsliste?new ve(e.vedleggsliste):void 0}}class Se extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:!e?.hideTitle&&I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return this.groupArrayItemsByUtfallType(t)}groupArrayItemsByUtfallType(e){return y(e)?e.reduce((e,t)=>{const s=t?.utfallType?.kodeverdi;return s?.length?(e[s]||(e[s]=[]),e[s].push(new De(t)),e):e},{}):{}}}class He{constructor(e){this.foreliggerMerknader=e?.foreliggerMerknader,this.fritattFraNabovarsling=e?.fritattFraNabovarsling}}class Ae extends e{constructor(e){super(e);const t=this.getResourceBindings(e),s=this.getValueFromFormData(e,t),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={title:t?.varsling?.title,emptyFieldText:t?.varsling?.emptyFieldText,trueText:t?.varsling?.trueText,falseText:t?.varsling?.falseText,defaultText:t?.varsling?.defaultText},this.resourceValues={data:n?w(t?.varsling?.emptyFieldText):s}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e,t){const s=j(e),n=new He(s);return this.getSjekklistekravItems(n,t)}getSjekklistekravItems(e,t){const s=[],n=this.getSjekklistekravForFritattFraNabovarsling(e,t),r=this.getSjekklistekravForForeliggerMerknader(e,t);return n&&s.push(n),r&&s.push(r),s.length>0?s:null}getSjekklistekravForFritattFraNabovarsling(e,t){if(y(e.fritattFraNabovarsling)){const s=e.fritattFraNabovarsling,n=w(t?.fritattFraNabovarsling?.title);return new Me({sjekklistepunktsvar:s,sjekklistepunkt:{kodebeskrivelse:n}})}}getSjekklistekravForForeliggerMerknader(e,t){if(y(e.foreliggerMerknader)){const s=e.foreliggerMerknader,n=w(t?.foreliggerMerknader?.title);return new Me({sjekklistepunktsvar:s,sjekklistepunkt:{kodebeskrivelse:n}})}}getResourceBindings(e){const t={varsling:{trueText:e?.resourceBindings?.trueText||"resource.trueText.default",falseText:e?.resourceBindings?.falseText||"resource.falseText.default",defaultText:e?.resourceBindings?.defaultText||"resource.defaultText.default"},fritattFraNabovarsling:{title:e?.resourceBindings?.fritattFraNabovarsling?.title||"resource.varsling.fritattFraNabovarsling.title"},foreliggerMerknader:{title:e?.resourceBindings?.foreliggerMerknader?.title||"resource.varsling.foreliggerMerknader.title"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.varsling={...t.varsling,title:e?.resourceBindings?.title||"resource.varsling.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.varsling={...t.varsling,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Re extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s||{},this.resourceValues={data:n?w(s?.plan?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return new Ce(t)}getResourceBindings(e){const t={navn:{title:e?.resourceBindings?.navn?.title||"resource.planer.andrePlaner.plan.navn.title"},plantype:{title:e?.resourceBindings?.plantype?.title||"resource.planer.andrePlaner.plan.plantype.title"}};return 1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.plan={emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class Ne extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s?.sjekklistekrav||{},this.resourceValues={data:n?w(s?.sjekklistekrav?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return new Me(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 Pe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s?.utfallSvar||{},this.resourceValues={data:n?w(s?.utfallSvar?.emptyFieldText):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){const t=j(e);return new De(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 Oe extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={title:s?.utfallSvarType?.title},this.resourceValues={data:n?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getValidationMessages(e){return $(V(),e)}getValueFromFormData(e){return j(e)}getResourceBindings(e){const t=e?.resourceValues?.utfallType;return{utfallSvarType:{title:`resource.utfallBesvarelse.utfallSvar.${t?.toLowerCase()}.header`}}}}class Ke extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues,this.size=e?.size}hasContent(e){return y(e?.resourceValues?.title)}}class $e extends e{constructor(e){super(e),this.size=e?.size,this.resourceValues={title:I(e,"title")}}}class ze extends e{constructor(e){super(e),this.size=e?.size;const t=I(e,"title"),s=L(e);this.resourceValues={title:[t||"",s||""].filter(Boolean).join(" ")}}}class Ue extends e{constructor(e){super(e),this.isEmpty=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return y(e?.resourceValues?.data)}}class Je extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getListItemsFromKey(e,t){return Array.isArray(e)&&e.length?e.map(e=>e?.[t]):[]}getValueFromFormData(e){const t=j(e);return y(e?.itemKey)?this.getListItemsFromKey(t,e?.itemKey):t}}class qe{constructor(e){this.erLoefteinnretningIBygning=e?.erLoefteinnretningIBygning,this.planleggesLoefteinnretningIBygning=e?.planleggesLoefteinnretningIBygning,this.planleggesHeis=e?.planleggesHeis,this.planleggesTrappeheis=e?.planleggesTrappeheis,this.planleggesRulletrapp=e?.planleggesRulletrapp,this.planleggesLoefteplattform=e?.planleggesLoefteplattform}}class Ge{constructor(e,t){this.resourceValues={data:this.getPlanlagteLoefteinnretningItems(e,t)}}getPlanlagteLoefteinnretningItems(e,t){return[!0===e?.planleggesHeis?w(t?.planleggesHeis?.title):null,!0===e?.planleggesLoefteplattform?w(t?.planleggesLoefteplattform?.title):null,!0===e?.planleggesRulletrapp?w(t?.planleggesRulletrapp?.title):null,!0===e?.planleggesTrappeheis?w(t?.planleggesTrappeheis?.title):null].filter(e=>null!==e)}}class Ze extends e{constructor(e){super(e);const t=this.getTextResourceBindings(e),s=this.getValueFromFormData(e,t),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={emptyFieldText:t?.loefteinnretninger?.emptyFieldText||void 0},this.resourceValues={title:!e?.hideTitle&&w(t?.loefteinnretninger?.title),data:n?w(t?.loefteinnretninger?.emptyFieldText):s}}getValueFromFormData(e,t){const s=j(e);if(!y(s))return;const n=new qe(s),r=new Ge(n,t);return y(r?.resourceValues?.data)?r.resourceValues.data:void 0}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}getTextResourceBindings(e){const t={planleggesHeis:{title:e?.resourceBindings?.planleggesHeis?.title||"resource.rammebetingelser.loefteinnretninger.planleggesHeis.title"},planleggesLoefteplattform:{title:e?.resourceBindings?.planleggesLoefteplattform?.title||"resource.rammebetingelser.loefteinnretninger.planleggesLoefteplattform.title"},planleggesRulletrapp:{title:e?.resourceBindings?.planleggesRulletrapp?.title||"resource.rammebetingelser.loefteinnretninger.planleggesRulletrapp.title"},planleggesTrappeheis:{title:e?.resourceBindings?.planleggesTrappeheis?.title||"resource.rammebetingelser.loefteinnretninger.planleggesTrappeheis.title"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.loefteinnretninger={title:e?.resourceBindings?.title||"resource.loefteinnretninger.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.loefteinnretninger={...t.loefteinnretninger,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class We extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(e)}getListItemsFromKey(e){const t=e?.data;return Array.isArray(t)&&t.length?t.map(t=>"Annet"===t?.kodebeskrivelse?`${t?.kodebeskrivelse}: ${e?.simpleBinding}`:t?.kodebeskrivelse):[]}getValueFromFormData(e){const t=this.getComponentDataValue(e);return this.getListItemsFromKey(t,e?.itemKey)}getComponentDataValue(e){return e.isChildComponent?e.resourceValues?.data:{simpleBinding:e.formData?.simpleBinding,data:e.formData?.data}}}class Ye extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:I(e,"title"),data:s?I(e,"emptyFieldText"):t}}hasContent(e){return y(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 be(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=j(e);return this.getAttachmentListItems(t)}}class _e extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues}hasContent(e){return y(e?.resourceValues?.title)}}class Qe extends e{constructor(e){super(e),this.resourceValues={title:this.getTextData(e)}}getTextData(e){const t=I(e,"title"),s=e?.text;return y(t)?t:s}}class Xe extends e{constructor(e){super(e),this.resourceValues={title:I(e,"title")}}}class et extends e{constructor(e){super(e),this.isEmpty=void 0!==e?.isEmpty?e.isEmpty:!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return y(e?.resourceValues?.data)}}class tt{constructor(e){this.tomtearealByggeomraade=e?.tomtearealByggeomraade,this.tomtearealSomTrekkesFra=e?.tomtearealSomTrekkesFra,this.tomtearealBeregnet=e?.tomtearealBeregnet,this.beregnetMaksByggeareal=e?.beregnetMaksByggeareal,this.arealBebyggelseEksisterende=e?.arealBebyggelseEksisterende,this.arealBebyggelseSomSkalRives=e?.arealBebyggelseSomSkalRives,this.arealBebyggelseNytt=e?.arealBebyggelseNytt,this.parkeringsarealTerreng=e?.parkeringsarealTerreng,this.arealSumByggesak=e?.arealSumByggesak,this.beregnetGradAvUtnytting=e?.beregnetGradAvUtnytting}}class st{constructor(e,t){this.tomtearealet={resourceBindings:{title:t?.tomtearealet?.title},resourceValues:{data:this.getTomtearealetItems(e,t)}},this.bebyggelsen={resourceBindings:{title:t?.bebyggelsen?.title},resourceValues:{data:this.getBebyggelsenItems(e,t)}}}getBebyggelsenItems(e,t){return[y(e?.beregnetMaksByggeareal)?{resourceValues:{data:e?.beregnetMaksByggeareal,isTotal:!1},resourceBindings:t?.beregnetMaksByggeareal}:null,y(e?.arealBebyggelseEksisterende)?{resourceValues:{data:e?.arealBebyggelseEksisterende,isTotal:!1},resourceBindings:t?.arealBebyggelseEksisterende}:null,y(e?.arealBebyggelseSomSkalRives)?{resourceValues:{data:e?.arealBebyggelseSomSkalRives,isTotal:!1},resourceBindings:t?.arealBebyggelseSomSkalRives}:null,y(e?.arealBebyggelseNytt)?{resourceValues:{data:e?.arealBebyggelseNytt,isTotal:!1},resourceBindings:t?.arealBebyggelseNytt}:null,y(e?.parkeringsarealTerreng)?{resourceValues:{data:e?.parkeringsarealTerreng,isTotal:!1},resourceBindings:t?.parkeringsarealTerreng}:null,y(e?.arealSumByggesak)?{resourceValues:{data:e?.arealSumByggesak,isTotal:!0},resourceBindings:t?.arealSumByggesak}:null].filter(e=>null!==e)}getTomtearealetItems(e,t){return[y(e?.tomtearealByggeomraade)?{resourceValues:{data:e?.tomtearealByggeomraade,isTotal:!1},resourceBindings:t?.tomtearealByggeomraade}:null,y(e?.tomtearealSomTrekkesFra)?{resourceValues:{data:e?.tomtearealSomTrekkesFra,isTotal:!1},resourceBindings:t?.tomtearealSomTrekkesFra}:null,y(e?.tomtearealBeregnet)?{resourceValues:{data:e?.tomtearealBeregnet,isTotal:!0},resourceBindings:t?.tomtearealBeregnet}:null].filter(e=>null!==e)}}class nt extends e{constructor(e){super(e);const t=this.getTextResourceBindings(e),s=this.getValueFromFormData(e,t),n=!this.hasContent(s),r=this.getValidationMessages(t);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings={emptyFieldText:t?.arealdisponering?.emptyFieldText||void 0},this.resourceValues={title:!e?.hideTitle&&w(t?.arealdisponering?.title),data:n?w(t?.arealdisponering?.emptyFieldText):s}}getValueFromFormData(e,t){const s=j(e);if(!y(s))return;const n=new tt(s),r=new st(n,t);return this.hasArealdisponeringSummationProps(r)?r:void 0}hasArealdisponeringSummationProps(e){return this.hasBebyggelsenData(e)||this.hasTomtearealetData(e)}hasBebyggelsenData(e){return y(e?.bebyggelsen?.resourceValues?.data)}hasTomtearealetData(e){return y(e?.tomtearealet?.resourceValues?.data)}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}getTextResourceBindings(e){const t={tomtearealet:{title:e?.resourceBindings?.tomtearealet?.title||"resource.rammebetingelser.arealdisponering.tomtearealet.title"},bebyggelsen:{title:e?.resourceBindings?.bebyggelsen?.title||"resource.rammebetingelser.arealdisponering.bebyggelsen.title"},arealBebyggelseEksisterende:{title:e?.resourceBindings?.arealBebyggelseEksisterende?.title||"resource.rammebetingelser.arealdisponering.arealBebyggelseEksisterende.title",emptyFieldText:e?.resourceBindings?.arealBebyggelseEksisterende?.emptyFieldText||"resource.emptyFieldText.default",unit:"resource.unit.meterSquared"},arealBebyggelseNytt:{title:e?.resourceBindings?.arealBebyggelseNytt?.title||"resource.rammebetingelser.arealdisponering.arealBebyggelseNytt.title",emptyFieldText:e?.resourceBindings?.arealBebyggelseNytt?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.plus",unit:"resource.unit.meterSquared"},arealBebyggelseSomSkalRives:{title:e?.resourceBindings?.arealBebyggelseSomSkalRives?.title||"resource.rammebetingelser.arealdisponering.arealBebyggelseSomSkalRives.title",emptyFieldText:e?.resourceBindings?.arealBebyggelseSomSkalRives?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.minus",unit:"resource.unit.meterSquared"},arealSumByggesak:{title:e?.resourceBindings?.arealSumByggesak?.title||"resource.rammebetingelser.arealdisponering.arealSumByggesak.title",emptyFieldText:e?.resourceBindings?.arealSumByggesak?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.equals",unit:"resource.unit.meterSquared"},beregnetMaksByggeareal:{title:e?.resourceBindings?.beregnetMaksByggeareal?.title||"resource.rammebetingelser.arealdisponering.beregnetMaksByggeareal.title",emptyFieldText:e?.resourceBindings?.beregnetMaksByggeareal?.emptyFieldText||"resource.emptyFieldText.default",unit:"resource.unit.meterSquared"},parkeringsarealTerreng:{title:e?.resourceBindings?.parkeringsarealTerreng?.title||"resource.rammebetingelser.arealdisponering.parkeringsarealTerreng.title",emptyFieldText:e?.resourceBindings?.parkeringsarealTerreng?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.plus",unit:"resource.unit.meterSquared"},tomtearealBeregnet:{title:e?.resourceBindings?.tomtearealBeregnet?.title||"resource.rammebetingelser.arealdisponering.tomtearealBeregnet.title",emptyFieldText:e?.resourceBindings?.tomtearealBeregnet?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.equals",unit:"resource.unit.meterSquared"},tomtearealByggeomraade:{title:e?.resourceBindings?.tomtearealByggeomraade?.title||"resource.rammebetingelser.arealdisponering.tomtearealByggeomraade.title",emptyFieldText:e?.resourceBindings?.tomtearealByggeomraade?.emptyFieldText||"resource.emptyFieldText.default",unit:"resource.unit.meterSquared"},tomtearealSomTrekkesFra:{title:e?.resourceBindings?.tomtearealSomTrekkesFra?.title||"resource.rammebetingelser.arealdisponering.tomtearealSomTrekkesFra.title",emptyFieldText:e?.resourceBindings?.tomtearealSomTrekkesFra?.emptyFieldText||"resource.emptyFieldText.default",operator:"resource.operator.minus",unit:"resource.unit.meterSquared"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.arealdisponering={...t.arealdisponering,title:e?.resourceBindings?.title||"resource.arealdisponering.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.arealdisponering={...t.arealdisponering,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class rt extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=!this.hasContent(t);this.isEmpty=s,this.resourceValues={title:w(e?.resourceBindings?.title),data:s?w(e?.resourceBindings?.emptyFieldText):t}}getResourcesForDataItems(e){return Array.isArray(e)?e.map(e=>({resourceValues:{...e.resourceValues,...M(e?.resourceBindings)}})):[]}getValueFromFormData(e){const t=j(e),s=this.getResourcesForDataItems(t);return y(s)?s:[]}hasContent(e){return y(e)}}class it extends e{constructor(e){super(e),this.isEmpty=!this.hasContent(e),this.resourceValues=e?.resourceValues||{}}hasContent(e){return y(e?.resourceValues?.data)}}class at{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 ot extends e{constructor(e){super(e);const t=["eksisterende","faste","framtidige","midlertidige","utleieBygg"],s=this.getTextResourceBindings(e,t),n=this.getValueFromFormData(e,t,s),r=!this.hasContent(n),i=this.getValidationMessages(s);this.isEmpty=r,this.validationMessages=i,this.hasValidationMessages=K(i),this.resourceBindings=s,this.resourceValues={data:r?w(e?.resourceBindings?.emptyFieldText):n}}getValueFromFormData(e,t,s){const n=j(e);if(!y(n))return;const r=new at(n);return this.hasArbeidsplasserBeroertProps(r,t)?this.getArbeidsplasserBeroertArray(r,t,s):void 0}getArbeidsplasserBeroertArray(e,t,s){return t.map(t=>({title:w(s[t]?.title),value:e[t]?w(s[t]?.trueText):w(s[t]?.falseText)}))}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(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 lt 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=K(n),this.resourceValues={title:w(e?.resourceBindings?.title),data:s?w(e?.resourceBindings?.emptyFieldText):t}}getValueFromFormData(e){const t=j(e);return y(t)?{tableHeaders:this.getTableHeadersFromProps(e),tableRows:this.getTableRowsFromProps(e,t)}:null}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:w(t),props:e.props}})}(t);var n;return e.showRowNumbers&&s.unshift({text:(n=e,w(n?.resourceBindings?.rowNumberTitle)||"#")}),s}getTableRowsFromProps(e,t){const s=function(e,t){return!Array.isArray(t)&&(t=[t]),t.map(t=>{const s=[];return e.forEach(e=>{const n=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,i=w(r),a={resourceBindings:e.resourceBindings,resourceValues:{data:n},format:e.format,hideTitle:!0,tagName:e.tagName,isChildComponent:!0};y(i)&&(a.resourceValues.emptyFieldText=i),s.push(a)}),s})}(e?.tableColumns||[],t),n=this.removeEmptyTableRows(s);return e.showRowNumbers?n.map((e,t)=>[{tagName:"custom-field-data",hideTitle:!0,isChildComponent:!0,resourceValues:{data:t+1}},...e]):n}getValidationMessagesFromProps(e){return function(e,t=new O){const s=V();return e.forEach((e,n)=>{Object.keys(e?.textResourceBindings||{}).forEach(r=>{const i=s?.resources?.find(t=>t.id===e.textResourceBindings[r]);i?""===i.value&&t.info.push(`Empty text resource binding with id: "${e.textResourceBindings[r]}" for "${r}" at table column [${n}]`):t.error.push(`Missing text resource binding with id: "${e.textResourceBindings[r]}" for "${r}" at table column [${n}]`)})}),t}(e?.tableColumns)}removeEmptyTableRows(e){return Array.isArray(e)?e.map(e=>{const t=e.map(e=>Rt(e));return t.filter(e=>!e?.isEmpty).length>0?t:null}).filter(e=>null!==e):[]}hasContent(e){return y(e)}}class ut extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.resourceValues={data:n?w(s?.eiendomByggested?.emptyFieldText):t}}getValueFromFormData(e){const t=j(e);return this.getEiendomListFromData(t)}getEiendomListFromData(e){if(y(e))return e.map(e=>new m(e)).filter(e=>this.hasEiendomValue(e))}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}hasKommunenavn(e){return y(e?.kommunenavn)}hasZipCodeOrCity(e){return y(e?.adresse?.postnr)||y(e?.adresse?.poststed)}hasAdresseLinje(e){return y(e?.adresse?.adresselinje1)||y(e?.adresse?.adresselinje2)||y(e?.adresse?.adresselinje3)}hasAdresse(e){return this.hasAdresseLinje(e)||this.hasZipCodeOrCity(e)||this.hasKommunenavn(e)}hasEiendomNummerField(e){return y(e?.bolignummer)||y(e?.bygningsnummer)||y(e?.eiendomsidentifikasjon?.gaardsnummer)||y(e?.eiendomsidentifikasjon?.bruksnummer)||y(e?.eiendomsidentifikasjon?.seksjonsnummer)||y(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 dt{constructor(e){this.risikotype=e?.risikotype&&new r(e.risikotype),this.sikkerhetsklasse=e?.sikkerhetsklasse&&new r(e.sikkerhetsklasse)}}class ct extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.resourceValues={data:n?w(s?.eiendomByggested?.emptyFieldText):t}}getValueFromFormData(e){const t=j(e);return this.getOmraaderisikoListFromData(t)}getOmraaderisikoListFromData(e){if(y(e))return Array.isArray(e)?e.map(e=>new dt(e)).filter(e=>this.hasOmraaderisikoValue(e)):[]}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}hasRisikotype(e){return y(e?.risikotype?.kodebeskrivelse)}hasSikkerhetsklasse(e){return y(e?.sikkerhetsklasse?.kodebeskrivelse)}hasOmraaderisikoValue(e){return this.hasRisikotype(e)||this.hasSikkerhetsklasse(e)}getTextResourceBindings(e){const t={risikotype:{title:e?.resourceBindings?.risikotype?.title||"resource.kravTilByggegrunn.muligeOmraadeRisikoer.omraadeRisiko.risikotype.title",emptyFieldText:e?.resourceBindings?.risikotype?.emptyFieldText||"resource.emptyFieldText.default"},sikkerhetsklasse:{title:e?.resourceBindings?.sikkerhetsklasse?.title||"resource.kravTilByggegrunn.muligeOmraadeRisikoer.omraadeRisiko.sikkerhetsklasse.title",emptyFieldText:e?.resourceBindings?.sikkerhetsklasse?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.omraadeRisiko={title:e?.resourceBindings?.title||"resource.kravTilByggegrunn.muligeOmraadeRisikoer.omraadeRisiko.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.omraadeRisiko={...t.omraadeRisiko,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}class mt extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.partType=e?.partType,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.resourceValues={data:n?w(e?.resourceBindings?.emptyFieldText):t}}getPartTypeFromElementAttributes(e){return e.getAttribute("parttype")||"tiltakshaver"}getValueFromFormData(e){const t=j(e);if(!y(t))return;const s=new S(t);return this.hasPartValue(s)?s:void 0}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}hasNavnOrOrganisasjonsnummer(e){return y(e?.navn)||y(e?.organisasjonsnummer)}hasTelefonnummer(e){return y(e?.telefonnummer)||y(e?.mobilnummer)}hasEpost(e){return y(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}}class gt extends e{constructor(e){super(e);const t=this.getValueFromFormData(e),s=this.getTextResourceBindings(e),n=!this.hasContent(t),r=this.getValidationMessages(s);this.isEmpty=n,this.validationMessages=r,this.hasValidationMessages=K(r),this.resourceBindings=s,this.resourceValues={data:n?w(s?.plan?.emptyFieldText):t}}getValueFromFormData(e){const t=j(e),s=new Ee({plan:t});return s?.plan}getValidationMessages(e){return $("undefined"!=typeof window&&window.textResources?window.textResources:[],e)}hasContent(e){return y(e)}getTextResourceBindings(e){const t={plan:{},navn:{title:e?.resourceBindings?.navn?.title||"resource.planer.andrePlaner.plan.navn.title",emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText||"resource.emptyFieldText.default"},plantype:{title:e?.resourceBindings?.plantype?.title||"resource.planer.andrePlaner.plan.plantype.title",emptyFieldText:e?.resourceBindings?.plantype?.emptyFieldText||"resource.emptyFieldText.default"}};return 1!=!e?.hideTitle&&"true"!==!e?.hideTitle||(t.plan={title:e?.resourceBindings?.title||"resource.planer.andrePlaner.title"}),1!=!e?.hideIfEmpty&&"true"!==!e?.hideIfEmpty||(t.plan={...t.plan,emptyFieldText:e?.resourceBindings?.emptyFieldText||"resource.emptyFieldText.default"}),t}}function pt(e,t){const s=e?.getAttribute(t);return"true"===s||""===s}function ht(e){const t=JSON.parse(e?.getAttribute("formdata"));return y(t)&&t}function ft(e){const t=e?.getAttribute("tagName")||e?.tagName?.toLowerCase();return y(t)&&t}function yt(e){const t=e?.getAttribute("text");return y(t)&&t}function kt(e){const t=JSON.parse(e?.getAttribute("texts"));return y(t)&&t}function Tt(e){return pt(e,"inline")}function Bt(e){return pt(e,"hideTitle")}function bt(e){const t=e?.getAttribute("size");return _(t)?t?.toString().toLowerCase():void 0}function vt(e){return pt(e,"hideIfEmpty")}function xt(e){const t=JSON.parse(e?.getAttribute("styleOverride")||"{}");return y(t)&&t}function Ft(e){return pt(e,"isChildComponent")}function Vt(e){const t=e?.getAttribute("feedbackType");return y(t)&&t}function Ct(e){const t=e?.getAttribute("itemKey");return y(t)&&t}function Et(e){const t=e?.getAttribute("dataItemKey");return y(t)&&t}function wt(e){const t=e?.getAttribute("dataTitleItemKey");return y(t)&&t}function Mt(e){return pt(e,"hideOrgNr")}function jt(e){const t=e?.getAttribute("format");return y(t)&&t}function Lt(e){const t=JSON.parse(e?.getAttribute("tableColumns"));return y(t)&&t}function It(e){return pt(e,"showRowNumbers")}function Dt(e){const t=JSON.parse(e?.getAttribute("resourceBindings"));return y(t)&&t}function St(e){const t=JSON.parse(e?.getAttribute("resourceValues"));return y(t)&&t}function Ht(e){const t=e?.getAttribute("partType");return y(t)?t:"tiltakshaver"}function At(e){return pt(e,"enableLinks")}function Rt(t){const s=t instanceof HTMLElement?function(e){return{formData:ht(e),tagName:ft(e),text:yt(e),texts:kt(e),inline:Tt(e),hideTitle:Bt(e),size:bt(e),hideIfEmpty:vt(e),styleOverride:xt(e),isChildComponent:Ft(e),feedbackType:Vt(e),itemKey:Ct(e),dataItemKey:Et(e),dataTitleItemKey:wt(e),hideOrgNr:Mt(e),format:jt(e),tableColumns:Lt(e),showRowNumbers:It(e),resourceBindings:Dt(e),resourceValues:St(e),partType:Ht(e),enableLinks:At(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 z(s);case"custom-dispensasjoner-list-data":return new Q(s);case"custom-dispensasjoner-unit-in-list":return new X(s);case"custom-divider":return new ee(s);case"custom-feedback":return new te(s);case"custom-feedback-data":return new se(s);case"custom-feedbacklist-data":return new ne(s);case"custom-feedbacklist-validation-messages":return new re(s);case"custom-field":return new ie(s);case"custom-field-adresse":return new ae(s);case"custom-field-boolean-data":return new oe(s);case"custom-field-boolean-text":return new le(s);case"custom-field-count-data":return new ue(s);case"custom-field-data":return new de(s);case"custom-field-list-data":return new ge(s);case"custom-field-kode":return new ce(s);case"custom-field-kommunens-saksnummer":return new me(s);case"custom-field-part-navn":return new pe(s);case"custom-field-prosjekt":return new fe(s);case"custom-field-telefonnummer":return new ke(s);case"custom-field-utfall-svar-status":return new Be(s);case"custom-group-ettersending":return new Fe(s);case"custom-group-plan":return new Re(s);case"custom-group-sjekklistekrav":return new Ne(s);case"custom-group-utfall-svar":return new Pe(s);case"custom-group-utfall-svar-type":return new Oe(s);case"custom-grouplist-ettersending":return new Ve(s);case"custom-grouplist-plan":return new we(s);case"custom-grouplist-sjekklistekrav":return new je(s);case"custom-grouplist-utfall-svar":return new Le(s);case"custom-grouplist-utfall-svar-type":return new Se(s);case"custom-grouplist-varsling":return new Ae(s);case"custom-header":return new Ke(s);case"custom-header-text":return new $e(s);case"custom-header-text-data":return new ze(s);case"custom-list":return new Ue(s);case"custom-list-data":return new Je(s);case"custom-list-planlagte-loefteinnretninger":return new Ze(s);case"custom-list-tiltaks-formaal":return new We(s);case"custom-list-vedlegg":return new Ye(s);case"custom-paragraph":return new _e(s);case"custom-paragraph-text":return new Qe(s);case"custom-subheader-text":return new Xe(s);case"custom-summation":return new et(s);case"custom-summation-arealdisponering":return new nt(s);case"custom-summation-data":return new rt(s);case"custom-table":return new it(s);case"custom-table-arbeidsplasser":return new ot(s);case"custom-table-data":return new lt(s);case"custom-table-eiendom":return new ut(s);case"custom-table-omraaderisiko":return new ct(s);case"custom-table-part":return new mt(s);case"custom-table-plan":return new gt(s);default:return console.warn(`Unknown component type: ${n}`),null}}function Nt(e,t,s){s={returnHtml:!0,inline:!1,styleOverride:{},...s};const n=document.createElement("div");n.classList.add("field");const r=e?.length?b("custom-field-"):null;e?.length&&n.appendChild(function(e,t,s){const n=document.createElement("span");return t&&(n.id=t),n.classList.add("field-title"),n.innerText=`${e}${s?":":""}`,n}(e,r,s.inline)),s?.inline&&n.classList.add("inline");const i=function(e,t){const s=document.createElement("span");return s.classList.add("field-value"),Array.isArray(e)&&(e=e.join(", ")),"object"==typeof e&&(e=JSON.stringify(e,null,2)),y(e)?s.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}$`),r=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>${r(n)}`}return r(e)}).join("")}(e):e:s.innerHTML="",s}(t,s.enableLinks);return e?.length&&(i.classList.add("has-title"),i.setAttribute("aria-labelledby",r)),n.appendChild(i),T(n,{...s.styleOverride}),s.returnHtml?n.outerHTML:n}function Pt(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-divider",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=document.createElement("hr");T(t,e?.styleOverride),this.innerHTML="",this.appendChild(t)}}),customElements.define("custom-feedback",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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=Rt(this),t=E(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=Nt(e?.resourceValues?.title,e?.resourceValues?.data,t)}}}),customElements.define("custom-header",class extends HTMLElement{connectedCallback(){const e=Rt(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,T(r,n),r.outerHTML}(e),T(this,e?.styleOverride))}}),customElements.define("custom-list",class extends HTMLElement{connectedCallback(){const e=new Rt(this);this.innerHTML=e?.resourceValues?.title?.length?function(e,t,s){const n=document.createElement("div");n.classList.add("field");const r=e?.length?b("custom-field-"):null;e?.length&&n.appendChild(function(e,t){const s=document.createElement("span");return t&&(s.id=t),s.classList.add("field-title"),s.innerText=e,s}(e,r));const i=Pt(t,s,!1);return e?.length&&(i.classList.add("has-title"),i.setAttribute("aria-labelledby",r)),n.appendChild(i),n.outerHTML}(e?.resourceValues?.title,e?.resourceValues?.data):Pt(e?.resourceValues?.data),T(this,e?.styleOverride)}}),customElements.define("custom-paragraph",class extends HTMLElement{connectedCallback(){const e=Rt(this);if(!e?.isEmpty){const t=function(e){const t=e?.resourceValues?.title,s=e?.styleOverride,n=document.createElement("p");return n.innerHTML=t,T(n,s),n.outerHTML}(e);this.innerHTML=t}}});class Ot{constructor(e){const t=this.getIsChildComponentAttributeFromProps(e),s=this.getFormDataAttributeFromProps(e),n=this.getTagNameAttributeFromProps(e),r=this.getSizeAttributeFromProps(e),i=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),g=this.getDataItemKeyAttributeFromProps(e),p=this.getDataTitleItemKeyAttributeFromProps(e),h=this.getIdAttributeFromProps(e),f=this.getFeedbackTypeAttributeFromProps(e),y=this.getHideOrgNr(e),k=this.getFormatAttributeFromProps(e),T=this.getShowRowNumbersAttributeFromProps(e),B=this.getPartTypeAttributeFromProps(e),b=this.getResourceBindingsFromProps(e),v=this.getResourceValuesFromProps(e),x=this.getEnableLinksFromProps(e),F=this.getTextAttributeFromProps(e);t&&(this.isChildComponent=t),s&&(this.formData=s),n&&(this.tagName=n),r&&(this.size=r),i&&(this.hideTitle=i),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),g&&(this.dataItemKey=g),p&&(this.dataTitleItemKey=p),h&&(this.id=h),f&&(this.feedbackType=f),y&&(this.hideOrgNr=y),k&&(this.format=k),T&&(this.showRowNumbers=T),B&&(this.partType=B),b&&(this.resourceBindings=b),v&&(this.resourceValues=v),x&&(this.enableLinks=x),F&&(this.text=F)}getFormDataAttributeFromProps(e){if(!y(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 y(e?.styleOverride)?JSON.stringify(e?.styleOverride):void 0}getGridAttributeFromProps(e){return y(e?.grid)&&JSON.stringify(e?.grid)}getTableColumnsAttributeFromProps(e){return y(e?.tableColumns)&&JSON.stringify(e?.tableColumns)}getItemKeyAttributeFromProps(e){return y(e?.itemKey)&&e?.itemKey}getDataItemKeyAttributeFromProps(e){return y(e?.dataItemKey)&&e?.dataItemKey}getDataTitleItemKeyAttributeFromProps(e){return y(e?.dataTitleItemKey)&&e?.dataTitleItemKey}getIdAttributeFromProps(e){return y(e?.id)&&e?.id}getFeedbackTypeAttributeFromProps(e){return y(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 y(e?.format)&&e?.format?.toString()}getShowRowNumbersAttributeFromProps(e){return"true"===e?.showRowNumbers?.toString()?"true":void 0}getPartTypeAttributeFromProps(e){return y(e?.partType)&&e?.partType}getResourceBindingsFromProps(e){return y(e?.resourceBindings)&&JSON.stringify(e?.resourceBindings)}getResourceValuesFromProps(e){return y(e?.resourceValues)?JSON.stringify(e?.resourceValues):null}getEnableLinksFromProps(e){return"true"===e?.enableLinks?.toString()?"true":void 0}getTextAttributeFromProps(e){return y(e?.text)&&e?.text}}function Kt(e){const t=e?.resourceValues?.data,s=e?.styleOverride,n=document.createElement("table"),r=document.createElement("thead"),i=document.createElement("tr");if(t?.tableHeaders?.length&&t?.tableRows?.length){t.tableHeaders.forEach(e=>{i.appendChild(function(e){const t=document.createElement("th");return t.textContent=e.text,T(t,e?.props?.styleOverride),t}(e))}),r.appendChild(i),n.appendChild(r);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 Ot(e);return t.innerHTML=v("custom-field-data",s).outerHTML,t}(e))}),t}(t))}),n.appendChild(e)}else{const t=B(e);if(t?.length){const e=document.createElement("tr"),s=document.createElement("td");s.textContent=t,e.appendChild(s),n.appendChild(e)}}return T(n,s),n}function $t(e){return v("custom-feedbacklist-validation-messages",new Ot({isChildComponent:!0,resourceValues:{data:e}}))}function zt(e,t){switch(e){case"error":return`Errors (${t})`;case"warning":return`Warnings (${t})`;case"info":return`Information (${t})`;default:return`Messages (${t})`}}function Ut(e,t){return v("custom-group-ettersending",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceValues:{data:e}}))}function Jt(e,t){return v("custom-group-sjekklistekrav",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceBindings:{trueText:t?.resourceBindings?.trueText,falseText:t?.resourceBindings?.falseText,defaultText:t?.resourceBindings?.defaultText},resourceValues:{data:e}}))}function qt(){return v("custom-divider",new Ot({styleOverride:{margin:0}}))}function Gt(e,t){return v("custom-group-utfall-svar",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:t?.enableLinks,resourceValues:{data:e}}))}function Zt(e){return x(v("custom-summation-data",new Ot({size:"h3",hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:e?.resourceBindings})))}function Wt(e,t="h1"){const s=e?.resourceValues?.data,n=s?.dispensasjonBeskrivelse?.dispensasjonTittel?.kodebeskrivelse;return y(n)?v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:n}})):null}customElements.define("custom-summation",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e){const t=document.createElement("div");return t.classList.add("custom-summation"),e&&Array.isArray(e)&&e.length&&e.forEach(e=>{const s=function(e){const t=document.createElement("div");t.classList.add("summation-item");const s=e?.resourceValues?.operator||"",n=e?.resourceValues?.title||"",r=n?.length?b("custom-field-"):null,i=y(e?.resourceValues?.data)?e?.resourceValues?.data:"0",a=e?.resourceValues?.unit||"";(!0===e?.resourceValues?.isTotal||"true"===e?.resourceValues?.isTotal)&&t.classList.add("total"),t.appendChild(function(e){const t=document.createElement("span");return t.classList.add("summation-item-operator"),t.innerText=e,t}(s)),t.appendChild(function(e,t){const s=document.createElement("span");return t&&(s.id=t),s.classList.add("summation-item-title"),s.innerText=e,s}(n,r));const o=function(e,t){const s=document.createElement("span");return y(e)?(s.classList.add("summation-item-data"),s.innerText=e+(t?.length?` ${t}`:""),s):s}(i,a);return n?.length&&(o.classList.add("has-title"),o.setAttribute("aria-labelledby",r)),t.appendChild(o),t.outerHTML}(e);t.innerHTML+=s}),t}(e?.resourceValues?.data);this.innerHTML="",y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t){const s=new Ot({size:t,resourceValues:{title:e}});if(e)return v("custom-header",s)}(e?.resourceValues?.title,e?.size)),this.appendChild(t)}}}),customElements.define("custom-table",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=Kt(e);this.innerHTML="",y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t){const s=new Ot({size:t,resourceValues:{title:e}});if(e)return v("custom-header",s)}(e?.resourceValues?.title,e?.size)),this.appendChild(t)}}}),customElements.define("custom-dispensasjoner-list-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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 v("custom-dispensasjoner-unit-in-list",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceValues:{data:e}}))}(e))}),t}(e))}}),customElements.define("custom-dispensasjoner-unit-in-list",class extends HTMLElement{connectedCallback(){const e=Rt(this);if(!e.isEmpty){const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){const t=document.createElement("div");return t.appendChild(function(e){return v("custom-header-text-data",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({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=Rt(this),t=E(this);if(e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-feedback",t).outerHTML}}}),customElements.define("custom-feedbacklist-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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),T(n);const i=document.createElement("summary");i.classList.add("feedback-summary"),i.innerHTML=e,r.appendChild(i);const a=document.createElement("div");return a.classList.add("feedback-list"),t.forEach(e=>{const t=document.createElement("div");t.classList.add("feedback-list-item");const s=new Ot({isChildComponent:!0,feedbackType:"default",resourceValues:{data:e}});t.appendChild(v("custom-feedback-data",s)),a.appendChild(t)}),r.appendChild(a),r.outerHTML}(n,s,e?.feedbackType,e?.styleOverride)}}),customElements.define("custom-feedbacklist-validation-messages",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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=v("custom-feedbacklist-data",new Ot({isChildComponent:!0,feedbackType:s,resourceValues:{title:zt(s,n.length),data:n}}));t.appendChild(e)}}),t.outerHTML}(s)}}),customElements.define("custom-field-adresse",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=new Ot(e);this.innerHTML=v("custom-field",s).outerHTML,t&&this.appendChild(t)}}}),customElements.define("custom-field-part-navn",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=B(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new Ot(e);this.innerHTML=v("custom-field",s).outerHTML}}}),customElements.define("custom-field-boolean-data",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-boolean-text",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-count-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-list-data",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(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(x(v("custom-field-data",new Ot({isChildComponent:!0,resourceValues:e}))))}),t}(e);this.innerHTML=t.outerHTML}}}),customElements.define("custom-field-kode",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-prosjekt",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}}}),customElements.define("custom-field-telefonnummer",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=B(e);e.isEmpty&&e.setFormData({simpleBinding:t});const s=new Ot(e);this.innerHTML=v("custom-field",s).outerHTML}}}),customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML;const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-ettersending",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.title,e?.size));for(const t of e?.resourceValues?.data??[]){const s=Ut(t,e);this.appendChild(s);const n=v("custom-divider");this.appendChild(n)}const t=e.hasValidationMessages&&$t(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-sjekklistekrav",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.title,e?.size));const t=document.createElement("div");t.className="sjekklistekrav-list";for(const s of e?.resourceValues?.data??[]){const n=Jt(s,e);t.appendChild(n);const r=qt();t.appendChild(r)}this.appendChild(t),t.lastChild&&t.removeChild(t.lastChild);const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-grouplist-utfall-svar",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{y(e?.resourceValues?.title)&&!0!==e?.hideTitle&&this.appendChild(function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.title,e?.size));for(const t of e?.resourceValues?.data??[]){const s=Gt(t,e);this.appendChild(s);const n=v("custom-divider");this.appendChild(n)}const t=e.hasValidationMessages&&$t(e?.validationMessages);t&&this.appendChild(t)}}}),customElements.define("custom-grouplist-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(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 v("custom-group-utfall-svar-type",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceValues:{data:s,utfallType:t}}))}(e,t);this.appendChild(s)})}}),customElements.define("custom-grouplist-varsling",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=function(e){return v("custom-grouplist-sjekklistekrav",new Ot({isChildComponent:!0,hideIfEmpty:e?.hideIfEmpty,enableLinks:e?.enableLinks,resourceBindings:e?.resourceBindings,resourceValues:e?.resourceValues}))}(e);this.appendChild(t);const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-ettersending",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=document.createElement("div");y(e?.resourceValues?.data?.tittel)&&!0!==e?.hideTitle&&t.appendChild(function(e,t="h3"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.data?.tittel,e?.size)),t.appendChild(function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-list-vedlegg",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-sjekklistekrav",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=document.createElement("div");y(e?.resourceValues?.data?.tittel)&&!0!==e?.hideTitle&&t.appendChild(function(e,t="h3"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.data?.tittel,e?.size)),t.appendChild(function(e){const t=F();return t.appendChild(function(e){const t=e?.resourceValues?.data,s={xs:11};return x(v("custom-field",new Ot({isChildComponent:!0,hideIfEmpty:!1,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 x(v("custom-field-boolean-text",new Ot({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&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=document.createElement("div");y(e?.resourceValues?.data?.tittel)&&!0!==e?.hideTitle&&t.appendChild(function(e,t="h3"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.data?.tittel,e?.size)),t.appendChild(function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,enableLinks:e?.enableLinks,resourceValues:{data:t?.beskrivelse}})))}(e)),t.appendChild(function(e){const t=e?.resourceValues?.data;return x(v("custom-field-utfall-svar-status",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-list-vedlegg",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e?.resourceBindings?.["vedleggsliste.vedlegg.title"]},resourceValues:{data:t?.vedleggsliste?.vedlegg}})))}(e)),this.appendChild(t);const s=e.hasValidationMessages&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-group-utfall-svar-type",class extends HTMLElement{async connectedCallback(){const e=Rt(this);if(!e.isEmpty){const t=function(e){return v("custom-grouplist-utfall-svar",new Ot({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&&$t(e?.validationMessages);s&&this.appendChild(s)}}}),customElements.define("custom-header-text",class extends HTMLElement{connectedCallback(){const e=new Rt(this);e?.isChildComponent||T(E(this),{padding:"0 0.75rem"});const t=new Ot(e);this.innerHTML=v("custom-header",t).outerHTML}}),customElements.define("custom-header-text-data",class extends HTMLElement{connectedCallback(){const e=new Rt(this);e?.isChildComponent||T(E(this),{padding:"0 0.75rem"});const t=new Ot(e);this.innerHTML=v("custom-header",t).outerHTML}}),customElements.define("custom-list-data",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e),s=e.isEmpty?"custom-field":"custom-list";this.innerHTML=v(s,t).outerHTML}}}),customElements.define("custom-list-planlagte-loefteinnretninger",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){return v("custom-list",new Ot(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-list-tiltaks-formaal",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=new Ot(e),s=e.isEmpty?"custom-field":"custom-list";this.innerHTML=v(s,t).outerHTML}}}),customElements.define("custom-list-vedlegg",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=new Ot(e);this.innerHTML=v("custom-field",t).outerHTML}else{const t=new Ot(e);this.innerHTML=v("custom-list",t).outerHTML}}}),customElements.define("custom-paragraph-text",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=new Ot(e);this.innerHTML=v("custom-paragraph",t).outerHTML}}),customElements.define("custom-subheader-text",class extends HTMLElement{connectedCallback(){const e=Rt(this),t=new Ot(e);this.innerHTML=v("custom-paragraph",t).outerHTML}}),customElements.define("custom-summation-arealdisponering",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else if(e?.isEmpty){const t=function(e){return v("custom-paragraph",new Ot({isChildComponent:!0,resourceValues:{title:e?.resourceValues?.data}}))}(e);this.appendChild(t)}else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){const t=e?.resourceValues?.data?.bebyggelsen,s=e?.resourceValues?.data?.tomtearealet;if(t||s){const e=document.createElement("div");if(s){const t=Zt({resourceValues:s?.resourceValues,resourceBindings:s?.resourceBindings});e.appendChild(t)}if(t){const s=Zt({resourceValues:t?.resourceValues,resourceBindings:t?.resourceBindings});e.appendChild(s)}return e}return null}(e);e?.resourceValues?.title&&!0!==e?.hideTitle&&this.appendChild(function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceValues:{title:e}}))}(e?.resourceValues?.title,e?.size)),this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-summation-data",class extends HTMLElement{connectedCallback(){const e=new Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){return v("custom-summation",new Ot({size:"h3",hideIfEmpty:e?.hideIfEmpty,hideTitle:e?.hideTitle,isChildComponent:!0,resourceValues:e?.resourceValues}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-arbeidsplasser",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(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 v("custom-table-data",new Ot({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=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){return v("custom-table",new Ot(e))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-eiendom",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(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 v("custom-table-data",new Ot({size:e?.size,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-omraaderisiko",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){const t=[{dataKey:"risikotype.kodebeskrivelse",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.risikotype?.title,emptyFieldText:e?.resourceBindings?.risikotype?.emptyFieldText}},{dataKey:"sikkerhetsklasse.kodebeskrivelse",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.sikkerhetsklasse?.title,emptyFieldText:e?.resourceBindings?.sikkerhetsklasse?.emptyFieldText}}];return v("custom-table-data",new Ot({size:e?.size,hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.omraadeRisiko?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-table-part",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(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 v("custom-table-data",new Ot({size:e?.size,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-table-plan",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e?.hideIfEmpty&&e.isEmpty&&t)t.style.display="none";else{const t=e.hasValidationMessages&&$t(e?.validationMessages),s=function(e){const t=[{dataKey:"navn",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.navn?.title,emptyFieldText:e?.resourceBindings?.navn?.emptyFieldText}},{dataKey:"plantype.kodebeskrivelse",tagName:"custom-field-data",resourceBindings:{title:e?.resourceBindings?.plantype?.title,emptyFieldText:e?.resourceBindings?.plantype?.emptyFieldText}}];return v("custom-table-data",new Ot({size:e?.size,hideIfEmpty:!0,isChildComponent:!0,resourceValues:e?.resourceValues,resourceBindings:{title:e?.resourceBindings?.plan?.title},tableColumns:t}))}(e);this.appendChild(s),t&&this.appendChild(t)}}}),customElements.define("custom-dispensasjon",class extends HTMLElement{async connectedCallback(){const e=Rt(this),t=E(this);if(e.isEmpty&&t)t.style.display="none";else{const t=F(),s=Wt(e),n=function(e){const t=e?.resourceValues?.data,s={xs:6};return x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.metadataFtbId?.title},resourceValues:{data:t?.metadata?.ftbId}})),s)}(e),i=function(e){const t=e?.resourceValues?.data,s={xs:6};return x(v("custom-field-kommunens-saksnummer",new Ot({isChildComponent:!0,hideIfEmpty:!0,grid:s,resourceBindings:{title:e.resourceBindings?.kommunensSaksnummer?.title},resourceValues:{data:t?.kommunensSaksnummer}})),s)}(e),a=function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.soeknadGjelderHeader?.title}}))}(e),o=function(e){const t=e?.resourceValues?.data;return v("custom-table-eiendom",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.eiendomByggested?.title},resourceValues:{data:t?.eiendomByggested?.eiendom}}))}(e),l=function(e,t="h3"){const s=e?.resourceValues?.data;return s?.tiltakstyper?.type?.kode?.length>0?v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeHeader?.title}})):null}(e),u=function(e){const t=e?.resourceValues?.data;return x(v("custom-list-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,itemKey:"kodebeskrivelse",resourceBindings:{title:e.resourceBindings?.tiltakstyperTypeKode?.title},resourceValues:{data:t?.tiltakstyper?.type?.kode}})))}(e),d=function(e){const t=e?.resourceValues?.data;return v("custom-table-part",new Ot({isChildComponent:!0,partType:"tiltakshaver",hideIfEmpty:!0,resourceValues:{data:t?.tiltakshaver}}))}(e),c=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-adresse",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.tiltakshaverAdresse?.title},resourceValues:{data:t?.tiltakshaver?.adresse}})))}(e),m=function(e){const t=e?.resourceValues?.data;return v("custom-table-part",new Ot({isChildComponent:!0,partType:"ansvarligSoeker",hideIfEmpty:!0,resourceValues:{data:t?.ansvarligSoeker}}))}(e),g=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-adresse",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.ansvarligSoekerAdresse?.title},resourceValues:{data:t?.ansvarligSoeker?.adresse}})))}(e),p=Wt(e,"h2"),h=function(e){const t=e?.resourceValues?.data;return y(t?.dispensasjonBeskrivelse?.annenInngangsbeskrivelse)||y(t?.dispensasjonBeskrivelse?.inngangsbeskrivelse?.kodebeskrivelse)?x(v("custom-field-boolean-data",new Ot({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),f=function(e){const t=e?.resourceValues?.data;return v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.dispensasjonBeskrivelseBeskrivelse?.title},resourceValues:{data:t?.dispensasjonBeskrivelse?.beskrivelse}}))}(e),k=function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.dispensasjonFraHeader?.title}}))}(e),T=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({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 x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.bestemmelserType?.title},resourceValues:{data:e.isPlanBestemmelseType?t?.dispensasjonFra?.bestemmelserType?.kodebeskrivelse:t?.dispensasjonFra?.lovbestemmelse}})))}(e),V=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.planBestemmelseNummerering?.title},resourceValues:{data:t?.dispensasjonFra?.dispensasjonPlanBestemmelse?.planbestemmelse?.nummerering}})))}(e),C=function(e){return v("custom-header-text",new Ot({isChildComponent:!0,size:"h2",resourceBindings:{title:e.resourceBindings?.stedfestingHeader?.title}}))}(e),E=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinatsystem?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinatsystem?.kodebeskrivelse}})))}(e),w=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingPosisjonKoordinater?.title},resourceValues:{data:t?.stedfesting?.posisjon?.koordinater?.koordinat}})))}(e),M=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.stedfestingVertikalnivaa?.title},resourceValues:{data:t?.stedfesting?.vertikalnivaa?.kodebeskrivelse}})))}(e),j=function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.varighetHeader?.title}}))}(e),L=function(e){const t=e?.resourceValues?.data;return t?.varighet?.oenskesVarigDispensasjon?x(v("custom-paragraph-text",new Ot({isChildComponent:!0,resourceBindings:{title:e.resourceBindings?.varighetOenskesVarigDispensasjon?.trueText}}))):y(t?.varighet?.oensketVarighetTil)?x(v("custom-field-data",new Ot({isChildComponent:!0,format:"date",resourceBindings:{title:e.resourceBindings?.varighetOensketVarighetTil?.title},resourceValues:{data:t?.varighet?.oensketVarighetTil}}))):null}(e),I=function(e,t="h2"){return v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.begrunnelseHeader?.title}}))}(e),S=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.hensynBakBestemmelsen}})))}(e),H=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynBakBestemmelsen?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynBakBestemmelsen}})))}(e),A=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseVurderingHensynOverordnet?.title},resourceValues:{data:t?.begrunnelse?.vurderingHensynOverordnet}})))}(e),R=function(e){const t=e?.resourceValues?.data;return x(v("custom-list-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseFordeler?.title},resourceValues:{data:t?.begrunnelse?.fordeler?.effekt}})))}(e),N=function(e){const t=e?.resourceValues?.data;return x(v("custom-list-data",new Ot({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 x(v("custom-field-data",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{title:e.resourceBindings?.begrunnelseSamletBegrunnelse?.title},resourceValues:{data:t?.begrunnelse?.samletBegrunnelse}})))}(e),O=function(e,t="h2"){const s=e?.resourceValues?.data,n=s?.generelleVilkaar?.norskSvenskDansk;return n?v("custom-header-text",new Ot({isChildComponent:!0,size:t,resourceBindings:{title:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.title}})):null}(e),K=function(e){const t=e?.resourceValues?.data;return x(v("custom-field-boolean-text",new Ot({isChildComponent:!0,hideIfEmpty:!0,resourceBindings:{trueText:e.resourceBindings?.generelleVilkaarNorskSvenskDansk?.trueText,falseText:"",defaultText:""},resourceValues:{data:t?.generelleVilkaar?.norskSvenskDansk}})))}(e),$=$t(e?.validationMessages);D(t,[s,n,r,i]),D(t,[a,o,l,u]),y(e?.resourceValues?.data?.ansvarligSoeker)?D(t,[m,g]):y(e?.resourceValues?.data?.tiltakshaver)&&D(t,[d,c]),D(t,[p,h,f]),e.isPlanBestemmelseType?D(t,[k,T,B,b,V]):D(t,[k,b]),D(t,[C,E,w,M]),D(t,[j,L]),D(t,[I,S,H,A,R,N,P]),D(t,[O,K]),D(t,[$]),this.appendChild(t)}}});class Yt{constructor(e){this.eiendomByggested=e?.eiendomByggested&&new g(e.eiendomByggested),this.kommunensSaksnummer=e?.kommunensSaksnummer&&new p(e.kommunensSaksnummer),this.metadata=e?.metadata&&new h(e.metadata),this.versjon=e?.versjon}}function _t(e){return M(e)}const Qt={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 Yt({eiendomByggested:y(t?.eiendomByggested)?t.eiendomByggested:null,kommunensSaksnummer:y(t?.kommunensSaksnummer)?t.kommunensSaksnummer:null,metadata:y(t?.metadata)?t.metadata:null,versjon:t?.versjon?t.versjon:null})}(this),s=$(e,Qt),n=E(this);if(!y(t)&&n)n.style.display="none";else{const n=function(e,t){return v("custom-field-data",{formData:{simpleBinding:e?.versjon},text:w(t),emptyFieldText:"(gjennomfoeringsplanNummer mangler)"})}(t,e),r=function(e,t){return v("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:_t(t),styleOverride:{tableLayout:"fixed"}})}(t?.eiendomByggested?.eiendom,e),i=$t(s);this.appendChild(n),this.appendChild(r),this.appendChild(i)}}}),window.addEventListener("load",async()=>{const e=window.location.pathname.split("/"),t=window.location.origin,s=e?.[1],n=e?.[2];if(![t?.length,s?.length,n?.length].every(Boolean))return void console.error("Could not determine the origin, organization, or application from the URL.");const r=`${t}/${s}/${n}/api/v1/profile/user`,i=await fetch(r).then(e=>e.json());if(!i?.profileSettingPreference?.language)return void console.error("Could not determine the user's language preference.");const a=i?.profileSettingPreference?.language;window.selectedLanguage=a;const o=`${t}/${s}/${n}/api/v1/texts/${a}`,l=await fetch(o).then(e=>e.json());if(y(l))window.textResources=l;else{console.error("Could not retrieve text resources for the selected language.");const e=`${t}/${s}/${n}/api/v1/texts/nb`,r=await fetch(e).then(e=>e.json());if(window.textResources=r,!y(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.26.0",
3
+ "version": "11.26.2",
4
4
  "description": "Custom components for Altinn Studio",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/main.js",