@oslokommune/punkt-elements 16.25.2 → 16.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/{accordion-BjYsEbSM.js → accordion-CBdIk9gw.js} +5 -5
  3. package/dist/{accordion-DaeWPWod.cjs → accordion-FISAiAbX.cjs} +2 -2
  4. package/dist/{alert-C8OpU_Un.cjs → alert-B8dLsiTz.cjs} +2 -2
  5. package/dist/{alert-B5Y841vH.js → alert-HHTGY0sp.js} +6 -6
  6. package/dist/{async-directive-Cz6tcqge.js → async-directive-Cw_7VW_-.js} +3 -3
  7. package/dist/{async-directive-DO1QtVmf.cjs → async-directive-HLXOyE4A.cjs} +1 -1
  8. package/dist/{backlink-C42-3OG3.cjs → backlink-DDGlLzk9.cjs} +2 -2
  9. package/dist/{backlink-BXAdgAte.js → backlink-wMNLuQ0X.js} +3 -3
  10. package/dist/{booleanish-jJLlnr6-.cjs → booleanish-B9Kf0nES.cjs} +1 -1
  11. package/dist/{breadcrumbs-Dkb9TxMp.js → breadcrumbs-CVTLNNsL.js} +2 -2
  12. package/dist/{breadcrumbs-CkjeLh3U.cjs → breadcrumbs-D3tfWqvC.cjs} +2 -2
  13. package/dist/{button-Bqk9wjme.cjs → button-B5tQpKeG.cjs} +2 -2
  14. package/dist/{button-CAZEaEW9.js → button-C_YzTSuU.js} +5 -5
  15. package/dist/{calendar-CRIp36hn.js → calendar-CjlUA-Lb.js} +4 -4
  16. package/dist/{calendar-64LmbIdR.cjs → calendar-DIzGBdbh.cjs} +2 -2
  17. package/dist/{card-C__IlsUa.cjs → card-BSZs5lRF.cjs} +2 -2
  18. package/dist/{card-5PydU247.js → card-D3jVkwxJ.js} +7 -7
  19. package/dist/{checkbox-CC1X7fw4.js → checkbox-DB_ZAuJJ.js} +12 -12
  20. package/dist/{checkbox-DzMc0AJX.cjs → checkbox-HKXLLpXq.cjs} +9 -9
  21. package/dist/{class-map-DH9hlJny.js → class-map-CAQCRB1W.js} +2 -2
  22. package/dist/{class-map-B8Ja0q7n.cjs → class-map-CCZN5uS3.cjs} +1 -1
  23. package/dist/{classutils-CVTzKF0J.cjs → classutils-CbklAJDe.cjs} +1 -1
  24. package/dist/{combobox-DJITmrnM.cjs → combobox-DsqvSokZ.cjs} +2 -2
  25. package/dist/{combobox-BuBvoK-N.js → combobox-vaCanZCq.js} +27 -17
  26. package/dist/components/accordion/accordion.d.ts +1 -1
  27. package/dist/components/accordion/accordionitem.d.ts +1 -1
  28. package/dist/components/alert/alert.d.ts +1 -1
  29. package/dist/components/backlink/backlink.d.ts +1 -1
  30. package/dist/components/breadcrumbs/breadcrumbs.d.ts +1 -1
  31. package/dist/components/button/button.d.ts +1 -1
  32. package/dist/components/card/card.d.ts +9 -9
  33. package/dist/components/checkbox/checkbox.d.ts +1 -1
  34. package/dist/components/combobox/combobox.d.ts +1 -1
  35. package/dist/components/consent/consent.d.ts +1 -1
  36. package/dist/components/datepicker/date-tags.d.ts +1 -1
  37. package/dist/components/datepicker/datepicker-multiple.d.ts +1 -1
  38. package/dist/components/datepicker/datepicker-popup.d.ts +1 -1
  39. package/dist/components/datepicker/datepicker-range.d.ts +1 -1
  40. package/dist/components/datepicker/datepicker-single.d.ts +1 -1
  41. package/dist/components/datepicker/datepicker.d.ts +5 -5
  42. package/dist/components/fileupload/fileupload-renderers.d.ts +2 -2
  43. package/dist/components/fileupload/fileupload.d.ts +1 -1
  44. package/dist/components/header/header-user-menu.d.ts +1 -1
  45. package/dist/components/header/header.d.ts +1 -1
  46. package/dist/components/helptext/helptext.d.ts +1 -1
  47. package/dist/components/icon/icon.d.ts +1 -1
  48. package/dist/components/input-wrapper/input-wrapper.d.ts +1 -1
  49. package/dist/components/link/link.d.ts +1 -1
  50. package/dist/components/linkcard/linkcard.d.ts +1 -1
  51. package/dist/components/listbox/listbox.d.ts +1 -1
  52. package/dist/components/loader/loader.d.ts +1 -1
  53. package/dist/components/messagebox/messagebox.d.ts +1 -1
  54. package/dist/components/modal/modal.d.ts +1 -1
  55. package/dist/components/progressbar/progressbar.d.ts +1 -1
  56. package/dist/components/radiobutton/radiobutton.d.ts +1 -1
  57. package/dist/components/searchinput/searchinput.d.ts +1 -1
  58. package/dist/components/select/select.d.ts +1 -1
  59. package/dist/components/tabs/tabitem.d.ts +1 -1
  60. package/dist/components/tabs/tabs.d.ts +1 -1
  61. package/dist/components/tag/tag.d.ts +1 -1
  62. package/dist/components/textarea/textarea.d.ts +1 -1
  63. package/dist/components/textinput/textinput.d.ts +1 -1
  64. package/dist/components/timepicker/timepicker.d.ts +1 -1
  65. package/dist/{consent-CCesjQ_e.js → consent-D5sY6JK3.js} +3 -3
  66. package/dist/{consent-DkCihETp.cjs → consent-X3wvhteO.cjs} +2 -2
  67. package/dist/converters-9jHlXDyy.cjs +1 -0
  68. package/dist/{converters-BQnj7OJE.js → converters-BKGBRBpS.js} +191 -176
  69. package/dist/{datepicker-zOOhs9JK.js → datepicker-CKghFMu2.js} +13 -13
  70. package/dist/{datepicker-ChEi_INm.cjs → datepicker-DNEUkbB0.cjs} +2 -2
  71. package/dist/{dialog-polyfill.esm-CYs2AHP1.cjs → dialog-polyfill.esm-J-GKtwrS.cjs} +1 -1
  72. package/dist/{directive-helpers-f36YZFOG.cjs → directive-helpers-BshFvt7A.cjs} +1 -1
  73. package/dist/{directive-helpers-Cep_4cpj.js → directive-helpers-DIF5DwN4.js} +2 -2
  74. package/dist/directives/slot-content.d.ts +1 -1
  75. package/dist/docs/backlink.d.ts +1 -1
  76. package/dist/docs/components/accordion.d.ts +1 -1
  77. package/dist/docs/components/alert.d.ts +1 -1
  78. package/dist/docs/components/backlink.d.ts +1 -1
  79. package/dist/docs/components/breadcrumbs.d.ts +1 -1
  80. package/dist/docs/components/button.d.ts +1 -1
  81. package/dist/docs/components/calendar.d.ts +1 -1
  82. package/dist/docs/components/card.d.ts +1 -1
  83. package/dist/docs/components/checkbox.d.ts +1 -1
  84. package/dist/docs/components/combobox.d.ts +1 -1
  85. package/dist/docs/components/comboboxdemo.d.ts +1 -1
  86. package/dist/docs/components/consent.d.ts +1 -1
  87. package/dist/docs/components/datepicker.d.ts +1 -1
  88. package/dist/docs/components/datepickermultiple.d.ts +1 -1
  89. package/dist/docs/components/fileupload.d.ts +1 -1
  90. package/dist/docs/components/form.d.ts +1 -1
  91. package/dist/docs/components/header-full.d.ts +1 -1
  92. package/dist/docs/components/header-menu.d.ts +1 -1
  93. package/dist/docs/components/header.d.ts +1 -1
  94. package/dist/docs/components/heading.d.ts +1 -1
  95. package/dist/docs/components/icon.d.ts +1 -1
  96. package/dist/docs/components/input-wrapper.d.ts +1 -1
  97. package/dist/docs/components/link.d.ts +1 -1
  98. package/dist/docs/components/linkcard.d.ts +1 -1
  99. package/dist/docs/components/loader.d.ts +1 -1
  100. package/dist/docs/components/messagebox.d.ts +1 -1
  101. package/dist/docs/components/modal.d.ts +1 -1
  102. package/dist/docs/components/progressbar.d.ts +1 -1
  103. package/dist/docs/components/radiobutton.d.ts +1 -1
  104. package/dist/docs/components/searchinput.d.ts +1 -1
  105. package/dist/docs/components/select.d.ts +1 -1
  106. package/dist/docs/components/slots.d.ts +1 -1
  107. package/dist/docs/components/tabs.d.ts +1 -1
  108. package/dist/docs/components/tag.d.ts +1 -1
  109. package/dist/docs/components/textarea.d.ts +1 -1
  110. package/dist/docs/components/textinput.d.ts +1 -1
  111. package/dist/docs/components/timepicker.d.ts +1 -1
  112. package/dist/docs/header.d.ts +1 -1
  113. package/dist/docs/punkt-docs.d.ts +1 -1
  114. package/dist/{element-CduG0XyF.js → element-BoJrqauR.js} +6 -6
  115. package/dist/{element-CXAtr6Gu.cjs → element-DJzurxgt.cjs} +1 -1
  116. package/dist/{element-with-slot-Cmxb9h4H.cjs → element-with-slot-BY7Jc-q8.cjs} +1 -1
  117. package/dist/{element-with-slot-BVj9MXzi.js → element-with-slot-mXLg8gg8.js} +2 -2
  118. package/dist/{fileupload-CGaJlMG9.cjs → fileupload-BMHJaAKR.cjs} +2 -2
  119. package/dist/{fileupload-BBph8gH3.js → fileupload-DpvQ3e_T.js} +10 -10
  120. package/dist/{focus-modality-controller-wI5SR8wH.cjs → focus-modality-controller-C1ocyv2J.cjs} +1 -1
  121. package/dist/{header-C8dCoJpr.js → header-C7kSI9zP.js} +10 -10
  122. package/dist/{header-C6z1KhOR.cjs → header-VfLyhEYL.cjs} +2 -2
  123. package/dist/{header-menu-BU-ylGrJ.js → header-menu-C8b5vd3n.js} +5 -5
  124. package/dist/{header-menu-CnW7nzmF.cjs → header-menu-DMdP_c6X.cjs} +2 -2
  125. package/dist/{heading-3o4Dk0Wn.js → heading-CD0PhL8g.js} +2 -2
  126. package/dist/{heading-C40-NX0r.cjs → heading-DyJpBFT2.cjs} +1 -1
  127. package/dist/{helptext-C2aQBBo_.js → helptext-OfqH5npD.js} +6 -6
  128. package/dist/{helptext-DNLg43eI.cjs → helptext-eckq4JEX.cjs} +2 -2
  129. package/dist/{icon-Dw6I0HDV.cjs → icon-B8PVq2O6.cjs} +1 -1
  130. package/dist/{icon-LaKyBKON.js → icon-DGFEIlco.js} +2 -2
  131. package/dist/if-defined-D0bnetLJ.js +5 -0
  132. package/dist/if-defined-DrwbxQOj.cjs +1 -0
  133. package/dist/index.d.ts +2 -2
  134. package/dist/input-element-C_zP_x4a.js +656 -0
  135. package/dist/input-element-Df9FHnfn.cjs +1 -0
  136. package/dist/{input-wrapper-CvtU-Ksb.cjs → input-wrapper-BRjQB4zM.cjs} +21 -21
  137. package/dist/{input-wrapper-C93MmOIg.js → input-wrapper-DaA98B5l.js} +32 -32
  138. package/dist/{input-wrapper-CYCCx8MP.cjs → input-wrapper-LcZjpt0L.cjs} +1 -1
  139. package/dist/{link-DauiNRMq.js → link-FmkQvSQL.js} +4 -4
  140. package/dist/{link-EZ0-lS3W.cjs → link-Geze7498.cjs} +2 -2
  141. package/dist/{linkcard-BIcCW-qw.cjs → linkcard-6LCXRTR-.cjs} +2 -2
  142. package/dist/{linkcard-DNJm5FvA.js → linkcard-BKdT0zU_.js} +4 -4
  143. package/dist/{listbox-DbEobJNx.cjs → listbox-89wMuQVK.cjs} +2 -2
  144. package/dist/{listbox-DXMIBv3y.js → listbox-LdyWPu7W.js} +5 -5
  145. package/dist/{loader-B3ToraVk.js → loader-BA-i8CaQ.js} +4 -4
  146. package/dist/{loader-CLf_Phfg.cjs → loader-CgW4Vst3.cjs} +2 -2
  147. package/dist/{messagebox-BqBxXK8c.cjs → messagebox-VD5oEZ19.cjs} +2 -2
  148. package/dist/{messagebox-XRFecqyS.js → messagebox-fiaAyHLG.js} +5 -5
  149. package/dist/{modal-CWgeT-RP.js → modal-C6pScpdG.js} +6 -6
  150. package/dist/{modal-CrYHKOmr.cjs → modal-DKU7PnjJ.cjs} +2 -2
  151. package/dist/pkt-accordion.cjs +1 -1
  152. package/dist/pkt-accordion.js +1 -1
  153. package/dist/pkt-alert.cjs +1 -1
  154. package/dist/pkt-alert.js +1 -1
  155. package/dist/pkt-backlink.cjs +1 -1
  156. package/dist/pkt-backlink.js +1 -1
  157. package/dist/pkt-breadcrumbs.cjs +1 -1
  158. package/dist/pkt-breadcrumbs.js +1 -1
  159. package/dist/pkt-button.cjs +1 -1
  160. package/dist/pkt-button.js +1 -1
  161. package/dist/pkt-calendar.cjs +1 -1
  162. package/dist/pkt-calendar.js +1 -1
  163. package/dist/pkt-card.cjs +1 -1
  164. package/dist/pkt-card.js +1 -1
  165. package/dist/pkt-checkbox.cjs +1 -1
  166. package/dist/pkt-checkbox.js +1 -1
  167. package/dist/pkt-combobox.cjs +1 -1
  168. package/dist/pkt-combobox.js +1 -1
  169. package/dist/pkt-consent.cjs +1 -1
  170. package/dist/pkt-consent.js +1 -1
  171. package/dist/pkt-datepicker.cjs +1 -1
  172. package/dist/pkt-datepicker.js +1 -1
  173. package/dist/pkt-fileupload.cjs +1 -1
  174. package/dist/pkt-fileupload.js +1 -1
  175. package/dist/pkt-header-menu.cjs +1 -1
  176. package/dist/pkt-header-menu.js +1 -1
  177. package/dist/pkt-header.cjs +1 -1
  178. package/dist/pkt-header.js +1 -1
  179. package/dist/pkt-heading.cjs +1 -1
  180. package/dist/pkt-heading.js +1 -1
  181. package/dist/pkt-helptext.cjs +1 -1
  182. package/dist/pkt-helptext.js +1 -1
  183. package/dist/pkt-icon.cjs +1 -1
  184. package/dist/pkt-icon.js +1 -1
  185. package/dist/pkt-index.cjs +1 -1
  186. package/dist/pkt-index.js +32 -32
  187. package/dist/pkt-input-wrapper.cjs +1 -1
  188. package/dist/pkt-input-wrapper.js +1 -1
  189. package/dist/pkt-link.cjs +1 -1
  190. package/dist/pkt-link.js +1 -1
  191. package/dist/pkt-linkcard.cjs +1 -1
  192. package/dist/pkt-linkcard.js +1 -1
  193. package/dist/pkt-listbox.cjs +1 -1
  194. package/dist/pkt-listbox.js +1 -1
  195. package/dist/pkt-loader.cjs +1 -1
  196. package/dist/pkt-loader.js +1 -1
  197. package/dist/pkt-messagebox.cjs +1 -1
  198. package/dist/pkt-messagebox.js +1 -1
  199. package/dist/pkt-modal.cjs +1 -1
  200. package/dist/pkt-modal.js +1 -1
  201. package/dist/{pkt-options-controller-BTNtjEIS.js → pkt-options-controller-Cis62vGe.js} +1 -1
  202. package/dist/{pkt-options-controller-CBM8xHwR.cjs → pkt-options-controller-DHKHMyXM.cjs} +1 -1
  203. package/dist/pkt-progressbar.cjs +1 -1
  204. package/dist/pkt-progressbar.js +1 -1
  205. package/dist/pkt-radiobutton.cjs +1 -1
  206. package/dist/pkt-radiobutton.js +1 -1
  207. package/dist/pkt-searchinput.cjs +1 -1
  208. package/dist/pkt-searchinput.js +1 -1
  209. package/dist/pkt-select.cjs +1 -1
  210. package/dist/pkt-select.js +1 -1
  211. package/dist/pkt-tabs.cjs +1 -1
  212. package/dist/pkt-tabs.js +1 -1
  213. package/dist/pkt-tag.cjs +1 -1
  214. package/dist/pkt-tag.js +1 -1
  215. package/dist/pkt-textarea.cjs +1 -1
  216. package/dist/pkt-textarea.js +1 -1
  217. package/dist/pkt-textinput.cjs +1 -1
  218. package/dist/pkt-textinput.js +1 -1
  219. package/dist/pkt-timepicker.cjs +1 -1
  220. package/dist/pkt-timepicker.js +1 -1
  221. package/dist/progressbar-BN5y20CC.cjs +17 -0
  222. package/dist/{progressbar-B0P_vmGD.js → progressbar-mtjtbpCO.js} +7 -7
  223. package/dist/{radiobutton-C6zERHoy.js → radiobutton-CKhWm7CI.js} +8 -8
  224. package/dist/{radiobutton-BfURufrZ.cjs → radiobutton-DbezjeDT.cjs} +5 -5
  225. package/dist/ref-DO7TzO4O.cjs +1 -0
  226. package/dist/{ref-BgoHEsEt.js → ref-WGS0u7i2.js} +5 -5
  227. package/dist/{repeat-CKIii8Mi.js → repeat-BH0cL82q.js} +3 -3
  228. package/dist/{repeat-CRRgmzVn.cjs → repeat-DRnLAg0O.cjs} +1 -1
  229. package/dist/{searchinput-fPvXHu2O.js → searchinput-CyO5k4Q4.js} +7 -6
  230. package/dist/{searchinput-BrxfRzez.cjs → searchinput-DG6YetL1.cjs} +2 -2
  231. package/dist/{select-z3hBSk02.cjs → select-3689MFnH.cjs} +2 -2
  232. package/dist/{select-Dz3YiN7b.js → select-CrTmkOw0.js} +7 -7
  233. package/dist/{tabs-DxQy8U-0.cjs → tabs-CGo0ODPa.cjs} +2 -2
  234. package/dist/{tabs-BJx6wwXD.js → tabs-ChdR0D1C.js} +9 -9
  235. package/dist/{tag-CBFz0R9N.cjs → tag-C4fEuT-r.cjs} +2 -2
  236. package/dist/{tag-CzlnHhho.js → tag-DBNga0hg.js} +5 -5
  237. package/dist/{textarea-rHlURXh5.cjs → textarea-BWOuU6m6.cjs} +2 -2
  238. package/dist/{textarea-BxBfLk3N.js → textarea-tKZakgjC.js} +10 -10
  239. package/dist/{textinput-DSYABvB6.cjs → textinput-CqvE701N.cjs} +2 -2
  240. package/dist/{textinput-Bs8DwHwR.js → textinput-D-gsl53I.js} +8 -8
  241. package/dist/{timepicker-Cb9pxkJa.js → timepicker-D2KJmxrZ.js} +8 -8
  242. package/dist/{timepicker-DVisPbGX.cjs → timepicker-DTI6LY0j.cjs} +2 -2
  243. package/dist/{utils-CjAbIttF.cjs → utils-63cRpWut.cjs} +1 -1
  244. package/package.json +28 -27
  245. package/dist/converters-CkqZ02TI.cjs +0 -1
  246. package/dist/if-defined-LTjAScFG.cjs +0 -1
  247. package/dist/if-defined-VShASPdu.js +0 -5
  248. package/dist/input-element-BHQVt4Q9.cjs +0 -1
  249. package/dist/input-element-BrmkXIXi.js +0 -643
  250. package/dist/progressbar-DADdvDl5.cjs +0 -17
  251. package/dist/ref-CBdWMlde.cjs +0 -1
  252. /package/dist/{booleanish-BmcOU-43.js → booleanish-MfutDT_4.js} +0 -0
  253. /package/dist/{classutils-lVbGcvjN.js → classutils-DcYnSgfc.js} +0 -0
  254. /package/dist/{dialog-polyfill.esm-0dVT8G1o.js → dialog-polyfill.esm-ChZRzCVh.js} +0 -0
  255. /package/dist/{focus-modality-controller-CaUqYdk0.js → focus-modality-controller-Dc2S-KqR.js} +0 -0
  256. /package/dist/{input-wrapper-kw2y6Jp_.js → input-wrapper-DwwE0JcO.js} +0 -0
  257. /package/dist/{utils-CUqCKGvp.js → utils-BwF4QSrq.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  var e=globalThis,t=e=>e,n=e.trustedTypes,r=n?n.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,i=`$lit$`,a=`lit$${Math.random().toFixed(9).slice(2)}$`,o=`?`+a,s=`<${o}>`,c=document,l=()=>c.createComment(``),u=e=>e===null||typeof e!=`object`&&typeof e!=`function`,d=Array.isArray,f=e=>d(e)||typeof e?.[Symbol.iterator]==`function`,p=`[
2
- \f\r]`,m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,h=/-->/g,g=/>/g,_=RegExp(`>|${p}(?:([^\\s"'>=/]+)(${p}*=${p}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),v=/'/g,y=/"/g,b=/^(?:script|style|textarea|title)$/i,x=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),S=Symbol.for(`lit-noChange`),C=Symbol.for(`lit-nothing`),w=new WeakMap,T=c.createTreeWalker(c,129);function E(e,t){if(!d(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return r===void 0?t:r.createHTML(t)}var D=(e,t)=>{let n=e.length-1,r=[],o,c=t===2?`<svg>`:t===3?`<math>`:``,l=m;for(let t=0;t<n;t++){let n=e[t],u,d,f=-1,p=0;for(;p<n.length&&(l.lastIndex=p,d=l.exec(n),d!==null);)p=l.lastIndex,l===m?d[1]===`!--`?l=h:d[1]===void 0?d[2]===void 0?d[3]!==void 0&&(l=_):(b.test(d[2])&&(o=RegExp(`</`+d[2],`g`)),l=_):l=g:l===_?d[0]===`>`?(l=o??m,f=-1):d[1]===void 0?f=-2:(f=l.lastIndex-d[2].length,u=d[1],l=d[3]===void 0?_:d[3]===`"`?y:v):l===y||l===v?l=_:l===h||l===g?l=m:(l=_,o=void 0);let x=l===_&&e[t+1].startsWith(`/>`)?` `:``;c+=l===m?n+s:f>=0?(r.push(u),n.slice(0,f)+i+n.slice(f)+a+x):n+a+(f===-2?t:x)}return[E(e,c+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},O=class e{constructor({strings:t,_$litType$:r},s){let c;this.parts=[];let u=0,d=0,f=t.length-1,p=this.parts,[m,h]=D(t,r);if(this.el=e.createElement(m,s),T.currentNode=this.el.content,r===2||r===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(c=T.nextNode())!==null&&p.length<f;){if(c.nodeType===1){if(c.hasAttributes())for(let e of c.getAttributeNames())if(e.endsWith(i)){let t=h[d++],n=c.getAttribute(e).split(a),r=/([.?@])?(.*)/.exec(t);p.push({type:1,index:u,name:r[2],strings:n,ctor:r[1]===`.`?N:r[1]===`?`?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={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ie=e=>(...t)=>({_$litDirective$:e,values:t}),ae=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)}},oe=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,se=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}},ce=e=>new se(typeof e==`string`?e:e+``,void 0,z),le=(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 ce(t)})(e):e,{is:ue,defineProperty:de,getOwnPropertyDescriptor:fe,getOwnPropertyNames:pe,getOwnPropertySymbols:me,getPrototypeOf:he}=Object,H=globalThis,U=H.trustedTypes,ge=U?U.emptyScript:``,_e=H.reactiveElementPolyfillSupport,W=(e,t)=>e,G={toAttribute(e,t){switch(t){case Boolean:e=e?ge: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)=>!ue(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&&de(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=fe(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=he(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=[...pe(e),...me(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 le(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,_e?.({ReactiveElement:J}),(H.reactiveElementVersions??=[]).push(`2.1.2`);var ve={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:K},ye=(e=ve,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`?ye(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 be(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 xe=X.litElementPolyfillSupport;xe?.({LitElement:Z}),(X.litElementVersions??=[]).push(`4.2.2`);var Se={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=Se,this.role=null}hotReplacedCallback(){this.requestUpdate()}};Q([Y({type:Object})],$.prototype,`strings`,void 0),Q([Y({type:String})],$.prototype,`role`,void 0);var Ce=class extends ${createRenderRoot(){return this}};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return re}});
2
+ \f\r]`,m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,h=/-->/g,g=/>/g,_=RegExp(`>|${p}(?:([^\\s"'>=/]+)(${p}*=${p}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),v=/'/g,y=/"/g,b=/^(?:script|style|textarea|title)$/i,x=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),S=Symbol.for(`lit-noChange`),C=Symbol.for(`lit-nothing`),w=new WeakMap,T=c.createTreeWalker(c,129);function E(e,t){if(!d(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return r===void 0?t:r.createHTML(t)}var D=(e,t)=>{let n=e.length-1,r=[],o,c=t===2?`<svg>`:t===3?`<math>`:``,l=m;for(let t=0;t<n;t++){let n=e[t],u,d,f=-1,p=0;for(;p<n.length&&(l.lastIndex=p,d=l.exec(n),d!==null);)p=l.lastIndex,l===m?d[1]===`!--`?l=h:d[1]===void 0?d[2]===void 0?d[3]!==void 0&&(l=_):(b.test(d[2])&&(o=RegExp(`</`+d[2],`g`)),l=_):l=g:l===_?d[0]===`>`?(l=o??m,f=-1):d[1]===void 0?f=-2:(f=l.lastIndex-d[2].length,u=d[1],l=d[3]===void 0?_:d[3]===`"`?y:v):l===y||l===v?l=_:l===h||l===g?l=m:(l=_,o=void 0);let x=l===_&&e[t+1].startsWith(`/>`)?` `:``;c+=l===m?n+s:f>=0?(r.push(u),n.slice(0,f)+i+n.slice(f)+a+x):n+a+(f===-2?t:x)}return[E(e,c+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},O=class e{constructor({strings:t,_$litType$:r},s){let c;this.parts=[];let u=0,d=0,f=t.length-1,p=this.parts,[m,h]=D(t,r);if(this.el=e.createElement(m,s),T.currentNode=this.el.content,r===2||r===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(c=T.nextNode())!==null&&p.length<f;){if(c.nodeType===1){if(c.hasAttributes())for(let e of c.getAttributeNames())if(e.endsWith(i)){let t=h[d++],n=c.getAttribute(e).split(a),r=/([.?@])?(.*)/.exec(t);p.push({type:1,index:u,name:r[2],strings:n,ctor:r[1]===`.`?N:r[1]===`?`?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.3`);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={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ie=e=>(...t)=>({_$litDirective$:e,values:t}),ae=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)}},oe=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,se=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}},ce=e=>new se(typeof e==`string`?e:e+``,void 0,z),le=(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 ce(t)})(e):e,{is:ue,defineProperty:de,getOwnPropertyDescriptor:fe,getOwnPropertyNames:pe,getOwnPropertySymbols:me,getPrototypeOf:he}=Object,H=globalThis,U=H.trustedTypes,ge=U?U.emptyScript:``,_e=H.reactiveElementPolyfillSupport,W=(e,t)=>e,G={toAttribute(e,t){switch(t){case Boolean:e=e?ge: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)=>!ue(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&&de(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=fe(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=he(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=[...pe(e),...me(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 le(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,_e?.({ReactiveElement:J}),(H.reactiveElementVersions??=[]).push(`2.1.2`);var ve={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:K},ye=(e=ve,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`?ye(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 be(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 xe=X.litElementPolyfillSupport;xe?.({LitElement:Z}),(X.litElementVersions??=[]).push(`4.2.2`);var Se={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=Se,this.role=null}hotReplacedCallback(){this.requestUpdate()}};Q([Y({type:Object})],$.prototype,`strings`,void 0),Q([Y({type:String})],$.prototype,`role`,void 0);var Ce=class extends ${createRenderRoot(){return this}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return re}});
@@ -1 +1 @@
1
- const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./async-directive-DO1QtVmf.cjs`);function n(e){return e.classList&&(e.classList.contains(`_dialog_overlay`)||e.classList.contains(`backdrop`))?!0:typeof e.hasAttribute==`function`&&e.hasAttribute(`data-skip`)}function r(e){return e.nodeName===`OPTION`||e.nodeName===`DATA`}function i(e){return e.nodeType===Node.TEXT_NODE&&e.nodeValue?.trim()!==``}var a=new WeakMap;function o(e){let t=a.get(e);return t||(t=new d(e),a.set(e,t)),t}var s=Symbol(`default`);function c(e){return e===void 0?s:e}function l(e,t){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return i(e)?(u(t,s,e),!0):!1;if(e.nodeType===Node.ELEMENT_NODE){let i=e;if(n(i)||r(i))return!1;if(i instanceof HTMLTemplateElement){let e=Array.from(i.content.childNodes),n=c(i.getAttribute(`slot`)??void 0);for(let r of e)u(t,n,r);return!0}let a=i.getAttribute(`slot`);return u(t,a===null?s:c(a),e),!0}return!1}function u(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var d=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)l(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(c(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)&&l(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 i(e);if(e.nodeType===Node.ELEMENT_NODE){let t=e;return!(n(t)||r(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()}},f=class extends t.t{constructor(t){if(super(t),this.manager=null,this.lastGeneration=-1,t.type!==e.u.CHILD)throw Error(`slotContent() can only be used in child expressions`)}render(t,n){return e.f}update(e,[t,n]){return this.slotName=n,this.manager||(this.manager=o(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.f&&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.f;let t=this.manager.generation;return t===this.lastGeneration?e.f:(this.lastGeneration=t,this.manager.getNodes(this.slotName))}},p=e.c(f),m=class extends e.t{connectedCallback(){o(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return o(this).hasContent(e)}};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
1
+ const e=require("./element-DJzurxgt.cjs"),t=require("./async-directive-HLXOyE4A.cjs");function n(e){return e.classList&&(e.classList.contains(`_dialog_overlay`)||e.classList.contains(`backdrop`))?!0:typeof e.hasAttribute==`function`&&e.hasAttribute(`data-skip`)}function r(e){return e.nodeName===`OPTION`||e.nodeName===`DATA`}function i(e){return e.nodeType===Node.TEXT_NODE&&e.nodeValue?.trim()!==``}var a=new WeakMap;function o(e){let t=a.get(e);return t||(t=new d(e),a.set(e,t)),t}var s=Symbol(`default`);function c(e){return e===void 0?s:e}function l(e,t){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return i(e)?(u(t,s,e),!0):!1;if(e.nodeType===Node.ELEMENT_NODE){let i=e;if(n(i)||r(i))return!1;if(i instanceof HTMLTemplateElement){let e=Array.from(i.content.childNodes),n=c(i.getAttribute(`slot`)??void 0);for(let r of e)u(t,n,r);return!0}let a=i.getAttribute(`slot`);return u(t,a===null?s:c(a),e),!0}return!1}function u(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var d=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)l(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(c(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)&&l(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 i(e);if(e.nodeType===Node.ELEMENT_NODE){let t=e;return!(n(t)||r(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()}},f=class extends t.t{constructor(t){if(super(t),this.manager=null,this.lastGeneration=-1,t.type!==e.u.CHILD)throw Error(`slotContent() can only be used in child expressions`)}render(t,n){return e.f}update(e,[t,n]){return this.slotName=n,this.manager||(this.manager=o(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.f&&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.f;let t=this.manager.generation;return t===this.lastGeneration?e.f:(this.lastGeneration=t,this.manager.getNodes(this.slotName))}},p=e.c(f),m=class extends e.t{connectedCallback(){o(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return o(this).hasContent(e)}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}});
@@ -1,5 +1,5 @@
1
- import { c as e, f as t, t as n, u as r } from "./element-CduG0XyF.js";
2
- import { t as i } from "./async-directive-Cz6tcqge.js";
1
+ import { c as e, f as t, t as n, u as r } from "./element-BoJrqauR.js";
2
+ import { t as i } from "./async-directive-Cw_7VW_-.js";
3
3
  //#region src/controllers/pkt-slot-utils.ts
4
4
  function a(e) {
5
5
  return e.classList && (e.classList.contains("_dialog_overlay") || e.classList.contains("backdrop")) ? !0 : typeof e.hasAttribute == "function" && e.hasAttribute("data-skip");
@@ -1,4 +1,4 @@
1
- const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);require(`./alert-C8OpU_Un.cjs`),require(`./icon-Dw6I0HDV.cjs`);const n=require(`./if-defined-LTjAScFG.cjs`),r=require(`./converters-CkqZ02TI.cjs`),i=require(`./utils-CjAbIttF.cjs`);require(`./input-wrapper-CvtU-Ksb.cjs`),require(`./modal-CrYHKOmr.cjs`),require(`./progressbar-DADdvDl5.cjs`);var a={dropZoneDragMultiple:`Dra filer hit for å laste dem opp eller`,dropZoneDragSingle:`Dra en fil hit for å laste den opp eller`,dropZoneDragMultipleThumbnail:`Dra bilder hit for å laste dem opp eller`,dropZoneDragSingleThumbnail:`Dra et bilde hit for å laste det opp eller`,dropZoneDragActiveMultiple:`Slipp filene her`,dropZoneDragActiveSingle:`Slipp filen her`,dropZoneDragActiveMultipleThumbnail:`Slipp bildene her`,dropZoneDragActiveSingleThumbnail:`Slipp bildet her`,dropZoneOpenFileDialogMultiple:`velg filer`,dropZoneOpenFileDialogSingle:`velg en fil`,dropZoneOpenFileDialogMultipleThumbnail:`velg fra kamerarull`,dropZoneOpenFileDialogSingleThumbnail:`velg fra kamerarull`,supportedFormatsPrefix:`Format:`,invalidFormatDefault:e=>`Ugyldig filtype. Tillatte formater: ${e}`,sizeTooLargeDefault:e=>`Filen er for stor. Maks størrelse er ${e}.`,requiredMissing:`Du må laste opp minst én fil.`,genericValidationRejection:`Filen ble avvist av validering.`,unknownFilename:`Ukjent fil`,fileLabel:e=>e===1?`fil`:`filer`,srFileAdded:e=>`Filen «${e}» er lagt til`,srFilesAdded:e=>`${e} filer er lagt til`,srFilesUploadedOfTotal:(e,t,n)=>`${e} av ${t} ${n} lastet opp`,srFilesFailedOfTotal:(e,t,n)=>`Feil ved opplasting: ${e} av ${t} ${n} feilet`};function o(e){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&e>0?e:void 0;let t=String(e).trim(),n=Number(t);if(!Number.isNaN(n)&&n>0)return n;let r=t.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!r){console.warn(`PktFileUpload: Invalid maxFileSize format "${t}". Use format like "5MB", "500KB", "1GB", or bytes.`);return}let i=parseFloat(r[1]);switch(r[2].toUpperCase()){case`B`:return i;case`KB`:return i*1024;case`MB`:return i*1024*1024;case`GB`:return i*1024*1024*1024;default:return}}function s(e){return e<1024?`${Math.round(e)} B`:e<1024*1024?`${Math.round(e/1024)} KB`:e<1024*1024*1024?`${Math.round(e/(1024*1024))} MB`:`${Math.round(e/(1024*1024*1024))} GB`}function c(e){return Array.isArray(e)?e.map(e=>String(e).trim().toLowerCase()).filter(Boolean):[]}function l(e){return e?e.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean):[]}function u(e,t,n){let r=e.toLowerCase().replace(/^\./,``);if(r.includes(`/`)){if(r.endsWith(`/*`)){let e=r.replace(`/*`,``);return n.startsWith(`${e}/`)}return n===r}return t===r}function d(e,t){let n=c(t);if(n.length===0)return!0;let r=e.name.split(`.`).pop()?.toLowerCase()??``,i=e.type.toLowerCase();return n.some(e=>u(e,r,i))}function f(e,t){let n=(e??``).trim();if(n)return n;let r=c(t);return r.length===0?``:r.map(e=>e.includes(`/`)||e.startsWith(`.`)?e:`.${e}`).join(`, `)}function p(e){return e.includes(`/`)?e:e.replace(/^\./,``).toUpperCase()}function m(e,t){let n=c(e);if(n.length>0)return n.map(p).join(`, `);let r=l(t);return r.length>0?r.map(p).join(`, `):``}function h(e,t,n){return((e??``).trim()||t).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`)}function g(e,t){let n=c(t.allowedFormats);if(n.length>0&&!d(e,n)){let e=n.join(`, `),r=`Ugyldig filtype. Tillatte formater: ${e}`;return h(t.formatErrorMessage,r,{formats:e})}let r=o(t.maxFileSize);if(r!==void 0&&e.size>r){let e=s(r),n=`Filen er for stor. Maks størrelse er ${e}.`;return h(t.sizeErrorMessage,n,{maxSize:e})}if(t.onFileValidation){let n=t.onFileValidation(e);if(n)return n}return null}function _(e){let t=e.file;if(t?.type?.startsWith(`image/`))return!0;let n=e.attributes?.targetFilename||t?.name||``;return/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(n)}function v(e){return typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`}function y(e,t,n){let r={"in-progress":0,error:1,idle:2};return e.map(e=>{let r=t?.find(t=>t.fileId===e.fileId);return{...e,progress:r?.progress??(n===`form`?`done`:`queued`),errorMessage:r?.errorMessage,showProgress:r?.showProgress,lastProgress:r?.lastProgress}}).sort((e,t)=>r[v(e.progress)]-r[v(t.progress)])}function b(e){if(!e)return[];let t=[`a[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);return Array.from(e.querySelectorAll(t)).filter(e=>!e.hasAttribute(`inert`))}function x(e,t){if(e.key!==`Tab`)return!1;let n=b(t);if(n.length===0)return e.preventDefault(),!0;let r=n[0],i=n[n.length-1],a=(t?.ownerDocument??document).activeElement,o=!!a&&n.includes(a);return e.shiftKey?!o||a===r?(e.preventDefault(),i.focus(),!0):!1:!o||a===i?(e.preventDefault(),r.focus(),!0):!1}function S(e,t){return!t||t<=0||e.length<=t+3?null:{head:e.slice(0,e.length-t),tail:e.slice(-t)}}function C(e,t,n){return n<=0?0:t===`prev`?e<=0?n-1:e-1:e>=n-1?0:e+1}function w(e,t){let n=e.length;if(n===0||!t||t.length===0)return{totalCount:n,uploadedCount:0,failedCount:0};let r=0,i=0;for(let n of e){let e=t.find(e=>e.fileId===n.fileId);e?.progress===`done`?r++:e?.progress===`error`&&i++}return{totalCount:n,uploadedCount:r,failedCount:i}}function T(e,t=a.unknownFilename){return e.attributes?.targetFilename||e.file?.name||t}var E=class extends e.t{constructor(...e){super(...e),this.id=`pkt-fileupload-${i.n()}`,this.name=`files`,this.label=``,this.helptext=``,this.required=!1,this.multiple=!1,this.disabled=!1,this.fullwidth=!1,this.uploadStrategy=`form`,this.itemRenderer=`filename`,this.accept=``,this.allowedFormats=[],this.formatErrorMessage=``,this.sizeErrorMessage=``,this.transfers=[],this.addCommentsEnabled=!1,this.renameFilesEnabled=!1,this.extraOperations=[],this.enableImagePreview=!1,this.hasError=!1,this.errorMessage=``,this.optionalTag=!1,this.requiredTag=!1,this.truncateTail=4,this.files=[],this.isDragActive=!1,this.validationErrorMessage=null,this.addedAnnouncement=``,this.thumbnailUrls={},this.hasInitializedValue=!1,this.hasWarnedInvalidValueCombo=!1,this.thumbnailFileById=new Map,this.connectedForm=null,this.addedAnnouncementTimer=null,this.requiredSelectionMessage=a.requiredMissing,this.onNativeFileChange=e=>{let t=e.target;this.addFiles(t.files?Array.from(t.files):[]),this.uploadStrategy===`custom`&&(t.value=``)},this.openFileDialog=e=>{e.preventDefault(),e.stopPropagation(),!this.disabled&&this.querySelector(`#${this.id}-input`)?.click()},this.onDropZoneClick=e=>{this.disabled||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||this.querySelector(`#${this.id}-input`)?.click()},this.onDragOver=e=>{e.preventDefault(),!this.disabled&&(this.isDragActive=!0)},this.onDragLeave=()=>{this.isDragActive=!1},this.onDrop=e=>{if(e.preventDefault(),this.isDragActive=!1,this.disabled)return;let t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this.addFiles(t)},this.onHostFormSubmit=e=>{!this.required||this.uploadStrategy!==`custom`||this.getCurrentFiles().length>0||(this.validationErrorMessage=this.requiredSelectionMessage,e.preventDefault())}}get isControlled(){return this.value!==void 0}get hasEffectiveError(){return!!this.validationErrorMessage||this.hasError||!!this.errorMessage.trim()}get effectiveErrorMessage(){return this.validationErrorMessage??this.errorMessage??``}get hasValidationError(){return!!this.validationErrorMessage}firstUpdated(e){super.firstUpdated?.(e),this.hasInitializedValue||=(this.files=this.value??this.defaultValue??[],this.syncThumbnailUrls(this.files),!0),this.value!==void 0&&this.defaultValue!==void 0&&this.warnInvalidValueCombo()}willUpdate(e){super.willUpdate(e),this.hasInitializedValue&&this.isControlled&&(e.has(`value`)||e.has(`itemRenderer`)||e.has(`enableImagePreview`))&&(this.files=this.value??[],this.syncThumbnailUrls(this.files))}updated(e){super.updated(e),(e.has(`uploadStrategy`)||e.has(`required`)||e.has(`value`))&&this.syncFormSubmitListener(),this.uploadStrategy===`form`&&(e.has(`value`)||e.has(`files`)||e.has(`uploadStrategy`))&&this.syncNativeInputFiles()}syncNativeInputFiles(){let e=this.querySelector(`#${this.id}-input`);if(!(!e||typeof DataTransfer>`u`))try{let t=new DataTransfer;for(let e of this.getCurrentFiles())e.file&&t.items.add(e.file);e.files=t.files}catch{}}warnInvalidValueCombo(){this.hasWarnedInvalidValueCombo||=(console.warn(`PktFileUpload: Både value og defaultValue er angitt. Komponenten kan være enten kontrollert eller ukontrollert, ikke begge. value vil bli prioritert.`),!0)}disconnectedCallback(){this.teardownFormSubmitListener(),this.addedAnnouncementTimer&&=(clearTimeout(this.addedAnnouncementTimer),null),super.disconnectedCallback(),this.revokeAllThumbnailUrls()}setAddedAnnouncement(e){this.addedAnnouncement=e,this.addedAnnouncementTimer&&clearTimeout(this.addedAnnouncementTimer),this.addedAnnouncementTimer=setTimeout(()=>{this.addedAnnouncement=``,this.addedAnnouncementTimer=null},1500)}connectedCallback(){super.connectedCallback(),this.syncFormSubmitListener()}addFiles(e){if(e.length===0)return;let t=this.multiple?e:[e[0]];for(let e of t){let t=this.validateFile(e);if(t){this.validationErrorMessage=t;return}}this.validationErrorMessage=null;let n=t.map(e=>({fileId:i.n(),file:e,attributes:{targetFilename:e.name}}));this.setAddedAnnouncement(n.length===1?a.srFileAdded(n[0].attributes.targetFilename):a.srFilesAdded(n.length));let r=this.getCurrentFiles(),o=this.multiple?[...r,...n]:[n[0]];this.commitFiles(o,`add`,n.map(e=>e.fileId)),this.uploadStrategy===`custom`&&n.forEach(e=>{this.dispatchEvent(new CustomEvent(`file-upload-requested`,{detail:{fileId:e.fileId,file:e.file,attributes:e.attributes},bubbles:!0,composed:!0}))})}getCurrentFiles(){return this.isControlled?this.value??[]:this.files}cancelTransfer(e){if(this.disabled)return;let t=this.getCurrentFiles().find(t=>t.fileId===e);t&&(this.removeFileItem(e),this.dispatchEvent(new CustomEvent(`transfer-cancelled`,{detail:{fileId:t.fileId,file:t.file,attributes:t.attributes},bubbles:!0,composed:!0})))}removeFileItem(e){if(this.disabled)return;let t=this.getCurrentFiles(),n=t.filter(t=>t.fileId!==e);n.length!==t.length&&this.commitFiles(n,`remove`,[e])}updateFileItem(e,t){let n=this.getCurrentFiles().map(n=>n.fileId===e?{...n,...t}:n);this.commitFiles(n,`update`,[e])}commitFiles(e,t,n){this.isControlled||(this.files=e,this.syncThumbnailUrls(e)),this.validationErrorMessage===this.requiredSelectionMessage&&e.length>0&&(this.validationErrorMessage=null),this.dispatchEvent(new CustomEvent(`files-changed`,{detail:{files:e,reason:t,changedFileIds:n},bubbles:!0,composed:!0}))}getThumbnailUrl(e){return this.thumbnailUrls[e.fileId]}getTransferProgress(e){let t=this.transfers.find(t=>t.fileId===e);return t?t.progress:this.uploadStrategy===`form`?`done`:`queued`}getTransferForFile(e){return this.transfers.find(t=>t.fileId===e)}isImageFile(e){return _(e)}formatFileSize(e){return s(e)}getResolvedAcceptValue(){return f(this.accept,this.allowedFormats)}getSupportedFormatsText(){return m(this.allowedFormats,this.accept)}getSortedFilesAndTransfers(){return y(this.getCurrentFiles(),this.transfers,this.uploadStrategy)}validateFile(e){let t=g(e,{allowedFormats:this.allowedFormats,maxFileSize:this.maxFileSize,formatErrorMessage:this.formatErrorMessage,sizeErrorMessage:this.sizeErrorMessage,onFileValidation:this.onFileValidation});if(t)return t;let n={file:e,errorMessage:null},r=new CustomEvent(`file-validate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r),n.errorMessage?n.errorMessage:r.defaultPrevented?a.genericValidationRejection:null}syncThumbnailUrls(e){if(!(typeof URL<`u`&&typeof URL.createObjectURL==`function`&&typeof URL.revokeObjectURL==`function`)){this.thumbnailUrls={},this.thumbnailFileById.clear();return}let t=new Set(e.map(e=>e.fileId)),n={};for(let[e,n]of Object.entries(this.thumbnailUrls))t.has(e)||(URL.revokeObjectURL(n),this.thumbnailFileById.delete(e));for(let t of e){let e=this.thumbnailUrls[t.fileId],r=this.thumbnailFileById.get(t.fileId);if(!t.file||!this.isImageFile(t)){e&&(URL.revokeObjectURL(e),this.thumbnailFileById.delete(t.fileId));continue}if(e&&r===t.file){n[t.fileId]=e;continue}e&&r!==t.file&&URL.revokeObjectURL(e);let i=URL.createObjectURL(t.file);this.thumbnailFileById.set(t.fileId,t.file),n[t.fileId]=i}this.thumbnailUrls=n}revokeAllThumbnailUrls(){if(typeof URL>`u`||typeof URL.revokeObjectURL!=`function`){this.thumbnailUrls={},this.thumbnailFileById.clear();return}Object.values(this.thumbnailUrls).forEach(e=>URL.revokeObjectURL(e)),this.thumbnailUrls={},this.thumbnailFileById.clear()}getSrUploadedMessage(){if(this.addedAnnouncement)return this.addedAnnouncement;let{totalCount:e,uploadedCount:t}=w(this.getCurrentFiles(),this.transfers);return e===0||t===0?``:a.srFilesUploadedOfTotal(t,e,a.fileLabel(e))}getSrErrorsMessage(){let{totalCount:e,failedCount:t}=w(this.getCurrentFiles(),this.transfers);return e===0||t===0?``:a.srFilesFailedOfTotal(t,e,a.fileLabel(e))}syncFormSubmitListener(){let e=this.closest(`form`);this.connectedForm!==e&&(this.teardownFormSubmitListener(),this.connectedForm=e,this.connectedForm&&this.connectedForm.addEventListener(`submit`,this.onHostFormSubmit))}teardownFormSubmitListener(){this.connectedForm&&=(this.connectedForm.removeEventListener(`submit`,this.onHostFormSubmit),null)}};e.n([e.o({type:String})],E.prototype,`id`,void 0),e.n([e.o({type:String})],E.prototype,`name`,void 0),e.n([e.o({type:String})],E.prototype,`label`,void 0),e.n([e.o({type:String})],E.prototype,`helptext`,void 0),e.n([e.o({type:Boolean,reflect:!0})],E.prototype,`required`,void 0),e.n([e.o({type:Boolean,reflect:!0})],E.prototype,`multiple`,void 0),e.n([e.o({type:Boolean,reflect:!0})],E.prototype,`disabled`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`fullwidth`})],E.prototype,`fullwidth`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`upload-strategy`})],E.prototype,`uploadStrategy`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`item-renderer`})],E.prototype,`itemRenderer`,void 0),e.n([e.o({type:String})],E.prototype,`accept`,void 0),e.n([e.o({converter:r.t.csvToArray,attribute:`allowed-formats`})],E.prototype,`allowedFormats`,void 0),e.n([e.o({type:String,attribute:`format-error-message`})],E.prototype,`formatErrorMessage`,void 0),e.n([e.o({attribute:`max-file-size`})],E.prototype,`maxFileSize`,void 0),e.n([e.o({type:String,attribute:`size-error-message`})],E.prototype,`sizeErrorMessage`,void 0),e.n([e.o({attribute:!1})],E.prototype,`onFileValidation`,void 0),e.n([e.o({attribute:!1})],E.prototype,`transfers`,void 0),e.n([e.o({type:Boolean,attribute:`add-comments-enabled`})],E.prototype,`addCommentsEnabled`,void 0),e.n([e.o({type:Boolean,attribute:`rename-files-enabled`})],E.prototype,`renameFilesEnabled`,void 0),e.n([e.o({attribute:!1})],E.prototype,`extraOperations`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`enable-image-preview`})],E.prototype,`enableImagePreview`,void 0),e.n([e.o({type:Boolean,attribute:`has-error`})],E.prototype,`hasError`,void 0),e.n([e.o({type:String,attribute:`error-message`})],E.prototype,`errorMessage`,void 0),e.n([e.o({type:Boolean,attribute:`optional-tag`})],E.prototype,`optionalTag`,void 0),e.n([e.o({type:Boolean,attribute:`required-tag`})],E.prototype,`requiredTag`,void 0),e.n([e.o({type:Number,attribute:`truncate-tail`})],E.prototype,`truncateTail`,void 0),e.n([e.o({attribute:!1})],E.prototype,`value`,void 0),e.n([e.o({attribute:!1})],E.prototype,`defaultValue`,void 0),e.n([e.a()],E.prototype,`files`,void 0),e.n([e.a()],E.prototype,`isDragActive`,void 0),e.n([e.a()],E.prototype,`validationErrorMessage`,void 0),e.n([e.a()],E.prototype,`addedAnnouncement`,void 0),e.n([e.a()],E.prototype,`thumbnailUrls`,void 0);var D=`comments`,O=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:`${String(t.getDate()).padStart(2,`0`)}.${String(t.getMonth()+1).padStart(2,`0`)}.${t.getFullYear()} kl. ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`},k=(e,t,n)=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t()),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n())},A=(e,t,n)=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},j=e=>({id:`remove`,title:`Slett`,ariaLabel:`Slett fil`,onClick:({file:t})=>e(t.fileId)}),M=()=>({id:`rename`,title:`Rediger`,ariaLabel:`Rediger filnavn`,renderInlineUI:t=>{let n=t.getAttribute(`targetFilename`)||t.file.attributes?.targetFilename||t.file.file?.name||``,r=`pkt-fileupload-rename-${t.file.fileId}`,i=()=>{let e=document.getElementById(r)?.value?.trim();e&&t.setAttribute(`targetFilename`,e),t.close()};return e.p`
1
+ const e=require("./element-DJzurxgt.cjs"),t=require("./class-map-CCZN5uS3.cjs");require("./alert-B8dLsiTz.cjs"),require("./icon-B8PVq2O6.cjs");const n=require("./if-defined-DrwbxQOj.cjs"),r=require("./converters-9jHlXDyy.cjs"),i=require("./utils-63cRpWut.cjs");require("./input-wrapper-BRjQB4zM.cjs"),require("./modal-DKU7PnjJ.cjs"),require("./progressbar-BN5y20CC.cjs");var a={dropZoneDragMultiple:`Dra filer hit for å laste dem opp eller`,dropZoneDragSingle:`Dra en fil hit for å laste den opp eller`,dropZoneDragMultipleThumbnail:`Dra bilder hit for å laste dem opp eller`,dropZoneDragSingleThumbnail:`Dra et bilde hit for å laste det opp eller`,dropZoneDragActiveMultiple:`Slipp filene her`,dropZoneDragActiveSingle:`Slipp filen her`,dropZoneDragActiveMultipleThumbnail:`Slipp bildene her`,dropZoneDragActiveSingleThumbnail:`Slipp bildet her`,dropZoneOpenFileDialogMultiple:`velg filer`,dropZoneOpenFileDialogSingle:`velg en fil`,dropZoneOpenFileDialogMultipleThumbnail:`velg fra kamerarull`,dropZoneOpenFileDialogSingleThumbnail:`velg fra kamerarull`,supportedFormatsPrefix:`Format:`,invalidFormatDefault:e=>`Ugyldig filtype. Tillatte formater: ${e}`,sizeTooLargeDefault:e=>`Filen er for stor. Maks størrelse er ${e}.`,requiredMissing:`Du må laste opp minst én fil.`,genericValidationRejection:`Filen ble avvist av validering.`,unknownFilename:`Ukjent fil`,fileLabel:e=>e===1?`fil`:`filer`,srFileAdded:e=>`Filen «${e}» er lagt til`,srFilesAdded:e=>`${e} filer er lagt til`,srFilesUploadedOfTotal:(e,t,n)=>`${e} av ${t} ${n} lastet opp`,srFilesFailedOfTotal:(e,t,n)=>`Feil ved opplasting: ${e} av ${t} ${n} feilet`};function o(e){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&e>0?e:void 0;let t=String(e).trim(),n=Number(t);if(!Number.isNaN(n)&&n>0)return n;let r=t.match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!r){console.warn(`PktFileUpload: Invalid maxFileSize format "${t}". Use format like "5MB", "500KB", "1GB", or bytes.`);return}let i=parseFloat(r[1]);switch(r[2].toUpperCase()){case`B`:return i;case`KB`:return i*1024;case`MB`:return i*1024*1024;case`GB`:return i*1024*1024*1024;default:return}}function s(e){return e<1024?`${Math.round(e)} B`:e<1024*1024?`${Math.round(e/1024)} KB`:e<1024*1024*1024?`${Math.round(e/(1024*1024))} MB`:`${Math.round(e/(1024*1024*1024))} GB`}function c(e){return Array.isArray(e)?e.map(e=>String(e).trim().toLowerCase()).filter(Boolean):[]}function l(e){return e?e.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean):[]}function u(e,t,n){let r=e.toLowerCase().replace(/^\./,``);if(r.includes(`/`)){if(r.endsWith(`/*`)){let e=r.replace(`/*`,``);return n.startsWith(`${e}/`)}return n===r}return t===r}function d(e,t){let n=c(t);if(n.length===0)return!0;let r=e.name.split(`.`).pop()?.toLowerCase()??``,i=e.type.toLowerCase();return n.some(e=>u(e,r,i))}function f(e,t){let n=(e??``).trim();if(n)return n;let r=c(t);return r.length===0?``:r.map(e=>e.includes(`/`)||e.startsWith(`.`)?e:`.${e}`).join(`, `)}function p(e){return e.includes(`/`)?e:e.replace(/^\./,``).toUpperCase()}function m(e,t){let n=c(e);if(n.length>0)return n.map(p).join(`, `);let r=l(t);return r.length>0?r.map(p).join(`, `):``}function h(e,t,n){return((e??``).trim()||t).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`)}function g(e,t){let n=c(t.allowedFormats);if(n.length>0&&!d(e,n)){let e=n.join(`, `),r=`Ugyldig filtype. Tillatte formater: ${e}`;return h(t.formatErrorMessage,r,{formats:e})}let r=o(t.maxFileSize);if(r!==void 0&&e.size>r){let e=s(r),n=`Filen er for stor. Maks størrelse er ${e}.`;return h(t.sizeErrorMessage,n,{maxSize:e})}if(t.onFileValidation){let n=t.onFileValidation(e);if(n)return n}return null}function _(e){let t=e.file;if(t?.type?.startsWith(`image/`))return!0;let n=e.attributes?.targetFilename||t?.name||``;return/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(n)}function v(e){return typeof e==`number`?`in-progress`:e===`error`?`error`:`idle`}function y(e,t,n){let r={"in-progress":0,error:1,idle:2};return e.map(e=>{let r=t?.find(t=>t.fileId===e.fileId);return{...e,progress:r?.progress??(n===`form`?`done`:`queued`),errorMessage:r?.errorMessage,showProgress:r?.showProgress,lastProgress:r?.lastProgress}}).sort((e,t)=>r[v(e.progress)]-r[v(t.progress)])}function b(e){if(!e)return[];let t=[`a[href]:not([tabindex="-1"])`,`button:not([disabled]):not([tabindex="-1"])`,`input:not([disabled]):not([type="hidden"]):not([tabindex="-1"])`,`select:not([disabled]):not([tabindex="-1"])`,`textarea:not([disabled]):not([tabindex="-1"])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);return Array.from(e.querySelectorAll(t)).filter(e=>!e.hasAttribute(`inert`))}function x(e,t){if(e.key!==`Tab`)return!1;let n=b(t);if(n.length===0)return e.preventDefault(),!0;let r=n[0],i=n[n.length-1],a=(t?.ownerDocument??document).activeElement,o=!!a&&n.includes(a);return e.shiftKey?!o||a===r?(e.preventDefault(),i.focus(),!0):!1:!o||a===i?(e.preventDefault(),r.focus(),!0):!1}function S(e,t){return!t||t<=0||e.length<=t+3?null:{head:e.slice(0,e.length-t),tail:e.slice(-t)}}function C(e,t,n){return n<=0?0:t===`prev`?e<=0?n-1:e-1:e>=n-1?0:e+1}function w(e,t){let n=e.length;if(n===0||!t||t.length===0)return{totalCount:n,uploadedCount:0,failedCount:0};let r=0,i=0;for(let n of e){let e=t.find(e=>e.fileId===n.fileId);e?.progress===`done`?r++:e?.progress===`error`&&i++}return{totalCount:n,uploadedCount:r,failedCount:i}}function T(e,t=a.unknownFilename){return e.attributes?.targetFilename||e.file?.name||t}var E=class extends e.t{constructor(...e){super(...e),this.id=`pkt-fileupload-${i.n()}`,this.name=`files`,this.label=``,this.helptext=``,this.required=!1,this.multiple=!1,this.disabled=!1,this.fullwidth=!1,this.uploadStrategy=`form`,this.itemRenderer=`filename`,this.accept=``,this.allowedFormats=[],this.formatErrorMessage=``,this.sizeErrorMessage=``,this.transfers=[],this.addCommentsEnabled=!1,this.renameFilesEnabled=!1,this.extraOperations=[],this.enableImagePreview=!1,this.hasError=!1,this.errorMessage=``,this.optionalTag=!1,this.requiredTag=!1,this.truncateTail=4,this.files=[],this.isDragActive=!1,this.validationErrorMessage=null,this.addedAnnouncement=``,this.thumbnailUrls={},this.hasInitializedValue=!1,this.hasWarnedInvalidValueCombo=!1,this.thumbnailFileById=new Map,this.connectedForm=null,this.addedAnnouncementTimer=null,this.requiredSelectionMessage=a.requiredMissing,this.onNativeFileChange=e=>{let t=e.target;this.addFiles(t.files?Array.from(t.files):[]),this.uploadStrategy===`custom`&&(t.value=``)},this.openFileDialog=e=>{e.preventDefault(),e.stopPropagation(),!this.disabled&&this.querySelector(`#${this.id}-input`)?.click()},this.onDropZoneClick=e=>{this.disabled||e.target.closest(`.pkt-fileupload__drop-zone__placeholder__title__open-file-dialog`)||this.querySelector(`#${this.id}-input`)?.click()},this.onDragOver=e=>{e.preventDefault(),!this.disabled&&(this.isDragActive=!0)},this.onDragLeave=()=>{this.isDragActive=!1},this.onDrop=e=>{if(e.preventDefault(),this.isDragActive=!1,this.disabled)return;let t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this.addFiles(t)},this.onHostFormSubmit=e=>{!this.required||this.uploadStrategy!==`custom`||this.getCurrentFiles().length>0||(this.validationErrorMessage=this.requiredSelectionMessage,e.preventDefault())}}get isControlled(){return this.value!==void 0}get hasEffectiveError(){return!!this.validationErrorMessage||this.hasError||!!this.errorMessage.trim()}get effectiveErrorMessage(){return this.validationErrorMessage??this.errorMessage??``}get hasValidationError(){return!!this.validationErrorMessage}firstUpdated(e){super.firstUpdated?.(e),this.hasInitializedValue||=(this.files=this.value??this.defaultValue??[],this.syncThumbnailUrls(this.files),!0),this.value!==void 0&&this.defaultValue!==void 0&&this.warnInvalidValueCombo()}willUpdate(e){super.willUpdate(e),this.hasInitializedValue&&this.isControlled&&(e.has(`value`)||e.has(`itemRenderer`)||e.has(`enableImagePreview`))&&(this.files=this.value??[],this.syncThumbnailUrls(this.files))}updated(e){super.updated(e),(e.has(`uploadStrategy`)||e.has(`required`)||e.has(`value`))&&this.syncFormSubmitListener(),this.uploadStrategy===`form`&&(e.has(`value`)||e.has(`files`)||e.has(`uploadStrategy`))&&this.syncNativeInputFiles()}syncNativeInputFiles(){let e=this.querySelector(`#${this.id}-input`);if(!(!e||typeof DataTransfer>`u`))try{let t=new DataTransfer;for(let e of this.getCurrentFiles())e.file&&t.items.add(e.file);e.files=t.files}catch{}}warnInvalidValueCombo(){this.hasWarnedInvalidValueCombo||=(console.warn(`PktFileUpload: Både value og defaultValue er angitt. Komponenten kan være enten kontrollert eller ukontrollert, ikke begge. value vil bli prioritert.`),!0)}disconnectedCallback(){this.teardownFormSubmitListener(),this.addedAnnouncementTimer&&=(clearTimeout(this.addedAnnouncementTimer),null),super.disconnectedCallback(),this.revokeAllThumbnailUrls()}setAddedAnnouncement(e){this.addedAnnouncement=e,this.addedAnnouncementTimer&&clearTimeout(this.addedAnnouncementTimer),this.addedAnnouncementTimer=setTimeout(()=>{this.addedAnnouncement=``,this.addedAnnouncementTimer=null},1500)}connectedCallback(){super.connectedCallback(),this.syncFormSubmitListener()}addFiles(e){if(e.length===0)return;let t=this.multiple?e:[e[0]];for(let e of t){let t=this.validateFile(e);if(t){this.validationErrorMessage=t;return}}this.validationErrorMessage=null;let n=t.map(e=>({fileId:i.n(),file:e,attributes:{targetFilename:e.name}}));this.setAddedAnnouncement(n.length===1?a.srFileAdded(n[0].attributes.targetFilename):a.srFilesAdded(n.length));let r=this.getCurrentFiles(),o=this.multiple?[...r,...n]:[n[0]];this.commitFiles(o,`add`,n.map(e=>e.fileId)),this.uploadStrategy===`custom`&&n.forEach(e=>{this.dispatchEvent(new CustomEvent(`file-upload-requested`,{detail:{fileId:e.fileId,file:e.file,attributes:e.attributes},bubbles:!0,composed:!0}))})}getCurrentFiles(){return this.isControlled?this.value??[]:this.files}cancelTransfer(e){if(this.disabled)return;let t=this.getCurrentFiles().find(t=>t.fileId===e);t&&(this.removeFileItem(e),this.dispatchEvent(new CustomEvent(`transfer-cancelled`,{detail:{fileId:t.fileId,file:t.file,attributes:t.attributes},bubbles:!0,composed:!0})))}removeFileItem(e){if(this.disabled)return;let t=this.getCurrentFiles(),n=t.filter(t=>t.fileId!==e);n.length!==t.length&&this.commitFiles(n,`remove`,[e])}updateFileItem(e,t){let n=this.getCurrentFiles().map(n=>n.fileId===e?{...n,...t}:n);this.commitFiles(n,`update`,[e])}commitFiles(e,t,n){this.isControlled||(this.files=e,this.syncThumbnailUrls(e)),this.validationErrorMessage===this.requiredSelectionMessage&&e.length>0&&(this.validationErrorMessage=null),this.dispatchEvent(new CustomEvent(`files-changed`,{detail:{files:e,reason:t,changedFileIds:n},bubbles:!0,composed:!0}))}getThumbnailUrl(e){return this.thumbnailUrls[e.fileId]}getTransferProgress(e){let t=this.transfers.find(t=>t.fileId===e);return t?t.progress:this.uploadStrategy===`form`?`done`:`queued`}getTransferForFile(e){return this.transfers.find(t=>t.fileId===e)}isImageFile(e){return _(e)}formatFileSize(e){return s(e)}getResolvedAcceptValue(){return f(this.accept,this.allowedFormats)}getSupportedFormatsText(){return m(this.allowedFormats,this.accept)}getSortedFilesAndTransfers(){return y(this.getCurrentFiles(),this.transfers,this.uploadStrategy)}validateFile(e){let t=g(e,{allowedFormats:this.allowedFormats,maxFileSize:this.maxFileSize,formatErrorMessage:this.formatErrorMessage,sizeErrorMessage:this.sizeErrorMessage,onFileValidation:this.onFileValidation});if(t)return t;let n={file:e,errorMessage:null},r=new CustomEvent(`file-validate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r),n.errorMessage?n.errorMessage:r.defaultPrevented?a.genericValidationRejection:null}syncThumbnailUrls(e){if(!(typeof URL<`u`&&typeof URL.createObjectURL==`function`&&typeof URL.revokeObjectURL==`function`)){this.thumbnailUrls={},this.thumbnailFileById.clear();return}let t=new Set(e.map(e=>e.fileId)),n={};for(let[e,n]of Object.entries(this.thumbnailUrls))t.has(e)||(URL.revokeObjectURL(n),this.thumbnailFileById.delete(e));for(let t of e){let e=this.thumbnailUrls[t.fileId],r=this.thumbnailFileById.get(t.fileId);if(!t.file||!this.isImageFile(t)){e&&(URL.revokeObjectURL(e),this.thumbnailFileById.delete(t.fileId));continue}if(e&&r===t.file){n[t.fileId]=e;continue}e&&r!==t.file&&URL.revokeObjectURL(e);let i=URL.createObjectURL(t.file);this.thumbnailFileById.set(t.fileId,t.file),n[t.fileId]=i}this.thumbnailUrls=n}revokeAllThumbnailUrls(){if(typeof URL>`u`||typeof URL.revokeObjectURL!=`function`){this.thumbnailUrls={},this.thumbnailFileById.clear();return}Object.values(this.thumbnailUrls).forEach(e=>URL.revokeObjectURL(e)),this.thumbnailUrls={},this.thumbnailFileById.clear()}getSrUploadedMessage(){if(this.addedAnnouncement)return this.addedAnnouncement;let{totalCount:e,uploadedCount:t}=w(this.getCurrentFiles(),this.transfers);return e===0||t===0?``:a.srFilesUploadedOfTotal(t,e,a.fileLabel(e))}getSrErrorsMessage(){let{totalCount:e,failedCount:t}=w(this.getCurrentFiles(),this.transfers);return e===0||t===0?``:a.srFilesFailedOfTotal(t,e,a.fileLabel(e))}syncFormSubmitListener(){let e=this.closest(`form`);this.connectedForm!==e&&(this.teardownFormSubmitListener(),this.connectedForm=e,this.connectedForm&&this.connectedForm.addEventListener(`submit`,this.onHostFormSubmit))}teardownFormSubmitListener(){this.connectedForm&&=(this.connectedForm.removeEventListener(`submit`,this.onHostFormSubmit),null)}};e.n([e.o({type:String})],E.prototype,`id`,void 0),e.n([e.o({type:String})],E.prototype,`name`,void 0),e.n([e.o({type:String})],E.prototype,`label`,void 0),e.n([e.o({type:String})],E.prototype,`helptext`,void 0),e.n([e.o({type:Boolean,reflect:!0})],E.prototype,`required`,void 0),e.n([e.o({type:Boolean,reflect:!0})],E.prototype,`multiple`,void 0),e.n([e.o({type:Boolean,reflect:!0})],E.prototype,`disabled`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`fullwidth`})],E.prototype,`fullwidth`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`upload-strategy`})],E.prototype,`uploadStrategy`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`item-renderer`})],E.prototype,`itemRenderer`,void 0),e.n([e.o({type:String})],E.prototype,`accept`,void 0),e.n([e.o({converter:r.t.csvToArray,attribute:`allowed-formats`})],E.prototype,`allowedFormats`,void 0),e.n([e.o({type:String,attribute:`format-error-message`})],E.prototype,`formatErrorMessage`,void 0),e.n([e.o({attribute:`max-file-size`})],E.prototype,`maxFileSize`,void 0),e.n([e.o({type:String,attribute:`size-error-message`})],E.prototype,`sizeErrorMessage`,void 0),e.n([e.o({attribute:!1})],E.prototype,`onFileValidation`,void 0),e.n([e.o({attribute:!1})],E.prototype,`transfers`,void 0),e.n([e.o({type:Boolean,attribute:`add-comments-enabled`})],E.prototype,`addCommentsEnabled`,void 0),e.n([e.o({type:Boolean,attribute:`rename-files-enabled`})],E.prototype,`renameFilesEnabled`,void 0),e.n([e.o({attribute:!1})],E.prototype,`extraOperations`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`enable-image-preview`})],E.prototype,`enableImagePreview`,void 0),e.n([e.o({type:Boolean,attribute:`has-error`})],E.prototype,`hasError`,void 0),e.n([e.o({type:String,attribute:`error-message`})],E.prototype,`errorMessage`,void 0),e.n([e.o({type:Boolean,attribute:`optional-tag`})],E.prototype,`optionalTag`,void 0),e.n([e.o({type:Boolean,attribute:`required-tag`})],E.prototype,`requiredTag`,void 0),e.n([e.o({type:Number,attribute:`truncate-tail`})],E.prototype,`truncateTail`,void 0),e.n([e.o({attribute:!1})],E.prototype,`value`,void 0),e.n([e.o({attribute:!1})],E.prototype,`defaultValue`,void 0),e.n([e.a()],E.prototype,`files`,void 0),e.n([e.a()],E.prototype,`isDragActive`,void 0),e.n([e.a()],E.prototype,`validationErrorMessage`,void 0),e.n([e.a()],E.prototype,`addedAnnouncement`,void 0),e.n([e.a()],E.prototype,`thumbnailUrls`,void 0);var D=`comments`,O=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:`${String(t.getDate()).padStart(2,`0`)}.${String(t.getMonth()+1).padStart(2,`0`)}.${t.getFullYear()} kl. ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`},k=(e,t,n)=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t()),e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n())},A=(e,t,n)=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},j=e=>({id:`remove`,title:`Slett`,ariaLabel:`Slett fil`,onClick:({file:t})=>e(t.fileId)}),M=()=>({id:`rename`,title:`Rediger`,ariaLabel:`Rediger filnavn`,renderInlineUI:t=>{let n=t.getAttribute(`targetFilename`)||t.file.attributes?.targetFilename||t.file.file?.name||``,r=`pkt-fileupload-rename-${t.file.fileId}`,i=()=>{let e=document.getElementById(r)?.value?.trim();e&&t.setAttribute(`targetFilename`,e),t.close()};return e.p`
2
2
  <label for=${r} class="pkt-sr-only">Endre filnavn</label>
3
3
  <input
4
4
  id=${r}
@@ -393,4 +393,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);
393
393
  </button>`:null}
394
394
  </div>
395
395
  </pkt-modal>
396
- `}getQueueItemOperations(){let e=[];return this.renameFilesEnabled&&this.itemRenderer!==`thumbnail`&&e.push(M()),this.addCommentsEnabled&&this.itemRenderer!==`thumbnail`&&e.push(N()),e.push(...this.extraOperations),e.push(j(e=>this.removeFileItem(e))),e}activateOperation(e,t){this.activeOperationByFileId={...this.activeOperationByFileId,[e]:t}}closeOperation(e){this.activeOperationByFileId={...this.activeOperationByFileId,[e]:void 0}}getFileAttribute(e,t){let n=this.getCurrentFiles().find(t=>t.fileId===e);if(n)return n.attributes?.[t]??void 0}setFileAttribute(e,t,n){let r=this.getCurrentFiles().find(t=>t.fileId===e);if(!r)return;let i={...r.attributes,[t]:n};n===void 0&&delete i[t],this.updateFileItem(e,{attributes:i})}};e.n([e.a()],Y.prototype,`activeOperationByFileId`,void 0),e.n([e.a()],Y.prototype,`isPreviewModalOpen`,void 0),e.n([e.a()],Y.prototype,`previewCurrentIndex`,void 0),e.n([e.a()],Y.prototype,`failedImageFileIds`,void 0),Y=e.n([e.s(`pkt-fileupload`)],Y);var X=Y;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return X}});
396
+ `}getQueueItemOperations(){let e=[];return this.renameFilesEnabled&&this.itemRenderer!==`thumbnail`&&e.push(M()),this.addCommentsEnabled&&this.itemRenderer!==`thumbnail`&&e.push(N()),e.push(...this.extraOperations),e.push(j(e=>this.removeFileItem(e))),e}activateOperation(e,t){this.activeOperationByFileId={...this.activeOperationByFileId,[e]:t}}closeOperation(e){this.activeOperationByFileId={...this.activeOperationByFileId,[e]:void 0}}getFileAttribute(e,t){let n=this.getCurrentFiles().find(t=>t.fileId===e);if(n)return n.attributes?.[t]??void 0}setFileAttribute(e,t,n){let r=this.getCurrentFiles().find(t=>t.fileId===e);if(!r)return;let i={...r.attributes,[t]:n};n===void 0&&delete i[t],this.updateFileItem(e,{attributes:i})}};e.n([e.a()],Y.prototype,`activeOperationByFileId`,void 0),e.n([e.a()],Y.prototype,`isPreviewModalOpen`,void 0),e.n([e.a()],Y.prototype,`previewCurrentIndex`,void 0),e.n([e.a()],Y.prototype,`failedImageFileIds`,void 0),Y=e.n([e.s(`pkt-fileupload`)],Y);var X=Y;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return X}});
@@ -1,13 +1,13 @@
1
- import { a as e, n as t, o as n, p as r, s as i, t as a } from "./element-CduG0XyF.js";
2
- import { t as o } from "./class-map-DH9hlJny.js";
3
- import "./alert-B5Y841vH.js";
4
- import "./icon-LaKyBKON.js";
5
- import { t as s } from "./if-defined-VShASPdu.js";
6
- import { t as c } from "./converters-BQnj7OJE.js";
7
- import { n as l } from "./utils-CUqCKGvp.js";
8
- import "./input-wrapper-C93MmOIg.js";
9
- import "./modal-CWgeT-RP.js";
10
- import "./progressbar-B0P_vmGD.js";
1
+ import { a as e, n as t, o as n, p as r, s as i, t as a } from "./element-BoJrqauR.js";
2
+ import { t as o } from "./class-map-CAQCRB1W.js";
3
+ import "./alert-HHTGY0sp.js";
4
+ import "./icon-DGFEIlco.js";
5
+ import { t as s } from "./if-defined-D0bnetLJ.js";
6
+ import { t as c } from "./converters-BKGBRBpS.js";
7
+ import { n as l } from "./utils-BwF4QSrq.js";
8
+ import "./input-wrapper-DaA98B5l.js";
9
+ import "./modal-C6pScpdG.js";
10
+ import "./progressbar-mtjtbpCO.js";
11
11
  //#region ../../shared-types/fileupload.ts
12
12
  var u = {
13
13
  dropZoneDragMultiple: "Dra filer hit for å laste dem opp eller",
@@ -1 +1 @@
1
- var e=class{constructor(e,t=null){this.pointerJustUsed=!1,this.handlePointerDown=()=>{this.pointerJustUsed=!0,this.pointerTimeoutId!==void 0&&clearTimeout(this.pointerTimeoutId),this.pointerTimeoutId=window.setTimeout(()=>{this.pointerJustUsed=!1,this.pointerTimeoutId=void 0},0)},this.handleFocusIn=()=>{this.setNavtype(this.pointerJustUsed?`pointer`:void 0)},this.handleFocusOut=e=>{this.host.contains(e.relatedTarget)||this.setNavtype(void 0)},this.host=e,this.targetSelector=t,e.addController(this)}hostConnected(){this.host.addEventListener(`pointerdown`,this.handlePointerDown,!0),this.host.addEventListener(`focusin`,this.handleFocusIn),this.host.addEventListener(`focusout`,this.handleFocusOut)}hostDisconnected(){this.host.removeEventListener(`pointerdown`,this.handlePointerDown,!0),this.host.removeEventListener(`focusin`,this.handleFocusIn),this.host.removeEventListener(`focusout`,this.handleFocusOut),this.pointerTimeoutId!==void 0&&(clearTimeout(this.pointerTimeoutId),this.pointerTimeoutId=void 0)}getTarget(){return this.targetSelector===null?this.host:this.host.querySelector(this.targetSelector)}setNavtype(e){let t=this.getTarget();t&&(e===void 0?delete t.dataset.navtype:t.dataset.navtype=e)}};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
1
+ var e=class{constructor(e,t=null){this.pointerJustUsed=!1,this.handlePointerDown=()=>{this.pointerJustUsed=!0,this.pointerTimeoutId!==void 0&&clearTimeout(this.pointerTimeoutId),this.pointerTimeoutId=window.setTimeout(()=>{this.pointerJustUsed=!1,this.pointerTimeoutId=void 0},0)},this.handleFocusIn=()=>{this.setNavtype(this.pointerJustUsed?`pointer`:void 0)},this.handleFocusOut=e=>{this.host.contains(e.relatedTarget)||this.setNavtype(void 0)},this.host=e,this.targetSelector=t,e.addController(this)}hostConnected(){this.host.addEventListener(`pointerdown`,this.handlePointerDown,!0),this.host.addEventListener(`focusin`,this.handleFocusIn),this.host.addEventListener(`focusout`,this.handleFocusOut)}hostDisconnected(){this.host.removeEventListener(`pointerdown`,this.handlePointerDown,!0),this.host.removeEventListener(`focusin`,this.handleFocusIn),this.host.removeEventListener(`focusout`,this.handleFocusOut),this.pointerTimeoutId!==void 0&&(clearTimeout(this.pointerTimeoutId),this.pointerTimeoutId=void 0)}getTarget(){return this.targetSelector===null?this.host:this.host.querySelector(this.targetSelector)}setNavtype(e){let t=this.getTarget();t&&(e===void 0?delete t.dataset.navtype:t.dataset.navtype=e)}};Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
@@ -1,13 +1,13 @@
1
- import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-CduG0XyF.js";
2
- import { t as s } from "./class-map-DH9hlJny.js";
3
- import { n as c, t as l } from "./element-with-slot-BVj9MXzi.js";
4
- import "./icon-LaKyBKON.js";
5
- import { t as u } from "./if-defined-VShASPdu.js";
6
- import "./button-CAZEaEW9.js";
7
- import { n as d, t as f } from "./ref-BgoHEsEt.js";
8
- import { t as p } from "./booleanish-BmcOU-43.js";
9
- import "./link-DauiNRMq.js";
10
- import "./textinput-Bs8DwHwR.js";
1
+ import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-BoJrqauR.js";
2
+ import { t as s } from "./class-map-CAQCRB1W.js";
3
+ import { n as c, t as l } from "./element-with-slot-mXLg8gg8.js";
4
+ import "./icon-DGFEIlco.js";
5
+ import { t as u } from "./if-defined-D0bnetLJ.js";
6
+ import "./button-C_YzTSuU.js";
7
+ import { n as d, t as f } from "./ref-WGS0u7i2.js";
8
+ import { t as p } from "./booleanish-MfutDT_4.js";
9
+ import "./link-FmkQvSQL.js";
10
+ import "./textinput-D-gsl53I.js";
11
11
  //#region ../../shared-types/header.ts
12
12
  var m = (e) => typeof e.target == "string" ? {
13
13
  title: e.title,
@@ -1,4 +1,4 @@
1
- const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),n=require(`./element-with-slot-Cmxb9h4H.cjs`);require(`./icon-Dw6I0HDV.cjs`);const r=require(`./if-defined-LTjAScFG.cjs`);require(`./button-Bqk9wjme.cjs`);const i=require(`./ref-CBdWMlde.cjs`),a=require(`./booleanish-jJLlnr6-.cjs`);require(`./link-EZ0-lS3W.cjs`),require(`./textinput-DSYABvB6.cjs`);var o=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},s=e=>o(e),c=e=>{if(!e)return;let t=typeof e==`string`?new Date(e):e;if(!isNaN(t.getTime()))return t.toLocaleDateString(`nb-NO`,{day:`numeric`,month:`long`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})},l=class extends e.t{constructor(...e){super(...e),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent(`change-representation`,{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent(`log-out`,{bubbles:!0,composed:!0}))}handleMenuItemClick(e){`onClick`in e&&typeof e.onClick==`function`&&e.onClick()}renderLinkOrButton(n,r){let i=`href`in n,a=t.t({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[r||``]:!!r});return i?e.p`
1
+ const e=require("./element-DJzurxgt.cjs"),t=require("./class-map-CCZN5uS3.cjs"),n=require("./element-with-slot-BY7Jc-q8.cjs");require("./icon-B8PVq2O6.cjs");const r=require("./if-defined-DrwbxQOj.cjs");require("./button-B5tQpKeG.cjs");const i=require("./ref-DO7TzO4O.cjs"),a=require("./booleanish-B9Kf0nES.cjs");require("./link-Geze7498.cjs"),require("./textinput-CqvE701N.cjs");var o=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},s=e=>o(e),c=e=>{if(!e)return;let t=typeof e==`string`?new Date(e):e;if(!isNaN(t.getTime()))return t.toLocaleDateString(`nb-NO`,{day:`numeric`,month:`long`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})},l=class extends e.t{constructor(...e){super(...e),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent(`change-representation`,{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent(`log-out`,{bubbles:!0,composed:!0}))}handleMenuItemClick(e){`onClick`in e&&typeof e.onClick==`function`&&e.onClick()}renderLinkOrButton(n,r){let i=`href`in n,a=t.t({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[r||``]:!!r});return i?e.p`
2
2
  <pkt-link
3
3
  icon-name=${n.iconName||e.d}
4
4
  href=${n.href}
@@ -307,4 +307,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),
307
307
  >
308
308
  ${this.hasSlotContent()?e.p`<div class="pkt-contents">${n.n(this)}</div>`:e.d}
309
309
  </pkt-header-service>
310
- `}};e.n([e.o({type:String,attribute:`service-name`})],f.prototype,`serviceName`,void 0),e.n([e.o({type:String,attribute:`service-link`})],f.prototype,`serviceLink`,void 0),e.n([e.o({type:String,attribute:`logo-link`})],f.prototype,`logoLink`,void 0),e.n([e.o({type:String,attribute:`logo-path`})],f.prototype,`logoPath`,void 0),e.n([e.o({type:String,attribute:`search-placeholder`})],f.prototype,`searchPlaceholder`,void 0),e.n([e.o({type:String,attribute:`search-value`})],f.prototype,`searchValue`,void 0),e.n([e.o({type:Number,attribute:`mobile-breakpoint`})],f.prototype,`mobileBreakpoint`,void 0),e.n([e.o({type:Number,attribute:`tablet-breakpoint`})],f.prototype,`tabletBreakpoint`,void 0),e.n([e.o({type:String,attribute:`opened-menu`})],f.prototype,`openedMenu`,void 0),e.n([e.o({type:String,attribute:`log-out-button-placement`})],f.prototype,`logOutButtonPlacement`,void 0),e.n([e.o({type:String})],f.prototype,`position`,void 0),e.n([e.o({type:String,attribute:`scroll-behavior`})],f.prototype,`scrollBehavior`,void 0),e.n([e.o({type:String,attribute:`slot-menu-variant`})],f.prototype,`slotMenuVariant`,void 0),e.n([e.o({type:String,attribute:`slot-menu-text`})],f.prototype,`slotMenuText`,void 0),e.n([e.o({type:Boolean,attribute:`hide-logo`,converter:a.t})],f.prototype,`hideLogo`,void 0),e.n([e.o({type:Boolean,converter:a.t})],f.prototype,`compact`,void 0),e.n([e.o({type:Boolean,attribute:`show-search`,converter:a.t})],f.prototype,`showSearch`,void 0),e.n([e.o({type:Boolean,attribute:`can-change-representation`,converter:a.t})],f.prototype,`canChangeRepresentation`,void 0),e.n([e.o({type:Boolean,attribute:`has-log-out`,converter:a.t})],f.prototype,`hasLogOut`,void 0),e.n([e.o({type:Object})],f.prototype,`user`,void 0),e.n([e.o({type:Array,attribute:`user-menu`})],f.prototype,`userMenu`,void 0),e.n([e.o({type:Object})],f.prototype,`representing`,void 0),e.n([e.o({type:Array,attribute:`user-menu-footer`})],f.prototype,`userMenuFooter`,void 0),e.n([e.o({type:Array,attribute:`user-options`})],f.prototype,`userOptions`,void 0);try{e.s(`pkt-header`)(f)}catch{console.warn(`Forsøker å definere <pkt-header>, men den er allerede definert`)}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
310
+ `}};e.n([e.o({type:String,attribute:`service-name`})],f.prototype,`serviceName`,void 0),e.n([e.o({type:String,attribute:`service-link`})],f.prototype,`serviceLink`,void 0),e.n([e.o({type:String,attribute:`logo-link`})],f.prototype,`logoLink`,void 0),e.n([e.o({type:String,attribute:`logo-path`})],f.prototype,`logoPath`,void 0),e.n([e.o({type:String,attribute:`search-placeholder`})],f.prototype,`searchPlaceholder`,void 0),e.n([e.o({type:String,attribute:`search-value`})],f.prototype,`searchValue`,void 0),e.n([e.o({type:Number,attribute:`mobile-breakpoint`})],f.prototype,`mobileBreakpoint`,void 0),e.n([e.o({type:Number,attribute:`tablet-breakpoint`})],f.prototype,`tabletBreakpoint`,void 0),e.n([e.o({type:String,attribute:`opened-menu`})],f.prototype,`openedMenu`,void 0),e.n([e.o({type:String,attribute:`log-out-button-placement`})],f.prototype,`logOutButtonPlacement`,void 0),e.n([e.o({type:String})],f.prototype,`position`,void 0),e.n([e.o({type:String,attribute:`scroll-behavior`})],f.prototype,`scrollBehavior`,void 0),e.n([e.o({type:String,attribute:`slot-menu-variant`})],f.prototype,`slotMenuVariant`,void 0),e.n([e.o({type:String,attribute:`slot-menu-text`})],f.prototype,`slotMenuText`,void 0),e.n([e.o({type:Boolean,attribute:`hide-logo`,converter:a.t})],f.prototype,`hideLogo`,void 0),e.n([e.o({type:Boolean,converter:a.t})],f.prototype,`compact`,void 0),e.n([e.o({type:Boolean,attribute:`show-search`,converter:a.t})],f.prototype,`showSearch`,void 0),e.n([e.o({type:Boolean,attribute:`can-change-representation`,converter:a.t})],f.prototype,`canChangeRepresentation`,void 0),e.n([e.o({type:Boolean,attribute:`has-log-out`,converter:a.t})],f.prototype,`hasLogOut`,void 0),e.n([e.o({type:Object})],f.prototype,`user`,void 0),e.n([e.o({type:Array,attribute:`user-menu`})],f.prototype,`userMenu`,void 0),e.n([e.o({type:Object})],f.prototype,`representing`,void 0),e.n([e.o({type:Array,attribute:`user-menu-footer`})],f.prototype,`userMenuFooter`,void 0),e.n([e.o({type:Array,attribute:`user-options`})],f.prototype,`userOptions`,void 0);try{e.s(`pkt-header`)(f)}catch{console.warn(`Forsøker å definere <pkt-header>, men den er allerede definert`)}Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
@@ -1,8 +1,8 @@
1
- import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-CduG0XyF.js";
2
- import { t as s } from "./class-map-DH9hlJny.js";
3
- import "./icon-LaKyBKON.js";
4
- import "./accordion-BjYsEbSM.js";
5
- import { t as c } from "./booleanish-BmcOU-43.js";
1
+ import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-BoJrqauR.js";
2
+ import { t as s } from "./class-map-CAQCRB1W.js";
3
+ import "./icon-DGFEIlco.js";
4
+ import "./accordion-CBdIk9gw.js";
5
+ import { t as c } from "./booleanish-MfutDT_4.js";
6
6
  //#region ../../shared-types/header-menu.ts
7
7
  var l = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json", u = {
8
8
  automat: "parking-meter",
@@ -1,4 +1,4 @@
1
- const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);require(`./icon-Dw6I0HDV.cjs`),require(`./accordion-DaeWPWod.cjs`);const n=require(`./booleanish-jJLlnr6-.cjs`);var r=`https://cdn.web.oslo.kommune.no/header-footer/header-footer.json`,i={automat:`parking-meter`,bike:`bicycle`,corona:`virus`,directions:`arrow-directions`,document:`document-plain`,"download-document":`document-download`,elcar:`electric-car`,"error-hexa":`alert-error`,"fire-emblem":`shield-fire`,"link-arrow":`arrow-link`,"linked-in":`linkedin`,"map-layer":`map-layers`,mobile:`mobile-phone`,neutral:`smiley-neutral`,placeholder:`placeholder-icon`,sad:`smiley-sad`,signing:`signature`,sky:`cloud`,smile:`smiley-smile`,"success-square":`alert-success`,trash:`trash-can`,treatment:`processing`,"warning-triangle":`alert-warning`};function a(e){return e&&(i[e]??e)}var o={"facebook.com":`facebook`,"fb.com":`facebook`,"instagram.com":`instagram`,"linkedin.com":`linkedin`,"x.com":`x`,"github.com":`github`};function s(e){return e.toLowerCase().replace(/^(?:www|m)\./,``)}function c(e,t){if(e)try{let t=o[s(new URL(e).hostname)];if(t)return t}catch{}if(t){let e=t.trim().toLowerCase().replace(/\s+/g,`-`);if(e){let t=a(e);if(t)return t}}}var l=`nb-NO`;function u(e,t=l){if(e)return e[t]??e[l]}async function d(e=r,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`pkt-header-menu: failed to fetch ${e} (HTTP ${n.status})`);let i=await n.json();if(!i||typeof i!=`object`)throw Error(`pkt-header-menu: ${e} returned a non-object payload`);return i}var f=class extends e.t{constructor(...e){super(...e),this.dataUrl=r,this.locale=`nb-NO`,this.open=!1,this.ariaLabelledBy=``,this.mobileBreakpoint=768,this.loadState=`idle`,this.isMobile=!1,this.handleMediaChange=e=>{this.isMobile=e.matches}}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-header-menu`),this.updateOpenClass(),this.setupMediaQuery(),this.data?(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0}))):this.loadData()}updateOpenClass(){this.classList.toggle(`pkt-header-menu--open`,!!this.open)}disconnectedCallback(){super.disconnectedCallback(),this.abortController?.abort(),this.teardownMediaQuery()}updated(e){super.updated(e),e.has(`open`)&&this.updateOpenClass(),e.has(`mobileBreakpoint`)&&e.get(`mobileBreakpoint`)!==void 0&&this.setupMediaQuery(),e.has(`dataUrl`)&&e.get(`dataUrl`)!==void 0&&!this.data&&this.loadData(),e.has(`data`)&&e.get(`data`)!==void 0&&this.data&&(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0})))}setupMediaQuery(){this.teardownMediaQuery(),!(typeof window>`u`||typeof window.matchMedia!=`function`)&&(this.mediaQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.isMobile=this.mediaQuery.matches,this.mediaQuery.addEventListener(`change`,this.handleMediaChange))}teardownMediaQuery(){this.mediaQuery?.removeEventListener(`change`,this.handleMediaChange),this.mediaQuery=void 0}async loadData(){this.abortController?.abort(),this.abortController=new AbortController,this.loadState=`loading`;try{let e=await d(this.dataUrl,this.abortController.signal);this.fetchedData=e,this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:e},bubbles:!0,composed:!0}))}catch(e){if(e.name===`AbortError`)return;this.loadState=`error`,this.dispatchEvent(new CustomEvent(`data-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}get effectiveData(){return this.data??this.fetchedData}get localeData(){return u(this.effectiveData,this.locale)}render(){if(this.loadState===`loading`)return e.p`
1
+ const e=require("./element-DJzurxgt.cjs"),t=require("./class-map-CCZN5uS3.cjs");require("./icon-B8PVq2O6.cjs"),require("./accordion-FISAiAbX.cjs");const n=require("./booleanish-B9Kf0nES.cjs");var r=`https://cdn.web.oslo.kommune.no/header-footer/header-footer.json`,i={automat:`parking-meter`,bike:`bicycle`,corona:`virus`,directions:`arrow-directions`,document:`document-plain`,"download-document":`document-download`,elcar:`electric-car`,"error-hexa":`alert-error`,"fire-emblem":`shield-fire`,"link-arrow":`arrow-link`,"linked-in":`linkedin`,"map-layer":`map-layers`,mobile:`mobile-phone`,neutral:`smiley-neutral`,placeholder:`placeholder-icon`,sad:`smiley-sad`,signing:`signature`,sky:`cloud`,smile:`smiley-smile`,"success-square":`alert-success`,trash:`trash-can`,treatment:`processing`,"warning-triangle":`alert-warning`};function a(e){return e&&(i[e]??e)}var o={"facebook.com":`facebook`,"fb.com":`facebook`,"instagram.com":`instagram`,"linkedin.com":`linkedin`,"x.com":`x`,"github.com":`github`};function s(e){return e.toLowerCase().replace(/^(?:www|m)\./,``)}function c(e,t){if(e)try{let t=o[s(new URL(e).hostname)];if(t)return t}catch{}if(t){let e=t.trim().toLowerCase().replace(/\s+/g,`-`);if(e){let t=a(e);if(t)return t}}}var l=`nb-NO`;function u(e,t=l){if(e)return e[t]??e[l]}async function d(e=r,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`pkt-header-menu: failed to fetch ${e} (HTTP ${n.status})`);let i=await n.json();if(!i||typeof i!=`object`)throw Error(`pkt-header-menu: ${e} returned a non-object payload`);return i}var f=class extends e.t{constructor(...e){super(...e),this.dataUrl=r,this.locale=`nb-NO`,this.open=!1,this.ariaLabelledBy=``,this.mobileBreakpoint=768,this.loadState=`idle`,this.isMobile=!1,this.handleMediaChange=e=>{this.isMobile=e.matches}}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-header-menu`),this.updateOpenClass(),this.setupMediaQuery(),this.data?(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0}))):this.loadData()}updateOpenClass(){this.classList.toggle(`pkt-header-menu--open`,!!this.open)}disconnectedCallback(){super.disconnectedCallback(),this.abortController?.abort(),this.teardownMediaQuery()}updated(e){super.updated(e),e.has(`open`)&&this.updateOpenClass(),e.has(`mobileBreakpoint`)&&e.get(`mobileBreakpoint`)!==void 0&&this.setupMediaQuery(),e.has(`dataUrl`)&&e.get(`dataUrl`)!==void 0&&!this.data&&this.loadData(),e.has(`data`)&&e.get(`data`)!==void 0&&this.data&&(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0})))}setupMediaQuery(){this.teardownMediaQuery(),!(typeof window>`u`||typeof window.matchMedia!=`function`)&&(this.mediaQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.isMobile=this.mediaQuery.matches,this.mediaQuery.addEventListener(`change`,this.handleMediaChange))}teardownMediaQuery(){this.mediaQuery?.removeEventListener(`change`,this.handleMediaChange),this.mediaQuery=void 0}async loadData(){this.abortController?.abort(),this.abortController=new AbortController,this.loadState=`loading`;try{let e=await d(this.dataUrl,this.abortController.signal);this.fetchedData=e,this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:e},bubbles:!0,composed:!0}))}catch(e){if(e.name===`AbortError`)return;this.loadState=`error`,this.dispatchEvent(new CustomEvent(`data-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}get effectiveData(){return this.data??this.fetchedData}get localeData(){return u(this.effectiveData,this.locale)}render(){if(this.loadState===`loading`)return e.p`
2
2
  <nav aria-busy="true">
3
3
  <p class="pkt-header-menu__loading">Laster meny…</p>
4
4
  </nav>
@@ -123,4 +123,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);
123
123
  ${n?e.p`<pkt-icon name=${n} aria-hidden="true"></pkt-icon>`:e.p`<span>${t.text}</span>`}
124
124
  </a>
125
125
  </li>
126
- `}};e.n([e.o({type:String,attribute:`data-url`})],f.prototype,`dataUrl`,void 0),e.n([e.o({type:Object,attribute:!1})],f.prototype,`data`,void 0),e.n([e.o({type:String})],f.prototype,`locale`,void 0),e.n([e.o({type:Boolean,reflect:!0,converter:n.t})],f.prototype,`open`,void 0),e.n([e.o({type:String,attribute:`aria-labelledby`,reflect:!0})],f.prototype,`ariaLabelledBy`,void 0),e.n([e.o({type:Number,attribute:`mobile-breakpoint`})],f.prototype,`mobileBreakpoint`,void 0),e.n([e.a()],f.prototype,`loadState`,void 0),e.n([e.a()],f.prototype,`fetchedData`,void 0),e.n([e.a()],f.prototype,`isMobile`,void 0);try{e.s(`pkt-header-menu`)(f)}catch{console.warn(`Forsøker å definere <pkt-header-menu>, men den er allerede definert`)}var p=f;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
126
+ `}};e.n([e.o({type:String,attribute:`data-url`})],f.prototype,`dataUrl`,void 0),e.n([e.o({type:Object,attribute:!1})],f.prototype,`data`,void 0),e.n([e.o({type:String})],f.prototype,`locale`,void 0),e.n([e.o({type:Boolean,reflect:!0,converter:n.t})],f.prototype,`open`,void 0),e.n([e.o({type:String,attribute:`aria-labelledby`,reflect:!0})],f.prototype,`ariaLabelledBy`,void 0),e.n([e.o({type:Number,attribute:`mobile-breakpoint`})],f.prototype,`mobileBreakpoint`,void 0),e.n([e.a()],f.prototype,`loadState`,void 0),e.n([e.a()],f.prototype,`fetchedData`,void 0),e.n([e.a()],f.prototype,`isMobile`,void 0);try{e.s(`pkt-header-menu`)(f)}catch{console.warn(`Forsøker å definere <pkt-header-menu>, men den er allerede definert`)}var p=f;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
@@ -1,5 +1,5 @@
1
- import { n as e, o as t, p as n, s as r } from "./element-CduG0XyF.js";
2
- import { n as i, t as a } from "./element-with-slot-BVj9MXzi.js";
1
+ import { n as e, o as t, p as n, s as r } from "./element-BoJrqauR.js";
2
+ import { n as i, t as a } from "./element-with-slot-mXLg8gg8.js";
3
3
  //#region src/components/heading/heading.ts
4
4
  var o = class extends a {
5
5
  constructor(...e) {
@@ -1 +1 @@
1
- const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./element-with-slot-Cmxb9h4H.cjs`);var n=class extends t.t{constructor(...e){super(...e),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}updated(e){super.updated(e),e.has(`level`)&&((this.level<1||this.level>6)&&console.warn(`Invalid heading level: ${this.level}. Must be between 1 and 6.`),this.hasAttribute(`size`)||(this.size=this.defaultSizeForLevel),this.hasAttribute(`weight`)||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute(`size`)&&this.size===void 0&&(this.size=this.defaultSizeForLevel)}get defaultSizeForLevel(){switch(this.level){case 1:return`xlarge`;case 2:return`large`;case 3:return`medium`;case 4:return`small`;case 5:case 6:return`xsmall`;default:return`medium`}}get defaultWeightForLevel(){switch(this.level){case 1:case 2:return`regular`;case 3:case 4:case 5:case 6:return`medium`;default:return`medium`}}get headingClasses(){return[`pkt-heading`,this.size&&`pkt-heading--${this.size}`,this.weight&&`pkt-heading--fw-${this.weight}`,this.visuallyHidden&&`pkt-sr-only`,this.align&&`pkt-heading--${this.align}`].filter(Boolean).join(` `)}render(){let n=this.headingClasses,r=t.n(this);switch(this.level>=1&&this.level<=6?this.level:2){case 1:return e.p`<h1 class=${n}>${r}</h1>`;case 2:return e.p`<h2 class=${n}>${r}</h2>`;case 3:return e.p`<h3 class=${n}>${r}</h3>`;case 4:return e.p`<h4 class=${n}>${r}</h4>`;case 5:return e.p`<h5 class=${n}>${r}</h5>`;case 6:return e.p`<h6 class=${n}>${r}</h6>`;default:return e.p`<h2 class=${n}>${r}</h2>`}}};e.n([e.o({type:String,reflect:!0})],n.prototype,`size`,void 0),e.n([e.o({type:Number,reflect:!0})],n.prototype,`level`,void 0),e.n([e.o({type:String,reflect:!0})],n.prototype,`weight`,void 0),e.n([e.o({type:Boolean,reflect:!0})],n.prototype,`visuallyHidden`,void 0),e.n([e.o({type:String,reflect:!0})],n.prototype,`align`,void 0);try{e.s(`pkt-heading`)(n)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var r=n;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
1
+ const e=require("./element-DJzurxgt.cjs"),t=require("./element-with-slot-BY7Jc-q8.cjs");var n=class extends t.t{constructor(...e){super(...e),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}updated(e){super.updated(e),e.has(`level`)&&((this.level<1||this.level>6)&&console.warn(`Invalid heading level: ${this.level}. Must be between 1 and 6.`),this.hasAttribute(`size`)||(this.size=this.defaultSizeForLevel),this.hasAttribute(`weight`)||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute(`size`)&&this.size===void 0&&(this.size=this.defaultSizeForLevel)}get defaultSizeForLevel(){switch(this.level){case 1:return`xlarge`;case 2:return`large`;case 3:return`medium`;case 4:return`small`;case 5:case 6:return`xsmall`;default:return`medium`}}get defaultWeightForLevel(){switch(this.level){case 1:case 2:return`regular`;case 3:case 4:case 5:case 6:return`medium`;default:return`medium`}}get headingClasses(){return[`pkt-heading`,this.size&&`pkt-heading--${this.size}`,this.weight&&`pkt-heading--fw-${this.weight}`,this.visuallyHidden&&`pkt-sr-only`,this.align&&`pkt-heading--${this.align}`].filter(Boolean).join(` `)}render(){let n=this.headingClasses,r=t.n(this);switch(this.level>=1&&this.level<=6?this.level:2){case 1:return e.p`<h1 class=${n}>${r}</h1>`;case 2:return e.p`<h2 class=${n}>${r}</h2>`;case 3:return e.p`<h3 class=${n}>${r}</h3>`;case 4:return e.p`<h4 class=${n}>${r}</h4>`;case 5:return e.p`<h5 class=${n}>${r}</h5>`;case 6:return e.p`<h6 class=${n}>${r}</h6>`;default:return e.p`<h2 class=${n}>${r}</h2>`}}};e.n([e.o({type:String,reflect:!0})],n.prototype,`size`,void 0),e.n([e.o({type:Number,reflect:!0})],n.prototype,`level`,void 0),e.n([e.o({type:String,reflect:!0})],n.prototype,`weight`,void 0),e.n([e.o({type:Boolean,reflect:!0})],n.prototype,`visuallyHidden`,void 0),e.n([e.o({type:String,reflect:!0})],n.prototype,`align`,void 0);try{e.s(`pkt-heading`)(n)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var r=n;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -1,9 +1,9 @@
1
- import { a as e, d as t, n, o as r, p as i, s as a } from "./element-CduG0XyF.js";
2
- import { t as o } from "./class-map-DH9hlJny.js";
3
- import { n as s, t as c } from "./element-with-slot-BVj9MXzi.js";
4
- import { r as l } from "./icon-LaKyBKON.js";
5
- import { n as u } from "./utils-CUqCKGvp.js";
6
- import { t as d } from "./input-wrapper-kw2y6Jp_.js";
1
+ import { a as e, d as t, n, o as r, p as i, s as a } from "./element-BoJrqauR.js";
2
+ import { t as o } from "./class-map-CAQCRB1W.js";
3
+ import { n as s, t as c } from "./element-with-slot-mXLg8gg8.js";
4
+ import { r as l } from "./icon-DGFEIlco.js";
5
+ import { n as u } from "./utils-BwF4QSrq.js";
6
+ import { t as d } from "./input-wrapper-DwwE0JcO.js";
7
7
  //#region src/components/helptext/helptext.ts
8
8
  var f = class extends c {
9
9
  constructor(...e) {
@@ -1,4 +1,4 @@
1
- const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),n=require(`./element-with-slot-Cmxb9h4H.cjs`),r=require(`./icon-Dw6I0HDV.cjs`),i=require(`./utils-CjAbIttF.cjs`),a=require(`./input-wrapper-CYCCx8MP.cjs`);var o=class extends n.t{constructor(...e){super(...e),this.forId=i.n(),this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=a.t.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){let i=()=>{let e=!this.isHelpTextOpen;this.isHelpTextOpen=e,this.dispatchEvent(new CustomEvent(`toggleHelpText`,{bubbles:!0,detail:{isOpen:e}}))},a=t.t({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()});return e.p`${e.p`<div class="${a}">
1
+ const e=require("./element-DJzurxgt.cjs"),t=require("./class-map-CCZN5uS3.cjs"),n=require("./element-with-slot-BY7Jc-q8.cjs"),r=require("./icon-B8PVq2O6.cjs"),i=require("./utils-63cRpWut.cjs"),a=require("./input-wrapper-LcZjpt0L.cjs");var o=class extends n.t{constructor(...e){super(...e),this.forId=i.n(),this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=a.t.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){let i=()=>{let e=!this.isHelpTextOpen;this.isHelpTextOpen=e,this.dispatchEvent(new CustomEvent(`toggleHelpText`,{bubbles:!0,detail:{isOpen:e}}))},a=t.t({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()});return e.p`${e.p`<div class="${a}">
2
2
  <div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
3
3
  <div class="pkt-contents" name="helptext">${n.n(this)}</div>
4
4
  ${this.helptext&&r.r(this.helptext)}
@@ -21,4 +21,4 @@ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),
21
21
  ${r.r(this.helptextDropdown)}
22
22
  </div>
23
23
  </div>`:e.d}
24
- </div>`}`}};e.n([e.o({type:String,reflect:!0})],o.prototype,`forId`,void 0),e.n([e.o({type:String})],o.prototype,`helptext`,void 0),e.n([e.o({type:String})],o.prototype,`helptextDropdown`,void 0),e.n([e.o({type:String})],o.prototype,`helptextDropdownButton`,void 0),e.n([e.a()],o.prototype,`isHelpTextOpen`,void 0);try{e.s(`pkt-helptext`)(o)}catch{console.warn(`Forsøker å definere <pkt-helptext>, men den er allerede definert`)}var s=o;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
24
+ </div>`}`}};e.n([e.o({type:String,reflect:!0})],o.prototype,`forId`,void 0),e.n([e.o({type:String})],o.prototype,`helptext`,void 0),e.n([e.o({type:String})],o.prototype,`helptextDropdown`,void 0),e.n([e.o({type:String})],o.prototype,`helptextDropdownButton`,void 0),e.n([e.a()],o.prototype,`isHelpTextOpen`,void 0);try{e.s(`pkt-helptext`)(o)}catch{console.warn(`Forsøker å definere <pkt-helptext>, men den er allerede definert`)}var s=o;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
@@ -1 +1 @@
1
- const e=require(`./element-CXAtr6Gu.cjs`);var t=class extends e.l{constructor(t){if(super(t),this.it=e.d,t.type!==e.u.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(t){if(t===e.d||t==null)return this._t=void 0,this.it=t;if(t===e.f)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:[]}}};t.directiveName=`unsafeHTML`,t.resultType=1;var n=e.c(t),r=class extends t{};r.directiveName=`unsafeSVG`,r.resultType=2;var i=e.c(r),a=`https://punkt-cdn.oslo.kommune.no/latest/icons/`;typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||a);var o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,s={},c=2,l=1500,u=typeof Storage<`u`&&typeof sessionStorage<`u`,d=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),f=async(e,t=c)=>{try{return await d(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,l)),f(e,t-1)):(console.error(`Failed to fetch icon: `+e),o)}},p=async(e,t)=>{let n=t+e+`.svg`;return u&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in s?s[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(s[n]=f(n).then(e=>(e!==o&&u&&sessionStorage.setItem(n,e),delete s[n],e)),s[n]):o},m=class extends e.t{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:a,this.name=``,this.ariaHidden=null,this.ariaLabel=null,this.icon=i(o),this._updatedProps=[]}get effectiveAriaHidden(){return this.ariaHidden!==null&&this.ariaHidden!==void 0?this.ariaHidden===``||this.ariaHidden===`true`:!this.ariaLabel}get effectiveAriaLabel(){return this.effectiveAriaHidden?null:this.ariaLabel||this.name||null}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),this.applyAriaToSvg()}applyAriaToSvg(){let e=this.querySelector(`svg`);if(!e)return;e.setAttribute(`aria-hidden`,String(this.effectiveAriaHidden));let t=this.effectiveAriaLabel;t?e.setAttribute(`aria-label`,t):e.removeAttribute(`aria-label`)}async getIcon(e=``){if(this._updatedProps.length>0){this.path||=typeof window<`u`?window.pktIconPath:a;try{this.icon=i(await p(this.name||``,this.path))}catch{this.icon=i(o)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return e.p`${this.name&&this.icon}`}};e.n([e.o({type:String,reflect:!1})],m.prototype,`path`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`name`,void 0),e.n([e.o({type:String,attribute:`aria-hidden`,reflect:!0})],m.prototype,`ariaHidden`,void 0),e.n([e.o({type:String,attribute:`aria-label`,reflect:!0})],m.prototype,`ariaLabel`,void 0),e.n([e.o({type:SVGElement})],m.prototype,`icon`,void 0),e.n([e.o({type:Array,noAccessor:!0})],m.prototype,`_updatedProps`,void 0);try{e.s(`pkt-icon`)(m)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var h=m;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
1
+ const e=require("./element-DJzurxgt.cjs");var t=class extends e.l{constructor(t){if(super(t),this.it=e.d,t.type!==e.u.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(t){if(t===e.d||t==null)return this._t=void 0,this.it=t;if(t===e.f)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:[]}}};t.directiveName=`unsafeHTML`,t.resultType=1;var n=e.c(t),r=class extends t{};r.directiveName=`unsafeSVG`,r.resultType=2;var i=e.c(r),a=`https://punkt-cdn.oslo.kommune.no/latest/icons/`;typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||a);var o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,s={},c=2,l=1500,u=typeof Storage<`u`&&typeof sessionStorage<`u`,d=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),f=async(e,t=c)=>{try{return await d(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,l)),f(e,t-1)):(console.error(`Failed to fetch icon: `+e),o)}},p=async(e,t)=>{let n=t+e+`.svg`;return u&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in s?s[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(s[n]=f(n).then(e=>(e!==o&&u&&sessionStorage.setItem(n,e),delete s[n],e)),s[n]):o},m=class extends e.t{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:a,this.name=``,this.ariaHidden=null,this.ariaLabel=null,this.icon=i(o),this._updatedProps=[]}get effectiveAriaHidden(){return this.ariaHidden!==null&&this.ariaHidden!==void 0?this.ariaHidden===``||this.ariaHidden===`true`:!this.ariaLabel}get effectiveAriaLabel(){return this.effectiveAriaHidden?null:this.ariaLabel||this.name||null}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),this.applyAriaToSvg()}applyAriaToSvg(){let e=this.querySelector(`svg`);if(!e)return;e.setAttribute(`aria-hidden`,String(this.effectiveAriaHidden));let t=this.effectiveAriaLabel;t?e.setAttribute(`aria-label`,t):e.removeAttribute(`aria-label`)}async getIcon(e=``){if(this._updatedProps.length>0){this.path||=typeof window<`u`?window.pktIconPath:a;try{this.icon=i(await p(this.name||``,this.path))}catch{this.icon=i(o)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return e.p`${this.name&&this.icon}`}};e.n([e.o({type:String,reflect:!1})],m.prototype,`path`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`name`,void 0),e.n([e.o({type:String,attribute:`aria-hidden`,reflect:!0})],m.prototype,`ariaHidden`,void 0),e.n([e.o({type:String,attribute:`aria-label`,reflect:!0})],m.prototype,`ariaLabel`,void 0),e.n([e.o({type:SVGElement})],m.prototype,`icon`,void 0),e.n([e.o({type:Array,noAccessor:!0})],m.prototype,`_updatedProps`,void 0);try{e.s(`pkt-icon`)(m)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var h=m;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
@@ -1,5 +1,5 @@
1
- import { c as e, d as t, f as n, l as r, n as i, o as a, p as o, s, t as c, u as l } from "./element-CduG0XyF.js";
2
- //#region ../../node_modules/lit-html/directives/unsafe-html.js
1
+ import { c as e, d as t, f as n, l as r, n as i, o as a, p as o, s, t as c, u as l } from "./element-BoJrqauR.js";
2
+ //#region node_modules/lit/node_modules/lit-html/directives/unsafe-html.js
3
3
  var u = class extends r {
4
4
  constructor(e) {
5
5
  if (super(e), this.it = t, e.type !== l.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
@@ -0,0 +1,5 @@
1
+ import { d as e } from "./element-BoJrqauR.js";
2
+ //#region node_modules/lit/node_modules/lit-html/directives/if-defined.js
3
+ var t = (t) => t ?? e;
4
+ //#endregion
5
+ export { t };
@@ -0,0 +1 @@
1
+ const e=require("./element-DJzurxgt.cjs");var t=t=>t??e.d;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './components';
2
- export * from './types';
1
+ export * from './components/index.js'
2
+ export {}