@oslokommune/punkt-elements 12.42.12 → 12.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{accordionitem-Be6vyX31.js → accordionitem-C9FI-NXW.js} +7 -8
  3. package/dist/{accordionitem-ogt0KNGP.cjs → accordionitem-DjAWPtsn.cjs} +5 -5
  4. package/dist/{alert-CZyqekhG.js → alert-B0OUR9oD.js} +21 -22
  5. package/dist/alert-BH0lJ2ny.cjs +32 -0
  6. package/dist/{backlink-C3dfam09.js → backlink-B13JTp9D.js} +11 -12
  7. package/dist/backlink-C5jQRMwJ.cjs +13 -0
  8. package/dist/button-CDocR7iN.cjs +19 -0
  9. package/dist/{button-OoC1RGJL.js → button-DrrEvUy9.js} +7 -8
  10. package/dist/calendar-BZe2D4Sr.cjs +108 -0
  11. package/dist/{calendar-qEV4u3xs.js → calendar-DevQhOup.js} +10 -11
  12. package/dist/{card-CJue0Esh.cjs → card-Bx36j0q4.cjs} +1 -1
  13. package/dist/{card-p-fcc7Wh.js → card-Djnd-pgo.js} +8 -9
  14. package/dist/{checkbox-iLywLQwL.cjs → checkbox-CJ4tK9RC.cjs} +1 -1
  15. package/dist/{checkbox-BLI7dfpW.js → checkbox-cD_5LDzV.js} +4 -4
  16. package/dist/{class-map-dph2jLEp.cjs → class-map-BBG2gMX4.cjs} +1 -1
  17. package/dist/{class-map-DO0E7GkW.js → class-map-BpTj9gtz.js} +1 -1
  18. package/dist/{combobox-BJOVpwAW.cjs → combobox-Cv6i7BEk.cjs} +1 -1
  19. package/dist/{combobox-C_Zj-ZxE.js → combobox-kWGI4RHI.js} +11 -11
  20. package/dist/{consent-C0pd0E2Q.js → consent-CftYu8Di.js} +5 -6
  21. package/dist/consent-DrS71kvz.cjs +11 -0
  22. package/dist/{datepicker--I3DF-Ci.cjs → datepicker-BJe92Vor.cjs} +1 -1
  23. package/dist/{datepicker-Y6-ORa5u.js → datepicker-LpbYHx8L.js} +11 -11
  24. package/dist/{directive-helpers-lOXMtxMR.cjs → directive-helpers-BBbxqP2W.cjs} +2 -2
  25. package/dist/{directive-helpers-D2BEk_ct.js → directive-helpers-r-kOS_Mf.js} +1 -1
  26. package/dist/element-6DBpyGQm.cjs +238 -0
  27. package/dist/{element-Cfyyg4nF.js → element-CgEWt74-.js} +9272 -9157
  28. package/dist/heading-BRE_iFtR.cjs +1 -0
  29. package/dist/{heading-BWV1JThP.js → heading-D6jXE_Mz.js} +4 -4
  30. package/dist/{helptext-C7oP6VRp.js → helptext-B7eI0iBQ.js} +18 -19
  31. package/dist/helptext-CzQX6YVE.cjs +24 -0
  32. package/dist/{icon-RJ9Op-BB.cjs → icon-B_ryAy4Q.cjs} +3 -3
  33. package/dist/{icon-DPnB79MP.js → icon-CC1js8eR.js} +11 -12
  34. package/dist/{if-defined-I-IZkUY2.js → if-defined-CmuO4Vz9.js} +1 -1
  35. package/dist/if-defined-Cni-RHLS.cjs +5 -0
  36. package/dist/index.d.ts +27 -27
  37. package/dist/input-element-CHjLWeKt.cjs +1 -0
  38. package/dist/input-element-Cco4PA2M.js +700 -0
  39. package/dist/{input-wrapper-DrJgi10C.cjs → input-wrapper-BxZf8wEP.cjs} +4 -4
  40. package/dist/{input-wrapper-BDm0DwAW.js → input-wrapper-gz7ppKrK.js} +13 -14
  41. package/dist/{link-BzKHhT3c.js → link-C76H6Qf1.js} +11 -12
  42. package/dist/link-DTkjNlmy.cjs +7 -0
  43. package/dist/{linkcard-CyepaY-g.js → linkcard-BVEsUPwG.js} +13 -14
  44. package/dist/{linkcard-Czsb01sQ.cjs → linkcard-BlMhPNry.cjs} +1 -1
  45. package/dist/{listbox-BIcmMiAK.cjs → listbox-C4supLfR.cjs} +7 -7
  46. package/dist/{listbox-Br7v_BsA.js → listbox-CLsSW32I.js} +10 -11
  47. package/dist/loader-CHPxY9c6.cjs +11 -0
  48. package/dist/{loader-Co35Rkbv.js → loader-Da4IOk_T.js} +15 -16
  49. package/dist/messagebox-CqUBJs_D.cjs +12 -0
  50. package/dist/{messagebox-CQXmoqzD.js → messagebox-DwGdcdm7.js} +17 -18
  51. package/dist/modal-BdA5aWGU.cjs +36 -0
  52. package/dist/{modal-DuubDFPT.js → modal-DcXPnFus.js} +26 -27
  53. package/dist/pkt-accordion.cjs +1 -1
  54. package/dist/pkt-accordion.js +2 -2
  55. package/dist/pkt-alert.cjs +1 -1
  56. package/dist/pkt-alert.js +1 -1
  57. package/dist/pkt-backlink.cjs +1 -1
  58. package/dist/pkt-backlink.js +1 -1
  59. package/dist/pkt-button.cjs +1 -1
  60. package/dist/pkt-button.js +1 -1
  61. package/dist/pkt-calendar.cjs +1 -1
  62. package/dist/pkt-calendar.js +1 -1
  63. package/dist/pkt-card.cjs +1 -1
  64. package/dist/pkt-card.js +1 -1
  65. package/dist/pkt-checkbox.cjs +1 -1
  66. package/dist/pkt-checkbox.js +1 -1
  67. package/dist/pkt-combobox.cjs +1 -1
  68. package/dist/pkt-combobox.js +1 -1
  69. package/dist/pkt-consent.cjs +1 -1
  70. package/dist/pkt-consent.js +1 -1
  71. package/dist/pkt-datepicker.cjs +1 -1
  72. package/dist/pkt-datepicker.js +1 -1
  73. package/dist/pkt-heading.cjs +1 -1
  74. package/dist/pkt-heading.js +1 -1
  75. package/dist/pkt-helptext.cjs +1 -1
  76. package/dist/pkt-helptext.js +1 -1
  77. package/dist/pkt-icon.cjs +1 -1
  78. package/dist/pkt-icon.js +1 -1
  79. package/dist/pkt-index.cjs +3 -3
  80. package/dist/pkt-index.js +62 -63
  81. package/dist/pkt-input-wrapper.cjs +1 -1
  82. package/dist/pkt-input-wrapper.js +1 -1
  83. package/dist/pkt-link.cjs +1 -1
  84. package/dist/pkt-link.js +1 -1
  85. package/dist/pkt-linkcard.cjs +1 -1
  86. package/dist/pkt-linkcard.js +1 -1
  87. package/dist/pkt-listbox.cjs +1 -1
  88. package/dist/pkt-listbox.js +1 -1
  89. package/dist/pkt-loader.cjs +1 -1
  90. package/dist/pkt-loader.js +1 -1
  91. package/dist/pkt-messagebox.cjs +1 -1
  92. package/dist/pkt-messagebox.js +1 -1
  93. package/dist/pkt-modal.cjs +1 -1
  94. package/dist/pkt-modal.js +1 -1
  95. package/dist/pkt-progressbar.cjs +1 -1
  96. package/dist/pkt-progressbar.js +2 -2
  97. package/dist/pkt-radiobutton.cjs +1 -1
  98. package/dist/pkt-radiobutton.js +1 -1
  99. package/dist/pkt-select.cjs +1 -1
  100. package/dist/pkt-select.js +1 -1
  101. package/dist/pkt-tag.cjs +1 -1
  102. package/dist/pkt-tag.js +1 -1
  103. package/dist/pkt-textarea.cjs +1 -1
  104. package/dist/pkt-textarea.js +1 -1
  105. package/dist/pkt-textinput.cjs +1 -1
  106. package/dist/pkt-textinput.js +1 -1
  107. package/dist/{progressbar-DF8IG5IY.cjs → progressbar-DhMBXkww.cjs} +7 -7
  108. package/dist/{progressbar-B75UwwRZ.js → progressbar-Dj_mI_A6.js} +13 -14
  109. package/dist/{radiobutton-DUpADoLc.cjs → radiobutton-0vVqu-GU.cjs} +1 -1
  110. package/dist/{radiobutton-CDO-HMP_.js → radiobutton-BcFRJFvI.js} +5 -5
  111. package/dist/{ref-DX488m2G.js → ref-BBYSqgeW.js} +2 -2
  112. package/dist/{ref-BMQZJJEo.cjs → ref-iJtiv3o2.cjs} +1 -1
  113. package/dist/{repeat-Dl4RVQIF.js → repeat-C8BeHwYx.js} +2 -2
  114. package/dist/{repeat-B93vZu9q.cjs → repeat-CDsZqct8.cjs} +1 -1
  115. package/dist/{select-q7qkLeW4.js → select-BaLHLuvH.js} +20 -20
  116. package/dist/select-CFpdOlDE.cjs +48 -0
  117. package/dist/{state-P2J1I2ny.js → state-Bo2bck5_.js} +1 -1
  118. package/dist/{state-y-GU-VH8.cjs → state-DPobt-Yz.cjs} +1 -1
  119. package/dist/{tag-OSIRLJc0.js → tag-BWm6s48d.js} +20 -21
  120. package/dist/tag-DPk3fpEg.cjs +18 -0
  121. package/dist/{textarea-BuhpS5Jj.cjs → textarea-CViiuZdR.cjs} +1 -1
  122. package/dist/{textarea-BIvwbRBK.js → textarea-EIFo7GZz.js} +22 -22
  123. package/dist/{textinput-BFbenR3I.js → textinput-BHS7b-Jt.js} +8 -8
  124. package/dist/{textinput-BUMlqXQC.cjs → textinput-_ZdyMA9O.cjs} +1 -1
  125. package/package.json +4 -4
  126. package/src/components/heading/heading.ts +3 -2
  127. package/dist/alert-DifeONO7.cjs +0 -32
  128. package/dist/backlink-C9qmM67k.cjs +0 -13
  129. package/dist/button-zO41ySZl.cjs +0 -19
  130. package/dist/calendar-BYYJH15O.cjs +0 -108
  131. package/dist/consent-BkgHuZ37.cjs +0 -11
  132. package/dist/element-DUJa1sRq.cjs +0 -212
  133. package/dist/heading-C6U6xiqH.cjs +0 -1
  134. package/dist/helptext-BxHMB-XH.cjs +0 -24
  135. package/dist/if-defined-BQOEcjlp.cjs +0 -5
  136. package/dist/input-element-B2JauW-Y.cjs +0 -1
  137. package/dist/input-element-CaCDNzdI.js +0 -230
  138. package/dist/link-Dhs4dS0S.cjs +0 -7
  139. package/dist/lit-element-DHqqtYbj.cjs +0 -27
  140. package/dist/lit-element-DcUrSbRH.js +0 -595
  141. package/dist/loader-5lt2W9RX.cjs +0 -11
  142. package/dist/messagebox-BSUbetVQ.cjs +0 -12
  143. package/dist/modal-5PZ-TDkV.cjs +0 -36
  144. package/dist/select-CE5L--Xw.cjs +0 -48
  145. package/dist/tag-sEPrma2U.cjs +0 -18
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./element-6DBpyGQm.cjs");var h=Object.defineProperty,p=Object.getOwnPropertyDescriptor,l=(n,t,a,e)=>{for(var s=e>1?void 0:e?p(t,a):t,d=n.length-1,r;d>=0;d--)(r=n[d])&&(s=(e?r(t,a,s):r(s))||s);return e&&s&&h(t,a,s),s};exports.PktHeading=class extends i.PktShadowElement{constructor(){super(...arguments),this.size="medium",this.level=2,this.visuallyHidden=!1,this.align="start"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(t,a,e){super.attributeChangedCallback(t,a,e),t==="level"&&e&&this.setLevel(Number(e)),(t==="size"||t==="visuallyHidden"||t==="align")&&this.updateHostClasses()}updated(t){super.updated(t),t.has("level")&&this.setLevel(this.level),(t.has("size")||t.has("visuallyHidden")||t.has("align"))&&this.updateHostClasses()}setLevel(t){t>=1&&t<=6?(this.level=t,this.setAttribute("aria-level",String(t))):console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`)}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return i.x`<slot></slot>`}};l([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"size",2);l([i.n({type:Number,reflect:!0})],exports.PktHeading.prototype,"level",2);l([i.n({type:Boolean,reflect:!0})],exports.PktHeading.prototype,"visuallyHidden",2);l([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"align",2);exports.PktHeading=l([i.t("pkt-heading")],exports.PktHeading);
@@ -1,8 +1,8 @@
1
- import { i as p, x as u, n as d, t as g } from "./lit-element-DcUrSbRH.js";
2
- var o = Object.defineProperty, c = Object.getOwnPropertyDescriptor, l = (t, i, e, r) => {
1
+ import { b as p, x as u, n as d, a as o } from "./element-CgEWt74-.js";
2
+ var g = Object.defineProperty, c = Object.getOwnPropertyDescriptor, l = (t, i, e, r) => {
3
3
  for (var s = r > 1 ? void 0 : r ? c(i, e) : i, n = t.length - 1, h; n >= 0; n--)
4
4
  (h = t[n]) && (s = (r ? h(i, e, s) : h(s)) || s);
5
- return r && s && o(i, e, s), s;
5
+ return r && s && g(i, e, s), s;
6
6
  };
7
7
  let a = class extends p {
8
8
  constructor() {
@@ -51,7 +51,7 @@ l([
51
51
  d({ type: String, reflect: !0 })
52
52
  ], a.prototype, "align", 2);
53
53
  a = l([
54
- g("pkt-heading")
54
+ o("pkt-heading")
55
55
  ], a);
56
56
  export {
57
57
  a as P
@@ -1,20 +1,19 @@
1
- import { P as c } from "./element-Cfyyg4nF.js";
2
- import { x as a, E as f, n, t as m } from "./lit-element-DcUrSbRH.js";
3
- import { e as w, n as _ } from "./ref-DX488m2G.js";
4
- import { o as x } from "./icon-DPnB79MP.js";
5
- import { e as d } from "./class-map-DO0E7GkW.js";
6
- import { r as u } from "./state-P2J1I2ny.js";
1
+ import { P as c, x as a, E as f, n as r, a as w } from "./element-CgEWt74-.js";
2
+ import { e as _, n as m } from "./ref-BBYSqgeW.js";
3
+ import { o as x } from "./icon-CC1js8eR.js";
4
+ import { e as d } from "./class-map-BpTj9gtz.js";
5
+ import { r as u } from "./state-Bo2bck5_.js";
7
6
  import { u as k } from "./stringutils-DJjRa8dG.js";
8
7
  import { s as v } from "./input-wrapper-8iKEzDRZ.js";
9
8
  import { P as b } from "./pkt-slot-controller-BPGj-LC5.js";
10
- var S = Object.defineProperty, D = Object.getOwnPropertyDescriptor, p = (o, s, r, l) => {
11
- for (var t = l > 1 ? void 0 : l ? D(s, r) : s, i = o.length - 1, h; i >= 0; i--)
12
- (h = o[i]) && (t = (l ? h(s, r, t) : h(t)) || t);
13
- return l && t && S(s, r, t), t;
9
+ var S = Object.defineProperty, D = Object.getOwnPropertyDescriptor, p = (o, s, l, n) => {
10
+ for (var t = n > 1 ? void 0 : n ? D(s, l) : s, i = o.length - 1, h; i >= 0; i--)
11
+ (h = o[i]) && (t = (n ? h(s, l, t) : h(t)) || t);
12
+ return n && t && S(s, l, t), t;
14
13
  };
15
14
  let e = class extends c {
16
15
  constructor() {
17
- super(), this.defaultSlot = w(), this.forId = k(), this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = v.props.helptextDropdownButton.default, this.isHelpTextOpen = !1, this.filledSlots = /* @__PURE__ */ new Set(), this.slotController = new b(this, this.defaultSlot);
16
+ super(), this.defaultSlot = _(), this.forId = k(), this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = v.props.helptextDropdownButton.default, this.isHelpTextOpen = !1, this.filledSlots = /* @__PURE__ */ new Set(), this.slotController = new b(this, this.defaultSlot);
18
17
  }
19
18
  updateSlots(o) {
20
19
  this.filledSlots = new Set(o);
@@ -31,7 +30,7 @@ let e = class extends c {
31
30
  }, s = d({
32
31
  "pkt-inputwrapper__helptext-container": !0,
33
32
  "pkt-inputwrapper__has-helptext": this.helptext || this.helptextDropdown || this.filledSlots.size > 0
34
- }), r = () => this.helptextDropdown ? a`<div class="pkt-inputwrapper__helptext-expandable">
33
+ }), l = () => this.helptextDropdown ? a`<div class="pkt-inputwrapper__helptext-expandable">
35
34
  <button
36
35
  class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
37
36
  type="button"
@@ -55,24 +54,24 @@ let e = class extends c {
55
54
  </div>` : f;
56
55
  return a`${a`<div class="${s}">
57
56
  <div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
58
- <div class="pkt-contents" ${_(this.defaultSlot)} name="helptext"></div>
57
+ <div class="pkt-contents" ${m(this.defaultSlot)} name="helptext"></div>
59
58
  ${this.helptext && x(this.helptext)}
60
59
  </div>
61
- ${r()}
60
+ ${l()}
62
61
  </div>`}`;
63
62
  }
64
63
  };
65
64
  p([
66
- n({ type: String, reflect: !0 })
65
+ r({ type: String, reflect: !0 })
67
66
  ], e.prototype, "forId", 2);
68
67
  p([
69
- n({ type: String })
68
+ r({ type: String })
70
69
  ], e.prototype, "helptext", 2);
71
70
  p([
72
- n({ type: String })
71
+ r({ type: String })
73
72
  ], e.prototype, "helptextDropdown", 2);
74
73
  p([
75
- n({ type: String })
74
+ r({ type: String })
76
75
  ], e.prototype, "helptextDropdownButton", 2);
77
76
  p([
78
77
  u()
@@ -81,7 +80,7 @@ p([
81
80
  u()
82
81
  ], e.prototype, "filledSlots", 2);
83
82
  e = p([
84
- m("pkt-helptext")
83
+ w("pkt-helptext")
85
84
  ], e);
86
85
  export {
87
86
  e as P
@@ -0,0 +1,24 @@
1
+ "use strict";const t=require("./element-6DBpyGQm.cjs"),x=require("./ref-iJtiv3o2.cjs"),h=require("./icon-B_ryAy4Q.cjs"),u=require("./class-map-BBG2gMX4.cjs"),a=require("./state-DPobt-Yz.cjs"),c=require("./stringutils-CkVRq4jP.cjs"),d=require("./input-wrapper-EoSAbU-U.cjs"),k=require("./pkt-slot-controller-BzddBp7z.cjs");var w=Object.defineProperty,_=Object.getOwnPropertyDescriptor,n=(o,p,r,l)=>{for(var e=l>1?void 0:l?_(p,r):p,s=o.length-1,i;s>=0;s--)(i=o[s])&&(e=(l?i(p,r,e):i(e))||e);return l&&e&&w(p,r,e),e};exports.PktHelptext=class extends t.PktElement{constructor(){super(),this.defaultSlot=x.e(),this.forId=c.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new k.PktSlotController(this,this.defaultSlot)}updateSlots(p){this.filledSlots=new Set(p)}render(){const p=()=>{const s=!this.isHelpTextOpen;this.isHelpTextOpen=s,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:s}}))},r=u.e({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),l=()=>this.helptextDropdown?t.x`<div class="pkt-inputwrapper__helptext-expandable">
2
+ <button
3
+ class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
4
+ type="button"
5
+ @click=${p}
6
+ >
7
+ <pkt-icon
8
+ class="pkt-btn__icon"
9
+ name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
10
+ ></pkt-icon>
11
+ <span class="pkt-btn__text">${h.o(this.helptextDropdownButton)}</span>
12
+ </button>
13
+ <div
14
+ class="${u.e({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
15
+ >
16
+ ${h.o(this.helptextDropdown)}
17
+ </div>
18
+ </div>`:t.E,e=()=>t.x`<div class="${r}">
19
+ <div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
20
+ <div class="pkt-contents" ${x.n(this.defaultSlot)} name="helptext"></div>
21
+ ${this.helptext&&h.o(this.helptext)}
22
+ </div>
23
+ ${l()}
24
+ </div>`;return t.x`${e()}`}};n([t.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"forId",2);n([t.n({type:String})],exports.PktHelptext.prototype,"helptext",2);n([t.n({type:String})],exports.PktHelptext.prototype,"helptextDropdown",2);n([t.n({type:String})],exports.PktHelptext.prototype,"helptextDropdownButton",2);n([a.r()],exports.PktHelptext.prototype,"isHelpTextOpen",2);n([a.r()],exports.PktHelptext.prototype,"filledSlots",2);exports.PktHelptext=n([t.t("pkt-helptext")],exports.PktHelptext);
@@ -1,9 +1,9 @@
1
- "use strict";const f=require("./element-DUJa1sRq.cjs"),o=require("./lit-element-DHqqtYbj.cjs"),a=require("./directive-C7oCP5Bh.cjs");/**
1
+ "use strict";const o=require("./element-6DBpyGQm.cjs"),a=require("./directive-C7oCP5Bh.cjs");/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */class h extends a.i{constructor(t){if(super(t),this.it=o.E,t.type!==a.t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===o.E||t==null)return this._t=void 0,this.it=t;if(t===o.T)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;const s=[t];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}h.directiveName="unsafeHTML",h.resultType=1;const g=a.e(h);/**
5
+ */class h extends a.i{constructor(t){if(super(t),this.it=o.E,t.type!==a.t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===o.E||t==null)return this._t=void 0,this.it=t;if(t===o.T)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;const s=[t];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}h.directiveName="unsafeHTML",h.resultType=1;const f=a.e(h);/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */class d extends h{}d.directiveName="unsafeSVG",d.resultType=2;const w=a.e(d);var v=Object.defineProperty,P=Object.getOwnPropertyDescriptor,r=(e,t,s,n)=>{for(var i=n>1?void 0:n?P(t,s):t,l=e.length-1,p;l>=0;l--)(p=e[l])&&(i=(n?p(t,s,i):p(i))||i);return n&&i&&v(t,s,i),i};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch;window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/latest/icons/";const k=e=>new Promise(t=>setTimeout(t,e)),c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',u={},y=async(e,t)=>{let s=0;for(;u[t+e+".svg"]==="fetching"&&(s++,!(s>50));)await k(50);return localStorage.getItem(t+e+".svg")?Promise.resolve(localStorage.getItem(t+e+".svg")):typeof window.pktFetch=="function"?(u[t+e+".svg"]="fetching",Promise.resolve(window.pktFetch(t+e+".svg").then(n=>n.ok?n.text():(console.error("Missing icon: "+t+e+".svg"),c)).then(n=>(n!==c&&localStorage.setItem(t+e+".svg",n),u[t+e+".svg"]="fetched",n)))):Promise.resolve(c)};exports.PktIcon=class extends f.PktElement{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=w(c),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,s,n){super.attributeChangedCallback(t,s,n),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path,window.pktIconPath),this.icon=w(await y(this.name||"",this.path).then(s=>s)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return o.x`${this.name&&this.icon}`}};r([o.n({type:String,reflect:!1})],exports.PktIcon.prototype,"path",2);r([o.n({type:String,reflect:!0})],exports.PktIcon.prototype,"name",2);r([o.n({type:SVGElement})],exports.PktIcon.prototype,"icon",2);r([o.n({type:Array,noAccessor:!0})],exports.PktIcon.prototype,"_updatedProps",2);exports.PktIcon=r([o.t("pkt-icon")],exports.PktIcon);exports.o=g;
9
+ */class d extends h{}d.directiveName="unsafeSVG",d.resultType=2;const w=a.e(d);var g=Object.defineProperty,v=Object.getOwnPropertyDescriptor,r=(e,t,s,n)=>{for(var i=n>1?void 0:n?v(t,s):t,l=e.length-1,p;l>=0;l--)(p=e[l])&&(i=(n?p(t,s,i):p(i))||i);return n&&i&&g(t,s,i),i};window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch;window.pktIconPath=window.pktIconPath||"https://punkt-cdn.oslo.kommune.no/latest/icons/";const P=e=>new Promise(t=>setTimeout(t,e)),c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',u={},k=async(e,t)=>{let s=0;for(;u[t+e+".svg"]==="fetching"&&(s++,!(s>50));)await P(50);return localStorage.getItem(t+e+".svg")?Promise.resolve(localStorage.getItem(t+e+".svg")):typeof window.pktFetch=="function"?(u[t+e+".svg"]="fetching",Promise.resolve(window.pktFetch(t+e+".svg").then(n=>n.ok?n.text():(console.error("Missing icon: "+t+e+".svg"),c)).then(n=>(n!==c&&localStorage.setItem(t+e+".svg",n),u[t+e+".svg"]="fetched",n)))):Promise.resolve(c)};exports.PktIcon=class extends o.PktElement{constructor(){super(...arguments),this.path=window.pktIconPath,this.name="",this.icon=w(c),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,s,n){super.attributeChangedCallback(t,s,n),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path,window.pktIconPath),this.icon=w(await k(this.name||"",this.path).then(s=>s)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return o.x`${this.name&&this.icon}`}};r([o.n({type:String,reflect:!1})],exports.PktIcon.prototype,"path",2);r([o.n({type:String,reflect:!0})],exports.PktIcon.prototype,"name",2);r([o.n({type:SVGElement})],exports.PktIcon.prototype,"icon",2);r([o.n({type:Array,noAccessor:!0})],exports.PktIcon.prototype,"_updatedProps",2);exports.PktIcon=r([o.t("pkt-icon")],exports.PktIcon);exports.o=f;
@@ -1,5 +1,4 @@
1
- import { P as v } from "./element-Cfyyg4nF.js";
2
- import { E as f, T as m, x as y, n as p, t as P } from "./lit-element-DcUrSbRH.js";
1
+ import { E as f, T as v, P as m, x as y, n as h, a as P } from "./element-CgEWt74-.js";
3
2
  import { e as g, i as k, t as _ } from "./directive-oAbCiebi.js";
4
3
  /**
5
4
  * @license
@@ -12,7 +11,7 @@ class a extends k {
12
11
  }
13
12
  render(t) {
14
13
  if (t === f || t == null) return this._t = void 0, this.it = t;
15
- if (t === m) return t;
14
+ if (t === v) return t;
16
15
  if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
17
16
  if (t === this.it) return this._t;
18
17
  this.it = t;
@@ -21,7 +20,7 @@ class a extends k {
21
20
  }
22
21
  }
23
22
  a.directiveName = "unsafeHTML", a.resultType = 1;
24
- const F = g(a);
23
+ const x = g(a);
25
24
  /**
26
25
  * @license
27
26
  * Copyright 2017 Google LLC
@@ -32,8 +31,8 @@ class d extends a {
32
31
  d.directiveName = "unsafeSVG", d.resultType = 2;
33
32
  const w = g(d);
34
33
  var I = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (e, t, s, o) => {
35
- for (var i = o > 1 ? void 0 : o ? b(t, s) : t, h = e.length - 1, l; h >= 0; h--)
36
- (l = e[h]) && (i = (o ? l(t, s, i) : l(i)) || i);
34
+ for (var i = o > 1 ? void 0 : o ? b(t, s) : t, p = e.length - 1, l; p >= 0; p--)
35
+ (l = e[p]) && (i = (o ? l(t, s, i) : l(i)) || i);
37
36
  return o && i && I(t, s, i), i;
38
37
  };
39
38
  window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch;
@@ -46,7 +45,7 @@ const C = (e) => new Promise((t) => setTimeout(t, e)), c = '<svg xmlns="http://w
46
45
  window.pktFetch(t + e + ".svg").then((o) => o.ok ? o.text() : (console.error("Missing icon: " + t + e + ".svg"), c)).then((o) => (o !== c && localStorage.setItem(t + e + ".svg", o), u[t + e + ".svg"] = "fetched", o))
47
46
  )) : Promise.resolve(c);
48
47
  };
49
- let r = class extends v {
48
+ let r = class extends m {
50
49
  constructor() {
51
50
  super(...arguments), this.path = window.pktIconPath, this.name = "", this.icon = w(c), this._updatedProps = [];
52
51
  }
@@ -69,21 +68,21 @@ let r = class extends v {
69
68
  }
70
69
  };
71
70
  n([
72
- p({ type: String, reflect: !1 })
71
+ h({ type: String, reflect: !1 })
73
72
  ], r.prototype, "path", 2);
74
73
  n([
75
- p({ type: String, reflect: !0 })
74
+ h({ type: String, reflect: !0 })
76
75
  ], r.prototype, "name", 2);
77
76
  n([
78
- p({ type: SVGElement })
77
+ h({ type: SVGElement })
79
78
  ], r.prototype, "icon", 2);
80
79
  n([
81
- p({ type: Array, noAccessor: !0 })
80
+ h({ type: Array, noAccessor: !0 })
82
81
  ], r.prototype, "_updatedProps", 2);
83
82
  r = n([
84
83
  P("pkt-icon")
85
84
  ], r);
86
85
  export {
87
86
  r as P,
88
- F as o
87
+ x as o
89
88
  };
@@ -1,4 +1,4 @@
1
- import { E as r } from "./lit-element-DcUrSbRH.js";
1
+ import { E as r } from "./element-CgEWt74-.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC
@@ -0,0 +1,5 @@
1
+ "use strict";const t=require("./element-6DBpyGQm.cjs");/**
2
+ * @license
3
+ * Copyright 2018 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const o=e=>e??t.E;exports.o=o;
package/dist/index.d.ts CHANGED
@@ -702,40 +702,18 @@ export declare class PktDatepicker extends PktInputElement {
702
702
  }
703
703
 
704
704
  /**
705
- * Base class for all Punkt elements
706
- * @extends LitElement
705
+ * Base class for Punkt light DOM elements
706
+ * This class extends PktShadowElement but renders in light DOM instead of shadow DOM
707
+ * @extends PktShadowElement
707
708
  */
708
- declare class PktElement<T = {}> extends LitElement {
709
- [key: string]: any;
710
- strings: any;
711
- role: string | null;
712
- /**
713
- * Here to support prop typing in Vue
714
- */
715
- $props: T & Props;
716
- /**
717
- * Runs on mount, used to set up various values and whatever you need to run
718
- */
719
- connectedCallback(): void;
709
+ declare class PktElement<T = {}> extends PktShadowElement<T> {
720
710
  /**
721
711
  * Make sure the component renders in light DOM instead of shadow DOM
722
712
  */
723
713
  createRenderRoot(): this;
724
- /**
725
- * Add support for Hot Module Reloading in dev mode
726
- */
727
- hotReplacedCallback(): void;
728
- /**
729
- * Go through changed properties and find ReactNodes to render out
730
- */
731
- protected update(changedProperties: PropertyValues): void;
732
- /**
733
- * Add extra stuff here whenever we decide what should be added here…
734
- */
735
- constructor();
736
714
  }
737
715
 
738
- export declare class PktHeading extends LitElement implements IPktHeading {
716
+ export declare class PktHeading extends PktShadowElement<IPktHeading> implements IPktHeading {
739
717
  size: TPktHeadingSize;
740
718
  level: TPktHeadingLevel;
741
719
  visuallyHidden: boolean;
@@ -1059,6 +1037,28 @@ export declare class PktSelect extends PktInputElement implements IPktSelect {
1059
1037
  private returnNumberOrNull;
1060
1038
  }
1061
1039
 
1040
+ /**
1041
+ * Base class for Punkt shadow DOM elements
1042
+ * @extends LitElement
1043
+ */
1044
+ declare class PktShadowElement<T = {}> extends LitElement {
1045
+ [key: string]: any;
1046
+ strings: any;
1047
+ role: string | null;
1048
+ /**
1049
+ * Here to support prop typing in Vue
1050
+ */
1051
+ $props: T & Props;
1052
+ /**
1053
+ * Add support for Hot Module Reloading in dev mode
1054
+ */
1055
+ hotReplacedCallback(): void;
1056
+ /**
1057
+ * Go through changed properties and find ReactNodes to render out
1058
+ */
1059
+ protected update(changedProperties: PropertyValues): void;
1060
+ }
1061
+
1062
1062
  /**
1063
1063
  * Controls the distribution of nodes into slots WITHOUT using Shadow DOM.
1064
1064
  * This controller provides a lightweight alternative to Shadow DOM slot distribution,
@@ -0,0 +1 @@
1
+ "use strict";const r=require("./element-6DBpyGQm.cjs"),Mt=require("./state-DPobt-Yz.cjs"),kt=require("./stringutils-CkVRq4jP.cjs"),Vt=require("./input-wrapper-EoSAbU-U.cjs");(function(){(function(E){const s=new WeakMap,h=new WeakMap,p=new WeakMap,u=new WeakMap,y=new WeakMap,k=new WeakMap,F=new WeakMap,g=new WeakMap,C=new WeakMap,V=new WeakMap,S=new WeakMap,T=new WeakMap,$=new WeakMap,U=new WeakMap,I=new WeakMap,x={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},nt=(e,t)=>{for(let i in x){t[i]=null;let a=null;const n=x[i];Object.defineProperty(t,i,{get(){return a},set(o){a=o,e.isConnected?M(e,n,o):V.set(e,t)}})}};function z(e){const t=u.get(e),{form:i}=t;X(e,i,t),Q(e,t.labels)}const K=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return u.has(o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let a=i.nextNode();const n=!t||e.disabled;for(;a;)a.formDisabledCallback&&n&&W(a,e.disabled),a=i.nextNode()},j={attributes:!0,attributeFilter:["disabled","name"]},L=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?W(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&K(i)),t.attributeName==="name"&&i.constructor.formAssociated){const a=u.get(i),n=C.get(i);a.setFormValue(n)}}}):{};function D(e){e.forEach(t=>{const{addedNodes:i,removedNodes:a}=t,n=Array.from(i),o=Array.from(a);n.forEach(l=>{var m;if(u.has(l)&&l.constructor.formAssociated&&z(l),V.has(l)){const f=V.get(l);Object.keys(x).filter(b=>f[b]!==null).forEach(b=>{M(l,x[b],f[b])}),V.delete(l)}if(I.has(l)){const f=I.get(l);M(l,"internals-valid",f.validity.valid.toString()),M(l,"internals-invalid",(!f.validity.valid).toString()),M(l,"aria-invalid",(!f.validity.valid).toString()),I.delete(l)}if(l.localName==="form"){const f=g.get(l),w=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode(q){return u.has(q)&&q.constructor.formAssociated&&!(f&&f.has(q))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let b=w.nextNode();for(;b;)z(b),b=w.nextNode()}l.localName==="fieldset"&&((m=L.observe)===null||m===void 0||m.call(L,l,j),K(l,!0))}),o.forEach(l=>{const m=u.get(l);m&&p.get(m)&&G(m),F.has(l)&&F.get(l).disconnect()})})}function ot(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(a=>{const n=$.get(t.target);u.has(a)&&Z(a),n.disconnect()})})}const lt=e=>{var t,i;const a=new MutationObserver(ot);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=a.observe)===null||i===void 0||i.call(a,e,{childList:!0}),$.set(e,a)};O()&&new MutationObserver(D);const P={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},W=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},G=e=>{p.get(e).forEach(i=>{i.remove()}),p.set(e,[])},J=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),p.get(t).push(i),i},ct=(e,t)=>{var i;p.set(t,[]),(i=L.observe)===null||i===void 0||i.call(L,e,j)},Q=(e,t)=>{if(t.length){Array.from(t).forEach(a=>a.addEventListener("click",e.click.bind(e)));let i=t[0].id;t[0].id||(i=`${t[0].htmlFor}_Label`,t[0].id=i),M(e,"aria-labelledby",i)}},N=e=>{const t=Array.from(e.elements).filter(o=>!o.tagName.includes("-")&&o.validity).map(o=>o.validity.valid),i=g.get(e)||[],a=Array.from(i).filter(o=>o.isConnected).map(o=>u.get(o).validity.valid),n=[...t,...a].includes(!1);e.toggleAttribute("internals-invalid",n),e.toggleAttribute("internals-valid",!n)},dt=e=>{N(R(e.target))},ht=e=>{N(R(e.target))},ut=e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map(i=>`${i}:not([disabled])`).map(i=>`${i}:not([form])${e.id?`,${i}[form='${e.id}']`:""}`).join(",");e.addEventListener("click",i=>{if(i.target.closest(t)){const n=g.get(e);if(e.noValidate)return;n.size&&Array.from(n).reverse().map(m=>u.get(m).reportValidity()).includes(!1)&&i.preventDefault()}})},ft=e=>{const t=g.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},X=(e,t,i)=>{if(t){const a=g.get(t);if(a)a.add(e);else{const n=new Set;n.add(e),g.set(t,n),ut(t),t.addEventListener("reset",ft),t.addEventListener("input",dt),t.addEventListener("change",ht)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),N(t)}},R=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=R(t)),t},v=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},Y=(e,t,i)=>{const a=g.get(e);return a&&a.size&&a.forEach(n=>{u.get(n)[i]()||(t=!1)}),t},Z=e=>{if(e.constructor.formAssociated){const t=u.get(e),{labels:i,form:a}=t;Q(e,i),X(e,a,t)}};function O(){return typeof MutationObserver<"u"}class pt{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const mt=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),yt=(e,t,i)=>(e.valid=gt(t),Object.keys(t).forEach(a=>e[a]=t[a]),i&&N(i),e),gt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},H=new WeakMap;function tt(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class B extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");H.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);const i=super.add(t),a=H.get(this),n=`state${t}`;return a.isConnected?tt(a,n):setTimeout(()=>{tt(a,n)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),a=H.get(this);return a.isConnected?(a.toggleAttribute(`state${t}`,!1),a.part&&a.part.remove(`state${t}`)):setTimeout(()=>{a.toggleAttribute(`state${t}`,!1),a.part&&a.part.remove(`state${t}`)}),i}}function et(e,t,i,a){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:t.get(e)}function bt(e,t,i,a,n){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var A;class vt{constructor(t){A.set(this,void 0),bt(this,A,t);for(let i=0;i<t.length;i++){let a=t[i];this[i]=a,a.hasAttribute("name")&&(this[a.getAttribute("name")]=a)}Object.freeze(this)}get length(){return et(this,A,"f").length}[(A=new WeakMap,Symbol.iterator)](){return et(this,A,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function wt(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=a;function i(...o){let l=e.apply(this,o);return Y(this,l,"checkValidity")}function a(...o){let l=t.apply(this,o);return Y(this,l,"reportValidity")}const{get:n}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...o){const l=n.call(this,...o),m=Array.from(g.get(this)||[]);if(m.length===0)return l;const f=Array.from(l).concat(m).sort((w,b)=>w.compareDocumentPosition?w.compareDocumentPosition(b)&2?1:-1:0);return new vt(f)}})}class it{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),a=new pt;this.states=new B(t),s.set(this,t),h.set(this,a),u.set(t,this),nt(t,this),ct(t,this),Object.seal(this),i instanceof DocumentFragment&&lt(i)}checkValidity(){const t=s.get(this);if(v(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=h.get(this);if(!i.valid){const a=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(a)}return i.valid}get form(){const t=s.get(this);v(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let i;return t.constructor.formAssociated===!0&&(i=R(t)),i}get labels(){const t=s.get(this);v(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const i=t.getAttribute("id"),a=t.getRootNode();return a&&i?a.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=s.get(this);if(v(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=this.checkValidity(),a=T.get(this);if(a&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&a&&(t.focus(),a.focus()),i}setFormValue(t){const i=s.get(this);if(v(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),G(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const a=J(i,this);a.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([a,n])=>{if(typeof n=="string"){const o=J(i,this);o.name=a,o.value=n}});C.set(i,t)}setValidity(t,i,a){const n=s.get(this);if(v(n,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");T.set(this,a);const o=h.get(this),l={};for(const w in t)l[w]=t[w];Object.keys(l).length===0&&mt(o);const m=Object.assign(Object.assign({},o),l);delete m.valid;const{valid:f}=yt(o,m,this.form);if(!f&&!i)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");y.set(this,f?"":i),n.isConnected?(n.toggleAttribute("internals-invalid",!f),n.toggleAttribute("internals-valid",f),M(n,"aria-invalid",`${!f}`)):I.set(n,this)}get shadowRoot(){const t=s.get(this),i=S.get(t);return i||null}get validationMessage(){const t=s.get(this);return v(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),y.get(this)}get validity(){const t=s.get(this);return v(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),h.get(this)}get willValidate(){const t=s.get(this);return v(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function Et(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const i=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(a=>a in i.internals)}let at=!1,st=!1;function _(e){st||(st=!0,window.CustomStateSet=B,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new B(this),i}))}function rt(e=!0){if(!at){if(at=!0,typeof window<"u"&&(window.ElementInternals=it),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,a,n){if(a.formAssociated){const o=a.prototype.connectedCallback;a.prototype.connectedCallback=function(){U.has(this)||(U.set(this,!0),this.hasAttribute("disabled")&&W(this,!0)),o!=null&&o.apply(this),Z(this)}}t.call(this,i,a,n)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new it(this)}),typeof Element<"u"){let t=function(...a){const n=i.apply(this,a);if(S.set(this,n),O()){const o=new MutationObserver(D);window.ShadyDOM?o.observe(this,P):o.observe(n,P),F.set(this,o)}return n};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(D).observe(document.documentElement,P),typeof HTMLFormElement<"u"&&wt(),(e||typeof window<"u"&&!window.CustomStateSet)&&_()}}return!!customElements.polyfillWrapFlushCallback||(Et()?typeof window<"u"&&!window.CustomStateSet&&_(HTMLElement.prototype.attachInternals):rt(!1)),E.forceCustomStateSetPolyfill=_,E.forceElementInternalsPolyfill=rt,Object.defineProperty(E,"__esModule",{value:!0}),E})({})})();var Ft=Object.defineProperty,d=(E,s,h,p)=>{for(var u=void 0,y=E.length-1,k;y>=0;y--)(k=E[y])&&(u=k(s,h,u)||u);return u&&Ft(s,h,u),u};class c extends r.PktElement{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=kt.uuidish(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Vt.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.translations.forms.labels.optional,this.requiredText=r.translations.forms.labels.required,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(s){var h,p,u,y,k,F,g,C,V,S,T;s&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.translations.forms.messages.required,s):(h=s.validity)!=null&&h.typeMismatch||(p=s.validity)!=null&&p.badInput?this.internals.setValidity({typeMismatch:!0},r.translations.forms.messages.invalid,s):(u=s.validity)!=null&&u.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.translations.forms.messages.invalidPattern,s):(y=s.validity)!=null&&y.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.translations.forms.messages.tooShort,s):(k=s.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.translations.forms.messages.tooLong,s):(F=s.validity)!=null&&F.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.translations.forms.messages.rangeUnderflowMin.replace("{min}",(g=this.min)==null?void 0:g.toString()):r.translations.forms.messages.rangeUnderflow,s):(C=s.validity)!=null&&C.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.translations.forms.messages.invalid,s):(V=s.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.translations.forms.messages.rangeOverflowMax.replace("{max}",(S=this.max)==null?void 0:S.toString()):r.translations.forms.messages.rangeOverflow,s):(T=s.validity)!=null&&T.customError?this.internals.setValidity({customError:!0},s.validationMessage,s):this.internals.setValidity({}))}setFormValue(s){if(this.internals)if(Array.isArray(s)){const h=new FormData;s.forEach(p=>{h.append(this.name,p)}),this.internals.setFormValue(h)}else this.internals.setFormValue(s)}valueChecked(s){if(!this.touched)return;const h=this.internals.form||this.closest("form"),p=h?new FormData(h):null;h&&h.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(u=>{const y=u;y.name===this.name&&y.value!==this.value&&y.checked&&(y.checked=!1)}),typeof s=="string"?(this.checked=s==="true",this.internals.ariaChecked=s==="true"):typeof s=="boolean"&&(this.checked=s,this.internals.ariaChecked=s),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),p&&p.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),p&&p.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(s,h){(h!==this.value||h!==this._value)&&(typeof s=="string"?((this.multiple||this.range)&&s.includes(",")&&(s=s.split(",")),this.value=s,this._value=Array.isArray(s)?s:[s]):Array.isArray(s)?(this.value=this.multiple||this.range?s:s[0],this._value=s):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&h&&h.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(h==null?void 0:h.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const s=this.multiple||this.range?[]:"";this.value=s,this.internals.setFormValue(s),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:s,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(s){if(!this.touched){this.touched=!0,s&&this.setFormValue(s);return}typeof s!="string"&&!Array.isArray(s)||((this.range||this.multiple)&&!Array.isArray(s)&&s.includes(",")&&(s=s.split(",")),!this.multiple&&!this.range&&Array.isArray(s)&&(s=s[0]),this.setFormValue(s),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:s,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(s=>{s.selected=!1}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(s){super.updated(s),s.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(s){if(super.firstUpdated(s),!this.form){const h=this.internals.form||this.closest("form");this.form=h}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const h=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=h,this.internals.setFormValue(h?this.value||"on":"",h?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}}d([r.n()],c.prototype,"defaultValue");d([r.n({type:Boolean,reflect:!0})],c.prototype,"disabled");d([r.n({type:Boolean,reflect:!0})],c.prototype,"readonly");d([r.n({type:Boolean,reflect:!0})],c.prototype,"required");d([r.n({type:Number,reflect:!0})],c.prototype,"max");d([r.n({type:Number,reflect:!0})],c.prototype,"maxlength");d([r.n({type:Number,reflect:!0})],c.prototype,"min");d([r.n({type:Number,reflect:!0})],c.prototype,"minlength");d([r.n({type:Number,reflect:!0})],c.prototype,"step");d([r.n({type:String})],c.prototype,"ariaDescribedBy");d([r.n({type:String})],c.prototype,"ariaLabelledby");d([r.n({type:String,reflect:!0})],c.prototype,"name");d([r.n({type:String,reflect:!0})],c.prototype,"pattern");d([r.n({type:String,reflect:!0})],c.prototype,"placeholder");d([r.n({type:String,reflect:!0})],c.prototype,"id");d([r.n({type:Boolean})],c.prototype,"counter");d([r.n({type:Boolean})],c.prototype,"hasError");d([r.n({type:Boolean})],c.prototype,"inline");d([r.n({type:Boolean})],c.prototype,"hasFieldset");d([r.n({type:Boolean})],c.prototype,"optionalTag");d([r.n({type:Boolean})],c.prototype,"requiredTag");d([r.n({type:Boolean})],c.prototype,"skipForwardTestid");d([r.n({type:Boolean,reflect:!1})],c.prototype,"useWrapper");d([r.n({type:Boolean,reflect:!0})],c.prototype,"fullwidth");d([r.n({type:Number})],c.prototype,"counterMaxLength");d([r.n({type:String})],c.prototype,"errorMessage");d([r.n({type:String})],c.prototype,"helptext");d([r.n({type:String})],c.prototype,"helptextDropdown");d([r.n({type:String,reflect:!1})],c.prototype,"helptextDropdownButton");d([r.n({type:String})],c.prototype,"label");d([r.n({type:String,reflect:!1})],c.prototype,"optionalText");d([r.n({type:String,reflect:!1})],c.prototype,"requiredText");d([r.n({type:String,attribute:"data-testid"})],c.prototype,"dataTestid");d([Mt.r()],c.prototype,"touched");exports.PktInputElement=c;