@oslokommune/punkt-elements 19.19.1 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/dist/{accordion-Bg4CMrUM.cjs → accordion-5N_ptxrN.cjs} +1 -1
- package/dist/{accordion-BHVzR-6Z.js → accordion-C5cu1xXT.js} +5 -5
- package/dist/{alert-BAaZIR3e.js → alert-CA1fDbyc.js} +5 -5
- package/dist/{alert-Dy5N7qK-.cjs → alert-DkyTTo7S.cjs} +1 -1
- package/dist/{async-directive-C4LocQwR.js → async-directive-BcS8rfeC.js} +2 -2
- package/dist/{async-directive-DpyKp6qv.cjs → async-directive-DCLIOGR8.cjs} +1 -1
- package/dist/{backlink-Dlkyj0ns.js → backlink-CDBRcaAu.js} +3 -3
- package/dist/{backlink-BnWruRuj.cjs → backlink-CXOxMeyt.cjs} +1 -1
- package/dist/{breadcrumbs-Bfv8W2CF.js → breadcrumbs-5oUaCef3.js} +2 -2
- package/dist/{breadcrumbs-CyWtnx2B.cjs → breadcrumbs-zfUto2U5.cjs} +1 -1
- package/dist/{button-CF9k3ARf.js → button-Bswo1C0M.js} +5 -5
- package/dist/{button-BBFI3FuT.cjs → button-bVWAX98x.cjs} +1 -1
- package/dist/{calendar-BX3n3vhs.js → calendar-BOd-9PDd.js} +3 -3
- package/dist/{calendar-Dds9KFiE.cjs → calendar-CDTCgTJn.cjs} +1 -1
- package/dist/{card-Ddu0sQ0f.js → card-DH1kPnyi.js} +44 -42
- package/dist/card-njWrvrHm.cjs +67 -0
- package/dist/{checkbox-D9-KugOh.js → checkbox-DIJbuqWm.js} +5 -5
- package/dist/{checkbox-group-Dz1ypmbU.js → checkbox-group-DLLbWgQb.js} +3 -3
- package/dist/{checkbox-group-BlBgrzKG.cjs → checkbox-group-Kua6HuRE.cjs} +1 -1
- package/dist/{checkbox-B8foyiOW.cjs → checkbox-iMOdzpJ_.cjs} +2 -2
- package/dist/{class-map-BkEYw5uE.js → class-map-BDwVSgLb.js} +1 -1
- package/dist/{class-map-Bh6toDeV.cjs → class-map-C82GtM1w.cjs} +1 -1
- package/dist/{combobox-DLDvyuDh.cjs → combobox-BwAxmoG9.cjs} +1 -1
- package/dist/{combobox-BAkblu9M.js → combobox-H5FLG8BV.js} +12 -12
- package/dist/components/card/card.d.ts +0 -10
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/link/link.d.ts +1 -1
- package/dist/components/linkcard/linkcard.d.ts +0 -1
- package/dist/components/progressbar/progressbar.d.ts +4 -18
- package/dist/components/tabs/tabitem.d.ts +2 -1
- package/dist/components/tag/tag.d.ts +4 -2
- package/dist/{consent-DNHRe0zV.cjs → consent-UkinU27V.cjs} +1 -1
- package/dist/{consent-BTw6uqFf.js → consent-p-0n2b9x.js} +2 -2
- package/dist/{datepicker-C7F1Yc5N.cjs → datepicker-COar3rRT.cjs} +1 -1
- package/dist/{datepicker-9dmdHweu.js → datepicker-ZSwWg8xW.js} +11 -11
- package/dist/{directive-helpers-BAinC437.js → directive-helpers-BoDzpPID.js} +1 -1
- package/dist/{directive-helpers-Bv70GjQh.cjs → directive-helpers-r7akb6wX.cjs} +1 -1
- package/dist/{element-C6WTyJFE.cjs → element-CEarCnHH.cjs} +1 -1
- package/dist/{element-ckeMVgMz.js → element-DLgZkx5L.js} +1 -0
- package/dist/{element-with-slot-B0Vp_OuR.cjs → element-with-slot-CeKuRE3_.cjs} +1 -1
- package/dist/{element-with-slot-Dp2Gzv-Q.js → element-with-slot-mG-h7Sjw.js} +2 -2
- package/dist/{fileupload-M66Pd-QJ.cjs → fileupload-DXJtAagE.cjs} +1 -1
- package/dist/{fileupload-CEwnpxZj.js → fileupload-vPDmtXiM.js} +8 -8
- package/dist/{footer-HFL2sjAY.cjs → footer-CpE05IW2.cjs} +1 -1
- package/dist/{footer-DZ4aA6fj.js → footer-D8t0PCPC.js} +4 -4
- package/dist/{header-BYNzxXCo.js → header-Bo8uvddg.js} +11 -11
- package/dist/{header-BqheRQpR.cjs → header-DzYKgl-k.cjs} +1 -1
- package/dist/{header-menu-DxOSBiTJ.js → header-menu-BrjsNjBH.js} +4 -4
- package/dist/{header-menu-De2DNAXd.cjs → header-menu-Dq9lwNr1.cjs} +1 -1
- package/dist/{heading-B1Ey3XzB.js → heading-CMZmPEL9.js} +2 -2
- package/dist/{heading--hGRDNX9.cjs → heading-DAkjw2Am.cjs} +1 -1
- package/dist/{helptext-BVYv8Lm9.js → helptext-BFQzrOw4.js} +4 -4
- package/dist/{helptext-BbrFE48Y.cjs → helptext-Bse1LpRd.cjs} +1 -1
- package/dist/icon-5A378_yh.cjs +1 -0
- package/dist/{icon-CUU42bZ0.js → icon-C1oCGwEe.js} +2 -2
- package/dist/if-defined-Ci4ZQsgL.cjs +1 -0
- package/dist/{if-defined-D18nY_K_.js → if-defined-DiYi2v_Q.js} +1 -1
- package/dist/{input-element-D82laWtR.cjs → input-element-2LHxo0em.cjs} +1 -1
- package/dist/{input-element-DczlJQb1.js → input-element-De40zUox.js} +2 -2
- package/dist/{input-wrapper-QzdntWJX.cjs → input-wrapper-C_Rzwxx7.cjs} +2 -2
- package/dist/{input-wrapper-CHwWQgZP.js → input-wrapper-DkpJS1hR.js} +7 -7
- package/dist/{link-a1ZK4J1j.cjs → link-B7t4iOKk.cjs} +3 -3
- package/dist/{link-BU6t5Tt9.js → link-DZgG_8Ni.js} +15 -10
- package/dist/linkcard-DIG6VYpl.cjs +15 -0
- package/dist/linkcard-Dr-r8jBO.js +60 -0
- package/dist/{listbox-DFd-1faX.js → listbox-DAvIBH4P.js} +4 -4
- package/dist/{listbox-BbdUu-IV.cjs → listbox-HrH4JonS.cjs} +1 -1
- package/dist/{loader-Y8V3Q82X.js → loader-CFidlqSG.js} +4 -4
- package/dist/{loader-DwGMavG7.cjs → loader-DTIrOtTo.cjs} +1 -1
- package/dist/messagebox-BLYx3AL7.cjs +16 -0
- package/dist/{messagebox-wJcXW5hI.js → messagebox-B_07P0QA.js} +25 -16
- package/dist/{modal-C5AiVm5g.cjs → modal-BvTfLfFq.cjs} +1 -1
- package/dist/{modal-BafCTC4M.js → modal-CA_M2Ix6.js} +6 -6
- package/dist/{option-group-element-CWjgrFwS.cjs → option-group-element-CVNaBIlP.cjs} +1 -1
- package/dist/{option-group-element-ZNyUoLcm.js → option-group-element-DzM8YznZ.js} +3 -3
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.cjs +1 -1
- package/dist/pkt-breadcrumbs.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox-group.cjs +1 -1
- package/dist/pkt-checkbox-group.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +37 -37
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-C193xcN4.cjs → pkt-options-controller-9zoH1OBW.cjs} +1 -1
- package/dist/{pkt-options-controller-CH8U6zlw.js → pkt-options-controller-CzvBlEPD.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radio-group.cjs +1 -1
- package/dist/pkt-radio-group.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/progressbar-BdqIhC1Z.cjs +30 -0
- package/dist/{progressbar-BukfOcRk.js → progressbar-CfCc2zhp.js} +50 -37
- package/dist/{radio-group-Bg6ODpT3.js → radio-group-BRY_74od.js} +3 -3
- package/dist/{radio-group-bpIEEMdL.cjs → radio-group-CsUgnEv0.cjs} +1 -1
- package/dist/{radiobutton-IcDc6ze2.cjs → radiobutton-CQhuG2lj.cjs} +2 -2
- package/dist/{radiobutton-DMvVv81Y.js → radiobutton-lHnq8wX_.js} +5 -5
- package/dist/{ref-CB7e9nMY.cjs → ref-B6p6mQkO.cjs} +1 -1
- package/dist/{ref-D4OwQYdf.js → ref-BAegS9BR.js} +2 -2
- package/dist/{repeat-CnnigVcj.cjs → repeat-CjvNrcUr.cjs} +1 -1
- package/dist/{repeat-BGbBqnfz.js → repeat-Cy1M16Di.js} +2 -2
- package/dist/{searchinput-BV2C1VbN.js → searchinput-BLGaXkP6.js} +4 -4
- package/dist/{searchinput-DqD_iLxV.cjs → searchinput-TAqMUJ0B.cjs} +1 -1
- package/dist/{select-DKBfPgJB.js → select-BvtUxW0Q.js} +7 -7
- package/dist/{select-CHqM6kI-.cjs → select-Dle67Uwv.cjs} +1 -1
- package/dist/shared-strings/nb.d.ts +3 -0
- package/dist/shared-types/card.d.ts +5 -17
- package/dist/shared-types/combobox.d.ts +3 -3
- package/dist/shared-types/icon.d.ts +2 -2
- package/dist/shared-types/index.d.ts +11 -9
- package/dist/shared-types/linkcard.d.ts +7 -4
- package/dist/shared-types/messagebox.d.ts +4 -2
- package/dist/shared-types/progressbar.d.ts +82 -5
- package/dist/shared-types/skin.d.ts +8 -2
- package/dist/{tabs-B2RjklQl.js → tabs-Bu_-WfCK.js} +5 -5
- package/dist/{tabs-BcnYrmjU.cjs → tabs-Dwk5PKzP.cjs} +1 -1
- package/dist/tag-1SSexs0H.cjs +27 -0
- package/dist/{tag-BOTH9kMz.js → tag-CkZ2Mn4a.js} +33 -11
- package/dist/{textarea-B5OfR-QI.cjs → textarea-DSX3jMlI.cjs} +1 -1
- package/dist/{textarea-Du1Z9JUu.js → textarea-Djp5L2Zd.js} +9 -9
- package/dist/{textinput-CRlErItw.js → textinput-CBrOZcvL.js} +8 -8
- package/dist/{textinput-C5KWIB21.cjs → textinput-CN2F3Q3H.cjs} +1 -1
- package/dist/{timepicker-DVqTAxt0.js → timepicker-CT4wfrgQ.js} +8 -8
- package/dist/{timepicker-RxsG0mCF.cjs → timepicker-CkaJkIGn.cjs} +1 -1
- package/package.json +3 -3
- package/src/components/card/card.test.ts +50 -53
- package/src/components/card/card.ts +14 -24
- package/src/components/card/index.ts +2 -2
- package/src/components/checkbox/checkbox.test.ts +3 -3
- package/src/components/checkbox/checkbox.ts +1 -1
- package/src/components/input-wrapper/input-wrapper.ts +1 -1
- package/src/components/link/link.test.ts +14 -18
- package/src/components/link/link.ts +2 -3
- package/src/components/linkcard/linkcard.test.ts +18 -6
- package/src/components/linkcard/linkcard.ts +5 -7
- package/src/components/messagebox/messagebox.test.ts +14 -1
- package/src/components/messagebox/messagebox.ts +13 -2
- package/src/components/progressbar/progressbar.test.ts +47 -5
- package/src/components/progressbar/progressbar.ts +49 -53
- package/src/components/radiobutton/radiobutton.test.ts +1 -1
- package/src/components/radiobutton/radiobutton.ts +1 -1
- package/src/components/tabs/tabitem.ts +6 -2
- package/src/components/tag/tag.test.ts +21 -12
- package/src/components/tag/tag.ts +12 -3
- package/dist/card-mi3VKIoy.cjs +0 -64
- package/dist/icon-CrG6o7ZE.cjs +0 -1
- package/dist/if-defined-CiML3MTM.cjs +0 -1
- package/dist/linkcard-Cu4Rh71U.cjs +0 -14
- package/dist/linkcard-DM0CQbwD.js +0 -56
- package/dist/messagebox-DR-s6tyr.cjs +0 -13
- package/dist/progressbar-YfHSPmqI.cjs +0 -31
- package/dist/tag-DrFK8Wq3.cjs +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-CrG6o7ZE.cjs");const i=require("./input-wrapper-QzdntWJX.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./ref-CB7e9nMY.cjs");require("./tag-DrFK8Wq3.cjs");const s=require("./repeat-CnnigVcj.cjs"),c=require("./listbox-BbdUu-IV.cjs"),l=require("./input-element-D82laWtR.cjs"),u=require("./pkt-options-controller-C193xcN4.cjs");var d={multiple:!1,typeahead:!1,includeSearch:!1,allowUserInput:!1,displayValueAs:`label`,inputSize:`medium`,disabled:!1,hasError:!1,required:!1,requiredTag:!1,optionalTag:!1,fullwidth:!1,inline:!1,useWrapper:!0},f=(e,t,n)=>{switch(e){case`,`:return n?`addValue`:null;case`Enter`:return`addValue`;case`Tab`:case`ArrowDown`:return t?null:`focusListbox`;case`Escape`:return`closeOptions`;default:return null}},p=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=c.i(n,e);return!t.includes(e)&&!a?r?{action:`addUserValue`,value:e}:i?{action:`none`,value:null}:{action:`removeValue`,value:t[0]}:a&&!t.includes(a.value)?{action:`selectOption`,value:a.value}:{action:`none`,value:null}},m=(e,t,n,r,i)=>e.trim().toLowerCase()?{...c.c(e,t,n,r),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:``,shouldRemoveValue:!i&&!!t[0],shouldResetInput:!0},h=(e,t,n)=>{let r=c.i(t,e);return n===`label`&&r?.label?r.label:e},g={markOptionSelected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!0;break}}},markOptionDeselected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!1;break}}},markAllSelected(e){for(let t of e)t.selected=!0},markAllDeselected(e){for(let t of e)t.selected=!1},removeUserAddedOptions(e){return e.filter(e=>!e.userAdded)}},_={parseOptionsFromSlot(e){let t=[];return e.forEach(e=>{if(!e.textContent&&!e.getAttribute(`value`))return;let n={value:e.getAttribute(`value`)||e.textContent||``,label:e.textContent||e.getAttribute(`value`)||``};e.getAttribute(`data-prefix`)&&(n.prefix=e.getAttribute(`data-prefix`)||void 0),e.getAttribute(`tagskincolor`)&&(n.tagSkinColor=e.getAttribute(`tagskincolor`)),e.getAttribute(`description`)&&(n.description=e.getAttribute(`description`)||void 0),n.fulltext=c.r(n),t.push(n)}),t}},v={cloneOptions(e){return Array.isArray(e)?e.map(e=>({...e})):[]},syncOptionsWithValues(e,t){let n=[...t];return e.forEach(e=>{e.value&&!e.label&&(e.label=e.value),e.selected&&!n.includes(e.value)&&n.push(e.value),e.fulltext=c.r(e),e.selected=e.selected||n.includes(e.value)}),{options:e,newValues:n}},mergeWithUserAdded(e,t,n){return[...t.filter(e=>e?.userAdded&&n.includes(e.value)).filter(t=>!(Array.isArray(e)?e:[]).some(e=>e.value===t.value)),...e]}},y=class extends l.t{constructor(){super(),this.value=``,this.options=[],this.defaultOptions=[],this.allowUserInput=d.allowUserInput,this.typeahead=d.typeahead,this.includeSearch=d.includeSearch,this.searchPlaceholder=null,this.multiple=d.multiple,this.maxlength=null,this.displayValueAs=d.displayValueAs,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage=``,this._messageValue=null,this._addValueText=null,this._maxIsReached=!1,this._search=``,this._inputFocus=!1,this._skipInputTab=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=o.t(),this.triggerRef=o.t(),this.listboxRef=o.t(),this._pendingDispatchFrom=null,this.optionsController=new u.t(this)}get _hasTextInput(){return this.typeahead||this.allowUserInput}get _selectionDescription(){if(this.multiple&&this._value.length!==0)return`${this._value.length} valgt`}focusTrigger(){this._hasTextInput?this.inputRef.value?.focus():this.triggerRef.value?.focus()}focusAfterCommit(){this._skipInputTab=!0;let e=this.inputRef.value;e&&e.type!==`hidden`&&e.setAttribute(`tabindex`,`-1`),this.triggerRef.value?.focus()}restoreInputTab(){this._skipInputTab=!1}parseValue(){return this.parseToValues(this.value)}parseToValues(e){return Array.isArray(e)?this.multiple?e:e.length>0?[e[0]]:[]:e&&this.multiple?e.split(`,`):e?[e]:[]}updateMaxReached(){this._maxIsReached=c.l(this._value.length,this.maxlength)}syncPublicValue(){let e=this.multiple?this._value.join(`,`):this._value[0]||``;e!==(Array.isArray(this.value)?this.value.join(`,`):String(this.value||``))&&(this.value=e)}dispatchValueChange(e){let t=this._value;if(e?.join(`,`)!==t.join(`,`)){let e=this.multiple?[...t]:t[0]||``;this.onChange(e)}else t.length===0&&e&&e.length>0&&this.clearInputValue()}onChange(e){this.touched=!0,super.onChange(e)}valueChanged(){}};e.n([e.u({type:String,reflect:!0})],y.prototype,`value`,void 0),e.n([e.u({type:Array})],y.prototype,`options`,void 0),e.n([e.u({type:Array,attribute:`default-options`})],y.prototype,`defaultOptions`,void 0),e.n([e.u({type:Boolean,attribute:`allow-user-input`})],y.prototype,`allowUserInput`,void 0),e.n([e.u({type:Boolean})],y.prototype,`typeahead`,void 0),e.n([e.u({type:Boolean,attribute:`include-search`})],y.prototype,`includeSearch`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],y.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:Boolean})],y.prototype,`multiple`,void 0),e.n([e.u({type:Number})],y.prototype,`maxlength`,void 0),e.n([e.u({type:String,attribute:`display-value-as`})],y.prototype,`displayValueAs`,void 0),e.n([e.u({type:String,attribute:`tag-placement`})],y.prototype,`tagPlacement`,void 0),e.n([e.u({type:Boolean,attribute:`open`})],y.prototype,`isOpen`,void 0),e.n([e.l()],y.prototype,`_options`,void 0),e.n([e.l()],y.prototype,`_value`,void 0),e.n([e.l()],y.prototype,`_isOptionsOpen`,void 0),e.n([e.l()],y.prototype,`_userInfoMessage`,void 0),e.n([e.l()],y.prototype,`_messageValue`,void 0),e.n([e.l()],y.prototype,`_addValueText`,void 0),e.n([e.l()],y.prototype,`_maxIsReached`,void 0),e.n([e.l()],y.prototype,`_search`,void 0),e.n([e.l()],y.prototype,`_inputFocus`,void 0),e.n([e.l()],y.prototype,`_skipInputTab`,void 0);var b=class extends y{toggleValue(e){if(this.isDisabled)return;this.touched=!0,this._userInfoMessage=``,this._addValueText=null;let t=c.i(this.options,e)?.value||null,n=this._value.includes(e||t||``),r=!!t,i=this._options.find(t=>t.value===e)?.disabled||!1,a=!e?.trim(),o=!this.multiple,s=this.multiple,l=c.l(this._value.length,this.maxlength),u=!1,d=!0,f=``,p=null,m=``;i||(!r&&this.allowUserInput&&!a?(this.addNewUserValue(e),f=`valueAdded`,u=s):!r&&!this.allowUserInput?(o&&this._value[0]&&this.removeValue(this._value[0]),d=!1,u=!0,f=`noResults`):n?(this.removeValue(t),u=!0,o&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``)):a&&o?(this.removeAllSelected(),u=!0):o?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t),u=!1,f=`valueSelected`,p=this._hasTextInput?h(t||``,this.options,this.displayValueAs):c.s(c.i(this.options,t),this.displayValueAs)):s&&!l?(this.setSelected(t),u=!0):s&&l?(f=`maxSelected`,d=!1,m=e):(o&&this.removeAllSelected(),f=`noValidValue`,d=!1,u=!0,m=e),this._isOptionsOpen=u,u||window.setTimeout(()=>{this.focusAfterCommit()},0),this._search=m||``,this.resetComboboxInput(d),this._userInfoMessage=f,this._messageValue=p,s&&this.updateMaxReached())}setSelected(e){this._value.includes(e)||(this.multiple&&c.l(this._value.length,this.maxlength)?this._userInfoMessage=`maxSelected`:(!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,g.markOptionSelected(this._options,e),this.resetComboboxInput(!0)))}removeSelected(e){if(!e)return;this._value=this._value.filter(t=>t!==e);let t=c.i(this.options,e);t&&(g.markOptionDeselected(this.options,e),t.userAdded?(this._options=[...this._options.filter(t=>t.value!==e)],this.options=[...this.options.filter(t=>t.value!==e)]):this._options.some(t=>t.value===e)?this.refreshOptionsFromValue():this._options=[...this._options,t])}addAllOptions(){this.multiple&&(this.maxlength&&this._options.length>this.maxlength?this._userInfoMessage=`tooManySelected`:(this._value=this._options.map(e=>e.value),g.markAllSelected(this._options),this.requestUpdate()))}removeAllSelected(){this._value=[],g.markAllDeselected(this._options),this._options=g.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){let e=this.inputRef.value?.value.trim()||``;this._search=e,e&&this._value.includes(e)?(this.resetComboboxInput(!0),this._userInfoMessage=`alreadySelected`):this.toggleValue(e)}removeValue(e){this._value=this.multiple?this._value.filter(t=>t!==e):[],this.removeSelected(e)}addNewUserValue(e){if(!e||e.trim()===``)return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[e];else if(!c.i(this.options,e)){if(c.l(this._value.length,this.maxlength))return;this._value=[...this._value,e]}let t={value:e,label:e,userAdded:!0,selected:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.resetComboboxInput(!0),this.multiple||(this._isOptionsOpen=!1,window.setTimeout(()=>{this.focusAfterCommit()},0)),this.requestUpdate()}refreshOptionsFromValue(){let e=v.cloneOptions(this.options);e.forEach(e=>e.selected=this._value.includes(e.value)),this._options=v.syncOptionsWithValues(e,this._value).options}resetComboboxInput(e=!0){this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!==`hidden`&&e&&(this._search=``,this.multiple?this.inputRef.value.value=``:(this.inputRef.value.value=this._value[0]?h(this._value[0],this.options,this.displayValueAs):``,this._userInfoMessage=``)),this.refreshOptionsFromValue()}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();let t=this._value[this._value.length-1];t&&this.removeSelected(t),this.updateMaxReached()}},x=class extends b{handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.isDisabled)return;this.touched=!0;let t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead){if(this._search){let{filtered:n,suggestion:r}=c.o(this.options,this._search);this._options=n,e.inputType!==`deleteContentBackward`&&r?.label&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(t.value=r.label,window.setTimeout(()=>t.setSelectionRange(this._search.length,t.value.length),0),t.selectionDirection=`backward`)}else this.refreshOptionsFromValue()}}handleFocus(){this.isDisabled||(this._skipInputTab=!1,this._suppressNextOpen?(this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate()):(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=h(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search=``,this.refreshOptionsFromValue(),this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()))}handleCloseOptions(){this._isOptionsOpen=!1,this._hasTextInput&&(this._suppressNextOpen=!0),this.focusTrigger()}handleFocusOut(e){if(this.isDisabled||!this._isOptionsOpen)return;let t=e.relatedTarget;t?.closest(`pkt-combobox`)?.id===this.id||e.target?.classList?.contains(`pkt-combobox__value`)||t===this.inputRef.value||t===this.triggerRef.value||this.closeAndProcessInput()}closeAndProcessInput(){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage=``,this._search=``,this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=this.inputRef.value.value;if(!this.multiple){if(!e)this._value[0]&&this.removeSelected(this._value[0]);else{let t=c.i(this.options,e);t&&t.value!==this._value[0]?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t.value)):!t&&this.allowUserInput&&(this._value[0]&&this.removeSelected(this._value[0]),this.addNewUserValue(e))}}else if(e!==``){let{action:t,value:n}=p(e,this._value,this.options,this.allowUserInput,this.multiple);switch(t){case`addUserValue`:this.addNewUserValue(n);break;case`selectOption`:this.setSelected(n);break;case`removeValue`:this.removeValue(n)}}!this.multiple&&this._value[0]?this.inputRef.value.value=h(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=``}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(e){this.isDisabled?(e.preventDefault(),e.stopImmediatePropagation()):this._hasTextInput?(this.inputRef.value?.focus(),this.requestUpdate()):(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen&&this.listboxRef.value?.focusFirstOrSelectedOption())}handlePlaceholderClick(e){this.isDisabled||(e.stopPropagation(),this._hasTextInput&&this.inputRef.value?(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()):(this._isOptionsOpen=!this._isOptionsOpen,this.requestUpdate()))}handleSelectOnlyKeydown(e){if(!this.isDisabled)switch(e.key){case`Enter`:case` `:case`ArrowDown`:case`ArrowUp`:e.preventDefault(),this._isOptionsOpen?this._isOptionsOpen=!1:(this._isOptionsOpen=!0,this.listboxRef.value?.focusFirstOrSelectedOption());break;case`Escape`:this._isOptionsOpen&&=(e.preventDefault(),!1);break;case`Home`:case`End`:e.preventDefault(),this._isOptionsOpen||=!0,this.listboxRef.value?.focusFirstOrSelectedOption();break;case`ArrowLeft`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.focusTag(this._value.length-1));break;case`Backspace`:case`Delete`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.removeSelected(this._value[this._value.length-1]))}}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase(),this.checkForMatches()}handleInputKeydown(e){if(e.key===`Backspace`){let t=!this.inputRef.value?.value;!this._search&&t&&this.multiple&&this._value.length>0&&this.removeLastValue(e);return}if(e.key===`ArrowLeft`&&this.multiple&&this._value.length>0){let t=this.inputRef.value;if(t&&t.selectionStart===0&&!t.value){e.preventDefault(),this.focusTag(this._value.length-1);return}}let t=f(e.key,e.shiftKey,this.multiple);if(t&&(e.key!==`Tab`||this._isOptionsOpen)){if(t===`focusListbox`&&e.key===`Tab`&&!this.listboxRef.value?.querySelector(`[role="option"]:not([data-disabled]), [data-type="new-option"]`))this.closeAndProcessInput();else switch(e.preventDefault(),t){case`addValue`:this.addValue();break;case`focusListbox`:this.listboxRef.value?.focusFirstOrSelectedOption();break;case`closeOptions`:this._isOptionsOpen=!1}}}handleTagRemove(e){this.removeSelected(e),this._hasTextInput&&this.inputRef.value&&(this._inputFocus=!0,this.inputRef.value.focus(),this.requestUpdate())}getInsideTags(){return Array.from(this.querySelectorAll(`.pkt-combobox__input .pkt-combobox__tag-list pkt-tag`))}focusTag(e){let t=this.getInsideTags();t.forEach((t,n)=>{t.buttonTabindex=n===e?0:-1}),(t[e]?.querySelector(`button`))?.focus()}resetTagTabindices(){this.getInsideTags().forEach(e=>{e.buttonTabindex=-1})}handleTagKeydown(e,t){e.stopPropagation();let n=()=>{this.resetTagTabindices(),this._hasTextInput&&this.inputRef.value?this.inputRef.value.focus():this.triggerRef.value?.focus()};switch(e.key){case`ArrowLeft`:e.preventDefault(),t>0&&this.focusTag(t-1);break;case`ArrowRight`:e.preventDefault(),t<this._value.length-1?this.focusTag(t+1):n();break;case`Backspace`:case`Delete`:e.preventDefault();{let e=this._value[t],r=t>=this._value.length-1?t-1:t;this.removeSelected(e),r>=0?(this.requestUpdate(),this.updateComplete.then(()=>this.focusTag(r))):n()}break;case`Tab`:this.resetTagTabindices();break;case`Escape`:e.preventDefault(),n()}}checkForMatches(){let e=m(this.inputRef.value?.value||this._search||``,this._value,this.options,this.allowUserInput,this.multiple);e.shouldRemoveValue&&this.removeValue(this._value[0]),e.shouldResetInput?this.resetComboboxInput(!1):(this._addValueText=e.addValueText,this._userInfoMessage=e.userInfoMessage)}},S=class extends x{constructor(...e){super(...e),this.handleBodyClick=e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.closeAndProcessInput()}}connectedCallback(){if(super.connectedCallback(),document?.body.addEventListener(`click`,this.handleBodyClick),this._options=[],this.defaultOptions&&this.defaultOptions.length){let e=this.options?.filter(e=>e.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=v.cloneOptions(this.options)}if(this.optionsController?.nodes&&this.optionsController.nodes.length){let e=_.parseOptionsFromSlot(this.optionsController.nodes);e.length&&(this.options=[...e],this._options=[...e],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}disconnectedCallback(){super.disconnectedCallback(),document?.body.removeEventListener(`click`,this.handleBodyClick)}firstUpdated(e){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(e)}willUpdate(e){if(this._optionsFromSlot&&this.optionsController){let e=this.optionsController.generation;if(e!==this._lastSlotGeneration){this._lastSlotGeneration=e;let t=_.parseOptionsFromSlot(this.optionsController.nodes),n=this._options.filter(e=>e.userAdded);this.options=[...n,...t]}}if(super.willUpdate(e),e.has(`isOpen`)&&(this._isOptionsOpen=this.isOpen),e.has(`defaultOptions`)&&this.defaultOptions.length){let e=(Array.isArray(this.options)?this.options:[]).filter(e=>e.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=v.cloneOptions(this.options)}let t=e.has(`value`),n=e.has(`_value`);if(t){let e=[...this._value],t=this.parseValue();t.join(`,`)!==this._value.join(`,`)&&(this._value=t,this._options.forEach(e=>e.selected=t.includes(e.value)),this._options=[...this._options]),this._pendingDispatchFrom??=e}else n&&(this._pendingDispatchFrom??=e.get(`_value`)??[]);if(e.has(`defaultValue`)&&this.defaultValue!=null&&!this._value.length){let e=this.parseToValues(this.defaultValue);e.length&&(this._pendingDispatchFrom??=[...this._value],this._value=e,this._options.forEach(t=>t.selected=e.includes(t.value)),this._options=[...this._options])}if(e.has(`options`)){let t=e.get(`options`)||this._options||[],n=v.mergeWithUserAdded(v.cloneOptions(this.options),t,this._value);this._options=n,n.length>this.options.length&&(this.options=n);let r=v.syncOptionsWithValues(this._options,this._value);this._options=r.options,r.newValues.length>this._value.length&&(this._pendingDispatchFrom??=[...this._value],this._value=r.newValues)}(t||n||e.has(`options`)||e.has(`defaultValue`))&&this.updateMaxReached(),this._pendingDispatchFrom&&this.syncPublicValue()}updated(e){if(this._pendingDispatchFrom){let e=this._pendingDispatchFrom;this._pendingDispatchFrom=null,this.dispatchValueChange(e)}if(e.has(`_search`)&&this.dispatchEvent(new CustomEvent(`search`,{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=!this.multiple&&this._value[0]?h(this._value[0],this.options,this.displayValueAs):``;this.inputRef.value.value!==e&&(this.inputRef.value.value=e)}this.classList.add(`pkt-combobox-component`),this.classList.toggle(`pkt-combobox-component--fullwidth`,!!this.fullwidth),super.updated(e)}formResetCallback(){this.touched=!1;let e=this.defaultValue||(this.multiple,``);this.value=e,this._value=this.parseValue(),this._options=this._options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this.options=this.options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this._search=``,this._isOptionsOpen=!1,this._userInfoMessage=``,this._addValueText=null,this._inputFocus=!1,this.updateMaxReached(),this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``),this.setFormValue(``),this.internals.ariaInvalid=`false`,this.requestUpdate()}attributeChangedCallback(e,t,n){if(e===`options`){this._options=v.cloneOptions(this.options);let e=v.syncOptionsWithValues(this._options,this._value);this._options=e.options,e.newValues.length>this._value.length&&(this._value=e.newValues),this._search=``}super.attributeChangedCallback(e,t,n)}render(){return e._`
|
|
1
|
+
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-CeKuRE3_.cjs");require("./icon-5A378_yh.cjs");const i=require("./input-wrapper-C_Rzwxx7.cjs"),a=require("./if-defined-Ci4ZQsgL.cjs"),o=require("./ref-B6p6mQkO.cjs");require("./tag-1SSexs0H.cjs");const s=require("./repeat-CjvNrcUr.cjs"),c=require("./listbox-HrH4JonS.cjs"),l=require("./input-element-2LHxo0em.cjs"),u=require("./pkt-options-controller-9zoH1OBW.cjs");var d={multiple:!1,typeahead:!1,includeSearch:!1,allowUserInput:!1,displayValueAs:`label`,inputSize:`medium`,disabled:!1,hasError:!1,required:!1,requiredTag:!1,optionalTag:!1,fullwidth:!1,inline:!1,useWrapper:!0},f=(e,t,n)=>{switch(e){case`,`:return n?`addValue`:null;case`Enter`:return`addValue`;case`Tab`:case`ArrowDown`:return t?null:`focusListbox`;case`Escape`:return`closeOptions`;default:return null}},p=(e,t,n,r,i)=>{if(!e)return{action:`none`,value:null};let a=c.i(n,e);return!t.includes(e)&&!a?r?{action:`addUserValue`,value:e}:i?{action:`none`,value:null}:{action:`removeValue`,value:t[0]}:a&&!t.includes(a.value)?{action:`selectOption`,value:a.value}:{action:`none`,value:null}},m=(e,t,n,r,i)=>e.trim().toLowerCase()?{...c.c(e,t,n,r),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:``,shouldRemoveValue:!i&&!!t[0],shouldResetInput:!0},h=(e,t,n)=>{let r=c.i(t,e);return n===`label`&&r?.label?r.label:e},g={markOptionSelected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!0;break}}},markOptionDeselected(e,t){if(t){for(let n of e)if(n.value===t){n.selected=!1;break}}},markAllSelected(e){for(let t of e)t.selected=!0},markAllDeselected(e){for(let t of e)t.selected=!1},removeUserAddedOptions(e){return e.filter(e=>!e.userAdded)}},_={parseOptionsFromSlot(e){let t=[];return e.forEach(e=>{if(!e.textContent&&!e.getAttribute(`value`))return;let n={value:e.getAttribute(`value`)||e.textContent||``,label:e.textContent||e.getAttribute(`value`)||``};e.getAttribute(`data-prefix`)&&(n.prefix=e.getAttribute(`data-prefix`)||void 0),e.getAttribute(`tagskincolor`)&&(n.tagSkinColor=e.getAttribute(`tagskincolor`)),e.getAttribute(`description`)&&(n.description=e.getAttribute(`description`)||void 0),n.fulltext=c.r(n),t.push(n)}),t}},v={cloneOptions(e){return Array.isArray(e)?e.map(e=>({...e})):[]},syncOptionsWithValues(e,t){let n=[...t];return e.forEach(e=>{e.value&&!e.label&&(e.label=e.value),e.selected&&!n.includes(e.value)&&n.push(e.value),e.fulltext=c.r(e),e.selected=e.selected||n.includes(e.value)}),{options:e,newValues:n}},mergeWithUserAdded(e,t,n){return[...t.filter(e=>e?.userAdded&&n.includes(e.value)).filter(t=>!(Array.isArray(e)?e:[]).some(e=>e.value===t.value)),...e]}},y=class extends l.t{constructor(){super(),this.value=``,this.options=[],this.defaultOptions=[],this.allowUserInput=d.allowUserInput,this.typeahead=d.typeahead,this.includeSearch=d.includeSearch,this.searchPlaceholder=null,this.multiple=d.multiple,this.maxlength=null,this.displayValueAs=d.displayValueAs,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage=``,this._messageValue=null,this._addValueText=null,this._maxIsReached=!1,this._search=``,this._inputFocus=!1,this._skipInputTab=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=o.t(),this.triggerRef=o.t(),this.listboxRef=o.t(),this._pendingDispatchFrom=null,this.optionsController=new u.t(this)}get _hasTextInput(){return this.typeahead||this.allowUserInput}get _selectionDescription(){if(this.multiple&&this._value.length!==0)return`${this._value.length} valgt`}focusTrigger(){this._hasTextInput?this.inputRef.value?.focus():this.triggerRef.value?.focus()}focusAfterCommit(){this._skipInputTab=!0;let e=this.inputRef.value;e&&e.type!==`hidden`&&e.setAttribute(`tabindex`,`-1`),this.triggerRef.value?.focus()}restoreInputTab(){this._skipInputTab=!1}parseValue(){return this.parseToValues(this.value)}parseToValues(e){return Array.isArray(e)?this.multiple?e:e.length>0?[e[0]]:[]:e&&this.multiple?e.split(`,`):e?[e]:[]}updateMaxReached(){this._maxIsReached=c.l(this._value.length,this.maxlength)}syncPublicValue(){let e=this.multiple?this._value.join(`,`):this._value[0]||``;e!==(Array.isArray(this.value)?this.value.join(`,`):String(this.value||``))&&(this.value=e)}dispatchValueChange(e){let t=this._value;if(e?.join(`,`)!==t.join(`,`)){let e=this.multiple?[...t]:t[0]||``;this.onChange(e)}else t.length===0&&e&&e.length>0&&this.clearInputValue()}onChange(e){this.touched=!0,super.onChange(e)}valueChanged(){}};e.n([e.u({type:String,reflect:!0})],y.prototype,`value`,void 0),e.n([e.u({type:Array})],y.prototype,`options`,void 0),e.n([e.u({type:Array,attribute:`default-options`})],y.prototype,`defaultOptions`,void 0),e.n([e.u({type:Boolean,attribute:`allow-user-input`})],y.prototype,`allowUserInput`,void 0),e.n([e.u({type:Boolean})],y.prototype,`typeahead`,void 0),e.n([e.u({type:Boolean,attribute:`include-search`})],y.prototype,`includeSearch`,void 0),e.n([e.u({type:String,attribute:`search-placeholder`})],y.prototype,`searchPlaceholder`,void 0),e.n([e.u({type:Boolean})],y.prototype,`multiple`,void 0),e.n([e.u({type:Number})],y.prototype,`maxlength`,void 0),e.n([e.u({type:String,attribute:`display-value-as`})],y.prototype,`displayValueAs`,void 0),e.n([e.u({type:String,attribute:`tag-placement`})],y.prototype,`tagPlacement`,void 0),e.n([e.u({type:Boolean,attribute:`open`})],y.prototype,`isOpen`,void 0),e.n([e.l()],y.prototype,`_options`,void 0),e.n([e.l()],y.prototype,`_value`,void 0),e.n([e.l()],y.prototype,`_isOptionsOpen`,void 0),e.n([e.l()],y.prototype,`_userInfoMessage`,void 0),e.n([e.l()],y.prototype,`_messageValue`,void 0),e.n([e.l()],y.prototype,`_addValueText`,void 0),e.n([e.l()],y.prototype,`_maxIsReached`,void 0),e.n([e.l()],y.prototype,`_search`,void 0),e.n([e.l()],y.prototype,`_inputFocus`,void 0),e.n([e.l()],y.prototype,`_skipInputTab`,void 0);var b=class extends y{toggleValue(e){if(this.isDisabled)return;this.touched=!0,this._userInfoMessage=``,this._addValueText=null;let t=c.i(this.options,e)?.value||null,n=this._value.includes(e||t||``),r=!!t,i=this._options.find(t=>t.value===e)?.disabled||!1,a=!e?.trim(),o=!this.multiple,s=this.multiple,l=c.l(this._value.length,this.maxlength),u=!1,d=!0,f=``,p=null,m=``;i||(!r&&this.allowUserInput&&!a?(this.addNewUserValue(e),f=`valueAdded`,u=s):!r&&!this.allowUserInput?(o&&this._value[0]&&this.removeValue(this._value[0]),d=!1,u=!0,f=`noResults`):n?(this.removeValue(t),u=!0,o&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``)):a&&o?(this.removeAllSelected(),u=!0):o?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t),u=!1,f=`valueSelected`,p=this._hasTextInput?h(t||``,this.options,this.displayValueAs):c.s(c.i(this.options,t),this.displayValueAs)):s&&!l?(this.setSelected(t),u=!0):s&&l?(f=`maxSelected`,d=!1,m=e):(o&&this.removeAllSelected(),f=`noValidValue`,d=!1,u=!0,m=e),this._isOptionsOpen=u,u||window.setTimeout(()=>{this.focusAfterCommit()},0),this._search=m||``,this.resetComboboxInput(d),this._userInfoMessage=f,this._messageValue=p,s&&this.updateMaxReached())}setSelected(e){this._value.includes(e)||(this.multiple&&c.l(this._value.length,this.maxlength)?this._userInfoMessage=`maxSelected`:(!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,g.markOptionSelected(this._options,e),this.resetComboboxInput(!0)))}removeSelected(e){if(!e)return;this._value=this._value.filter(t=>t!==e);let t=c.i(this.options,e);t&&(g.markOptionDeselected(this.options,e),t.userAdded?(this._options=[...this._options.filter(t=>t.value!==e)],this.options=[...this.options.filter(t=>t.value!==e)]):this._options.some(t=>t.value===e)?this.refreshOptionsFromValue():this._options=[...this._options,t])}addAllOptions(){this.multiple&&(this.maxlength&&this._options.length>this.maxlength?this._userInfoMessage=`tooManySelected`:(this._value=this._options.map(e=>e.value),g.markAllSelected(this._options),this.requestUpdate()))}removeAllSelected(){this._value=[],g.markAllDeselected(this._options),this._options=g.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){let e=this.inputRef.value?.value.trim()||``;this._search=e,e&&this._value.includes(e)?(this.resetComboboxInput(!0),this._userInfoMessage=`alreadySelected`):this.toggleValue(e)}removeValue(e){this._value=this.multiple?this._value.filter(t=>t!==e):[],this.removeSelected(e)}addNewUserValue(e){if(!e||e.trim()===``)return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[e];else if(!c.i(this.options,e)){if(c.l(this._value.length,this.maxlength))return;this._value=[...this._value,e]}let t={value:e,label:e,userAdded:!0,selected:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.resetComboboxInput(!0),this.multiple||(this._isOptionsOpen=!1,window.setTimeout(()=>{this.focusAfterCommit()},0)),this.requestUpdate()}refreshOptionsFromValue(){let e=v.cloneOptions(this.options);e.forEach(e=>e.selected=this._value.includes(e.value)),this._options=v.syncOptionsWithValues(e,this._value).options}resetComboboxInput(e=!0){this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!==`hidden`&&e&&(this._search=``,this.multiple?this.inputRef.value.value=``:(this.inputRef.value.value=this._value[0]?h(this._value[0],this.options,this.displayValueAs):``,this._userInfoMessage=``)),this.refreshOptionsFromValue()}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();let t=this._value[this._value.length-1];t&&this.removeSelected(t),this.updateMaxReached()}},x=class extends b{handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.isDisabled)return;this.touched=!0;let t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead){if(this._search){let{filtered:n,suggestion:r}=c.o(this.options,this._search);this._options=n,e.inputType!==`deleteContentBackward`&&r?.label&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(t.value=r.label,window.setTimeout(()=>t.setSelectionRange(this._search.length,t.value.length),0),t.selectionDirection=`backward`)}else this.refreshOptionsFromValue()}}handleFocus(){this.isDisabled||(this._skipInputTab=!1,this._suppressNextOpen?(this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate()):(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=h(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search=``,this.refreshOptionsFromValue(),this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()))}handleCloseOptions(){this._isOptionsOpen=!1,this._hasTextInput&&(this._suppressNextOpen=!0),this.focusTrigger()}handleFocusOut(e){if(this.isDisabled||!this._isOptionsOpen)return;let t=e.relatedTarget;t?.closest(`pkt-combobox`)?.id===this.id||e.target?.classList?.contains(`pkt-combobox__value`)||t===this.inputRef.value||t===this.triggerRef.value||this.closeAndProcessInput()}closeAndProcessInput(){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage=``,this._search=``,this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=this.inputRef.value.value;if(!this.multiple){if(!e)this._value[0]&&this.removeSelected(this._value[0]);else{let t=c.i(this.options,e);t&&t.value!==this._value[0]?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t.value)):!t&&this.allowUserInput&&(this._value[0]&&this.removeSelected(this._value[0]),this.addNewUserValue(e))}}else if(e!==``){let{action:t,value:n}=p(e,this._value,this.options,this.allowUserInput,this.multiple);switch(t){case`addUserValue`:this.addNewUserValue(n);break;case`selectOption`:this.setSelected(n);break;case`removeValue`:this.removeValue(n)}}!this.multiple&&this._value[0]?this.inputRef.value.value=h(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=``}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(e){this.isDisabled?(e.preventDefault(),e.stopImmediatePropagation()):this._hasTextInput?(this.inputRef.value?.focus(),this.requestUpdate()):(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen&&this.listboxRef.value?.focusFirstOrSelectedOption())}handlePlaceholderClick(e){this.isDisabled||(e.stopPropagation(),this._hasTextInput&&this.inputRef.value?(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()):(this._isOptionsOpen=!this._isOptionsOpen,this.requestUpdate()))}handleSelectOnlyKeydown(e){if(!this.isDisabled)switch(e.key){case`Enter`:case` `:case`ArrowDown`:case`ArrowUp`:e.preventDefault(),this._isOptionsOpen?this._isOptionsOpen=!1:(this._isOptionsOpen=!0,this.listboxRef.value?.focusFirstOrSelectedOption());break;case`Escape`:this._isOptionsOpen&&=(e.preventDefault(),!1);break;case`Home`:case`End`:e.preventDefault(),this._isOptionsOpen||=!0,this.listboxRef.value?.focusFirstOrSelectedOption();break;case`ArrowLeft`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.focusTag(this._value.length-1));break;case`Backspace`:case`Delete`:this.multiple&&this._value.length>0&&(e.preventDefault(),this.removeSelected(this._value[this._value.length-1]))}}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase(),this.checkForMatches()}handleInputKeydown(e){if(e.key===`Backspace`){let t=!this.inputRef.value?.value;!this._search&&t&&this.multiple&&this._value.length>0&&this.removeLastValue(e);return}if(e.key===`ArrowLeft`&&this.multiple&&this._value.length>0){let t=this.inputRef.value;if(t&&t.selectionStart===0&&!t.value){e.preventDefault(),this.focusTag(this._value.length-1);return}}let t=f(e.key,e.shiftKey,this.multiple);if(t&&(e.key!==`Tab`||this._isOptionsOpen)){if(t===`focusListbox`&&e.key===`Tab`&&!this.listboxRef.value?.querySelector(`[role="option"]:not([data-disabled]), [data-type="new-option"]`))this.closeAndProcessInput();else switch(e.preventDefault(),t){case`addValue`:this.addValue();break;case`focusListbox`:this.listboxRef.value?.focusFirstOrSelectedOption();break;case`closeOptions`:this._isOptionsOpen=!1}}}handleTagRemove(e){this.removeSelected(e),this._hasTextInput&&this.inputRef.value&&(this._inputFocus=!0,this.inputRef.value.focus(),this.requestUpdate())}getInsideTags(){return Array.from(this.querySelectorAll(`.pkt-combobox__input .pkt-combobox__tag-list pkt-tag`))}focusTag(e){let t=this.getInsideTags();t.forEach((t,n)=>{t.buttonTabindex=n===e?0:-1}),(t[e]?.querySelector(`button`))?.focus()}resetTagTabindices(){this.getInsideTags().forEach(e=>{e.buttonTabindex=-1})}handleTagKeydown(e,t){e.stopPropagation();let n=()=>{this.resetTagTabindices(),this._hasTextInput&&this.inputRef.value?this.inputRef.value.focus():this.triggerRef.value?.focus()};switch(e.key){case`ArrowLeft`:e.preventDefault(),t>0&&this.focusTag(t-1);break;case`ArrowRight`:e.preventDefault(),t<this._value.length-1?this.focusTag(t+1):n();break;case`Backspace`:case`Delete`:e.preventDefault();{let e=this._value[t],r=t>=this._value.length-1?t-1:t;this.removeSelected(e),r>=0?(this.requestUpdate(),this.updateComplete.then(()=>this.focusTag(r))):n()}break;case`Tab`:this.resetTagTabindices();break;case`Escape`:e.preventDefault(),n()}}checkForMatches(){let e=m(this.inputRef.value?.value||this._search||``,this._value,this.options,this.allowUserInput,this.multiple);e.shouldRemoveValue&&this.removeValue(this._value[0]),e.shouldResetInput?this.resetComboboxInput(!1):(this._addValueText=e.addValueText,this._userInfoMessage=e.userInfoMessage)}},S=class extends x{constructor(...e){super(...e),this.handleBodyClick=e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.closeAndProcessInput()}}connectedCallback(){if(super.connectedCallback(),document?.body.addEventListener(`click`,this.handleBodyClick),this._options=[],this.defaultOptions&&this.defaultOptions.length){let e=this.options?.filter(e=>e.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=v.cloneOptions(this.options)}if(this.optionsController?.nodes&&this.optionsController.nodes.length){let e=_.parseOptionsFromSlot(this.optionsController.nodes);e.length&&(this.options=[...e],this._options=[...e],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}disconnectedCallback(){super.disconnectedCallback(),document?.body.removeEventListener(`click`,this.handleBodyClick)}firstUpdated(e){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(e)}willUpdate(e){if(this._optionsFromSlot&&this.optionsController){let e=this.optionsController.generation;if(e!==this._lastSlotGeneration){this._lastSlotGeneration=e;let t=_.parseOptionsFromSlot(this.optionsController.nodes),n=this._options.filter(e=>e.userAdded);this.options=[...n,...t]}}if(super.willUpdate(e),e.has(`isOpen`)&&(this._isOptionsOpen=this.isOpen),e.has(`defaultOptions`)&&this.defaultOptions.length){let e=(Array.isArray(this.options)?this.options:[]).filter(e=>e.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=v.cloneOptions(this.options)}let t=e.has(`value`),n=e.has(`_value`);if(t){let e=[...this._value],t=this.parseValue();t.join(`,`)!==this._value.join(`,`)&&(this._value=t,this._options.forEach(e=>e.selected=t.includes(e.value)),this._options=[...this._options]),this._pendingDispatchFrom??=e}else n&&(this._pendingDispatchFrom??=e.get(`_value`)??[]);if(e.has(`defaultValue`)&&this.defaultValue!=null&&!this._value.length){let e=this.parseToValues(this.defaultValue);e.length&&(this._pendingDispatchFrom??=[...this._value],this._value=e,this._options.forEach(t=>t.selected=e.includes(t.value)),this._options=[...this._options])}if(e.has(`options`)){let t=e.get(`options`)||this._options||[],n=v.mergeWithUserAdded(v.cloneOptions(this.options),t,this._value);this._options=n,n.length>this.options.length&&(this.options=n);let r=v.syncOptionsWithValues(this._options,this._value);this._options=r.options,r.newValues.length>this._value.length&&(this._pendingDispatchFrom??=[...this._value],this._value=r.newValues)}(t||n||e.has(`options`)||e.has(`defaultValue`))&&this.updateMaxReached(),this._pendingDispatchFrom&&this.syncPublicValue()}updated(e){if(this._pendingDispatchFrom){let e=this._pendingDispatchFrom;this._pendingDispatchFrom=null,this.dispatchValueChange(e)}if(e.has(`_search`)&&this.dispatchEvent(new CustomEvent(`search`,{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!==`hidden`){let e=!this.multiple&&this._value[0]?h(this._value[0],this.options,this.displayValueAs):``;this.inputRef.value.value!==e&&(this.inputRef.value.value=e)}this.classList.add(`pkt-combobox-component`),this.classList.toggle(`pkt-combobox-component--fullwidth`,!!this.fullwidth),super.updated(e)}formResetCallback(){this.touched=!1;let e=this.defaultValue||(this.multiple,``);this.value=e,this._value=this.parseValue(),this._options=this._options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this.options=this.options.filter(e=>!e.userAdded).map(e=>({...e,selected:this._value.includes(e.value)})),this._search=``,this._isOptionsOpen=!1,this._userInfoMessage=``,this._addValueText=null,this._inputFocus=!1,this.updateMaxReached(),this.inputRef.value&&this.inputRef.value.type!==`hidden`&&(this.inputRef.value.value=``),this.setFormValue(``),this.internals.ariaInvalid=`false`,this.requestUpdate()}attributeChangedCallback(e,t,n){if(e===`options`){this._options=v.cloneOptions(this.options);let e=v.syncOptionsWithValues(this._options,this._value);this._options=e.options,e.newValues.length>this._value.length&&(this._value=e.newValues),this._search=``}super.attributeChangedCallback(e,t,n)}render(){return e._`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
${r.n(this,[`helptext`])}
|
|
4
4
|
.strings=${this.strings}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-
|
|
2
|
-
import { t as o } from "./class-map-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-DLgZkx5L.js";
|
|
2
|
+
import { t as o } from "./class-map-BDwVSgLb.js";
|
|
3
3
|
import { t as s } from "./format-BTeSVkED.js";
|
|
4
|
-
import { n as c } from "./element-with-slot-
|
|
5
|
-
import "./icon-
|
|
6
|
-
import { r as l } from "./input-wrapper-
|
|
7
|
-
import { t as u } from "./if-defined-
|
|
8
|
-
import { n as d, t as f } from "./ref-
|
|
9
|
-
import "./tag-
|
|
10
|
-
import { t as p } from "./repeat-
|
|
11
|
-
import { a as m, c as h, i as g, l as _, o as v, r as y, s as b } from "./listbox-
|
|
12
|
-
import { t as x } from "./input-element-
|
|
13
|
-
import { t as S } from "./pkt-options-controller-
|
|
4
|
+
import { n as c } from "./element-with-slot-mG-h7Sjw.js";
|
|
5
|
+
import "./icon-C1oCGwEe.js";
|
|
6
|
+
import { r as l } from "./input-wrapper-DkpJS1hR.js";
|
|
7
|
+
import { t as u } from "./if-defined-DiYi2v_Q.js";
|
|
8
|
+
import { n as d, t as f } from "./ref-BAegS9BR.js";
|
|
9
|
+
import "./tag-CkZ2Mn4a.js";
|
|
10
|
+
import { t as p } from "./repeat-Cy1M16Di.js";
|
|
11
|
+
import { a as m, c as h, i as g, l as _, o as v, r as y, s as b } from "./listbox-DAvIBH4P.js";
|
|
12
|
+
import { t as x } from "./input-element-De40zUox.js";
|
|
13
|
+
import { t as S } from "./pkt-options-controller-CzvBlEPD.js";
|
|
14
14
|
//#region ../../shared-types/combobox.ts
|
|
15
15
|
var C = {
|
|
16
16
|
multiple: !1,
|
|
@@ -5,8 +5,6 @@ import { IPktHeading } from '../heading';
|
|
|
5
5
|
import { IAriaAttributes, TCardSkin, TLayout } from '../../shared-types';
|
|
6
6
|
import { IPktStringsProps } from '../../shared-strings';
|
|
7
7
|
export type { TCardSkin, TLayout };
|
|
8
|
-
export type TCardPadding = 'none' | 'default';
|
|
9
|
-
export type TCardImageShape = 'square' | 'round';
|
|
10
8
|
export type TCardImageAspect = 'auto' | '1-1' | '4-3' | '3-2' | '16-9' | '19-10';
|
|
11
9
|
export type TCardTagPosition = 'top' | 'bottom';
|
|
12
10
|
export interface IPktCard extends IPktStringsProps<'card'> {
|
|
@@ -20,14 +18,10 @@ export interface IPktCard extends IPktStringsProps<'card'> {
|
|
|
20
18
|
src: string;
|
|
21
19
|
alt: string;
|
|
22
20
|
};
|
|
23
|
-
imageShape?: TCardImageShape;
|
|
24
21
|
imageAspect?: TCardImageAspect | null;
|
|
25
|
-
restrictImageHeight?: boolean | null;
|
|
26
22
|
clickCardLink?: string | null;
|
|
27
23
|
openLinkInNewTab?: boolean | null;
|
|
28
|
-
borderOnHover?: boolean | null;
|
|
29
24
|
zoom?: boolean | null;
|
|
30
|
-
padding?: TCardPadding;
|
|
31
25
|
skin?: TCardSkin;
|
|
32
26
|
subheading?: string;
|
|
33
27
|
tagPosition?: TCardTagPosition;
|
|
@@ -38,10 +32,8 @@ export interface IPktCard extends IPktStringsProps<'card'> {
|
|
|
38
32
|
export declare class PktCard extends PktElementWithSlot implements IPktCard {
|
|
39
33
|
ariaLabel: string;
|
|
40
34
|
metaLead: string | null;
|
|
41
|
-
borderOnHover: boolean;
|
|
42
35
|
zoom: boolean;
|
|
43
36
|
imageAspect: TCardImageAspect | null;
|
|
44
|
-
restrictImageHeight: boolean;
|
|
45
37
|
clickCardLink: IPktCard['clickCardLink'];
|
|
46
38
|
metaTrail: string | null;
|
|
47
39
|
layout: TLayout;
|
|
@@ -51,9 +43,7 @@ export declare class PktCard extends PktElementWithSlot implements IPktCard {
|
|
|
51
43
|
src: string;
|
|
52
44
|
alt: string;
|
|
53
45
|
};
|
|
54
|
-
imageShape: TCardImageShape;
|
|
55
46
|
openLinkInNewTab: boolean;
|
|
56
|
-
padding: TCardPadding;
|
|
57
47
|
skin: TCardSkin;
|
|
58
48
|
subheading: string;
|
|
59
49
|
tagPosition: 'top' | 'bottom';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PktCard, TCardSkin, TLayout,
|
|
2
|
-
export { PktCard, TCardSkin, TLayout,
|
|
1
|
+
import { PktCard, TCardSkin, TLayout, TCardTagPosition } from './card';
|
|
2
|
+
export { PktCard, TCardSkin, TLayout, TCardTagPosition };
|
|
3
3
|
export default PktCard;
|
|
@@ -6,7 +6,7 @@ export declare class PktLink extends PktElementWithSlot {
|
|
|
6
6
|
href: string;
|
|
7
7
|
iconName: string | undefined;
|
|
8
8
|
iconPosition: string | undefined;
|
|
9
|
-
|
|
9
|
+
rel: string | null;
|
|
10
10
|
target: string | null;
|
|
11
11
|
render(): import('lit-html').TemplateResult<1>;
|
|
12
12
|
}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
import { PktElement } from '../../base-elements/element';
|
|
2
|
-
import { TAriaLive, TProgressbarRole, TProgressbarSkin, TProgressbarStatusPlacement, TProgressbarStatusType, TProgressbarTitlePosition } from '../../shared-types';
|
|
3
|
-
export type { TProgressbarRole, TProgressbarSkin, TProgressbarStatusPlacement, TProgressbarStatusType, TProgressbarTitlePosition };
|
|
4
|
-
export interface IPktProgressbar {
|
|
5
|
-
ariaLabel?: string | null;
|
|
6
|
-
ariaLabelledby?: string | null;
|
|
2
|
+
import { IPktProgressbarBase, TAriaLive, TProgressbarRole, TProgressbarSkin, TProgressbarStatusPlacement, TProgressbarStatusType, TProgressbarTitlePosition } from '../../shared-types';
|
|
3
|
+
export type { TProgressbarRole, TProgressbarSkin, TProgressbarStatusPlacement, TProgressbarStatusType, TProgressbarTitlePosition, };
|
|
4
|
+
export interface IPktProgressbar extends Omit<IPktProgressbarBase, 'ariaLive' | 'id'> {
|
|
7
5
|
ariaLive?: TAriaLive | null;
|
|
8
|
-
ariaValueText?: string | null;
|
|
9
6
|
id?: string | null;
|
|
10
|
-
role?: TProgressbarRole;
|
|
11
|
-
skin?: TProgressbarSkin;
|
|
12
|
-
statusPlacement?: TProgressbarStatusPlacement;
|
|
13
|
-
statusType?: TProgressbarStatusType;
|
|
14
|
-
title?: string | null;
|
|
15
|
-
titlePosition?: TProgressbarTitlePosition;
|
|
16
|
-
valueCurrent: number;
|
|
17
|
-
valueMax?: number;
|
|
18
|
-
valueMin?: number;
|
|
19
7
|
}
|
|
20
|
-
export declare class PktProgressbar extends PktElement implements IPktProgressbar {
|
|
21
|
-
constructor();
|
|
8
|
+
export declare class PktProgressbar extends PktElement<IPktProgressbar> implements IPktProgressbar {
|
|
22
9
|
ariaLabel: string | null;
|
|
23
10
|
ariaLabelledby: string | null;
|
|
24
11
|
ariaValueText: string | null;
|
|
@@ -37,7 +24,6 @@ export declare class PktProgressbar extends PktElement implements IPktProgressba
|
|
|
37
24
|
private progressbarId;
|
|
38
25
|
private resolvedRole;
|
|
39
26
|
private labelRef;
|
|
40
|
-
private progressBarRef;
|
|
41
27
|
private containerRef;
|
|
42
28
|
protected willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
43
29
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PktElementWithSlot } from '../../base-elements/element-with-slot';
|
|
2
2
|
import { Ref } from 'lit/directives/ref.js';
|
|
3
3
|
import { TabsContext } from './tabs-context';
|
|
4
|
-
|
|
4
|
+
import { TTagSkin } from '../../shared-types';
|
|
5
|
+
export type TSkin = TTagSkin;
|
|
5
6
|
export interface IPktTabItem {
|
|
6
7
|
active?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { PropertyValues } from 'lit';
|
|
2
2
|
import { PktElementWithSlot } from '../../base-elements/element-with-slot';
|
|
3
|
-
import { IAriaAttributes, THTMLButtonType, TPktSizeBase } from '../../shared-types';
|
|
3
|
+
import { IAriaAttributes, THTMLButtonType, TTagSkin, TTagState, TPktSizeBase } from '../../shared-types';
|
|
4
4
|
import { PktIconName } from '@oslokommune/punkt-assets/dist/icons/icon';
|
|
5
5
|
import { IPktStringsProps } from '../../shared-strings';
|
|
6
|
-
export type TTagSkin
|
|
6
|
+
export type { TTagSkin, TTagState };
|
|
7
7
|
export type TTagType = THTMLButtonType;
|
|
8
8
|
export interface IPktTag extends IPktStringsProps<'tag'> {
|
|
9
9
|
closeTag?: boolean;
|
|
10
10
|
size?: TPktSizeBase;
|
|
11
11
|
skin?: TTagSkin;
|
|
12
|
+
state?: TTagState | null;
|
|
12
13
|
textStyle?: string | null;
|
|
13
14
|
iconName?: PktIconName;
|
|
14
15
|
type?: TTagType;
|
|
@@ -22,6 +23,7 @@ export declare class PktTag extends PktElementWithSlot<IPktTag> implements IPktT
|
|
|
22
23
|
closeTag: boolean;
|
|
23
24
|
size: TPktSizeBase;
|
|
24
25
|
skin: TTagSkin;
|
|
26
|
+
state: TTagState | null;
|
|
25
27
|
textStyle: string | null;
|
|
26
28
|
iconName: string | undefined;
|
|
27
29
|
type: TTagType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-CEarCnHH.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./button-bVWAX98x.cjs");var t={i18n:{nb:{contentPresentation:{title:`Oslo kommune bruker informasjonskapsler`,description:[`For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.`,`Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss.`],buttons:{accept:`Godta alle`,reject:`Kun nødvendige`,settings:`Innstillinger for informasjonskapsler`}},contentSettings:{title:`Innstillinger for informasjonskapsler`,description:[`Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.`,`Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler».`],buttons:{back:`Tilbake`,save:`Lagre innstillinger`}}},en:{contentPresentation:{title:`Before you visit Oslo kommune ...`,description:[`This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.`,`To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites.`],buttons:{accept:`Yes, I accept`,reject:`Only necessary`,settings:`Go to settings`}},contentSettings:{title:`Her kan du aktivt velge mellom ulike informasjonskapsler`,description:[`For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider`],buttons:{back:`Back`,save:`Save settings`}}}},cookies:[{name:`statistics`,defaultValue:null,i18n:{nb:{title:`Statistikk og analyse`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å innhente data om statistikk og brukeradferd.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Statistics and analytics`,description:`Select your preference for statistics and analytics`,buttons:{yes:`Yes`,no:`No`}}}},{name:`survey`,defaultValue:null,i18n:{nb:{title:`Skriftlige tilbakemeldinger`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å vise responsfelt og registrere tilbakemeldinger.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Survey`,description:`Select your preference for survey`,buttons:{yes:`Yes`,no:`No`}}}},{name:`functional`,defaultValue:!0,i18n:{nb:{title:`Funksjonelle informasjonskapsler`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler for å gjøre ulike funksjoner på nettstedet mulige (for eksempel skjemaer og barnehagevelger).`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Functional cookies`,description:`For the website to function optimally, we recommend that you accept these cookies`,buttons:{yes:`Yes`,no:`No`}}}}]},n={devMode:!1,i18nLanguage:`nb`,triggerType:`button`},r=null;function i(){return r||(r=new Promise((e,t)=>{if(document.querySelector(`#oslo-consent-script`)){e();return}let n=document.createElement(`script`);n.src=`https://cdn.web.oslo.kommune.no/cb/cb-v2.0.0.js`,n.id=`oslo-consent-script`,n.onload=()=>e(),n.onerror=t,document.head.appendChild(n);let r=document.createElement(`link`);r.href=`https://cdn.web.oslo.kommune.no/cb/cb-v2.0.0.css`,r.type=`text/css`,r.rel=`stylesheet`,r.id=`oslo-consent-styles`,document.head.appendChild(r)}),r)}var a=e=>{if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}},o=e=>a(e.value).items.reduce((e,t)=>(e[t.name]=t.consent,e),{}),s=class extends e.t{constructor(...e){super(...e),this.devMode=n.devMode,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType=n.triggerType,this.triggerText=null,this.i18nLanguage=n.i18nLanguage}connectedCallback(){super.connectedCallback();let e=Object.prototype.hasOwnProperty.call(t.i18n,this.i18nLanguage)?this.i18nLanguage:`nb`;this.triggerText=this.triggerText||t.i18n[e].contentPresentation.buttons.settings}disconnectedCallback(){super.disconnectedCallback(),this._cookieEventHandler&&window.__cookieEvents?.off(`CookieManager.setCookie`,this._cookieEventHandler)}returnJsonOrObject(e){return a(e)}emitCookieConsents(e){this.dispatchEvent(new CustomEvent(`toggle-consent`,{detail:o(e),bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await i(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event(`CookieBannerReady`,{bubbles:!0,cancelable:!0}));let e=window.cookieBanner,t=window.__cookieEvents;e&&t&&e.cookieConsent.validateConsentCookie().then(n=>{if(!n)return;let r=e.cookieConsent.getConsentCookie();window.setTimeout(()=>this.emitCookieConsents({value:r}),0),this._cookieEventHandler&&t.off(`CookieManager.setCookie`,this._cookieEventHandler),this._cookieEventHandler=e=>this.emitCookieConsents(e),t.on(`CookieManager.setCookie`,this._cookieEventHandler)})}openModal(e){e.preventDefault(),window.cookieBanner?.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner?.openCookieModal())}render(){return this.triggerType===`link`?e._`<a href="#" class="pkt-link" aria-haspopup="dialog" @click=${this.openModal}
|
|
2
2
|
>${this.triggerText}</a
|
|
3
3
|
>`:this.triggerType===`footerlink`?e._`<a
|
|
4
4
|
href="#"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as e, d as t, n, t as r, u as i } from "./element-
|
|
1
|
+
import { _ as e, d as t, n, t as r, u as i } from "./element-DLgZkx5L.js";
|
|
2
2
|
import "./shared-types-A6iGIX-f.js";
|
|
3
|
-
import "./button-
|
|
3
|
+
import "./button-Bswo1C0M.js";
|
|
4
4
|
//#region ../../shared-strings/consent.ts
|
|
5
5
|
var a = {
|
|
6
6
|
i18n: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./element-with-slot-CeKuRE3_.cjs");require("./icon-5A378_yh.cjs"),require("./input-wrapper-C_Rzwxx7.cjs"),require("./calendar-CDTCgTJn.cjs");const r=require("./if-defined-Ci4ZQsgL.cjs"),i=require("./ref-B6p6mQkO.cjs"),a=require("./converters-CW6SN0TT.cjs");require("./tag-1SSexs0H.cjs");const o=require("./repeat-CjvNrcUr.cjs"),s=require("./utils-63cRpWut.cjs"),c=require("./input-element-2LHxo0em.cjs");var l=class extends e.t{constructor(...e){super(...e),this.dates=[],this.dateformat=`dd.MM.yyyy`,this.className=`pkt-datepicker__tags`,this.idBase=s.n()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},e._`
|
|
2
2
|
<div class=${t.t(this.classes)} aria-live="polite">
|
|
3
3
|
${Array.isArray(this.dates)&&this.dates[0]?o.t(a.h((this.dates??[]).filter(Boolean)),e=>e,t=>e._` <pkt-tag
|
|
4
4
|
id=${this.idBase+t+`-tag`}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, s as a, t as o, u as s } from "./element-
|
|
2
|
-
import { t as c } from "./class-map-
|
|
3
|
-
import { n as l } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import "./input-wrapper-
|
|
6
|
-
import "./calendar-
|
|
7
|
-
import { t as u } from "./if-defined-
|
|
8
|
-
import { n as d, t as f } from "./ref-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, s as a, t as o, u as s } from "./element-DLgZkx5L.js";
|
|
2
|
+
import { t as c } from "./class-map-BDwVSgLb.js";
|
|
3
|
+
import { n as l } from "./element-with-slot-mG-h7Sjw.js";
|
|
4
|
+
import "./icon-C1oCGwEe.js";
|
|
5
|
+
import "./input-wrapper-DkpJS1hR.js";
|
|
6
|
+
import "./calendar-BOd-9PDd.js";
|
|
7
|
+
import { t as u } from "./if-defined-DiYi2v_Q.js";
|
|
8
|
+
import { n as d, t as f } from "./ref-BAegS9BR.js";
|
|
9
9
|
import { a as p, c as m, d as h, h as g, i as _, m as v, n as y, r as b, s as x, t as S, u as ee } from "./converters-CYgQrWVm.js";
|
|
10
|
-
import "./tag-
|
|
11
|
-
import { t as te } from "./repeat-
|
|
10
|
+
import "./tag-CkZ2Mn4a.js";
|
|
11
|
+
import { t as te } from "./repeat-Cy1M16Di.js";
|
|
12
12
|
import { n as C, t as w } from "./utils-BwF4QSrq.js";
|
|
13
|
-
import { t as T } from "./input-element-
|
|
13
|
+
import { t as T } from "./input-element-De40zUox.js";
|
|
14
14
|
//#region src/components/datepicker/date-tags.ts
|
|
15
15
|
var E = class extends o {
|
|
16
16
|
constructor(...e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "./element-
|
|
1
|
+
import { v as e } from "./element-DLgZkx5L.js";
|
|
2
2
|
//#region ../../node_modules/lit-html/directive-helpers.js
|
|
3
3
|
var { I: t } = e, n = (e) => e, r = (e) => e.strings === void 0, i = () => document.createComment(""), a = (e, r, a) => {
|
|
4
4
|
let o = e._$AA.parentNode, s = r === void 0 ? e._$AB : r._$AA;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var{I:e}=require("./element-
|
|
1
|
+
var{I:e}=require("./element-CEarCnHH.cjs").v,t=e=>e,n=e=>e.strings===void 0,r=()=>document.createComment(``),i=(n,i,a)=>{let o=n._$AA.parentNode,s=i===void 0?n._$AB:i._$AA;if(a===void 0)a=new e(o.insertBefore(r(),s),o.insertBefore(r(),s),n,n.options);else{let e=a._$AB.nextSibling,r=a._$AM,i=r!==n;if(i){let e;a._$AQ?.(n),a._$AM=n,a._$AP!==void 0&&(e=n._$AU)!==r._$AU&&a._$AP(e)}if(e!==s||i){let n=a._$AA;for(;n!==e;){let e=t(n).nextSibling;t(o).insertBefore(n,s),n=e}}}return a},a=(e,t,n=e)=>(e._$AI(t,n),e),o={},s=(e,t=o)=>e._$AH=t,c=e=>e._$AH,l=e=>{e._$AR(),e._$AA.remove()};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var e=globalThis,t=e=>e,n=e.trustedTypes,r=n?n.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,i=`$lit$`,a=`lit$${Math.random().toFixed(9).slice(2)}$`,o=`?`+a,s=`<${o}>`,c=document,l=()=>c.createComment(``),u=e=>e===null||typeof e!=`object`&&typeof e!=`function`,d=Array.isArray,f=e=>d(e)||typeof e?.[Symbol.iterator]==`function`,p=`[
|
|
2
|
-
\f\r]`,m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,h=/-->/g,g=/>/g,_=RegExp(`>|${p}(?:([^\\s"'>=/]+)(${p}*=${p}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),v=/'/g,y=/"/g,b=/^(?:script|style|textarea|title)$/i,x=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),S=Symbol.for(`lit-noChange`),C=Symbol.for(`lit-nothing`),w=new WeakMap,T=c.createTreeWalker(c,129);function E(e,t){if(!d(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return r===void 0?t:r.createHTML(t)}var D=(e,t)=>{let n=e.length-1,r=[],o,c=t===2?`<svg>`:t===3?`<math>`:``,l=m;for(let t=0;t<n;t++){let n=e[t],u,d,f=-1,p=0;for(;p<n.length&&(l.lastIndex=p,d=l.exec(n),d!==null);)p=l.lastIndex,l===m?d[1]===`!--`?l=h:d[1]===void 0?d[2]===void 0?d[3]!==void 0&&(l=_):(b.test(d[2])&&(o=RegExp(`</`+d[2],`g`)),l=_):l=g:l===_?d[0]===`>`?(l=o??m,f=-1):d[1]===void 0?f=-2:(f=l.lastIndex-d[2].length,u=d[1],l=d[3]===void 0?_:d[3]===`"`?y:v):l===y||l===v?l=_:l===h||l===g?l=m:(l=_,o=void 0);let x=l===_&&e[t+1].startsWith(`/>`)?` `:``;c+=l===m?n+s:f>=0?(r.push(u),n.slice(0,f)+i+n.slice(f)+a+x):n+a+(f===-2?t:x)}return[E(e,c+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},O=class e{constructor({strings:t,_$litType$:r},s){let c;this.parts=[];let u=0,d=0,f=t.length-1,p=this.parts,[m,h]=D(t,r);if(this.el=e.createElement(m,s),T.currentNode=this.el.content,r===2||r===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(c=T.nextNode())!==null&&p.length<f;){if(c.nodeType===1){if(c.hasAttributes())for(let e of c.getAttributeNames())if(e.endsWith(i)){let t=h[d++],n=c.getAttribute(e).split(a),r=/([.?@])?(.*)/.exec(t);p.push({type:1,index:u,name:r[2],strings:n,ctor:r[1]===`.`?N:r[1]===`?`?ee:r[1]===`@`?te:M}),c.removeAttribute(e)}else e.startsWith(a)&&(p.push({type:6,index:u}),c.removeAttribute(e));if(b.test(c.tagName)){let e=c.textContent.split(a),t=e.length-1;if(t>0){c.textContent=n?n.emptyScript:``;for(let n=0;n<t;n++)c.append(e[n],l()),T.nextNode(),p.push({type:2,index:++u});c.append(e[t],l())}}}else if(c.nodeType===8){if(c.data===o)p.push({type:2,index:u});else{let e=-1;for(;(e=c.data.indexOf(a,e+1))!==-1;)p.push({type:7,index:u}),e+=a.length-1}}u++}}static createElement(e,t){let n=c.createElement(`template`);return n.innerHTML=e,n}};function k(e,t,n=e,r){if(t===S)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=u(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=k(e,i._$AS(e,t.values),i,r)),t}var A=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??c).importNode(t,!0);T.currentNode=r;let i=T.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new j(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new ne(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=T.nextNode(),a++)}return T.currentNode=c,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},j=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=k(this,e,t),u(e)?e===C||e==null||e===``?(this._$AH!==C&&this._$AR(),this._$AH=C):e!==this._$AH&&e!==S&&this._(e):e._$litType$===void 0?e.nodeType===void 0?f(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==C&&u(this._$AH)?this._$AA.nextSibling.data=e:this.T(c.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=O.createElement(E(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new A(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=w.get(e.strings);return t===void 0&&w.set(e.strings,t=new O(e)),t}k(t){d(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(l()),this.O(l()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let n=t(e).nextSibling;t(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},M=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=C,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=C}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=k(this,e,t,0),a=!u(e)||e!==this._$AH&&e!==S,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=k(this,r[n+o],t,o),s===S&&(s=this._$AH[o]),a||=!u(s)||s!==this._$AH[o],s===C?e=C:e!==C&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},N=class extends M{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===C?void 0:e}},ee=class extends M{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==C)}},te=class extends M{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=k(this,e,t,0)??C)===S)return;let n=this._$AH,r=e===C&&n!==C||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==C&&(n===C||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ne=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){k(this,e)}},re={M:i,P:a,A:o,C:1,L:D,R:A,D:f,V:k,I:j,H:M,N:ee,U:te,B:N,F:ne},ie=e.litHtmlPolyfillSupport;ie?.(O,j),(e.litHtmlVersions??=[]).push(`3.3.3`);var ae=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new j(t.insertBefore(l(),e),e,void 0,n??{})}return i._$AI(e),i},oe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},se=e=>(...t)=>({_$litDirective$:e,values:t}),ce=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},le=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},P=globalThis,F=P.ShadowRoot&&(P.ShadyCSS===void 0||P.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,I=Symbol(),L=new WeakMap,ue=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==I)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(F&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=L.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&L.set(t,e))}return e}toString(){return this.cssText}},de=e=>new ue(typeof e==`string`?e:e+``,void 0,I),fe=(e,t)=>{if(F)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=P.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},R=F?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return de(t)})(e):e,{is:pe,defineProperty:me,getOwnPropertyDescriptor:he,getOwnPropertyNames:ge,getOwnPropertySymbols:_e,getPrototypeOf:ve}=Object,z=globalThis,B=z.trustedTypes,ye=B?B.emptyScript:``,be=z.reactiveElementPolyfillSupport,V=(e,t)=>e,H={toAttribute(e,t){switch(t){case Boolean:e=e?ye:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},U=(e,t)=>!pe(e,t),xe={attribute:!0,type:String,converter:H,reflect:!1,useDefault:!1,hasChanged:U};Symbol.metadata??=Symbol(`metadata`),z.litPropertyMetadata??=new WeakMap;var W=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=xe){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&me(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=he(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??xe}static _$Ei(){if(this.hasOwnProperty(V(`elementProperties`)))return;let e=ve(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(V(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(V(`properties`))){let e=this.properties,t=[...ge(e),..._e(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(R(e))}else e!==void 0&&t.push(R(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return fe(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?H:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?H:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??U)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};W.elementStyles=[],W.shadowRootOptions={mode:`open`},W[V(`elementProperties`)]=new Map,W[V(`finalized`)]=new Map,be?.({ReactiveElement:W}),(z.reactiveElementVersions??=[]).push(`2.1.2`);var Se={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:U},Ce=(e=Se,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function G(e){return(t,n)=>typeof n==`object`?Ce(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function we(e){return G({...e,state:!0,attribute:!1})}var K=globalThis,q=class extends W{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ae(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return S}};q._$litElement$=!0,q.finalized=!0,K.litElementHydrateSupport?.({LitElement:q});var Te=K.litElementPolyfillSupport;Te?.({LitElement:q}),(K.litElementVersions??=[]).push(`4.2.2`);var J={generic:{from:`Fra`,to:`Til`,close:`Lukk`},forms:{optional:`Valgfritt`,required:`Må fylles ut`,readMore:`Les mer <span class='pkt-sr-only'>om feltet</span>`},validation:{valueMissing:`Dette feltet er påkrevd`,checkboxGroupValueMissing:`Velg minst ett alternativ`,typeMismatch:`Ugyldig verdi`,patternMismatch:`Ugyldig format`,tooShort:`For kort`,tooLong:`For lang`,rangeUnderflow:`For lav verdi`,rangeOverflow:`For høy verdi`,rangeUnderflowMin:`Verdien må være større enn eller lik {min}.`,rangeOverflowMax:`Verdien må være mindre enn eller lik {max}.`,stepMismatch:`Må treffe på steget som er definert i elementet`,timeStepMismatch:`Må treffe på et steg, for eksempel 0, {step} minutter`,timeStepMismatchHour:`Må treffe på hver hele time`,timeStepMismatchHalfHour:`Må treffe på hver hele eller halve time`,dateUnderflow:`For tidlig dato`,dateOverflow:`For sen dato`,counterExceeded:`Du har brukt {current} av {max}`},dates:{month:`Måned`,year:`År`,week:`Uke`,days:[`Mandag`,`Tirsdag`,`Onsdag`,`Torsdag`,`Fredag`,`Lørdag`,`Søndag`],daysShort:[`Man`,`Tir`,`Ons`,`Tor`,`Fre`,`Lør`,`Søn`],months:[`Januar`,`Februar`,`Mars`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Desember`],monthsShort:[`Jan`,`Feb`,`Mar`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Des`]},calendar:{prevMonth:`Forrige måned`,nextMonth:`Neste måned`},datepicker:{openPicker:`Åpne kalender`,deleteDate:`Fjern dato`},timepicker:{hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},searchinput:{placeholder:`Søk…`,submit:`Søk`},backlink:{label:`Gå tilbake til forrige side`},breadcrumbs:{ariaLabel:`brødsmulemeny`},linkcard:{openInNewTab:`Åpnes i ny fane`},alert:{lastUpdated:`Sist oppdatert: {date}`},card:{tagsLabelOne:`merkelapp`,tagsLabelOther:`merkelapper`},tag:{remove:`Klikk for å fjerne {label}`},header:{search:`Søk`,menu:`Meny`,openMenu:`Åpne meny`,openSearch:`Åpne søkefelt`,logoLabel:`Til Oslo kommunes hovednettsted`,logoAlt:`Oslo kommune`,logOut:`Logg ut`,userMenuButton:`Brukermeny:`,userMenuLabel:`Meny for innlogget bruker`,loggedInAs:`Pålogget som`,lastLoggedIn:`Sist pålogget:`,representing:`Representerer`,orgNumber:`Org.nr. {number}`,changeRepresentation:`Endre organisasjon`,menuLoading:`Laster meny…`,menuLoadError:`Kunne ikke laste meny.`},listbox:{searchLabel:`Søk i listen`,searchPlaceholder:`Søk…`,empty:`Tom liste`,addValue:`Legg til "{value}"`,maxReached:`{selected} av maks {max} mulige er valgt.`},combobox:{noResults:`Ingen treff i søket`,maxSelected:`Maks antall valg nådd`,tooManySelected:`For mange valgt`,alreadySelected:`Verdien er allerede valgt`,valueAdded:`Ny verdi lagt til`,valueSelected:`{value} er valgt`,noValidValue:`Ingen gyldig verdi valgt`},fileupload:{dropZoneDragMultiple:`Dra filer hit for å laste dem opp eller`,dropZoneDragSingle:`Dra en fil hit for å laste den opp eller`,dropZoneDragMultipleThumbnail:`Dra bilder hit for å laste dem opp eller`,dropZoneDragSingleThumbnail:`Dra et bilde hit for å laste det opp eller`,dropZoneDragActiveMultiple:`Slipp filene her`,dropZoneDragActiveSingle:`Slipp filen her`,dropZoneDragActiveMultipleThumbnail:`Slipp bildene her`,dropZoneDragActiveSingleThumbnail:`Slipp bildet her`,dropZoneOpenFileDialogMultiple:`velg filer`,dropZoneOpenFileDialogSingle:`velg en fil`,dropZoneOpenFileDialogMultipleThumbnail:`velg fra kamerarull`,dropZoneOpenFileDialogSingleThumbnail:`velg fra kamerarull`,openFileDialogLabelMultiple:`Velg filer`,openFileDialogLabelSingle:`Velg fil`,supportedFormatsPrefix:`Format:`,invalidFormat:`Ugyldig filtype. Tillatte formater: {formats}`,sizeTooLarge:`Filen er for stor. Maks størrelse er {maxSize}.`,requiredMissing:`Du må laste opp minst én fil.`,genericValidationRejection:`Filen ble avvist av validering.`,unknownFilename:`Ukjent fil`,previewFallbackName:`Forhåndsvisning`,previewImage:`Forhåndsvis bilde {filename}`,fileLabelOne:`fil`,fileLabelOther:`filer`,srFileAdded:`Filen «{filename}» er lagt til`,srFilesAdded:`{count} filer er lagt til`,srFilesUploadedOfTotal:`{uploaded} av {total} {label} lastet opp`,srFilesFailedOfTotal:`Feil ved opplasting: {failed} av {total} {label} feilet`,filename:`Filnavn`,uploading:`Laster opp`,uploadingFile:`Laster opp fil`,save:`Lagre`,cancel:`Avbryt`,cancelUpload:`Avbryt opplasting`,removeFailed:`Fjern`,removeFailedFile:`Fjern fil som feilet under opplasting`,remove:`Slett`,removeFile:`Slett fil`,rename:`Rediger`,renameFile:`Rediger filnavn`,renameInputLabel:`Endre filnavn`,addComment:`Legg til kommentar`,editComment:`Rediger kommentar`,saveComment:`Lagre kommentar`,deleteComment:`Slett kommentar`,commentPlaceholder:`Skriv inn kommentar`,commentText:`Kommentar tekst`,commentTimestamp:`{date} kl. {time}`,previewPrevious:`Forrige bilde {index} / {total}`,previewNext:`Neste bilde {index} / {total}`,previewImageAlt:`{filename} - {index} av {total}`}},Y=Symbol.for(`@oslokommune/punkt-strings`);function X(){let e=globalThis;return e[Y]||(e[Y]={overrides:{},listeners:new Set}),e[Y]}function Ee(e){let t=X(),n={...t.overrides};for(let t of Object.keys(e)){let r=e[t];r&&(n[t]={...n[t],...r})}t.overrides=n,t.listeners.forEach(e=>e())}function De(){return X().overrides}function Oe(){let e=X();e.overrides={},e.listeners.forEach(e=>e())}function ke(e){let t=X();return t.listeners.add(e),()=>{t.listeners.delete(e)}}var Ae=new Map;function je(e,t){if(t)for(let n of Object.keys(t)){let r=t[n];r!==void 0&&(e[n]=r)}}function Me(e){return!!e&&Object.keys(e).length>0}function Ne(e){let t=De(),n=Ae.get(e);if(n&&n.overrides===t)return n.value;let r=t[e],i;if(Me(r)){let t={...J[e]};je(t,r),i=t}else i=J[e];return Ae.set(e,{overrides:t,value:i}),i}function Z(e,...t){let n=t.filter(t=>Me(t?.[e])),r=Ne(e);if(n.length===0)return r;let i={...r};for(let t of n)je(i,t?.[e]);return i}function Pe(e,...t){let n={};for(let r of e)n[r]=Z(r,...t);return n}var Fe=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){this.unsubscribe=ke(()=>this.host.requestUpdate())}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=void 0}get(e){return Z(e,this.host.strings)}getAll(e){return Pe(e,this.host.strings)}};function Q(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var $=class extends q{constructor(...e){super(...e),this.pktStrings=new Fe(this),this.role=null}hotReplacedCallback(){this.requestUpdate()}};Q([G({type:Object})],$.prototype,`strings`,void 0),Q([G({type:String})],$.prototype,`role`,void 0);var Ie=class extends ${createRenderRoot(){return this}};Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return re}});
|
|
2
|
+
\f\r]`,m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,h=/-->/g,g=/>/g,_=RegExp(`>|${p}(?:([^\\s"'>=/]+)(${p}*=${p}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),v=/'/g,y=/"/g,b=/^(?:script|style|textarea|title)$/i,x=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),S=Symbol.for(`lit-noChange`),C=Symbol.for(`lit-nothing`),w=new WeakMap,T=c.createTreeWalker(c,129);function E(e,t){if(!d(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return r===void 0?t:r.createHTML(t)}var D=(e,t)=>{let n=e.length-1,r=[],o,c=t===2?`<svg>`:t===3?`<math>`:``,l=m;for(let t=0;t<n;t++){let n=e[t],u,d,f=-1,p=0;for(;p<n.length&&(l.lastIndex=p,d=l.exec(n),d!==null);)p=l.lastIndex,l===m?d[1]===`!--`?l=h:d[1]===void 0?d[2]===void 0?d[3]!==void 0&&(l=_):(b.test(d[2])&&(o=RegExp(`</`+d[2],`g`)),l=_):l=g:l===_?d[0]===`>`?(l=o??m,f=-1):d[1]===void 0?f=-2:(f=l.lastIndex-d[2].length,u=d[1],l=d[3]===void 0?_:d[3]===`"`?y:v):l===y||l===v?l=_:l===h||l===g?l=m:(l=_,o=void 0);let x=l===_&&e[t+1].startsWith(`/>`)?` `:``;c+=l===m?n+s:f>=0?(r.push(u),n.slice(0,f)+i+n.slice(f)+a+x):n+a+(f===-2?t:x)}return[E(e,c+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},O=class e{constructor({strings:t,_$litType$:r},s){let c;this.parts=[];let u=0,d=0,f=t.length-1,p=this.parts,[m,h]=D(t,r);if(this.el=e.createElement(m,s),T.currentNode=this.el.content,r===2||r===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(c=T.nextNode())!==null&&p.length<f;){if(c.nodeType===1){if(c.hasAttributes())for(let e of c.getAttributeNames())if(e.endsWith(i)){let t=h[d++],n=c.getAttribute(e).split(a),r=/([.?@])?(.*)/.exec(t);p.push({type:1,index:u,name:r[2],strings:n,ctor:r[1]===`.`?N:r[1]===`?`?ee:r[1]===`@`?te:M}),c.removeAttribute(e)}else e.startsWith(a)&&(p.push({type:6,index:u}),c.removeAttribute(e));if(b.test(c.tagName)){let e=c.textContent.split(a),t=e.length-1;if(t>0){c.textContent=n?n.emptyScript:``;for(let n=0;n<t;n++)c.append(e[n],l()),T.nextNode(),p.push({type:2,index:++u});c.append(e[t],l())}}}else if(c.nodeType===8){if(c.data===o)p.push({type:2,index:u});else{let e=-1;for(;(e=c.data.indexOf(a,e+1))!==-1;)p.push({type:7,index:u}),e+=a.length-1}}u++}}static createElement(e,t){let n=c.createElement(`template`);return n.innerHTML=e,n}};function k(e,t,n=e,r){if(t===S)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=u(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=k(e,i._$AS(e,t.values),i,r)),t}var A=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??c).importNode(t,!0);T.currentNode=r;let i=T.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new j(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new ne(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=T.nextNode(),a++)}return T.currentNode=c,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},j=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=k(this,e,t),u(e)?e===C||e==null||e===``?(this._$AH!==C&&this._$AR(),this._$AH=C):e!==this._$AH&&e!==S&&this._(e):e._$litType$===void 0?e.nodeType===void 0?f(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==C&&u(this._$AH)?this._$AA.nextSibling.data=e:this.T(c.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=O.createElement(E(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new A(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=w.get(e.strings);return t===void 0&&w.set(e.strings,t=new O(e)),t}k(t){d(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(l()),this.O(l()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let n=t(e).nextSibling;t(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},M=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=C,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=C}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=k(this,e,t,0),a=!u(e)||e!==this._$AH&&e!==S,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=k(this,r[n+o],t,o),s===S&&(s=this._$AH[o]),a||=!u(s)||s!==this._$AH[o],s===C?e=C:e!==C&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},N=class extends M{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===C?void 0:e}},ee=class extends M{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==C)}},te=class extends M{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=k(this,e,t,0)??C)===S)return;let n=this._$AH,r=e===C&&n!==C||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==C&&(n===C||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ne=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){k(this,e)}},re={M:i,P:a,A:o,C:1,L:D,R:A,D:f,V:k,I:j,H:M,N:ee,U:te,B:N,F:ne},ie=e.litHtmlPolyfillSupport;ie?.(O,j),(e.litHtmlVersions??=[]).push(`3.3.3`);var ae=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new j(t.insertBefore(l(),e),e,void 0,n??{})}return i._$AI(e),i},oe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},se=e=>(...t)=>({_$litDirective$:e,values:t}),ce=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},le=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},P=globalThis,F=P.ShadowRoot&&(P.ShadyCSS===void 0||P.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,I=Symbol(),L=new WeakMap,ue=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==I)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(F&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=L.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&L.set(t,e))}return e}toString(){return this.cssText}},de=e=>new ue(typeof e==`string`?e:e+``,void 0,I),fe=(e,t)=>{if(F)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=P.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},R=F?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return de(t)})(e):e,{is:pe,defineProperty:me,getOwnPropertyDescriptor:he,getOwnPropertyNames:ge,getOwnPropertySymbols:_e,getPrototypeOf:ve}=Object,z=globalThis,B=z.trustedTypes,ye=B?B.emptyScript:``,be=z.reactiveElementPolyfillSupport,V=(e,t)=>e,H={toAttribute(e,t){switch(t){case Boolean:e=e?ye:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},U=(e,t)=>!pe(e,t),xe={attribute:!0,type:String,converter:H,reflect:!1,useDefault:!1,hasChanged:U};Symbol.metadata??=Symbol(`metadata`),z.litPropertyMetadata??=new WeakMap;var W=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=xe){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&me(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=he(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??xe}static _$Ei(){if(this.hasOwnProperty(V(`elementProperties`)))return;let e=ve(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(V(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(V(`properties`))){let e=this.properties,t=[...ge(e),..._e(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(R(e))}else e!==void 0&&t.push(R(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return fe(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?H:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?H:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??U)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};W.elementStyles=[],W.shadowRootOptions={mode:`open`},W[V(`elementProperties`)]=new Map,W[V(`finalized`)]=new Map,be?.({ReactiveElement:W}),(z.reactiveElementVersions??=[]).push(`2.1.2`);var Se={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:U},Ce=(e=Se,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function G(e){return(t,n)=>typeof n==`object`?Ce(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function we(e){return G({...e,state:!0,attribute:!1})}var K=globalThis,q=class extends W{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ae(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return S}};q._$litElement$=!0,q.finalized=!0,K.litElementHydrateSupport?.({LitElement:q});var Te=K.litElementPolyfillSupport;Te?.({LitElement:q}),(K.litElementVersions??=[]).push(`4.2.2`);var J={generic:{from:`Fra`,to:`Til`,close:`Lukk`},forms:{optional:`Valgfritt`,required:`Må fylles ut`,readMore:`Les mer <span class='pkt-sr-only'>om feltet</span>`},validation:{valueMissing:`Dette feltet er påkrevd`,checkboxGroupValueMissing:`Velg minst ett alternativ`,typeMismatch:`Ugyldig verdi`,patternMismatch:`Ugyldig format`,tooShort:`For kort`,tooLong:`For lang`,rangeUnderflow:`For lav verdi`,rangeOverflow:`For høy verdi`,rangeUnderflowMin:`Verdien må være større enn eller lik {min}.`,rangeOverflowMax:`Verdien må være mindre enn eller lik {max}.`,stepMismatch:`Må treffe på steget som er definert i elementet`,timeStepMismatch:`Må treffe på et steg, for eksempel 0, {step} minutter`,timeStepMismatchHour:`Må treffe på hver hele time`,timeStepMismatchHalfHour:`Må treffe på hver hele eller halve time`,dateUnderflow:`For tidlig dato`,dateOverflow:`For sen dato`,counterExceeded:`Du har brukt {current} av {max}`},dates:{month:`Måned`,year:`År`,week:`Uke`,days:[`Mandag`,`Tirsdag`,`Onsdag`,`Torsdag`,`Fredag`,`Lørdag`,`Søndag`],daysShort:[`Man`,`Tir`,`Ons`,`Tor`,`Fre`,`Lør`,`Søn`],months:[`Januar`,`Februar`,`Mars`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Desember`],monthsShort:[`Jan`,`Feb`,`Mar`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Des`]},calendar:{prevMonth:`Forrige måned`,nextMonth:`Neste måned`},datepicker:{openPicker:`Åpne kalender`,deleteDate:`Fjern dato`},timepicker:{hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},searchinput:{placeholder:`Søk…`,submit:`Søk`},backlink:{label:`Gå tilbake til forrige side`},breadcrumbs:{ariaLabel:`brødsmulemeny`},linkcard:{openInNewTab:`Åpnes i ny fane`},alert:{lastUpdated:`Sist oppdatert: {date}`},card:{tagsLabelOne:`merkelapp`,tagsLabelOther:`merkelapper`},tag:{remove:`Klikk for å fjerne {label}`},progressbar:{fraction:`{current} av {total}`},header:{search:`Søk`,menu:`Meny`,openMenu:`Åpne meny`,openSearch:`Åpne søkefelt`,logoLabel:`Til Oslo kommunes hovednettsted`,logoAlt:`Oslo kommune`,logOut:`Logg ut`,userMenuButton:`Brukermeny:`,userMenuLabel:`Meny for innlogget bruker`,loggedInAs:`Pålogget som`,lastLoggedIn:`Sist pålogget:`,representing:`Representerer`,orgNumber:`Org.nr. {number}`,changeRepresentation:`Endre organisasjon`,menuLoading:`Laster meny…`,menuLoadError:`Kunne ikke laste meny.`},listbox:{searchLabel:`Søk i listen`,searchPlaceholder:`Søk…`,empty:`Tom liste`,addValue:`Legg til "{value}"`,maxReached:`{selected} av maks {max} mulige er valgt.`},combobox:{noResults:`Ingen treff i søket`,maxSelected:`Maks antall valg nådd`,tooManySelected:`For mange valgt`,alreadySelected:`Verdien er allerede valgt`,valueAdded:`Ny verdi lagt til`,valueSelected:`{value} er valgt`,noValidValue:`Ingen gyldig verdi valgt`},fileupload:{dropZoneDragMultiple:`Dra filer hit for å laste dem opp eller`,dropZoneDragSingle:`Dra en fil hit for å laste den opp eller`,dropZoneDragMultipleThumbnail:`Dra bilder hit for å laste dem opp eller`,dropZoneDragSingleThumbnail:`Dra et bilde hit for å laste det opp eller`,dropZoneDragActiveMultiple:`Slipp filene her`,dropZoneDragActiveSingle:`Slipp filen her`,dropZoneDragActiveMultipleThumbnail:`Slipp bildene her`,dropZoneDragActiveSingleThumbnail:`Slipp bildet her`,dropZoneOpenFileDialogMultiple:`velg filer`,dropZoneOpenFileDialogSingle:`velg en fil`,dropZoneOpenFileDialogMultipleThumbnail:`velg fra kamerarull`,dropZoneOpenFileDialogSingleThumbnail:`velg fra kamerarull`,openFileDialogLabelMultiple:`Velg filer`,openFileDialogLabelSingle:`Velg fil`,supportedFormatsPrefix:`Format:`,invalidFormat:`Ugyldig filtype. Tillatte formater: {formats}`,sizeTooLarge:`Filen er for stor. Maks størrelse er {maxSize}.`,requiredMissing:`Du må laste opp minst én fil.`,genericValidationRejection:`Filen ble avvist av validering.`,unknownFilename:`Ukjent fil`,previewFallbackName:`Forhåndsvisning`,previewImage:`Forhåndsvis bilde {filename}`,fileLabelOne:`fil`,fileLabelOther:`filer`,srFileAdded:`Filen «{filename}» er lagt til`,srFilesAdded:`{count} filer er lagt til`,srFilesUploadedOfTotal:`{uploaded} av {total} {label} lastet opp`,srFilesFailedOfTotal:`Feil ved opplasting: {failed} av {total} {label} feilet`,filename:`Filnavn`,uploading:`Laster opp`,uploadingFile:`Laster opp fil`,save:`Lagre`,cancel:`Avbryt`,cancelUpload:`Avbryt opplasting`,removeFailed:`Fjern`,removeFailedFile:`Fjern fil som feilet under opplasting`,remove:`Slett`,removeFile:`Slett fil`,rename:`Rediger`,renameFile:`Rediger filnavn`,renameInputLabel:`Endre filnavn`,addComment:`Legg til kommentar`,editComment:`Rediger kommentar`,saveComment:`Lagre kommentar`,deleteComment:`Slett kommentar`,commentPlaceholder:`Skriv inn kommentar`,commentText:`Kommentar tekst`,commentTimestamp:`{date} kl. {time}`,previewPrevious:`Forrige bilde {index} / {total}`,previewNext:`Neste bilde {index} / {total}`,previewImageAlt:`{filename} - {index} av {total}`}},Y=Symbol.for(`@oslokommune/punkt-strings`);function X(){let e=globalThis;return e[Y]||(e[Y]={overrides:{},listeners:new Set}),e[Y]}function Ee(e){let t=X(),n={...t.overrides};for(let t of Object.keys(e)){let r=e[t];r&&(n[t]={...n[t],...r})}t.overrides=n,t.listeners.forEach(e=>e())}function De(){return X().overrides}function Oe(){let e=X();e.overrides={},e.listeners.forEach(e=>e())}function ke(e){let t=X();return t.listeners.add(e),()=>{t.listeners.delete(e)}}var Ae=new Map;function je(e,t){if(t)for(let n of Object.keys(t)){let r=t[n];r!==void 0&&(e[n]=r)}}function Me(e){return!!e&&Object.keys(e).length>0}function Ne(e){let t=De(),n=Ae.get(e);if(n&&n.overrides===t)return n.value;let r=t[e],i;if(Me(r)){let t={...J[e]};je(t,r),i=t}else i=J[e];return Ae.set(e,{overrides:t,value:i}),i}function Z(e,...t){let n=t.filter(t=>Me(t?.[e])),r=Ne(e);if(n.length===0)return r;let i={...r};for(let t of n)je(i,t?.[e]);return i}function Pe(e,...t){let n={};for(let r of e)n[r]=Z(r,...t);return n}var Fe=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){this.unsubscribe=ke(()=>this.host.requestUpdate())}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=void 0}get(e){return Z(e,this.host.strings)}getAll(e){return Pe(e,this.host.strings)}};function Q(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var $=class extends q{constructor(...e){super(...e),this.pktStrings=new Fe(this),this.role=null}hotReplacedCallback(){this.requestUpdate()}};Q([G({type:Object})],$.prototype,`strings`,void 0),Q([G({type:String})],$.prototype,`role`,void 0);var Ie=class extends ${createRenderRoot(){return this}};Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return re}});
|