@oslokommune/punkt-elements 16.17.3 → 16.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/{accordion-CU2tJ5vn.js → accordion-BjYsEbSM.js} +19 -19
  3. package/dist/{accordion-DDZkjXFb.cjs → accordion-DaeWPWod.cjs} +5 -5
  4. package/dist/{alert-ePJuDtmm.js → alert-BkzC5mVu.js} +22 -22
  5. package/dist/{alert-BEEnTiCb.cjs → alert-D_45dWPn.cjs} +6 -6
  6. package/dist/{async-directive-CaQiqjyV.js → async-directive-Cz6tcqge.js} +2 -2
  7. package/dist/async-directive-DO1QtVmf.cjs +1 -0
  8. package/dist/{backlink-CiwXrQYD.js → backlink-BXAdgAte.js} +6 -6
  9. package/dist/{backlink-Ba03LlbB.cjs → backlink-C42-3OG3.cjs} +2 -2
  10. package/dist/{breadcrumbs-CD1zib3s.cjs → breadcrumbs-CkjeLh3U.cjs} +6 -6
  11. package/dist/{breadcrumbs-CpuVqWhF.js → breadcrumbs-Dkb9TxMp.js} +15 -15
  12. package/dist/{button-BIpd1xJh.js → button-CR-KWhTT.js} +21 -21
  13. package/dist/{button-D-TOBaJB.cjs → button-Dwv11n6R.cjs} +7 -7
  14. package/dist/{calendar-DkjXla0I.cjs → calendar-Buvxe4l_.cjs} +11 -11
  15. package/dist/{calendar-Ch1dgnBo.js → calendar-DAq6iJdx.js} +50 -50
  16. package/dist/{card-CEDbo1t7.js → card-5PydU247.js} +43 -43
  17. package/dist/{card-C3POnP3O.cjs → card-C__IlsUa.cjs} +26 -26
  18. package/dist/{checkbox-CF5mSBR5.js → checkbox-CC1X7fw4.js} +23 -23
  19. package/dist/{checkbox-BerAYcfK.cjs → checkbox-DzMc0AJX.cjs} +10 -10
  20. package/dist/class-map-B8Ja0q7n.cjs +1 -0
  21. package/dist/{class-map-C8HuhNzZ.js → class-map-DH9hlJny.js} +7 -8
  22. package/dist/{combobox-DjvRMKOD.js → combobox-D-DY7YcW.js} +42 -42
  23. package/dist/{combobox-DYttdLJ4.cjs → combobox-x4tBGP3F.cjs} +17 -17
  24. package/dist/components/heading/heading.d.ts +5 -8
  25. package/dist/components/icon/icon.d.ts +6 -1
  26. package/dist/components/icon/icon.test.d.ts +2 -0
  27. package/dist/{consent-B5dIDyLD.cjs → consent-BB3g_ByO.cjs} +3 -3
  28. package/dist/{consent-DSHrt9eS.js → consent-Y14WZ0JS.js} +8 -8
  29. package/dist/{datepicker-D3QQbd_H.cjs → datepicker-BFI-3stE.cjs} +20 -20
  30. package/dist/{datepicker-M_jcY3wp.js → datepicker-CRk7aiwH.js} +57 -57
  31. package/dist/{directive-helpers-Dkv2gKgs.js → directive-helpers-Cep_4cpj.js} +1 -1
  32. package/dist/{directive-helpers-D1QSxY17.cjs → directive-helpers-f36YZFOG.cjs} +1 -1
  33. package/dist/element-CXAtr6Gu.cjs +2 -0
  34. package/dist/{element-cZ85T_aa.js → element-CduG0XyF.js} +47 -23
  35. package/dist/{element-with-slot-4J2o3SeU.js → element-with-slot-BVj9MXzi.js} +5 -6
  36. package/dist/element-with-slot-Cmxb9h4H.cjs +1 -0
  37. package/dist/{fileupload-IXSGrqiH.js → fileupload-C8muj8qd.js} +149 -149
  38. package/dist/{fileupload-qc0fHcR-.cjs → fileupload-YtsrgQTY.cjs} +40 -40
  39. package/dist/{header-C1hDYMRX.cjs → header-CjBip0zj.cjs} +57 -57
  40. package/dist/{header-BGknkrEt.js → header-DONTGbD9.js} +130 -130
  41. package/dist/{header-menu-zhGYdnvz.js → header-menu-BU-ylGrJ.js} +45 -45
  42. package/dist/{header-menu-CPI1_5oZ.cjs → header-menu-CnW7nzmF.cjs} +24 -24
  43. package/dist/heading-3o4Dk0Wn.js +80 -0
  44. package/dist/heading-C40-NX0r.cjs +1 -0
  45. package/dist/{helptext-BdqoW19r.js → helptext-C2aQBBo_.js} +12 -12
  46. package/dist/{helptext-KWXjKljV.cjs → helptext-DNLg43eI.cjs} +4 -4
  47. package/dist/icon-Dw6I0HDV.cjs +1 -0
  48. package/dist/{icon-Co72KtgF.js → icon-LaKyBKON.js} +39 -19
  49. package/dist/if-defined-LTjAScFG.cjs +1 -0
  50. package/dist/{if-defined-Cjj8qN-Z.js → if-defined-VShASPdu.js} +1 -1
  51. package/dist/{input-element-D0egtEnr.cjs → input-element-BHQVt4Q9.cjs} +1 -1
  52. package/dist/{input-element-B1ciW1N2.js → input-element-BrmkXIXi.js} +30 -30
  53. package/dist/{input-wrapper-DVU68NcJ.js → input-wrapper-B6WowlWG.js} +33 -33
  54. package/dist/{input-wrapper-DOIWggEv.cjs → input-wrapper-Dhkt20WW.cjs} +17 -17
  55. package/dist/{link-DMKjKawh.cjs → link-B5ur0Rym.cjs} +4 -4
  56. package/dist/{link-F51Ho7CV.js → link-ClUNY__5.js} +13 -13
  57. package/dist/linkcard-BIcCW-qw.cjs +13 -0
  58. package/dist/{linkcard-E07qJZMP.js → linkcard-DNJm5FvA.js} +15 -15
  59. package/dist/{listbox-0NHJvNjz.js → listbox-DXMIBv3y.js} +35 -35
  60. package/dist/{listbox-CcThiNBY.cjs → listbox-DbEobJNx.cjs} +14 -14
  61. package/dist/{loader-q_eO6zaE.cjs → loader-Uap9qDsV.cjs} +5 -5
  62. package/dist/{loader-teN65oWo.js → loader-gKdQpOOQ.js} +12 -12
  63. package/dist/{messagebox-D1QeQqb8.cjs → messagebox-BqBxXK8c.cjs} +5 -5
  64. package/dist/{messagebox-Ct9lfe0Z.js → messagebox-XRFecqyS.js} +15 -15
  65. package/dist/{modal-Ca-6xVkg.js → modal-CWgeT-RP.js} +19 -19
  66. package/dist/{modal-B7-0F5q7.cjs → modal-CrYHKOmr.cjs} +8 -8
  67. package/dist/pkt-accordion.cjs +1 -1
  68. package/dist/pkt-accordion.js +1 -1
  69. package/dist/pkt-alert.cjs +1 -1
  70. package/dist/pkt-alert.js +1 -1
  71. package/dist/pkt-backlink.cjs +1 -1
  72. package/dist/pkt-backlink.js +1 -1
  73. package/dist/pkt-breadcrumbs.cjs +1 -1
  74. package/dist/pkt-breadcrumbs.js +1 -1
  75. package/dist/pkt-button.cjs +1 -1
  76. package/dist/pkt-button.js +1 -1
  77. package/dist/pkt-calendar.cjs +1 -1
  78. package/dist/pkt-calendar.js +1 -1
  79. package/dist/pkt-card.cjs +1 -1
  80. package/dist/pkt-card.js +1 -1
  81. package/dist/pkt-checkbox.cjs +1 -1
  82. package/dist/pkt-checkbox.js +1 -1
  83. package/dist/pkt-combobox.cjs +1 -1
  84. package/dist/pkt-combobox.js +1 -1
  85. package/dist/pkt-consent.cjs +1 -1
  86. package/dist/pkt-consent.js +1 -1
  87. package/dist/pkt-datepicker.cjs +1 -1
  88. package/dist/pkt-datepicker.js +1 -1
  89. package/dist/pkt-fileupload.cjs +1 -1
  90. package/dist/pkt-fileupload.js +1 -1
  91. package/dist/pkt-header-menu.cjs +1 -1
  92. package/dist/pkt-header-menu.js +1 -1
  93. package/dist/pkt-header.cjs +1 -1
  94. package/dist/pkt-header.js +1 -1
  95. package/dist/pkt-heading.cjs +1 -1
  96. package/dist/pkt-heading.js +1 -1
  97. package/dist/pkt-helptext.cjs +1 -1
  98. package/dist/pkt-helptext.js +1 -1
  99. package/dist/pkt-icon.cjs +1 -1
  100. package/dist/pkt-icon.js +1 -1
  101. package/dist/pkt-index.cjs +1 -1
  102. package/dist/pkt-index.js +32 -32
  103. package/dist/pkt-input-wrapper.cjs +1 -1
  104. package/dist/pkt-input-wrapper.js +1 -1
  105. package/dist/pkt-link.cjs +1 -1
  106. package/dist/pkt-link.js +1 -1
  107. package/dist/pkt-linkcard.cjs +1 -1
  108. package/dist/pkt-linkcard.js +1 -1
  109. package/dist/pkt-listbox.cjs +1 -1
  110. package/dist/pkt-listbox.js +1 -1
  111. package/dist/pkt-loader.cjs +1 -1
  112. package/dist/pkt-loader.js +1 -1
  113. package/dist/pkt-messagebox.cjs +1 -1
  114. package/dist/pkt-messagebox.js +1 -1
  115. package/dist/pkt-modal.cjs +1 -1
  116. package/dist/pkt-modal.js +1 -1
  117. package/dist/{pkt-options-controller-CCB15L_G.js → pkt-options-controller-BTNtjEIS.js} +1 -1
  118. package/dist/{pkt-options-controller-CeAQ-D-i.cjs → pkt-options-controller-CBM8xHwR.cjs} +1 -1
  119. package/dist/pkt-progressbar.cjs +1 -1
  120. package/dist/pkt-progressbar.js +1 -1
  121. package/dist/pkt-radiobutton.cjs +1 -1
  122. package/dist/pkt-radiobutton.js +1 -1
  123. package/dist/pkt-searchinput.cjs +1 -1
  124. package/dist/pkt-searchinput.js +1 -1
  125. package/dist/pkt-select.cjs +1 -1
  126. package/dist/pkt-select.js +1 -1
  127. package/dist/pkt-tabs.cjs +1 -1
  128. package/dist/pkt-tabs.js +1 -1
  129. package/dist/pkt-tag.cjs +1 -1
  130. package/dist/pkt-tag.js +1 -1
  131. package/dist/pkt-textarea.cjs +1 -1
  132. package/dist/pkt-textarea.js +1 -1
  133. package/dist/pkt-textinput.cjs +1 -1
  134. package/dist/pkt-textinput.js +1 -1
  135. package/dist/pkt-timepicker.cjs +1 -1
  136. package/dist/pkt-timepicker.js +1 -1
  137. package/dist/{progressbar-o-M17HPA.js → progressbar-B0P_vmGD.js} +23 -24
  138. package/dist/progressbar-DADdvDl5.cjs +17 -0
  139. package/dist/{radiobutton-B1Xg6XzP.cjs → radiobutton-BfURufrZ.cjs} +8 -8
  140. package/dist/{radiobutton-BAn1V_mQ.js → radiobutton-C6zERHoy.js} +20 -20
  141. package/dist/{ref-RS8Uv6uC.js → ref-BgoHEsEt.js} +7 -8
  142. package/dist/ref-CBdWMlde.cjs +1 -0
  143. package/dist/{repeat-DV1O43YU.js → repeat-CKIii8Mi.js} +15 -16
  144. package/dist/repeat-CRRgmzVn.cjs +1 -0
  145. package/dist/{searchinput-BVIaoetB.cjs → searchinput-BrxfRzez.cjs} +13 -13
  146. package/dist/{searchinput-CIseS5tL.js → searchinput-fPvXHu2O.js} +31 -31
  147. package/dist/{select-6XCVj1lP.js → select-BIgFPp42.js} +13 -13
  148. package/dist/{select-DO0xGhQQ.cjs → select-DzZHv6Bz.cjs} +3 -3
  149. package/dist/shared-types/index.d.ts +1 -1
  150. package/dist/shared-types/skin.d.ts +4 -0
  151. package/dist/{tabs-ClI1XQDt.js → tabs-BJx6wwXD.js} +29 -29
  152. package/dist/{tabs-CN_RIMWg.cjs → tabs-DxQy8U-0.cjs} +7 -7
  153. package/dist/{tag-DWtajZk6.cjs → tag-CBFz0R9N.cjs} +5 -5
  154. package/dist/{tag-hl59gziI.js → tag-CzlnHhho.js} +19 -19
  155. package/dist/textarea-M_S9WK7s.cjs +46 -0
  156. package/dist/{textarea-DBSNSvrX.js → textarea-qHtkhelz.js} +24 -25
  157. package/dist/{textinput-BZZnFDk3.js → textinput-CZrBM-Fj.js} +26 -26
  158. package/dist/{textinput-Dsc-8-BB.cjs → textinput-C_6kvf87.cjs} +12 -12
  159. package/dist/{timepicker-DDQ7CfOy.js → timepicker-O0iCeJyW.js} +51 -51
  160. package/dist/{timepicker-C2Ua6vHY.cjs → timepicker-WiYLAncb.cjs} +20 -20
  161. package/package.json +2 -2
  162. package/src/components/card/card.ts +1 -1
  163. package/src/components/heading/heading.test.ts +79 -70
  164. package/src/components/heading/heading.ts +40 -78
  165. package/src/components/icon/icon.test.ts +101 -0
  166. package/src/components/icon/icon.ts +40 -1
  167. package/dist/async-directive-B9P1Qa0k.cjs +0 -1
  168. package/dist/class-map-CJ-msbHs.cjs +0 -1
  169. package/dist/directive-3THFsVew.js +0 -28
  170. package/dist/directive-CJ2giQBZ.cjs +0 -1
  171. package/dist/element-DjtxO-1r.cjs +0 -2
  172. package/dist/element-with-slot-CWoTGA1B.cjs +0 -1
  173. package/dist/heading-BxvE80bb.js +0 -73
  174. package/dist/heading-DRJTS27k.cjs +0 -1
  175. package/dist/icon-Dr8sfT2X.cjs +0 -1
  176. package/dist/if-defined-XKOD_t_V.cjs +0 -1
  177. package/dist/linkcard-CBmJbSoV.cjs +0 -13
  178. package/dist/progressbar-Ca7pRjmt.cjs +0 -17
  179. package/dist/ref-BaJ0mBT_.cjs +0 -1
  180. package/dist/repeat-DaDFvx86.cjs +0 -1
  181. package/dist/textarea-CV6z3LDf.cjs +0 -46
  182. /package/dist/{booleanish-CRaKZ75t.js → booleanish-BmcOU-43.js} +0 -0
  183. /package/dist/{booleanish-B5EFqFpJ.cjs → booleanish-jJLlnr6-.cjs} +0 -0
  184. /package/dist/{classutils-z8YsPlOf.cjs → classutils-CVTzKF0J.cjs} +0 -0
  185. /package/dist/{classutils-DEL164Ur.js → classutils-lVbGcvjN.js} +0 -0
  186. /package/dist/{converters-Bffq_YDm.cjs → converters-C_66kHUN.cjs} +0 -0
  187. /package/dist/{converters-jauYkvNh.js → converters-DSQXaDQ_.js} +0 -0
  188. /package/dist/{dialog-polyfill.esm-B7W3teD0.js → dialog-polyfill.esm-0dVT8G1o.js} +0 -0
  189. /package/dist/{dialog-polyfill.esm-BnAQvMQO.cjs → dialog-polyfill.esm-CYs2AHP1.cjs} +0 -0
  190. /package/dist/{focus-modality-controller-pzSZkDkH.js → focus-modality-controller-CaUqYdk0.js} +0 -0
  191. /package/dist/{focus-modality-controller-BSZAQk8y.cjs → focus-modality-controller-wI5SR8wH.cjs} +0 -0
  192. /package/dist/{input-wrapper-CQGoyLdZ.cjs → input-wrapper-CYCCx8MP.cjs} +0 -0
  193. /package/dist/{input-wrapper-DwSsP39J.js → input-wrapper-kw2y6Jp_.js} +0 -0
  194. /package/dist/{utils-BOOZ0ppt.js → utils-CUqCKGvp.js} +0 -0
  195. /package/dist/{utils-CM67Oudc.cjs → utils-CjAbIttF.cjs} +0 -0
