@oslokommune/punkt-elements 19.18.2 → 19.18.3

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.
Files changed (161) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/{accordion-gEzU_AQC.js → accordion-D-mcyw_S.js} +1 -0
  3. package/dist/{accordion-Ea61u8Xj.cjs → accordion-t9p3qgCp.cjs} +1 -1
  4. package/dist/alert-CBW94-ku.cjs +39 -0
  5. package/dist/{alert-B3ify6mt.js → alert-CdfTJcT2.js} +3 -2
  6. package/dist/{backlink-HF3DMgLc.js → backlink-D3rkJWkd.js} +1 -1
  7. package/dist/{backlink-CNRyH73A.cjs → backlink-GIyyoDoi.cjs} +1 -1
  8. package/dist/{breadcrumbs-qyZMkJtA.js → breadcrumbs-B4WdX4QR.js} +1 -1
  9. package/dist/{breadcrumbs-YQ1orAK_.cjs → breadcrumbs-B7U57Zey.cjs} +1 -1
  10. package/dist/{button-DWXtPiAA.cjs → button-DdR_XzMY.cjs} +1 -1
  11. package/dist/{button-U4r2XSv4.js → button-DwcFG7bU.js} +1 -1
  12. package/dist/{calendar-C8maj_iv.js → calendar-DGOwyX3o.js} +1 -1
  13. package/dist/{calendar-4S_k7_KN.cjs → calendar-DcenMWOQ.cjs} +1 -1
  14. package/dist/{card-CS0OoVjJ.cjs → card-CizBnD59.cjs} +1 -1
  15. package/dist/{card-yxsQ563N.js → card-D4rpTD_e.js} +3 -2
  16. package/dist/{checkbox-Cj3S0xJE.cjs → checkbox-B6BVu9BZ.cjs} +1 -1
  17. package/dist/{checkbox-A5B82H0n.js → checkbox-BTD7bz3U.js} +2 -1
  18. package/dist/{checkbox-group-AVOtCLSB.js → checkbox-group-4dLJ_HTY.js} +2 -2
  19. package/dist/{checkbox-group-BFtLRclu.cjs → checkbox-group-CREaHr24.cjs} +1 -1
  20. package/dist/{combobox-rmrzvK3U.cjs → combobox-B-bdCNiE.cjs} +1 -1
  21. package/dist/{combobox-CScZtqsn.js → combobox-CVg5vs-l.js} +4 -4
  22. package/dist/components/loader/loader.d.ts +3 -3
  23. package/dist/components/modal/modal.d.ts +2 -2
  24. package/dist/components/tag/tag.d.ts +3 -4
  25. package/dist/{consent-JoGVWIB7.js → consent-Chtz1yL0.js} +2 -1
  26. package/dist/consent-Dhh207Zz.cjs +18 -0
  27. package/dist/{datepicker-C8DQaZa8.js → datepicker-DeTZy8NM.js} +5 -5
  28. package/dist/{datepicker-BOi60ruU.cjs → datepicker-DvI7BT4S.cjs} +1 -1
  29. package/dist/{fileupload-jSc9M2Ok.js → fileupload-iGE2WK9e.js} +5 -5
  30. package/dist/{fileupload-Dov3DkmR.cjs → fileupload-pGOXdyL0.cjs} +1 -1
  31. package/dist/{footer-BOIVSL59.js → footer-D4R-9si6.js} +3 -2
  32. package/dist/{footer-MYZSMtmP.cjs → footer-QGnujLm9.cjs} +1 -1
  33. package/dist/{header-BCpCu0HP.js → header-A70TKzPE.js} +7 -6
  34. package/dist/{header-CecwTgso.cjs → header-B3TDAMMX.cjs} +1 -1
  35. package/dist/{header-menu-BEhnqxnw.js → header-menu-BK36mG6a.js} +3 -2
  36. package/dist/{header-menu-CkZjAxHb.cjs → header-menu-CWrw01rm.cjs} +1 -1
  37. package/dist/{helptext-BXoDjtNs.js → helptext-BXryqHy5.js} +1 -1
  38. package/dist/{helptext-DPqzGQeD.cjs → helptext-KrtUyA7H.cjs} +1 -1
  39. package/dist/{icon-D3XT49vM.js → icon-BVSiUQSL.js} +1 -0
  40. package/dist/icon-BsRlhXU2.cjs +1 -0
  41. package/dist/{input-element-JH4qPly5.js → input-element-8mrCxToc.js} +1 -0
  42. package/dist/input-element-a5dcxOzs.cjs +1 -0
  43. package/dist/{input-wrapper-BttEKK9G.js → input-wrapper-7RSISZu6.js} +4 -3
  44. package/dist/{input-wrapper-Bekd6DGA.cjs → input-wrapper-DT9h0n2i.cjs} +1 -1
  45. package/dist/{link-Cb0ufHt0.js → link-DL4dZoI5.js} +1 -1
  46. package/dist/{link-UEoCDWe-.cjs → link-u69d_-Zh.cjs} +1 -1
  47. package/dist/{linkcard-Dmp8DOyg.cjs → linkcard-B6N7xChn.cjs} +1 -1
  48. package/dist/{linkcard-CD-tRZnz.js → linkcard-C_9NCgkD.js} +1 -1
  49. package/dist/{loader-B0p9ZrAa.js → loader-DJGAd8c-.js} +8 -8
  50. package/dist/{loader-nd4WUR88.cjs → loader-l7CLjzgI.cjs} +8 -8
  51. package/dist/{messagebox-B-DU7T5q.js → messagebox-V1Kszdop.js} +2 -1
  52. package/dist/{messagebox-Bx9jEw4V.cjs → messagebox-YkknrtEM.cjs} +1 -1
  53. package/dist/{modal-SFoXzth5.cjs → modal--k988mEb.cjs} +19 -21
  54. package/dist/{modal-Cv0uz8iY.js → modal-EjPYLhS-.js} +19 -21
  55. package/dist/option-group-element-BEGRouXw.cjs +23 -0
  56. package/dist/{option-group-element-16F2MJlO.js → option-group-element-CQViBzca.js} +2 -1
  57. package/dist/pkt-accordion.cjs +1 -1
  58. package/dist/pkt-accordion.js +1 -1
  59. package/dist/pkt-alert.cjs +1 -1
  60. package/dist/pkt-alert.js +1 -1
  61. package/dist/pkt-backlink.cjs +1 -1
  62. package/dist/pkt-backlink.js +1 -1
  63. package/dist/pkt-breadcrumbs.cjs +1 -1
  64. package/dist/pkt-breadcrumbs.js +1 -1
  65. package/dist/pkt-button.cjs +1 -1
  66. package/dist/pkt-button.js +1 -1
  67. package/dist/pkt-calendar.cjs +1 -1
  68. package/dist/pkt-calendar.js +1 -1
  69. package/dist/pkt-card.cjs +1 -1
  70. package/dist/pkt-card.js +1 -1
  71. package/dist/pkt-checkbox-group.cjs +1 -1
  72. package/dist/pkt-checkbox-group.js +1 -1
  73. package/dist/pkt-checkbox.cjs +1 -1
  74. package/dist/pkt-checkbox.js +1 -1
  75. package/dist/pkt-combobox.cjs +1 -1
  76. package/dist/pkt-combobox.js +1 -1
  77. package/dist/pkt-consent.cjs +1 -1
  78. package/dist/pkt-consent.js +1 -1
  79. package/dist/pkt-datepicker.cjs +1 -1
  80. package/dist/pkt-datepicker.js +1 -1
  81. package/dist/pkt-fileupload.cjs +1 -1
  82. package/dist/pkt-fileupload.js +1 -1
  83. package/dist/pkt-footer.cjs +1 -1
  84. package/dist/pkt-footer.js +1 -1
  85. package/dist/pkt-header-menu.cjs +1 -1
  86. package/dist/pkt-header-menu.js +1 -1
  87. package/dist/pkt-header.cjs +1 -1
  88. package/dist/pkt-header.js +1 -1
  89. package/dist/pkt-helptext.cjs +1 -1
  90. package/dist/pkt-helptext.js +1 -1
  91. package/dist/pkt-icon.cjs +1 -1
  92. package/dist/pkt-icon.js +1 -1
  93. package/dist/pkt-index.cjs +1 -1
  94. package/dist/pkt-index.js +34 -34
  95. package/dist/pkt-input-wrapper.cjs +1 -1
  96. package/dist/pkt-input-wrapper.js +1 -1
  97. package/dist/pkt-link.cjs +1 -1
  98. package/dist/pkt-link.js +1 -1
  99. package/dist/pkt-linkcard.cjs +1 -1
  100. package/dist/pkt-linkcard.js +1 -1
  101. package/dist/pkt-loader.cjs +1 -1
  102. package/dist/pkt-loader.js +1 -1
  103. package/dist/pkt-messagebox.cjs +1 -1
  104. package/dist/pkt-messagebox.js +1 -1
  105. package/dist/pkt-modal.cjs +1 -1
  106. package/dist/pkt-modal.js +1 -1
  107. package/dist/pkt-progressbar.cjs +1 -1
  108. package/dist/pkt-progressbar.js +1 -1
  109. package/dist/pkt-radio-group.cjs +1 -1
  110. package/dist/pkt-radio-group.js +1 -1
  111. package/dist/pkt-radiobutton.cjs +1 -1
  112. package/dist/pkt-radiobutton.js +1 -1
  113. package/dist/pkt-searchinput.cjs +1 -1
  114. package/dist/pkt-searchinput.js +1 -1
  115. package/dist/pkt-select.cjs +1 -1
  116. package/dist/pkt-select.js +1 -1
  117. package/dist/pkt-tabs.cjs +1 -1
  118. package/dist/pkt-tabs.js +1 -1
  119. package/dist/pkt-tag.cjs +1 -1
  120. package/dist/pkt-tag.js +1 -1
  121. package/dist/pkt-textarea.cjs +1 -1
  122. package/dist/pkt-textarea.js +1 -1
  123. package/dist/pkt-textinput.cjs +1 -1
  124. package/dist/pkt-textinput.js +1 -1
  125. package/dist/pkt-timepicker.cjs +1 -1
  126. package/dist/pkt-timepicker.js +1 -1
  127. package/dist/{progressbar-CMwFXEMB.js → progressbar-BJswle17.js} +1 -1
  128. package/dist/{progressbar-eRJU41Uc.cjs → progressbar-BVeWeSLq.cjs} +1 -1
  129. package/dist/{radio-group-CO3dzdOl.js → radio-group-CYEnKuIM.js} +2 -2
  130. package/dist/{radio-group-S8Gg4Qaq.cjs → radio-group-DI_5eAL4.cjs} +1 -1
  131. package/dist/{radiobutton-CYlly_Zk.cjs → radiobutton-Cf3ROHzB.cjs} +1 -1
  132. package/dist/{radiobutton-BNsed-4-.js → radiobutton-DY3tXJ8Z.js} +2 -1
  133. package/dist/{searchinput-CVpPmZAJ.cjs → searchinput-B1m241pF.cjs} +1 -1
  134. package/dist/{searchinput-Ca6zFqH5.js → searchinput-zxHqZ-jG.js} +1 -1
  135. package/dist/{select-C74U9Tyl.cjs → select-B2W70m_k.cjs} +1 -1
  136. package/dist/{select-C7r2Y7Bq.js → select-CeFVfjM-.js} +2 -2
  137. package/dist/shared-types/heading.d.ts +2 -1
  138. package/dist/shared-types/index.d.ts +2 -2
  139. package/dist/shared-types/size.d.ts +4 -12
  140. package/dist/shared-types-A6iGIX-f.js +1 -0
  141. package/dist/shared-types-BvRk9kiK.cjs +0 -0
  142. package/dist/{tabs-CxG9lgAB.js → tabs-ZhYxE5fX.js} +1 -1
  143. package/dist/{tabs-BsVUzKix.cjs → tabs-fXlMzPFJ.cjs} +1 -1
  144. package/dist/{tag-BfFtiV5e.cjs → tag-B2EEjkjD.cjs} +9 -9
  145. package/dist/{tag-BswfpmoV.js → tag-Bv5JRS69.js} +9 -9
  146. package/dist/{textarea-VObZEvUw.cjs → textarea-BBo8oZA-.cjs} +1 -1
  147. package/dist/{textarea-5aOI1Qkq.js → textarea-BOOFnUFu.js} +4 -3
  148. package/dist/{textinput-Wd1yRQuN.cjs → textinput-GRYgsT0X.cjs} +1 -1
  149. package/dist/{textinput-DABFhf0d.js → textinput-wzBD3Tk1.js} +3 -3
  150. package/dist/{timepicker-Cc_7siiw.cjs → timepicker-DLF0UN3M.cjs} +1 -1
  151. package/dist/{timepicker-Bfp365j8.js → timepicker-x0PuqU-M.js} +3 -3
  152. package/dist/types/size.d.ts +2 -1
  153. package/package.json +2 -2
  154. package/src/components/loader/loader.ts +15 -13
  155. package/src/components/modal/modal.ts +33 -29
  156. package/src/components/tag/tag.ts +21 -25
  157. package/dist/alert-ByQC8-D1.cjs +0 -39
  158. package/dist/consent-T0-aOOEh.cjs +0 -18
  159. package/dist/icon-Dk8y6odR.cjs +0 -1
  160. package/dist/input-element-BhbkMU20.cjs +0 -1
  161. package/dist/option-group-element-DHpno4pS.cjs +0 -23