@@ -73,7 +73,7 @@ const downloadIconOrGetFromCache = async (
73
73
  return errorSvg
74
74
  }
75
75
 
76
- type Props = ElementProps<PktIcon, 'path' | 'name'>
76
+ type Props = ElementProps<PktIcon, 'path' | 'name' | 'ariaHidden' | 'ariaLabel'>
77
77
 
78
78
  export class PktIcon extends PktElement<Props> {
79
79
  @property({ type: String, reflect: false })
@@ -82,12 +82,38 @@ export class PktIcon extends PktElement<Props> {
82
82
  @property({ type: String, reflect: true })
83
83
  name: PktIconName = ''
84
84
 
85
+ @property({
86
+ type: String,
87
+ attribute: 'aria-hidden',
88
+ reflect: true,
89
+ })
90
+ override ariaHidden: string | null = null
91
+
92
+ @property({
93
+ type: String,
94
+ attribute: 'aria-label',
95
+ reflect: true,
96
+ })
97
+ override ariaLabel: string | null = null
98
+
85
99
  @property({ type: SVGElement })
86
100
  private icon: ReturnType<typeof unsafeSVG> = unsafeSVG(errorSvg)
87
101
 
88
102
  @property({ type: Array, noAccessor: true })
89
103
  private _updatedProps: string[] = []
90
104
 
105
+ private get effectiveAriaHidden(): boolean {
106
+ if (this.ariaHidden !== null && this.ariaHidden !== undefined) {
107
+ return this.ariaHidden === '' || this.ariaHidden === 'true'
108
+ }
109
+ return !this.ariaLabel
110
+ }
111
+
112
+ private get effectiveAriaLabel(): string | null {
113
+ if (this.effectiveAriaHidden) return null
114
+ return this.ariaLabel || this.name || null
115
+ }
116
+
91
117
  connectedCallback(): void {
92
118
  super.connectedCallback()
93
119
  this.classList.add('pkt-icon')
@@ -102,6 +128,19 @@ export class PktIcon extends PktElement<Props> {
102
128
  if (_changedProperties.has('name') || _changedProperties.has('path')) {
103
129
  this.getIcon(this.name)
104
130
  }
131
+ this.applyAriaToSvg()
132
+ }
133
+
134
+ private applyAriaToSvg() {
135
+ const svg = this.querySelector('svg')
136
+ if (!svg) return
137
+ svg.setAttribute('aria-hidden', String(this.effectiveAriaHidden))
138
+ const label = this.effectiveAriaLabel
139
+ if (label) {
140
+ svg.setAttribute('aria-label', label)
141
+ } else {
142
+ svg.removeAttribute('aria-label')
143
+ }
105
144
  }
106
145
 
107
146
  protected async getIcon(name: PktIconName = '') {
@@ -1 +0,0 @@
1
- const e=require(`./directive-CJ2giQBZ.cjs`),t=require(`./directive-helpers-D1QSxY17.cjs`);var n=(e,t)=>{let r=e._$AN;if(r===void 0)return!1;for(let e of r)e._$AO?.(t,!1),n(e,t);return!0},r=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},i=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),s(t)}};function a(e){this._$AN===void 0?this._$AM=e:(r(this),this._$AM=e,i(this))}function o(e,t=!1,i=0){let a=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(a))for(let e=i;e<a.length;e++)n(a[e],!1),r(a[e]);else a!=null&&(n(a,!1),r(a));else n(this,e)}var s=t=>{t.type==e.r.CHILD&&(t._$AP??=o,t._$AQ??=a)},c=class extends e.n{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),i(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(n(this,e),r(this))}setValue(e){if(t.i(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
@@ -1 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./directive-CJ2giQBZ.cjs`);var n=t.t(class extends t.n{constructor(e){if(super(e),e.type!==t.r.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(t,[n]){if(this.st===void 0){this.st=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in n)n[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(n)}let r=t.element.classList;for(let e of this.st)e in n||(r.remove(e),this.st.delete(e));for(let e in n){let t=!!n[e];t===this.st.has(e)||this.nt?.has(e)||(t?(r.add(e),this.st.add(e)):(r.remove(e),this.st.delete(e)))}return e.u}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
@@ -1,28 +0,0 @@
1
- //#region ../../node_modules/lit-html/directive.js
2
- var e = {
3
- ATTRIBUTE: 1,
4
- CHILD: 2,
5
- PROPERTY: 3,
6
- BOOLEAN_ATTRIBUTE: 4,
7
- EVENT: 5,
8
- ELEMENT: 6
9
- }, t = (e) => (...t) => ({
10
- _$litDirective$: e,
11
- values: t
12
- }), n = class {
13
- constructor(e) {}
14
- get _$AU() {
15
- return this._$AM._$AU;
16
- }
17
- _$AT(e, t, n) {
18
- this._$Ct = e, this._$AM = t, this._$Ci = n;
19
- }
20
- _$AS(e, t) {
21
- return this.update(e, t);
22
- }
23
- update(e, t) {
24
- return this.render(...t);
25
- }
26
- };
27
- //#endregion
28
- export { n, e as r, t };
@@ -1 +0,0 @@
1
- var e={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},t=e=>(...t)=>({_$litDirective$:e,values:t}),n=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
@@ -1,2 +0,0 @@
1
- var e=globalThis,t=e=>e,n=e.trustedTypes,r=n?n.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,i=`$lit$`,a=`lit$${Math.random().toFixed(9).slice(2)}$`,o=`?`+a,s=`<${o}>`,c=document,l=()=>c.createComment(``),u=e=>e===null||typeof e!=`object`&&typeof e!=`function`,d=Array.isArray,f=e=>d(e)||typeof e?.[Symbol.iterator]==`function`,p=`[
2
- \f\r]`,m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,h=/-->/g,g=/>/g,_=RegExp(`>|${p}(?:([^\\s"'>=/]+)(${p}*=${p}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),v=/'/g,y=/"/g,b=/^(?:script|style|textarea|title)$/i,x=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),S=Symbol.for(`lit-noChange`),C=Symbol.for(`lit-nothing`),w=new WeakMap,T=c.createTreeWalker(c,129);function E(e,t){if(!d(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return r===void 0?t:r.createHTML(t)}var D=(e,t)=>{let n=e.length-1,r=[],o,c=t===2?`<svg>`:t===3?`<math>`:``,l=m;for(let t=0;t<n;t++){let n=e[t],u,d,f=-1,p=0;for(;p<n.length&&(l.lastIndex=p,d=l.exec(n),d!==null);)p=l.lastIndex,l===m?d[1]===`!--`?l=h:d[1]===void 0?d[2]===void 0?d[3]!==void 0&&(l=_):(b.test(d[2])&&(o=RegExp(`</`+d[2],`g`)),l=_):l=g:l===_?d[0]===`>`?(l=o??m,f=-1):d[1]===void 0?f=-2:(f=l.lastIndex-d[2].length,u=d[1],l=d[3]===void 0?_:d[3]===`"`?y:v):l===y||l===v?l=_:l===h||l===g?l=m:(l=_,o=void 0);let x=l===_&&e[t+1].startsWith(`/>`)?` `:``;c+=l===m?n+s:f>=0?(r.push(u),n.slice(0,f)+i+n.slice(f)+a+x):n+a+(f===-2?t:x)}return[E(e,c+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},O=class e{constructor({strings:t,_$litType$:r},s){let c;this.parts=[];let u=0,d=0,f=t.length-1,p=this.parts,[m,h]=D(t,r);if(this.el=e.createElement(m,s),T.currentNode=this.el.content,r===2||r===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(c=T.nextNode())!==null&&p.length<f;){if(c.nodeType===1){if(c.hasAttributes())for(let e of c.getAttributeNames())if(e.endsWith(i)){let t=h[d++],n=c.getAttribute(e).split(a),r=/([.?@])?(.*)/.exec(t);p.push({type:1,index:u,name:r[2],strings:n,ctor:r[1]===`.`?N:r[1]===`?`?P:r[1]===`@`?F:M}),c.removeAttribute(e)}else e.startsWith(a)&&(p.push({type:6,index:u}),c.removeAttribute(e));if(b.test(c.tagName)){let e=c.textContent.split(a),t=e.length-1;if(t>0){c.textContent=n?n.emptyScript:``;for(let n=0;n<t;n++)c.append(e[n],l()),T.nextNode(),p.push({type:2,index:++u});c.append(e[t],l())}}}else if(c.nodeType===8)if(c.data===o)p.push({type:2,index:u});else{let e=-1;for(;(e=c.data.indexOf(a,e+1))!==-1;)p.push({type:7,index:u}),e+=a.length-1}u++}}static createElement(e,t){let n=c.createElement(`template`);return n.innerHTML=e,n}};function k(e,t,n=e,r){if(t===S)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=u(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=k(e,i._$AS(e,t.values),i,r)),t}var A=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??c).importNode(t,!0);T.currentNode=r;let i=T.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new j(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new I(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=T.nextNode(),a++)}return T.currentNode=c,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},j=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=k(this,e,t),u(e)?e===C||e==null||e===``?(this._$AH!==C&&this._$AR(),this._$AH=C):e!==this._$AH&&e!==S&&this._(e):e._$litType$===void 0?e.nodeType===void 0?f(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==C&&u(this._$AH)?this._$AA.nextSibling.data=e:this.T(c.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=O.createElement(E(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new A(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=w.get(e.strings);return t===void 0&&w.set(e.strings,t=new O(e)),t}k(t){d(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(l()),this.O(l()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let n=t(e).nextSibling;t(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},M=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=C,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=C}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=k(this,e,t,0),a=!u(e)||e!==this._$AH&&e!==S,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=k(this,r[n+o],t,o),s===S&&(s=this._$AH[o]),a||=!u(s)||s!==this._$AH[o],s===C?e=C:e!==C&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},N=class extends M{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===C?void 0:e}},P=class extends M{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==C)}},F=class extends M{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=k(this,e,t,0)??C)===S)return;let n=this._$AH,r=e===C&&n!==C||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==C&&(n===C||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},I=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){k(this,e)}},ee={M:i,P:a,A:o,C:1,L:D,R:A,D:f,V:k,I:j,H:M,N:P,U:F,B:N,F:I},te=e.litHtmlPolyfillSupport;te?.(O,j),(e.litHtmlVersions??=[]).push(`3.3.2`);var ne=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new j(t.insertBefore(l(),e),e,void 0,n??{})}return i._$AI(e),i},re=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},L=globalThis,R=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,z=Symbol(),B=new WeakMap,ie=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==z)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(R&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=B.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&B.set(t,e))}return e}toString(){return this.cssText}},ae=e=>new ie(typeof e==`string`?e:e+``,void 0,z),oe=(e,t)=>{if(R)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=L.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},V=R?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return ae(t)})(e):e,{is:se,defineProperty:ce,getOwnPropertyDescriptor:le,getOwnPropertyNames:ue,getOwnPropertySymbols:de,getPrototypeOf:fe}=Object,H=globalThis,U=H.trustedTypes,pe=U?U.emptyScript:``,me=H.reactiveElementPolyfillSupport,W=(e,t)=>e,G={toAttribute(e,t){switch(t){case Boolean:e=e?pe:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},K=(e,t)=>!se(e,t),q={attribute:!0,type:String,converter:G,reflect:!1,useDefault:!1,hasChanged:K};Symbol.metadata??=Symbol(`metadata`),H.litPropertyMetadata??=new WeakMap;var J=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=q){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&ce(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=le(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??q}static _$Ei(){if(this.hasOwnProperty(W(`elementProperties`)))return;let e=fe(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(W(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W(`properties`))){let e=this.properties,t=[...ue(e),...de(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(V(e))}else e!==void 0&&t.push(V(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return oe(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?G:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?G:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??K)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};J.elementStyles=[],J.shadowRootOptions={mode:`open`},J[W(`elementProperties`)]=new Map,J[W(`finalized`)]=new Map,me?.({ReactiveElement:J}),(H.reactiveElementVersions??=[]).push(`2.1.2`);var he={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:K},ge=(e=he,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function Y(e){return(t,n)=>typeof n==`object`?ge(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function _e(e){return Y({...e,state:!0,attribute:!1})}var X=globalThis,Z=class extends J{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ne(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return S}};Z._$litElement$=!0,Z.finalized=!0,X.litElementHydrateSupport?.({LitElement:Z});var ve=X.litElementPolyfillSupport;ve?.({LitElement:Z}),(X.litElementVersions??=[]).push(`4.2.2`);var ye={example:{hi:`Hei!`},generic:{from:`Fra`,to:`Til`},calendar:{buttonAltText:`Åpne kalender`,deleteDate:`Fjern dato`},dates:{month:`Måned`,year:`År`,days:[`Mandag`,`Tirsdag`,`Onsdag`,`Torsdag`,`Fredag`,`Lørdag`,`Søndag`],daysShort:[`Man`,`Tir`,`Ons`,`Tor`,`Fre`,`Lør`,`Søn`],months:[`Januar`,`Februar`,`Mars`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Desember`],monthsShort:[`Jan`,`Feb`,`Mar`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Des`],week:`Uke`,prevMonth:`Forrige måned`,nextMonth:`Neste måned`},timepicker:{hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},forms:{search:{placeholder:`Søk…`},labels:{optional:`Valgfritt`,required:`Må fylles ut`},messages:{required:`Dette feltet er påkrevd`,invalid:`Ugyldig verdi`,invalidPattern:`Ugyldig format`,tooShort:`For kort`,tooLong:`For lang`,rangeUnderflow:`For lav verdi`,rangeOverflow:`For høy verdi`,stepMismatch:`Må treffe på steget som er definert i elementet`,timeStepMismatch:`Må treffe på et steg, for eksempel 0, {step} minutter`,timeStepMismatchHour:`Må treffe på hver hele time`,timeStepMismatchHalfHour:`Må treffe på hver hele eller halve time`,rangeUnderflowMin:`Verdien må være større enn eller lik {min}.`,rangeOverflowMax:`Verdien må være mindre enn eller lik {max}.`,dateUnderflow:`For tidlig dato`,dateOverflow:`For sen dato`},helptext:{helptextDropdownButton:`Les mer`},date:{multiple:`Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato.`}}};function Q(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var $=class extends Z{constructor(...e){super(...e),this.strings=ye,this.role=null}hotReplacedCallback(){this.requestUpdate()}};Q([Y({type:Object})],$.prototype,`strings`,void 0),Q([Y({type:String})],$.prototype,`role`,void 0);var be=class extends ${createRenderRoot(){return this}};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return S}});
@@ -1 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./directive-CJ2giQBZ.cjs`),n=require(`./async-directive-B9P1Qa0k.cjs`);function r(e){return e.classList&&(e.classList.contains(`_dialog_overlay`)||e.classList.contains(`backdrop`))?!0:typeof e.hasAttribute==`function`&&e.hasAttribute(`data-skip`)}function i(e){return e.nodeName===`OPTION`||e.nodeName===`DATA`}function a(e){return e.nodeType===Node.TEXT_NODE&&e.nodeValue?.trim()!==``}var o=new WeakMap;function s(e){let t=o.get(e);return t||(t=new f(e),o.set(e,t)),t}var c=Symbol(`default`);function l(e){return e===void 0?c:e}function u(e,t){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return a(e)?(d(t,c,e),!0):!1;if(e.nodeType===Node.ELEMENT_NODE){let n=e;if(r(n)||i(n))return!1;if(n instanceof HTMLTemplateElement){let e=Array.from(n.content.childNodes),r=l(n.getAttribute(`slot`)??void 0);for(let n of e)d(t,r,n);return!0}let a=n.getAttribute(`slot`);return d(t,a===null?c:l(a),e),!0}return!1}function d(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var f=class e{static{this.PLACEHOLDER_PREFIX=`pkt-slot`}constructor(e){this.observer=null,this.nodesBySlot=new Map,this.directives=new Set,this.observing=!1,this.trackedNodes=new Set,this.generation=0,this.initialCollectionDone=!1,this.processingMutations=!1,this.placeholderToNode=new Map,this.nodeToPlaceholder=new Map,this.host=e}collectNodes(){if(this.initialCollectionDone)return;this.initialCollectionDone=!0,this.generation++;let e=Array.from(this.host.childNodes);for(let t of e)u(t,this.nodesBySlot)&&this.trackedNodes.add(t)}addDirective(e){this.directives.add(e),this.startObserving()}removeDirective(e){this.directives.delete(e),this.directives.size===0&&this.stopObserving()}getNodes(e){return this.nodesBySlot.get(l(e))??[]}hasContent(e){return this.getNodes(e).length>0}ensurePlaceholder(t){if(this.nodeToPlaceholder.has(t)||t.parentNode!==this.host)return;let n=document.createComment(e.PLACEHOLDER_PREFIX);this.host.insertBefore(n,t),this.placeholderToNode.set(n,t),this.nodeToPlaceholder.set(t,n)}startObserving(){this.observing||(this.observing=!0,setTimeout(()=>{this.observing&&(this.observer=new MutationObserver(e=>{this.handleMutations(e)}),this.observer.observe(this.host,{childList:!0}))},0))}stopObserving(){this.observing&&(this.observing=!1,this.observer?.disconnect(),this.observer=null)}handleMutations(e){if(this.processingMutations)return;this.processingMutations=!0;let t=!1;for(let n of e)if(n.target===this.host){for(let e of n.removedNodes){let n=this.placeholderToNode.get(e);if(n){n.parentNode?.removeChild(n),this.trackedNodes.delete(n),this.removeFromSlots(n),this.placeholderToNode.delete(e),this.nodeToPlaceholder.delete(n),t=!0;continue}if(this.trackedNodes.has(e)){this.trackedNodes.delete(e),this.removeFromSlots(e);let n=this.nodeToPlaceholder.get(e);n&&(n.parentNode?.removeChild(n),this.placeholderToNode.delete(n),this.nodeToPlaceholder.delete(e)),t=!0}}for(let e of n.addedNodes)this.placeholderToNode.has(e)||!this.trackedNodes.has(e)&&this.isUserContent(e)&&u(e,this.nodesBySlot)&&(this.trackedNodes.add(e),t=!0)}t&&(this.generation++,this.notifyDirectives()),this.observer?.takeRecords(),this.processingMutations=!1}isUserContent(e){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return a(e);if(e.nodeType===Node.ELEMENT_NODE){let t=e;return!(r(t)||i(t))}return!1}removeFromSlots(e){for(let[t,n]of this.nodesBySlot){let r=n.indexOf(e);if(r!==-1){n.splice(r,1),n.length===0&&this.nodesBySlot.delete(t);return}}}notifyDirectives(){for(let e of this.directives)e.handleNodesChanged()}},p=class extends n.t{constructor(e){if(super(e),this.manager=null,this.lastGeneration=-1,e.type!==t.r.CHILD)throw Error(`slotContent() can only be used in child expressions`)}render(t,n){return e.u}update(e,[t,n]){return this.slotName=n,this.manager||(this.manager=s(t),this.manager.collectNodes(),this.manager.addDirective(this)),this.ensurePlaceholders(),this.getNodesOrNoChange()}handleNodesChanged(){if(!this.isConnected||!this.manager)return;this.ensurePlaceholders();let t=this.getNodesOrNoChange();t!==e.u&&this.setValue(t)}ensurePlaceholders(){if(!this.manager)return;let e=this.manager.getNodes(this.slotName);for(let t of e)this.manager.ensurePlaceholder(t)}disconnected(){this.manager?.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){}getNodesOrNoChange(){if(!this.manager)return e.u;let t=this.manager.generation;return t===this.lastGeneration?e.u:(this.lastGeneration=t,this.manager.getNodes(this.slotName))}},m=t.t(p),h=class extends e.t{connectedCallback(){s(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return s(this).hasContent(e)}};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
@@ -1,73 +0,0 @@
1
- import { c as e, d as t, n, r, s as i } from "./element-cZ85T_aa.js";
2
- //#region src/components/heading/heading.ts
3
- var a = class extends n {
4
- constructor(...e) {
5
- super(...e), this.size = void 0, this.level = 2, this.weight = void 0, this.visuallyHidden = !1, this.align = void 0;
6
- }
7
- connectedCallback() {
8
- super.connectedCallback(), this.setAttribute("role", "heading"), this.setAttribute("aria-level", String(this.level)), this.updateHostClasses();
9
- }
10
- attributeChangedCallback(e, t, n) {
11
- super.attributeChangedCallback(e, t, n), e === "level" && n && this.setLevel(Number(n)), e === "visuallyHidden" && (this.visuallyHidden = n !== null && n !== "false"), (e === "size" || e === "visuallyHidden" || e === "align" || e === "weight") && this.updateHostClasses();
12
- }
13
- updated(e) {
14
- super.updated(e), e.has("level") && (this.setLevel(this.level), this.hasAttribute("size") || (this.size = this.defaultSizeForLevel), this.hasAttribute("weight") || (this.weight = this.defaultWeightForLevel)), !this.hasAttribute("size") && (e.has("level") || this.size === void 0) && (this.size = this.defaultSizeForLevel), (e.has("size") || e.has("visuallyHidden") || e.has("align") || e.has("weight")) && this.updateHostClasses();
15
- }
16
- setLevel(e) {
17
- e >= 1 && e <= 6 ? (this.level = e, this.setAttribute("aria-level", String(e))) : console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`);
18
- }
19
- get defaultSizeForLevel() {
20
- switch (this.level) {
21
- case 1: return "xlarge";
22
- case 2: return "large";
23
- case 3: return "medium";
24
- case 4: return "small";
25
- case 5: return "xsmall";
26
- case 6: return "xsmall";
27
- default: return "medium";
28
- }
29
- }
30
- get defaultWeightForLevel() {
31
- switch (this.level) {
32
- case 1: return "regular";
33
- case 2: return "regular";
34
- case 3: return "medium";
35
- case 4: return "medium";
36
- case 5: return "medium";
37
- case 6: return "medium";
38
- default: return "medium";
39
- }
40
- }
41
- updateHostClasses() {
42
- this.classList.remove("pkt-heading", "pkt-heading--xsmall", "pkt-heading--small", "pkt-heading--medium", "pkt-heading--large", "pkt-heading--xlarge", "pkt-sr-only", "pkt-heading--start", "pkt-heading--center", "pkt-heading--end", "pkt-heading--light", "pkt-heading--regular", "pkt-heading--medium", "pkt-heading--bold"), this.classList.add("pkt-heading"), this.size && this.classList.add(`pkt-heading--${this.size}`), this.weight && this.classList.add(`pkt-heading--fw-${this.weight}`), this.visuallyHidden && this.classList.add("pkt-sr-only"), this.align && this.classList.add(`pkt-heading--${this.align}`);
43
- }
44
- render() {
45
- return t`<slot></slot>`;
46
- }
47
- };
48
- r([i({
49
- type: String,
50
- reflect: !0
51
- })], a.prototype, "size", void 0), r([i({
52
- type: Number,
53
- reflect: !0
54
- })], a.prototype, "level", void 0), r([i({
55
- type: String,
56
- reflect: !0
57
- })], a.prototype, "weight", void 0), r([i({
58
- type: Boolean,
59
- reflect: !0
60
- })], a.prototype, "visuallyHidden", void 0), r([i({
61
- type: String,
62
- reflect: !0
63
- })], a.prototype, "align", void 0);
64
- try {
65
- e("pkt-heading")(a);
66
- } catch {
67
- console.warn("Forsøker å definere <pkt-heading>, men den er allerede definert");
68
- }
69
- //#endregion
70
- //#region src/components/heading/index.ts
71
- var o = a;
72
- //#endregion
73
- export { a as n, o as t };
@@ -1 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`);var t=class extends e.n{constructor(...e){super(...e),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`heading`),this.setAttribute(`aria-level`,String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`level`&&n&&this.setLevel(Number(n)),e===`visuallyHidden`&&(this.visuallyHidden=n!==null&&n!==`false`),(e===`size`||e===`visuallyHidden`||e===`align`||e===`weight`)&&this.updateHostClasses()}updated(e){super.updated(e),e.has(`level`)&&(this.setLevel(this.level),this.hasAttribute(`size`)||(this.size=this.defaultSizeForLevel),this.hasAttribute(`weight`)||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute(`size`)&&(e.has(`level`)||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has(`size`)||e.has(`visuallyHidden`)||e.has(`align`)||e.has(`weight`))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute(`aria-level`,String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return`xlarge`;case 2:return`large`;case 3:return`medium`;case 4:return`small`;case 5:return`xsmall`;case 6:return`xsmall`;default:return`medium`}}get defaultWeightForLevel(){switch(this.level){case 1:return`regular`;case 2:return`regular`;case 3:return`medium`;case 4:return`medium`;case 5:return`medium`;case 6:return`medium`;default:return`medium`}}updateHostClasses(){this.classList.remove(`pkt-heading`,`pkt-heading--xsmall`,`pkt-heading--small`,`pkt-heading--medium`,`pkt-heading--large`,`pkt-heading--xlarge`,`pkt-sr-only`,`pkt-heading--start`,`pkt-heading--center`,`pkt-heading--end`,`pkt-heading--light`,`pkt-heading--regular`,`pkt-heading--medium`,`pkt-heading--bold`),this.classList.add(`pkt-heading`),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add(`pkt-sr-only`),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return e.d`<slot></slot>`}};e.r([e.s({type:String,reflect:!0})],t.prototype,`size`,void 0),e.r([e.s({type:Number,reflect:!0})],t.prototype,`level`,void 0),e.r([e.s({type:String,reflect:!0})],t.prototype,`weight`,void 0),e.r([e.s({type:Boolean,reflect:!0})],t.prototype,`visuallyHidden`,void 0),e.r([e.s({type:String,reflect:!0})],t.prototype,`align`,void 0);try{e.c(`pkt-heading`)(t)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var n=t;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
@@ -1 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./directive-CJ2giQBZ.cjs`);var n=class extends t.n{constructor(n){if(super(n),this.it=e.l,n.type!==t.r.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(t){if(t===e.l||t==null)return this._t=void 0,this.it=t;if(t===e.u)return t;if(typeof t!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(t===this.it)return this._t;this.it=t;let n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};n.directiveName=`unsafeHTML`,n.resultType=1;var r=t.t(n),i=class extends n{};i.directiveName=`unsafeSVG`,i.resultType=2;var a=t.t(i),o=`https://punkt-cdn.oslo.kommune.no/latest/icons/`;typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||o);var s=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,c={},l=2,u=1500,d=typeof Storage<`u`&&typeof sessionStorage<`u`,f=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),p=async(e,t=l)=>{try{return await f(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,u)),p(e,t-1)):(console.error(`Failed to fetch icon: `+e),s)}},m=async(e,t)=>{let n=t+e+`.svg`;return d&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in c?c[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(c[n]=p(n).then(e=>(e!==s&&d&&sessionStorage.setItem(n,e),delete c[n],e)),c[n]):s},h=class extends e.t{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:o,this.name=``,this.icon=a(s),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-icon`)}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e===`name`||e===`path`)&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has(`name`)||e.has(`path`))&&this.getIcon(this.name)}async getIcon(e=``){if(this._updatedProps.length>0){this.path||=typeof window<`u`?window.pktIconPath:o;try{this.icon=a(await m(this.name||``,this.path))}catch{this.icon=a(s)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return e.d`${this.name&&this.icon}`}};e.r([e.s({type:String,reflect:!1})],h.prototype,`path`,void 0),e.r([e.s({type:String,reflect:!0})],h.prototype,`name`,void 0),e.r([e.s({type:SVGElement})],h.prototype,`icon`,void 0),e.r([e.s({type:Array,noAccessor:!0})],h.prototype,`_updatedProps`,void 0);try{e.c(`pkt-icon`)(h)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var g=h;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
@@ -1 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`);var t=t=>t??e.l;Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
@@ -1,13 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1B.cjs`);require(`./icon-Dr8sfT2X.cjs`);const n=require(`./if-defined-XKOD_t_V.cjs`);var r=class extends t.t{constructor(...e){super(...e),this.title=``,this.href=`#`,this.iconName=``,this.external=!1,this.openInNewTab=!1,this.skin=`normal`}render(){let r=[`pkt-linkcard`,this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(` `),i=[`pkt-linkcard__title`,this.external&&`pkt-link pkt-link--external`].filter(Boolean).join(` `);return e.d`
2
- <a
3
- href=${this.href}
4
- class=${r}
5
- target=${this.openInNewTab?`_blank`:`_self`}
6
- rel=${n.t(this.openInNewTab?`noopener noreferrer`:void 0)}
7
- >
8
- ${this.iconName&&e.d`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
9
- ${this.title&&e.d`<div class=${i}>${this.title}</div>`}
10
-
11
- <div class="pkt-linkcard__text">${t.n(this)}</div>
12
- </a>
13
- `}};e.r([e.s({type:String,reflect:!0})],r.prototype,`title`,void 0),e.r([e.s({type:String,reflect:!0})],r.prototype,`href`,void 0),e.r([e.s({type:String,reflect:!0})],r.prototype,`iconName`,void 0),e.r([e.s({type:Boolean,reflect:!0})],r.prototype,`external`,void 0),e.r([e.s({type:Boolean,reflect:!0})],r.prototype,`openInNewTab`,void 0),e.r([e.s({type:String,reflect:!0})],r.prototype,`skin`,void 0);try{e.c(`pkt-linkcard`)(r)}catch{console.warn(`Forsøker å definere <pkt-linkcard>, men den er allerede definert`)}var i=r;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
@@ -1,17 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./directive-CJ2giQBZ.cjs`),n=require(`./class-map-CJ-msbHs.cjs`);require(`./icon-Dr8sfT2X.cjs`);const r=require(`./ref-BaJ0mBT_.cjs`),i=require(`./utils-CM67Oudc.cjs`);var a=`important`,o=` !`+a,s=t.t(class extends t.n{constructor(e){if(super(e),e.type!==t.r.ATTRIBUTE||e.name!==`style`||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(t,[n]){let{style:r}=t.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let e of this.ft)n[e]??(this.ft.delete(e),e.includes(`-`)?r.removeProperty(e):r[e]=null);for(let e in n){let t=n[e];if(t!=null){this.ft.add(e);let n=typeof t==`string`&&t.endsWith(o);e.includes(`-`)||n?r.setProperty(e,n?t.slice(0,-11):t,n?a:``):r[e]=t}}return e.u}}),c=class extends e.t{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=i.n(),this.role=`progressbar`,this.skin=`dark-blue`,this.statusPlacement=`following`,this.statusType=`none`,this.title=``,this.titlePosition=`left`,this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.computedAriaLabelledby=null,this.computedAriaValueText=``,this.labelRef=r.t(),this.progressBarRef=r.t()}firstUpdated(e){super.firstUpdated(e),this.setComputedValues(),this.syncAttributes()}updated(e){super.updated(e),e.has(`valueCurrent`)&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),e.has(`id`)&&this.id&&(this.progressBarId=this.id),(e.has(`statusType`)||e.has(`id`)||e.has(`ariaLabelledby`))&&(this.progressbarId=this.id||i.n(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(e.has(`ariaValueText`)||e.has(`valueCurrent`)||e.has(`valueMax`))&&(this.computedAriaValueText=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``),this.syncAttributes()}render(){let t=this.statusType!==`none`,i=this.valueMax-this.valueMin,a=this.valueCurrent/i*100,o=this.statusType===`fraction`?Math.round(a):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),c=`${this.valueCurrent} av ${i}`,l=n.t({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),u=n.t({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),d=n.t({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),f=n.t({"pkt-progressbar__status-placement--following":this.statusPlacement===`following`,"pkt-progressbar__status-placement--center":this.statusPlacement===`center`,"pkt-progressbar__status-placement--left":this.statusPlacement===`left`});return e.d` <div
2
- class="pkt-progressbar__container"
3
- .ref=${this.progressBarRef}
4
- style=${s({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${o}%`})}
5
- >
6
- ${this.title?e.d`<p id=${`${this.progressBarId}-title`} class=${u}>${this.title}</p>`:e.l}
7
-
8
- <div class="pkt-progressbar__bar-wrapper">
9
- <div class=${l}></div>
10
- </div>
11
-
12
- ${t?e.d`<div class=${d}>
13
- <span class=${f} ${r.n(this.labelRef)}>
14
- ${this.statusType===`percentage`?`${o}%`:c}
15
- </span>
16
- </div>`:e.l}
17
- </div>`}setComputedValues(){this.progressbarId=this.id||i.n(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``}syncAttributes(){this._handleAttribute(`aria-live`,this.ariaLive),this._handleAttribute(`aria-valuenow`,this.valueCurrent),this._handleAttribute(`aria-valuemin`,this.valueMin),this._handleAttribute(`aria-valuemax`,this.valueMax),this._handleAttribute(`aria-valuetext`,this.computedAriaValueText),this._handleAttribute(`aria-label`,this.ariaLabel),this._handleAttribute(`role`,this.role),this._handleAttribute(`aria-atomic`,`true`),this._handleAttribute(`id`,this.progressbarId),this.ariaLabel||this._handleAttribute(`aria-labelledby`,this.computedAriaLabelledby)}_handleAttribute(e,t){t==null||t===``?this.removeAttribute(e):this.setAttribute(e,String(t))}};e.r([e.s({type:String})],c.prototype,`ariaLabel`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`ariaLabelledby`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`ariaValueText`,void 0),e.r([e.s({type:String})],c.prototype,`ariaLive`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`id`,void 0),e.r([e.s({type:String})],c.prototype,`role`,void 0),e.r([e.s({type:String})],c.prototype,`skin`,void 0),e.r([e.s({type:String})],c.prototype,`statusPlacement`,void 0),e.r([e.s({type:String})],c.prototype,`statusType`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`title`,void 0),e.r([e.s({type:String})],c.prototype,`titlePosition`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`valueCurrent`,void 0),e.r([e.s({type:Number})],c.prototype,`valueMax`,void 0),e.r([e.s({type:Number})],c.prototype,`valueMin`,void 0),e.r([e.o()],c.prototype,`labelWidth`,void 0),e.r([e.o()],c.prototype,`progressbarId`,void 0),e.r([e.o()],c.prototype,`computedAriaLabelledby`,void 0),e.r([e.o()],c.prototype,`computedAriaValueText`,void 0);try{e.c(`pkt-progressbar`)(c)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, men den er allerede definert`)}var l=c;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
@@ -1 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./directive-CJ2giQBZ.cjs`),n=require(`./async-directive-B9P1Qa0k.cjs`);var r=()=>new i,i=class{},a=new WeakMap,o=t.t(class extends n.t{render(t){return e.l}update(t,[n]){let r=n!==this.G;return r&&this.G!==void 0&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=n,this.ht=t.options?.host,this.rt(this.ct=t.element)),e.l}rt(e){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=a.get(t);n===void 0&&(n=new WeakMap,a.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?a.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
@@ -1 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./directive-CJ2giQBZ.cjs`),n=require(`./directive-helpers-D1QSxY17.cjs`);var r=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},i=t.t(class extends t.n{constructor(e){if(super(e),e.type!==t.r.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(t,[i,a,o]){let s=n.t(t),{values:c,keys:l}=this.dt(i,a,o);if(!Array.isArray(s))return this.ut=l,c;let u=this.ut??=[],d=[],f,p,m=0,h=s.length-1,g=0,_=c.length-1;for(;m<=h&&g<=_;)if(s[m]===null)m++;else if(s[h]===null)h--;else if(u[m]===l[g])d[g]=n.a(s[m],c[g]),m++,g++;else if(u[h]===l[_])d[_]=n.a(s[h],c[_]),h--,_--;else if(u[m]===l[_])d[_]=n.a(s[m],c[_]),n.o(t,d[_+1],s[m]),m++,_--;else if(u[h]===l[g])d[g]=n.a(s[h],c[g]),n.o(t,s[m],s[h]),h--,g++;else if(f===void 0&&(f=r(l,g,_),p=r(u,m,h)),f.has(u[m]))if(f.has(u[h])){let e=p.get(l[g]),r=e===void 0?null:s[e];if(r===null){let e=n.o(t,s[m]);n.a(e,c[g]),d[g]=e}else d[g]=n.a(r,c[g]),n.o(t,s[m],r),s[e]=null;g++}else n.n(s[h]),h--;else n.n(s[m]),m++;for(;g<=_;){let e=n.o(t,d[_+1]);n.a(e,c[g]),d[g++]=e}for(;m<=h;){let e=s[m++];e!==null&&n.n(e)}return this.ut=l,n.r(t,d),e.u}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
@@ -1,46 +0,0 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./directive-CJ2giQBZ.cjs`),n=require(`./class-map-CJ-msbHs.cjs`),r=require(`./directive-helpers-D1QSxY17.cjs`),i=require(`./element-with-slot-CWoTGA1B.cjs`);require(`./icon-Dr8sfT2X.cjs`);const a=require(`./if-defined-XKOD_t_V.cjs`),o=require(`./ref-BaJ0mBT_.cjs`),s=require(`./input-element-D0egtEnr.cjs`);require(`./input-wrapper-DOIWggEv.cjs`);var c=t.t(class extends t.n{constructor(e){if(super(e),e.type!==t.r.PROPERTY&&e.type!==t.r.ATTRIBUTE&&e.type!==t.r.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!r.i(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(n,[i]){if(i===e.u||i===e.l)return i;let a=n.element,o=n.name;if(n.type===t.r.PROPERTY){if(i===a[o])return e.u}else if(n.type===t.r.BOOLEAN_ATTRIBUTE){if(!!i===a.hasAttribute(o))return e.u}else if(n.type===t.r.ATTRIBUTE&&a.getAttribute(o)===i+``)return e.u;return r.r(n),i}}),l=class extends s.t{constructor(...e){super(...e),this.inputRef=o.t(),this.value=``,this.autocomplete=`off`,this.rows=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}render(){let t=n.t({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),r=this.ariaLabelledby||`${this.id}-input-label`;return e.d`<pkt-input-wrapper
2
- label=${this.label}
3
- ?counter=${this.counter}
4
- ?disabled=${this.disabled}
5
- ?hasError=${this.hasError}
6
- ?inline=${this.inline}
7
- ?optionalTag=${this.optionalTag}
8
- ?required=${this.required}
9
- ?requiredTag=${this.requiredTag}
10
- useWrapper=${this.useWrapper}
11
- .ariaDescribedBy=${this.ariaDescribedBy}
12
- .counterCurrent=${this.counterCurrent}
13
- .counterMaxLength=${this.counterMaxLength}
14
- .errorMessage=${this.errorMessage}
15
- .forId="${this.id+`-input`}"
16
- .helptext=${this.helptext}
17
- .helptextDropdown=${this.helptextDropdown}
18
- .helptextDropdownButton=${this.helptextDropdownButton}
19
- .optionalText=${this.optionalText}
20
- .requiredText=${this.requiredText}
21
- .tagText=${this.tagText}
22
- class="pkt-textarea"
23
- >
24
- <div class="pkt-contents" slot="helptext">${i.n(this,`helptext`)}</div>
25
- <textarea
26
- ${o.n(this.inputRef)}
27
- class=${t}
28
- id=${this.id+`-input`}
29
- name=${(this.name||this.id)+`-input`}
30
- placeholder=${a.t(this.placeholder)}
31
- .value=${c(this.value)}
32
- minlength=${a.t(this.minlength)}
33
- maxlength=${a.t(this.maxlength)}
34
- ?readonly=${this.readonly}
35
- autocomplete=${this.autocomplete}
36
- aria-labelledby=${r}
37
- aria-invalid=${this.hasError}
38
- aria-errormessage=${`${this.id}-error`}
39
- rows=${this.rows}
40
- ?disabled=${this.disabled}
41
- @input=${e=>{this.value=e.target.value,this.onInput(),e.stopImmediatePropagation()}}
42
- @change=${e=>{e.stopImmediatePropagation()}}
43
- @focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
44
- @blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
45
- ></textarea>
46
- </pkt-input-wrapper>`}};e.r([e.s({type:String,reflect:!0})],l.prototype,`value`,void 0),e.r([e.s({type:String})],l.prototype,`autocomplete`,void 0),e.r([e.s({type:Number})],l.prototype,`rows`,void 0),e.r([e.o()],l.prototype,`counterCurrent`,void 0);try{e.c(`pkt-textarea`)(l)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var u=l;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
File without changes
File without changes