package/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [19.18.3](https://github.com/oslokommune/punkt/compare/19.18.2...19.18.3) (2026-10-20)
9
+
10
+ ---
11
+
12
+
8
13
  ## [19.18.2](https://github.com/oslokommune/punkt/compare/19.18.1...19.18.2) (2026-10-20)
9
14
 
10
15
  ### Bug Fixes
@@ -1,6 +1,7 @@
1
1
  import { _ as e, c as t, d as n, l as r, n as i, u as a } from "./element-ckeMVgMz.js";
2
2
  import { t as o } from "./class-map-BkEYw5uE.js";
3
3
  import { i as s, t as c } from "./element-with-slot-Dp2Gzv-Q.js";
4
+ import "./shared-types-A6iGIX-f.js";
4
5
  import { t as l } from "./if-defined-D18nY_K_.js";
5
6
  import { n as u, t as d } from "./consume-Bp12si68.js";
6
7
  import { t as f } from "./provide-_MnlMGnw.js";
@@ -1,4 +1,4 @@
1
- const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs"),r=require("./if-defined-CiML3MTM.cjs"),i=require("./consume-kEjgTrAp.cjs"),a=require("./provide-Cz18sYug.cjs"),o=require("./ref-CB7e9nMY.cjs");var s=[`beige`,`blue`],c=i.n(Symbol(`pkt-accordion-context`)),l=class extends e.c{constructor(...e){super(...e),this.ariaLabelledBy=``,this.compact=!1,this.skin=`borderless`,this.name=``,this.context={skin:this.skin}}willUpdate(e){e.has(`skin`)&&(this.context={...this.context,skin:this.skin})}updated(e){e.has(`name`)&&this.updateAccordionItemNames()}updateAccordionItemNames(){if(this.name){let e=this.renderRoot?.querySelector(`slot`);e&&e.assignedElements().forEach(e=>{e.tagName.toLowerCase()===`pkt-accordion-item`&&(e.hasAttribute(`name`)||e.setAttribute(`name`,this.name))})}}firstUpdated(){let e=this.renderRoot?.querySelector(`slot`);e&&e.addEventListener(`slotchange`,()=>{this.updateAccordionItemNames()})}render(){let n={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return e._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./shared-types-BvRk9kiK.cjs");const r=require("./if-defined-CiML3MTM.cjs"),i=require("./consume-kEjgTrAp.cjs"),a=require("./provide-Cz18sYug.cjs"),o=require("./ref-CB7e9nMY.cjs");var s=[`beige`,`blue`],c=i.n(Symbol(`pkt-accordion-context`)),l=class extends e.c{constructor(...e){super(...e),this.ariaLabelledBy=``,this.compact=!1,this.skin=`borderless`,this.name=``,this.context={skin:this.skin}}willUpdate(e){e.has(`skin`)&&(this.context={...this.context,skin:this.skin})}updated(e){e.has(`name`)&&this.updateAccordionItemNames()}updateAccordionItemNames(){if(this.name){let e=this.renderRoot?.querySelector(`slot`);e&&e.assignedElements().forEach(e=>{e.tagName.toLowerCase()===`pkt-accordion-item`&&(e.hasAttribute(`name`)||e.setAttribute(`name`,this.name))})}}firstUpdated(){let e=this.renderRoot?.querySelector(`slot`);e&&e.addEventListener(`slotchange`,()=>{this.updateAccordionItemNames()})}render(){let n={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return e._`
2
2
  <div
3
3
  part="container"
4
4
  class=${t.t(n)}
@@ -0,0 +1,39 @@
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("./shared-types-BvRk9kiK.cjs"),require("./icon-BsRlhXU2.cjs");const i=require("./classutils-CbklAJDe.cjs"),a=require("./define-component-spec-DBNd2FJY.cjs");require("./button-DdR_XzMY.cjs");var o=[`off`,`polite`,`assertive`],s=[`info`,`success`,`warning`,`error`],c=[`medium`,`small`,`xsmall`],l={compact:!1},u=a.t({name:`pkt-alert`,react:`PktAlert`,"css-class":`pkt-alert`,"dark-mode":!0,isElement:!0,isPureReact:!0,events:{onClose:{reactOnly:!0,description:`React: Klikk-event for 'Lukk'-knappen`},close:{elementsOnly:!0,description:`Elements: Klikk-event for 'Lukk'-knappen`},"on-close":{elementsOnly:!0,description:`Elements: Samme event som <code>close</code>, beholdt for eldre Vue-oppsett.`,deprecated:`Bruk <code>close</code>. <code>on-close</code> fjernes i en senere hovedversjon.`}},props:{title:{name:`Tittel`,description:`Tittelen som vises øverst i på meldingen`,type:`string`,category:`contents`},skin:{name:`Utseende`,description:`Hvordan type melding er dette?`,type:[...s],default:`info`,category:`ui`},date:{name:`Sist oppdatert`,description:`Dato som vises nederst i på meldingen`,type:`string`,category:`contents`},ariaLive:{name:`aria-live`,description:`Hvordan skal skjermleseren lese opp meldingen?`,type:[...o],default:`polite`,category:`accessibility`},size:{name:`Størrelse`,description:`Endrer størrelsen på ulike elementer i alerten.`,type:[...c],default:`medium`,category:`ui`},closeAlert:{name:`Vis 'Lukk'-knapp`,description:`Viser 'Lukk'-knappen`,type:`boolean`,default:!1,category:`ui`},compact:{name:`Kompakt`,description:`Kompakt visning av alerten.`,deprecated:"Bruk `size` i stedet; uten eksplisitt `size` gir compact størrelsen 'small'.",type:`boolean`,category:`ui`,default:l.compact}},slots:{default:{description:`Innholdet i meldingen`}}}),d=class extends r.t{constructor(){super(),this.compact=l.compact,this.title=``,this.skin=u.props.skin.default,this.ariaLive=u.props.ariaLive.default,this.ariaLiveAttr=null,this.closeAlert=u.props.closeAlert.default,this.date=null,this.role=`status`,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0,composed:!0}))},this._isClosed=!1}connectedCallback(){super.connectedCallback(),this.ariaLiveAttr=this.getAttribute(`aria-live`)||this.ariaLive}attributeChangedCallback(e,t,n){e===`ariaLive`&&(this.ariaLiveAttr=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`ariaLive`)&&e.get(`ariaLive`)!==void 0&&(this.ariaLiveAttr=this.ariaLive),e.has(`_isClosed`)&&i.t(this,`pkt-hide`,this._isClosed)}render(){let i=this.size??(this.compact?`small`:`medium`),a={"pkt-alert":!0,[`pkt-alert--${i}`]:!0,[`pkt-alert--${this.skin}`]:!0,"pkt-hide":this._isClosed},o={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return e._`
2
+ <div
3
+ class=${t.t(a)}
4
+ aria-live=${this.ariaLiveAttr}
5
+ role=${this.role}
6
+ >
7
+ <div class=${t.t(o)}>
8
+ <pkt-icon
9
+ class="pkt-alert__icon"
10
+ aria-hidden="true"
11
+ name=${this.skin===`info`?`alert-information`:`alert-${this.skin}`}
12
+ ></pkt-icon>
13
+
14
+ ${this.closeAlert?e._`
15
+ <div class="pkt-alert__close">
16
+ <pkt-button
17
+ tabindex="0"
18
+ aria-label=${this.pktStrings.get(`generic`).close}
19
+ size=${i}
20
+ type="button"
21
+ skin="tertiary"
22
+ iconName="close"
23
+ variant="icon-only"
24
+ @click=${this.close}
25
+ >
26
+ <span class="sr-only">${this.pktStrings.get(`generic`).close}</span>
27
+ </pkt-button>
28
+ </div>
29
+ `:e.h}
30
+ ${this.title?e._`<div class="pkt-alert__title">${this.title}</div>`:e.h}
31
+
32
+ <div class="pkt-alert__text">${r.i(this)}</div>
33
+
34
+ ${this.date?e._`<div class="pkt-alert__date">
35
+ ${n.t(this.pktStrings.get(`alert`).lastUpdated,{date:this.date})}
36
+ </div>`:e.h}
37
+ </div>
38
+ </div>
39
+ `}};e.n([e.u({type:Boolean,reflect:!1})],d.prototype,`compact`,void 0),e.n([e.u({type:String,reflect:!0})],d.prototype,`title`,void 0),e.n([e.u({type:String,reflect:!0})],d.prototype,`skin`,void 0),e.n([e.u({type:String})],d.prototype,`ariaLive`,void 0),e.n([e.u({type:String,reflect:!0,attribute:`aria-live`})],d.prototype,`ariaLiveAttr`,void 0),e.n([e.u({type:Boolean,reflect:!0})],d.prototype,`closeAlert`,void 0),e.n([e.u({type:String,reflect:!0})],d.prototype,`date`,void 0),e.n([e.u({type:String})],d.prototype,`role`,void 0),e.n([e.u({type:String,attribute:`size`})],d.prototype,`size`,void 0),e.n([e.l()],d.prototype,`_isClosed`,void 0);try{e.d(`pkt-alert`)(d)}catch{console.warn(`Forsøker å definere <pkt-alert>, men den er allerede definert`)}var f=d;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
@@ -2,10 +2,11 @@ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-ckeMVg
2
2
  import { t as o } from "./class-map-BkEYw5uE.js";
3
3
  import { t as s } from "./format-BTeSVkED.js";
4
4
  import { i as c, t as l } from "./element-with-slot-Dp2Gzv-Q.js";
5
- import "./icon-D3XT49vM.js";
5
+ import "./shared-types-A6iGIX-f.js";
6
+ import "./icon-BVSiUQSL.js";
6
7
  import { t as u } from "./classutils-DcYnSgfc.js";
7
8
  import { t as d } from "./define-component-spec-BYOSeplU.js";
8
- import "./button-U4r2XSv4.js";
9
+ import "./button-DwcFG7bU.js";
9
10
  //#region ../../shared-types/aria.ts
10
11
  var f = [
11
12
  "off",
@@ -1,5 +1,5 @@
1
1
  import { _ as e, d as t, n, t as r, u as i } from "./element-ckeMVgMz.js";
2
- import "./icon-D3XT49vM.js";
2
+ import "./icon-BVSiUQSL.js";
3
3
  import { t as a } from "./if-defined-D18nY_K_.js";
4
4
  //#region src/components/backlink/backlink.ts
5
5
  var o = class extends r {
@@ -1,4 +1,4 @@
1
- const e=require("./element-C6WTyJFE.cjs");require("./icon-Dk8y6odR.cjs");const t=require("./if-defined-CiML3MTM.cjs");var n=class extends e.t{constructor(...e){super(...e),this.href=``,this.text=`Forsiden`,this.ariaLabel=null}attributeChangedCallback(e,t,n){e===`arialabel`&&this.removeAttribute(`arialabel`),e===`href`&&this.removeAttribute(`href`),e===`text`&&this.removeAttribute(`text`),super.attributeChangedCallback(e,t,n)}render(){return e._`<nav
1
+ const e=require("./element-C6WTyJFE.cjs");require("./icon-BsRlhXU2.cjs");const t=require("./if-defined-CiML3MTM.cjs");var n=class extends e.t{constructor(...e){super(...e),this.href=``,this.text=`Forsiden`,this.ariaLabel=null}attributeChangedCallback(e,t,n){e===`arialabel`&&this.removeAttribute(`arialabel`),e===`href`&&this.removeAttribute(`href`),e===`text`&&this.removeAttribute(`text`),super.attributeChangedCallback(e,t,n)}render(){return e._`<nav
2
2
  class="pkt-back-link"
3
3
  aria-label=${this.ariaLabel||this.pktStrings.get(`backlink`).label}
4
4
  >
@@ -1,5 +1,5 @@
1
1
  import { _ as e, d as t, h as n, n as r, t as i, u as a } from "./element-ckeMVgMz.js";
2
- import "./icon-D3XT49vM.js";
2
+ import "./icon-BVSiUQSL.js";
3
3
  //#region src/components/breadcrumbs/breadcrumbs.ts
4
4
  var o = class extends i {
5
5
  constructor(...e) {
@@ -1,4 +1,4 @@
1
- const e=require("./element-C6WTyJFE.cjs");require("./icon-Dk8y6odR.cjs");var t=class extends e.t{constructor(...e){super(...e),this.breadcrumbs=[]}handleLinkClick(e,t,n){let r=new CustomEvent(`navigate`,{detail:{item:t,index:n,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}render(){if(!this.breadcrumbs||this.breadcrumbs.length===0)return e.h;let t=this.breadcrumbs[this.breadcrumbs.length-2];return e._`
1
+ const e=require("./element-C6WTyJFE.cjs");require("./icon-BsRlhXU2.cjs");var t=class extends e.t{constructor(...e){super(...e),this.breadcrumbs=[]}handleLinkClick(e,t,n){let r=new CustomEvent(`navigate`,{detail:{item:t,index:n,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}render(){if(!this.breadcrumbs||this.breadcrumbs.length===0)return e.h;let t=this.breadcrumbs[this.breadcrumbs.length-2];return e._`
2
2
  <nav class="pkt-breadcrumbs" aria-label=${this.pktStrings.get(`breadcrumbs`).ariaLabel}>
3
3
  <ol class="pkt-breadcrumbs__list pkt-breadcrumbs--desktop">
4
4
  ${this.breadcrumbs.map((t,n)=>n===this.breadcrumbs.length-1?e._`
@@ -1,4 +1,4 @@
1
- const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-Dk8y6odR.cjs");const r=require("./if-defined-CiML3MTM.cjs");var i,a=`https://punkt-cdn.oslo.kommune.no/latest/animations/`;typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||a);var o=class i extends n.t{constructor(...e){super(...e),this.iconName=`user`,this.secondIconName=`user`,this.size=`medium`,this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin=`primary`,this.variant=`label-only`,this.state=void 0,this.type=`button`,this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:a,this.relocatedAria={}}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener(`keydown`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}willUpdate(e){super.willUpdate(e);let t=!1,n={...this.relocatedAria};for(let e of i.relocatedAriaAttributes){let r=this.getAttribute(e);r!==null&&(n[e]=r,this.removeAttribute(e),t=!0)}t&&(this.relocatedAria=n)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let i=this.form??this.getAttribute(`form`)??void 0,a={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--isLoading":!!this.isLoading};return e._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-BsRlhXU2.cjs");const r=require("./if-defined-CiML3MTM.cjs");var i,a=`https://punkt-cdn.oslo.kommune.no/latest/animations/`;typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||a);var o=class i extends n.t{constructor(...e){super(...e),this.iconName=`user`,this.secondIconName=`user`,this.size=`medium`,this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin=`primary`,this.variant=`label-only`,this.state=void 0,this.type=`button`,this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:a,this.relocatedAria={}}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener(`keydown`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}willUpdate(e){super.willUpdate(e);let t=!1,n={...this.relocatedAria};for(let e of i.relocatedAriaAttributes){let r=this.getAttribute(e);r!==null&&(n[e]=r,this.removeAttribute(e),t=!0)}t&&(this.relocatedAria=n)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let i=this.form??this.getAttribute(`form`)??void 0,a={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--isLoading":!!this.isLoading};return e._`
2
2
  <button
3
3
  class=${t.t(a)}
4
4
  type=${this.type}
@@ -1,7 +1,7 @@
1
1
  import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-ckeMVgMz.js";
2
2
  import { t as o } from "./class-map-BkEYw5uE.js";
3
3
  import { i as s, t as c } from "./element-with-slot-Dp2Gzv-Q.js";
4
- import "./icon-D3XT49vM.js";
4
+ import "./icon-BVSiUQSL.js";
5
5
  import { t as l } from "./if-defined-D18nY_K_.js";
6
6
  //#region src/components/button/button.ts
7
7
  var u, d = "https://punkt-cdn.oslo.kommune.no/latest/animations/";
@@ -1,6 +1,6 @@
1
1
  import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-ckeMVgMz.js";
2
2
  import { t as s } from "./class-map-BkEYw5uE.js";
3
- import "./icon-D3XT49vM.js";
3
+ import "./icon-BVSiUQSL.js";
4
4
  import { _ as c, a as l, b as u, d, f, g as p, l as m, m as h, o as g, p as _, t as v, v as y, y as b } from "./converters-CYgQrWVm.js";
5
5
  //#region ../../shared-types/calendar.ts
6
6
  var x = {
@@ -1,4 +1,4 @@
1
- const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs");require("./icon-Dk8y6odR.cjs");const n=require("./converters-CW6SN0TT.cjs");var r={multiple:!1,maxMultiple:0,range:!1,earliest:null,latest:null,weeknumbers:!1,withcontrols:!1};function i(e,t,r){let i=n.y(e,r?.in);return isNaN(t)?n.b(r?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function a(e,t){let[r,i]=n.v(e,t.start,t.end);return{start:r,end:i}}function o(e,t){let{start:r,end:i}=a(t?.in,e),o=+r>+i,s=o?+r:+i,c=o?i:r;c.setHours(0,0,0,0);let l=t?.step??1;if(!l)return[];l<0&&(l=-l,o=!o);let u=[];for(;+c<=s;)u.push(n.b(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return o?u.reverse():u}function s(e,t){let r=n.y(e,t?.in).getDay();return r===0?7:r}function c(e,t){let r=(t.excludedates??[]).map(e=>typeof e==`string`?e:n.a(e));return!n.l(e,t.earliest,t.latest,r,t.excludeweekdays??[])}function l(e,t,n,r){return!!(c(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function u(e,t,r){let i=n.p(e,t,0);return!(r&&n.d(r)>i)}function d(e,t,r){let i=n.p(t===11?e+1:e,t===11?0:t+1,1);return!(r&&n.d(r)<i)}function f(e,t){let r=n.p(e,t,1),i=n.p(e,t+1,0),a=(r.getDay()+6)%7,o=i.getDate();return{firstDayOfMonth:r,lastDayOfMonth:i,startingDay:a,numDays:o,numRows:Math.ceil((o+a)/7),initialWeek:n._(r)}}function p(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function m(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>n.m(e))}function h(e,t){let r=o({start:e,end:t}),i={};if(Array.isArray(r)&&r.length)for(let a=0;a<r.length;a++){let o=r[a],s=o>e&&o<t;i[n.a(o)]=s}return i}function g(e,t,n,r){if(t.length!==1)return!0;let i=o({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(s(i[a]).toString()))return!1}return!0}function _(e,t){let r=n.a(e);return t.includes(r)?t:[...t,r]}function v(e,t){let r=n.a(e),i=t.indexOf(r);if(i===-1)return t;if(t.length===1)return[];let a=[...t];return a.splice(i,1),a}function y(e,t,r){let i=n.a(e);return t.includes(i)?v(e,t):r>0&&t.length>=r?t:_(e,t)}function b(e,t,r){let i=n.a(e),a=m(t);return t.includes(i)?t.indexOf(i)===0?[]:v(e,t):t.length>1||t.length===1&&(!g(e,a,r.excludedates,r.excludeweekdays)||a[0]>e)?[i]:_(e,t)}var x={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function S(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function C(e,t,r){let a=i(e,t);if(!a)return null;let o=r(`button[data-date="${n.a(a)}"]`);for(;o instanceof HTMLButtonElement&&o.dataset.disabled;)if(a=i(a,t),o=r(`button[data-date="${n.a(a)}"]`),!o)return null;return a}function w(e){return x[e]??null}var T=class extends e.t{constructor(...e){super(...e),this.selected=[],this.multiple=r.multiple,this.maxMultiple=r.maxMultiple,this.range=r.range,this.earliest=r.earliest,this.latest=r.latest,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=r.weeknumbers,this.withcontrols=r.withcontrols,this.currentmonth=null,this.today=null,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get calendarStrings(){let e=this.pktStrings.get(`dates`),t=this.pktStrings.get(`calendar`);return{daysShort:this.dayStrings??e.daysShort,days:this.dayStringsLong??e.days,months:this.monthStrings??e.months,week:this.weekString??e.week,prevMonth:this.prevMonthString??t.prevMonth,nextMonth:this.nextMonthString??t.nextMonth}}get todayDate(){return this.today?n.m(this.today):n.g()}firstUpdated(e){this.addEventListener(`keydown`,this.handleKeydown)}disconnectedCallback(){this.removeEventListener(`keydown`,this.handleKeydown),super.disconnectedCallback()}willUpdate(e){super.willUpdate(e),e.has(`selected`)&&this.convertSelected()}convertSelected(){typeof this.selected==`string`&&(this.selected=this.selected.split(`,`)),this.selected.length===1&&this.selected[0]===``&&(this.selected=[]),this._selected=m(this.selected),this.range&&this.selected.length===2&&(this.inRange=h(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==``){let e=n.m(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?n.f(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=n.f(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=n.f(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){let t=w(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){let r=e.target;if(S(r))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}let i=C(this.focusedDate?n.d(this.focusedDate):n.p(this.year,this.month,1),t,this.querySelector.bind(this));if(i){let e=this.querySelector(`button[data-date="${n.a(i)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(this.focusedDate=n.a(i),e.focus())}}render(){return e._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs");require("./icon-BsRlhXU2.cjs");const n=require("./converters-CW6SN0TT.cjs");var r={multiple:!1,maxMultiple:0,range:!1,earliest:null,latest:null,weeknumbers:!1,withcontrols:!1};function i(e,t,r){let i=n.y(e,r?.in);return isNaN(t)?n.b(r?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function a(e,t){let[r,i]=n.v(e,t.start,t.end);return{start:r,end:i}}function o(e,t){let{start:r,end:i}=a(t?.in,e),o=+r>+i,s=o?+r:+i,c=o?i:r;c.setHours(0,0,0,0);let l=t?.step??1;if(!l)return[];l<0&&(l=-l,o=!o);let u=[];for(;+c<=s;)u.push(n.b(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return o?u.reverse():u}function s(e,t){let r=n.y(e,t?.in).getDay();return r===0?7:r}function c(e,t){let r=(t.excludedates??[]).map(e=>typeof e==`string`?e:n.a(e));return!n.l(e,t.earliest,t.latest,r,t.excludeweekdays??[])}function l(e,t,n,r){return!!(c(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function u(e,t,r){let i=n.p(e,t,0);return!(r&&n.d(r)>i)}function d(e,t,r){let i=n.p(t===11?e+1:e,t===11?0:t+1,1);return!(r&&n.d(r)<i)}function f(e,t){let r=n.p(e,t,1),i=n.p(e,t+1,0),a=(r.getDay()+6)%7,o=i.getDate();return{firstDayOfMonth:r,lastDayOfMonth:i,startingDay:a,numDays:o,numRows:Math.ceil((o+a)/7),initialWeek:n._(r)}}function p(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function m(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>n.m(e))}function h(e,t){let r=o({start:e,end:t}),i={};if(Array.isArray(r)&&r.length)for(let a=0;a<r.length;a++){let o=r[a],s=o>e&&o<t;i[n.a(o)]=s}return i}function g(e,t,n,r){if(t.length!==1)return!0;let i=o({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(s(i[a]).toString()))return!1}return!0}function _(e,t){let r=n.a(e);return t.includes(r)?t:[...t,r]}function v(e,t){let r=n.a(e),i=t.indexOf(r);if(i===-1)return t;if(t.length===1)return[];let a=[...t];return a.splice(i,1),a}function y(e,t,r){let i=n.a(e);return t.includes(i)?v(e,t):r>0&&t.length>=r?t:_(e,t)}function b(e,t,r){let i=n.a(e),a=m(t);return t.includes(i)?t.indexOf(i)===0?[]:v(e,t):t.length>1||t.length===1&&(!g(e,a,r.excludedates,r.excludeweekdays)||a[0]>e)?[i]:_(e,t)}var x={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function S(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function C(e,t,r){let a=i(e,t);if(!a)return null;let o=r(`button[data-date="${n.a(a)}"]`);for(;o instanceof HTMLButtonElement&&o.dataset.disabled;)if(a=i(a,t),o=r(`button[data-date="${n.a(a)}"]`),!o)return null;return a}function w(e){return x[e]??null}var T=class extends e.t{constructor(...e){super(...e),this.selected=[],this.multiple=r.multiple,this.maxMultiple=r.maxMultiple,this.range=r.range,this.earliest=r.earliest,this.latest=r.latest,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=r.weeknumbers,this.withcontrols=r.withcontrols,this.currentmonth=null,this.today=null,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get calendarStrings(){let e=this.pktStrings.get(`dates`),t=this.pktStrings.get(`calendar`);return{daysShort:this.dayStrings??e.daysShort,days:this.dayStringsLong??e.days,months:this.monthStrings??e.months,week:this.weekString??e.week,prevMonth:this.prevMonthString??t.prevMonth,nextMonth:this.nextMonthString??t.nextMonth}}get todayDate(){return this.today?n.m(this.today):n.g()}firstUpdated(e){this.addEventListener(`keydown`,this.handleKeydown)}disconnectedCallback(){this.removeEventListener(`keydown`,this.handleKeydown),super.disconnectedCallback()}willUpdate(e){super.willUpdate(e),e.has(`selected`)&&this.convertSelected()}convertSelected(){typeof this.selected==`string`&&(this.selected=this.selected.split(`,`)),this.selected.length===1&&this.selected[0]===``&&(this.selected=[]),this._selected=m(this.selected),this.range&&this.selected.length===2&&(this.inRange=h(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==``){let e=n.m(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?n.f(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=n.f(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=n.f(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){let t=w(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){let r=e.target;if(S(r))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}let i=C(this.focusedDate?n.d(this.focusedDate):n.p(this.year,this.month,1),t,this.querySelector.bind(this));if(i){let e=this.querySelector(`button[data-date="${n.a(i)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(this.focusedDate=n.a(i),e.focus())}}render(){return e._`
2
2
  <div
3
3
  class="pkt-calendar ${this.weeknumbers?`pkt-cal-weeknumbers`:``}"
4
4
  @focusout=${this.closeEvent}
@@ -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-Dk8y6odR.cjs");const i=require("./if-defined-CiML3MTM.cjs");require("./tag-BfFtiV5e.cjs");var a=[`outlined`,`outlined-beige`,`gray`,`blue`,`beige`,`green`],o={headingLevel:3,layout:`vertical`,skin:`outlined`,padding:`default`,tagPosition:`top`,openLinkInNewTab:!1,borderOnHover:!0,zoom:!1,imageShape:`square`,restrictImageHeight:!1},s=class extends r.t{constructor(...e){super(...e),this.ariaLabel=``,this.metaLead=null,this.borderOnHover=o.borderOnHover,this.zoom=o.zoom,this.imageAspect=null,this.restrictImageHeight=o.restrictImageHeight,this.clickCardLink=null,this.metaTrail=null,this.layout=o.layout,this.heading=``,this.headingLevel=o.headingLevel,this.image={src:``,alt:``},this.imageShape=o.imageShape,this.openLinkInNewTab=o.openLinkInNewTab,this.padding=o.padding,this.skin=o.skin,this.subheading=``,this.tagPosition=`top`,this.tags=[]}connectedCallback(){super.connectedCallback()}render(){let n={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover,"pkt-card--zoom":this.zoom},r=this.ariaLabel?.trim()||(this.heading?`${this.heading} lenkekort`:`lenkekort`),a=this.ariaLabel?.trim()||(this.heading?this.heading:`kort`);return e._`
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("./shared-types-BvRk9kiK.cjs"),require("./icon-BsRlhXU2.cjs");const i=require("./if-defined-CiML3MTM.cjs");require("./tag-B2EEjkjD.cjs");var a=[`outlined`,`outlined-beige`,`gray`,`blue`,`beige`,`green`],o={headingLevel:3,layout:`vertical`,skin:`outlined`,padding:`default`,tagPosition:`top`,openLinkInNewTab:!1,borderOnHover:!0,zoom:!1,imageShape:`square`,restrictImageHeight:!1},s=class extends r.t{constructor(...e){super(...e),this.ariaLabel=``,this.metaLead=null,this.borderOnHover=o.borderOnHover,this.zoom=o.zoom,this.imageAspect=null,this.restrictImageHeight=o.restrictImageHeight,this.clickCardLink=null,this.metaTrail=null,this.layout=o.layout,this.heading=``,this.headingLevel=o.headingLevel,this.image={src:``,alt:``},this.imageShape=o.imageShape,this.openLinkInNewTab=o.openLinkInNewTab,this.padding=o.padding,this.skin=o.skin,this.subheading=``,this.tagPosition=`top`,this.tags=[]}connectedCallback(){super.connectedCallback()}render(){let n={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover,"pkt-card--zoom":this.zoom},r=this.ariaLabel?.trim()||(this.heading?`${this.heading} lenkekort`:`lenkekort`),a=this.ariaLabel?.trim()||(this.heading?this.heading:`kort`);return e._`
2
2
  <article
3
3
  class=${t.t(n)}
4
4
  aria-label=${i.t(this.clickCardLink?r:a)}
@@ -2,9 +2,10 @@ import { _ as e, d as t, h as n, n as r, u as i } from "./element-ckeMVgMz.js";
2
2
  import { t as a } from "./class-map-BkEYw5uE.js";
3
3
  import { n as o } from "./format-BTeSVkED.js";
4
4
  import { i as s, t as c } from "./element-with-slot-Dp2Gzv-Q.js";
5
- import "./icon-D3XT49vM.js";
5
+ import "./shared-types-A6iGIX-f.js";
6
+ import "./icon-BVSiUQSL.js";
6
7
  import { t as l } from "./if-defined-D18nY_K_.js";
7
- import "./tag-BswfpmoV.js";
8
+ import "./tag-Bv5JRS69.js";
8
9
  //#region ../../shared-types/card.ts
9
10
  var u = [
10
11
  "outlined",
@@ -1,4 +1,4 @@
1
- const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./consume-kEjgTrAp.cjs"),r=require("./ref-CB7e9nMY.cjs"),i=require("./input-element-BhbkMU20.cjs");var a={defaultChecked:!1,indeterminate:!1,hasTile:!1,disabled:!1,hasError:!1,isSwitch:!1,hideLabel:!1,labelPosition:`right`,requiredTag:!1,optionalTag:!1},o=n.n(Symbol(`pkt-checkbox-group-context`)),s=class extends i.t{constructor(...e){super(...e),this.inputRef=r.t(),this.value=``,this.checkHelptext=null,this.defaultChecked=a.defaultChecked,this.hasTile=a.hasTile,this.isSwitch=a.isSwitch,this.labelPosition=a.labelPosition,this.hideLabel=a.hideLabel,this.checked=null,this.indeterminate=a.indeterminate,this.type=`checkbox`,this.inputSize=void 0,this.tagText=null,this.optionalTag=a.optionalTag,this.requiredTag=a.requiredTag}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e===`checked`&&(this.checked=this.checked===``||this.checked===`true`||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e===`indeterminate`&&(this.indeterminate=this.indeterminate===``||this.indeterminate===`true`||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,t,n)}firstUpdated(e){this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===``||this.indeterminate===`true`||this.indeterminate===!0),super.firstUpdated(e)}willUpdate(e){super.willUpdate(e),e.has(`defaultChecked`)&&!this.checked&&(this.checked=this.defaultChecked)}updated(e){e.has(`checked`)&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===``||this.checked===`true`||this.checked===!0),e.has(`indeterminate`)&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===``||this.indeterminate===`true`||this.indeterminate===!0),super.updated(e)}render(){let n=this.hasTile||!!this.groupContext?.hasTile,i=t.t({"pkt-input-check__input":!0,"pkt-input-check__input--tile":n,"pkt-input-check__input--tile-disabled":this.isDisabled&&n}),a=t.t({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError||!!this.groupContext?.hasError}),o=t.t({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.isDisabled,"pkt-input-check__input-label--left":this.labelPosition===`left`,"pkt-input-check__input-label--right":this.labelPosition===`right`,"pkt-sr-only":this.hideLabel}),s=`pkt-tag pkt-tag--small pkt-tag--thin-text`,c=this.pktStrings.get(`forms`),l=()=>e._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs");require("./shared-types-BvRk9kiK.cjs");const n=require("./consume-kEjgTrAp.cjs"),r=require("./ref-CB7e9nMY.cjs"),i=require("./input-element-a5dcxOzs.cjs");var a={defaultChecked:!1,indeterminate:!1,hasTile:!1,disabled:!1,hasError:!1,isSwitch:!1,hideLabel:!1,labelPosition:`right`,requiredTag:!1,optionalTag:!1},o=n.n(Symbol(`pkt-checkbox-group-context`)),s=class extends i.t{constructor(...e){super(...e),this.inputRef=r.t(),this.value=``,this.checkHelptext=null,this.defaultChecked=a.defaultChecked,this.hasTile=a.hasTile,this.isSwitch=a.isSwitch,this.labelPosition=a.labelPosition,this.hideLabel=a.hideLabel,this.checked=null,this.indeterminate=a.indeterminate,this.type=`checkbox`,this.inputSize=void 0,this.tagText=null,this.optionalTag=a.optionalTag,this.requiredTag=a.requiredTag}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e===`checked`&&(this.checked=this.checked===``||this.checked===`true`||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e===`indeterminate`&&(this.indeterminate=this.indeterminate===``||this.indeterminate===`true`||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,t,n)}firstUpdated(e){this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===``||this.indeterminate===`true`||this.indeterminate===!0),super.firstUpdated(e)}willUpdate(e){super.willUpdate(e),e.has(`defaultChecked`)&&!this.checked&&(this.checked=this.defaultChecked)}updated(e){e.has(`checked`)&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===``||this.checked===`true`||this.checked===!0),e.has(`indeterminate`)&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===``||this.indeterminate===`true`||this.indeterminate===!0),super.updated(e)}render(){let n=this.hasTile||!!this.groupContext?.hasTile,i=t.t({"pkt-input-check__input":!0,"pkt-input-check__input--tile":n,"pkt-input-check__input--tile-disabled":this.isDisabled&&n}),a=t.t({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError||!!this.groupContext?.hasError}),o=t.t({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.isDisabled,"pkt-input-check__input-label--left":this.labelPosition===`left`,"pkt-input-check__input-label--right":this.labelPosition===`right`,"pkt-sr-only":this.hideLabel}),s=`pkt-tag pkt-tag--small pkt-tag--thin-text`,c=this.pktStrings.get(`forms`),l=()=>e._`
2
2
  ${this.tagText?e._`<span class=${s+` pkt-tag--gray`}>${this.tagText}</span>`:e.h}
3
3
  ${this.optionalTag?e._`<span class=${s+` pkt-tag--blue-light`}
4
4
  >${this.optionalText??c.optional}</span
@@ -1,8 +1,9 @@
1
1
  import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-ckeMVgMz.js";
2
2
  import { t as o } from "./class-map-BkEYw5uE.js";
3
+ import "./shared-types-A6iGIX-f.js";
3
4
  import { n as s, t as c } from "./consume-Bp12si68.js";
4
5
  import { n as l, t as u } from "./ref-D4OwQYdf.js";
5
- import { t as d } from "./input-element-JH4qPly5.js";
6
+ import { t as d } from "./input-element-8mrCxToc.js";
6
7
  //#region ../../shared-types/checkbox.ts
7
8
  var f = {
8
9
  defaultChecked: !1,
@@ -1,6 +1,6 @@
1
1
  import { d as e, l as t, n, u as r } from "./element-ckeMVgMz.js";
2
- import { r as i } from "./checkbox-A5B82H0n.js";
3
- import { i as a, n as o, r as s, t as c } from "./option-group-element-16F2MJlO.js";
2
+ import { r as i } from "./checkbox-BTD7bz3U.js";
3
+ import { i as a, n as o, r as s, t as c } from "./option-group-element-CQViBzca.js";
4
4
  import { t as l } from "./provide-_MnlMGnw.js";
5
5
  //#region src/components/checkbox-group/checkbox-group.ts
6
6
  var u = class extends c {
@@ -1 +1 @@
1
- const e=require("./element-C6WTyJFE.cjs"),t=require("./checkbox-Cj3S0xJE.cjs"),n=require("./option-group-element-DHpno4pS.cjs"),r=require("./provide-Cz18sYug.cjs");var i=class extends n.t{constructor(...e){super(...e),this.optionSelector=`pkt-checkbox`,this.groupContext={name:``,hasTile:!1,hasError:!1},this.storedValue=null,this.validityApplied=!1}get value(){return this.options().filter(e=>n.n(e)&&!n.r(e)).map(n.i)}set value(e){let t=this.value;this.storedValue=Array.isArray(e)?e:e?e.split(`,`):[],this.applyStoredValue(this.options()),this.requestUpdate(`value`,t)}get hasStoredValue(){return this.storedValue!==null}storeCurrentValue(){this.storedValue=this.value}applyStoredValue(e){e.forEach(e=>{let t=!!this.storedValue?.includes(n.i(e));n.n(e)!==t&&(e.checked=t)})}syncValidity(){if(!this.required&&!this.validityApplied)return;this.validityApplied=this.required;let e=this.options(),t=this.required&&!e.some(e=>n.n(e)&&!n.r(e))?this.pktStrings.get(`validation`).checkboxGroupValueMissing:``;e.forEach(e=>e.setGroupValidity?.(t))}};e.n([r.t({context:t.r}),e.l()],i.prototype,`groupContext`,void 0),e.n([e.u({type:String})],i.prototype,`value`,null);try{e.d(`pkt-checkbox-group`)(i)}catch{console.warn(`Forsøker å definere <pkt-checkbox-group>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./checkbox-B6BVu9BZ.cjs"),n=require("./option-group-element-BEGRouXw.cjs"),r=require("./provide-Cz18sYug.cjs");var i=class extends n.t{constructor(...e){super(...e),this.optionSelector=`pkt-checkbox`,this.groupContext={name:``,hasTile:!1,hasError:!1},this.storedValue=null,this.validityApplied=!1}get value(){return this.options().filter(e=>n.n(e)&&!n.r(e)).map(n.i)}set value(e){let t=this.value;this.storedValue=Array.isArray(e)?e:e?e.split(`,`):[],this.applyStoredValue(this.options()),this.requestUpdate(`value`,t)}get hasStoredValue(){return this.storedValue!==null}storeCurrentValue(){this.storedValue=this.value}applyStoredValue(e){e.forEach(e=>{let t=!!this.storedValue?.includes(n.i(e));n.n(e)!==t&&(e.checked=t)})}syncValidity(){if(!this.required&&!this.validityApplied)return;this.validityApplied=this.required;let e=this.options(),t=this.required&&!e.some(e=>n.n(e)&&!n.r(e))?this.pktStrings.get(`validation`).checkboxGroupValueMissing:``;e.forEach(e=>e.setGroupValidity?.(t))}};e.n([r.t({context:t.r}),e.l()],i.prototype,`groupContext`,void 0),e.n([e.u({type:String})],i.prototype,`value`,null);try{e.d(`pkt-checkbox-group`)(i)}catch{console.warn(`Forsøker å definere <pkt-checkbox-group>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
@@ -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-Dk8y6odR.cjs");const i=require("./input-wrapper-Bekd6DGA.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./ref-CB7e9nMY.cjs");require("./tag-BfFtiV5e.cjs");const s=require("./repeat-CnnigVcj.cjs"),c=require("./listbox-BbdUu-IV.cjs"),l=require("./input-element-BhbkMU20.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-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-BsRlhXU2.cjs");const i=require("./input-wrapper-DT9h0n2i.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./ref-CB7e9nMY.cjs");require("./tag-B2EEjkjD.cjs");const s=require("./repeat-CnnigVcj.cjs"),c=require("./listbox-BbdUu-IV.cjs"),l=require("./input-element-a5dcxOzs.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._`
2
2
  <pkt-input-wrapper
3
3
  ${r.n(this,[`helptext`])}
4
4
  .strings=${this.strings}
@@ -2,14 +2,14 @@ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-ckeMVg
2
2
  import { t as o } from "./class-map-BkEYw5uE.js";
3
3
  import { t as s } from "./format-BTeSVkED.js";
4
4
  import { n as c } from "./element-with-slot-Dp2Gzv-Q.js";
5
- import "./icon-D3XT49vM.js";
6
- import { r as l } from "./input-wrapper-BttEKK9G.js";
5
+ import "./icon-BVSiUQSL.js";
6
+ import { r as l } from "./input-wrapper-7RSISZu6.js";
7
7
  import { t as u } from "./if-defined-D18nY_K_.js";
8
8
  import { n as d, t as f } from "./ref-D4OwQYdf.js";
9
- import "./tag-BswfpmoV.js";
9
+ import "./tag-Bv5JRS69.js";
10
10
  import { t as p } from "./repeat-BGbBqnfz.js";
11
11
  import { a as m, c as h, i as g, l as _, o as v, r as y, s as b } from "./listbox-DFd-1faX.js";
12
- import { t as x } from "./input-element-JH4qPly5.js";
12
+ import { t as x } from "./input-element-8mrCxToc.js";
13
13
  import { t as S } from "./pkt-options-controller-CH8U6zlw.js";
14
14
  //#region ../../shared-types/combobox.ts
15
15
  var C = {
@@ -1,5 +1,5 @@
1
1
  import { PktElementWithSlot } from '../../base-elements/element-with-slot';
2
- import { TPktSize } from '../../types/size';
2
+ import { TPktSizeBase } from '../../shared-types';
3
3
  export type TPktLoaderVariant = 'blue' | 'rainbow' | 'shapes';
4
4
  export interface IPktLoader {
5
5
  /**
@@ -24,7 +24,7 @@ export interface IPktLoader {
24
24
  /**
25
25
  * The size of the loader. Default is "medium".
26
26
  */
27
- size?: TPktSize;
27
+ size?: TPktSizeBase;
28
28
  /**
29
29
  * The variant of the loader. Default is "rainbow".
30
30
  * "shapes" is the OSLO wave loader, "blue" a blue spinner.
@@ -40,7 +40,7 @@ export declare class PktLoader extends PktElementWithSlot implements IPktLoader
40
40
  inline: boolean;
41
41
  isLoading: boolean;
42
42
  message: string | null;
43
- size: TPktSize;
43
+ size: TPktSizeBase;
44
44
  variant: TPktLoaderVariant;
45
45
  loadingAnimationPath: string | undefined;
46
46
  private _shouldDisplayLoader;
@@ -1,8 +1,8 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { PktElementWithSlot } from '../../base-elements/element-with-slot';
3
3
  import { Ref } from 'lit/directives/ref.js';
4
- import { TPktSize } from '../../types/size';
5
- type ModalSize = TPktSize | 'fit-content';
4
+ import { TPktSizeBase } from '../../shared-types';
5
+ type ModalSize = TPktSizeBase | 'fit-content';
6
6
  export interface IPktModal {
7
7
  open?: boolean;
8
8
  headingText?: string;
@@ -1,14 +1,13 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { PktElementWithSlot } from '../../base-elements/element-with-slot';
3
- import { TPktSize } from '../../types/size';
4
- import { IAriaAttributes, THTMLButtonType } from '../../shared-types';
3
+ import { IAriaAttributes, THTMLButtonType, TPktSizeBase } from '../../shared-types';
5
4
  import { PktIconName } from '@oslokommune/punkt-assets/dist/icons/icon';
6
5
  import { IPktStringsProps } from '../../shared-strings';
7
6
  export type TTagSkin = 'blue' | 'blue-dark' | 'blue-light' | 'green' | 'red' | 'yellow' | 'beige' | 'gray' | 'grey';
8
7
  export type TTagType = THTMLButtonType;
9
8
  export interface IPktTag extends IPktStringsProps<'tag'> {
10
9
  closeTag?: boolean;
11
- size?: TPktSize;
10
+ size?: TPktSizeBase;
12
11
  skin?: TTagSkin;
13
12
  textStyle?: string | null;
14
13
  iconName?: PktIconName;
@@ -21,7 +20,7 @@ export declare class PktTag extends PktElementWithSlot<IPktTag> implements IPktT
21
20
  * Element attributes
22
21
  */
23
22
  closeTag: boolean;
24
- size: TPktSize;
23
+ size: TPktSizeBase;
25
24
  skin: TTagSkin;
26
25
  textStyle: string | null;
27
26
  iconName: string | undefined;
@@ -1,5 +1,6 @@
1
1
  import { _ as e, d as t, n, t as r, u as i } from "./element-ckeMVgMz.js";
2
- import "./button-U4r2XSv4.js";
2
+ import "./shared-types-A6iGIX-f.js";
3
+ import "./button-DwcFG7bU.js";
3
4
  //#region ../../shared-strings/consent.ts
4
5
  var a = {
5
6
  i18n: {
@@ -0,0 +1,18 @@
1
+ const e=require("./element-C6WTyJFE.cjs");require("./shared-types-BvRk9kiK.cjs"),require("./button-DdR_XzMY.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
+ >${this.triggerText}</a
3
+ >`:this.triggerType===`footerlink`?e._`<a
4
+ href="#"
5
+ class="pkt-footer__link"
6
+ aria-haspopup="dialog"
7
+ @click=${this.openModal}
8
+ >${this.triggerText}</a
9
+ >`:this.triggerType===`icon`?e._`<pkt-button
10
+ skin="tertiary"
11
+ variant="icon-only"
12
+ iconName="cookie"
13
+ aria-haspopup="dialog"
14
+ @click=${this.openModal}
15
+ >${this.triggerText}</pkt-button
16
+ >`:e._`<pkt-button aria-haspopup="dialog" @click=${this.openModal}
17
+ >${this.triggerText}</pkt-button
18
+ >`}};e.n([e.u({type:Boolean})],s.prototype,`devMode`,void 0),e.n([e.u({type:String})],s.prototype,`hotjarId`,void 0),e.n([e.u({type:String})],s.prototype,`googleAnalyticsId`,void 0),e.n([e.u({type:String})],s.prototype,`cookieDomain`,void 0),e.n([e.u({type:String})],s.prototype,`cookieSecure`,void 0),e.n([e.u({type:String})],s.prototype,`cookieExpiryDays`,void 0),e.n([e.u({type:String})],s.prototype,`triggerType`,void 0),e.n([e.u({type:String})],s.prototype,`triggerText`,void 0),e.n([e.u({type:String})],s.prototype,`i18nLanguage`,void 0);try{e.d(`pkt-consent`)(s)}catch{console.warn(`Forsøker å definere <pkt-consent>, men den er allerede definert`)}var c=s;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
@@ -1,16 +1,16 @@
1
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-ckeMVgMz.js";
2
2
  import { t as c } from "./class-map-BkEYw5uE.js";
3
3
  import { n as l } from "./element-with-slot-Dp2Gzv-Q.js";
4
- import "./icon-D3XT49vM.js";
5
- import "./input-wrapper-BttEKK9G.js";
6
- import "./calendar-C8maj_iv.js";
4
+ import "./icon-BVSiUQSL.js";
5
+ import "./input-wrapper-7RSISZu6.js";
6
+ import "./calendar-DGOwyX3o.js";
7
7
  import { t as u } from "./if-defined-D18nY_K_.js";
8
8
  import { n as d, t as f } from "./ref-D4OwQYdf.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-BswfpmoV.js";
10
+ import "./tag-Bv5JRS69.js";
11
11
  import { t as te } from "./repeat-BGbBqnfz.js";
12
12
  import { n as C, t as w } from "./utils-BwF4QSrq.js";
13
- import { t as T } from "./input-element-JH4qPly5.js";
13
+ import { t as T } from "./input-element-8mrCxToc.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
- const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-Dk8y6odR.cjs"),require("./input-wrapper-Bekd6DGA.cjs"),require("./calendar-4S_k7_KN.cjs");const r=require("./if-defined-CiML3MTM.cjs"),i=require("./ref-CB7e9nMY.cjs"),a=require("./converters-CW6SN0TT.cjs");require("./tag-BfFtiV5e.cjs");const o=require("./repeat-CnnigVcj.cjs"),s=require("./utils-63cRpWut.cjs"),c=require("./input-element-BhbkMU20.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._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-B0Vp_OuR.cjs");require("./icon-BsRlhXU2.cjs"),require("./input-wrapper-DT9h0n2i.cjs"),require("./calendar-DcenMWOQ.cjs");const r=require("./if-defined-CiML3MTM.cjs"),i=require("./ref-CB7e9nMY.cjs"),a=require("./converters-CW6SN0TT.cjs");require("./tag-B2EEjkjD.cjs");const o=require("./repeat-CnnigVcj.cjs"),s=require("./utils-63cRpWut.cjs"),c=require("./input-element-a5dcxOzs.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,15 +1,15 @@
1
1
  import { _ as e, d as t, l as n, n as r, s as i, t as a, u as o } from "./element-ckeMVgMz.js";
2
2
  import { t as s } from "./class-map-BkEYw5uE.js";
3
3
  import { n as c, t as l } from "./format-BTeSVkED.js";
4
- import "./alert-B3ify6mt.js";
5
- import "./icon-D3XT49vM.js";
6
- import "./input-wrapper-BttEKK9G.js";
4
+ import "./alert-CdfTJcT2.js";
5
+ import "./icon-BVSiUQSL.js";
6
+ import "./input-wrapper-7RSISZu6.js";
7
7
  import { t as u } from "./if-defined-D18nY_K_.js";
8
8
  import { t as d } from "./converters-CYgQrWVm.js";
9
9
  import { n as f } from "./utils-BwF4QSrq.js";
10
10
  import { r as p } from "./focus-trap-DG3pEuyJ.js";
11
- import "./modal-Cv0uz8iY.js";
12
- import "./progressbar-CMwFXEMB.js";
11
+ import "./modal-EjPYLhS-.js";
12
+ import "./progressbar-BJswle17.js";
13
13
  //#region ../../shared-utils/fileupload/size.ts
14
14
  function m(e) {
15
15
  if (e == null || e === "") return;