@oslokommune/punkt-react 16.7.2 → 16.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,17 +33,17 @@
33
33
  return [];
34
34
  };
35
35
  }
36
- (function(X,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-router-dom"],o):(X=typeof globalThis<"u"?globalThis:X||self,o(X["punkt-react"]={},X.ReactJsxRuntime,X.React,X.ReactRouterDOM))})(this,(function(X,o,d,kc){"use strict";var nv=Object.defineProperty;var iv=(X,o,d)=>o in X?nv(X,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):X[o]=d;var pr=(X,o,d)=>iv(X,typeof o!="symbol"?o+"":o,d);const ba=d.createContext({}),yc=()=>d.useContext(ba),va=d.forwardRef(({compact:s=!1,skin:e="borderless",ariaLabelledBy:t,children:n,name:i,className:r},a)=>{const l=["pkt-accordion",s&&"pkt-accordion--compact",e&&`pkt-accordion--${e}`,r].filter(Boolean).join(" ");return o.jsx(ba.Provider,{value:{name:i},children:o.jsx("div",{ref:a,className:l,"data-testid":"pkt-accordion","aria-labelledby":t||void 0,children:n})})});va.displayName="PktAccordion";/**
36
+ (function(X,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-router-dom"],o):(X=typeof globalThis<"u"?globalThis:X||self,o(X["punkt-react"]={},X.ReactJsxRuntime,X.React,X.ReactRouterDOM))})(this,(function(X,o,d,gc){"use strict";var vb=Object.defineProperty;var yb=(X,o,d)=>o in X?vb(X,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):X[o]=d;var ur=(X,o,d)=>yb(X,typeof o!="symbol"?o+"":o,d);const fa=d.createContext({}),bc=()=>d.useContext(fa),ma=d.forwardRef(({compact:s=!1,skin:e="borderless",ariaLabelledBy:t,children:n,name:i,className:r},a)=>{const l=["pkt-accordion",s&&"pkt-accordion--compact",e&&`pkt-accordion--${e}`,r].filter(Boolean).join(" ");return o.jsx(fa.Provider,{value:{name:i},children:o.jsx("div",{ref:a,className:l,"data-testid":"pkt-accordion","aria-labelledby":t||void 0,children:n})})});ma.displayName="PktAccordion";/**
37
37
  * @license
38
38
  * Copyright 2018 Google LLC
39
39
  * SPDX-License-Identifier: BSD-3-Clause
40
- */const _c=new Set(["children","localName","ref","style","className"]),ka=new WeakMap,ya=(s,e,t,n,i)=>{const r=i==null?void 0:i[e];r===void 0?(s[e]=t,t==null&&e in HTMLElement.prototype&&s.removeAttribute(e)):t!==n&&((a,l,c)=>{let h=ka.get(a);h===void 0&&ka.set(a,h=new Map);let g=h.get(l);c!==void 0?g===void 0?(h.set(l,g={handleEvent:c}),a.addEventListener(l,g)):g.handleEvent=c:g!==void 0&&(h.delete(l),a.removeEventListener(l,g))})(s,r,t)},Bn=({react:s,tagName:e,elementClass:t,events:n,displayName:i})=>{const r=new Set(Object.keys(n??{})),a=s.forwardRef(((l,c)=>{const h=s.useRef(new Map),g=s.useRef(null),m={},f={};for(const[v,b]of Object.entries(l))_c.has(v)?m[v==="className"?"class":v]=b:r.has(v)||v in t.prototype?f[v]=b:m[v]=b;return s.useLayoutEffect((()=>{if(g.current===null)return;const v=new Map;for(const b in f)ya(g.current,b,l[b],h.current.get(b),n),h.current.delete(b),v.set(b,l[b]);for(const[b,w]of h.current)ya(g.current,b,void 0,w,n);h.current=v})),s.useLayoutEffect((()=>{var v;(v=g.current)==null||v.removeAttribute("defer-hydration")}),[]),m.suppressHydrationWarning=!0,s.createElement(e,{...m,ref:s.useCallback((v=>{g.current=v,typeof c=="function"?c(v):c!==null&&(c.current=v)}),[c])})}));return a.displayName=i??t.name,a};/**
40
+ */const kc=new Set(["children","localName","ref","style","className"]),ga=new WeakMap,ba=(s,e,t,n,i)=>{const r=i==null?void 0:i[e];r===void 0?(s[e]=t,t==null&&e in HTMLElement.prototype&&s.removeAttribute(e)):t!==n&&((a,l,c)=>{let h=ga.get(a);h===void 0&&ga.set(a,h=new Map);let g=h.get(l);c!==void 0?g===void 0?(h.set(l,g={handleEvent:c}),a.addEventListener(l,g)):g.handleEvent=c:g!==void 0&&(h.delete(l),a.removeEventListener(l,g))})(s,r,t)},Dn=({react:s,tagName:e,elementClass:t,events:n,displayName:i})=>{const r=new Set(Object.keys(n??{})),a=s.forwardRef(((l,c)=>{const h=s.useRef(new Map),g=s.useRef(null),m={},f={};for(const[k,b]of Object.entries(l))kc.has(k)?m[k==="className"?"class":k]=b:r.has(k)||k in t.prototype?f[k]=b:m[k]=b;return s.useLayoutEffect((()=>{if(g.current===null)return;const k=new Map;for(const b in f)ba(g.current,b,l[b],h.current.get(b),n),h.current.delete(b),k.set(b,l[b]);for(const[b,$]of h.current)ba(g.current,b,void 0,$,n);h.current=k})),s.useLayoutEffect((()=>{var k;(k=g.current)==null||k.removeAttribute("defer-hydration")}),[]),m.suppressHydrationWarning=!0,s.createElement(e,{...m,ref:s.useCallback((k=>{g.current=k,typeof c=="function"?c(k):c!==null&&(c.current=k)}),[c])})}));return a.displayName=i??t.name,a};/**
41
41
  * @license
42
42
  * Copyright 2017 Google LLC
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
- */const Ni=globalThis,_a=s=>s,Mi=Ni.trustedTypes,$a=Mi?Mi.createPolicy("lit-html",{createHTML:s=>s}):void 0,wa="$lit$",Ds=`lit$${Math.random().toFixed(9).slice(2)}$`,xa="?"+Ds,$c=`<${xa}>`,js=document,Vn=()=>js.createComment(""),Hn=s=>s===null||typeof s!="object"&&typeof s!="function",fr=Array.isArray,wc=s=>fr(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",mr=`[
45
- \f\r]`,Un=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Sa=/-->/g,Ca=/>/g,Ws=RegExp(`>|${mr}(?:([^\\s"'>=/]+)(${mr}*=${mr}*(?:[^
46
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ta=/'/g,Da=/"/g,Na=/^(?:script|style|textarea|title)$/i,xc=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),y=xc(1),yt=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),Ma=new WeakMap,zs=js.createTreeWalker(js,129);function Oa(s,e){if(!fr(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return $a!==void 0?$a.createHTML(e):e}const Sc=(s,e)=>{const t=s.length-1,n=[];let i,r=e===2?"<svg>":e===3?"<math>":"",a=Un;for(let l=0;l<t;l++){const c=s[l];let h,g,m=-1,f=0;for(;f<c.length&&(a.lastIndex=f,g=a.exec(c),g!==null);)f=a.lastIndex,a===Un?g[1]==="!--"?a=Sa:g[1]!==void 0?a=Ca:g[2]!==void 0?(Na.test(g[2])&&(i=RegExp("</"+g[2],"g")),a=Ws):g[3]!==void 0&&(a=Ws):a===Ws?g[0]===">"?(a=i??Un,m=-1):g[1]===void 0?m=-2:(m=a.lastIndex-g[2].length,h=g[1],a=g[3]===void 0?Ws:g[3]==='"'?Da:Ta):a===Da||a===Ta?a=Ws:a===Sa||a===Ca?a=Un:(a=Ws,i=void 0);const v=a===Ws&&s[l+1].startsWith("/>")?" ":"";r+=a===Un?c+$c:m>=0?(n.push(h),c.slice(0,m)+wa+c.slice(m)+Ds+v):c+Ds+(m===-2?l:v)}return[Oa(s,r+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let gr=class gc{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let r=0,a=0;const l=e.length-1,c=this.parts,[h,g]=Sc(e,t);if(this.el=gc.createElement(h,n),zs.currentNode=this.el.content,t===2||t===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(i=zs.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const m of i.getAttributeNames())if(m.endsWith(wa)){const f=g[a++],v=i.getAttribute(m).split(Ds),b=/([.?@])?(.*)/.exec(f);c.push({type:1,index:r,name:b[2],strings:v,ctor:b[1]==="."?Tc:b[1]==="?"?Dc:b[1]==="@"?Nc:Ei}),i.removeAttribute(m)}else m.startsWith(Ds)&&(c.push({type:6,index:r}),i.removeAttribute(m));if(Na.test(i.tagName)){const m=i.textContent.split(Ds),f=m.length-1;if(f>0){i.textContent=Mi?Mi.emptyScript:"";for(let v=0;v<f;v++)i.append(m[v],Vn()),zs.nextNode(),c.push({type:2,index:++r});i.append(m[f],Vn())}}}else if(i.nodeType===8)if(i.data===xa)c.push({type:2,index:r});else{let m=-1;for(;(m=i.data.indexOf(Ds,m+1))!==-1;)c.push({type:7,index:r}),m+=Ds.length-1}r++}}static createElement(e,t){const n=js.createElement("template");return n.innerHTML=e,n}};function fn(s,e,t=s,n){var i,r;if(e===yt)return e;let a=n!==void 0?(i=t._$Co)==null?void 0:i[n]:t._$Cl;const l=Hn(e)?void 0:e._$litDirective$;return(a==null?void 0:a.constructor)!==l&&((r=a==null?void 0:a._$AO)==null||r.call(a,!1),l===void 0?a=void 0:(a=new l(s),a._$AT(s,t,n)),n!==void 0?(t._$Co??(t._$Co=[]))[n]=a:t._$Cl=a),a!==void 0&&(e=fn(s,a._$AS(s,e.values),a,n)),e}let Cc=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){const{el:{content:t},parts:n}=this._$AD,i=((e==null?void 0:e.creationScope)??js).importNode(t,!0);zs.currentNode=i;let r=zs.nextNode(),a=0,l=0,c=n[0];for(;c!==void 0;){if(a===c.index){let h;c.type===2?h=new Oi(r,r.nextSibling,this,e):c.type===1?h=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(h=new Mc(r,this,e)),this._$AV.push(h),c=n[++l]}a!==(c==null?void 0:c.index)&&(r=zs.nextNode(),a++)}return zs.currentNode=js,i}p(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},Oi=class bc{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=x,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=fn(this,e,t),Hn(e)?e===x||e==null||e===""?(this._$AH!==x&&this._$AR(),this._$AH=x):e!==this._$AH&&e!==yt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):wc(e)?this.k(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!==x&&Hn(this._$AH)?this._$AA.nextSibling.data=e:this.T(js.createTextNode(e)),this._$AH=e}$(e){var t;const{values:n,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=gr.createElement(Oa(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)==null?void 0:t._$AD)===r)this._$AH.p(n);else{const a=new Cc(r,this),l=a.u(this.options);a.p(n),this.T(l),this._$AH=a}}_$AC(e){let t=Ma.get(e.strings);return t===void 0&&Ma.set(e.strings,t=new gr(e)),t}k(e){fr(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const r of e)i===t.length?t.push(n=new bc(this.O(Vn()),this.O(Vn()),this,this.options)):n=t[i],n._$AI(r),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,t);e!==this._$AB;){const i=_a(e).nextSibling;_a(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Ei=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,r){this.type=1,this._$AH=x,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=x}_$AI(e,t=this,n,i){const r=this.strings;let a=!1;if(r===void 0)e=fn(this,e,t,0),a=!Hn(e)||e!==this._$AH&&e!==yt,a&&(this._$AH=e);else{const l=e;let c,h;for(e=r[0],c=0;c<r.length-1;c++)h=fn(this,l[n+c],t,c),h===yt&&(h=this._$AH[c]),a||(a=!Hn(h)||h!==this._$AH[c]),h===x?e=x:e!==x&&(e+=(h??"")+r[c+1]),this._$AH[c]=h}a&&!i&&this.j(e)}j(e){e===x?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Tc=class extends Ei{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===x?void 0:e}},Dc=class extends Ei{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==x)}},Nc=class extends Ei{constructor(e,t,n,i,r){super(e,t,n,i,r),this.type=5}_$AI(e,t=this){if((e=fn(this,e,t,0)??x)===yt)return;const n=this._$AH,i=e===x&&n!==x||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==x&&(n===x||i);i&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},Mc=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){fn(this,e)}};const Oc={I:Oi},Ea=Ni.litHtmlPolyfillSupport;Ea==null||Ea(gr,Oi),(Ni.litHtmlVersions??(Ni.litHtmlVersions=[])).push("3.3.2");const Ec=(s,e,t)=>{const n=(t==null?void 0:t.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const r=(t==null?void 0:t.renderBefore)??null;n._$litPart$=i=new Oi(e.insertBefore(Vn(),r),r,void 0,t??{})}return i._$AI(s),i};/**
44
+ */const wi=globalThis,ka=s=>s,$i=wi.trustedTypes,va=$i?$i.createPolicy("lit-html",{createHTML:s=>s}):void 0,ya="$lit$",Cs=`lit$${Math.random().toFixed(9).slice(2)}$`,_a="?"+Cs,vc=`<${_a}>`,Fs=document,Mn=()=>Fs.createComment(""),En=s=>s===null||typeof s!="object"&&typeof s!="function",dr=Array.isArray,yc=s=>dr(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",hr=`[
45
+ \f\r]`,On=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wa=/-->/g,$a=/>/g,Bs=RegExp(`>|${hr}(?:([^\\s"'>=/]+)(${hr}*=${hr}*(?:[^
46
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),xa=/'/g,Sa=/"/g,Ca=/^(?:script|style|textarea|title)$/i,_c=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),y=_c(1),bt=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),Ta=new WeakMap,Vs=Fs.createTreeWalker(Fs,129);function Na(s,e){if(!dr(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return va!==void 0?va.createHTML(e):e}const wc=(s,e)=>{const t=s.length-1,n=[];let i,r=e===2?"<svg>":e===3?"<math>":"",a=On;for(let l=0;l<t;l++){const c=s[l];let h,g,m=-1,f=0;for(;f<c.length&&(a.lastIndex=f,g=a.exec(c),g!==null);)f=a.lastIndex,a===On?g[1]==="!--"?a=wa:g[1]!==void 0?a=$a:g[2]!==void 0?(Ca.test(g[2])&&(i=RegExp("</"+g[2],"g")),a=Bs):g[3]!==void 0&&(a=Bs):a===Bs?g[0]===">"?(a=i??On,m=-1):g[1]===void 0?m=-2:(m=a.lastIndex-g[2].length,h=g[1],a=g[3]===void 0?Bs:g[3]==='"'?Sa:xa):a===Sa||a===xa?a=Bs:a===wa||a===$a?a=On:(a=Bs,i=void 0);const k=a===Bs&&s[l+1].startsWith("/>")?" ":"";r+=a===On?c+vc:m>=0?(n.push(h),c.slice(0,m)+ya+c.slice(m)+Cs+k):c+Cs+(m===-2?l:k)}return[Na(s,r+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let pr=class pc{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let r=0,a=0;const l=e.length-1,c=this.parts,[h,g]=wc(e,t);if(this.el=pc.createElement(h,n),Vs.currentNode=this.el.content,t===2||t===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(i=Vs.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const m of i.getAttributeNames())if(m.endsWith(ya)){const f=g[a++],k=i.getAttribute(m).split(Cs),b=/([.?@])?(.*)/.exec(f);c.push({type:1,index:r,name:b[2],strings:k,ctor:b[1]==="."?xc:b[1]==="?"?Sc:b[1]==="@"?Cc:Si}),i.removeAttribute(m)}else m.startsWith(Cs)&&(c.push({type:6,index:r}),i.removeAttribute(m));if(Ca.test(i.tagName)){const m=i.textContent.split(Cs),f=m.length-1;if(f>0){i.textContent=$i?$i.emptyScript:"";for(let k=0;k<f;k++)i.append(m[k],Mn()),Vs.nextNode(),c.push({type:2,index:++r});i.append(m[f],Mn())}}}else if(i.nodeType===8)if(i.data===_a)c.push({type:2,index:r});else{let m=-1;for(;(m=i.data.indexOf(Cs,m+1))!==-1;)c.push({type:7,index:r}),m+=Cs.length-1}r++}}static createElement(e,t){const n=Fs.createElement("template");return n.innerHTML=e,n}};function an(s,e,t=s,n){var i,r;if(e===bt)return e;let a=n!==void 0?(i=t._$Co)==null?void 0:i[n]:t._$Cl;const l=En(e)?void 0:e._$litDirective$;return(a==null?void 0:a.constructor)!==l&&((r=a==null?void 0:a._$AO)==null||r.call(a,!1),l===void 0?a=void 0:(a=new l(s),a._$AT(s,t,n)),n!==void 0?(t._$Co??(t._$Co=[]))[n]=a:t._$Cl=a),a!==void 0&&(e=an(s,a._$AS(s,e.values),a,n)),e}let $c=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){const{el:{content:t},parts:n}=this._$AD,i=((e==null?void 0:e.creationScope)??Fs).importNode(t,!0);Vs.currentNode=i;let r=Vs.nextNode(),a=0,l=0,c=n[0];for(;c!==void 0;){if(a===c.index){let h;c.type===2?h=new xi(r,r.nextSibling,this,e):c.type===1?h=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(h=new Tc(r,this,e)),this._$AV.push(h),c=n[++l]}a!==(c==null?void 0:c.index)&&(r=Vs.nextNode(),a++)}return Vs.currentNode=Fs,i}p(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},xi=class fc{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=x,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=an(this,e,t),En(e)?e===x||e==null||e===""?(this._$AH!==x&&this._$AR(),this._$AH=x):e!==this._$AH&&e!==bt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):yc(e)?this.k(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!==x&&En(this._$AH)?this._$AA.nextSibling.data=e:this.T(Fs.createTextNode(e)),this._$AH=e}$(e){var t;const{values:n,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=pr.createElement(Na(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)==null?void 0:t._$AD)===r)this._$AH.p(n);else{const a=new $c(r,this),l=a.u(this.options);a.p(n),this.T(l),this._$AH=a}}_$AC(e){let t=Ta.get(e.strings);return t===void 0&&Ta.set(e.strings,t=new pr(e)),t}k(e){dr(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const r of e)i===t.length?t.push(n=new fc(this.O(Mn()),this.O(Mn()),this,this.options)):n=t[i],n._$AI(r),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,t);e!==this._$AB;){const i=ka(e).nextSibling;ka(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Si=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,r){this.type=1,this._$AH=x,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=x}_$AI(e,t=this,n,i){const r=this.strings;let a=!1;if(r===void 0)e=an(this,e,t,0),a=!En(e)||e!==this._$AH&&e!==bt,a&&(this._$AH=e);else{const l=e;let c,h;for(e=r[0],c=0;c<r.length-1;c++)h=an(this,l[n+c],t,c),h===bt&&(h=this._$AH[c]),a||(a=!En(h)||h!==this._$AH[c]),h===x?e=x:e!==x&&(e+=(h??"")+r[c+1]),this._$AH[c]=h}a&&!i&&this.j(e)}j(e){e===x?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},xc=class extends Si{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===x?void 0:e}},Sc=class extends Si{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==x)}},Cc=class extends Si{constructor(e,t,n,i,r){super(e,t,n,i,r),this.type=5}_$AI(e,t=this){if((e=an(this,e,t,0)??x)===bt)return;const n=this._$AH,i=e===x&&n!==x||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==x&&(n===x||i);i&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},Tc=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){an(this,e)}};const Nc={I:xi},Da=wi.litHtmlPolyfillSupport;Da==null||Da(pr,xi),(wi.litHtmlVersions??(wi.litHtmlVersions=[])).push("3.3.2");const Dc=(s,e,t)=>{const n=(t==null?void 0:t.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const r=(t==null?void 0:t.renderBefore)??null;n._$litPart$=i=new xi(e.insertBefore(Mn(),r),r,void 0,t??{})}return i._$AI(s),i};/**
47
47
  * @license
48
48
  * Copyright 2017 Google LLC
49
49
  * SPDX-License-Identifier: BSD-3-Clause
@@ -51,27 +51,27 @@
51
51
  * @license
52
52
  * Copyright 2019 Google LLC
53
53
  * SPDX-License-Identifier: BSD-3-Clause
54
- */const Pi=globalThis,br=Pi.ShadowRoot&&(Pi.ShadyCSS===void 0||Pi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pa=Symbol(),Aa=new WeakMap;let Pc=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Pa)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(br&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=Aa.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Aa.set(t,e))}return e}toString(){return this.cssText}};const Ac=s=>new Pc(typeof s=="string"?s:s+"",void 0,Pa),Ic=(s,e)=>{if(br)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const n=document.createElement("style"),i=Pi.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,s.appendChild(n)}},Ia=br?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return Ac(t)})(s):s;/**
54
+ */const Ci=globalThis,fr=Ci.ShadowRoot&&(Ci.ShadyCSS===void 0||Ci.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ma=Symbol(),Ea=new WeakMap;let Mc=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Ma)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(fr&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=Ea.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ea.set(t,e))}return e}toString(){return this.cssText}};const Ec=s=>new Mc(typeof s=="string"?s:s+"",void 0,Ma),Oc=(s,e)=>{if(fr)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const n=document.createElement("style"),i=Ci.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,s.appendChild(n)}},Oa=fr?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return Ec(t)})(s):s;/**
55
55
  * @license
56
56
  * Copyright 2017 Google LLC
57
57
  * SPDX-License-Identifier: BSD-3-Clause
58
- */const{is:Lc,defineProperty:Fc,getOwnPropertyDescriptor:Bc,getOwnPropertyNames:Vc,getOwnPropertySymbols:Hc,getPrototypeOf:Uc}=Object,mn=globalThis,La=mn.trustedTypes,qc=La?La.emptyScript:"",Fa=mn.reactiveElementPolyfillSupport,qn=(s,e)=>s,Ai={toAttribute(s,e){switch(e){case Boolean:s=s?qc:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},vr=(s,e)=>!Lc(s,e),Ba={attribute:!0,type:String,converter:Ai,reflect:!1,useDefault:!1,hasChanged:vr};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),mn.litPropertyMetadata??(mn.litPropertyMetadata=new WeakMap);let gn=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Ba){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){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Fc(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:r}=Bc(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){const l=i==null?void 0:i.call(this);r==null||r.call(this,a),this.requestUpdate(e,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ba}static _$Ei(){if(this.hasOwnProperty(qn("elementProperties")))return;const e=Uc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(qn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qn("properties"))){const t=this.properties,n=[...Vc(t),...Hc(t)];for(const i of n)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(Ia(i))}else e!==void 0&&t.push(Ia(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?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(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ic(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostConnected)==null?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostDisconnected)==null?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){var n;const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){const a=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:Ai).toAttribute(t,i.type);this._$Em=e,a==null?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){var n,i;const r=this.constructor,a=r._$Eh.get(e);if(a!==void 0&&this._$Em!==a){const l=r.getPropertyOptions(a),c=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:Ai;this._$Em=a;const h=c.fromAttribute(t,l.type);this[a]=h??((i=this._$Ej)==null?void 0:i.get(a))??h,this._$Em=null}}requestUpdate(e,t,n,i=!1,r){var a;if(e!==void 0){const l=this.constructor;if(i===!1&&(r=this[e]),n??(n=l.getPropertyOptions(e)),!((n.hasChanged??vr)(r,t)||n.useDefault&&n.reflect&&r===((a=this._$Ej)==null?void 0:a.get(e))&&!this.hasAttribute(l._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:r},a){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),r!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,a]of this._$Ep)this[r]=a;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,a]of i){const{wrapped:l}=a,c=this[r];l!==!0||this._$AL.has(r)||c===void 0||this.C(r,void 0,a,c)}}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(n)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),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=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};gn.elementStyles=[],gn.shadowRootOptions={mode:"open"},gn[qn("elementProperties")]=new Map,gn[qn("finalized")]=new Map,Fa==null||Fa({ReactiveElement:gn}),(mn.reactiveElementVersions??(mn.reactiveElementVersions=[])).push("2.1.2");/**
58
+ */const{is:Ac,defineProperty:Ic,getOwnPropertyDescriptor:Pc,getOwnPropertyNames:Lc,getOwnPropertySymbols:Fc,getPrototypeOf:Bc}=Object,on=globalThis,Aa=on.trustedTypes,Vc=Aa?Aa.emptyScript:"",Ia=on.reactiveElementPolyfillSupport,An=(s,e)=>s,Ti={toAttribute(s,e){switch(e){case Boolean:s=s?Vc:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},mr=(s,e)=>!Ac(s,e),Pa={attribute:!0,type:String,converter:Ti,reflect:!1,useDefault:!1,hasChanged:mr};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),on.litPropertyMetadata??(on.litPropertyMetadata=new WeakMap);let ln=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Pa){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){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Ic(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:r}=Pc(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){const l=i==null?void 0:i.call(this);r==null||r.call(this,a),this.requestUpdate(e,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Pa}static _$Ei(){if(this.hasOwnProperty(An("elementProperties")))return;const e=Bc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(An("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(An("properties"))){const t=this.properties,n=[...Lc(t),...Fc(t)];for(const i of n)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(Oa(i))}else e!==void 0&&t.push(Oa(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?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(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Oc(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostConnected)==null?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostDisconnected)==null?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){var n;const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){const a=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:Ti).toAttribute(t,i.type);this._$Em=e,a==null?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){var n,i;const r=this.constructor,a=r._$Eh.get(e);if(a!==void 0&&this._$Em!==a){const l=r.getPropertyOptions(a),c=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:Ti;this._$Em=a;const h=c.fromAttribute(t,l.type);this[a]=h??((i=this._$Ej)==null?void 0:i.get(a))??h,this._$Em=null}}requestUpdate(e,t,n,i=!1,r){var a;if(e!==void 0){const l=this.constructor;if(i===!1&&(r=this[e]),n??(n=l.getPropertyOptions(e)),!((n.hasChanged??mr)(r,t)||n.useDefault&&n.reflect&&r===((a=this._$Ej)==null?void 0:a.get(e))&&!this.hasAttribute(l._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:r},a){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),r!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,a]of this._$Ep)this[r]=a;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,a]of i){const{wrapped:l}=a,c=this[r];l!==!0||this._$AL.has(r)||c===void 0||this.C(r,void 0,a,c)}}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(n)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),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=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};ln.elementStyles=[],ln.shadowRootOptions={mode:"open"},ln[An("elementProperties")]=new Map,ln[An("finalized")]=new Map,Ia==null||Ia({ReactiveElement:ln}),(on.reactiveElementVersions??(on.reactiveElementVersions=[])).push("2.1.2");/**
59
59
  * @license
60
60
  * Copyright 2017 Google LLC
61
61
  * SPDX-License-Identifier: BSD-3-Clause
62
- */const jc={attribute:!0,type:String,converter:Ai,reflect:!1,hasChanged:vr},Wc=(s=jc,e,t)=>{const{kind:n,metadata:i}=t;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),n==="setter"&&((s=Object.create(s)).wrapped=!0),r.set(t.name,s),n==="accessor"){const{name:a}=t;return{set(l){const c=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,c,s,!0,l)},init(l){return l!==void 0&&this.C(a,void 0,s,l),l}}}if(n==="setter"){const{name:a}=t;return function(l){const c=this[a];e.call(this,l),this.requestUpdate(a,c,s,!0,l)}}throw Error("Unsupported decorator location: "+n)};function u(s){return(e,t)=>typeof t=="object"?Wc(s,e,t):((n,i,r)=>{const a=i.hasOwnProperty(r);return i.constructor.createProperty(r,n),a?Object.getOwnPropertyDescriptor(i,r):void 0})(s,e,t)}/**
62
+ */const Hc={attribute:!0,type:String,converter:Ti,reflect:!1,hasChanged:mr},Uc=(s=Hc,e,t)=>{const{kind:n,metadata:i}=t;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),n==="setter"&&((s=Object.create(s)).wrapped=!0),r.set(t.name,s),n==="accessor"){const{name:a}=t;return{set(l){const c=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,c,s,!0,l)},init(l){return l!==void 0&&this.C(a,void 0,s,l),l}}}if(n==="setter"){const{name:a}=t;return function(l){const c=this[a];e.call(this,l),this.requestUpdate(a,c,s,!0,l)}}throw Error("Unsupported decorator location: "+n)};function u(s){return(e,t)=>typeof t=="object"?Uc(s,e,t):((n,i,r)=>{const a=i.hasOwnProperty(r);return i.constructor.createProperty(r,n),a?Object.getOwnPropertyDescriptor(i,r):void 0})(s,e,t)}/**
63
63
  * @license
64
64
  * Copyright 2017 Google LLC
65
65
  * SPDX-License-Identifier: BSD-3-Clause
66
- */const jn=globalThis;let bn=class extends gn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ec(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return yt}};var Va;bn._$litElement$=!0,bn.finalized=!0,(Va=jn.litElementHydrateSupport)==null||Va.call(jn,{LitElement:bn});const Ha=jn.litElementPolyfillSupport;Ha==null||Ha({LitElement:bn}),(jn.litElementVersions??(jn.litElementVersions=[])).push("4.2.2");const zc={hi:"Hei!"},Kc={from:"Fra",to:"Til"},Yc={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Gc={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"},Xc={hours:"Timer",minutes:"Minutter",openPicker:"Åpne tidspunkt-velger",prevTime:"Forrige tidspunkt",nextTime:"Neste tidspunkt",selectTime:"Velg tidspunkt"},Qc={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."}},dt={example:zc,generic:Kc,calendar:Yc,dates:Gc,timepicker:Xc,forms:Qc};var Zc=Object.defineProperty,Ua=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Zc(e,t,i),i};let Ii=class extends bn{constructor(){super(...arguments),this.strings=dt,this.role=null}hotReplacedCallback(){this.requestUpdate()}};Ua([u({type:Object})],Ii.prototype,"strings"),Ua([u({type:String})],Ii.prototype,"role");let Gt=class extends Ii{createRenderRoot(){return this}};/**
66
+ */const In=globalThis;let cn=class extends ln{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Dc(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return bt}};var La;cn._$litElement$=!0,cn.finalized=!0,(La=In.litElementHydrateSupport)==null||La.call(In,{LitElement:cn});const Fa=In.litElementPolyfillSupport;Fa==null||Fa({LitElement:cn}),(In.litElementVersions??(In.litElementVersions=[])).push("4.2.2");const qc={hi:"Hei!"},Wc={from:"Fra",to:"Til"},jc={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},zc={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"},Kc={hours:"Timer",minutes:"Minutter",openPicker:"Åpne tidspunkt-velger",prevTime:"Forrige tidspunkt",nextTime:"Neste tidspunkt",selectTime:"Velg tidspunkt"},Yc={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."}},dt={example:qc,generic:Wc,calendar:jc,dates:zc,timepicker:Kc,forms:Yc};var Gc=Object.defineProperty,Ba=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Gc(e,t,i),i};let Ni=class extends cn{constructor(){super(...arguments),this.strings=dt,this.role=null}hotReplacedCallback(){this.requestUpdate()}};Ba([u({type:Object})],Ni.prototype,"strings"),Ba([u({type:String})],Ni.prototype,"role");let Kt=class extends Ni{createRenderRoot(){return this}};/**
67
67
  * @license
68
68
  * Copyright 2017 Google LLC
69
69
  * SPDX-License-Identifier: BSD-3-Clause
70
- */const Xt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Ns=s=>(...e)=>({_$litDirective$:s,values:e});let vn=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)}};/**
70
+ */const Yt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Ts=s=>(...e)=>({_$litDirective$:s,values:e});let un=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)}};/**
71
71
  * @license
72
72
  * Copyright 2018 Google LLC
73
73
  * SPDX-License-Identifier: BSD-3-Clause
74
- */const Z=Ns(class extends vn{constructor(s){var e;if(super(s),s.type!==Xt.ATTRIBUTE||s.name!=="class"||((e=s.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(e=>s[e]).join(" ")+" "}update(s,[e]){var t,n;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in e)e[r]&&!((t=this.nt)!=null&&t.has(r))&&this.st.add(r);return this.render(e)}const i=s.element.classList;for(const r of this.st)r in e||(i.remove(r),this.st.delete(r));for(const r in e){const a=!!e[r];a===this.st.has(r)||(n=this.nt)!=null&&n.has(r)||(a?(i.add(r),this.st.add(r)):(i.remove(r),this.st.delete(r)))}return yt}});/**
74
+ */const Z=Ts(class extends un{constructor(s){var e;if(super(s),s.type!==Yt.ATTRIBUTE||s.name!=="class"||((e=s.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(e=>s[e]).join(" ")+" "}update(s,[e]){var t,n;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in e)e[r]&&!((t=this.nt)!=null&&t.has(r))&&this.st.add(r);return this.render(e)}const i=s.element.classList;for(const r of this.st)r in e||(i.remove(r),this.st.delete(r));for(const r in e){const a=!!e[r];a===this.st.has(r)||(n=this.nt)!=null&&n.has(r)||(a?(i.add(r),this.st.add(r)):(i.remove(r),this.st.delete(r)))}return bt}});/**
75
75
  * @license
76
76
  * Copyright 2017 Google LLC
77
77
  * SPDX-License-Identifier: BSD-3-Clause
@@ -79,23 +79,23 @@
79
79
  * @license
80
80
  * Copyright 2020 Google LLC
81
81
  * SPDX-License-Identifier: BSD-3-Clause
82
- */const{I:Jc}=Oc,qa=s=>s,ja=s=>s.strings===void 0,Wa=()=>document.createComment(""),Wn=(s,e,t)=>{var n;const i=s._$AA.parentNode,r=e===void 0?s._$AB:e._$AA;if(t===void 0){const a=i.insertBefore(Wa(),r),l=i.insertBefore(Wa(),r);t=new Jc(a,l,s,s.options)}else{const a=t._$AB.nextSibling,l=t._$AM,c=l!==s;if(c){let h;(n=t._$AQ)==null||n.call(t,s),t._$AM=s,t._$AP!==void 0&&(h=s._$AU)!==l._$AU&&t._$AP(h)}if(a!==r||c){let h=t._$AA;for(;h!==a;){const g=qa(h).nextSibling;qa(i).insertBefore(h,r),h=g}}}return t},Ks=(s,e,t=s)=>(s._$AI(e,t),s),Rc={},za=(s,e=Rc)=>s._$AH=e,eu=s=>s._$AH,kr=s=>{s._$AR(),s._$AA.remove()};/**
82
+ */const{I:Xc}=Nc,Va=s=>s,Ha=s=>s.strings===void 0,Ua=()=>document.createComment(""),Pn=(s,e,t)=>{var n;const i=s._$AA.parentNode,r=e===void 0?s._$AB:e._$AA;if(t===void 0){const a=i.insertBefore(Ua(),r),l=i.insertBefore(Ua(),r);t=new Xc(a,l,s,s.options)}else{const a=t._$AB.nextSibling,l=t._$AM,c=l!==s;if(c){let h;(n=t._$AQ)==null||n.call(t,s),t._$AM=s,t._$AP!==void 0&&(h=s._$AU)!==l._$AU&&t._$AP(h)}if(a!==r||c){let h=t._$AA;for(;h!==a;){const g=Va(h).nextSibling;Va(i).insertBefore(h,r),h=g}}}return t},Hs=(s,e,t=s)=>(s._$AI(e,t),s),Qc={},qa=(s,e=Qc)=>s._$AH=e,Zc=s=>s._$AH,gr=s=>{s._$AR(),s._$AA.remove()};/**
83
83
  * @license
84
84
  * Copyright 2017 Google LLC
85
85
  * SPDX-License-Identifier: BSD-3-Clause
86
- */const zn=(s,e)=>{var t;const n=s._$AN;if(n===void 0)return!1;for(const i of n)(t=i._$AO)==null||t.call(i,e,!1),zn(i,e);return!0},Li=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while((t==null?void 0:t.size)===0)},Ka=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),nu(e)}};function tu(s){this._$AN!==void 0?(Li(this),this._$AM=s,Ka(this)):this._$AM=s}function su(s,e=!1,t=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let r=t;r<n.length;r++)zn(n[r],!1),Li(n[r]);else n!=null&&(zn(n,!1),Li(n));else zn(this,s)}const nu=s=>{s.type==Xt.CHILD&&(s._$AP??(s._$AP=su),s._$AQ??(s._$AQ=tu))};let Ya=class extends vn{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Ka(this),this.isConnected=e._$AU}_$AO(e,t=!0){var n,i;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),t&&(zn(this,e),Li(this))}setValue(e){if(ja(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};function Ga(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function Kn(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function Xa(s){var e;return s.nodeType===Node.TEXT_NODE&&((e=s.nodeValue)==null?void 0:e.trim())!==""}const Qa=new WeakMap;function yr(s){let e=Qa.get(s);return e||(e=new iu(s),Qa.set(s,e)),e}const _r=Symbol("default");function $r(s){return s===void 0?_r:s}function Za(s,e){if(s.nodeType===Node.COMMENT_NODE)return!1;if(s.nodeType===Node.TEXT_NODE)return Xa(s)?(wr(e,_r,s),!0):!1;if(s.nodeType===Node.ELEMENT_NODE){const t=s;if(Ga(t)||Kn(t))return!1;if(t instanceof HTMLTemplateElement){const r=Array.from(t.content.childNodes),a=$r(t.getAttribute("slot")??void 0);for(const l of r)wr(e,a,l);return!0}const n=t.getAttribute("slot"),i=n!==null?$r(n):_r;return wr(e,i,s),!0}return!1}function wr(s,e,t){let n=s.get(e);n||(n=[],s.set(e,n)),n.push(t)}const Ja=class vc{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++;const e=Array.from(this.host.childNodes);for(const t of e)Za(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($r(e))??[]}hasContent(e){return this.getNodes(e).length>0}ensurePlaceholder(e){if(this.nodeToPlaceholder.has(e)||e.parentNode!==this.host)return;const t=document.createComment(vc.PLACEHOLDER_PREFIX);this.host.insertBefore(t,e),this.placeholderToNode.set(t,e),this.nodeToPlaceholder.set(e,t)}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(){var e;this.observing&&(this.observing=!1,(e=this.observer)==null||e.disconnect(),this.observer=null)}handleMutations(e){var t,n,i;if(this.processingMutations)return;this.processingMutations=!0;let r=!1;for(const a of e)if(a.target===this.host){for(const l of a.removedNodes){const c=this.placeholderToNode.get(l);if(c){(t=c.parentNode)==null||t.removeChild(c),this.trackedNodes.delete(c),this.removeFromSlots(c),this.placeholderToNode.delete(l),this.nodeToPlaceholder.delete(c),r=!0;continue}if(this.trackedNodes.has(l)){this.trackedNodes.delete(l),this.removeFromSlots(l);const h=this.nodeToPlaceholder.get(l);h&&((n=h.parentNode)==null||n.removeChild(h),this.placeholderToNode.delete(h),this.nodeToPlaceholder.delete(l)),r=!0}}for(const l of a.addedNodes)this.placeholderToNode.has(l)||!this.trackedNodes.has(l)&&this.isUserContent(l)&&Za(l,this.nodesBySlot)&&(this.trackedNodes.add(l),r=!0)}r&&(this.generation++,this.notifyDirectives()),(i=this.observer)==null||i.takeRecords(),this.processingMutations=!1}isUserContent(e){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return Xa(e);if(e.nodeType===Node.ELEMENT_NODE){const t=e;return!(Ga(t)||Kn(t))}return!1}removeFromSlots(e){for(const[t,n]of this.nodesBySlot){const i=n.indexOf(e);if(i!==-1){n.splice(i,1),n.length===0&&this.nodesBySlot.delete(t);return}}}notifyDirectives(){for(const e of this.directives)e.handleNodesChanged()}};Ja.PLACEHOLDER_PREFIX="pkt-slot";let iu=Ja;const tt=Ns(class extends Ya{constructor(e){if(super(e),this.manager=null,this.lastGeneration=-1,e.type!==Xt.CHILD)throw new Error("slotContent() can only be used in child expressions")}render(e,t){return yt}update(e,[t,n]){return this.slotName=n,this.manager||(this.manager=yr(t),this.manager.collectNodes(),this.manager.addDirective(this)),this.ensurePlaceholders(),this.getNodesOrNoChange()}handleNodesChanged(){if(!this.isConnected||!this.manager)return;this.ensurePlaceholders();const e=this.getNodesOrNoChange();e!==yt&&this.setValue(e)}ensurePlaceholders(){if(!this.manager)return;const e=this.manager.getNodes(this.slotName);for(const t of e)this.manager.ensurePlaceholder(t)}disconnected(){var e;(e=this.manager)==null||e.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){}getNodesOrNoChange(){if(!this.manager)return yt;const e=this.manager.generation;return e===this.lastGeneration?yt:(this.lastGeneration=e,this.manager.getNodes(this.slotName))}});let xt=class extends Gt{connectedCallback(){yr(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return yr(this).hasContent(e)}};function Ra(s,e,t){const n=s.getAttribute("class")||"",i=new Set(n.split(/\s+/).filter(Boolean));t?i.add(e):i.delete(e),s.setAttribute("class",Array.from(i).join(" "))}/**
86
+ */const Ln=(s,e)=>{var t;const n=s._$AN;if(n===void 0)return!1;for(const i of n)(t=i._$AO)==null||t.call(i,e,!1),Ln(i,e);return!0},Di=s=>{let e,t;do{if((e=s._$AM)===void 0)break;t=e._$AN,t.delete(s),s=e}while((t==null?void 0:t.size)===0)},Wa=s=>{for(let e;e=s._$AM;s=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(s))break;t.add(s),eu(e)}};function Jc(s){this._$AN!==void 0?(Di(this),this._$AM=s,Wa(this)):this._$AM=s}function Rc(s,e=!1,t=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let r=t;r<n.length;r++)Ln(n[r],!1),Di(n[r]);else n!=null&&(Ln(n,!1),Di(n));else Ln(this,s)}const eu=s=>{s.type==Yt.CHILD&&(s._$AP??(s._$AP=Rc),s._$AQ??(s._$AQ=Jc))};let ja=class extends un{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Wa(this),this.isConnected=e._$AU}_$AO(e,t=!0){var n,i;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),t&&(Ln(this,e),Di(this))}setValue(e){if(Ha(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};function za(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function Fn(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function Ka(s){var e;return s.nodeType===Node.TEXT_NODE&&((e=s.nodeValue)==null?void 0:e.trim())!==""}const Ya=new WeakMap;function br(s){let e=Ya.get(s);return e||(e=new tu(s),Ya.set(s,e)),e}const kr=Symbol("default");function vr(s){return s===void 0?kr:s}function Ga(s,e){if(s.nodeType===Node.COMMENT_NODE)return!1;if(s.nodeType===Node.TEXT_NODE)return Ka(s)?(yr(e,kr,s),!0):!1;if(s.nodeType===Node.ELEMENT_NODE){const t=s;if(za(t)||Fn(t))return!1;if(t instanceof HTMLTemplateElement){const r=Array.from(t.content.childNodes),a=vr(t.getAttribute("slot")??void 0);for(const l of r)yr(e,a,l);return!0}const n=t.getAttribute("slot"),i=n!==null?vr(n):kr;return yr(e,i,s),!0}return!1}function yr(s,e,t){let n=s.get(e);n||(n=[],s.set(e,n)),n.push(t)}const Xa=class mc{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++;const e=Array.from(this.host.childNodes);for(const t of e)Ga(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(vr(e))??[]}hasContent(e){return this.getNodes(e).length>0}ensurePlaceholder(e){if(this.nodeToPlaceholder.has(e)||e.parentNode!==this.host)return;const t=document.createComment(mc.PLACEHOLDER_PREFIX);this.host.insertBefore(t,e),this.placeholderToNode.set(t,e),this.nodeToPlaceholder.set(e,t)}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(){var e;this.observing&&(this.observing=!1,(e=this.observer)==null||e.disconnect(),this.observer=null)}handleMutations(e){var t,n,i;if(this.processingMutations)return;this.processingMutations=!0;let r=!1;for(const a of e)if(a.target===this.host){for(const l of a.removedNodes){const c=this.placeholderToNode.get(l);if(c){(t=c.parentNode)==null||t.removeChild(c),this.trackedNodes.delete(c),this.removeFromSlots(c),this.placeholderToNode.delete(l),this.nodeToPlaceholder.delete(c),r=!0;continue}if(this.trackedNodes.has(l)){this.trackedNodes.delete(l),this.removeFromSlots(l);const h=this.nodeToPlaceholder.get(l);h&&((n=h.parentNode)==null||n.removeChild(h),this.placeholderToNode.delete(h),this.nodeToPlaceholder.delete(l)),r=!0}}for(const l of a.addedNodes)this.placeholderToNode.has(l)||!this.trackedNodes.has(l)&&this.isUserContent(l)&&Ga(l,this.nodesBySlot)&&(this.trackedNodes.add(l),r=!0)}r&&(this.generation++,this.notifyDirectives()),(i=this.observer)==null||i.takeRecords(),this.processingMutations=!1}isUserContent(e){if(e.nodeType===Node.COMMENT_NODE)return!1;if(e.nodeType===Node.TEXT_NODE)return Ka(e);if(e.nodeType===Node.ELEMENT_NODE){const t=e;return!(za(t)||Fn(t))}return!1}removeFromSlots(e){for(const[t,n]of this.nodesBySlot){const i=n.indexOf(e);if(i!==-1){n.splice(i,1),n.length===0&&this.nodesBySlot.delete(t);return}}}notifyDirectives(){for(const e of this.directives)e.handleNodesChanged()}};Xa.PLACEHOLDER_PREFIX="pkt-slot";let tu=Xa;const Re=Ts(class extends ja{constructor(e){if(super(e),this.manager=null,this.lastGeneration=-1,e.type!==Yt.CHILD)throw new Error("slotContent() can only be used in child expressions")}render(e,t){return bt}update(e,[t,n]){return this.slotName=n,this.manager||(this.manager=br(t),this.manager.collectNodes(),this.manager.addDirective(this)),this.ensurePlaceholders(),this.getNodesOrNoChange()}handleNodesChanged(){if(!this.isConnected||!this.manager)return;this.ensurePlaceholders();const e=this.getNodesOrNoChange();e!==bt&&this.setValue(e)}ensurePlaceholders(){if(!this.manager)return;const e=this.manager.getNodes(this.slotName);for(const t of e)this.manager.ensurePlaceholder(t)}disconnected(){var e;(e=this.manager)==null||e.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){}getNodesOrNoChange(){if(!this.manager)return bt;const e=this.manager.generation;return e===this.lastGeneration?bt:(this.lastGeneration=e,this.manager.getNodes(this.slotName))}});let wt=class extends Kt{connectedCallback(){br(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return br(this).hasContent(e)}};function Qa(s,e,t){const n=s.getAttribute("class")||"",i=new Set(n.split(/\s+/).filter(Boolean));t?i.add(e):i.delete(e),s.setAttribute("class",Array.from(i).join(" "))}/**
87
87
  * @license
88
88
  * Copyright 2017 Google LLC
89
89
  * SPDX-License-Identifier: BSD-3-Clause
90
- */let Fi=class extends vn{constructor(e){if(super(e),this.it=x,e.type!==Xt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===x||e==null)return this._t=void 0,this.it=e;if(e===yt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Fi.directiveName="unsafeHTML",Fi.resultType=1;const Bi=Ns(Fi);/**
90
+ */let Mi=class extends un{constructor(e){if(super(e),this.it=x,e.type!==Yt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===x||e==null)return this._t=void 0,this.it=e;if(e===bt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Mi.directiveName="unsafeHTML",Mi.resultType=1;const Ei=Ts(Mi);/**
91
91
  * @license
92
92
  * Copyright 2017 Google LLC
93
93
  * SPDX-License-Identifier: BSD-3-Clause
94
- */let xr=class extends Fi{};xr.directiveName="unsafeSVG",xr.resultType=2;const Sr=Ns(xr);var ru=Object.defineProperty,au=Object.getOwnPropertyDescriptor,Yn=(s,e,t,n)=>{for(var i=n>1?void 0:n?au(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&ru(e,t,i),i};const Cr="https://punkt-cdn.oslo.kommune.no/16.7/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Cr);const Gn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',Xn={},ou=2,lu=1500,eo=typeof Storage<"u"&&typeof sessionStorage<"u",cu=s=>window.pktFetch(s).then(e=>{if(!e.ok)throw new Error("Missing icon: "+s);return e.text()}),to=async(s,e=ou)=>{try{return await cu(s)}catch{return e>0?(await new Promise(t=>setTimeout(t,lu)),to(s,e-1)):(console.error("Failed to fetch icon: "+s),Gn)}},uu=async(s,e)=>{const t=e+s+".svg";return eo&&sessionStorage.getItem(t)?sessionStorage.getItem(t):t in Xn?Xn[t]:typeof window<"u"&&typeof window.pktFetch=="function"?(Xn[t]=to(t).then(n=>(n!==Gn&&eo&&sessionStorage.setItem(t,n),delete Xn[t],n)),Xn[t]):Gn};let Ys=class extends Gt{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:Cr,this.name="",this.icon=Sr(Gn),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e==="name"||e==="path")&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has("name")||e.has("path"))&&this.getIcon(this.name)}async getIcon(e=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:Cr);try{this.icon=Sr(await uu(this.name||"",this.path))}catch{this.icon=Sr(Gn)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return y`${this.name&&this.icon}`}};Yn([u({type:String,reflect:!1})],Ys.prototype,"path",2),Yn([u({type:String,reflect:!0})],Ys.prototype,"name",2),Yn([u({type:SVGElement})],Ys.prototype,"icon",2),Yn([u({type:Array,noAccessor:!0})],Ys.prototype,"_updatedProps",2),Ys=Yn([Se("pkt-icon")],Ys);/**
94
+ */let _r=class extends Mi{};_r.directiveName="unsafeSVG",_r.resultType=2;const wr=Ts(_r);var su=Object.defineProperty,Oi=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&su(e,t,i),i};const $r="https://punkt-cdn.oslo.kommune.no/16.7/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||$r);const Bn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',Vn={},nu=2,iu=1500,Za=typeof Storage<"u"&&typeof sessionStorage<"u",ru=s=>window.pktFetch(s).then(e=>{if(!e.ok)throw new Error("Missing icon: "+s);return e.text()}),Ja=async(s,e=nu)=>{try{return await ru(s)}catch{return e>0?(await new Promise(t=>setTimeout(t,iu)),Ja(s,e-1)):(console.error("Failed to fetch icon: "+s),Bn)}},au=async(s,e)=>{const t=e+s+".svg";return Za&&sessionStorage.getItem(t)?sessionStorage.getItem(t):t in Vn?Vn[t]:typeof window<"u"&&typeof window.pktFetch=="function"?(Vn[t]=Ja(t).then(n=>(n!==Bn&&Za&&sessionStorage.setItem(t,n),delete Vn[t],n)),Vn[t]):Bn};let dn=class extends Kt{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:$r,this.name="",this.icon=wr(Bn),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e==="name"||e==="path")&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has("name")||e.has("path"))&&this.getIcon(this.name)}async getIcon(e=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:$r);try{this.icon=wr(await au(this.name||"",this.path))}catch{this.icon=wr(Bn)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return y`${this.name&&this.icon}`}};Oi([u({type:String,reflect:!1})],dn.prototype,"path"),Oi([u({type:String,reflect:!0})],dn.prototype,"name"),Oi([u({type:SVGElement})],dn.prototype,"icon"),Oi([u({type:Array,noAccessor:!0})],dn.prototype,"_updatedProps");try{Se("pkt-icon")(dn)}catch{console.warn("Forsøker å definere <pkt-icon>, men den er allerede definert")}/**
95
95
  * @license
96
96
  * Copyright 2018 Google LLC
97
97
  * SPDX-License-Identifier: BSD-3-Clause
98
- */const B=s=>s??x;var du=Object.defineProperty,hu=Object.getOwnPropertyDescriptor,_t=(s,e,t,n)=>{for(var i=n>1?void 0:n?hu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&du(e,t,i),i};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/16.7/animations/";let mt=class extends xt{constructor(){super(...arguments),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath}connectedCallback(){super.connectedCallback(),this.addEventListener("click",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("keydown",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e==="disabled"&&n==="false"&&(this.disabled=!1),(e==="isloading"||e==="isLoading")&&n==="false"&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const e=this.form??this.getAttribute("form")??void 0,t={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return y`
98
+ */const B=s=>s??x;var ou=Object.defineProperty,$t=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&ou(e,t,i),i};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/16.7/animations/";let kt=class extends wt{constructor(){super(...arguments),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath}connectedCallback(){super.connectedCallback(),this.addEventListener("click",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("keydown",e=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e==="disabled"&&n==="false"&&(this.disabled=!1),(e==="isloading"||e==="isLoading")&&n==="false"&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const e=this.form??this.getAttribute("form")??void 0,t={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return y`
99
99
  <button
100
100
  class=${Z(t)}
101
101
  type=${this.type}
@@ -114,14 +114,14 @@
114
114
  name=${this.iconName}
115
115
  path=${B(this.iconPath)}
116
116
  ></pkt-icon>`:x}
117
- <span class="pkt-btn__text">${tt(this)}</span>
117
+ <span class="pkt-btn__text">${Re(this)}</span>
118
118
  ${this.variant==="icons-right-and-left"?y`<pkt-icon
119
119
  class="pkt-btn__icon"
120
120
  name=${this.secondIconName}
121
121
  path=${B(this.secondIconPath)}
122
122
  ></pkt-icon>`:x}
123
123
  </button>
124
- `}};_t([u({type:String})],mt.prototype,"iconName",2),_t([u({type:String})],mt.prototype,"secondIconName",2),_t([u({type:String})],mt.prototype,"iconPath",2),_t([u({type:String})],mt.prototype,"secondIconPath",2),_t([u({type:String})],mt.prototype,"mode",2),_t([u({type:String})],mt.prototype,"size",2),_t([u({type:Boolean,attribute:"full-width"})],mt.prototype,"fullWidth",2),_t([u({type:Boolean,attribute:"full-width-on-mobile"})],mt.prototype,"fullWidthOnMobile",2),_t([u({type:String})],mt.prototype,"color",2),_t([u({type:String})],mt.prototype,"skin",2),_t([u({type:String})],mt.prototype,"variant",2),_t([u({type:String,reflect:!0})],mt.prototype,"state",2),_t([u({type:String,reflect:!0})],mt.prototype,"type",2),_t([u({type:String})],mt.prototype,"form",2),_t([u({type:Boolean,reflect:!0})],mt.prototype,"isLoading",2),_t([u({type:Boolean,reflect:!0})],mt.prototype,"disabled",2),_t([u({type:String})],mt.prototype,"loadingAnimationPath",2),mt=_t([Se("pkt-button")],mt);const pu={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Vi={props:pu};var fu=Object.defineProperty,mu=Object.getOwnPropertyDescriptor,ls=(s,e,t,n)=>{for(var i=n>1?void 0:n?mu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&fu(e,t,i),i};let is=class extends xt{constructor(){super(),this.compact=Vi.props.compact.default,this.title="",this.skin=Vi.props.skin.default,this.ariaLive=Vi.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Vi.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,t,n){e==="ariaLive"&&(this["aria-live"]=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&Ra(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},t={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return y`
124
+ `}};$t([u({type:String})],kt.prototype,"iconName"),$t([u({type:String})],kt.prototype,"secondIconName"),$t([u({type:String})],kt.prototype,"iconPath"),$t([u({type:String})],kt.prototype,"secondIconPath"),$t([u({type:String})],kt.prototype,"mode"),$t([u({type:String})],kt.prototype,"size"),$t([u({type:Boolean,attribute:"full-width"})],kt.prototype,"fullWidth"),$t([u({type:Boolean,attribute:"full-width-on-mobile"})],kt.prototype,"fullWidthOnMobile"),$t([u({type:String})],kt.prototype,"color"),$t([u({type:String})],kt.prototype,"skin"),$t([u({type:String})],kt.prototype,"variant"),$t([u({type:String,reflect:!0})],kt.prototype,"state"),$t([u({type:String,reflect:!0})],kt.prototype,"type"),$t([u({type:String})],kt.prototype,"form"),$t([u({type:Boolean,reflect:!0})],kt.prototype,"isLoading"),$t([u({type:Boolean,reflect:!0})],kt.prototype,"disabled"),$t([u({type:String})],kt.prototype,"loadingAnimationPath");try{Se("pkt-button")(kt)}catch{console.warn("Forsøker å definere <pkt-button>, men den er allerede definert")}const lu={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Ai={props:lu};var cu=Object.defineProperty,fs=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&cu(e,t,i),i};let is=class extends wt{constructor(){super(),this.compact=Ai.props.compact.default,this.title="",this.skin=Ai.props.skin.default,this.ariaLive=Ai.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Ai.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,t,n){e==="ariaLive"&&(this["aria-live"]=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&Qa(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},t={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return y`
125
125
  <div class=${Z(e)} aria-live=${this["aria-live"]}>
126
126
  <div class=${Z(t)}>
127
127
  <pkt-icon
@@ -148,16 +148,16 @@
148
148
  `:x}
149
149
  ${this.title?y`<div class="pkt-alert__title">${this.title}</div>`:x}
150
150
 
151
- <div class="pkt-alert__text">${tt(this)}</div>
151
+ <div class="pkt-alert__text">${Re(this)}</div>
152
152
 
153
153
  ${this.date?y`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:x}
154
154
  </div>
155
155
  </div>
156
- `}};ls([u({type:Boolean,reflect:!1})],is.prototype,"compact",2),ls([u({type:String,reflect:!0})],is.prototype,"title",2),ls([u({type:String,reflect:!0})],is.prototype,"skin",2),ls([u({type:String})],is.prototype,"ariaLive",2),ls([u({type:String,reflect:!0})],is.prototype,"aria-live",2),ls([u({type:Boolean,reflect:!0})],is.prototype,"closeAlert",2),ls([u({type:String,reflect:!0})],is.prototype,"date",2),ls([u({type:String,reflect:!0})],is.prototype,"role",2),ls([_e()],is.prototype,"_isClosed",2),is=ls([Se("pkt-alert")],is);/**
156
+ `}};fs([u({type:Boolean,reflect:!1})],is.prototype,"compact"),fs([u({type:String,reflect:!0})],is.prototype,"title"),fs([u({type:String,reflect:!0})],is.prototype,"skin"),fs([u({type:String})],is.prototype,"ariaLive"),fs([u({type:String,reflect:!0})],is.prototype,"aria-live"),fs([u({type:Boolean,reflect:!0})],is.prototype,"closeAlert"),fs([u({type:String,reflect:!0})],is.prototype,"date"),fs([u({type:String,reflect:!0})],is.prototype,"role"),fs([_e()],is.prototype,"_isClosed");try{Se("pkt-alert")(is)}catch{console.warn("Forsøker å definere <pkt-alert>, men den er allerede definert")}/**
157
157
  * @license
158
158
  * Copyright 2020 Google LLC
159
159
  * SPDX-License-Identifier: BSD-3-Clause
160
- */const De=()=>new gu;let gu=class{};const Tr=new WeakMap,Ne=Ns(class extends Ya{render(s){return x}update(s,[e]){var t;const n=e!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=e,this.ht=(t=s.options)==null?void 0:t.host,this.rt(this.ct=s.element)),x}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=Tr.get(e);t===void 0&&(t=new WeakMap,Tr.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){var s,e;return typeof this.G=="function"?(s=Tr.get(this.ht??globalThis))==null?void 0:s.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var bu=Object.defineProperty,vu=Object.getOwnPropertyDescriptor,Qn=(s,e,t,n)=>{for(var i=n>1?void 0:n?vu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&bu(e,t,i),i};let kn=class extends bn{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(e){e.has("skin")&&this.requestUpdate(),e.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var e;if(this.name){const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.assignedElements().forEach(n=>{n.tagName.toLowerCase()==="pkt-accordion-item"&&(n.hasAttribute("name")||n.setAttribute("name",this.name))})}}firstUpdated(){var e;const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const e={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return y`
160
+ */const Ne=()=>new uu;let uu=class{};const xr=new WeakMap,De=Ts(class extends ja{render(s){return x}update(s,[e]){var t;const n=e!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=e,this.ht=(t=s.options)==null?void 0:t.host,this.rt(this.ct=s.element)),x}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=xr.get(e);t===void 0&&(t=new WeakMap,xr.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){var s,e;return typeof this.G=="function"?(s=xr.get(this.ht??globalThis))==null?void 0:s.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var du=Object.defineProperty,Ii=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&du(e,t,i),i};let Hn=class extends cn{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(e){e.has("skin")&&this.requestUpdate(),e.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var e;if(this.name){const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.assignedElements().forEach(n=>{n.tagName.toLowerCase()==="pkt-accordion-item"&&(n.hasAttribute("name")||n.setAttribute("name",this.name))})}}firstUpdated(){var e;const t=(e=this.renderRoot)==null?void 0:e.querySelector("slot");t&&t.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const e={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return y`
161
161
  <div
162
162
  part="container"
163
163
  class=${Z(e)}
@@ -166,12 +166,12 @@
166
166
  >
167
167
  <slot></slot>
168
168
  </div>
169
- `}};Qn([u({type:String,reflect:!0,attribute:"aria-labelledby"})],kn.prototype,"ariaLabelledBy",2),Qn([u({type:Boolean,reflect:!0,attribute:"compact"})],kn.prototype,"compact",2),Qn([u({type:String,reflect:!0,attribute:"skin"})],kn.prototype,"skin",2),Qn([u({type:String,reflect:!0,attribute:"name"})],kn.prototype,"name",2),kn=Qn([Se("pkt-accordion")],kn);var ku=Object.defineProperty,yu=Object.getOwnPropertyDescriptor,Gs=(s,e,t,n)=>{for(var i=n>1?void 0:n?yu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&ku(e,t,i),i};let Ms=class extends xt{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=De()}firstUpdated(e){this.defaultOpen&&(this.isOpen=!0)}render(){const e={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return y`
169
+ `}};Ii([u({type:String,reflect:!0,attribute:"aria-labelledby"})],Hn.prototype,"ariaLabelledBy"),Ii([u({type:Boolean,reflect:!0,attribute:"compact"})],Hn.prototype,"compact"),Ii([u({type:String,reflect:!0,attribute:"skin"})],Hn.prototype,"skin"),Ii([u({type:String,reflect:!0,attribute:"name"})],Hn.prototype,"name");try{Se("pkt-accordion")(Hn)}catch{console.warn("Forsøker å definere <pkt-accordion>, men den er allerede definert")}var hu=Object.defineProperty,hn=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&hu(e,t,i),i};let Us=class extends wt{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=Ne()}firstUpdated(e){this.defaultOpen&&(this.isOpen=!0)}render(){const e={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return y`
170
170
  <details
171
171
  class=${Z(e)}
172
172
  id=${this.id}
173
173
  ?open=${this.isOpen}
174
- ${Ne(this.accordionItemRef)}
174
+ ${De(this.accordionItemRef)}
175
175
  name=${B(this.name)}
176
176
  >
177
177
  <summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
@@ -187,10 +187,10 @@
187
187
  id="pkt-accordion-item__content-${this.id}"
188
188
  role="region"
189
189
  >
190
- <div class="pkt-accordion-item__content-inner">${tt(this)}</div>
190
+ <div class="pkt-accordion-item__content-inner">${Re(this)}</div>
191
191
  </div>
192
192
  </details>
193
- `}};Gs([u({type:Boolean})],Ms.prototype,"defaultOpen",2),Gs([u({type:String})],Ms.prototype,"title",2),Gs([u({type:String,reflect:!0})],Ms.prototype,"skin",2),Gs([u({type:Boolean,reflect:!0})],Ms.prototype,"compact",2),Gs([u({type:Boolean,reflect:!0})],Ms.prototype,"isOpen",2),Gs([u({type:String,reflect:!0})],Ms.prototype,"name",2),Ms=Gs([Se("pkt-accordion-item")],Ms);var _u=Object.defineProperty,$u=Object.getOwnPropertyDescriptor,Hi=(s,e,t,n)=>{for(var i=n>1?void 0:n?$u(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&_u(e,t,i),i};let Zn=class extends Gt{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(e,t,n){e==="arialabel"&&this.removeAttribute("arialabel"),e==="href"&&this.removeAttribute("href"),e==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(e,t,n)}render(){return y`<nav
193
+ `}};hn([u({type:Boolean})],Us.prototype,"defaultOpen"),hn([u({type:String})],Us.prototype,"title"),hn([u({type:String,reflect:!0})],Us.prototype,"skin"),hn([u({type:Boolean,reflect:!0})],Us.prototype,"compact"),hn([u({type:Boolean,reflect:!0})],Us.prototype,"isOpen"),hn([u({type:String,reflect:!0})],Us.prototype,"name");try{Se("pkt-accordion-item")(Us)}catch{console.warn("Forsøker å definere <pkt-accordion-item>, men den er allerede definert")}var pu=Object.defineProperty,Sr=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&pu(e,t,i),i};let Pi=class extends Kt{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(e,t,n){e==="arialabel"&&this.removeAttribute("arialabel"),e==="href"&&this.removeAttribute("href"),e==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(e,t,n)}render(){return y`<nav
194
194
  class="pkt-back-link"
195
195
  aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
196
196
  >
@@ -202,7 +202,7 @@
202
202
  ></pkt-icon
203
203
  ><span class="pkt-back-link__text">${this.text}</span></a
204
204
  >
205
- </nav>`}};Hi([u({type:String})],Zn.prototype,"href",2),Hi([u({type:String})],Zn.prototype,"text",2),Hi([u({type:String})],Zn.prototype,"ariaLabel",2),Zn=Hi([Se("pkt-backlink")],Zn);var wu=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,so=(s,e,t,n)=>{for(var i=n>1?void 0:n?xu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&wu(e,t,i),i};let Dr=class extends Gt{constructor(){super(...arguments),this.breadcrumbs=[]}handleLinkClick(e,t,n){const i=new CustomEvent("navigate",{detail:{item:t,index:n,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i)||e.preventDefault()}render(){if(!this.breadcrumbs||this.breadcrumbs.length===0)return x;const e=this.breadcrumbs[this.breadcrumbs.length-2];return y`
205
+ </nav>`}};Sr([u({type:String})],Pi.prototype,"href"),Sr([u({type:String})],Pi.prototype,"text"),Sr([u({type:String})],Pi.prototype,"ariaLabel");try{Se("pkt-backlink")(Pi)}catch{console.warn("Forsøker å definere <pkt-backlink>, men den er allerede definert")}var fu=Object.defineProperty,mu=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&fu(e,t,i),i};let Ra=class extends Kt{constructor(){super(...arguments),this.breadcrumbs=[]}handleLinkClick(e,t,n){const i=new CustomEvent("navigate",{detail:{item:t,index:n,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i)||e.preventDefault()}render(){if(!this.breadcrumbs||this.breadcrumbs.length===0)return x;const e=this.breadcrumbs[this.breadcrumbs.length-2];return y`
206
206
  <nav class="pkt-breadcrumbs" aria-label="brødsmulemeny">
207
207
  <ol class="pkt-breadcrumbs__list pkt-breadcrumbs--desktop">
208
208
  ${this.breadcrumbs.map((t,n)=>n===this.breadcrumbs.length-1?y`
@@ -244,7 +244,7 @@
244
244
  </a>
245
245
  `:x}
246
246
  </nav>
247
- `}};so([u({type:Array})],Dr.prototype,"breadcrumbs",2),Dr=so([Se("pkt-breadcrumbs")],Dr);const no=6048e5,Su=864e5,io=Symbol.for("constructDateFrom");function cs(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&io in s?s[io](e):s instanceof Date?new s.constructor(e):new Date(e)}function Ut(s,e){return cs(e||s,s)}function ro(s,e,t){const n=Ut(s,void 0);return isNaN(e)?cs(s,NaN):(e&&n.setDate(n.getDate()+e),n)}let Cu={};function Ui(){return Cu}function Jn(s,e){var t,n,i,r;const a=Ui(),l=(e==null?void 0:e.weekStartsOn)??((n=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:n.weekStartsOn)??a.weekStartsOn??((r=(i=a.locale)==null?void 0:i.options)==null?void 0:r.weekStartsOn)??0,c=Ut(s,e==null?void 0:e.in),h=c.getDay(),g=(h<l?7:0)+h-l;return c.setDate(c.getDate()-g),c.setHours(0,0,0,0),c}function qi(s,e){return Jn(s,{...e,weekStartsOn:1})}function ao(s,e){const t=Ut(s,void 0),n=t.getFullYear(),i=cs(t,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const r=qi(i),a=cs(t,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const l=qi(a);return t.getTime()>=r.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}function oo(s){const e=Ut(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function lo(s,...e){const t=cs.bind(null,e.find(n=>typeof n=="object"));return e.map(t)}function co(s,e){const t=Ut(s,void 0);return t.setHours(0,0,0,0),t}function Tu(s,e,t){const[n,i]=lo(void 0,s,e),r=co(n),a=co(i),l=+r-oo(r),c=+a-oo(a);return Math.round((l-c)/Su)}function Du(s,e){const t=ao(s),n=cs(s,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),qi(n)}function Nu(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Mu(s){return!(!Nu(s)&&typeof s!="number"||isNaN(+Ut(s)))}function Ou(s,e){const[t,n]=lo(s,e.start,e.end);return{start:t,end:n}}function uo(s,e){const{start:t,end:n}=Ou(void 0,s);let i=+t>+n;const r=i?+t:+n,a=i?n:t;a.setHours(0,0,0,0);let l=1;const c=[];for(;+a<=r;)c.push(cs(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return i?c.reverse():c}function Eu(s,e){const t=Ut(s,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Pu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Au=(s,e,t)=>{let n;const i=Pu[s];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function Nr(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Iu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Fu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bu={date:Nr({formats:Iu,defaultWidth:"full"}),time:Nr({formats:Lu,defaultWidth:"full"}),dateTime:Nr({formats:Fu,defaultWidth:"full"})},Vu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Hu=(s,e,t,n)=>Vu[s];function Rn(s){return(e,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let i;if(n==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;i=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;i=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return i[r]}}const Uu={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ju={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Wu={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},zu={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ku={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yu=(s,e)=>{const t=Number(s),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Gu={ordinalNumber:Yu,era:Rn({values:Uu,defaultWidth:"wide"}),quarter:Rn({values:qu,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Rn({values:ju,defaultWidth:"wide"}),day:Rn({values:Wu,defaultWidth:"wide"}),dayPeriod:Rn({values:zu,defaultWidth:"wide",formattingValues:Ku,defaultFormattingWidth:"wide"})};function ei(s){return(e,t={})=>{const n=t.width,i=n&&s.matchPatterns[n]||s.matchPatterns[s.defaultMatchWidth],r=e.match(i);if(!r)return null;const a=r[0],l=n&&s.parsePatterns[n]||s.parsePatterns[s.defaultParseWidth],c=Array.isArray(l)?Qu(l,m=>m.test(a)):Xu(l,m=>m.test(a));let h;h=s.valueCallback?s.valueCallback(c):c,h=t.valueCallback?t.valueCallback(h):h;const g=e.slice(a.length);return{value:h,rest:g}}}function Xu(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Qu(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function Zu(s){return(e,t={})=>{const n=e.match(s.matchPattern);if(!n)return null;const i=n[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(i.length);return{value:a,rest:l}}}const Ju=/^(\d+)(th|st|nd|rd)?/i,Ru=/\d+/i,ed={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},td={any:[/^b/i,/^(a|c)/i]},sd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},nd={any:[/1/i,/2/i,/3/i,/4/i]},id={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ad={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},od={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ld={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ud={ordinalNumber:Zu({matchPattern:Ju,parsePattern:Ru,valueCallback:s=>parseInt(s,10)}),era:ei({matchPatterns:ed,defaultMatchWidth:"wide",parsePatterns:td,defaultParseWidth:"any"}),quarter:ei({matchPatterns:sd,defaultMatchWidth:"wide",parsePatterns:nd,defaultParseWidth:"any",valueCallback:s=>s+1}),month:ei({matchPatterns:id,defaultMatchWidth:"wide",parsePatterns:rd,defaultParseWidth:"any"}),day:ei({matchPatterns:ad,defaultMatchWidth:"wide",parsePatterns:od,defaultParseWidth:"any"}),dayPeriod:ei({matchPatterns:ld,defaultMatchWidth:"any",parsePatterns:cd,defaultParseWidth:"any"})},dd={code:"en-US",formatDistance:Au,formatLong:Bu,formatRelative:Hu,localize:Gu,match:ud,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hd(s,e){const t=Ut(s,void 0);return Tu(t,Eu(t))+1}function pd(s,e){const t=Ut(s,void 0),n=+qi(t)-+Du(t);return Math.round(n/no)+1}function ho(s,e){var t,n,i,r;const a=Ut(s,e==null?void 0:e.in),l=a.getFullYear(),c=Ui(),h=(e==null?void 0:e.firstWeekContainsDate)??((n=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:n.firstWeekContainsDate)??c.firstWeekContainsDate??((r=(i=c.locale)==null?void 0:i.options)==null?void 0:r.firstWeekContainsDate)??1,g=cs((e==null?void 0:e.in)||s,0);g.setFullYear(l+1,0,h),g.setHours(0,0,0,0);const m=Jn(g,e),f=cs((e==null?void 0:e.in)||s,0);f.setFullYear(l,0,h),f.setHours(0,0,0,0);const v=Jn(f,e);return+a>=+m?l+1:+a>=+v?l:l-1}function fd(s,e){var t,n,i,r;const a=Ui(),l=(e==null?void 0:e.firstWeekContainsDate)??((n=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:n.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(i=a.locale)==null?void 0:i.options)==null?void 0:r.firstWeekContainsDate)??1,c=ho(s,e),h=cs((e==null?void 0:e.in)||s,0);return h.setFullYear(c,0,l),h.setHours(0,0,0,0),Jn(h,e)}function po(s,e){const t=Ut(s,e==null?void 0:e.in),n=+Jn(t,e)-+fd(t,e);return Math.round(n/no)+1}function Ue(s,e){const t=s<0?"-":"",n=Math.abs(s).toString().padStart(e,"0");return t+n}const Os={y(s,e){const t=s.getFullYear(),n=t>0?t:1-t;return Ue(e==="yy"?n%100:n,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):Ue(t+1,2)},d(s,e){return Ue(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return Ue(s.getHours()%12||12,e.length)},H(s,e){return Ue(s.getHours(),e.length)},m(s,e){return Ue(s.getMinutes(),e.length)},s(s,e){return Ue(s.getSeconds(),e.length)},S(s,e){const t=e.length,n=s.getMilliseconds(),i=Math.trunc(n*Math.pow(10,t-3));return Ue(i,e.length)}},yn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},fo={G:function(s,e,t){const n=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const n=s.getFullYear(),i=n>0?n:1-n;return t.ordinalNumber(i,{unit:"year"})}return Os.y(s,e)},Y:function(s,e,t,n){const i=ho(s,n),r=i>0?i:1-i;if(e==="YY"){const a=r%100;return Ue(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):Ue(r,e.length)},R:function(s,e){const t=ao(s);return Ue(t,e.length)},u:function(s,e){const t=s.getFullYear();return Ue(t,e.length)},Q:function(s,e,t){const n=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return Ue(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(s,e,t){const n=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return Ue(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(s,e,t){const n=s.getMonth();switch(e){case"M":case"MM":return Os.M(s,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(s,e,t){const n=s.getMonth();switch(e){case"L":return String(n+1);case"LL":return Ue(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(s,e,t,n){const i=po(s,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):Ue(i,e.length)},I:function(s,e,t){const n=pd(s);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):Ue(n,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):Os.d(s,e)},D:function(s,e,t){const n=hd(s);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):Ue(n,e.length)},E:function(s,e,t){const n=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(s,e,t,n){const i=s.getDay(),r=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return Ue(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(s,e,t,n){const i=s.getDay(),r=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return Ue(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(s,e,t){const n=s.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return Ue(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(s,e,t){const n=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(s,e,t){const n=s.getHours();let i;switch(n===12?i=yn.noon:n===0?i=yn.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(s,e,t){const n=s.getHours();let i;switch(n>=17?i=yn.evening:n>=12?i=yn.afternoon:n>=4?i=yn.morning:i=yn.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let n=s.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return Os.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):Os.H(s,e)},K:function(s,e,t){const n=s.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):Ue(n,e.length)},k:function(s,e,t){let n=s.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):Ue(n,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):Os.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):Os.s(s,e)},S:function(s,e){return Os.S(s,e)},X:function(s,e,t){const n=s.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return go(n);case"XXXX":case"XX":return Xs(n);case"XXXXX":case"XXX":default:return Xs(n,":")}},x:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"x":return go(n);case"xxxx":case"xx":return Xs(n);case"xxxxx":case"xxx":default:return Xs(n,":")}},O:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+mo(n,":");case"OOOO":default:return"GMT"+Xs(n,":")}},z:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+mo(n,":");case"zzzz":default:return"GMT"+Xs(n,":")}},t:function(s,e,t){const n=Math.trunc(+s/1e3);return Ue(n,e.length)},T:function(s,e,t){return Ue(+s,e.length)}};function mo(s,e=""){const t=s>0?"-":"+",n=Math.abs(s),i=Math.trunc(n/60),r=n%60;return r===0?t+String(i):t+String(i)+e+Ue(r,2)}function go(s,e){return s%60===0?(s>0?"-":"+")+Ue(Math.abs(s)/60,2):Xs(s,e)}function Xs(s,e=""){const t=s>0?"-":"+",n=Math.abs(s),i=Ue(Math.trunc(n/60),2),r=Ue(n%60,2);return t+i+e+r}const bo=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},vo=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},md=(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return bo(s,e);let r;switch(n){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",bo(n,e)).replace("{{time}}",vo(i,e))},gd={p:vo,P:md},bd=/^D+$/,vd=/^Y+$/,kd=["D","DD","YY","YYYY"];function yd(s){return bd.test(s)}function _d(s){return vd.test(s)}function $d(s,e,t){const n=wd(s,e,t);if(console.warn(n),kd.includes(s))throw new RangeError(n)}function wd(s,e,t){const n=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const xd=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Sd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Cd=/^'([^]*?)'?$/,Td=/''/g,Dd=/[a-zA-Z]/;function Nd(s,e,t){var n,i,r,a;const l=Ui(),c=l.locale??dd,h=l.firstWeekContainsDate??((i=(n=l.locale)==null?void 0:n.options)==null?void 0:i.firstWeekContainsDate)??1,g=l.weekStartsOn??((a=(r=l.locale)==null?void 0:r.options)==null?void 0:a.weekStartsOn)??0,m=Ut(s,void 0);if(!Mu(m))throw new RangeError("Invalid time value");let f=e.match(Sd).map(b=>{const w=b[0];if(w==="p"||w==="P"){const C=gd[w];return C(b,c.formatLong)}return b}).join("").match(xd).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const w=b[0];if(w==="'")return{isToken:!1,value:Md(b)};if(fo[w])return{isToken:!0,value:b};if(w.match(Dd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:b}});c.localize.preprocessor&&(f=c.localize.preprocessor(m,f));const v={firstWeekContainsDate:h,weekStartsOn:g,locale:c};return f.map(b=>{if(!b.isToken)return b.value;const w=b.value;(_d(w)||yd(w))&&$d(w,e,String(s));const C=fo[w[0]];return C(m,w,c.localize,v)}).join("")}function Md(s){const e=s.match(Cd);return e?e[1].replace(Td,"'"):s}function Od(s,e){const t=Ut(s,void 0).getDay();return t===0?7:t}function Ed(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const ko={},ti={};function Qs(s,e){try{const t=(ko[s]||(ko[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return t in ti?ti[t]:yo(t,t.split(":"))}catch{if(s in ti)return ti[s];const t=s==null?void 0:s.match(Pd);return t?yo(s,t.slice(1)):NaN}}const Pd=/([+-]\d\d):?(\d\d)?/;function yo(s,e){const t=+(e[0]||0),n=+(e[1]||0),i=+(e[2]||0)/60;return ti[s]=t*60+n>0?t*60+n+i:t*60-n-i}let si=class Ti extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Qs(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),$o(this),Mr(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ti(...t,e):new Ti(Date.now(),e)}withTimeZone(e){return new Ti(+this,e)}getTimezoneOffset(){const e=-Qs(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Mr(this),+this}[Symbol.for("constructDateFrom")](e){return new Ti(+new Date(e),this.timeZone)}};const _o=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!_o.test(s))return;const e=s.replace(_o,"$1UTC");si.prototype[e]&&(s.startsWith("get")?si.prototype[s]=function(){return this.internal[e]()}:(si.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Ad(this),+this},si.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Mr(this),+this}))});function Mr(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Qs(s.timeZone,s)*60))}function Ad(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),$o(s)}function $o(s){const e=Qs(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),n=new Date(+s);n.setUTCHours(n.getUTCHours()-1);const i=-new Date(+s).getTimezoneOffset(),r=-new Date(+n).getTimezoneOffset(),a=i-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const c=i-t;c&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+c);const h=new Date(+s);h.setUTCSeconds(0);const g=i>0?h.getSeconds():(h.getSeconds()-60)%60,m=Math.round(-(Qs(s.timeZone,s)*60))%60;(m||g)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+m+g));const f=Qs(s.timeZone,s),v=f>0?Math.floor(f):Math.ceil(f),b=-new Date(+s).getTimezoneOffset()-v,w=v!==t,C=b-c;if(w&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const S=Qs(s.timeZone,s),T=S>0?Math.floor(S):Math.ceil(S),F=v-T;F&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+F),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+F))}}let Or=class Di extends si{static tz(e,...t){return t.length?new Di(...t,e):new Di(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),i=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,i]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${n} ${t} ${i}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,i]=this.tzComponents();return`${e} GMT${t}${n}${i} (${Ed(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",n=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),i=String(Math.abs(e)%60).padStart(2,"0");return[t,n,i]}withTimeZone(e){return new Di(+this,e)}[Symbol.for("constructDateFrom")](e){return new Di(+new Date(e),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Id=(s=window.pktTz)=>{const e=new Or(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function vs(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,n]=s.split("-").map(Number);return new Date(e,t-1,n)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const gt=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),n=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${n}`},Es=s=>{if(!s)return null;const e=vs(s);return isNaN(e.getTime())?null:e},wo=(s,e)=>{const t=Qt(s);return isNaN(t.getTime())?"":Nd(t,e)},Qt=(s="",e)=>{const t=typeof s=="string"?vs(s):s;return!t||isNaN(t.getTime())?new Date:t},Zs=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const n=new Date(s,e,t);return isNaN(n.getTime())?new Date:n},ni=s=>{let e;return typeof s=="number"?e=new Or(s,window.pktTz):e=new Or(s,window.pktTz),e.setHours(12,0,0,0),e};let Er=null,xo;const Ld=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Er||xo!==e)&&(Er=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),xo=e),Er.format(s)},Fd=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const n=e?Qt(e):null,i=t?Qt(t):null;return!(n&&s<n||i&&s>i)},Bd=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=gt(s);return e.includes(t)},Vd=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},So=(s,e,t,n,i)=>!(!s||isNaN(s.getTime())||!Fd(s,e,t)||n&&Bd(s,n)||i&&Vd(s,i)),Hd=(s,e,t,n,i)=>s.filter(r=>{const a=Es(r);return a&&So(a,e,t,n,i)}),Co=s=>s.slice().sort((e,t)=>{const n=Es(e),i=Es(t);return!n||!i?0:n.getTime()-i.getTime()}),Ud=(s,e)=>{const t=Es(s),n=Es(e);return!t||!n?!1:t<=n},ii=s=>{if(!s)return[];if(Array.isArray(s))return s.filter(Boolean);if(typeof s=="string"&&s.trimStart().startsWith("["))try{const e=JSON.parse(s);if(Array.isArray(e))return e.filter(Boolean)}catch{}return String(s).split(",").map(e=>e.trim()).filter(Boolean)},qd=s=>s.join(","),jd=s=>ii(s),Wd=s=>s?vs(s):null,zd=s=>{if(typeof s=="string")return s.split(",").map(e=>vs(e));if(Array.isArray(s))return s.map(e=>vs(e))},_n={csvToArray:jd,stringToDate:Wd,stringsToDate:zd},Kd={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Js={props:Kd};function To(s,e){const t=(e.excludedates??[]).map(n=>typeof n=="string"?n:gt(n));return!So(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function Yd(s,e,t,n){return!!(To(s,t)||!e&&n.multiple&&n.maxMultiple>0&&n.selectedCount>=n.maxMultiple)}function Gd(s,e,t){const n=Zs(s,e,0);return!(t&&Qt(t)>n)}function Xd(s,e,t){const n=Zs(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Qt(t)<n)}const ri=7,Qd=6;function Zd(s,e){const t=Zs(s,e,1),n=Zs(s,e+1,0),i=(t.getDay()+Qd)%ri,r=n.getDate(),a=Math.ceil((r+i)/ri),l=Zs(s,e,0).getDate(),c=po(t);return{firstDayOfMonth:t,lastDayOfMonth:n,startingDay:i,numDays:r,numRows:a,numDaysPrevMonth:l,initialWeek:c}}function Jd(s,e,t,n){const{startingDay:i,numDays:r}=n;return s===0&&e<i?"prev-month":t>r?"next-month":"current-month"}function Rd(s,e,t,n){const{startingDay:i,numDaysPrevMonth:r,numDays:a}=n;return s==="prev-month"?r-(i-e-1):s==="next-month"?t-a:t}function $n(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>vs(e))}function Do(s,e){const t=uo({start:s,end:e}),n={};if(Array.isArray(t)&&t.length)for(let i=0;i<t.length;i++){const r=t[i],a=r>s&&r<e;n[gt(r)]=a}return n}function No(s,e,t,n){if(e.length!==1)return!0;const i=uo({start:e[0],end:s});if(!Array.isArray(i)||!i.length)return!0;for(let r=0;r<i.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((n??[]).includes(Od(i[r]).toString()))return!1}return!0}function Pr(s,e){const t=gt(s);return e.includes(t)?e:[...e,t]}function Ar(s,e){const t=gt(s),n=e.indexOf(t);if(n===-1)return e;if(e.length===1)return[];const i=[...e];return i.splice(n,1),i}function eh(s,e,t){const n=gt(s);return e.includes(n)?Ar(s,e):t>0&&e.length>=t?e:Pr(s,e)}function th(s,e,t){const n=gt(s),i=$n(e);if(e.includes(n))return e.indexOf(n)===0?[]:Ar(s,e);if(e.length>1)return[n];if(e.length===1){if(!No(s,i,t.excludedates,t.excludeweekdays))return[n];if(i[0]>s)return[n]}return Pr(s,e)}const sh={ArrowLeft:-1,ArrowRight:1,ArrowUp:-ri,ArrowDown:ri};function nh(s){var e;const t=s.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((e=s.dataset)!=null&&e.date)}function ih(s,e,t){let n=ro(s,e);if(!n)return null;let i=t(`button[data-date="${gt(n)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(n=ro(n,e),i=t(`button[data-date="${gt(n)}"]`),!i)return null;return n}function rh(s){return sh[s]??null}var ah=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,Xe=(s,e,t,n)=>{for(var i=n>1?void 0:n?oh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&ah(e,t,i),i};let Ke=class extends Gt{constructor(){super(...arguments),this.selected=[],this.multiple=Js.props.multiple.default,this.maxMultiple=Js.props.maxMultiple.default,this.range=Js.props.range.default,this.earliest=Js.props.earliest.default,this.latest=Js.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=Js.props.weeknumbers.default,this.withcontrols=Js.props.withcontrols.default,this.currentmonth=null,this.today=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get todayDate(){return this.today?vs(this.today):Id()}firstUpdated(e){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(e){super.updated(e),e.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=$n(this.selected),this.range&&this.selected.length===2&&(this.inRange=Do(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const e=vs(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?ni(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=ni(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=ni(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){const t=rh(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){const n=e.target;if(nh(n))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const i=this.focusedDate?Qt(this.focusedDate):Zs(this.year,this.month,1),r=ih(i,t,this.querySelector.bind(this));if(r){const a=this.querySelector(`button[data-date="${gt(r)}"]`);a instanceof HTMLButtonElement&&!a.dataset.disabled&&(this.focusedDate=gt(r),a.focus())}}render(){return y`
247
+ `}};mu([u({type:Array})],Ra.prototype,"breadcrumbs");try{Se("pkt-breadcrumbs")(Ra)}catch{console.warn("Forsøker å definere <pkt-breadcrumbs>, men den er allerede definert")}const eo=6048e5,gu=864e5,to=Symbol.for("constructDateFrom");function rs(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&to in s?s[to](e):s instanceof Date?new s.constructor(e):new Date(e)}function Ht(s,e){return rs(e||s,s)}function so(s,e,t){const n=Ht(s,void 0);return isNaN(e)?rs(s,NaN):(e&&n.setDate(n.getDate()+e),n)}let bu={};function Li(){return bu}function Un(s,e){var t,n,i,r;const a=Li(),l=(e==null?void 0:e.weekStartsOn)??((n=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:n.weekStartsOn)??a.weekStartsOn??((r=(i=a.locale)==null?void 0:i.options)==null?void 0:r.weekStartsOn)??0,c=Ht(s,e==null?void 0:e.in),h=c.getDay(),g=(h<l?7:0)+h-l;return c.setDate(c.getDate()-g),c.setHours(0,0,0,0),c}function Fi(s,e){return Un(s,{...e,weekStartsOn:1})}function no(s,e){const t=Ht(s,void 0),n=t.getFullYear(),i=rs(t,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const r=Fi(i),a=rs(t,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const l=Fi(a);return t.getTime()>=r.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}function io(s){const e=Ht(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function ro(s,...e){const t=rs.bind(null,e.find(n=>typeof n=="object"));return e.map(t)}function ao(s,e){const t=Ht(s,void 0);return t.setHours(0,0,0,0),t}function ku(s,e,t){const[n,i]=ro(void 0,s,e),r=ao(n),a=ao(i),l=+r-io(r),c=+a-io(a);return Math.round((l-c)/gu)}function vu(s,e){const t=no(s),n=rs(s,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Fi(n)}function yu(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function _u(s){return!(!yu(s)&&typeof s!="number"||isNaN(+Ht(s)))}function wu(s,e){const[t,n]=ro(s,e.start,e.end);return{start:t,end:n}}function oo(s,e){const{start:t,end:n}=wu(void 0,s);let i=+t>+n;const r=i?+t:+n,a=i?n:t;a.setHours(0,0,0,0);let l=1;const c=[];for(;+a<=r;)c.push(rs(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return i?c.reverse():c}function $u(s,e){const t=Ht(s,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const xu={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Su=(s,e,t)=>{let n;const i=xu[s];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function Cr(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Cu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Tu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Du={date:Cr({formats:Cu,defaultWidth:"full"}),time:Cr({formats:Tu,defaultWidth:"full"}),dateTime:Cr({formats:Nu,defaultWidth:"full"})},Mu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Eu=(s,e,t,n)=>Mu[s];function qn(s){return(e,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let i;if(n==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;i=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;i=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return i[r]}}const Ou={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Au={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Iu={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Pu={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Lu={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Fu={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Bu=(s,e)=>{const t=Number(s),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},Vu={ordinalNumber:Bu,era:qn({values:Ou,defaultWidth:"wide"}),quarter:qn({values:Au,defaultWidth:"wide",argumentCallback:s=>s-1}),month:qn({values:Iu,defaultWidth:"wide"}),day:qn({values:Pu,defaultWidth:"wide"}),dayPeriod:qn({values:Lu,defaultWidth:"wide",formattingValues:Fu,defaultFormattingWidth:"wide"})};function Wn(s){return(e,t={})=>{const n=t.width,i=n&&s.matchPatterns[n]||s.matchPatterns[s.defaultMatchWidth],r=e.match(i);if(!r)return null;const a=r[0],l=n&&s.parsePatterns[n]||s.parsePatterns[s.defaultParseWidth],c=Array.isArray(l)?Uu(l,m=>m.test(a)):Hu(l,m=>m.test(a));let h;h=s.valueCallback?s.valueCallback(c):c,h=t.valueCallback?t.valueCallback(h):h;const g=e.slice(a.length);return{value:h,rest:g}}}function Hu(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Uu(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function qu(s){return(e,t={})=>{const n=e.match(s.matchPattern);if(!n)return null;const i=n[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(i.length);return{value:a,rest:l}}}const Wu=/^(\d+)(th|st|nd|rd)?/i,ju=/\d+/i,zu={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ku={any:[/^b/i,/^(a|c)/i]},Yu={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Gu={any:[/1/i,/2/i,/3/i,/4/i]},Xu={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qu={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Zu={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ju={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ru={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ed={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},td={ordinalNumber:qu({matchPattern:Wu,parsePattern:ju,valueCallback:s=>parseInt(s,10)}),era:Wn({matchPatterns:zu,defaultMatchWidth:"wide",parsePatterns:Ku,defaultParseWidth:"any"}),quarter:Wn({matchPatterns:Yu,defaultMatchWidth:"wide",parsePatterns:Gu,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Wn({matchPatterns:Xu,defaultMatchWidth:"wide",parsePatterns:Qu,defaultParseWidth:"any"}),day:Wn({matchPatterns:Zu,defaultMatchWidth:"wide",parsePatterns:Ju,defaultParseWidth:"any"}),dayPeriod:Wn({matchPatterns:Ru,defaultMatchWidth:"any",parsePatterns:ed,defaultParseWidth:"any"})},sd={code:"en-US",formatDistance:Su,formatLong:Du,formatRelative:Eu,localize:Vu,match:td,options:{weekStartsOn:0,firstWeekContainsDate:1}};function nd(s,e){const t=Ht(s,void 0);return ku(t,$u(t))+1}function id(s,e){const t=Ht(s,void 0),n=+Fi(t)-+vu(t);return Math.round(n/eo)+1}function lo(s,e){var t,n,i,r;const a=Ht(s,e==null?void 0:e.in),l=a.getFullYear(),c=Li(),h=(e==null?void 0:e.firstWeekContainsDate)??((n=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:n.firstWeekContainsDate)??c.firstWeekContainsDate??((r=(i=c.locale)==null?void 0:i.options)==null?void 0:r.firstWeekContainsDate)??1,g=rs((e==null?void 0:e.in)||s,0);g.setFullYear(l+1,0,h),g.setHours(0,0,0,0);const m=Un(g,e),f=rs((e==null?void 0:e.in)||s,0);f.setFullYear(l,0,h),f.setHours(0,0,0,0);const k=Un(f,e);return+a>=+m?l+1:+a>=+k?l:l-1}function rd(s,e){var t,n,i,r;const a=Li(),l=(e==null?void 0:e.firstWeekContainsDate)??((n=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:n.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(i=a.locale)==null?void 0:i.options)==null?void 0:r.firstWeekContainsDate)??1,c=lo(s,e),h=rs((e==null?void 0:e.in)||s,0);return h.setFullYear(c,0,l),h.setHours(0,0,0,0),Un(h,e)}function co(s,e){const t=Ht(s,e==null?void 0:e.in),n=+Un(t,e)-+rd(t,e);return Math.round(n/eo)+1}function He(s,e){const t=s<0?"-":"",n=Math.abs(s).toString().padStart(e,"0");return t+n}const Ns={y(s,e){const t=s.getFullYear(),n=t>0?t:1-t;return He(e==="yy"?n%100:n,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):He(t+1,2)},d(s,e){return He(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return He(s.getHours()%12||12,e.length)},H(s,e){return He(s.getHours(),e.length)},m(s,e){return He(s.getMinutes(),e.length)},s(s,e){return He(s.getSeconds(),e.length)},S(s,e){const t=e.length,n=s.getMilliseconds(),i=Math.trunc(n*Math.pow(10,t-3));return He(i,e.length)}},pn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},uo={G:function(s,e,t){const n=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const n=s.getFullYear(),i=n>0?n:1-n;return t.ordinalNumber(i,{unit:"year"})}return Ns.y(s,e)},Y:function(s,e,t,n){const i=lo(s,n),r=i>0?i:1-i;if(e==="YY"){const a=r%100;return He(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):He(r,e.length)},R:function(s,e){const t=no(s);return He(t,e.length)},u:function(s,e){const t=s.getFullYear();return He(t,e.length)},Q:function(s,e,t){const n=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return He(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(s,e,t){const n=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return He(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(s,e,t){const n=s.getMonth();switch(e){case"M":case"MM":return Ns.M(s,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(s,e,t){const n=s.getMonth();switch(e){case"L":return String(n+1);case"LL":return He(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(s,e,t,n){const i=co(s,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):He(i,e.length)},I:function(s,e,t){const n=id(s);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):He(n,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):Ns.d(s,e)},D:function(s,e,t){const n=nd(s);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):He(n,e.length)},E:function(s,e,t){const n=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(s,e,t,n){const i=s.getDay(),r=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return He(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(s,e,t,n){const i=s.getDay(),r=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return He(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(s,e,t){const n=s.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return He(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(s,e,t){const n=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(s,e,t){const n=s.getHours();let i;switch(n===12?i=pn.noon:n===0?i=pn.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(s,e,t){const n=s.getHours();let i;switch(n>=17?i=pn.evening:n>=12?i=pn.afternoon:n>=4?i=pn.morning:i=pn.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let n=s.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return Ns.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):Ns.H(s,e)},K:function(s,e,t){const n=s.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):He(n,e.length)},k:function(s,e,t){let n=s.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):He(n,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):Ns.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):Ns.s(s,e)},S:function(s,e){return Ns.S(s,e)},X:function(s,e,t){const n=s.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return po(n);case"XXXX":case"XX":return qs(n);case"XXXXX":case"XXX":default:return qs(n,":")}},x:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"x":return po(n);case"xxxx":case"xx":return qs(n);case"xxxxx":case"xxx":default:return qs(n,":")}},O:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ho(n,":");case"OOOO":default:return"GMT"+qs(n,":")}},z:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ho(n,":");case"zzzz":default:return"GMT"+qs(n,":")}},t:function(s,e,t){const n=Math.trunc(+s/1e3);return He(n,e.length)},T:function(s,e,t){return He(+s,e.length)}};function ho(s,e=""){const t=s>0?"-":"+",n=Math.abs(s),i=Math.trunc(n/60),r=n%60;return r===0?t+String(i):t+String(i)+e+He(r,2)}function po(s,e){return s%60===0?(s>0?"-":"+")+He(Math.abs(s)/60,2):qs(s,e)}function qs(s,e=""){const t=s>0?"-":"+",n=Math.abs(s),i=He(Math.trunc(n/60),2),r=He(n%60,2);return t+i+e+r}const fo=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},mo=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},ad=(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return fo(s,e);let r;switch(n){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",fo(n,e)).replace("{{time}}",mo(i,e))},od={p:mo,P:ad},ld=/^D+$/,cd=/^Y+$/,ud=["D","DD","YY","YYYY"];function dd(s){return ld.test(s)}function hd(s){return cd.test(s)}function pd(s,e,t){const n=fd(s,e,t);if(console.warn(n),ud.includes(s))throw new RangeError(n)}function fd(s,e,t){const n=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const md=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bd=/^'([^]*?)'?$/,kd=/''/g,vd=/[a-zA-Z]/;function yd(s,e,t){var n,i,r,a;const l=Li(),c=l.locale??sd,h=l.firstWeekContainsDate??((i=(n=l.locale)==null?void 0:n.options)==null?void 0:i.firstWeekContainsDate)??1,g=l.weekStartsOn??((a=(r=l.locale)==null?void 0:r.options)==null?void 0:a.weekStartsOn)??0,m=Ht(s,void 0);if(!_u(m))throw new RangeError("Invalid time value");let f=e.match(gd).map(b=>{const $=b[0];if($==="p"||$==="P"){const C=od[$];return C(b,c.formatLong)}return b}).join("").match(md).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const $=b[0];if($==="'")return{isToken:!1,value:_d(b)};if(uo[$])return{isToken:!0,value:b};if($.match(vd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:b}});c.localize.preprocessor&&(f=c.localize.preprocessor(m,f));const k={firstWeekContainsDate:h,weekStartsOn:g,locale:c};return f.map(b=>{if(!b.isToken)return b.value;const $=b.value;(hd($)||dd($))&&pd($,e,String(s));const C=uo[$[0]];return C(m,$,c.localize,k)}).join("")}function _d(s){const e=s.match(bd);return e?e[1].replace(kd,"'"):s}function wd(s,e){const t=Ht(s,void 0).getDay();return t===0?7:t}function $d(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const go={},jn={};function Ws(s,e){try{const t=(go[s]||(go[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return t in jn?jn[t]:bo(t,t.split(":"))}catch{if(s in jn)return jn[s];const t=s==null?void 0:s.match(xd);return t?bo(s,t.slice(1)):NaN}}const xd=/([+-]\d\d):?(\d\d)?/;function bo(s,e){const t=+(e[0]||0),n=+(e[1]||0),i=+(e[2]||0)/60;return jn[s]=t*60+n>0?t*60+n+i:t*60-n-i}let zn=class yi extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ws(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),vo(this),Tr(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new yi(...t,e):new yi(Date.now(),e)}withTimeZone(e){return new yi(+this,e)}getTimezoneOffset(){const e=-Ws(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Tr(this),+this}[Symbol.for("constructDateFrom")](e){return new yi(+new Date(e),this.timeZone)}};const ko=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ko.test(s))return;const e=s.replace(ko,"$1UTC");zn.prototype[e]&&(s.startsWith("get")?zn.prototype[s]=function(){return this.internal[e]()}:(zn.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Sd(this),+this},zn.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Tr(this),+this}))});function Tr(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Ws(s.timeZone,s)*60))}function Sd(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),vo(s)}function vo(s){const e=Ws(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),n=new Date(+s);n.setUTCHours(n.getUTCHours()-1);const i=-new Date(+s).getTimezoneOffset(),r=-new Date(+n).getTimezoneOffset(),a=i-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const c=i-t;c&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+c);const h=new Date(+s);h.setUTCSeconds(0);const g=i>0?h.getSeconds():(h.getSeconds()-60)%60,m=Math.round(-(Ws(s.timeZone,s)*60))%60;(m||g)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+m+g));const f=Ws(s.timeZone,s),k=f>0?Math.floor(f):Math.ceil(f),b=-new Date(+s).getTimezoneOffset()-k,$=k!==t,C=b-c;if($&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const S=Ws(s.timeZone,s),T=S>0?Math.floor(S):Math.ceil(S),F=k-T;F&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+F),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+F))}}let Nr=class _i extends zn{static tz(e,...t){return t.length?new _i(...t,e):new _i(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),i=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,i]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${n} ${t} ${i}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,i]=this.tzComponents();return`${e} GMT${t}${n}${i} (${$d(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",n=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),i=String(Math.abs(e)%60).padStart(2,"0");return[t,n,i]}withTimeZone(e){return new _i(+this,e)}[Symbol.for("constructDateFrom")](e){return new _i(+new Date(e),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Cd=(s=window.pktTz)=>{const e=new Nr(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function ms(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,n]=s.split("-").map(Number);return new Date(e,t-1,n)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const pt=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),n=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${n}`},Ds=s=>{if(!s)return null;const e=ms(s);return isNaN(e.getTime())?null:e},yo=(s,e)=>{const t=Gt(s);return isNaN(t.getTime())?"":yd(t,e)},Gt=(s="",e)=>{const t=typeof s=="string"?ms(s):s;return!t||isNaN(t.getTime())?new Date:t},js=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const n=new Date(s,e,t);return isNaN(n.getTime())?new Date:n},Kn=s=>{let e;return typeof s=="number"?e=new Nr(s,window.pktTz):e=new Nr(s,window.pktTz),e.setHours(12,0,0,0),e};let Dr=null,_o;const Td=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Dr||_o!==e)&&(Dr=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),_o=e),Dr.format(s)},Nd=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const n=e?Gt(e):null,i=t?Gt(t):null;return!(n&&s<n||i&&s>i)},Dd=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=pt(s);return e.includes(t)},Md=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},wo=(s,e,t,n,i)=>!(!s||isNaN(s.getTime())||!Nd(s,e,t)||n&&Dd(s,n)||i&&Md(s,i)),Ed=(s,e,t,n,i)=>s.filter(r=>{const a=Ds(r);return a&&wo(a,e,t,n,i)}),$o=s=>s.slice().sort((e,t)=>{const n=Ds(e),i=Ds(t);return!n||!i?0:n.getTime()-i.getTime()}),Od=(s,e)=>{const t=Ds(s),n=Ds(e);return!t||!n?!1:t<=n},Yn=s=>{if(!s)return[];if(Array.isArray(s))return s.filter(Boolean);if(typeof s=="string"&&s.trimStart().startsWith("["))try{const e=JSON.parse(s);if(Array.isArray(e))return e.filter(Boolean)}catch{}return String(s).split(",").map(e=>e.trim()).filter(Boolean)},Ad=s=>s.join(","),Id=s=>Yn(s),Pd=s=>s?ms(s):null,Ld=s=>{if(typeof s=="string")return s.split(",").map(e=>ms(e));if(Array.isArray(s))return s.map(e=>ms(e))},fn={csvToArray:Id,stringToDate:Pd,stringsToDate:Ld},Fd={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},zs={props:Fd};function xo(s,e){const t=(e.excludedates??[]).map(n=>typeof n=="string"?n:pt(n));return!wo(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function Bd(s,e,t,n){return!!(xo(s,t)||!e&&n.multiple&&n.maxMultiple>0&&n.selectedCount>=n.maxMultiple)}function Vd(s,e,t){const n=js(s,e,0);return!(t&&Gt(t)>n)}function Hd(s,e,t){const n=js(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Gt(t)<n)}const Gn=7,Ud=6;function qd(s,e){const t=js(s,e,1),n=js(s,e+1,0),i=(t.getDay()+Ud)%Gn,r=n.getDate(),a=Math.ceil((r+i)/Gn),l=js(s,e,0).getDate(),c=co(t);return{firstDayOfMonth:t,lastDayOfMonth:n,startingDay:i,numDays:r,numRows:a,numDaysPrevMonth:l,initialWeek:c}}function Wd(s,e,t,n){const{startingDay:i,numDays:r}=n;return s===0&&e<i?"prev-month":t>r?"next-month":"current-month"}function jd(s,e,t,n){const{startingDay:i,numDaysPrevMonth:r,numDays:a}=n;return s==="prev-month"?r-(i-e-1):s==="next-month"?t-a:t}function mn(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>ms(e))}function So(s,e){const t=oo({start:s,end:e}),n={};if(Array.isArray(t)&&t.length)for(let i=0;i<t.length;i++){const r=t[i],a=r>s&&r<e;n[pt(r)]=a}return n}function Co(s,e,t,n){if(e.length!==1)return!0;const i=oo({start:e[0],end:s});if(!Array.isArray(i)||!i.length)return!0;for(let r=0;r<i.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((n??[]).includes(wd(i[r]).toString()))return!1}return!0}function Mr(s,e){const t=pt(s);return e.includes(t)?e:[...e,t]}function Er(s,e){const t=pt(s),n=e.indexOf(t);if(n===-1)return e;if(e.length===1)return[];const i=[...e];return i.splice(n,1),i}function zd(s,e,t){const n=pt(s);return e.includes(n)?Er(s,e):t>0&&e.length>=t?e:Mr(s,e)}function Kd(s,e,t){const n=pt(s),i=mn(e);if(e.includes(n))return e.indexOf(n)===0?[]:Er(s,e);if(e.length>1)return[n];if(e.length===1){if(!Co(s,i,t.excludedates,t.excludeweekdays))return[n];if(i[0]>s)return[n]}return Mr(s,e)}const Yd={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Gn,ArrowDown:Gn};function Gd(s){var e;const t=s.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((e=s.dataset)!=null&&e.date)}function Xd(s,e,t){let n=so(s,e);if(!n)return null;let i=t(`button[data-date="${pt(n)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(n=so(n,e),i=t(`button[data-date="${pt(n)}"]`),!i)return null;return n}function Qd(s){return Yd[s]??null}var Zd=Object.defineProperty,Ze=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Zd(e,t,i),i};let Ge=class extends Kt{constructor(){super(...arguments),this.selected=[],this.multiple=zs.props.multiple.default,this.maxMultiple=zs.props.maxMultiple.default,this.range=zs.props.range.default,this.earliest=zs.props.earliest.default,this.latest=zs.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=zs.props.weeknumbers.default,this.withcontrols=zs.props.withcontrols.default,this.currentmonth=null,this.today=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get todayDate(){return this.today?ms(this.today):Cd()}firstUpdated(e){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(e){super.updated(e),e.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=mn(this.selected),this.range&&this.selected.length===2&&(this.inRange=So(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const e=ms(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?Kn(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=Kn(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Kn(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){const t=Qd(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){const n=e.target;if(Gd(n))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const i=this.focusedDate?Gt(this.focusedDate):js(this.year,this.month,1),r=Xd(i,t,this.querySelector.bind(this));if(r){const a=this.querySelector(`button[data-date="${pt(r)}"]`);a instanceof HTMLButtonElement&&!a.dataset.disabled&&(this.focusedDate=pt(r),a.focus())}}render(){return y`
248
248
  <div
249
249
  class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
250
250
  @focusout=${this.closeEvent}
@@ -309,7 +309,7 @@
309
309
  />
310
310
  </div>`:y`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
311
311
  ${this.monthStrings[this.month]} ${this.year}
312
- </div>`}getDayViewData(e,t){const n=Zs(this.year,this.month,e),i=gt(n),r=i===gt(t),a=this.selected.includes(i),l=this.isDayDisabled(n,a),c=this.calculateTabIndex(i,l,e);return{currentDate:n,currentDateISO:i,isToday:r,isSelected:a,isDisabled:l,ariaLabel:Ld(n),tabindex:c}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return Yd(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,n){return this.focusedDate?this.focusedDate===e&&!t?"0":"-1":!t&&this.tabIndexSet===0?(this.tabIndexSet=n,"0"):this.tabIndexSet===n?"0":"-1"}getDayCellClasses(e){const{currentDateISO:t,isToday:n,isSelected:i}=e,r=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],a=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-cal-today":n,"pkt-cal-selected":i,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":this.rangeHovered!==null&&t===gt(this.rangeHovered)}}getDayButtonClasses(e){const{currentDateISO:t,isToday:n,isSelected:i,isDisabled:r}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],l=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":n,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===gt(this.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(e,t){const n=this.getDayViewData(e,t),{currentDate:i,currentDateISO:r,isSelected:a,isDisabled:l,ariaLabel:c,tabindex:h}=n;this.selectableDates.push({currentDateISO:r,isDisabled:l,tabindex:h});const g=this.getDayCellClasses(n),m=this.getDayButtonClasses(n);return y`<td class=${Z(g)}>
312
+ </div>`}getDayViewData(e,t){const n=js(this.year,this.month,e),i=pt(n),r=i===pt(t),a=this.selected.includes(i),l=this.isDayDisabled(n,a),c=this.calculateTabIndex(i,l,e);return{currentDate:n,currentDateISO:i,isToday:r,isSelected:a,isDisabled:l,ariaLabel:Td(n),tabindex:c}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return Bd(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,n){return this.focusedDate?this.focusedDate===e&&!t?"0":"-1":!t&&this.tabIndexSet===0?(this.tabIndexSet=n,"0"):this.tabIndexSet===n?"0":"-1"}getDayCellClasses(e){const{currentDateISO:t,isToday:n,isSelected:i}=e,r=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],a=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-cal-today":n,"pkt-cal-selected":i,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":this.rangeHovered!==null&&t===pt(this.rangeHovered)}}getDayButtonClasses(e){const{currentDateISO:t,isToday:n,isSelected:i,isDisabled:r}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],l=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":n,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===pt(this.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(e,t){const n=this.getDayViewData(e,t),{currentDate:i,currentDateISO:r,isSelected:a,isDisabled:l,ariaLabel:c,tabindex:h}=n;this.selectableDates.push({currentDateISO:r,isDisabled:l,tabindex:h});const g=this.getDayCellClasses(n),m=this.getDayButtonClasses(n);return y`<td class=${Z(g)}>
313
313
  <button
314
314
  type="button"
315
315
  aria-pressed=${a?"true":"false"}
@@ -333,7 +333,7 @@
333
333
  >
334
334
  <span class="pkt-btn__text pkt-txt-14-light">${e}</span>
335
335
  </div>
336
- </td>`}renderWeekRow(e){return y`<tr class="pkt-cal-week-row" role="row">${e}</tr>`}renderCalendarBody(){const e=this.todayDate,t=Zd(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let n=1;this.week=t.initialWeek;const i=[];for(let r=0;r<t.numRows;r++){const a=[];this.weeknumbers&&a.push(y`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let l=0;l<ri;l++){const c=Jd(r,l,n,t);if(c==="current-month")a.push(this.renderDayView(n,e)),n++;else{const h=Rd(c,l,n,t);a.push(this.renderEmptyDayCell(h)),c==="next-month"&&n++}}i.push(this.renderWeekRow(a))}return i}isExcluded(e){return To(e,this.getDateConstraints())}isPrevMonthAllowed(){return Gd(this.year,this.month,this.earliest)}prevMonth(){const e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return Xd(this.year,this.month,this.latest)}nextMonth(){const e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=typeof e=="string"?parseInt(e):e,this.month=typeof t=="string"?parseInt(t):t,this.currentmonth=ni(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected=="string"?this.selected.split(","):this.selected}addToSelected(e){this.selected=Pr(e,this.normalizeSelected()),this._selected=$n(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=Ar(e,this.normalizeSelected()),this._selected=$n(this.selected)}toggleSelected(e){this.selected=eh(e,this.normalizeSelected(),this.maxMultiple),this._selected=$n(this.selected)}isRangeAllowed(e){return No(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=th(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=$n(this.selected),this.selected.length===2?(this.convertSelected(),this.close()):this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(e){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(e)||this._selected[0]>=e){this.rangeHovered=null;return}this.rangeHovered=e,this.inRange=Do(this._selected[0],e)}handleDateSelect(e){return e&&(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(gt(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0}))),Promise.resolve()}focusOnCurrentDate(){const e=gt(ni(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}const n=this.selectableDates.find(i=>!i.isDisabled);if(n){const i=this.querySelector(`button[data-date="${n.currentDateISO}"]`);i instanceof HTMLButtonElement&&(this.focusedDate=n.currentDateISO,i.focus())}}closeEvent(e){!this.contains(e.relatedTarget)&&!e.target.classList.contains("pkt-invisible")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};Xe([u({converter:_n.csvToArray})],Ke.prototype,"selected",2),Xe([u({type:Boolean})],Ke.prototype,"multiple",2),Xe([u({type:Number,attribute:"max-multiple"})],Ke.prototype,"maxMultiple",2),Xe([u({type:Boolean})],Ke.prototype,"range",2),Xe([u({type:String})],Ke.prototype,"earliest",2),Xe([u({type:String})],Ke.prototype,"latest",2),Xe([u({converter:_n.stringsToDate})],Ke.prototype,"excludedates",2),Xe([u({converter:_n.csvToArray})],Ke.prototype,"excludeweekdays",2),Xe([u({type:Boolean})],Ke.prototype,"weeknumbers",2),Xe([u({type:Boolean})],Ke.prototype,"withcontrols",2),Xe([u({converter:_n.stringToDate})],Ke.prototype,"currentmonth",2),Xe([u({type:String})],Ke.prototype,"today",2),Xe([u({type:Array,attribute:"day-strings"})],Ke.prototype,"dayStrings",2),Xe([u({type:Array,attribute:"day-strings-long"})],Ke.prototype,"dayStringsLong",2),Xe([u({type:Array,attribute:"month-strings"})],Ke.prototype,"monthStrings",2),Xe([u({type:String,attribute:"week-string"})],Ke.prototype,"weekString",2),Xe([u({type:String,attribute:"prev-month-string"})],Ke.prototype,"prevMonthString",2),Xe([u({type:String,attribute:"next-month-string"})],Ke.prototype,"nextMonthString",2),Xe([u({type:Array})],Ke.prototype,"_selected",2),Xe([_e()],Ke.prototype,"inRange",2),Xe([u({type:Date})],Ke.prototype,"rangeHovered",2),Xe([u({type:Number})],Ke.prototype,"year",2),Xe([u({type:Number})],Ke.prototype,"month",2),Xe([u({type:Number})],Ke.prototype,"week",2),Xe([_e()],Ke.prototype,"currentmonthtouched",2),Xe([_e()],Ke.prototype,"focusedDate",2),Ke=Xe([Se("pkt-calendar")],Ke);const lh={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},ji={props:lh};var ch=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,rs=(s,e,t,n)=>{for(var i=n>1?void 0:n?uh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&ch(e,t,i),i};let Zt=class extends xt{constructor(){super(),this.closeTag=ji.props.closeTag.default,this.size=ji.props.size.default,this.skin=ji.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=ji.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!1,composed:!0}))},this._isClosed=!1}firstUpdated(e){var t,n;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const i=(n=(t=this.querySelector("button span, .pkt-tag > span"))==null?void 0:t.textContent)==null?void 0:n.trim();i&&(this._ariaDescription=`Klikk for å fjerne ${i}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},t={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?y`
336
+ </td>`}renderWeekRow(e){return y`<tr class="pkt-cal-week-row" role="row">${e}</tr>`}renderCalendarBody(){const e=this.todayDate,t=qd(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let n=1;this.week=t.initialWeek;const i=[];for(let r=0;r<t.numRows;r++){const a=[];this.weeknumbers&&a.push(y`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let l=0;l<Gn;l++){const c=Wd(r,l,n,t);if(c==="current-month")a.push(this.renderDayView(n,e)),n++;else{const h=jd(c,l,n,t);a.push(this.renderEmptyDayCell(h)),c==="next-month"&&n++}}i.push(this.renderWeekRow(a))}return i}isExcluded(e){return xo(e,this.getDateConstraints())}isPrevMonthAllowed(){return Vd(this.year,this.month,this.earliest)}prevMonth(){const e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return Hd(this.year,this.month,this.latest)}nextMonth(){const e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=typeof e=="string"?parseInt(e):e,this.month=typeof t=="string"?parseInt(t):t,this.currentmonth=Kn(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected=="string"?this.selected.split(","):this.selected}addToSelected(e){this.selected=Mr(e,this.normalizeSelected()),this._selected=mn(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=Er(e,this.normalizeSelected()),this._selected=mn(this.selected)}toggleSelected(e){this.selected=zd(e,this.normalizeSelected(),this.maxMultiple),this._selected=mn(this.selected)}isRangeAllowed(e){return Co(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=Kd(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=mn(this.selected),this.selected.length===2?(this.convertSelected(),this.close()):this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(e){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(e)||this._selected[0]>=e){this.rangeHovered=null;return}this.rangeHovered=e,this.inRange=So(this._selected[0],e)}handleDateSelect(e){return e&&(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(pt(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0}))),Promise.resolve()}focusOnCurrentDate(){const e=pt(Kn(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}const n=this.selectableDates.find(i=>!i.isDisabled);if(n){const i=this.querySelector(`button[data-date="${n.currentDateISO}"]`);i instanceof HTMLButtonElement&&(this.focusedDate=n.currentDateISO,i.focus())}}closeEvent(e){!this.contains(e.relatedTarget)&&!e.target.classList.contains("pkt-invisible")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};Ze([u({converter:fn.csvToArray})],Ge.prototype,"selected"),Ze([u({type:Boolean})],Ge.prototype,"multiple"),Ze([u({type:Number,attribute:"max-multiple"})],Ge.prototype,"maxMultiple"),Ze([u({type:Boolean})],Ge.prototype,"range"),Ze([u({type:String})],Ge.prototype,"earliest"),Ze([u({type:String})],Ge.prototype,"latest"),Ze([u({converter:fn.stringsToDate})],Ge.prototype,"excludedates"),Ze([u({converter:fn.csvToArray})],Ge.prototype,"excludeweekdays"),Ze([u({type:Boolean})],Ge.prototype,"weeknumbers"),Ze([u({type:Boolean})],Ge.prototype,"withcontrols"),Ze([u({converter:fn.stringToDate})],Ge.prototype,"currentmonth"),Ze([u({type:String})],Ge.prototype,"today"),Ze([u({type:Array,attribute:"day-strings"})],Ge.prototype,"dayStrings"),Ze([u({type:Array,attribute:"day-strings-long"})],Ge.prototype,"dayStringsLong"),Ze([u({type:Array,attribute:"month-strings"})],Ge.prototype,"monthStrings"),Ze([u({type:String,attribute:"week-string"})],Ge.prototype,"weekString"),Ze([u({type:String,attribute:"prev-month-string"})],Ge.prototype,"prevMonthString"),Ze([u({type:String,attribute:"next-month-string"})],Ge.prototype,"nextMonthString"),Ze([u({type:Array})],Ge.prototype,"_selected"),Ze([_e()],Ge.prototype,"inRange"),Ze([u({type:Date})],Ge.prototype,"rangeHovered"),Ze([u({type:Number})],Ge.prototype,"year"),Ze([u({type:Number})],Ge.prototype,"month"),Ze([u({type:Number})],Ge.prototype,"week"),Ze([_e()],Ge.prototype,"currentmonthtouched"),Ze([_e()],Ge.prototype,"focusedDate");try{Se("pkt-calendar")(Ge)}catch{console.warn("Forsøker å definere <pkt-calendar>, men den er allerede definert")}const Jd={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},Bi={props:Jd};var Rd=Object.defineProperty,as=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Rd(e,t,i),i};let ts=class extends wt{constructor(){super(),this.closeTag=Bi.props.closeTag.default,this.size=Bi.props.size.default,this.skin=Bi.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=Bi.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!1,composed:!0}))},this._isClosed=!1}firstUpdated(e){var t,n;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const i=(n=(t=this.querySelector("button span, .pkt-tag > span"))==null?void 0:t.textContent)==null?void 0:n.trim();i&&(this._ariaDescription=`Klikk for å fjerne ${i}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},t={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?y`
337
337
  <button
338
338
  class=${Z(t)}
339
339
  type=${this.type}
@@ -347,7 +347,7 @@
347
347
  name=${this.iconName}
348
348
  aria-hidden="true"
349
349
  ></pkt-icon>`}
350
- <span>${tt(this)}</span>
350
+ <span>${Re(this)}</span>
351
351
  <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
352
352
  </button>
353
353
  `:y`
@@ -357,9 +357,9 @@
357
357
  name=${this.iconName}
358
358
  aria-hidden="true"
359
359
  ></pkt-icon>`}
360
- <span>${tt(this)}</span>
360
+ <span>${Re(this)}</span>
361
361
  </span>
362
- `}};rs([u({type:Boolean,reflect:!0})],Zt.prototype,"closeTag",2),rs([u({type:String,reflect:!0})],Zt.prototype,"size",2),rs([u({type:String,reflect:!0})],Zt.prototype,"skin",2),rs([u({type:String,reflect:!0})],Zt.prototype,"textStyle",2),rs([u({type:String,reflect:!0})],Zt.prototype,"iconName",2),rs([u({type:String})],Zt.prototype,"type",2),rs([u({type:String})],Zt.prototype,"ariaLabel",2),rs([u({type:Number,attribute:"button-tabindex"})],Zt.prototype,"buttonTabindex",2),rs([_e()],Zt.prototype,"_isClosed",2),rs([_e()],Zt.prototype,"_ariaDescription",2),Zt=rs([Se("pkt-tag")],Zt);var dh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,wn=(s,e,t,n)=>{for(var i=n>1?void 0:n?hh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&dh(e,t,i),i};let Ps=class extends Ii{constructor(){super(...arguments),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e==="level"&&n&&this.setLevel(Number(n)),e==="visuallyHidden"&&(this.visuallyHidden=n!==null&&n!=="false"),(e==="size"||e==="visuallyHidden"||e==="align"||e==="weight")&&this.updateHostClasses()}updated(e){super.updated(e),e.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(e.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has("size")||e.has("visuallyHidden")||e.has("align")||e.has("weight"))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute("aria-level",String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}get defaultWeightForLevel(){switch(this.level){case 1:return"regular";case 2:return"regular";case 3:return"medium";case 4:return"medium";case 5:return"medium";case 6:return"medium";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end","pkt-heading--light","pkt-heading--regular","pkt-heading--medium","pkt-heading--bold"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return y`<slot></slot>`}};wn([u({type:String,reflect:!0})],Ps.prototype,"size",2),wn([u({type:Number,reflect:!0})],Ps.prototype,"level",2),wn([u({type:String,reflect:!0})],Ps.prototype,"weight",2),wn([u({type:Boolean,reflect:!0})],Ps.prototype,"visuallyHidden",2),wn([u({type:String,reflect:!0})],Ps.prototype,"align",2),Ps=wn([Se("pkt-heading")],Ps);const ph={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},xn={props:ph};var fh=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,St=(s,e,t,n)=>{for(var i=n>1?void 0:n?mh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&fh(e,t,i),i};let $t=class extends xt{constructor(){super(...arguments),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=xn.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=xn.props.padding.default,this.skin=xn.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[]}connectedCallback(){super.connectedCallback()}render(){var e,t;const n={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},i=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),r=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?this.heading:"kort");return y`
362
+ `}};as([u({type:Boolean,reflect:!0})],ts.prototype,"closeTag"),as([u({type:String,reflect:!0})],ts.prototype,"size"),as([u({type:String,reflect:!0})],ts.prototype,"skin"),as([u({type:String,reflect:!0})],ts.prototype,"textStyle"),as([u({type:String,reflect:!0})],ts.prototype,"iconName"),as([u({type:String})],ts.prototype,"type"),as([u({type:String})],ts.prototype,"ariaLabel"),as([u({type:Number,attribute:"button-tabindex"})],ts.prototype,"buttonTabindex"),as([_e()],ts.prototype,"_isClosed"),as([_e()],ts.prototype,"_ariaDescription");try{Se("pkt-tag")(ts)}catch{console.warn("Forsøker å definere <pkt-tag>, men den er allerede definert")}var eh=Object.defineProperty,Xn=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&eh(e,t,i),i};let Ks=class extends Ni{constructor(){super(...arguments),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e==="level"&&n&&this.setLevel(Number(n)),e==="visuallyHidden"&&(this.visuallyHidden=n!==null&&n!=="false"),(e==="size"||e==="visuallyHidden"||e==="align"||e==="weight")&&this.updateHostClasses()}updated(e){super.updated(e),e.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(e.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(e.has("size")||e.has("visuallyHidden")||e.has("align")||e.has("weight"))&&this.updateHostClasses()}setLevel(e){e>=1&&e<=6?(this.level=e,this.setAttribute("aria-level",String(e))):console.warn(`Invalid heading level: ${e}. Must be between 1 and 6.`)}get defaultSizeForLevel(){switch(this.level){case 1:return"xlarge";case 2:return"large";case 3:return"medium";case 4:return"small";case 5:return"xsmall";case 6:return"xsmall";default:return"medium"}}get defaultWeightForLevel(){switch(this.level){case 1:return"regular";case 2:return"regular";case 3:return"medium";case 4:return"medium";case 5:return"medium";case 6:return"medium";default:return"medium"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end","pkt-heading--light","pkt-heading--regular","pkt-heading--medium","pkt-heading--bold"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.weight&&this.classList.add(`pkt-heading--fw-${this.weight}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return y`<slot></slot>`}};Xn([u({type:String,reflect:!0})],Ks.prototype,"size"),Xn([u({type:Number,reflect:!0})],Ks.prototype,"level"),Xn([u({type:String,reflect:!0})],Ks.prototype,"weight"),Xn([u({type:Boolean,reflect:!0})],Ks.prototype,"visuallyHidden"),Xn([u({type:String,reflect:!0})],Ks.prototype,"align");try{Se("pkt-heading")(Ks)}catch{console.warn("Forsøker å definere <pkt-heading>, men den er allerede definert")}const th={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},gn={props:th};var sh=Object.defineProperty,Ct=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&sh(e,t,i),i};let xt=class extends wt{constructor(){super(...arguments),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=gn.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=gn.props.padding.default,this.skin=gn.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[]}connectedCallback(){super.connectedCallback()}render(){var e,t;const n={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},i=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),r=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?this.heading:"kort");return y`
363
363
  <article
364
364
  class=${Z(n)}
365
365
  aria-label=${B(this.clickCardLink?i:r)}
@@ -438,18 +438,18 @@
438
438
  `)}
439
439
  </div>
440
440
  `:x}
441
- `}renderSlot(){return y`<section class="pkt-card__content">${tt(this)}</section>`}renderMetadata(){return y`
441
+ `}renderSlot(){return y`<section class="pkt-card__content">${Re(this)}</section>`}renderMetadata(){return y`
442
442
  ${this.metaLead||this.metaTrail?y`
443
443
  <footer class="pkt-card__metadata">
444
444
  ${this.metaLead?y`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:x}
445
445
  ${this.metaTrail?y`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:x}
446
446
  </footer>
447
447
  `:x}
448
- `}};St([u({type:String})],$t.prototype,"ariaLabel",2),St([u({type:String})],$t.prototype,"metaLead",2),St([u({type:Boolean})],$t.prototype,"borderOnHover",2),St([u({type:String,reflect:!0})],$t.prototype,"clickCardLink",2),St([u({type:String})],$t.prototype,"metaTrail",2),St([u({type:String})],$t.prototype,"layout",2),St([u({type:String})],$t.prototype,"heading",2),St([u({type:Number})],$t.prototype,"headinglevel",2),St([u({type:Object})],$t.prototype,"image",2),St([u({type:String})],$t.prototype,"imageShape",2),St([u({type:Boolean})],$t.prototype,"openLinkInNewTab",2),St([u({type:String})],$t.prototype,"padding",2),St([u({type:String,converter:{fromAttribute:s=>{const e=xn.props.skin.type;return s&&e.includes(s)?s:(s&&!e.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${xn.props.skin.default}".`),xn.props.skin.default)},toAttribute:s=>s}})],$t.prototype,"skin",2),St([u({type:String})],$t.prototype,"subheading",2),St([u({type:String})],$t.prototype,"tagPosition",2),St([u({type:Array})],$t.prototype,"tags",2),$t=St([Se("pkt-card")],$t);/**
448
+ `}};Ct([u({type:String})],xt.prototype,"ariaLabel"),Ct([u({type:String})],xt.prototype,"metaLead"),Ct([u({type:Boolean})],xt.prototype,"borderOnHover"),Ct([u({type:String,reflect:!0})],xt.prototype,"clickCardLink"),Ct([u({type:String})],xt.prototype,"metaTrail"),Ct([u({type:String})],xt.prototype,"layout"),Ct([u({type:String})],xt.prototype,"heading"),Ct([u({type:Number})],xt.prototype,"headinglevel"),Ct([u({type:Object})],xt.prototype,"image"),Ct([u({type:String})],xt.prototype,"imageShape"),Ct([u({type:Boolean})],xt.prototype,"openLinkInNewTab"),Ct([u({type:String})],xt.prototype,"padding"),Ct([u({type:String,converter:{fromAttribute:s=>{const e=gn.props.skin.type;return s&&e.includes(s)?s:(s&&!e.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${gn.props.skin.default}".`),gn.props.skin.default)},toAttribute:s=>s}})],xt.prototype,"skin"),Ct([u({type:String})],xt.prototype,"subheading"),Ct([u({type:String})],xt.prototype,"tagPosition"),Ct([u({type:Array})],xt.prototype,"tags");try{Se("pkt-card")(xt)}catch{console.warn("Forsøker å definere <pkt-card>, men den er allerede definert")}/**
449
449
  * @license
450
450
  * Copyright 2017 Google LLC
451
451
  * SPDX-License-Identifier: BSD-3-Clause
452
- */const Mo=(s,e,t)=>{const n=new Map;for(let i=e;i<=t;i++)n.set(s[i],i);return n},Ir=Ns(class extends vn{constructor(s){if(super(s),s.type!==Xt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);const i=[],r=[];let a=0;for(const l of s)i[a]=n?n(l,a):a,r[a]=t(l,a),a++;return{values:r,keys:i}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,n]){const i=eu(s),{values:r,keys:a}=this.dt(e,t,n);if(!Array.isArray(i))return this.ut=a,r;const l=this.ut??(this.ut=[]),c=[];let h,g,m=0,f=i.length-1,v=0,b=r.length-1;for(;m<=f&&v<=b;)if(i[m]===null)m++;else if(i[f]===null)f--;else if(l[m]===a[v])c[v]=Ks(i[m],r[v]),m++,v++;else if(l[f]===a[b])c[b]=Ks(i[f],r[b]),f--,b--;else if(l[m]===a[b])c[b]=Ks(i[m],r[b]),Wn(s,c[b+1],i[m]),m++,b--;else if(l[f]===a[v])c[v]=Ks(i[f],r[v]),Wn(s,i[m],i[f]),f--,v++;else if(h===void 0&&(h=Mo(a,v,b),g=Mo(l,m,f)),h.has(l[m]))if(h.has(l[f])){const w=g.get(a[v]),C=w!==void 0?i[w]:null;if(C===null){const S=Wn(s,i[m]);Ks(S,r[v]),c[v]=S}else c[v]=Ks(C,r[v]),Wn(s,i[m],C),i[w]=null;v++}else kr(i[f]),f--;else kr(i[m]),m++;for(;v<=b;){const w=Wn(s,c[b+1]);Ks(w,r[v]),c[v++]=w}for(;m<=f;){const w=i[m++];w!==null&&kr(w)}return this.ut=a,za(s,c),yt}}),Oo=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),gh=s=>new Promise(e=>setTimeout(e,s)),As=()=>{const s=Oo(),e=Oo();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)},us=(s,e)=>e&&(s.find(t=>t.value===e)||s.find(t=>t.label===e))||null,Eo=(s,e)=>{if(!e)return-1;const t=s.findIndex(n=>n.value===e);return t>=0?t:s.findIndex(n=>n.label===e)},bh=(s,e)=>{if(!e)return[...s];const t=e.toLowerCase();return s.filter(n=>(n.fulltext||n.value+(n.label||"")+(n.prefix||"")).toLowerCase().includes(t))},Po=s=>s.value+(s.label||"")+(s.prefix||""),Wi=(s,e)=>e!==null&&s>=e,vh=(s,e)=>{if(!e)return{filtered:[...s],suggestion:null};const t=e.toLowerCase(),n=s.filter(r=>{var a;return(a=r.fulltext)==null?void 0:a.toLowerCase().includes(t)}),i=n.find(r=>{var a;return!r.selected&&((a=r.label)==null?void 0:a.toLowerCase().startsWith(t))})||null;return{filtered:n,suggestion:i}},kh=(s,e,t,n)=>{if(!s.trim())return{addValueText:null,userInfoMessage:""};const i=s.trim().toLowerCase(),r=e.find(c=>c.toLowerCase()===i),a=t.filter(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase().includes(i))||c.value.toLowerCase().includes(i)}),l=a.find(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase())===i||c.value.toLowerCase()===i});return(a.length===0||!l)&&n?{addValueText:s,userInfoMessage:""}:a.length===0&&!n?{addValueText:null,userInfoMessage:"Ingen treff i søket"}:r?{addValueText:null,userInfoMessage:"Verdien er allerede valgt"}:{addValueText:null,userInfoMessage:""}},yh=s=>/^[\p{L} ]$/u.test(s),_h=(s=500)=>{let e="",t;return{append:n=>(e+=n.toLowerCase(),t!==void 0&&clearTimeout(t),t=setTimeout(()=>{e=""},s),e),reset:()=>{e="",t!==void 0&&(clearTimeout(t),t=void 0)},getBuffer:()=>e}},$h=(s,e)=>{const t=e.toLowerCase();return s.findIndex(n=>{var i;return(i=n.textContent)==null?void 0:i.trim().toLowerCase().startsWith(t)})},ks=s=>{s.scrollIntoView({block:"nearest"}),window.setTimeout(()=>s.focus(),0)},ai=s=>Array.from(s.querySelectorAll('[role="option"]:not([data-disabled])')||[]),wh=s=>{const e=s.nextElementSibling;e&&ks(e)},xh=(s,e,t)=>{const n=s.previousElementSibling;if(s.dataset.index==="0"&&t){const i=e.querySelector('[role="searchbox"]');i&&ks(i)}else n&&ks(n)},Lr=s=>{const e=ai(s);e[0]&&ks(e[0])},Ao=s=>{const e=ai(s),t=e[e.length-1];t&&ks(t)},Sh=(s,e)=>{if(e.disabled)return;const t=ai(s);if(e.allowUserInput&&e.customUserInput){const i=s.querySelector('[data-type="new-option"]');if(i){ks(i);return}}const n=t.find(i=>i.dataset.selected==="true");if(n){ks(n);return}if(e.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const i=s.querySelector('[role="searchbox"]');if(i){window.setTimeout(()=>i.focus(),0);return}}t[0]&&ks(t[0])};var Ch=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,Nt=(s,e,t,n)=>{for(var i=n>1?void 0:n?Th(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Ch(e,t,i),i};let Ct=class extends Gt{constructor(){super(...arguments),this.id=As(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this.typeahead=_h(),this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),this.includeSearch&&!this.searchValue&&(this.searchValue=""),this.options.length>0&&this.filterOptions(),this.setAttribute("tabindex","-1"),this.addEventListener("focus",this.focusFirstOrSelectedOption)}disconnectedCallback(){super.disconnectedCallback(),this.typeahead.reset()}updated(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,n){(e==="options"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,n)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}render(){return y`
452
+ */const To=(s,e,t)=>{const n=new Map;for(let i=e;i<=t;i++)n.set(s[i],i);return n},Or=Ts(class extends un{constructor(s){if(super(s),s.type!==Yt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);const i=[],r=[];let a=0;for(const l of s)i[a]=n?n(l,a):a,r[a]=t(l,a),a++;return{values:r,keys:i}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,n]){const i=Zc(s),{values:r,keys:a}=this.dt(e,t,n);if(!Array.isArray(i))return this.ut=a,r;const l=this.ut??(this.ut=[]),c=[];let h,g,m=0,f=i.length-1,k=0,b=r.length-1;for(;m<=f&&k<=b;)if(i[m]===null)m++;else if(i[f]===null)f--;else if(l[m]===a[k])c[k]=Hs(i[m],r[k]),m++,k++;else if(l[f]===a[b])c[b]=Hs(i[f],r[b]),f--,b--;else if(l[m]===a[b])c[b]=Hs(i[m],r[b]),Pn(s,c[b+1],i[m]),m++,b--;else if(l[f]===a[k])c[k]=Hs(i[f],r[k]),Pn(s,i[m],i[f]),f--,k++;else if(h===void 0&&(h=To(a,k,b),g=To(l,m,f)),h.has(l[m]))if(h.has(l[f])){const $=g.get(a[k]),C=$!==void 0?i[$]:null;if(C===null){const S=Pn(s,i[m]);Hs(S,r[k]),c[k]=S}else c[k]=Hs(C,r[k]),Pn(s,i[m],C),i[$]=null;k++}else gr(i[f]),f--;else gr(i[m]),m++;for(;k<=b;){const $=Pn(s,c[b+1]);Hs($,r[k]),c[k++]=$}for(;m<=f;){const $=i[m++];$!==null&&gr($)}return this.ut=a,qa(s,c),bt}}),No=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),nh=s=>new Promise(e=>setTimeout(e,s)),Ms=()=>{const s=No(),e=No();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)},os=(s,e)=>e&&(s.find(t=>t.value===e)||s.find(t=>t.label===e))||null,Do=(s,e)=>{if(!e)return-1;const t=s.findIndex(n=>n.value===e);return t>=0?t:s.findIndex(n=>n.label===e)},ih=(s,e)=>{if(!e)return[...s];const t=e.toLowerCase();return s.filter(n=>(n.fulltext||n.value+(n.label||"")+(n.prefix||"")).toLowerCase().includes(t))},Mo=s=>s.value+(s.label||"")+(s.prefix||""),Vi=(s,e)=>e!==null&&s>=e,rh=(s,e)=>{if(!e)return{filtered:[...s],suggestion:null};const t=e.toLowerCase(),n=s.filter(r=>{var a;return(a=r.fulltext)==null?void 0:a.toLowerCase().includes(t)}),i=n.find(r=>{var a;return!r.selected&&((a=r.label)==null?void 0:a.toLowerCase().startsWith(t))})||null;return{filtered:n,suggestion:i}},ah=(s,e,t,n)=>{if(!s.trim())return{addValueText:null,userInfoMessage:""};const i=s.trim().toLowerCase(),r=e.find(c=>c.toLowerCase()===i),a=t.filter(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase().includes(i))||c.value.toLowerCase().includes(i)}),l=a.find(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase())===i||c.value.toLowerCase()===i});return(a.length===0||!l)&&n?{addValueText:s,userInfoMessage:""}:a.length===0&&!n?{addValueText:null,userInfoMessage:"Ingen treff i søket"}:r?{addValueText:null,userInfoMessage:"Verdien er allerede valgt"}:{addValueText:null,userInfoMessage:""}},oh=s=>/^[\p{L} ]$/u.test(s),lh=(s=500)=>{let e="",t;return{append:n=>(e+=n.toLowerCase(),t!==void 0&&clearTimeout(t),t=setTimeout(()=>{e=""},s),e),reset:()=>{e="",t!==void 0&&(clearTimeout(t),t=void 0)},getBuffer:()=>e}},ch=(s,e)=>{const t=e.toLowerCase();return s.findIndex(n=>{var i;return(i=n.textContent)==null?void 0:i.trim().toLowerCase().startsWith(t)})},gs=s=>{s.scrollIntoView({block:"nearest"}),window.setTimeout(()=>s.focus(),0)},Qn=s=>Array.from(s.querySelectorAll('[role="option"]:not([data-disabled])')||[]),uh=s=>{const e=s.nextElementSibling;e&&gs(e)},dh=(s,e,t)=>{const n=s.previousElementSibling;if(s.dataset.index==="0"&&t){const i=e.querySelector('[role="searchbox"]');i&&gs(i)}else n&&gs(n)},Ar=s=>{const e=Qn(s);e[0]&&gs(e[0])},Eo=s=>{const e=Qn(s),t=e[e.length-1];t&&gs(t)},hh=(s,e)=>{if(e.disabled)return;const t=Qn(s);if(e.allowUserInput&&e.customUserInput){const i=s.querySelector('[data-type="new-option"]');if(i){gs(i);return}}const n=t.find(i=>i.dataset.selected==="true");if(n){gs(n);return}if(e.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const i=s.querySelector('[role="searchbox"]');if(i){window.setTimeout(()=>i.focus(),0);return}}t[0]&&gs(t[0])};var ph=Object.defineProperty,Et=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&ph(e,t,i),i};let Tt=class extends Kt{constructor(){super(...arguments),this.id=Ms(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this.typeahead=lh(),this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),this.includeSearch&&!this.searchValue&&(this.searchValue=""),this.options.length>0&&this.filterOptions(),this.setAttribute("tabindex","-1"),this.addEventListener("focus",this.focusFirstOrSelectedOption)}disconnectedCallback(){super.disconnectedCallback(),this.typeahead.reset()}updated(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,n){(e==="options"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,n)}get _hasOptions(){return this._filteredOptions.length>0||this.options.length>0}render(){return y`
453
453
  <div
454
454
  class=${Z({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
455
455
  role=${B(this._hasOptions?"listbox":void 0)}
@@ -485,7 +485,7 @@
485
485
  ></pkt-icon>
486
486
  Tom liste
487
487
  </div>`}renderList(){return y`
488
- ${Ir(this._filteredOptions,e=>e.value,(e,t)=>y`
488
+ ${Or(this._filteredOptions,e=>e.value,(e,t)=>y`
489
489
  <li
490
490
  @click=${()=>{this.toggleOption(e)}}
491
491
  aria-selected=${e.selected?"true":"false"}
@@ -554,7 +554,7 @@
554
554
  role="searchbox"
555
555
  />
556
556
  </div>
557
- `:x}handleSearchInput(e){this.searchValue=e.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(e){switch(e.key){case"Enter":e.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),e.preventDefault();break;case"ArrowDown":this.focusFirstOrSelectedOption();break;case"Tab":this.tabClose();break}}handleOptionKeydown(e){const t=e.currentTarget,n=t.dataset.value,i=t.dataset.type,r=t.dataset.selected==="true";if(!(!ai(this).length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&i!=="new-option"&&i!=="searchbox"))switch(e.key){case" ":case"Enter":this.toggleOption(t),e.preventDefault();break;case"Backspace":n&&(r?this.toggleOption(t):this.closeOptions()),e.preventDefault();break;case"Escape":this.closeOptions(),e.preventDefault();break;case"Tab":this.tabClose();break;case"ArrowDown":e.altKey?Ao(this):i==="searchbox"||i==="new-option"?Lr(this):wh(t),e.preventDefault();break;case"ArrowUp":if(e.altKey)Lr(this);else if(t.dataset.index==="0"&&this.includeSearch){const a=this.querySelector('[role="searchbox"]');a&&a.focus()}else if(t.dataset.index==="0"&&this.customUserInput){const a=this.querySelector('[data-type="new-option"]');a&&a.focus()}else xh(t,this,this.includeSearch);e.preventDefault();break;case"Home":Lr(this),e.preventDefault();break;case"End":Ao(this),e.preventDefault();break;default:(e.metaKey||e.ctrlKey)&&e.key==="a"&&(this.selectAll(),e.preventDefault()),yh(e.key)&&(this.handleTypeAhead(e.key),e.preventDefault());break}}focusFirstOrSelectedOption(){Sh(this,{disabled:this.disabled,allowUserInput:this.allowUserInput,customUserInput:this.customUserInput,includeSearch:this.includeSearch})}toggleOption(e){const t=e instanceof HTMLElement?e.dataset.disabled:e.disabled;if(this.disabled||t)return;const n=e instanceof HTMLElement?e.dataset.value:e.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:n,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}tabClose(){this.dispatchEvent(new CustomEvent("tab-close",{bubbles:!1}))}filterOptions(){this._filteredOptions=bh(this.options,this.searchValue)}handleTypeAhead(e){const t=this.typeahead.append(e),n=ai(this),i=$h(n,t);i>=0&&ks(n[i])}};Nt([u({type:String})],Ct.prototype,"id",2),Nt([u({type:String})],Ct.prototype,"label",2),Nt([u({type:Array})],Ct.prototype,"options",2),Nt([u({type:Boolean,reflect:!0,attribute:"is-open"})],Ct.prototype,"isOpen",2),Nt([u({type:Boolean})],Ct.prototype,"disabled",2),Nt([u({type:Boolean,attribute:"include-search"})],Ct.prototype,"includeSearch",2),Nt([u({type:Boolean,attribute:"is-multi-select"})],Ct.prototype,"isMultiSelect",2),Nt([u({type:Boolean,attribute:"allow-user-input"})],Ct.prototype,"allowUserInput",2),Nt([u({type:Boolean,attribute:"max-is-reached"})],Ct.prototype,"maxIsReached",2),Nt([u({type:String,attribute:"custom-user-input"})],Ct.prototype,"customUserInput",2),Nt([u({type:String,attribute:"search-placeholder"})],Ct.prototype,"searchPlaceholder",2),Nt([u({type:String,attribute:"search-value"})],Ct.prototype,"searchValue",2),Nt([u({type:Number,attribute:"max-length"})],Ct.prototype,"maxLength",2),Nt([u({type:String,attribute:"user-message"})],Ct.prototype,"userMessage",2),Nt([_e()],Ct.prototype,"_filteredOptions",2),Ct=Nt([Se("pkt-listbox")],Ct);const It={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Dh={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},qt={props:Dh};var Nh={},Io;function Mh(){return Io||(Io=1,(function(){(function(s){const e=new WeakMap,t=new WeakMap,n=new WeakMap,i=new WeakMap,r=new WeakMap,a=new WeakMap,l=new WeakMap,c=new WeakMap,h=new WeakMap,g=new WeakMap,m=new WeakMap,f=new WeakMap,v=new WeakMap,b=new WeakMap,w=new WeakMap,C={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"},S=(k,p)=>{for(let $ in C){p[$]=null;let D=null;const Y=C[$];Object.defineProperty(p,$,{get(){return D},set(K){D=K,k.isConnected?M(k,Y,K):g.set(k,p)}})}};function T(k){const p=i.get(k),{form:$}=p;Qe(k,$,p),ne(k,p.labels)}const F=(k,p=!1)=>{const $=document.createTreeWalker(k,NodeFilter.SHOW_ELEMENT,{acceptNode(K){return i.has(K)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let D=$.nextNode();const Y=!p||k.disabled;for(;D;)D.formDisabledCallback&&Y&&G(D,k.disabled),D=$.nextNode()},E={attributes:!0,attributeFilter:["disabled","name"]},W=ae()?new MutationObserver(k=>{for(const p of k){const $=p.target;if(p.attributeName==="disabled"&&($.constructor.formAssociated?G($,$.hasAttribute("disabled")):$.localName==="fieldset"&&F($)),p.attributeName==="name"&&$.constructor.formAssociated){const D=i.get($),Y=h.get($);D.setFormValue(Y)}}}):{};function U(k){k.forEach(p=>{const{addedNodes:$,removedNodes:D}=p,Y=Array.from($),K=Array.from(D);Y.forEach(ye=>{var ot;if(i.has(ye)&&ye.constructor.formAssociated&&T(ye),g.has(ye)){const it=g.get(ye);Object.keys(C).filter(Ge=>it[Ge]!==null).forEach(Ge=>{M(ye,C[Ge],it[Ge])}),g.delete(ye)}if(w.has(ye)){const it=w.get(ye);M(ye,"internals-valid",it.validity.valid.toString()),M(ye,"internals-invalid",(!it.validity.valid).toString()),M(ye,"aria-invalid",(!it.validity.valid).toString()),w.delete(ye)}if(ye.localName==="form"){const it=c.get(ye),Ge=document.createTreeWalker(ye,NodeFilter.SHOW_ELEMENT,{acceptNode(Kt){return i.has(Kt)&&Kt.constructor.formAssociated&&!(it&&it.has(Kt))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let zt=Ge.nextNode();for(;zt;)T(zt),zt=Ge.nextNode()}ye.localName==="fieldset"&&((ot=W.observe)===null||ot===void 0||ot.call(W,ye,E),F(ye,!0))}),K.forEach(ye=>{const ot=i.get(ye);ot&&n.get(ot)&&V(ot),l.has(ye)&&l.get(ye).disconnect()})})}function Q(k){k.forEach(p=>{const{removedNodes:$}=p;$.forEach(D=>{const Y=v.get(p.target);i.has(D)&&Ve(D),Y.disconnect()})})}const $e=k=>{var p,$;const D=new MutationObserver(Q);!((p=window==null?void 0:window.ShadyDOM)===null||p===void 0)&&p.inUse&&k.mode&&k.host&&(k=k.host),($=D.observe)===null||$===void 0||$.call(D,k,{childList:!0}),v.set(k,D)};ae()&&new MutationObserver(U);const z={childList:!0,subtree:!0},M=(k,p,$)=>{k.getAttribute(p)!==$&&k.setAttribute(p,$)},G=(k,p)=>{k.toggleAttribute("internals-disabled",p),p?M(k,"aria-disabled","true"):k.removeAttribute("aria-disabled"),k.formDisabledCallback&&k.formDisabledCallback.apply(k,[p])},V=k=>{n.get(k).forEach(p=>{p.remove()}),n.set(k,[])},ee=(k,p)=>{const $=document.createElement("input");return $.type="hidden",$.name=k.getAttribute("name"),k.after($),n.get(p).push($),$},le=(k,p)=>{var $;n.set(p,[]),($=W.observe)===null||$===void 0||$.call(W,k,E)},ne=(k,p)=>{if(p.length){Array.from(p).forEach(D=>D.addEventListener("click",k.click.bind(k)));let $=p[0].id;p[0].id||($=`${p[0].htmlFor}_Label`,p[0].id=$),M(k,"aria-labelledby",$)}},me=k=>{const p=Array.from(k.elements).filter(K=>!K.tagName.includes("-")&&K.validity).map(K=>K.validity.valid),$=c.get(k)||[],D=Array.from($).filter(K=>K.isConnected).map(K=>i.get(K).validity.valid),Y=[...p,...D].includes(!1);k.toggleAttribute("internals-invalid",Y),k.toggleAttribute("internals-valid",!Y)},ke=k=>{me(J(k.target))},fe=k=>{me(J(k.target))},ce=k=>{const p=["button[type=submit]","input[type=submit]","button:not([type])"].map($=>`${$}:not([disabled])`).map($=>`${$}:not([form])${k.id?`,${$}[form='${k.id}']`:""}`).join(",");k.addEventListener("click",$=>{if($.target.closest(p)){const D=c.get(k);if(k.noValidate)return;D.size&&Array.from(D).reverse().map(Y=>i.get(Y).reportValidity()).includes(!1)&&$.preventDefault()}})},de=k=>{const p=c.get(k.target);p&&p.size&&p.forEach($=>{$.constructor.formAssociated&&$.formResetCallback&&$.formResetCallback.apply($)})},Qe=(k,p,$)=>{if(p){const D=c.get(p);if(D)D.add(k);else{const Y=new Set;Y.add(k),c.set(p,Y),ce(p),p.addEventListener("reset",de),p.addEventListener("input",ke),p.addEventListener("change",fe)}a.set(p,{ref:k,internals:$}),k.constructor.formAssociated&&k.formAssociatedCallback&&setTimeout(()=>{k.formAssociatedCallback.apply(k,[p])},0),me(p)}},J=k=>{let p=k.parentNode;return p&&p.tagName!=="FORM"&&(p=J(p)),p},P=(k,p,$=DOMException)=>{if(!k.constructor.formAssociated)throw new $(p)},Le=(k,p,$)=>{const D=c.get(k);return D&&D.size&&D.forEach(Y=>{i.get(Y)[$]()||(p=!1)}),p},Ve=k=>{if(k.constructor.formAssociated){const p=i.get(k),{labels:$,form:D}=p;ne(k,$),Qe(k,D,p)}};function ae(){return typeof MutationObserver<"u"}class Ye{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 xe=k=>(k.badInput=!1,k.customError=!1,k.patternMismatch=!1,k.rangeOverflow=!1,k.rangeUnderflow=!1,k.stepMismatch=!1,k.tooLong=!1,k.tooShort=!1,k.typeMismatch=!1,k.valid=!0,k.valueMissing=!1,k),ve=(k,p,$)=>(k.valid=oe(p),Object.keys(p).forEach(D=>k[D]=p[D]),$&&me($),k),oe=k=>{let p=!0;for(let $ in k)$!=="valid"&&k[$]!==!1&&(p=!1);return p},ue=new WeakMap;function Me(k,p){k.toggleAttribute(p,!0),k.part&&k.part.add(p)}class Ae extends Set{static get isPolyfilled(){return!0}constructor(p){if(super(),!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");ue.set(this,p)}add(p){if(!/^--/.test(p)||typeof p!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${p} must start with '--'.`);const $=super.add(p),D=ue.get(this),Y=`state${p}`;return D.isConnected?Me(D,Y):setTimeout(()=>{Me(D,Y)}),$}clear(){for(let[p]of this.entries())this.delete(p);super.clear()}delete(p){const $=super.delete(p),D=ue.get(this);return D.isConnected?(D.toggleAttribute(`state${p}`,!1),D.part&&D.part.remove(`state${p}`)):setTimeout(()=>{D.toggleAttribute(`state${p}`,!1),D.part&&D.part.remove(`state${p}`)}),$}}function Te(k,p,$,D){if(typeof p=="function"?k!==p||!D:!p.has(k))throw new TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?D:$==="a"?D.call(k):D?D.value:p.get(k)}function I(k,p,$,D,Y){if(typeof p=="function"?k!==p||!0:!p.has(k))throw new TypeError("Cannot write private member to an object whose class did not declare it");return p.set(k,$),$}var We;class Ie{constructor(p){We.set(this,void 0),I(this,We,p);for(let $=0;$<p.length;$++){let D=p[$];this[$]=D,D.hasAttribute("name")&&(this[D.getAttribute("name")]=D)}Object.freeze(this)}get length(){return Te(this,We,"f").length}[(We=new WeakMap,Symbol.iterator)](){return Te(this,We,"f")[Symbol.iterator]()}item(p){return this[p]==null?null:this[p]}namedItem(p){return this[p]==null?null:this[p]}}function j(){const k=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=$;const p=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=D;function $(...K){let ye=k.apply(this,K);return Le(this,ye,"checkValidity")}function D(...K){let ye=p.apply(this,K);return Le(this,ye,"reportValidity")}const{get:Y}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...K){const ye=Y.call(this,...K),ot=Array.from(c.get(this)||[]);if(ot.length===0)return ye;const it=Array.from(ye).concat(ot).sort((Ge,zt)=>Ge.compareDocumentPosition?Ge.compareDocumentPosition(zt)&2?1:-1:0);return new Ie(it)}})}class q{static get isPolyfilled(){return!0}constructor(p){if(!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const $=p.getRootNode(),D=new Ye;this.states=new Ae(p),e.set(this,p),t.set(this,D),i.set(p,this),S(p,this),le(p,this),Object.seal(this),$ instanceof DocumentFragment&&$e($)}checkValidity(){const p=e.get(this);if(P(p,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const $=t.get(this);if(!$.valid){const D=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});p.dispatchEvent(D)}return $.valid}get form(){const p=e.get(this);P(p,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let $;return p.constructor.formAssociated===!0&&($=J(p)),$}get labels(){const p=e.get(this);P(p,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const $=p.getAttribute("id"),D=p.getRootNode();return D&&$?D.querySelectorAll(`[for="${$}"]`):[]}reportValidity(){const p=e.get(this);if(P(p,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const $=this.checkValidity(),D=f.get(this);if(D&&!p.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!$&&D&&(p.focus(),D.focus()),$}setFormValue(p){const $=e.get(this);if(P($,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),V(this),p!=null&&!(p instanceof FormData)){if($.getAttribute("name")){const D=ee($,this);D.value=p}}else p!=null&&p instanceof FormData&&Array.from(p).reverse().forEach(([D,Y])=>{if(typeof Y=="string"){const K=ee($,this);K.name=D,K.value=Y}});h.set($,p)}setValidity(p,$,D){const Y=e.get(this);if(P(Y,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!p)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");f.set(this,D);const K=t.get(this),ye={};for(const Ge in p)ye[Ge]=p[Ge];Object.keys(ye).length===0&&xe(K);const ot=Object.assign(Object.assign({},K),ye);delete ot.valid;const{valid:it}=ve(K,ot,this.form);if(!it&&!$)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.");r.set(this,it?"":$),Y.isConnected?(Y.toggleAttribute("internals-invalid",!it),Y.toggleAttribute("internals-valid",it),M(Y,"aria-invalid",`${!it}`)):w.set(Y,this)}get shadowRoot(){const p=e.get(this);return m.get(p)||null}get validationMessage(){const p=e.get(this);return P(p,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),r.get(this)}get validity(){const p=e.get(this);return P(p,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),t.get(this)}get willValidate(){const p=e.get(this);return P(p,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(p.disabled||p.hasAttribute("disabled")||p.hasAttribute("readonly"))}}function se(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class k extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const p=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(p,k);const $=new k;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(D=>D in $.internals)}let ge=!1,R=!1;function ze(k){R||(R=!0,window.CustomStateSet=Ae,k&&(HTMLElement.prototype.attachInternals=function(...p){const $=k.call(this,p);return $.states=new Ae(this),$}))}function He(k=!0){if(!ge){if(ge=!0,typeof window<"u"&&(window.ElementInternals=q),typeof CustomElementRegistry<"u"){const p=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function($,D,Y){if(D.formAssociated){const K=D.prototype.connectedCallback;D.prototype.connectedCallback=function(){b.has(this)||(b.set(this,!0),this.hasAttribute("disabled")&&G(this,!0)),K!=null&&K.apply(this),Ve(this)}}p.call(this,$,D,Y)}}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(i.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new q(this)}),typeof Element<"u"){let p=function(...D){const Y=$.apply(this,D);if(m.set(this,Y),ae()){const K=new MutationObserver(U);window.ShadyDOM?K.observe(this,z):K.observe(Y,z),l.set(this,K)}return Y};const $=Element.prototype.attachShadow;Element.prototype.attachShadow=p}ae()&&typeof document<"u"&&new MutationObserver(U).observe(document.documentElement,z),typeof HTMLFormElement<"u"&&j(),(k||typeof window<"u"&&!window.CustomStateSet)&&ze()}}return customElements.polyfillWrapFlushCallback||(se()?typeof window<"u"&&!window.CustomStateSet&&ze(HTMLElement.prototype.attachInternals):He(!1)),s.forceCustomStateSetPolyfill=ze,s.forceElementInternalsPolyfill=He,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Nh}Mh();var Oh=Object.defineProperty,Ce=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Oh(e,t,i),i};const Lo="on",Fr="--checked",zi=",";let he=class extends xt{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=As(),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=qt.props.helptextDropdownButton.default,this.label=null,this.optionalText=dt.forms.labels.optional,this.requiredText=dt.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(e){var t,n,i,r,a,l,c,h,g,m,f;if(!e){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},dt.forms.messages.required,e):(t=e.validity)!=null&&t.typeMismatch||(n=e.validity)!=null&&n.badInput?this.internals.setValidity({typeMismatch:!0},dt.forms.messages.invalid,e):(i=e.validity)!=null&&i.patternMismatch?this.internals.setValidity({patternMismatch:!0},dt.forms.messages.invalidPattern,e):(r=e.validity)!=null&&r.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},dt.forms.messages.tooShort,e):(a=e.validity)!=null&&a.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},dt.forms.messages.tooLong,e):(l=e.validity)!=null&&l.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?dt.forms.messages.rangeUnderflowMin.replace("{min}",(c=this.min)==null?void 0:c.toString()):dt.forms.messages.rangeUnderflow,e):(h=e.validity)!=null&&h.stepMismatch?this.internals.setValidity({stepMismatch:!0},dt.forms.messages.invalid,e):(g=e.validity)!=null&&g.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?dt.forms.messages.rangeOverflowMax.replace("{max}",(m=this.max)==null?void 0:m.toString()):dt.forms.messages.rangeOverflow,e):(f=e.validity)!=null&&f.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){const t=new FormData;e.forEach(n=>{t.append(this.name,n)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(t=>{var n;if(t!==this&&t.getAttribute("name")===this.name&&t.getAttribute("value")!==this.value){const i=t;i.checked&&(i.checked=!1,i.internals&&(i.internals.setFormValue(null),(n=i.internals.states)==null||n.delete(Fr)))}})}valueChecked(e){if(!this.touched)return;const t=this.internals.form||this.closest("form"),n=t?new FormData(t):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof e=="string"?(this.checked=e==="true",this.internals.ariaChecked=String(e==="true")):typeof e=="boolean"&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){const i=(typeof this.value=="string"?this.value:"")||Lo;this.internals.setFormValue(i),n&&n.append(this.name,i),this.internals.states.add(Fr)}else this.internals.setFormValue(null),n&&n.delete(this.name),this.internals.states.delete(Fr);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){(t!==this.value||t!==this._value)&&(typeof e=="string"?((this.multiple||this.range)&&e.includes(zi)&&(e=e.split(zi)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(t==null?void 0:t.toString())&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){const e=this.multiple||this.range?[]:"";this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}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}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e=="string"&&e.includes(zi)?e.split(zi):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||"":e}validate(){var e,t;(e=this.inputRef)!=null&&e.value&&this.manageValidity(this.inputRef.value),(t=this.inputRefTo)!=null&&t.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(!this.touched){this.touched=!0,e&&this.setFormValue(e),this.validate();return}if(typeof e!="string"&&!Array.isArray(e))return;const t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){var e;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(e=this.inputRef)!=null&&e.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const t=this.defaultValue||(this.multiple||this.range?[]:"");this.value=t,this._value=Array.isArray(t)?t:[t],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(e){super.updated(e),e.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(e){if(super.firstUpdated(e),!this.form){const t=this.internals.form||this.closest("form");this.form=t}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="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const t=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(t);const n=t?(typeof this.value=="string"?this.value:"")||Lo:null;this.internals.setFormValue(n)}else this.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))}};Ce([u({type:Boolean,reflect:!0})],he.prototype,"checked"),Ce([u({type:Boolean})],he.prototype,"defaultChecked"),Ce([u({type:Boolean})],he.prototype,"multiple"),Ce([u({type:Boolean})],he.prototype,"range"),Ce([u({type:String,reflect:!0})],he.prototype,"type"),Ce([u()],he.prototype,"defaultValue"),Ce([u({type:Boolean,reflect:!0})],he.prototype,"disabled"),Ce([u({type:Boolean,reflect:!0})],he.prototype,"readonly"),Ce([u({type:Boolean,reflect:!0})],he.prototype,"required"),Ce([u({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],he.prototype,"max"),Ce([u({type:Number,reflect:!0})],he.prototype,"maxlength"),Ce([u({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],he.prototype,"min"),Ce([u({type:Number,reflect:!0})],he.prototype,"minlength"),Ce([u({type:Number,reflect:!0})],he.prototype,"step"),Ce([u({type:String})],he.prototype,"ariaDescribedBy"),Ce([u({type:String})],he.prototype,"ariaLabelledby"),Ce([u({type:String,reflect:!0})],he.prototype,"name"),Ce([u({type:String,reflect:!0})],he.prototype,"pattern"),Ce([u({type:String,reflect:!0})],he.prototype,"placeholder"),Ce([u({type:String,reflect:!0})],he.prototype,"id"),Ce([u({type:Boolean})],he.prototype,"counter"),Ce([u({type:Boolean})],he.prototype,"hasError"),Ce([u({type:Boolean})],he.prototype,"inline"),Ce([u({type:Boolean})],he.prototype,"hasFieldset"),Ce([u({type:Boolean})],he.prototype,"optionalTag"),Ce([u({type:Boolean})],he.prototype,"requiredTag"),Ce([u({type:Boolean})],he.prototype,"skipForwardTestid"),Ce([u({type:Boolean,reflect:!0,converter:It})],he.prototype,"useWrapper"),Ce([u({type:Boolean,reflect:!0})],he.prototype,"fullwidth"),Ce([u({type:Number})],he.prototype,"counterMaxLength"),Ce([u({type:String})],he.prototype,"errorMessage"),Ce([u({type:String})],he.prototype,"helptext"),Ce([u({type:String})],he.prototype,"helptextDropdown"),Ce([u({type:String,reflect:!1})],he.prototype,"helptextDropdownButton"),Ce([u({type:String})],he.prototype,"label"),Ce([u({type:String,reflect:!1})],he.prototype,"optionalText"),Ce([u({type:String,reflect:!1})],he.prototype,"requiredText"),Ce([u({type:String,reflect:!1})],he.prototype,"tagText"),Ce([u({type:String,attribute:"data-testid"})],he.prototype,"dataTestid");let Fo=class{constructor(e){this.nodes=[],this.options=[],this.generation=0,this.host=e,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(t=>this.handleMutations(t))}hostConnected(){Array.from(this.host.childNodes).forEach(e=>{(e.nodeName==="OPTION"||e.nodeName==="DATA")&&this.addNode(e)}),this.createOptions(),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(e){(e.nodeName==="OPTION"||e.nodeName==="DATA")&&(e.hasAttribute("hidden")&&!e.hasAttribute("data-skip")&&e.setAttribute("data-hidden","true"),!e.hasAttribute("hidden")&&e.hasAttribute("data-skip")&&e.hasAttribute("data-hidden")&&e.removeAttribute("data-hidden"),e.setAttribute("class","pkt-hide"),e.setAttribute("data-skip","true"),e.setAttribute("hidden","true"),this.nodes.push(e))}createOptions(){this.options=this.nodes.map(e=>({value:e.hasAttribute("value")?e.getAttribute("value")??"":e.textContent??"",label:e.textContent||e.getAttribute("value")||"",selected:e.hasAttribute("selected"),disabled:e.hasAttribute("disabled"),hidden:e.hasAttribute("data-hidden")})),this.generation++,this.host.requestUpdate()}handleMutations(e){let t=!1;e.forEach(n=>{n.type==="childList"&&(n.addedNodes.forEach(i=>{Kn(i)&&(this.addNode(i),t=!0)}),n.removedNodes.forEach(i=>{Kn(i)&&(this.nodes=this.nodes.filter(r=>r!==i),t=!0)})),n.type==="attributes"&&Kn(n.target)&&(this.addNode(n.target),t=!0)}),t&&this.createOptions()}};var Eh=Object.defineProperty,Ph=Object.getOwnPropertyDescriptor,Sn=(s,e,t,n)=>{for(var i=n>1?void 0:n?Ph(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Eh(e,t,i),i};let Is=class extends xt{constructor(){super(...arguments),this.forId=As(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=qt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){const e=()=>{const i=!this.isHelpTextOpen;this.isHelpTextOpen=i,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:i}}))},t=Z({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()}),n=()=>this.helptextDropdown?y`<div class="pkt-inputwrapper__helptext-expandable">
557
+ `:x}handleSearchInput(e){this.searchValue=e.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(e){switch(e.key){case"Enter":e.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),e.preventDefault();break;case"ArrowDown":this.focusFirstOrSelectedOption();break;case"Tab":this.tabClose();break}}handleOptionKeydown(e){const t=e.currentTarget,n=t.dataset.value,i=t.dataset.type,r=t.dataset.selected==="true";if(!(!Qn(this).length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&i!=="new-option"&&i!=="searchbox"))switch(e.key){case" ":case"Enter":this.toggleOption(t),e.preventDefault();break;case"Backspace":n&&(r?this.toggleOption(t):this.closeOptions()),e.preventDefault();break;case"Escape":this.closeOptions(),e.preventDefault();break;case"Tab":this.tabClose();break;case"ArrowDown":e.altKey?Eo(this):i==="searchbox"||i==="new-option"?Ar(this):uh(t),e.preventDefault();break;case"ArrowUp":if(e.altKey)Ar(this);else if(t.dataset.index==="0"&&this.includeSearch){const a=this.querySelector('[role="searchbox"]');a&&a.focus()}else if(t.dataset.index==="0"&&this.customUserInput){const a=this.querySelector('[data-type="new-option"]');a&&a.focus()}else dh(t,this,this.includeSearch);e.preventDefault();break;case"Home":Ar(this),e.preventDefault();break;case"End":Eo(this),e.preventDefault();break;default:(e.metaKey||e.ctrlKey)&&e.key==="a"&&(this.selectAll(),e.preventDefault()),oh(e.key)&&(this.handleTypeAhead(e.key),e.preventDefault());break}}focusFirstOrSelectedOption(){hh(this,{disabled:this.disabled,allowUserInput:this.allowUserInput,customUserInput:this.customUserInput,includeSearch:this.includeSearch})}toggleOption(e){const t=e instanceof HTMLElement?e.dataset.disabled:e.disabled;if(this.disabled||t)return;const n=e instanceof HTMLElement?e.dataset.value:e.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:n,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}tabClose(){this.dispatchEvent(new CustomEvent("tab-close",{bubbles:!1}))}filterOptions(){this._filteredOptions=ih(this.options,this.searchValue)}handleTypeAhead(e){const t=this.typeahead.append(e),n=Qn(this),i=ch(n,t);i>=0&&gs(n[i])}};Et([u({type:String})],Tt.prototype,"id"),Et([u({type:String})],Tt.prototype,"label"),Et([u({type:Array})],Tt.prototype,"options"),Et([u({type:Boolean,reflect:!0,attribute:"is-open"})],Tt.prototype,"isOpen"),Et([u({type:Boolean})],Tt.prototype,"disabled"),Et([u({type:Boolean,attribute:"include-search"})],Tt.prototype,"includeSearch"),Et([u({type:Boolean,attribute:"is-multi-select"})],Tt.prototype,"isMultiSelect"),Et([u({type:Boolean,attribute:"allow-user-input"})],Tt.prototype,"allowUserInput"),Et([u({type:Boolean,attribute:"max-is-reached"})],Tt.prototype,"maxIsReached"),Et([u({type:String,attribute:"custom-user-input"})],Tt.prototype,"customUserInput"),Et([u({type:String,attribute:"search-placeholder"})],Tt.prototype,"searchPlaceholder"),Et([u({type:String,attribute:"search-value"})],Tt.prototype,"searchValue"),Et([u({type:Number,attribute:"max-length"})],Tt.prototype,"maxLength"),Et([u({type:String,attribute:"user-message"})],Tt.prototype,"userMessage"),Et([_e()],Tt.prototype,"_filteredOptions");try{Se("pkt-listbox")(Tt)}catch{console.warn("Forsøker å definere <pkt-listbox>, men den er allerede definert")}const It={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},fh={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},Ut={props:fh};var mh={},Oo;function gh(){return Oo||(Oo=1,(function(){(function(s){const e=new WeakMap,t=new WeakMap,n=new WeakMap,i=new WeakMap,r=new WeakMap,a=new WeakMap,l=new WeakMap,c=new WeakMap,h=new WeakMap,g=new WeakMap,m=new WeakMap,f=new WeakMap,k=new WeakMap,b=new WeakMap,$=new WeakMap,C={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"},S=(v,p)=>{for(let w in C){p[w]=null;let N=null;const Y=C[w];Object.defineProperty(p,w,{get(){return N},set(K){N=K,v.isConnected?M(v,Y,K):g.set(v,p)}})}};function T(v){const p=i.get(v),{form:w}=p;Xe(v,w,p),ne(v,p.labels)}const F=(v,p=!1)=>{const w=document.createTreeWalker(v,NodeFilter.SHOW_ELEMENT,{acceptNode(K){return i.has(K)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let N=w.nextNode();const Y=!p||v.disabled;for(;N;)N.formDisabledCallback&&Y&&G(N,v.disabled),N=w.nextNode()},O={attributes:!0,attributeFilter:["disabled","name"]},j=ae()?new MutationObserver(v=>{for(const p of v){const w=p.target;if(p.attributeName==="disabled"&&(w.constructor.formAssociated?G(w,w.hasAttribute("disabled")):w.localName==="fieldset"&&F(w)),p.attributeName==="name"&&w.constructor.formAssociated){const N=i.get(w),Y=h.get(w);N.setFormValue(Y)}}}):{};function U(v){v.forEach(p=>{const{addedNodes:w,removedNodes:N}=p,Y=Array.from(w),K=Array.from(N);Y.forEach(ye=>{var ot;if(i.has(ye)&&ye.constructor.formAssociated&&T(ye),g.has(ye)){const it=g.get(ye);Object.keys(C).filter(Ye=>it[Ye]!==null).forEach(Ye=>{M(ye,C[Ye],it[Ye])}),g.delete(ye)}if($.has(ye)){const it=$.get(ye);M(ye,"internals-valid",it.validity.valid.toString()),M(ye,"internals-invalid",(!it.validity.valid).toString()),M(ye,"aria-invalid",(!it.validity.valid).toString()),$.delete(ye)}if(ye.localName==="form"){const it=c.get(ye),Ye=document.createTreeWalker(ye,NodeFilter.SHOW_ELEMENT,{acceptNode(jt){return i.has(jt)&&jt.constructor.formAssociated&&!(it&&it.has(jt))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let Wt=Ye.nextNode();for(;Wt;)T(Wt),Wt=Ye.nextNode()}ye.localName==="fieldset"&&((ot=j.observe)===null||ot===void 0||ot.call(j,ye,O),F(ye,!0))}),K.forEach(ye=>{const ot=i.get(ye);ot&&n.get(ot)&&V(ot),l.has(ye)&&l.get(ye).disconnect()})})}function Q(v){v.forEach(p=>{const{removedNodes:w}=p;w.forEach(N=>{const Y=k.get(p.target);i.has(N)&&Be(N),Y.disconnect()})})}const we=v=>{var p,w;const N=new MutationObserver(Q);!((p=window==null?void 0:window.ShadyDOM)===null||p===void 0)&&p.inUse&&v.mode&&v.host&&(v=v.host),(w=N.observe)===null||w===void 0||w.call(N,v,{childList:!0}),k.set(v,N)};ae()&&new MutationObserver(U);const z={childList:!0,subtree:!0},M=(v,p,w)=>{v.getAttribute(p)!==w&&v.setAttribute(p,w)},G=(v,p)=>{v.toggleAttribute("internals-disabled",p),p?M(v,"aria-disabled","true"):v.removeAttribute("aria-disabled"),v.formDisabledCallback&&v.formDisabledCallback.apply(v,[p])},V=v=>{n.get(v).forEach(p=>{p.remove()}),n.set(v,[])},ee=(v,p)=>{const w=document.createElement("input");return w.type="hidden",w.name=v.getAttribute("name"),v.after(w),n.get(p).push(w),w},le=(v,p)=>{var w;n.set(p,[]),(w=j.observe)===null||w===void 0||w.call(j,v,O)},ne=(v,p)=>{if(p.length){Array.from(p).forEach(N=>N.addEventListener("click",v.click.bind(v)));let w=p[0].id;p[0].id||(w=`${p[0].htmlFor}_Label`,p[0].id=w),M(v,"aria-labelledby",w)}},me=v=>{const p=Array.from(v.elements).filter(K=>!K.tagName.includes("-")&&K.validity).map(K=>K.validity.valid),w=c.get(v)||[],N=Array.from(w).filter(K=>K.isConnected).map(K=>i.get(K).validity.valid),Y=[...p,...N].includes(!1);v.toggleAttribute("internals-invalid",Y),v.toggleAttribute("internals-valid",!Y)},ve=v=>{me(J(v.target))},fe=v=>{me(J(v.target))},ce=v=>{const p=["button[type=submit]","input[type=submit]","button:not([type])"].map(w=>`${w}:not([disabled])`).map(w=>`${w}:not([form])${v.id?`,${w}[form='${v.id}']`:""}`).join(",");v.addEventListener("click",w=>{if(w.target.closest(p)){const N=c.get(v);if(v.noValidate)return;N.size&&Array.from(N).reverse().map(Y=>i.get(Y).reportValidity()).includes(!1)&&w.preventDefault()}})},de=v=>{const p=c.get(v.target);p&&p.size&&p.forEach(w=>{w.constructor.formAssociated&&w.formResetCallback&&w.formResetCallback.apply(w)})},Xe=(v,p,w)=>{if(p){const N=c.get(p);if(N)N.add(v);else{const Y=new Set;Y.add(v),c.set(p,Y),ce(p),p.addEventListener("reset",de),p.addEventListener("input",ve),p.addEventListener("change",fe)}a.set(p,{ref:v,internals:w}),v.constructor.formAssociated&&v.formAssociatedCallback&&setTimeout(()=>{v.formAssociatedCallback.apply(v,[p])},0),me(p)}},J=v=>{let p=v.parentNode;return p&&p.tagName!=="FORM"&&(p=J(p)),p},A=(v,p,w=DOMException)=>{if(!v.constructor.formAssociated)throw new w(p)},Le=(v,p,w)=>{const N=c.get(v);return N&&N.size&&N.forEach(Y=>{i.get(Y)[w]()||(p=!1)}),p},Be=v=>{if(v.constructor.formAssociated){const p=i.get(v),{labels:w,form:N}=p;ne(v,w),Xe(v,N,p)}};function ae(){return typeof MutationObserver<"u"}class Ke{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 xe=v=>(v.badInput=!1,v.customError=!1,v.patternMismatch=!1,v.rangeOverflow=!1,v.rangeUnderflow=!1,v.stepMismatch=!1,v.tooLong=!1,v.tooShort=!1,v.typeMismatch=!1,v.valid=!0,v.valueMissing=!1,v),ke=(v,p,w)=>(v.valid=oe(p),Object.keys(p).forEach(N=>v[N]=p[N]),w&&me(w),v),oe=v=>{let p=!0;for(let w in v)w!=="valid"&&v[w]!==!1&&(p=!1);return p},ue=new WeakMap;function Me(v,p){v.toggleAttribute(p,!0),v.part&&v.part.add(p)}class Ie extends Set{static get isPolyfilled(){return!0}constructor(p){if(super(),!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");ue.set(this,p)}add(p){if(!/^--/.test(p)||typeof p!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${p} must start with '--'.`);const w=super.add(p),N=ue.get(this),Y=`state${p}`;return N.isConnected?Me(N,Y):setTimeout(()=>{Me(N,Y)}),w}clear(){for(let[p]of this.entries())this.delete(p);super.clear()}delete(p){const w=super.delete(p),N=ue.get(this);return N.isConnected?(N.toggleAttribute(`state${p}`,!1),N.part&&N.part.remove(`state${p}`)):setTimeout(()=>{N.toggleAttribute(`state${p}`,!1),N.part&&N.part.remove(`state${p}`)}),w}}function Te(v,p,w,N){if(typeof p=="function"?v!==p||!N:!p.has(v))throw new TypeError("Cannot read private member from an object whose class did not declare it");return w==="m"?N:w==="a"?N.call(v):N?N.value:p.get(v)}function P(v,p,w,N,Y){if(typeof p=="function"?v!==p||!0:!p.has(v))throw new TypeError("Cannot write private member to an object whose class did not declare it");return p.set(v,w),w}var We;class Pe{constructor(p){We.set(this,void 0),P(this,We,p);for(let w=0;w<p.length;w++){let N=p[w];this[w]=N,N.hasAttribute("name")&&(this[N.getAttribute("name")]=N)}Object.freeze(this)}get length(){return Te(this,We,"f").length}[(We=new WeakMap,Symbol.iterator)](){return Te(this,We,"f")[Symbol.iterator]()}item(p){return this[p]==null?null:this[p]}namedItem(p){return this[p]==null?null:this[p]}}function W(){const v=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=w;const p=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=N;function w(...K){let ye=v.apply(this,K);return Le(this,ye,"checkValidity")}function N(...K){let ye=p.apply(this,K);return Le(this,ye,"reportValidity")}const{get:Y}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...K){const ye=Y.call(this,...K),ot=Array.from(c.get(this)||[]);if(ot.length===0)return ye;const it=Array.from(ye).concat(ot).sort((Ye,Wt)=>Ye.compareDocumentPosition?Ye.compareDocumentPosition(Wt)&2?1:-1:0);return new Pe(it)}})}class q{static get isPolyfilled(){return!0}constructor(p){if(!p||!p.tagName||p.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const w=p.getRootNode(),N=new Ke;this.states=new Ie(p),e.set(this,p),t.set(this,N),i.set(p,this),S(p,this),le(p,this),Object.seal(this),w instanceof DocumentFragment&&we(w)}checkValidity(){const p=e.get(this);if(A(p,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const w=t.get(this);if(!w.valid){const N=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});p.dispatchEvent(N)}return w.valid}get form(){const p=e.get(this);A(p,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let w;return p.constructor.formAssociated===!0&&(w=J(p)),w}get labels(){const p=e.get(this);A(p,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const w=p.getAttribute("id"),N=p.getRootNode();return N&&w?N.querySelectorAll(`[for="${w}"]`):[]}reportValidity(){const p=e.get(this);if(A(p,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const w=this.checkValidity(),N=f.get(this);if(N&&!p.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!w&&N&&(p.focus(),N.focus()),w}setFormValue(p){const w=e.get(this);if(A(w,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),V(this),p!=null&&!(p instanceof FormData)){if(w.getAttribute("name")){const N=ee(w,this);N.value=p}}else p!=null&&p instanceof FormData&&Array.from(p).reverse().forEach(([N,Y])=>{if(typeof Y=="string"){const K=ee(w,this);K.name=N,K.value=Y}});h.set(w,p)}setValidity(p,w,N){const Y=e.get(this);if(A(Y,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!p)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");f.set(this,N);const K=t.get(this),ye={};for(const Ye in p)ye[Ye]=p[Ye];Object.keys(ye).length===0&&xe(K);const ot=Object.assign(Object.assign({},K),ye);delete ot.valid;const{valid:it}=ke(K,ot,this.form);if(!it&&!w)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.");r.set(this,it?"":w),Y.isConnected?(Y.toggleAttribute("internals-invalid",!it),Y.toggleAttribute("internals-valid",it),M(Y,"aria-invalid",`${!it}`)):$.set(Y,this)}get shadowRoot(){const p=e.get(this);return m.get(p)||null}get validationMessage(){const p=e.get(this);return A(p,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),r.get(this)}get validity(){const p=e.get(this);return A(p,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),t.get(this)}get willValidate(){const p=e.get(this);return A(p,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(p.disabled||p.hasAttribute("disabled")||p.hasAttribute("readonly"))}}function se(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class v extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const p=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(p,v);const w=new v;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(N=>N in w.internals)}let ge=!1,R=!1;function je(v){R||(R=!0,window.CustomStateSet=Ie,v&&(HTMLElement.prototype.attachInternals=function(...p){const w=v.call(this,p);return w.states=new Ie(this),w}))}function Ve(v=!0){if(!ge){if(ge=!0,typeof window<"u"&&(window.ElementInternals=q),typeof CustomElementRegistry<"u"){const p=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(w,N,Y){if(N.formAssociated){const K=N.prototype.connectedCallback;N.prototype.connectedCallback=function(){b.has(this)||(b.set(this,!0),this.hasAttribute("disabled")&&G(this,!0)),K!=null&&K.apply(this),Be(this)}}p.call(this,w,N,Y)}}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(i.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new q(this)}),typeof Element<"u"){let p=function(...N){const Y=w.apply(this,N);if(m.set(this,Y),ae()){const K=new MutationObserver(U);window.ShadyDOM?K.observe(this,z):K.observe(Y,z),l.set(this,K)}return Y};const w=Element.prototype.attachShadow;Element.prototype.attachShadow=p}ae()&&typeof document<"u"&&new MutationObserver(U).observe(document.documentElement,z),typeof HTMLFormElement<"u"&&W(),(v||typeof window<"u"&&!window.CustomStateSet)&&je()}}return customElements.polyfillWrapFlushCallback||(se()?typeof window<"u"&&!window.CustomStateSet&&je(HTMLElement.prototype.attachInternals):Ve(!1)),s.forceCustomStateSetPolyfill=je,s.forceElementInternalsPolyfill=Ve,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),mh}gh();var bh=Object.defineProperty,Ce=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&bh(e,t,i),i};const Ao="on",Ir="--checked",Hi=",";let he=class extends wt{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=Ms(),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=Ut.props.helptextDropdownButton.default,this.label=null,this.optionalText=dt.forms.labels.optional,this.requiredText=dt.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(e){var t,n,i,r,a,l,c,h,g,m,f;if(!e){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},dt.forms.messages.required,e):(t=e.validity)!=null&&t.typeMismatch||(n=e.validity)!=null&&n.badInput?this.internals.setValidity({typeMismatch:!0},dt.forms.messages.invalid,e):(i=e.validity)!=null&&i.patternMismatch?this.internals.setValidity({patternMismatch:!0},dt.forms.messages.invalidPattern,e):(r=e.validity)!=null&&r.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},dt.forms.messages.tooShort,e):(a=e.validity)!=null&&a.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},dt.forms.messages.tooLong,e):(l=e.validity)!=null&&l.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?dt.forms.messages.rangeUnderflowMin.replace("{min}",(c=this.min)==null?void 0:c.toString()):dt.forms.messages.rangeUnderflow,e):(h=e.validity)!=null&&h.stepMismatch?this.internals.setValidity({stepMismatch:!0},dt.forms.messages.invalid,e):(g=e.validity)!=null&&g.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?dt.forms.messages.rangeOverflowMax.replace("{max}",(m=this.max)==null?void 0:m.toString()):dt.forms.messages.rangeOverflow,e):(f=e.validity)!=null&&f.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){const t=new FormData;e.forEach(n=>{t.append(this.name,n)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(t=>{var n;if(t!==this&&t.getAttribute("name")===this.name&&t.getAttribute("value")!==this.value){const i=t;i.checked&&(i.checked=!1,i.internals&&(i.internals.setFormValue(null),(n=i.internals.states)==null||n.delete(Ir)))}})}valueChecked(e){if(!this.touched)return;const t=this.internals.form||this.closest("form"),n=t?new FormData(t):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof e=="string"?(this.checked=e==="true",this.internals.ariaChecked=String(e==="true")):typeof e=="boolean"&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){const i=(typeof this.value=="string"?this.value:"")||Ao;this.internals.setFormValue(i),n&&n.append(this.name,i),this.internals.states.add(Ir)}else this.internals.setFormValue(null),n&&n.delete(this.name),this.internals.states.delete(Ir);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){(t!==this.value||t!==this._value)&&(typeof e=="string"?((this.multiple||this.range)&&e.includes(Hi)&&(e=e.split(Hi)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(t==null?void 0:t.toString())&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){const e=this.multiple||this.range?[]:"";this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}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}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e=="string"&&e.includes(Hi)?e.split(Hi):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||"":e}validate(){var e,t;(e=this.inputRef)!=null&&e.value&&this.manageValidity(this.inputRef.value),(t=this.inputRefTo)!=null&&t.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(!this.touched){this.touched=!0,e&&this.setFormValue(e),this.validate();return}if(typeof e!="string"&&!Array.isArray(e))return;const t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){var e;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(e=this.inputRef)!=null&&e.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const t=this.defaultValue||(this.multiple||this.range?[]:"");this.value=t,this._value=Array.isArray(t)?t:[t],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(e){super.updated(e),e.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(e){if(super.firstUpdated(e),!this.form){const t=this.internals.form||this.closest("form");this.form=t}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="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const t=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(t);const n=t?(typeof this.value=="string"?this.value:"")||Ao:null;this.internals.setFormValue(n)}else this.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))}};Ce([u({type:Boolean,reflect:!0})],he.prototype,"checked"),Ce([u({type:Boolean})],he.prototype,"defaultChecked"),Ce([u({type:Boolean})],he.prototype,"multiple"),Ce([u({type:Boolean})],he.prototype,"range"),Ce([u({type:String,reflect:!0})],he.prototype,"type"),Ce([u()],he.prototype,"defaultValue"),Ce([u({type:Boolean,reflect:!0})],he.prototype,"disabled"),Ce([u({type:Boolean,reflect:!0})],he.prototype,"readonly"),Ce([u({type:Boolean,reflect:!0})],he.prototype,"required"),Ce([u({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],he.prototype,"max"),Ce([u({type:Number,reflect:!0})],he.prototype,"maxlength"),Ce([u({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],he.prototype,"min"),Ce([u({type:Number,reflect:!0})],he.prototype,"minlength"),Ce([u({type:Number,reflect:!0})],he.prototype,"step"),Ce([u({type:String})],he.prototype,"ariaDescribedBy"),Ce([u({type:String})],he.prototype,"ariaLabelledby"),Ce([u({type:String,reflect:!0})],he.prototype,"name"),Ce([u({type:String,reflect:!0})],he.prototype,"pattern"),Ce([u({type:String,reflect:!0})],he.prototype,"placeholder"),Ce([u({type:String,reflect:!0})],he.prototype,"id"),Ce([u({type:Boolean})],he.prototype,"counter"),Ce([u({type:Boolean})],he.prototype,"hasError"),Ce([u({type:Boolean})],he.prototype,"inline"),Ce([u({type:Boolean})],he.prototype,"hasFieldset"),Ce([u({type:Boolean})],he.prototype,"optionalTag"),Ce([u({type:Boolean})],he.prototype,"requiredTag"),Ce([u({type:Boolean})],he.prototype,"skipForwardTestid"),Ce([u({type:Boolean,reflect:!0,converter:It})],he.prototype,"useWrapper"),Ce([u({type:Boolean,reflect:!0})],he.prototype,"fullwidth"),Ce([u({type:Number})],he.prototype,"counterMaxLength"),Ce([u({type:String})],he.prototype,"errorMessage"),Ce([u({type:String})],he.prototype,"helptext"),Ce([u({type:String})],he.prototype,"helptextDropdown"),Ce([u({type:String,reflect:!1})],he.prototype,"helptextDropdownButton"),Ce([u({type:String})],he.prototype,"label"),Ce([u({type:String,reflect:!1})],he.prototype,"optionalText"),Ce([u({type:String,reflect:!1})],he.prototype,"requiredText"),Ce([u({type:String,reflect:!1})],he.prototype,"tagText"),Ce([u({type:String,attribute:"data-testid"})],he.prototype,"dataTestid");let Io=class{constructor(e){this.nodes=[],this.options=[],this.generation=0,this.host=e,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(t=>this.handleMutations(t))}hostConnected(){Array.from(this.host.childNodes).forEach(e=>{(e.nodeName==="OPTION"||e.nodeName==="DATA")&&this.addNode(e)}),this.createOptions(),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(e){(e.nodeName==="OPTION"||e.nodeName==="DATA")&&(e.hasAttribute("hidden")&&!e.hasAttribute("data-skip")&&e.setAttribute("data-hidden","true"),!e.hasAttribute("hidden")&&e.hasAttribute("data-skip")&&e.hasAttribute("data-hidden")&&e.removeAttribute("data-hidden"),e.setAttribute("class","pkt-hide"),e.setAttribute("data-skip","true"),e.setAttribute("hidden","true"),this.nodes.push(e))}createOptions(){this.options=this.nodes.map(e=>({value:e.hasAttribute("value")?e.getAttribute("value")??"":e.textContent??"",label:e.textContent||e.getAttribute("value")||"",selected:e.hasAttribute("selected"),disabled:e.hasAttribute("disabled"),hidden:e.hasAttribute("data-hidden")})),this.generation++,this.host.requestUpdate()}handleMutations(e){let t=!1;e.forEach(n=>{n.type==="childList"&&(n.addedNodes.forEach(i=>{Fn(i)&&(this.addNode(i),t=!0)}),n.removedNodes.forEach(i=>{Fn(i)&&(this.nodes=this.nodes.filter(r=>r!==i),t=!0)})),n.type==="attributes"&&Fn(n.target)&&(this.addNode(n.target),t=!0)}),t&&this.createOptions()}};var kh=Object.defineProperty,Zn=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&kh(e,t,i),i};let Ys=class extends wt{constructor(){super(...arguments),this.forId=Ms(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Ut.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){const e=()=>{const i=!this.isHelpTextOpen;this.isHelpTextOpen=i,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:i}}))},t=Z({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()}),n=()=>this.helptextDropdown?y`<div class="pkt-inputwrapper__helptext-expandable">
558
558
  <button
559
559
  class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
560
560
  type="button"
@@ -564,20 +564,20 @@
564
564
  class="pkt-btn__icon"
565
565
  name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
566
566
  ></pkt-icon>
567
- <span class="pkt-btn__text">${Bi(this.helptextDropdownButton)}</span>
567
+ <span class="pkt-btn__text">${Ei(this.helptextDropdownButton)}</span>
568
568
  </button>
569
569
  <div
570
570
  class="${Z({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
571
571
  >
572
- ${Bi(this.helptextDropdown)}
572
+ ${Ei(this.helptextDropdown)}
573
573
  </div>
574
574
  </div>`:x;return y`${y`<div class="${t}">
575
575
  <div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
576
- <div class="pkt-contents" name="helptext">${tt(this)}</div>
577
- ${this.helptext&&Bi(this.helptext)}
576
+ <div class="pkt-contents" name="helptext">${Re(this)}</div>
577
+ ${this.helptext&&Ei(this.helptext)}
578
578
  </div>
579
579
  ${n()}
580
- </div>`}`}};Sn([u({type:String,reflect:!0})],Is.prototype,"forId",2),Sn([u({type:String})],Is.prototype,"helptext",2),Sn([u({type:String})],Is.prototype,"helptextDropdown",2),Sn([u({type:String})],Is.prototype,"helptextDropdownButton",2),Sn([_e()],Is.prototype,"isHelpTextOpen",2),Is=Sn([Se("pkt-helptext")],Is);var Ah=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,st=(s,e,t,n)=>{for(var i=n>1?void 0:n?Ih(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Ah(e,t,i),i};let Re=class extends xt{constructor(){super(...arguments),this.forId=As(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=qt.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=qt.props.optionalTag.default,this.optionalText=qt.props.optionalText.default,this.requiredTag=qt.props.requiredTag.default,this.requiredText=qt.props.requiredText.default,this.tagText=null,this.hasError=qt.props.hasError.default,this.errorMessage="",this.disabled=qt.props.disabled.default,this.inline=qt.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=qt.props.hasFieldset.default,this.role="group",this.useWrapper=qt.props.useWrapper.default}updated(e){super.updated(e)}render(){const e={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},t="pkt-tag pkt-tag--small pkt-tag--thin-text",n=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:x,i=()=>y`
580
+ </div>`}`}};Zn([u({type:String,reflect:!0})],Ys.prototype,"forId"),Zn([u({type:String})],Ys.prototype,"helptext"),Zn([u({type:String})],Ys.prototype,"helptextDropdown"),Zn([u({type:String})],Ys.prototype,"helptextDropdownButton"),Zn([_e()],Ys.prototype,"isHelpTextOpen");try{Se("pkt-helptext")(Ys)}catch{console.warn("Forsøker å definere <pkt-helptext>, men den er allerede definert")}var vh=Object.defineProperty,st=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&vh(e,t,i),i};let et=class extends wt{constructor(){super(...arguments),this.forId=Ms(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=Ut.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=Ut.props.optionalTag.default,this.optionalText=Ut.props.optionalText.default,this.requiredTag=Ut.props.requiredTag.default,this.requiredText=Ut.props.requiredText.default,this.tagText=null,this.hasError=Ut.props.hasError.default,this.errorMessage="",this.disabled=Ut.props.disabled.default,this.inline=Ut.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=Ut.props.hasFieldset.default,this.role="group",this.useWrapper=Ut.props.useWrapper.default}updated(e){super.updated(e)}render(){const e={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},t="pkt-tag pkt-tag--small pkt-tag--thin-text",n=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:x,i=()=>y`
581
581
  ${this.tagText?y`<span class=${t+" pkt-tag--gray"}>${this.tagText}</span>`:x}
582
582
  ${this.optionalTag?y`<span class=${t+" pkt-tag--blue-light"}>${this.optionalText}</span>`:x}
583
583
  ${this.requiredTag?y`<span class=${t+" pkt-tag--beige"}>${this.requiredText}</span>`:x}
@@ -607,9 +607,9 @@
607
607
  .forId=${this.forId}
608
608
  .helptext=${this.helptext}
609
609
  .helptextDropdown=${this.helptextDropdown}
610
- .helptextDropdownButton=${this.helptextDropdownButton||qt.props.helptextDropdownButton.default}
610
+ .helptextDropdownButton=${this.helptextDropdownButton||Ut.props.helptextDropdownButton.default}
611
611
  @toggleHelpText=${m=>{this.toggleDropdown(m)}}
612
- >${tt(this,"helptext")}</pkt-helptext>
612
+ >${Re(this,"helptext")}</pkt-helptext>
613
613
  `,l=()=>this.counter?y`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
614
614
  ${this.counterError?this.counterError:x} ${this.counterCurrent||0}
615
615
  ${this.counterMaxLength?`/${this.counterMaxLength}`:x}
@@ -620,17 +620,17 @@
620
620
  aria-live="assertive"
621
621
  aria-atomic="true"
622
622
  >
623
- ${Bi(this.errorMessage)}
623
+ ${Ei(this.errorMessage)}
624
624
  </pkt-alert>`:x,h=()=>y`
625
625
  ${r()}
626
626
  ${a()}
627
627
  ${this.counterPosition==="top"?l():x}
628
- <div class="pkt-contents">${tt(this)}</div>
628
+ <div class="pkt-contents">${Re(this)}</div>
629
629
  ${this.counterPosition==="bottom"?l():x}
630
630
  ${c()}
631
631
  `,g=()=>this.hasFieldset?y`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${n}">
632
632
  ${h()}
633
- </fieldset>`:y`<div class="pkt-inputwrapper__fieldset">${h()}</div>`;return y`<div class=${Z(e)}>${g()}</div> `}toggleDropdown(e){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:e.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};st([u({type:String})],Re.prototype,"forId",2),st([u({type:String})],Re.prototype,"label",2),st([u({type:String})],Re.prototype,"helptext",2),st([u({type:String})],Re.prototype,"helptextDropdown",2),st([u({type:String})],Re.prototype,"helptextDropdownButton",2),st([u({type:Boolean})],Re.prototype,"counter",2),st([u({type:Number})],Re.prototype,"counterCurrent",2),st([u({type:Number})],Re.prototype,"counterMaxLength",2),st([u({type:String})],Re.prototype,"counterError",2),st([u({type:String,reflect:!1})],Re.prototype,"counterPosition",2),st([u({type:Boolean})],Re.prototype,"optionalTag",2),st([u({type:String})],Re.prototype,"optionalText",2),st([u({type:Boolean})],Re.prototype,"requiredTag",2),st([u({type:String})],Re.prototype,"requiredText",2),st([u({type:String})],Re.prototype,"tagText",2),st([u({type:Boolean})],Re.prototype,"hasError",2),st([u({type:String})],Re.prototype,"errorMessage",2),st([u({type:Boolean})],Re.prototype,"disabled",2),st([u({type:Boolean})],Re.prototype,"inline",2),st([u({type:String})],Re.prototype,"ariaDescribedby",2),st([u({type:Boolean})],Re.prototype,"hasFieldset",2),st([u({type:String,reflect:!0})],Re.prototype,"role",2),st([u({type:Boolean,reflect:!0,converter:It})],Re.prototype,"useWrapper",2),Re=st([Se("pkt-input-wrapper")],Re);const Lh=(s,e,t)=>{switch(s){case",":return t?"addValue":null;case"Enter":return"addValue";case"Tab":case"ArrowDown":return e?null:"focusListbox";case"Escape":return"closeOptions";default:return null}},Fh=(s,e,t,n,i)=>{if(!s)return{action:"none",value:null};const r=us(t,s);return!e.includes(s)&&!r?n?{action:"addUserValue",value:s}:i?{action:"none",value:null}:{action:"removeValue",value:e[0]}:r&&!e.includes(r.value)?{action:"selectOption",value:r.value}:{action:"none",value:null}},Bh=(s,e,t,n,i)=>s.trim().toLowerCase()?{...kh(s,e,t,n),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:"",shouldRemoveValue:!i&&!!e[0],shouldResetInput:!0},Ki=(s,e,t)=>{const n=us(e,s);return t==="label"&&n!=null&&n.label?n.label:s},oi={markOptionSelected(s,e){if(e){for(const t of s)if(t.value===e){t.selected=!0;break}}},markOptionDeselected(s,e){if(e){for(const t of s)if(t.value===e){t.selected=!1;break}}},markAllSelected(s){for(const e of s)e.selected=!0},markAllDeselected(s){for(const e of s)e.selected=!1},removeUserAddedOptions(s){return s.filter(e=>!e.userAdded)}},Bo={parseOptionsFromSlot(s){const e=[];return s.forEach(t=>{if(!t.textContent&&!t.getAttribute("value"))return;const n={value:t.getAttribute("value")||t.textContent||"",label:t.textContent||t.getAttribute("value")||""};t.getAttribute("data-prefix")&&(n.prefix=t.getAttribute("data-prefix")||void 0),t.getAttribute("tagskincolor")&&(n.tagSkinColor=t.getAttribute("tagskincolor")),t.getAttribute("description")&&(n.description=t.getAttribute("description")||void 0),n.fulltext=Po(n),e.push(n)}),e}},Br={syncOptionsWithValues(s,e){const t=[...e];return s.forEach(n=>{n.value&&!n.label&&(n.label=n.value),n.selected&&!t.includes(n.value)&&t.push(n.value),n.fulltext=Po(n),n.selected=n.selected||t.includes(n.value)}),{options:s,newValues:t}},mergeWithUserAdded(s,e){return[...e.filter(t=>(t==null?void 0:t.userAdded)&&t.selected).filter(t=>!(Array.isArray(s)?s:[]).some(n=>n.value===t.value)),...s]}},Vh={displayValueAs:{default:"label"}},Hh={props:Vh};var Uh=Object.defineProperty,ht=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Uh(e,t,i),i};let ct=class extends he{constructor(){super(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=Hh.props.displayValueAs.default,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._internalValueSync=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=De(),this.triggerRef=De(),this.listboxRef=De(),this.optionsController=new Fo(this)}get _hasTextInput(){return this.typeahead||this.allowUserInput}get _selectionDescription(){if(!(!this.multiple||this._value.length===0))return`${this._value.length} valgt`}focusTrigger(){var e,t;this._hasTextInput?(e=this.inputRef.value)==null||e.focus():(t=this.triggerRef.value)==null||t.focus()}parseValue(){return Array.isArray(this.value)?this.multiple?this.value:this.value.length>0?[this.value[0]]:[]:this.value&&this.multiple?this.value.split(","):this.value?[this.value]:[]}updateMaxReached(){this._maxIsReached=Wi(this._value.length,this.maxlength)}syncValueAndDispatch(e){const t=this._value,n=this.multiple?t.join(","):t[0]||"",i=Array.isArray(this.value)?this.value.join(","):String(this.value||"");if(n!==i&&(this._internalValueSync=!0,this.value=n),(e==null?void 0:e.join(","))!==t.join(",")){const r=this.multiple?[...t]:t[0]||"";this.onChange(r)}else t.length===0&&e&&e.length>0&&this.clearInputValue()}onChange(e){this.touched=!0,super.onChange(e)}valueChanged(){}};ht([u({type:String,reflect:!0})],ct.prototype,"value"),ht([u({type:Array})],ct.prototype,"options"),ht([u({type:Array,attribute:"default-options"})],ct.prototype,"defaultOptions"),ht([u({type:Boolean,attribute:"allow-user-input"})],ct.prototype,"allowUserInput"),ht([u({type:Boolean})],ct.prototype,"typeahead"),ht([u({type:Boolean,attribute:"include-search"})],ct.prototype,"includeSearch"),ht([u({type:String,attribute:"search-placeholder"})],ct.prototype,"searchPlaceholder"),ht([u({type:Boolean})],ct.prototype,"multiple"),ht([u({type:Number})],ct.prototype,"maxlength"),ht([u({type:String,attribute:"display-value-as"})],ct.prototype,"displayValueAs"),ht([u({type:String,attribute:"tag-placement"})],ct.prototype,"tagPlacement"),ht([u({type:Boolean,attribute:"open"})],ct.prototype,"isOpen"),ht([_e()],ct.prototype,"_options"),ht([_e()],ct.prototype,"_value"),ht([_e()],ct.prototype,"_isOptionsOpen"),ht([_e()],ct.prototype,"_userInfoMessage"),ht([_e()],ct.prototype,"_addValueText"),ht([_e()],ct.prototype,"_maxIsReached"),ht([_e()],ct.prototype,"_search"),ht([_e()],ct.prototype,"_inputFocus");class qh extends ct{toggleValue(e){var t,n;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const i=((t=us(this.options,e))==null?void 0:t.value)||null,r=this._value.includes(e||i||""),a=!!i,l=((n=this._options.find(C=>C.value===e))==null?void 0:n.disabled)||!1,c=!(e!=null&&e.trim()),h=!this.multiple,g=this.multiple,m=Wi(this._value.length,this.maxlength);let f=!1,v=!0,b="",w="";l||(!a&&this.allowUserInput&&!c?(this.addNewUserValue(e),b="Ny verdi lagt til",f=g):!a&&!this.allowUserInput?(h&&this._value[0]&&this.removeValue(this._value[0]),v=!1,f=!0,b="Ingen treff i søket"):r?(this.removeValue(i),f=!0,h&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="")):c&&h?(this.removeAllSelected(),f=!0):h?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(i),f=!1):g&&!m?(this.setSelected(i),f=!0):g&&m?(b="Maks antall valg nådd",v=!1,w=e):(h&&this.removeAllSelected(),b="Ingen gyldig verdi valgt",v=!1,f=!0,w=e),this._isOptionsOpen=f,f||(h&&this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this._userInfoMessage=b,this._search=w||"",this.resetComboboxInput(v),g&&this.updateMaxReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&Wi(this._value.length,this.maxlength)){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,oi.markOptionSelected(this._options,e),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(n=>n!==e);const t=us(this.options,e);t&&(oi.markOptionDeselected(this.options,e),t.userAdded?(this._options=[...this._options.filter(n=>n.value!==e)],this.options=[...this.options.filter(n=>n.value!==e)]):this._options.some(n=>n.value===e)||(this._options=[...this._options,t]))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(e=>e.value),oi.markAllSelected(this._options),this.requestUpdate()}}removeAllSelected(){this._value=[],oi.markAllDeselected(this._options),this._options=oi.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";if(this._search=t,t&&this._value.includes(t)){this.resetComboboxInput(!0),this._userInfoMessage="Verdien er allerede valgt";return}this.toggleValue(t)}removeValue(e){this._value=this.multiple?this._value.filter(t=>t!==e):[],this.removeSelected(e)}addNewUserValue(e){if(!e||e.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[e];else if(!us(this.options,e)){if(Wi(this._value.length,this.maxlength))return;this._value=[...this._value,e]}const t={value:e,label:e,userAdded:!0,selected:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.resetComboboxInput(!0),this.multiple||(this._isOptionsOpen=!1,this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this.requestUpdate()}resetComboboxInput(e=!0){this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&e&&(this._search="",this.multiple?this.inputRef.value.value="":(this.inputRef.value.value=this._value[0]?Ki(this._value[0],this.options,this.displayValueAs):"",this._userInfoMessage="")),this._options=[...this.options]}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();const t=this._value[this._value.length-1];t&&this.removeSelected(t),this.updateMaxReached()}}class jh extends qh{handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead)if(this._search){const{filtered:n,suggestion:i}=vh(this.options,this._search);this._options=n,e.inputType!=="deleteContentBackward"&&i!=null&&i.label&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(t.value=i.label,window.setTimeout(()=>t.setSelectionRange(this._search.length,t.value.length),0),t.selectionDirection="backward")}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(this._suppressNextOpen){this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate();return}!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value=Ki(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){var t,n;if(this.disabled||!this._isOptionsOpen)return;const i=e.relatedTarget;((t=i==null?void 0:i.closest("pkt-combobox"))==null?void 0:t.id)===this.id||((n=e.target)==null?void 0:n.getAttribute("data-focusfix"))===this.id||i===this.inputRef.value||i===this.triggerRef.value||this.closeAndProcessInput()}closeAndProcessInput(){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"){const e=this.inputRef.value.value;if(this.multiple){if(e!==""){const{action:t,value:n}=Fh(e,this._value,this.options,this.allowUserInput,this.multiple);switch(t){case"addUserValue":this.addNewUserValue(n);break;case"selectOption":this.setSelected(n);break;case"removeValue":this.removeValue(n);break}}}else if(!e)this._value[0]&&this.removeSelected(this._value[0]);else{const t=us(this.options,e);t&&t.value!==this._value[0]?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t.value)):!t&&this.allowUserInput&&(this._value[0]&&this.removeSelected(this._value[0]),this.addNewUserValue(e))}!this.multiple&&this._value[0]?this.inputRef.value.value=Ki(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(e){var t,n;if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}this._hasTextInput?((t=this.inputRef.value)==null||t.focus(),this.requestUpdate()):(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen&&((n=this.listboxRef.value)==null||n.focusFirstOrSelectedOption()))}handlePlaceholderClick(e){this.disabled||(e.stopPropagation(),this._hasTextInput&&this.inputRef.value?(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()):(this._isOptionsOpen=!this._isOptionsOpen,this.requestUpdate()))}handleSelectOnlyKeydown(e){var t,n;if(!this.disabled)switch(e.key){case"Enter":case" ":case"ArrowDown":case"ArrowUp":e.preventDefault(),this._isOptionsOpen?this._isOptionsOpen=!1:(this._isOptionsOpen=!0,(t=this.listboxRef.value)==null||t.focusFirstOrSelectedOption());break;case"Escape":this._isOptionsOpen&&(e.preventDefault(),this._isOptionsOpen=!1);break;case"Home":case"End":e.preventDefault(),this._isOptionsOpen||(this._isOptionsOpen=!0),(n=this.listboxRef.value)==null||n.focusFirstOrSelectedOption();break;case"ArrowLeft":this.multiple&&this._value.length>0&&(e.preventDefault(),this.focusTag(this._value.length-1));break;case"Backspace":case"Delete":this.multiple&&this._value.length>0&&(e.preventDefault(),this.removeSelected(this._value[this._value.length-1]));break}}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase(),this.checkForMatches()}handleInputKeydown(e){var t,n,i;if(e.key==="Backspace"){const a=!((t=this.inputRef.value)!=null&&t.value);!this._search&&a&&this.multiple&&this._value.length>0&&this.removeLastValue(e);return}if(e.key==="ArrowLeft"&&this.multiple&&this._value.length>0){const a=this.inputRef.value;if(a&&a.selectionStart===0&&!a.value){e.preventDefault(),this.focusTag(this._value.length-1);return}}const r=Lh(e.key,e.shiftKey,this.multiple);if(r&&!(e.key==="Tab"&&!this._isOptionsOpen)){if(r==="focusListbox"&&e.key==="Tab"&&!((n=this.listboxRef.value)!=null&&n.querySelector('[role="option"]:not([data-disabled]), [data-type="new-option"]'))){this.closeAndProcessInput();return}switch(e.preventDefault(),r){case"addValue":this.addValue();break;case"focusListbox":(i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption();break;case"closeOptions":this._isOptionsOpen=!1;break}}}handleTagRemove(e){this.removeSelected(e),this._hasTextInput&&this.inputRef.value&&(this._inputFocus=!0,this.inputRef.value.focus(),this.requestUpdate())}getInsideTags(){return Array.from(this.querySelectorAll(".pkt-combobox__input .pkt-combobox__tag-list pkt-tag"))}focusTag(e){var t;const n=this.getInsideTags();n.forEach((r,a)=>{r.buttonTabindex=a===e?0:-1});const i=(t=n[e])==null?void 0:t.querySelector("button");i==null||i.focus()}resetTagTabindices(){this.getInsideTags().forEach(e=>{e.buttonTabindex=-1})}handleTagKeydown(e,t){e.stopPropagation();const n=()=>{var i;this.resetTagTabindices(),this._hasTextInput&&this.inputRef.value?this.inputRef.value.focus():(i=this.triggerRef.value)==null||i.focus()};switch(e.key){case"ArrowLeft":e.preventDefault(),t>0&&this.focusTag(t-1);break;case"ArrowRight":e.preventDefault(),t<this._value.length-1?this.focusTag(t+1):n();break;case"Backspace":case"Delete":e.preventDefault();{const i=this._value[t],r=t>=this._value.length-1?t-1:t;this.removeSelected(i),r>=0?(this.requestUpdate(),this.updateComplete.then(()=>this.focusTag(r))):n()}break;case"Tab":this.resetTagTabindices();break;case"Escape":e.preventDefault(),n();break}}checkForMatches(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value)||this._search||"",n=Bh(t,this._value,this.options,this.allowUserInput,this.multiple);if(n.shouldRemoveValue&&this.removeValue(this._value[0]),n.shouldResetInput){this.resetComboboxInput(!1);return}this._addValueText=n.addValueText,this._userInfoMessage=n.userInfoMessage}}var Wh=(s,e,t,n)=>{for(var i=e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(i)||i);return i};let Vo=class extends jh{constructor(){super(...arguments),this.handleBodyClick=e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.closeAndProcessInput()}}connectedCallback(){var e,t;if(super.connectedCallback(),document==null||document.body.addEventListener("click",this.handleBodyClick),this._options=[],this.defaultOptions&&this.defaultOptions.length){const n=((e=this.options)==null?void 0:e.filter(i=>i.userAdded))||[];this.options=[...n,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((t=this.optionsController)!=null&&t.nodes&&this.optionsController.nodes.length){const n=Bo.parseOptionsFromSlot(this.optionsController.nodes);n.length&&(this.options=[...n],this._options=[...n],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}willUpdate(e){if(this._optionsFromSlot&&this.optionsController){const t=this.optionsController.generation;if(t!==this._lastSlotGeneration){this._lastSlotGeneration=t;const n=Bo.parseOptionsFromSlot(this.optionsController.nodes),i=this._options.filter(r=>r.userAdded);this.options=[...i,...n]}}super.willUpdate(e)}disconnectedCallback(){super.disconnectedCallback(),document==null||document.body.removeEventListener("click",this.handleBodyClick)}firstUpdated(e){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(e)}updated(e){e.has("isOpen")&&(this._isOptionsOpen=this.isOpen);const t=e.has("value"),n=e.has("_value");if(t&&this._internalValueSync)this._internalValueSync=!1,n&&this.syncValueAndDispatch(e.get("_value"));else if(t){const i=[...this._value],r=this.parseValue();r.join(",")!==this._value.join(",")&&(this._value=r),this.updateMaxReached(),this.syncValueAndDispatch(i)}else n&&this.syncValueAndDispatch(e.get("_value"));if(e.has("defaultOptions")&&this.defaultOptions.length){const i=(Array.isArray(this.options)?this.options:[]).filter(r=>r.userAdded)||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const i=e.get("options")||this._options||[],r=Br.mergeWithUserAdded(this.options,i);this._options=r,r.length>this.options.length&&(this.options=r);const a=Br.syncOptionsWithValues(this._options,this._value);if(this._options=a.options,a.newValues.length>this._value.length){const l=[...this._value];this._value=a.newValues,this.syncValueAndDispatch(l)}}if(e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&!this.multiple&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const i=this._value[0]?Ki(this._value[0],this.options,this.displayValueAs):"";this.inputRef.value.value!==i&&(this.inputRef.value.value=i)}super.updated(e)}formResetCallback(){this.touched=!1;const e=this.defaultValue||(this.multiple,"");this.value=e,this._value=this.parseValue(),this._options=this._options.filter(t=>!t.userAdded).map(t=>({...t,selected:this._value.includes(t.value)})),this.options=this.options.filter(t=>!t.userAdded).map(t=>({...t,selected:this._value.includes(t.value)})),this._search="",this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._inputFocus=!1,this.updateMaxReached(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value=""),this.internals.setFormValue(""),this.internals.ariaInvalid="false",this.requestUpdate()}attributeChangedCallback(e,t,n){if(e==="options"){this._options=Array.isArray(this.options)?[...this.options]:[];const i=Br.syncOptionsWithValues(this._options,this._value);this._options=i.options,i.newValues.length>this._value.length&&(this._value=i.newValues),this._search=""}super.attributeChangedCallback(e,t,n)}render(){return y`
633
+ </fieldset>`:y`<div class="pkt-inputwrapper__fieldset">${h()}</div>`;return y`<div class=${Z(e)}>${g()}</div> `}toggleDropdown(e){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:e.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};st([u({type:String})],et.prototype,"forId"),st([u({type:String})],et.prototype,"label"),st([u({type:String})],et.prototype,"helptext"),st([u({type:String})],et.prototype,"helptextDropdown"),st([u({type:String})],et.prototype,"helptextDropdownButton"),st([u({type:Boolean})],et.prototype,"counter"),st([u({type:Number})],et.prototype,"counterCurrent"),st([u({type:Number})],et.prototype,"counterMaxLength"),st([u({type:String})],et.prototype,"counterError"),st([u({type:String,reflect:!1})],et.prototype,"counterPosition"),st([u({type:Boolean})],et.prototype,"optionalTag"),st([u({type:String})],et.prototype,"optionalText"),st([u({type:Boolean})],et.prototype,"requiredTag"),st([u({type:String})],et.prototype,"requiredText"),st([u({type:String})],et.prototype,"tagText"),st([u({type:Boolean})],et.prototype,"hasError"),st([u({type:String})],et.prototype,"errorMessage"),st([u({type:Boolean})],et.prototype,"disabled"),st([u({type:Boolean})],et.prototype,"inline"),st([u({type:String})],et.prototype,"ariaDescribedby"),st([u({type:Boolean})],et.prototype,"hasFieldset"),st([u({type:String,reflect:!0})],et.prototype,"role"),st([u({type:Boolean,reflect:!0,converter:It})],et.prototype,"useWrapper");try{Se("pkt-input-wrapper")(et)}catch{console.warn("Forsøker å definere <pkt-input-wrapper>, men den er allerede definert")}const yh=(s,e,t)=>{switch(s){case",":return t?"addValue":null;case"Enter":return"addValue";case"Tab":case"ArrowDown":return e?null:"focusListbox";case"Escape":return"closeOptions";default:return null}},_h=(s,e,t,n,i)=>{if(!s)return{action:"none",value:null};const r=os(t,s);return!e.includes(s)&&!r?n?{action:"addUserValue",value:s}:i?{action:"none",value:null}:{action:"removeValue",value:e[0]}:r&&!e.includes(r.value)?{action:"selectOption",value:r.value}:{action:"none",value:null}},wh=(s,e,t,n,i)=>s.trim().toLowerCase()?{...ah(s,e,t,n),shouldRemoveValue:!1,shouldResetInput:!1}:{addValueText:null,userInfoMessage:"",shouldRemoveValue:!i&&!!e[0],shouldResetInput:!0},Ui=(s,e,t)=>{const n=os(e,s);return t==="label"&&n!=null&&n.label?n.label:s},Jn={markOptionSelected(s,e){if(e){for(const t of s)if(t.value===e){t.selected=!0;break}}},markOptionDeselected(s,e){if(e){for(const t of s)if(t.value===e){t.selected=!1;break}}},markAllSelected(s){for(const e of s)e.selected=!0},markAllDeselected(s){for(const e of s)e.selected=!1},removeUserAddedOptions(s){return s.filter(e=>!e.userAdded)}},Po={parseOptionsFromSlot(s){const e=[];return s.forEach(t=>{if(!t.textContent&&!t.getAttribute("value"))return;const n={value:t.getAttribute("value")||t.textContent||"",label:t.textContent||t.getAttribute("value")||""};t.getAttribute("data-prefix")&&(n.prefix=t.getAttribute("data-prefix")||void 0),t.getAttribute("tagskincolor")&&(n.tagSkinColor=t.getAttribute("tagskincolor")),t.getAttribute("description")&&(n.description=t.getAttribute("description")||void 0),n.fulltext=Mo(n),e.push(n)}),e}},Pr={syncOptionsWithValues(s,e){const t=[...e];return s.forEach(n=>{n.value&&!n.label&&(n.label=n.value),n.selected&&!t.includes(n.value)&&t.push(n.value),n.fulltext=Mo(n),n.selected=n.selected||t.includes(n.value)}),{options:s,newValues:t}},mergeWithUserAdded(s,e){return[...e.filter(t=>(t==null?void 0:t.userAdded)&&t.selected).filter(t=>!(Array.isArray(s)?s:[]).some(n=>n.value===t.value)),...s]}},$h={displayValueAs:{default:"label"}},xh={props:$h};var Sh=Object.defineProperty,ht=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Sh(e,t,i),i};let ct=class extends he{constructor(){super(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=xh.props.displayValueAs.default,this.tagPlacement=null,this.isOpen=!1,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._internalValueSync=!1,this._optionsFromSlot=!1,this._lastSlotGeneration=0,this._suppressNextOpen=!1,this.inputRef=Ne(),this.triggerRef=Ne(),this.listboxRef=Ne(),this.optionsController=new Io(this)}get _hasTextInput(){return this.typeahead||this.allowUserInput}get _selectionDescription(){if(!(!this.multiple||this._value.length===0))return`${this._value.length} valgt`}focusTrigger(){var e,t;this._hasTextInput?(e=this.inputRef.value)==null||e.focus():(t=this.triggerRef.value)==null||t.focus()}parseValue(){return Array.isArray(this.value)?this.multiple?this.value:this.value.length>0?[this.value[0]]:[]:this.value&&this.multiple?this.value.split(","):this.value?[this.value]:[]}updateMaxReached(){this._maxIsReached=Vi(this._value.length,this.maxlength)}syncValueAndDispatch(e){const t=this._value,n=this.multiple?t.join(","):t[0]||"",i=Array.isArray(this.value)?this.value.join(","):String(this.value||"");if(n!==i&&(this._internalValueSync=!0,this.value=n),(e==null?void 0:e.join(","))!==t.join(",")){const r=this.multiple?[...t]:t[0]||"";this.onChange(r)}else t.length===0&&e&&e.length>0&&this.clearInputValue()}onChange(e){this.touched=!0,super.onChange(e)}valueChanged(){}};ht([u({type:String,reflect:!0})],ct.prototype,"value"),ht([u({type:Array})],ct.prototype,"options"),ht([u({type:Array,attribute:"default-options"})],ct.prototype,"defaultOptions"),ht([u({type:Boolean,attribute:"allow-user-input"})],ct.prototype,"allowUserInput"),ht([u({type:Boolean})],ct.prototype,"typeahead"),ht([u({type:Boolean,attribute:"include-search"})],ct.prototype,"includeSearch"),ht([u({type:String,attribute:"search-placeholder"})],ct.prototype,"searchPlaceholder"),ht([u({type:Boolean})],ct.prototype,"multiple"),ht([u({type:Number})],ct.prototype,"maxlength"),ht([u({type:String,attribute:"display-value-as"})],ct.prototype,"displayValueAs"),ht([u({type:String,attribute:"tag-placement"})],ct.prototype,"tagPlacement"),ht([u({type:Boolean,attribute:"open"})],ct.prototype,"isOpen"),ht([_e()],ct.prototype,"_options"),ht([_e()],ct.prototype,"_value"),ht([_e()],ct.prototype,"_isOptionsOpen"),ht([_e()],ct.prototype,"_userInfoMessage"),ht([_e()],ct.prototype,"_addValueText"),ht([_e()],ct.prototype,"_maxIsReached"),ht([_e()],ct.prototype,"_search"),ht([_e()],ct.prototype,"_inputFocus");class Ch extends ct{toggleValue(e){var t,n;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const i=((t=os(this.options,e))==null?void 0:t.value)||null,r=this._value.includes(e||i||""),a=!!i,l=((n=this._options.find(C=>C.value===e))==null?void 0:n.disabled)||!1,c=!(e!=null&&e.trim()),h=!this.multiple,g=this.multiple,m=Vi(this._value.length,this.maxlength);let f=!1,k=!0,b="",$="";l||(!a&&this.allowUserInput&&!c?(this.addNewUserValue(e),b="Ny verdi lagt til",f=g):!a&&!this.allowUserInput?(h&&this._value[0]&&this.removeValue(this._value[0]),k=!1,f=!0,b="Ingen treff i søket"):r?(this.removeValue(i),f=!0,h&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="")):c&&h?(this.removeAllSelected(),f=!0):h?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(i),f=!1):g&&!m?(this.setSelected(i),f=!0):g&&m?(b="Maks antall valg nådd",k=!1,$=e):(h&&this.removeAllSelected(),b="Ingen gyldig verdi valgt",k=!1,f=!0,$=e),this._isOptionsOpen=f,f||(h&&this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this._userInfoMessage=b,this._search=$||"",this.resetComboboxInput(k),g&&this.updateMaxReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&Vi(this._value.length,this.maxlength)){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,Jn.markOptionSelected(this._options,e),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(n=>n!==e);const t=os(this.options,e);t&&(Jn.markOptionDeselected(this.options,e),t.userAdded?(this._options=[...this._options.filter(n=>n.value!==e)],this.options=[...this.options.filter(n=>n.value!==e)]):this._options.some(n=>n.value===e)||(this._options=[...this._options,t]))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(e=>e.value),Jn.markAllSelected(this._options),this.requestUpdate()}}removeAllSelected(){this._value=[],Jn.markAllDeselected(this._options),this._options=Jn.removeUserAddedOptions(this._options),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";if(this._search=t,t&&this._value.includes(t)){this.resetComboboxInput(!0),this._userInfoMessage="Verdien er allerede valgt";return}this.toggleValue(t)}removeValue(e){this._value=this.multiple?this._value.filter(t=>t!==e):[],this.removeSelected(e)}addNewUserValue(e){if(!e||e.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[e];else if(!os(this.options,e)){if(Vi(this._value.length,this.maxlength))return;this._value=[...this._value,e]}const t={value:e,label:e,userAdded:!0,selected:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.resetComboboxInput(!0),this.multiple||(this._isOptionsOpen=!1,this._hasTextInput&&(this._suppressNextOpen=!0),window.setTimeout(()=>{this.focusTrigger()},0)),this.requestUpdate()}resetComboboxInput(e=!0){this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&e&&(this._search="",this.multiple?this.inputRef.value.value="":(this.inputRef.value.value=this._value[0]?Ui(this._value[0],this.options,this.displayValueAs):"",this._userInfoMessage="")),this._options=[...this.options]}removeLastValue(e){if(this._value.length===0)return;e.preventDefault();const t=this._value[this._value.length-1];t&&this.removeSelected(t),this.updateMaxReached()}}class Th extends Ch{handleInput(e){if(e.stopPropagation(),e.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const t=e.target;if(this._search=t.value,this.checkForMatches(),this.typeahead)if(this._search){const{filtered:n,suggestion:i}=rh(this.options,this._search);this._options=n,e.inputType!=="deleteContentBackward"&&i!=null&&i.label&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(t.value=i.label,window.setTimeout(()=>t.setSelectionRange(this._search.length,t.value.length),0),t.selectionDirection="backward")}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(this._suppressNextOpen){this._suppressNextOpen=!1,this._inputFocus=!0,this.requestUpdate();return}!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value=Ui(this._value[0],this.options,this.displayValueAs)),this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){var t,n;if(this.disabled||!this._isOptionsOpen)return;const i=e.relatedTarget;((t=i==null?void 0:i.closest("pkt-combobox"))==null?void 0:t.id)===this.id||((n=e.target)==null?void 0:n.getAttribute("data-focusfix"))===this.id||i===this.inputRef.value||i===this.triggerRef.value||this.closeAndProcessInput()}closeAndProcessInput(){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"){const e=this.inputRef.value.value;if(this.multiple){if(e!==""){const{action:t,value:n}=_h(e,this._value,this.options,this.allowUserInput,this.multiple);switch(t){case"addUserValue":this.addNewUserValue(n);break;case"selectOption":this.setSelected(n);break;case"removeValue":this.removeValue(n);break}}}else if(!e)this._value[0]&&this.removeSelected(this._value[0]);else{const t=os(this.options,e);t&&t.value!==this._value[0]?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(t.value)):!t&&this.allowUserInput&&(this._value[0]&&this.removeSelected(this._value[0]),this.addNewUserValue(e))}!this.multiple&&this._value[0]?this.inputRef.value.value=Ui(this._value[0],this.options,this.displayValueAs):this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}handleBlur(){this._inputFocus=!1,this.onBlur()}handleInputClick(e){var t,n;if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}this._hasTextInput?((t=this.inputRef.value)==null||t.focus(),this.requestUpdate()):(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen&&((n=this.listboxRef.value)==null||n.focusFirstOrSelectedOption()))}handlePlaceholderClick(e){this.disabled||(e.stopPropagation(),this._hasTextInput&&this.inputRef.value?(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()):(this._isOptionsOpen=!this._isOptionsOpen,this.requestUpdate()))}handleSelectOnlyKeydown(e){var t,n;if(!this.disabled)switch(e.key){case"Enter":case" ":case"ArrowDown":case"ArrowUp":e.preventDefault(),this._isOptionsOpen?this._isOptionsOpen=!1:(this._isOptionsOpen=!0,(t=this.listboxRef.value)==null||t.focusFirstOrSelectedOption());break;case"Escape":this._isOptionsOpen&&(e.preventDefault(),this._isOptionsOpen=!1);break;case"Home":case"End":e.preventDefault(),this._isOptionsOpen||(this._isOptionsOpen=!0),(n=this.listboxRef.value)==null||n.focusFirstOrSelectedOption();break;case"ArrowLeft":this.multiple&&this._value.length>0&&(e.preventDefault(),this.focusTag(this._value.length-1));break;case"Backspace":case"Delete":this.multiple&&this._value.length>0&&(e.preventDefault(),this.removeSelected(this._value[this._value.length-1]));break}}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase(),this.checkForMatches()}handleInputKeydown(e){var t,n,i;if(e.key==="Backspace"){const a=!((t=this.inputRef.value)!=null&&t.value);!this._search&&a&&this.multiple&&this._value.length>0&&this.removeLastValue(e);return}if(e.key==="ArrowLeft"&&this.multiple&&this._value.length>0){const a=this.inputRef.value;if(a&&a.selectionStart===0&&!a.value){e.preventDefault(),this.focusTag(this._value.length-1);return}}const r=yh(e.key,e.shiftKey,this.multiple);if(r&&!(e.key==="Tab"&&!this._isOptionsOpen)){if(r==="focusListbox"&&e.key==="Tab"&&!((n=this.listboxRef.value)!=null&&n.querySelector('[role="option"]:not([data-disabled]), [data-type="new-option"]'))){this.closeAndProcessInput();return}switch(e.preventDefault(),r){case"addValue":this.addValue();break;case"focusListbox":(i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption();break;case"closeOptions":this._isOptionsOpen=!1;break}}}handleTagRemove(e){this.removeSelected(e),this._hasTextInput&&this.inputRef.value&&(this._inputFocus=!0,this.inputRef.value.focus(),this.requestUpdate())}getInsideTags(){return Array.from(this.querySelectorAll(".pkt-combobox__input .pkt-combobox__tag-list pkt-tag"))}focusTag(e){var t;const n=this.getInsideTags();n.forEach((r,a)=>{r.buttonTabindex=a===e?0:-1});const i=(t=n[e])==null?void 0:t.querySelector("button");i==null||i.focus()}resetTagTabindices(){this.getInsideTags().forEach(e=>{e.buttonTabindex=-1})}handleTagKeydown(e,t){e.stopPropagation();const n=()=>{var i;this.resetTagTabindices(),this._hasTextInput&&this.inputRef.value?this.inputRef.value.focus():(i=this.triggerRef.value)==null||i.focus()};switch(e.key){case"ArrowLeft":e.preventDefault(),t>0&&this.focusTag(t-1);break;case"ArrowRight":e.preventDefault(),t<this._value.length-1?this.focusTag(t+1):n();break;case"Backspace":case"Delete":e.preventDefault();{const i=this._value[t],r=t>=this._value.length-1?t-1:t;this.removeSelected(i),r>=0?(this.requestUpdate(),this.updateComplete.then(()=>this.focusTag(r))):n()}break;case"Tab":this.resetTagTabindices();break;case"Escape":e.preventDefault(),n();break}}checkForMatches(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value)||this._search||"",n=wh(t,this._value,this.options,this.allowUserInput,this.multiple);if(n.shouldRemoveValue&&this.removeValue(this._value[0]),n.shouldResetInput){this.resetComboboxInput(!1);return}this._addValueText=n.addValueText,this._userInfoMessage=n.userInfoMessage}}class Nh extends Th{constructor(){super(...arguments),this.handleBodyClick=e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.closeAndProcessInput()}}connectedCallback(){var e,t;if(super.connectedCallback(),document==null||document.body.addEventListener("click",this.handleBodyClick),this._options=[],this.defaultOptions&&this.defaultOptions.length){const n=((e=this.options)==null?void 0:e.filter(i=>i.userAdded))||[];this.options=[...n,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((t=this.optionsController)!=null&&t.nodes&&this.optionsController.nodes.length){const n=Po.parseOptionsFromSlot(this.optionsController.nodes);n.length&&(this.options=[...n],this._options=[...n],this._optionsFromSlot=!0,this._lastSlotGeneration=this.optionsController.generation)}}willUpdate(e){if(this._optionsFromSlot&&this.optionsController){const t=this.optionsController.generation;if(t!==this._lastSlotGeneration){this._lastSlotGeneration=t;const n=Po.parseOptionsFromSlot(this.optionsController.nodes),i=this._options.filter(r=>r.userAdded);this.options=[...i,...n]}}super.willUpdate(e)}disconnectedCallback(){super.disconnectedCallback(),document==null||document.body.removeEventListener("click",this.handleBodyClick)}firstUpdated(e){this.defaultValue!==null&&!this.value&&(this.value=this.defaultValue),super.firstUpdated(e)}updated(e){e.has("isOpen")&&(this._isOptionsOpen=this.isOpen);const t=e.has("value"),n=e.has("_value");if(t&&this._internalValueSync)this._internalValueSync=!1,n&&this.syncValueAndDispatch(e.get("_value"));else if(t){const i=[...this._value],r=this.parseValue();r.join(",")!==this._value.join(",")&&(this._value=r),this.updateMaxReached(),this.syncValueAndDispatch(i)}else n&&this.syncValueAndDispatch(e.get("_value"));if(e.has("defaultOptions")&&this.defaultOptions.length){const i=(Array.isArray(this.options)?this.options:[]).filter(r=>r.userAdded)||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const i=e.get("options")||this._options||[],r=Pr.mergeWithUserAdded(this.options,i);this._options=r,r.length>this.options.length&&(this.options=r);const a=Pr.syncOptionsWithValues(this._options,this._value);if(this._options=a.options,a.newValues.length>this._value.length){const l=[...this._value];this._value=a.newValues,this.syncValueAndDispatch(l)}}if(e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),!this._isOptionsOpen&&!this.multiple&&this._hasTextInput&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const i=this._value[0]?Ui(this._value[0],this.options,this.displayValueAs):"";this.inputRef.value.value!==i&&(this.inputRef.value.value=i)}super.updated(e)}formResetCallback(){this.touched=!1;const e=this.defaultValue||(this.multiple,"");this.value=e,this._value=this.parseValue(),this._options=this._options.filter(t=>!t.userAdded).map(t=>({...t,selected:this._value.includes(t.value)})),this.options=this.options.filter(t=>!t.userAdded).map(t=>({...t,selected:this._value.includes(t.value)})),this._search="",this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._inputFocus=!1,this.updateMaxReached(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value=""),this.internals.setFormValue(""),this.internals.ariaInvalid="false",this.requestUpdate()}attributeChangedCallback(e,t,n){if(e==="options"){this._options=Array.isArray(this.options)?[...this.options]:[];const i=Pr.syncOptionsWithValues(this._options,this._value);this._options=i.options,i.newValues.length>this._value.length&&(this._value=i.newValues),this._search=""}super.attributeChangedCallback(e,t,n)}render(){return y`
634
634
  <pkt-input-wrapper
635
635
  .label=${this.label}
636
636
  .helptext=${this.helptext}
@@ -652,7 +652,7 @@
652
652
  class="pkt-combobox__wrapper"
653
653
  @labelClick=${this.handleInputClick}
654
654
  >
655
- <div class="pkt-contents" slot="helptext">${tt(this,"helptext")}</div>
655
+ <div class="pkt-contents" slot="helptext">${Re(this,"helptext")}</div>
656
656
  <div class="pkt-combobox" @focusout=${this.handleFocusOut}>
657
657
  <div
658
658
  class=${Z({"pkt-combobox__input":!0,"pkt-combobox__input--fullwidth":this.fullwidth,"pkt-combobox__input--open":this._isOptionsOpen,"pkt-combobox__input--error":this.hasError,"pkt-combobox__input--disabled":this.disabled})}
@@ -662,12 +662,12 @@
662
662
  aria-controls=${B(this._hasTextInput?void 0:`${this.id}-listbox`)}
663
663
  aria-haspopup=${B(this._hasTextInput?void 0:"listbox")}
664
664
  aria-labelledby=${B(this._hasTextInput?void 0:`${this.id}-combobox-label`)}
665
- aria-activedescendant=${B(!this._hasTextInput&&this._value[0]&&us(this.options,this._value[0])?`${this.id}-listbox-${Eo(this._options,this._value[0])}`:void 0)}
665
+ aria-activedescendant=${B(!this._hasTextInput&&this._value[0]&&os(this.options,this._value[0])?`${this.id}-listbox-${Do(this._options,this._value[0])}`:void 0)}
666
666
  aria-description=${B(this._selectionDescription||void 0)}
667
667
  tabindex=${this._hasTextInput||this.disabled?"-1":"0"}
668
668
  @click=${this.handleInputClick}
669
669
  @keydown=${this._hasTextInput?x:this.handleSelectOnlyKeydown}
670
- ${Ne(this.triggerRef)}
670
+ ${De(this.triggerRef)}
671
671
  >
672
672
  ${!this._hasTextInput&&this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?y`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
673
673
  >${this.placeholder}</span
@@ -699,7 +699,7 @@
699
699
  @tab-close=${()=>this.closeAndProcessInput()}
700
700
  .searchValue=${this._search||null}
701
701
  .maxLength=${this.maxlength||0}
702
- ${Ne(this.listboxRef)}
702
+ ${De(this.listboxRef)}
703
703
  ></pkt-listbox>
704
704
  </div>
705
705
 
@@ -725,9 +725,9 @@
725
725
  aria-label=${B(this.label)}
726
726
  aria-autocomplete=${this.typeahead?"both":this.allowUserInput?"list":"none"}
727
727
  aria-controls="${this.id}-listbox"
728
- aria-activedescendant=${B(this._value[0]&&us(this.options,this._value[0])?`${this.id}-listbox-${Eo(this._options,this._value[0])}`:void 0)}
728
+ aria-activedescendant=${B(this._value[0]&&os(this.options,this._value[0])?`${this.id}-listbox-${Do(this._options,this._value[0])}`:void 0)}
729
729
  aria-description=${B(this._selectionDescription||void 0)}
730
- ${Ne(this.inputRef)}
730
+ ${De(this.inputRef)}
731
731
  />
732
732
  </div>
733
733
  `:y`
@@ -736,11 +736,11 @@
736
736
  id="${this.id}-input"
737
737
  name=${(this.name||this.id)+"-input"}
738
738
  .value=${this._value.join(",")}
739
- ${Ne(this.inputRef)}
739
+ ${De(this.inputRef)}
740
740
  />
741
- `}renderSingleOrMultipleValues(){if(!this.multiple&&this._hasTextInput)return x;const e=!this.multiple,t=this.renderValueTag(us(this.options,this._value[0])),n=this.tagPlacement==="outside",i=y`
741
+ `}renderSingleOrMultipleValues(){if(!this.multiple&&this._hasTextInput)return x;const e=!this.multiple,t=this.renderValueTag(os(this.options,this._value[0])),n=this.tagPlacement==="outside",i=y`
742
742
  <ul role="list" class="pkt-combobox__tag-list">
743
- ${Ir(this._value,r=>r,(r,a)=>{const l=us(this.options,r),c=l==null?void 0:l.tagSkinColor;return y`
743
+ ${Or(this._value,r=>r,(r,a)=>{const l=os(this.options,r),c=l==null?void 0:l.tagSkinColor;return y`
744
744
  <li
745
745
  role="listitem"
746
746
  @click=${n?x:h=>h.stopPropagation()}
@@ -764,7 +764,7 @@
764
764
  >${e.value}</span
765
765
  >`;case"label":default:return y`<span class="pkt-combobox__value" data-focusfix=${this.id}
766
766
  >${e.label||e.value}</span
767
- >`}}};Vo=Wh([Se("pkt-combobox")],Vo);const zh={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var Kh=Object.defineProperty,Yh=Object.getOwnPropertyDescriptor,ds=(s,e,t,n)=>{for(var i=n>1?void 0:n?Yh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Kh(e,t,i),i};let Vr=null;function Gh(){return Vr||(Vr=new Promise((s,e)=>{if(document.querySelector("#oslo-consent-script")){s();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>s(),t.onerror=e,document.head.appendChild(t);const n=document.createElement("link");n.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",n.type="text/css",n.rel="stylesheet",n.id="oslo-consent-styles",document.head.appendChild(n)}),Vr)}let Jt=class extends Gt{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||zh.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const t=this.returnJsonOrObject(e.value).items.reduce((n,i)=>(n[i.name]=i.consent,n),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:t,bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await Gh(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const t={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(t),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=n=>{this.emitCookieConsents(n)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?y`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?y`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
767
+ >`}}}try{Se("pkt-combobox")(Nh)}catch{console.warn("Forsøker å definere <pkt-combobox>, men den er allerede definert")}const Dh={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var Mh=Object.defineProperty,bs=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Mh(e,t,i),i};let Lr=null;function Eh(){return Lr||(Lr=new Promise((s,e)=>{if(document.querySelector("#oslo-consent-script")){s();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>s(),t.onerror=e,document.head.appendChild(t);const n=document.createElement("link");n.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",n.type="text/css",n.rel="stylesheet",n.id="oslo-consent-styles",document.head.appendChild(n)}),Lr)}let ss=class extends Kt{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||Dh.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const t=this.returnJsonOrObject(e.value).items.reduce((n,i)=>(n[i.name]=i.consent,n),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:t,bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await Eh(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const t={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(t),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=n=>{this.emitCookieConsents(n)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?y`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?y`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
768
768
  <pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
769
769
  ${this.triggerText}
770
770
  </a>`:this.triggerType==="icon"?y`<pkt-button
@@ -774,7 +774,7 @@
774
774
  @click=${this.openModal}
775
775
  >
776
776
  >${this.triggerText}</pkt-button
777
- >`:y`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ds([u({type:Boolean})],Jt.prototype,"devMode",2),ds([u({type:String})],Jt.prototype,"hotjarId",2),ds([u({type:String})],Jt.prototype,"googleAnalyticsId",2),ds([u({type:String})],Jt.prototype,"cookieDomain",2),ds([u({type:String})],Jt.prototype,"cookieSecure",2),ds([u({type:String})],Jt.prototype,"cookieExpiryDays",2),ds([u({type:String})],Jt.prototype,"triggerType",2),ds([u({type:String})],Jt.prototype,"triggerText",2),ds([u({type:String})],Jt.prototype,"i18nLanguage",2),Jt=ds([Se("pkt-consent")],Jt);var Xh=Object.defineProperty,Qh=Object.getOwnPropertyDescriptor,Mt=(s,e,t,n)=>{for(var i=n>1?void 0:n?Qh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Xh(e,t,i),i};let Tt=class extends he{constructor(){super(...arguments),this.inputRef=De(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,t,n)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=Z({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=Z({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),n=Z({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),i="pkt-tag pkt-tag--small pkt-tag--thin-text",r=()=>y`
777
+ >`:y`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};bs([u({type:Boolean})],ss.prototype,"devMode"),bs([u({type:String})],ss.prototype,"hotjarId"),bs([u({type:String})],ss.prototype,"googleAnalyticsId"),bs([u({type:String})],ss.prototype,"cookieDomain"),bs([u({type:String})],ss.prototype,"cookieSecure"),bs([u({type:String})],ss.prototype,"cookieExpiryDays"),bs([u({type:String})],ss.prototype,"triggerType"),bs([u({type:String})],ss.prototype,"triggerText"),bs([u({type:String})],ss.prototype,"i18nLanguage");try{Se("pkt-consent")(ss)}catch{console.warn("Forsøker å definere <pkt-consent>, men den er allerede definert")}var Oh=Object.defineProperty,Ot=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Oh(e,t,i),i};let Nt=class extends he{constructor(){super(...arguments),this.inputRef=Ne(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,t,n)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=Z({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=Z({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),n=Z({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),i="pkt-tag pkt-tag--small pkt-tag--thin-text",r=()=>y`
778
778
  ${this.tagText?y`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:x}
779
779
  ${this.optionalTag?y`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:x}
780
780
  ${this.requiredTag?y`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:x}
@@ -793,7 +793,7 @@
793
793
  type="checkbox"
794
794
  ?disabled=${this.disabled}
795
795
  name=${this.name+"-internal"}
796
- ${Ne(this.inputRef)}
796
+ ${De(this.inputRef)}
797
797
  @change=${this.handleChange}
798
798
  @click=${this.handleClick}
799
799
  @blur=${this.onBlur}
@@ -804,27 +804,27 @@
804
804
  ${this.labelPosition==="right"?a():x}
805
805
  </div>
806
806
  </div>
807
- `}handleClick(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1}handleChange(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1;this.toggleChecked(e)}toggleChecked(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}const t=e.target;if(t&&t.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};Mt([u({type:String,reflect:!0})],Tt.prototype,"value",2),Mt([u({type:String})],Tt.prototype,"checkHelptext",2),Mt([u({type:Boolean})],Tt.prototype,"defaultChecked",2),Mt([u({type:Boolean})],Tt.prototype,"hasTile",2),Mt([u({type:Boolean})],Tt.prototype,"isSwitch",2),Mt([u({type:String})],Tt.prototype,"labelPosition",2),Mt([u({type:Boolean})],Tt.prototype,"hideLabel",2),Mt([u({type:Boolean,reflect:!0})],Tt.prototype,"checked",2),Mt([u({type:Boolean,reflect:!0})],Tt.prototype,"indeterminate",2),Mt([u({type:String,reflect:!0})],Tt.prototype,"type",2),Mt([u({type:String})],Tt.prototype,"tagText",2),Mt([u({type:Boolean})],Tt.prototype,"optionalTag",2),Mt([u({type:String})],Tt.prototype,"optionalText",2),Mt([u({type:Boolean})],Tt.prototype,"requiredTag",2),Mt([u({type:String})],Tt.prototype,"requiredText",2),Tt=Mt([Se("pkt-checkbox")],Tt);const Ho={calendar:{buttonAltText:"Åpne kalender"}},Zh={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var Jh=Object.defineProperty,Rh=Object.getOwnPropertyDescriptor,li=(s,e,t,n)=>{for(var i=n>1?void 0:n?Rh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Jh(e,t,i),i};let Cn=class extends Gt{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=As()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},y`
807
+ `}handleClick(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1}handleChange(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1;this.toggleChecked(e)}toggleChecked(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}const t=e.target;if(t&&t.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};Ot([u({type:String,reflect:!0})],Nt.prototype,"value"),Ot([u({type:String})],Nt.prototype,"checkHelptext"),Ot([u({type:Boolean})],Nt.prototype,"defaultChecked"),Ot([u({type:Boolean})],Nt.prototype,"hasTile"),Ot([u({type:Boolean})],Nt.prototype,"isSwitch"),Ot([u({type:String})],Nt.prototype,"labelPosition"),Ot([u({type:Boolean})],Nt.prototype,"hideLabel"),Ot([u({type:Boolean,reflect:!0})],Nt.prototype,"checked"),Ot([u({type:Boolean,reflect:!0})],Nt.prototype,"indeterminate"),Ot([u({type:String,reflect:!0})],Nt.prototype,"type"),Ot([u({type:String})],Nt.prototype,"tagText"),Ot([u({type:Boolean})],Nt.prototype,"optionalTag"),Ot([u({type:String})],Nt.prototype,"optionalText"),Ot([u({type:Boolean})],Nt.prototype,"requiredTag"),Ot([u({type:String})],Nt.prototype,"requiredText");try{Se("pkt-checkbox")(Nt)}catch{console.warn("Forsøker å definere <pkt-checkbox>, men den er allerede definert")}const Lo={calendar:{buttonAltText:"Åpne kalender"}},Ah={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var Ih=Object.defineProperty,qi=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Ih(e,t,i),i};let Rn=class extends Kt{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=Ms()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},y`
808
808
  <div class=${Z(this.classes)} aria-live="polite">
809
- ${Array.isArray(this.dates)&&this.dates[0]?Ir(Co((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return y` <pkt-tag
809
+ ${Array.isArray(this.dates)&&this.dates[0]?Or($o((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return y` <pkt-tag
810
810
  id=${this.idBase+e+"-tag"}
811
811
  closeTag
812
812
  @close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:e}))}}
813
- .ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${wo(e,this.dateformat)}`}
813
+ .ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${yo(e,this.dateformat)}`}
814
814
  >
815
- <time datetime=${e}>${wo(e,this.dateformat)}</time>
815
+ <time datetime=${e}>${yo(e,this.dateformat)}</time>
816
816
  </pkt-tag>`}):x}
817
817
  </div>
818
- `}};li([u({type:Array})],Cn.prototype,"dates",2),li([u({type:String})],Cn.prototype,"dateformat",2),li([u({type:String,attribute:"class"})],Cn.prototype,"className",2),li([u({type:String,attribute:"id-base"})],Cn.prototype,"idBase",2),Cn=li([Se("pkt-date-tags")],Cn);const ep={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},ci={props:ep},Rs=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},tp=()=>Rs()?"text":"date",sp=s=>!s||s.length!==2?!0:Ud(s[0],s[1]),np=s=>Co(s),ip=(s,e,t,n,i)=>Hd(s,e,t,n,i),rp=(s,e,t,n,i,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":n,"ios-readonly-hack":i===!1&&r==="text"}),ap=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),op=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),lp=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,cp=(s,e,t=!1)=>{var n;if(!s||!e)return;const i=((n=e.parentElement)==null?void 0:n.getBoundingClientRect())||e.getBoundingClientRect(),r=t?i.height+30:i.height,a=s.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";i&&i.top+a>window.innerHeight&&i.top-a>0&&(l=`calc(100% - ${r}px - ${a}px)`),s.style.top=l},up=(s,e,t,n,i,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):i&&i()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():n?n():i&&i())},dp=(s,e)=>{const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))},Uo={validateRangeOrder:sp,sortDates:np,filterSelectableDates:ip},hp={getInputType:tp},ui={submitForm(s){var e;const t=(e=s.internals)==null?void 0:e.form;t&&t.requestSubmit()},submitFormOrFallback(s,e){const t=s==null?void 0:s.form;t?t.requestSubmit():e()},validateDateInput(s,e,t,n,i){var r,a,l,c;const h=s.value;h&&(t&&t>h?e.setValidity({rangeUnderflow:!0},((a=(r=i==null?void 0:i.forms)==null?void 0:r.messages)==null?void 0:a.rangeUnderflow)||"Value is below minimum",s):n&&n<h&&e.setValidity({rangeOverflow:!0},((c=(l=i==null?void 0:i.forms)==null?void 0:l.messages)==null?void 0:c.rangeOverflow)||"Value is above maximum",s))}},Yi={addToSelected(s,e,t,n){const i=s.target;if(!i.value)return;const r=t?Qt(t):null,a=n?Qt(n):null,l=Qt(i.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&e.value&&e.value.handleDateSelect(l),i.value=""},handleCalendarPosition(s,e,t=!1){cp(s.value??null,e.value??null,t)}},Hr={getInputClasses:rp,getButtonClasses:ap,getRangeLabelClasses:op},Ur={processDateSelection:lp,updateInputValues(s,e,t,n,i,r){s.value&&(n&&e!=null&&e.value?(s.value.value=t[0]??"",e.value.value=t[1]??"",r(s.value),r(e.value)):i||(s.value.value=t.length?t[0]:"",r(s.value)))},processRangeBlur(s,e,t,n,i){var r;const a=s.target;if(a.value){i(a);const l=Es(a.value);l&&((r=t==null?void 0:t.value)==null||r.handleDateSelect(l))}else e[0]&&n()}},Gi={handleInputKeydown:up,handleButtonKeydown:dp};var pp=Object.defineProperty,fp=Object.getOwnPropertyDescriptor,At=(s,e,t,n)=>{for(var i=n>1?void 0:n?fp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&pp(e,t,i),i};let Ot=class extends Gt{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this._hasBeenOpened=!1,this.popupRef=De(),this.calendarRef=De(),this.handleDocumentClick=e=>{if(!this.open)return;const t=e.composedPath(),n=this.parentElement,i=this.popupRef.value;!t.includes(this)&&!t.includes(i)&&!(n&&t.includes(n))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=e=>{this.open&&e.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef}updated(e){super.updated(e),e.has("open")&&(this.open?(this._hasBeenOpened=!0,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)):(document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var e;this.open=!0,(e=this.calendarRef.value)==null||e.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(e){var t;return!!e&&!!((t=this.popupRef.value)!=null&&t.contains(e))}focusOnCurrentDate(){const e=this.calendarRef.value;e&&typeof e.focusOnCurrentDate=="function"&&e.focusOnCurrentDate()}addToSelected(e,t,n){if(this.calendarRef.value&&typeof Yi.addToSelected=="function")return Yi.addToSelected(e,this.calendarRef,t,n);const i=e.target;if(!i.value)return;const r=t?Qt(t):null,a=n?Qt(n):null,l=Qt(i.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&this.handleDateSelect(l),i.value=""}handleDateSelect(e){const t=this.calendarRef.value;if(t&&typeof t.handleDateSelect=="function")return t.handleDateSelect(e);const n=gt(e),i=this.selected.indexOf(n)>=0?this.selected.filter(r=>r!==n):[...this.selected,n];this.selected=i,this.dispatchEvent(new CustomEvent("date-selected",{detail:i,bubbles:!0,composed:!0}))}render(){const e={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return y`
818
+ `}};qi([u({type:Array})],Rn.prototype,"dates"),qi([u({type:String})],Rn.prototype,"dateformat"),qi([u({type:String,attribute:"class"})],Rn.prototype,"className"),qi([u({type:String,attribute:"id-base"})],Rn.prototype,"idBase");try{Se("pkt-date-tags")(Rn)}catch{console.warn("Forsøker å definere <pkt-date-tags>, men den er allerede definert")}const Ph={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},ei={props:Ph},Gs=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},Lh=()=>Gs()?"text":"date",Fh=s=>!s||s.length!==2?!0:Od(s[0],s[1]),Bh=s=>$o(s),Vh=(s,e,t,n,i)=>Ed(s,e,t,n,i),Hh=(s,e,t,n,i,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":n,"ios-readonly-hack":i===!1&&r==="text"}),Uh=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),qh=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),Wh=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,jh=(s,e,t=!1)=>{var n;if(!s||!e)return;const i=((n=e.parentElement)==null?void 0:n.getBoundingClientRect())||e.getBoundingClientRect(),r=t?i.height+30:i.height,a=s.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";i&&i.top+a>window.innerHeight&&i.top-a>0&&(l=`calc(100% - ${r}px - ${a}px)`),s.style.top=l},zh=(s,e,t,n,i,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):i&&i()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():n?n():i&&i())},Kh=(s,e)=>{const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))},Fo={validateRangeOrder:Fh,sortDates:Bh,filterSelectableDates:Vh},Yh={getInputType:Lh},ti={submitForm(s){var e;const t=(e=s.internals)==null?void 0:e.form;t&&t.requestSubmit()},submitFormOrFallback(s,e){const t=s==null?void 0:s.form;t?t.requestSubmit():e()},validateDateInput(s,e,t,n,i){var r,a,l,c;const h=s.value;h&&(t&&t>h?e.setValidity({rangeUnderflow:!0},((a=(r=i==null?void 0:i.forms)==null?void 0:r.messages)==null?void 0:a.rangeUnderflow)||"Value is below minimum",s):n&&n<h&&e.setValidity({rangeOverflow:!0},((c=(l=i==null?void 0:i.forms)==null?void 0:l.messages)==null?void 0:c.rangeOverflow)||"Value is above maximum",s))}},Wi={addToSelected(s,e,t,n){const i=s.target;if(!i.value)return;const r=t?Gt(t):null,a=n?Gt(n):null,l=Gt(i.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&e.value&&e.value.handleDateSelect(l),i.value=""},handleCalendarPosition(s,e,t=!1){jh(s.value??null,e.value??null,t)}},Fr={getInputClasses:Hh,getButtonClasses:Uh,getRangeLabelClasses:qh},Br={processDateSelection:Wh,updateInputValues(s,e,t,n,i,r){s.value&&(n&&e!=null&&e.value?(s.value.value=t[0]??"",e.value.value=t[1]??"",r(s.value),r(e.value)):i||(s.value.value=t.length?t[0]:"",r(s.value)))},processRangeBlur(s,e,t,n,i){var r;const a=s.target;if(a.value){i(a);const l=Ds(a.value);l&&((r=t==null?void 0:t.value)==null||r.handleDateSelect(l))}else e[0]&&n()}},ji={handleInputKeydown:zh,handleButtonKeydown:Kh};var Gh=Object.defineProperty,Pt=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Gh(e,t,i),i};let At=class extends Kt{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this._hasBeenOpened=!1,this.popupRef=Ne(),this.calendarRef=Ne(),this.handleDocumentClick=e=>{if(!this.open)return;const t=e.composedPath(),n=this.parentElement,i=this.popupRef.value;!t.includes(this)&&!t.includes(i)&&!(n&&t.includes(n))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=e=>{this.open&&e.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef}updated(e){super.updated(e),e.has("open")&&(this.open?(this._hasBeenOpened=!0,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)):(document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var e;this.open=!0,(e=this.calendarRef.value)==null||e.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(e){var t;return!!e&&!!((t=this.popupRef.value)!=null&&t.contains(e))}focusOnCurrentDate(){const e=this.calendarRef.value;e&&typeof e.focusOnCurrentDate=="function"&&e.focusOnCurrentDate()}addToSelected(e,t,n){if(this.calendarRef.value&&typeof Wi.addToSelected=="function")return Wi.addToSelected(e,this.calendarRef,t,n);const i=e.target;if(!i.value)return;const r=t?Gt(t):null,a=n?Gt(n):null,l=Gt(i.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&this.handleDateSelect(l),i.value=""}handleDateSelect(e){const t=this.calendarRef.value;if(t&&typeof t.handleDateSelect=="function")return t.handleDateSelect(e);const n=pt(e),i=this.selected.indexOf(n)>=0?this.selected.filter(r=>r!==n):[...this.selected,n];this.selected=i,this.dispatchEvent(new CustomEvent("date-selected",{detail:i,bubbles:!0,composed:!0}))}render(){const e={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return y`
819
819
  <div
820
820
  class="${Z(e)}"
821
- ${Ne(this.popupRef)}
821
+ ${De(this.popupRef)}
822
822
  id="date-popup"
823
823
  ?hidden=${!this.open}
824
824
  aria-hidden="${!this.open}"
825
825
  >
826
826
  ${this.open||this._hasBeenOpened?y`<pkt-calendar
827
- ${Ne(this.calendarRef)}
827
+ ${De(this.calendarRef)}
828
828
  ?multiple=${this.multiple}
829
829
  ?range=${this.range}
830
830
  ?weeknumbers=${this.weeknumbers}
@@ -841,9 +841,9 @@
841
841
  @close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
842
842
  ></pkt-calendar>`:x}
843
843
  </div>
844
- `}};At([u({type:Boolean,reflect:!0})],Ot.prototype,"open",2),At([u({type:Boolean})],Ot.prototype,"multiple",2),At([u({type:Boolean})],Ot.prototype,"range",2),At([u({type:Boolean})],Ot.prototype,"weeknumbers",2),At([u({type:Boolean})],Ot.prototype,"withcontrols",2),At([u({type:Number})],Ot.prototype,"maxMultiple",2),At([u({type:Array})],Ot.prototype,"selected",2),At([u({type:String})],Ot.prototype,"earliest",2),At([u({type:String})],Ot.prototype,"latest",2),At([u({type:Array})],Ot.prototype,"excludedates",2),At([u({type:Array})],Ot.prototype,"excludeweekdays",2),At([u({type:String})],Ot.prototype,"currentmonth",2),At([u({type:String})],Ot.prototype,"today",2),At([_e()],Ot.prototype,"_hasBeenOpened",2),Ot=At([Se("pkt-datepicker-popup")],Ot);var mp=Object.defineProperty,ys=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&mp(e,t,i),i};let Rt=class extends Gt{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=De(),this.btnRef=De()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}renderCalendarButton(){var e;return y`
844
+ `}};Pt([u({type:Boolean,reflect:!0})],At.prototype,"open"),Pt([u({type:Boolean})],At.prototype,"multiple"),Pt([u({type:Boolean})],At.prototype,"range"),Pt([u({type:Boolean})],At.prototype,"weeknumbers"),Pt([u({type:Boolean})],At.prototype,"withcontrols"),Pt([u({type:Number})],At.prototype,"maxMultiple"),Pt([u({type:Array})],At.prototype,"selected"),Pt([u({type:String})],At.prototype,"earliest"),Pt([u({type:String})],At.prototype,"latest"),Pt([u({type:Array})],At.prototype,"excludedates"),Pt([u({type:Array})],At.prototype,"excludeweekdays"),Pt([u({type:String})],At.prototype,"currentmonth"),Pt([u({type:String})],At.prototype,"today"),Pt([_e()],At.prototype,"_hasBeenOpened");try{Se("pkt-datepicker-popup")(At)}catch{console.warn("Forsøker å definere <pkt-datepicker-popup>, men den er allerede definert")}var Xh=Object.defineProperty,ks=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Xh(e,t,i),i};let Xt=class extends Kt{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=Ne(),this.btnRef=Ne()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(e){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:e,bubbles:!0,composed:!0}))}dispatchInput(e){this.dispatchEvent(new CustomEvent("input-change",{detail:e,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(e){this.dispatchEvent(new CustomEvent("input-blur",{detail:e,bubbles:!0,composed:!0}))}dispatchChange(e){this.dispatchEvent(new CustomEvent("input-changed",{detail:e,bubbles:!0,composed:!0}))}renderCalendarButton(){var e;return y`
845
845
  <button
846
- class="${Z(Hr.getButtonClasses())}"
846
+ class="${Z(Fr.getButtonClasses())}"
847
847
  type="button"
848
848
  @click=${t=>this.dispatchToggleCalendar(t)}
849
849
  @keydown=${t=>{const{key:n}=t;(n==="Enter"||n===" "||n==="Space")&&(t.preventDefault(),this.dispatchToggleCalendar(t))}}
@@ -853,7 +853,7 @@
853
853
  <pkt-icon name="calendar"></pkt-icon>
854
854
  <span class="pkt-btn__text">${((e=this.strings.calendar)==null?void 0:e.buttonAltText)||"Åpne kalender"}</span>
855
855
  </button>
856
- `}createRenderRoot(){return this}};ys([u({type:String})],Rt.prototype,"inputType"),ys([u({type:String})],Rt.prototype,"id"),ys([u({type:String})],Rt.prototype,"min"),ys([u({type:String})],Rt.prototype,"max"),ys([u({type:String})],Rt.prototype,"placeholder"),ys([u({type:Boolean})],Rt.prototype,"readonly"),ys([u({type:Boolean})],Rt.prototype,"disabled"),ys([u({type:Object})],Rt.prototype,"inputClasses"),ys([u({type:Object})],Rt.prototype,"internals");var gp=Object.defineProperty,bp=Object.getOwnPropertyDescriptor,qr=(s,e,t,n)=>{for(var i=n>1?void 0:n?bp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&gp(e,t,i),i};let Xi=class extends Rt{constructor(){super(...arguments),this.value="",this.strings=Ho}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return y`
856
+ `}createRenderRoot(){return this}};ks([u({type:String})],Xt.prototype,"inputType"),ks([u({type:String})],Xt.prototype,"id"),ks([u({type:String})],Xt.prototype,"min"),ks([u({type:String})],Xt.prototype,"max"),ks([u({type:String})],Xt.prototype,"placeholder"),ks([u({type:Boolean})],Xt.prototype,"readonly"),ks([u({type:Boolean})],Xt.prototype,"disabled"),ks([u({type:Object})],Xt.prototype,"inputClasses"),ks([u({type:Object})],Xt.prototype,"internals");var Qh=Object.defineProperty,Bo=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Qh(e,t,i),i};class Vr extends Xt{constructor(){super(...arguments),this.value="",this.strings=Lo}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return y`
857
857
  <div class="pkt-input__container">
858
858
  <input
859
859
  class="${Z(this.inputClasses)}"
@@ -868,16 +868,16 @@
868
868
  @click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
869
869
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
870
870
  ?disabled=${this.disabled}
871
- @keydown=${e=>Gi.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>ui.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()})}
871
+ @keydown=${e=>ji.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>ti.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()})}
872
872
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
873
- @focus=${()=>{this.dispatchFocus(),Rs()&&this.dispatchToggleCalendar(new Event("focus"))}}
873
+ @focus=${()=>{this.dispatchFocus(),Gs()&&this.dispatchToggleCalendar(new Event("focus"))}}
874
874
  @blur=${e=>{this.dispatchBlur(e),this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent("value-change",{detail:e.target.value,bubbles:!0,composed:!0}))}}
875
875
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
876
- ${Ne(this.inputRef)}
876
+ ${De(this.inputRef)}
877
877
  />
878
878
  ${this.renderCalendarButton()}
879
879
  </div>
880
- `}};qr([u({type:String})],Xi.prototype,"value",2),qr([u({type:Object})],Xi.prototype,"strings",2),Xi=qr([Se("pkt-datepicker-single")],Xi);var vp=Object.defineProperty,kp=Object.getOwnPropertyDescriptor,di=(s,e,t,n)=>{for(var i=n>1?void 0:n?kp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&vp(e,t,i),i};let Tn=class extends Rt{constructor(){super(...arguments),this.value=[],this.label="",this.showRangeLabels=!1,this.strings=Zh,this.inputRefTo=De()}get inputElementTo(){return this.inputRefTo.value}render(){var e,t,n,i;const r=Hr.getRangeLabelClasses(this.showRangeLabels);return y`
880
+ `}}Bo([u({type:String})],Vr.prototype,"value"),Bo([u({type:Object})],Vr.prototype,"strings");try{Se("pkt-datepicker-single")(Vr)}catch{console.warn("Forsøker å definere <pkt-datepicker-single>, men den er allerede definert")}var Zh=Object.defineProperty,zi=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Zh(e,t,i),i};let si=class extends Xt{constructor(){super(...arguments),this.value=[],this.label="",this.showRangeLabels=!1,this.strings=Ah,this.inputRefTo=Ne()}get inputElementTo(){return this.inputRefTo.value}render(){var e,t,n,i;const r=Fr.getRangeLabelClasses(this.showRangeLabels);return y`
881
881
  <div class="pkt-input__container">
882
882
  ${this.showRangeLabels?y` <div class="pkt-input-prefix">${(e=this.strings.generic)==null?void 0:e.from}</div> `:x}
883
883
  <input
@@ -893,12 +893,12 @@
893
893
  ?disabled=${this.disabled}
894
894
  @click=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
895
895
  @touchend=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
896
- @keydown=${a=>Gi.handleInputKeydown(a,l=>this.dispatchToggleCalendar(l),()=>ui.submitFormOrFallback(this.internals,()=>{var l;return(l=this.inputRefTo.value)==null?void 0:l.focus()}),()=>{var l;return(l=this.inputRefTo.value)==null?void 0:l.focus()},()=>{var l;return(l=this.inputRef.value)==null?void 0:l.blur()})}
896
+ @keydown=${a=>ji.handleInputKeydown(a,l=>this.dispatchToggleCalendar(l),()=>ti.submitFormOrFallback(this.internals,()=>{var l;return(l=this.inputRefTo.value)==null?void 0:l.focus()}),()=>{var l;return(l=this.inputRefTo.value)==null?void 0:l.focus()},()=>{var l;return(l=this.inputRef.value)==null?void 0:l.blur()})}
897
897
  @input=${a=>{this.dispatchInput(a),a.stopImmediatePropagation()}}
898
- @focus=${()=>{this.dispatchFocus(),Rs()&&this.dispatchToggleCalendar(new Event("focus"))}}
898
+ @focus=${()=>{this.dispatchFocus(),Gs()&&this.dispatchToggleCalendar(new Event("focus"))}}
899
899
  @blur=${a=>{this.dispatchBlur(a),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:a,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
900
900
  @change=${a=>{this.dispatchChange(a),a.stopImmediatePropagation()}}
901
- ${Ne(this.inputRef)}
901
+ ${De(this.inputRef)}
902
902
  />
903
903
  <div class="${Z(r)}" id="${this.id}-to-label">
904
904
  ${(n=this.strings.generic)==null?void 0:n.to}
@@ -917,16 +917,16 @@
917
917
  ?disabled=${this.disabled}
918
918
  @click=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
919
919
  @touchend=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
920
- @keydown=${a=>Gi.handleInputKeydown(a,l=>this.dispatchToggleCalendar(l),()=>ui.submitFormOrFallback(this.internals,()=>{var l;return(l=this.inputRefTo.value)==null?void 0:l.blur()}),void 0,()=>{var l;return(l=this.inputRefTo.value)==null?void 0:l.blur()})}
920
+ @keydown=${a=>ji.handleInputKeydown(a,l=>this.dispatchToggleCalendar(l),()=>ti.submitFormOrFallback(this.internals,()=>{var l;return(l=this.inputRefTo.value)==null?void 0:l.blur()}),void 0,()=>{var l;return(l=this.inputRefTo.value)==null?void 0:l.blur()})}
921
921
  @input=${a=>{this.dispatchInput(a),a.stopImmediatePropagation()}}
922
- @focus=${()=>{this.dispatchFocus(),Rs()&&this.dispatchToggleCalendar(new Event("focus"))}}
922
+ @focus=${()=>{this.dispatchFocus(),Gs()&&this.dispatchToggleCalendar(new Event("focus"))}}
923
923
  @blur=${a=>{this.dispatchBlur(a),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:a,values:this.value,inputType:"to"},bubbles:!0,composed:!0}))}}
924
924
  @change=${a=>{this.dispatchChange(a),a.stopImmediatePropagation()}}
925
- ${Ne(this.inputRefTo)}
925
+ ${De(this.inputRefTo)}
926
926
  />
927
927
  ${this.renderCalendarButton()}
928
928
  </div>
929
- `}};di([u({type:Array})],Tn.prototype,"value",2),di([u({type:String})],Tn.prototype,"label",2),di([u({type:Boolean})],Tn.prototype,"showRangeLabels",2),di([u({type:Object})],Tn.prototype,"strings",2),Tn=di([Se("pkt-datepicker-range")],Tn);var yp=Object.defineProperty,_p=Object.getOwnPropertyDescriptor,Qi=(s,e,t,n)=>{for(var i=n>1?void 0:n?_p(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&yp(e,t,i),i};let hi=class extends Rt{constructor(){super(...arguments),this.value=[],this.strings=Ho}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}render(){return y`
929
+ `}};zi([u({type:Array})],si.prototype,"value"),zi([u({type:String})],si.prototype,"label"),zi([u({type:Boolean})],si.prototype,"showRangeLabels"),zi([u({type:Object})],si.prototype,"strings");try{Se("pkt-datepicker-range")(si)}catch{console.warn("Forsøker å definere <pkt-datepicker-range>, men den er allerede definert")}var Jh=Object.defineProperty,Hr=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Jh(e,t,i),i};let Ki=class extends Xt{constructor(){super(...arguments),this.value=[],this.strings=Lo}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(e){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:e,bubbles:!0,composed:!0}))}render(){return y`
930
930
  <div class="pkt-input__container">
931
931
  <input
932
932
  class=${Z(this.inputClasses)}
@@ -941,14 +941,14 @@
941
941
  @touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
942
942
  @blur=${e=>{this.dispatchBlur(e),this.dispatchAddToSelected(e)}}
943
943
  @input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
944
- @focus=${()=>{this.dispatchFocus(),Rs()&&this.dispatchToggleCalendar(new Event("focus"))}}
945
- @keydown=${e=>Gi.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>ui.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,void 0,t=>this.dispatchAddToSelected(t))}
944
+ @focus=${()=>{this.dispatchFocus(),Gs()&&this.dispatchToggleCalendar(new Event("focus"))}}
945
+ @keydown=${e=>ji.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>ti.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,void 0,t=>this.dispatchAddToSelected(t))}
946
946
  @change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
947
- ${Ne(this.inputRef)}
947
+ ${De(this.inputRef)}
948
948
  />
949
949
  ${this.renderCalendarButton()}
950
950
  </div>
951
- `}};Qi([u({type:Array})],hi.prototype,"value",2),Qi([u({type:Number})],hi.prototype,"maxlength",2),Qi([u({type:Object})],hi.prototype,"strings",2),hi=Qi([Se("pkt-datepicker-multiple")],hi);var $p=Object.defineProperty,wp=Object.getOwnPropertyDescriptor,bt=(s,e,t,n)=>{for(var i=n>1?void 0:n?wp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&$p(e,t,i),i};let pt=class extends he{constructor(){super(...arguments),this._valueProperty="",this._valueProcessing=!1,this.datepickerPopupRef=De(),this._value=[],this.label="Datovelger",this.dateformat=ci.props.dateformat.default,this.multiple=ci.props.multiple.default,this.maxlength=null,this.range=ci.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=ci.props.weeknumbers.default,this.withcontrols=ci.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=De(),this.popupRef=De(),this.singleInputRef=De(),this.rangeInputRef=De(),this.multipleInputRef=De(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):Yi.addToSelected(e,this.calRef,this.min,this.max)}}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return hp.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(!(this._valueProcessing||e===t)){this._valueProcessing=!0;try{const n=ii(e),i=this.multiple&&n.length>1?Uo.filterSelectableDates(n,this.min,this.max,this.excludedates,this.excludeweekdays):n;if(this.range&&!Uo.validateRangeOrder(i)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=i;const r=qd(i);if(this._valueProperty!==r&&(this._valueProperty=r),this.range&&i.length<2)return;super.valueChanged(r,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,n){e==="value"&&this.value!==t&&this.valueChanged(n,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=ii(n||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=ii(n||"")),super.attributeChangedCallback(e,t,n)}updated(e){if(e.has("value")&&(e.has("multiple")||e.has("range"))){const t=Array.isArray(this.value)?this.value.join(","):this.value,n=e.get("value"),i=Array.isArray(n)?n.join(","):n;this.valueChanged(t,i)}e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=ii(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,n;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(n=this.singleInputRef.value)==null?void 0:n.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,n;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(n=this.singleInputRef.value)==null?void 0:n.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return y`
951
+ `}};Hr([u({type:Array})],Ki.prototype,"value"),Hr([u({type:Number})],Ki.prototype,"maxlength"),Hr([u({type:Object})],Ki.prototype,"strings");try{Se("pkt-datepicker-multiple")(Ki)}catch{console.warn("Forsøker å definere <pkt-datepicker-multiple>, men den er allerede definert")}var Rh=Object.defineProperty,ep=Object.getOwnPropertyDescriptor,vt=(s,e,t,n)=>{for(var i=n>1?void 0:n?ep(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Rh(e,t,i),i};let ft=class extends he{constructor(){super(...arguments),this._valueProperty="",this._valueProcessing=!1,this.datepickerPopupRef=Ne(),this._value=[],this.label="Datovelger",this.dateformat=ei.props.dateformat.default,this.multiple=ei.props.multiple.default,this.maxlength=null,this.range=ei.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=ei.props.weeknumbers.default,this.withcontrols=ei.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=Ne(),this.popupRef=Ne(),this.singleInputRef=Ne(),this.rangeInputRef=Ne(),this.multipleInputRef=Ne(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):Wi.addToSelected(e,this.calRef,this.min,this.max)}}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return Yh.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone)}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(!(this._valueProcessing||e===t)){this._valueProcessing=!0;try{const n=Yn(e),i=this.multiple&&n.length>1?Fo.filterSelectableDates(n,this.min,this.max,this.excludedates,this.excludeweekdays):n;if(this.range&&!Fo.validateRangeOrder(i)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=i;const r=Ad(i);if(this._valueProperty!==r&&(this._valueProperty=r),this.range&&i.length<2)return;super.valueChanged(r,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,n){e==="value"&&this.value!==t&&this.valueChanged(n,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=Yn(n||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=Yn(n||"")),super.attributeChangedCallback(e,t,n)}updated(e){if(e.has("value")&&(e.has("multiple")||e.has("range"))){const t=Array.isArray(this.value)?this.value.join(","):this.value,n=e.get("value"),i=Array.isArray(n)?n.join(","):n;this.valueChanged(t,i)}e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=Yn(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,n;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(n=this.singleInputRef.value)==null?void 0:n.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,n;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(n=this.singleInputRef.value)==null?void 0:n.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return y`
952
952
  <pkt-datepicker-single
953
953
  .value=${this._value[0]??""}
954
954
  .inputType=${this.inputType}
@@ -968,7 +968,7 @@
968
968
  @manage-validity=${e=>this.manageValidity(e.detail)}
969
969
  @value-change=${e=>{this.value=e.detail}}
970
970
  @input-changed=${()=>{this.touched=!0}}
971
- ${Ne(this.singleInputRef)}
971
+ ${De(this.singleInputRef)}
972
972
  ></pkt-datepicker-single>
973
973
  `}renderRangeInput(){return y`
974
974
  <pkt-datepicker-range
@@ -989,12 +989,12 @@
989
989
  @input-change=${()=>this.onInput()}
990
990
  @input-focus=${()=>this.onFocus()}
991
991
  @input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
992
- @range-blur=${e=>{const t=this.currentInputElement,n=this.currentInputElementTo;if(t&&n){const i=t.value,r=n.value;if(i&&r&&i>r)n.value="",this._value=[i],this.value=i;else{const a=[i,r].filter(Boolean);a.length>0&&(a[0]!==this._value[0]||a[1]!==this._value[1])&&(this._value=a,this.value=a.join(","))}}Ur.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),i=>this.manageValidity(i))}}
992
+ @range-blur=${e=>{const t=this.currentInputElement,n=this.currentInputElementTo;if(t&&n){const i=t.value,r=n.value;if(i&&r&&i>r)n.value="",this._value=[i],this.value=i;else{const a=[i,r].filter(Boolean);a.length>0&&(a[0]!==this._value[0]||a[1]!==this._value[1])&&(this._value=a,this.value=a.join(","))}}Br.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),i=>this.manageValidity(i))}}
993
993
  @manage-validity=${e=>this.manageValidity(e.detail)}
994
- @validate-date-input=${e=>{ui.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
995
- @handle-date-select=${e=>{var t,n;const i=Es(e.detail);if(i){const r=gt(i);this._value[0]!==r&&this._value[1]!==r&&((n=(t=this.calRef)==null?void 0:t.value)==null||n.handleDateSelect(i))}}}
994
+ @validate-date-input=${e=>{ti.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
995
+ @handle-date-select=${e=>{var t,n;const i=Ds(e.detail);if(i){const r=pt(i);this._value[0]!==r&&this._value[1]!==r&&((n=(t=this.calRef)==null?void 0:t.value)==null||n.handleDateSelect(i))}}}
996
996
  @input-changed=${()=>{this.touched=!0}}
997
- ${Ne(this.rangeInputRef)}
997
+ ${De(this.rangeInputRef)}
998
998
  ></pkt-datepicker-range>
999
999
  `}renderMultipleInput(){return y`
1000
1000
  <pkt-datepicker-multiple
@@ -1016,7 +1016,7 @@
1016
1016
  @input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
1017
1017
  @add-to-selected=${e=>this.addToSelected(e.detail)}
1018
1018
  @input-changed=${()=>{this.touched=!0}}
1019
- ${Ne(this.multipleInputRef)}
1019
+ ${De(this.multipleInputRef)}
1020
1020
  ></pkt-datepicker-multiple>
1021
1021
  `}renderCalendar(){return y`
1022
1022
  <pkt-datepicker-popup
@@ -1032,13 +1032,13 @@
1032
1032
  .latest=${this.max}
1033
1033
  .excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
1034
1034
  .excludeweekdays=${this.excludeweekdays}
1035
- .currentmonth=${this.currentmonth?vs(this.currentmonth):null}
1035
+ .currentmonth=${this.currentmonth?ms(this.currentmonth):null}
1036
1036
  .today=${this.today}
1037
- @date-selected=${e=>{this.value=Ur.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,Ur.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
1037
+ @date-selected=${e=>{this.value=Br.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,Br.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
1038
1038
  @close=${()=>{this.onBlur(),this.hideCalendar()}}
1039
- ${Ne(this.datepickerPopupRef)}
1039
+ ${De(this.datepickerPopupRef)}
1040
1040
  ></pkt-datepicker-popup>
1041
- `}render(){return this.inputClasses=Hr.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),y`
1041
+ `}render(){return this.inputClasses=Fr.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),y`
1042
1042
  <pkt-input-wrapper
1043
1043
  label="${this.label}"
1044
1044
  forId="${this.id}-input"
@@ -1063,26 +1063,26 @@
1063
1063
  .ariaDescribedBy=${this.ariaDescribedBy}
1064
1064
  class="pkt-datepicker"
1065
1065
  >
1066
- <div class="pkt-contents" slot="helptext">${tt(this,"helptext")}</div>
1066
+ <div class="pkt-contents" slot="helptext">${Re(this,"helptext")}</div>
1067
1067
  ${this.multiple?y`<pkt-date-tags
1068
1068
  .dates=${this._value}
1069
1069
  dateformat=${this.dateformat}
1070
1070
  strings=${this.strings}
1071
1071
  id-base=${this.id}
1072
- @date-tag-removed=${e=>{var t;const n=this.datepickerPopupRef.value,i=Es(e.detail);n&&i&&typeof n.handleDateSelect=="function"?n.handleDateSelect(i):(t=this.calRef.value)==null||t.handleDateSelect(i)}}
1072
+ @date-tag-removed=${e=>{var t;const n=this.datepickerPopupRef.value,i=Ds(e.detail);n&&i&&typeof n.handleDateSelect=="function"?n.handleDateSelect(i):(t=this.calRef.value)==null||t.handleDateSelect(i)}}
1073
1073
  ></pkt-date-tags>`:x}
1074
1074
  <div class="pkt-datepicker__inputs ${this.range?"pkt-input__range-inputs":""}">
1075
1075
  ${this.range?this.renderRangeInput():this.multiple?this.renderMultipleInput():this.renderInput()}
1076
1076
  </div>
1077
1077
  </pkt-input-wrapper>
1078
1078
  ${this.renderCalendar()}
1079
- `}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;Yi.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var e;const t=this.datepickerPopupRef.value;if(this.calendarOpen=!0,t&&typeof t.show=="function"){t.show(),Rs()&&t.focusOnCurrentDate();return}await gh(20),this.handleCalendarPosition(),Rs()&&((e=this.calRef.value)==null||e.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const n=!!t.open;t.toggle(),this.calendarOpen=!n;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};bt([u({type:String,reflect:!0})],pt.prototype,"value",1),bt([u({type:String,reflect:!0})],pt.prototype,"label",2),bt([u({type:String})],pt.prototype,"dateformat",2),bt([u({type:Boolean,reflect:!0})],pt.prototype,"multiple",2),bt([u({type:Number,reflect:!0})],pt.prototype,"maxlength",2),bt([u({type:Boolean,reflect:!0})],pt.prototype,"range",2),bt([u({type:Boolean,attribute:"show-range-labels"})],pt.prototype,"showRangeLabels",2),bt([u({type:String,reflect:!0})],pt.prototype,"min",2),bt([u({type:String,reflect:!0})],pt.prototype,"max",2),bt([u({type:Boolean})],pt.prototype,"weeknumbers",2),bt([u({type:Boolean,reflect:!0})],pt.prototype,"withcontrols",2),bt([u({converter:_n.csvToArray})],pt.prototype,"excludedates",2),bt([u({converter:_n.csvToArray})],pt.prototype,"excludeweekdays",2),bt([u({type:String})],pt.prototype,"currentmonth",2),bt([u({type:String})],pt.prototype,"today",2),bt([u({type:Boolean,reflect:!0,attribute:"calendar-open"})],pt.prototype,"calendarOpen",2),bt([u({type:String})],pt.prototype,"timezone",2),bt([_e()],pt.prototype,"inputClasses",2),pt=bt([Se("pkt-datepicker")],pt);const xp={href:{default:"#"},target:{default:"_self"}},qo={props:xp};var Sp=Object.defineProperty,Cp=Object.getOwnPropertyDescriptor,Dn=(s,e,t,n)=>{for(var i=n>1?void 0:n?Cp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Sp(e,t,i),i};let en=class extends xt{constructor(){super(...arguments),this.href=qo.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=qo.props.target.default}render(){const e={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return y`<a
1079
+ `}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;Wi.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var e;const t=this.datepickerPopupRef.value;if(this.calendarOpen=!0,t&&typeof t.show=="function"){t.show(),Gs()&&t.focusOnCurrentDate();return}await nh(20),this.handleCalendarPosition(),Gs()&&((e=this.calRef.value)==null||e.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const n=!!t.open;t.toggle(),this.calendarOpen=!n;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};vt([u({type:String,reflect:!0})],ft.prototype,"value",1),vt([u({type:String,reflect:!0})],ft.prototype,"label",2),vt([u({type:String})],ft.prototype,"dateformat",2),vt([u({type:Boolean,reflect:!0})],ft.prototype,"multiple",2),vt([u({type:Number,reflect:!0})],ft.prototype,"maxlength",2),vt([u({type:Boolean,reflect:!0})],ft.prototype,"range",2),vt([u({type:Boolean,attribute:"show-range-labels"})],ft.prototype,"showRangeLabels",2),vt([u({type:String,reflect:!0})],ft.prototype,"min",2),vt([u({type:String,reflect:!0})],ft.prototype,"max",2),vt([u({type:Boolean})],ft.prototype,"weeknumbers",2),vt([u({type:Boolean,reflect:!0})],ft.prototype,"withcontrols",2),vt([u({converter:fn.csvToArray})],ft.prototype,"excludedates",2),vt([u({converter:fn.csvToArray})],ft.prototype,"excludeweekdays",2),vt([u({type:String})],ft.prototype,"currentmonth",2),vt([u({type:String})],ft.prototype,"today",2),vt([u({type:Boolean,reflect:!0,attribute:"calendar-open"})],ft.prototype,"calendarOpen",2),vt([u({type:String})],ft.prototype,"timezone",2),vt([_e()],ft.prototype,"inputClasses",2);try{Se("pkt-datepicker")(ft)}catch{console.warn("Forsøker å definere <pkt-datepicker>, men den er allerede definert")}const tp={href:{default:"#"},target:{default:"_self"}},Vo={props:tp};var sp=Object.defineProperty,ni=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&sp(e,t,i),i};let bn=class extends wt{constructor(){super(...arguments),this.href=Vo.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=Vo.props.target.default}render(){const e={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return y`<a
1080
1080
  class=${Z(e)}
1081
1081
  href=${this.href}
1082
1082
  .target=${this.target}
1083
1083
  .rel=${this.external?"noopener noreferrer":x}
1084
- >${this.iconName?y`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span>${tt(this)}</span></a
1085
- >`}};Dn([u({type:String,reflect:!0})],en.prototype,"href",2),Dn([u({type:String,reflect:!0})],en.prototype,"iconName",2),Dn([u({type:String,reflect:!0})],en.prototype,"iconPosition",2),Dn([u({type:Boolean,reflect:!0})],en.prototype,"external",2),Dn([u({type:String,reflect:!0})],en.prototype,"target",2),en=Dn([Se("pkt-link")],en);var Tp=Object.defineProperty,Dp=Object.getOwnPropertyDescriptor,hs=(s,e,t,n)=>{for(var i=n>1?void 0:n?Dp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Tp(e,t,i),i};let as=class extends he{constructor(){super(...arguments),this.inputRef=De(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0}attributeChangedCallback(s,e,t){s==="value"&&this.value!==e&&(this.counterCurrent=t?t.length:0,this.valueChanged(t,e)),super.attributeChangedCallback(s,e,t)}updated(s){var e;super.updated(s),s.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const s=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,e=Z({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),t=this.ariaLabelledby||`${this.id}-input-label`;return y`
1084
+ >${this.iconName?y`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span>${Re(this)}</span></a
1085
+ >`}};ni([u({type:String,reflect:!0})],bn.prototype,"href"),ni([u({type:String,reflect:!0})],bn.prototype,"iconName"),ni([u({type:String,reflect:!0})],bn.prototype,"iconPosition"),ni([u({type:Boolean,reflect:!0})],bn.prototype,"external"),ni([u({type:String,reflect:!0})],bn.prototype,"target");try{Se("pkt-link")(bn)}catch{console.warn("Forsøker å definere <pkt-link>, men den er allerede definert")}var np=Object.defineProperty,vs=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&np(e,t,i),i};let ls=class extends he{constructor(){super(...arguments),this.inputRef=Ne(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0}attributeChangedCallback(e,t,n){e==="value"&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){var t;super.updated(e),e.has("value")&&(this.counterCurrent=((t=this.value)==null?void 0:t.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const e=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,t=Z({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),n=this.ariaLabelledby||`${this.id}-input-label`;return y`
1086
1086
  <pkt-input-wrapper
1087
1087
  label="${this.label}"
1088
1088
  ?counter=${this.counter}
@@ -1107,17 +1107,17 @@
1107
1107
  .tagText=${this.tagText}
1108
1108
  class="pkt-textinput"
1109
1109
  >
1110
- <div class="pkt-contents" slot="helptext">${tt(this,"helptext")}</div>
1110
+ <div class="pkt-contents" slot="helptext">${Re(this,"helptext")}</div>
1111
1111
  <div class="pkt-input__container">
1112
1112
  ${this.prefix?y`<div class="pkt-input-prefix">${this.prefix}</div>`:x}
1113
1113
  <input
1114
- ${Ne(this.inputRef)}
1115
- class=${e}
1114
+ ${De(this.inputRef)}
1115
+ class=${t}
1116
1116
  type=${this.type}
1117
1117
  name=${(this.name||this.id)+"-input"}
1118
1118
  id=${this.id+"-input"}
1119
1119
  placeholder=${B(this.placeholder)}
1120
- aria-labelledby=${t}
1120
+ aria-labelledby=${n}
1121
1121
  autocomplete=${this.autocomplete||"off"}
1122
1122
  minlength=${B(this.minlength||void 0)}
1123
1123
  maxlength=${B(this.maxlength||void 0)}
@@ -1130,11 +1130,11 @@
1130
1130
  ?disabled=${this.disabled}
1131
1131
  aria-invalid=${this.hasError}
1132
1132
  aria-errormessage=${`${this.id}-error`}
1133
- @input=${n=>{this.value=n.target.value,this.onInput(),n.stopImmediatePropagation()}}
1134
- @change=${n=>{n.stopImmediatePropagation()}}
1135
- @focus=${n=>{this.onFocus(),n.stopImmediatePropagation()}}
1136
- @blur=${n=>{this.value=n.target.value,this.onBlur(),n.stopImmediatePropagation()}}
1137
- @keydown=${n=>{var i;if(n.key==="Enter"){const r=this.internals.form;r?r.requestSubmit():(i=this.inputRef.value)==null||i.blur()}}}
1133
+ @input=${i=>{this.value=i.target.value,this.onInput(),i.stopImmediatePropagation()}}
1134
+ @change=${i=>{i.stopImmediatePropagation()}}
1135
+ @focus=${i=>{this.onFocus(),i.stopImmediatePropagation()}}
1136
+ @blur=${i=>{this.value=i.target.value,this.onBlur(),i.stopImmediatePropagation()}}
1137
+ @keydown=${i=>{var r;if(i.key==="Enter"){const a=this.internals.form;a?a.requestSubmit():(r=this.inputRef.value)==null||r.blur()}}}
1138
1138
  />
1139
1139
  ${this.suffix?y`<div class="pkt-input-suffix">
1140
1140
  ${this.suffix}
@@ -1142,16 +1142,16 @@
1142
1142
  class="pkt-input-suffix-icon"
1143
1143
  name=${this.iconNameRight}
1144
1144
  ></pkt-icon>`:x}
1145
- ${s?y`<pkt-icon
1145
+ ${e?y`<pkt-icon
1146
1146
  class="pkt-input-suffix-icon"
1147
1147
  name="magnifying-glass-big"
1148
1148
  ></pkt-icon>`:x}
1149
1149
  </div>`:x}
1150
1150
  ${!this.suffix&&this.iconNameRight?y`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:x}
1151
- ${!this.suffix&&s?y`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:x}
1151
+ ${!this.suffix&&e?y`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:x}
1152
1152
  </div>
1153
1153
  </pkt-input-wrapper>
1154
- `}};hs([u({type:String,reflect:!0})],as.prototype,"value",2),hs([u({type:String})],as.prototype,"type",2),hs([u({type:Number})],as.prototype,"size",2),hs([u({type:String})],as.prototype,"autocomplete",2),hs([u({type:String})],as.prototype,"iconNameRight",2),hs([u({type:String})],as.prototype,"prefix",2),hs([u({type:String})],as.prototype,"suffix",2),hs([u({type:Boolean})],as.prototype,"omitSearchIcon",2),hs([_e()],as.prototype,"counterCurrent",2),as=hs([Se("pkt-textinput")],as);const Np=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Mp=s=>Np(s),Op=s=>{if(!s)return;const e=typeof s=="string"?new Date(s):s;if(!isNaN(e.getTime()))return e.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})};var Ep=Object.defineProperty,Pp=Object.getOwnPropertyDescriptor,tn=(s,e,t,n)=>{for(var i=n>1?void 0:n?Pp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Ep(e,t,i),i};let Ls=class extends Gt{constructor(){super(...arguments),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(e,t){const n="href"in e,i=Z({"pkt-user-menu__link":!0,"pkt-link-button":!n,"pkt-link":!n,"pkt-link--icon-left":!n,[t||""]:!!t});return n?y`
1154
+ `}};vs([u({type:String,reflect:!0})],ls.prototype,"value"),vs([u({type:String})],ls.prototype,"type"),vs([u({type:Number})],ls.prototype,"size"),vs([u({type:String})],ls.prototype,"autocomplete"),vs([u({type:String})],ls.prototype,"iconNameRight"),vs([u({type:String})],ls.prototype,"prefix"),vs([u({type:String})],ls.prototype,"suffix"),vs([u({type:Boolean})],ls.prototype,"omitSearchIcon"),vs([_e()],ls.prototype,"counterCurrent");try{Se("pkt-textinput")(ls)}catch{console.warn("Forsøker å definere <pkt-textinput>, men den er allerede definert")}const ip=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},rp=s=>ip(s),ap=s=>{if(!s)return;const e=typeof s=="string"?new Date(s):s;if(!isNaN(e.getTime()))return e.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})};var op=Object.defineProperty,kn=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&op(e,t,i),i};let Xs=class extends Kt{constructor(){super(...arguments),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(e,t){const n="href"in e,i=Z({"pkt-user-menu__link":!0,"pkt-link-button":!n,"pkt-link":!n,"pkt-link--icon-left":!n,[t||""]:!!t});return n?y`
1155
1155
  <pkt-link
1156
1156
  icon-name=${e.iconName||x}
1157
1157
  href=${e.href}
@@ -1175,7 +1175,7 @@
1175
1175
  <li class="pkt-user-menu__subitem">${this.renderLinkOrButton(t)}</li>
1176
1176
  `)}
1177
1177
  </ul>
1178
- `}render(){var e;const t=(e=this.userMenu)==null?void 0:e.map(Mp);return y`
1178
+ `}render(){var e;const t=(e=this.userMenu)==null?void 0:e.map(rp);return y`
1179
1179
  <nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
1180
1180
  <ul class="pkt-user-menu__list">
1181
1181
  <!-- User section -->
@@ -1233,8 +1233,8 @@
1233
1233
  `:x}
1234
1234
  </ul>
1235
1235
  </nav>
1236
- `}};tn([u({type:Object})],Ls.prototype,"user",2),tn([u({type:String,attribute:"formatted-last-logged-in"})],Ls.prototype,"formattedLastLoggedIn",2),tn([u({type:Object})],Ls.prototype,"representing",2),tn([u({type:Array,attribute:"user-menu"})],Ls.prototype,"userMenu",2),tn([u({type:Boolean,attribute:"can-change-representation",converter:It})],Ls.prototype,"canChangeRepresentation",2),tn([u({type:Boolean,attribute:"logout-on-click",converter:It})],Ls.prototype,"logoutOnClick",2),Ls=tn([Se("pkt-header-user-menu")],Ls);var Ap=Object.defineProperty,Ip=Object.getOwnPropertyDescriptor,qe=(s,e,t,n)=>{for(var i=n>1?void 0:n?Ip(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Ap(e,t,i),i};const Lp="https://punkt-cdn.oslo.kommune.no/16.7/logos/";let Be=class extends xt{constructor(){super(...arguments),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.alignSlotRight=!1,this.alignSearchRight=!1,this.headerRef=De(),this.userContainerRef=De(),this.slotContainerRef=De(),this.searchContainerRef=De(),this.slotContentRef=De(),this.searchMenuRef=De(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const e=window.pageYOffset||document.documentElement.scrollTop;e<0||Math.abs(e-this.lastScrollPosition)<60||(this.isHidden=e>this.lastScrollPosition,this.lastScrollPosition=e)},this.handleClickOutside=e=>{const t=e.target;this.user&&this.openMenu==="user"&&!t.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!t.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!t.closest(".pkt-header-service__search-container")&&!t.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(e,t)=>{const n=e.relatedTarget;let i;switch(t){case"user":i=this.userContainerRef;break;case"slot":i=this.slotContainerRef;break;case"search":i=this.searchContainerRef;break;default:return}const r=i.value;r&&(!n||!r.contains(n))&&(this.openMenu="none")},this.handleEscapeKey=e=>{e.key==="Escape"&&this.openMenu!=="none"&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")}}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(e){if(super.updated(e),e.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(e.has("mobileBreakpoint")||e.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),e.has("openMenu")){const t=e.get("openMenu");this.openMenu!=="none"&&(t==="none"||t===void 0)?(document.addEventListener("mousedown",this.handleClickOutside),document.addEventListener("keydown",this.handleEscapeKey),(this.openMenu==="slot"||this.openMenu==="search")&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu==="none"&&t!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(e.has("openMenu")||e.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const e=this.headerRef.value;e&&(this.componentWidth=e.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(t=>{for(const n of t)n.borderBoxSize&&n.borderBoxSize.length>0?this.componentWidth=n.borderBoxSize[0].inlineSize:this.componentWidth=n.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(e))}updateIsMobile(){this.isMobile=this.componentWidth<this.mobileBreakpoint}updateIsTablet(){this.isTablet=this.componentWidth<this.tabletBreakpoint}updateScrollLock(){this.position==="fixed"&&this.isMobile&&this.openMenu!=="none"?this.lockScroll():this.unlockScroll()}lockScroll(){const e=document.body,t=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const n=window.innerWidth-t.clientWidth;n>0&&(e.style.paddingRight=`${n}px`),e.style.position="fixed",e.style.top=`-${this.savedScrollY}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",t.classList.add("is-scroll-locked")}unlockScroll(){const e=document.body,t=document.documentElement;t.classList.contains("is-scroll-locked")&&(e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),t.classList.remove("is-scroll-locked"),window.scrollTo({top:this.savedScrollY}))}setupScrollListener(){window.addEventListener("scroll",this.handleScroll)}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}checkDropdownAlignment(e){const t=e==="slot"?this.slotContainerRef:this.searchContainerRef,n=e==="slot"?this.slotContentRef:this.searchMenuRef;if(!t.value||!n.value||!this.isTablet||this.isMobile)return;const i=t.value.getBoundingClientRect(),r=n.value.offsetWidth,a=i.left+r>window.innerWidth;e==="slot"?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=e)}handleLogoClick(e){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleServiceClick(e){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(e){this.dispatchEvent(new CustomEvent("search",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchChange(e){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchInputChange(e){const t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key==="Enter"&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){var e;return Op((e=this.user)==null?void 0:e.lastLoggedIn)}get isFixed(){return this.position==="fixed"}get shouldHideOnScroll(){return this.scrollBehavior==="hide"}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement==="header"||this.logOutButtonPlacement==="both")}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement==="userMenu"||this.logOutButtonPlacement==="both")}renderLogo(){if(this.hideLogo)return x;const e=y`
1237
- <pkt-icon name="oslologo" aria-hidden="true" path=${Lp}></pkt-icon>
1236
+ `}};kn([u({type:Object})],Xs.prototype,"user"),kn([u({type:String,attribute:"formatted-last-logged-in"})],Xs.prototype,"formattedLastLoggedIn"),kn([u({type:Object})],Xs.prototype,"representing"),kn([u({type:Array,attribute:"user-menu"})],Xs.prototype,"userMenu"),kn([u({type:Boolean,attribute:"can-change-representation",converter:It})],Xs.prototype,"canChangeRepresentation"),kn([u({type:Boolean,attribute:"logout-on-click",converter:It})],Xs.prototype,"logoutOnClick");try{Se("pkt-header-user-menu")(Xs)}catch{console.warn("Forsøker å definere <pkt-header-user-menu>, men den er allerede definert")}var lp=Object.defineProperty,ze=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&lp(e,t,i),i};const cp="https://punkt-cdn.oslo.kommune.no/16.7/logos/";class Ue extends wt{constructor(){super(...arguments),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.alignSlotRight=!1,this.alignSearchRight=!1,this.headerRef=Ne(),this.userContainerRef=Ne(),this.slotContainerRef=Ne(),this.searchContainerRef=Ne(),this.slotContentRef=Ne(),this.searchMenuRef=Ne(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const e=window.pageYOffset||document.documentElement.scrollTop;e<0||Math.abs(e-this.lastScrollPosition)<60||(this.isHidden=e>this.lastScrollPosition,this.lastScrollPosition=e)},this.handleClickOutside=e=>{const t=e.target;this.user&&this.openMenu==="user"&&!t.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!t.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!t.closest(".pkt-header-service__search-container")&&!t.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(e,t)=>{const n=e.relatedTarget;let i;switch(t){case"user":i=this.userContainerRef;break;case"slot":i=this.slotContainerRef;break;case"search":i=this.searchContainerRef;break;default:return}const r=i.value;r&&(!n||!r.contains(n))&&(this.openMenu="none")},this.handleEscapeKey=e=>{e.key==="Escape"&&this.openMenu!=="none"&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")}}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(e){if(super.updated(e),e.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(e.has("mobileBreakpoint")||e.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),e.has("openMenu")){const t=e.get("openMenu");this.openMenu!=="none"&&(t==="none"||t===void 0)?(document.addEventListener("mousedown",this.handleClickOutside),document.addEventListener("keydown",this.handleEscapeKey),(this.openMenu==="slot"||this.openMenu==="search")&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu==="none"&&t!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(e.has("openMenu")||e.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const e=this.headerRef.value;e&&(this.componentWidth=e.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(t=>{for(const n of t)n.borderBoxSize&&n.borderBoxSize.length>0?this.componentWidth=n.borderBoxSize[0].inlineSize:this.componentWidth=n.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(e))}updateIsMobile(){this.isMobile=this.componentWidth<this.mobileBreakpoint}updateIsTablet(){this.isTablet=this.componentWidth<this.tabletBreakpoint}updateScrollLock(){this.position==="fixed"&&this.isMobile&&this.openMenu!=="none"?this.lockScroll():this.unlockScroll()}lockScroll(){const e=document.body,t=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const n=window.innerWidth-t.clientWidth;n>0&&(e.style.paddingRight=`${n}px`),e.style.position="fixed",e.style.top=`-${this.savedScrollY}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",t.classList.add("is-scroll-locked")}unlockScroll(){const e=document.body,t=document.documentElement;t.classList.contains("is-scroll-locked")&&(e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),t.classList.remove("is-scroll-locked"),window.scrollTo({top:this.savedScrollY}))}setupScrollListener(){window.addEventListener("scroll",this.handleScroll)}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}checkDropdownAlignment(e){const t=e==="slot"?this.slotContainerRef:this.searchContainerRef,n=e==="slot"?this.slotContentRef:this.searchMenuRef;if(!t.value||!n.value||!this.isTablet||this.isMobile)return;const i=t.value.getBoundingClientRect(),r=n.value.offsetWidth,a=i.left+r>window.innerWidth;e==="slot"?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=e)}handleLogoClick(e){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleServiceClick(e){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(e){this.dispatchEvent(new CustomEvent("search",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchChange(e){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchInputChange(e){const t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key==="Enter"&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){var e;return ap((e=this.user)==null?void 0:e.lastLoggedIn)}get isFixed(){return this.position==="fixed"}get shouldHideOnScroll(){return this.scrollBehavior==="hide"}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement==="header"||this.logOutButtonPlacement==="both")}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement==="userMenu"||this.logOutButtonPlacement==="both")}renderLogo(){if(this.hideLogo)return x;const e=y`
1237
+ <pkt-icon name="oslologo" aria-hidden="true" path=${cp}></pkt-icon>
1238
1238
  `;return this.logoLink&&typeof this.logoLink=="string"?y`
1239
1239
  <span class="pkt-header-service__logo">
1240
1240
  <a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
@@ -1280,7 +1280,7 @@
1280
1280
  <div
1281
1281
  class=${e}
1282
1282
  @focusout=${n=>this.handleFocusOut(n,"slot")}
1283
- ${Ne(this.slotContainerRef)}
1283
+ ${De(this.slotContainerRef)}
1284
1284
  >
1285
1285
  ${this.isTablet&&this.hasSlotContent()?y`
1286
1286
  <pkt-button
@@ -1302,16 +1302,16 @@
1302
1302
  id="mobile-slot-menu"
1303
1303
  role=${this.isTablet?"menu":x}
1304
1304
  aria-label=${this.isTablet?"Meny":x}
1305
- ${Ne(this.slotContentRef)}
1305
+ ${De(this.slotContentRef)}
1306
1306
  >
1307
- ${tt(this)}
1307
+ ${Re(this)}
1308
1308
  </div>
1309
1309
  </div>
1310
1310
  `}renderSearch(){if(!this.showSearch)return x;if(this.isTablet){const e=Z({"pkt-header-service__search-container":!0,"is-open":this.openMenu==="search"}),t=Z({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu==="search","align-right":this.alignSearchRight});return y`
1311
1311
  <div
1312
1312
  class=${e}
1313
1313
  @focusout=${n=>this.handleFocusOut(n,"search")}
1314
- ${Ne(this.searchContainerRef)}
1314
+ ${De(this.searchContainerRef)}
1315
1315
  >
1316
1316
  <pkt-button
1317
1317
  skin="secondary"
@@ -1326,7 +1326,7 @@
1326
1326
  >
1327
1327
  Søk
1328
1328
  </pkt-button>
1329
- <div class=${t} ${Ne(this.searchMenuRef)}>
1329
+ <div class=${t} ${De(this.searchMenuRef)}>
1330
1330
  ${this.openMenu==="search"?y`
1331
1331
  <pkt-textinput
1332
1332
  id="mobile-search-menu"
@@ -1360,7 +1360,7 @@
1360
1360
  <div
1361
1361
  class="pkt-header-service__user-container"
1362
1362
  @focusout=${n=>this.handleFocusOut(n,"user")}
1363
- ${Ne(this.userContainerRef)}
1363
+ ${De(this.userContainerRef)}
1364
1364
  >
1365
1365
  <pkt-button
1366
1366
  class=${Z({"pkt-header-service__user-button":!0,"pkt-header-service__user-button--mobile":this.isMobile})}
@@ -1391,7 +1391,7 @@
1391
1391
  `:x}
1392
1392
  </div>
1393
1393
  `}renderHeader(){const e=Z({"pkt-header-service":!0,"pkt-header-service--compact":this.compact,"pkt-header-service--mobile":this.isMobile,"pkt-header-service--tablet":this.isTablet,"pkt-header-service--fixed":this.isFixed,"pkt-header-service--scroll-to-hide":this.shouldHideOnScroll,"pkt-header-service--hidden":this.isHidden}),t=Z({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return y`
1394
- <header class=${e} ${Ne(this.headerRef)}>
1394
+ <header class=${e} ${De(this.headerRef)}>
1395
1395
  <div class=${t}>${this.renderLogo()} ${this.renderServiceName()}</div>
1396
1396
 
1397
1397
  ${this.hasSlotContent()||this.showSearch||this.showLogoutInHeader?y`<div class="pkt-header-service__content">
@@ -1428,7 +1428,7 @@
1428
1428
  ${e}
1429
1429
  <div class=${t}></div>
1430
1430
  </div>
1431
- `}return e}};qe([u({type:String,attribute:"service-name"})],Be.prototype,"serviceName",2),qe([u({type:String,attribute:"service-link"})],Be.prototype,"serviceLink",2),qe([u({type:String,attribute:"logo-link"})],Be.prototype,"logoLink",2),qe([u({type:String,attribute:"search-placeholder"})],Be.prototype,"searchPlaceholder",2),qe([u({type:String,attribute:"search-value"})],Be.prototype,"searchValue",2),qe([u({type:Number,attribute:"mobile-breakpoint"})],Be.prototype,"mobileBreakpoint",2),qe([u({type:Number,attribute:"tablet-breakpoint"})],Be.prototype,"tabletBreakpoint",2),qe([u({type:String,attribute:"opened-menu"})],Be.prototype,"openedMenu",2),qe([u({type:String,attribute:"log-out-button-placement"})],Be.prototype,"logOutButtonPlacement",2),qe([u({type:String})],Be.prototype,"position",2),qe([u({type:String,attribute:"scroll-behavior"})],Be.prototype,"scrollBehavior",2),qe([u({type:String,attribute:"slot-menu-variant"})],Be.prototype,"slotMenuVariant",2),qe([u({type:String,attribute:"slot-menu-text"})],Be.prototype,"slotMenuText",2),qe([u({type:Boolean,attribute:"hide-logo",converter:It})],Be.prototype,"hideLogo",2),qe([u({type:Boolean,converter:It})],Be.prototype,"compact",2),qe([u({type:Boolean,attribute:"show-search",converter:It})],Be.prototype,"showSearch",2),qe([u({type:Boolean,attribute:"can-change-representation",converter:It})],Be.prototype,"canChangeRepresentation",2),qe([u({type:Boolean,attribute:"has-log-out",converter:It})],Be.prototype,"hasLogOut",2),qe([u({type:Object})],Be.prototype,"user",2),qe([u({type:Array,attribute:"user-menu"})],Be.prototype,"userMenu",2),qe([u({type:Object})],Be.prototype,"representing",2),qe([_e()],Be.prototype,"isMobile",2),qe([_e()],Be.prototype,"isTablet",2),qe([_e()],Be.prototype,"openMenu",2),qe([_e()],Be.prototype,"isHidden",2),qe([_e()],Be.prototype,"componentWidth",2),qe([_e()],Be.prototype,"alignSlotRight",2),qe([_e()],Be.prototype,"alignSearchRight",2),Be=qe([Se("pkt-header-service")],Be);var Fp=Object.defineProperty,Bp=Object.getOwnPropertyDescriptor,nt=(s,e,t,n)=>{for(var i=n>1?void 0:n?Bp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Fp(e,t,i),i};let et=class extends xt{constructor(){super(...arguments),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1}firstUpdated(e){super.firstUpdated(e),this.emitDeprecationWarnings()}emitDeprecationWarnings(){this.userMenuFooter!==void 0&&console.warn("[PktHeader] userMenuFooter is deprecated. Use userMenu instead."),this.userOptions!==void 0&&console.warn("[PktHeader] userOptions is deprecated. Use userMenu instead.")}get effectiveUserMenu(){const e=this.userMenu||[],t=this.userMenuFooter||[],n=this.userOptions||[];return t.length||n.length?[...e,...n,...t]:this.userMenu}render(){return y`
1431
+ `}return e}}ze([u({type:String,attribute:"service-name"})],Ue.prototype,"serviceName"),ze([u({type:String,attribute:"service-link"})],Ue.prototype,"serviceLink"),ze([u({type:String,attribute:"logo-link"})],Ue.prototype,"logoLink"),ze([u({type:String,attribute:"search-placeholder"})],Ue.prototype,"searchPlaceholder"),ze([u({type:String,attribute:"search-value"})],Ue.prototype,"searchValue"),ze([u({type:Number,attribute:"mobile-breakpoint"})],Ue.prototype,"mobileBreakpoint"),ze([u({type:Number,attribute:"tablet-breakpoint"})],Ue.prototype,"tabletBreakpoint"),ze([u({type:String,attribute:"opened-menu"})],Ue.prototype,"openedMenu"),ze([u({type:String,attribute:"log-out-button-placement"})],Ue.prototype,"logOutButtonPlacement"),ze([u({type:String})],Ue.prototype,"position"),ze([u({type:String,attribute:"scroll-behavior"})],Ue.prototype,"scrollBehavior"),ze([u({type:String,attribute:"slot-menu-variant"})],Ue.prototype,"slotMenuVariant"),ze([u({type:String,attribute:"slot-menu-text"})],Ue.prototype,"slotMenuText"),ze([u({type:Boolean,attribute:"hide-logo",converter:It})],Ue.prototype,"hideLogo"),ze([u({type:Boolean,converter:It})],Ue.prototype,"compact"),ze([u({type:Boolean,attribute:"show-search",converter:It})],Ue.prototype,"showSearch"),ze([u({type:Boolean,attribute:"can-change-representation",converter:It})],Ue.prototype,"canChangeRepresentation"),ze([u({type:Boolean,attribute:"has-log-out",converter:It})],Ue.prototype,"hasLogOut"),ze([u({type:Object})],Ue.prototype,"user"),ze([u({type:Array,attribute:"user-menu"})],Ue.prototype,"userMenu"),ze([u({type:Object})],Ue.prototype,"representing"),ze([_e()],Ue.prototype,"isMobile"),ze([_e()],Ue.prototype,"isTablet"),ze([_e()],Ue.prototype,"openMenu"),ze([_e()],Ue.prototype,"isHidden"),ze([_e()],Ue.prototype,"componentWidth"),ze([_e()],Ue.prototype,"alignSlotRight"),ze([_e()],Ue.prototype,"alignSearchRight");try{Se("pkt-header-service")(Ue)}catch{console.warn("Forsøker å definere <pkt-header-service>, men den er allerede definert")}var up=Object.defineProperty,nt=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&up(e,t,i),i};let tt=class extends wt{constructor(){super(...arguments),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.slotMenuVariant="icon-only",this.slotMenuText="Meny",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1}firstUpdated(e){super.firstUpdated(e),this.emitDeprecationWarnings()}emitDeprecationWarnings(){this.userMenuFooter!==void 0&&console.warn("[PktHeader] userMenuFooter is deprecated. Use userMenu instead."),this.userOptions!==void 0&&console.warn("[PktHeader] userOptions is deprecated. Use userMenu instead.")}get effectiveUserMenu(){const e=this.userMenu||[],t=this.userMenuFooter||[],n=this.userOptions||[];return t.length||n.length?[...e,...n,...t]:this.userMenu}render(){return y`
1432
1432
  <pkt-header-service
1433
1433
  service-name=${B(this.serviceName)}
1434
1434
  service-link=${B(this.serviceLink)}
@@ -1452,9 +1452,9 @@
1452
1452
  .userMenu=${this.effectiveUserMenu}
1453
1453
  .representing=${this.representing}
1454
1454
  >
1455
- ${this.hasSlotContent()?y`<div class="pkt-contents">${tt(this)}</div>`:x}
1455
+ ${this.hasSlotContent()?y`<div class="pkt-contents">${Re(this)}</div>`:x}
1456
1456
  </pkt-header-service>
1457
- `}};nt([u({type:String,attribute:"service-name"})],et.prototype,"serviceName",2),nt([u({type:String,attribute:"service-link"})],et.prototype,"serviceLink",2),nt([u({type:String,attribute:"logo-link"})],et.prototype,"logoLink",2),nt([u({type:String,attribute:"search-placeholder"})],et.prototype,"searchPlaceholder",2),nt([u({type:String,attribute:"search-value"})],et.prototype,"searchValue",2),nt([u({type:Number,attribute:"mobile-breakpoint"})],et.prototype,"mobileBreakpoint",2),nt([u({type:Number,attribute:"tablet-breakpoint"})],et.prototype,"tabletBreakpoint",2),nt([u({type:String,attribute:"opened-menu"})],et.prototype,"openedMenu",2),nt([u({type:String,attribute:"log-out-button-placement"})],et.prototype,"logOutButtonPlacement",2),nt([u({type:String})],et.prototype,"position",2),nt([u({type:String,attribute:"scroll-behavior"})],et.prototype,"scrollBehavior",2),nt([u({type:String,attribute:"slot-menu-variant"})],et.prototype,"slotMenuVariant",2),nt([u({type:String,attribute:"slot-menu-text"})],et.prototype,"slotMenuText",2),nt([u({type:Boolean,attribute:"hide-logo",converter:It})],et.prototype,"hideLogo",2),nt([u({type:Boolean,converter:It})],et.prototype,"compact",2),nt([u({type:Boolean,attribute:"show-search",converter:It})],et.prototype,"showSearch",2),nt([u({type:Boolean,attribute:"can-change-representation",converter:It})],et.prototype,"canChangeRepresentation",2),nt([u({type:Boolean,attribute:"has-log-out",converter:It})],et.prototype,"hasLogOut",2),nt([u({type:Object})],et.prototype,"user",2),nt([u({type:Array,attribute:"user-menu"})],et.prototype,"userMenu",2),nt([u({type:Object})],et.prototype,"representing",2),nt([u({type:Array,attribute:"user-menu-footer"})],et.prototype,"userMenuFooter",2),nt([u({type:Array,attribute:"user-options"})],et.prototype,"userOptions",2),et=nt([Se("pkt-header")],et);var Vp=Object.defineProperty,Hp=Object.getOwnPropertyDescriptor,sn=(s,e,t,n)=>{for(var i=n>1?void 0:n?Hp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Vp(e,t,i),i};let Fs=class extends xt{constructor(){super(...arguments),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal"}render(){const e=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),t=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return y`
1457
+ `}};nt([u({type:String,attribute:"service-name"})],tt.prototype,"serviceName"),nt([u({type:String,attribute:"service-link"})],tt.prototype,"serviceLink"),nt([u({type:String,attribute:"logo-link"})],tt.prototype,"logoLink"),nt([u({type:String,attribute:"search-placeholder"})],tt.prototype,"searchPlaceholder"),nt([u({type:String,attribute:"search-value"})],tt.prototype,"searchValue"),nt([u({type:Number,attribute:"mobile-breakpoint"})],tt.prototype,"mobileBreakpoint"),nt([u({type:Number,attribute:"tablet-breakpoint"})],tt.prototype,"tabletBreakpoint"),nt([u({type:String,attribute:"opened-menu"})],tt.prototype,"openedMenu"),nt([u({type:String,attribute:"log-out-button-placement"})],tt.prototype,"logOutButtonPlacement"),nt([u({type:String})],tt.prototype,"position"),nt([u({type:String,attribute:"scroll-behavior"})],tt.prototype,"scrollBehavior"),nt([u({type:String,attribute:"slot-menu-variant"})],tt.prototype,"slotMenuVariant"),nt([u({type:String,attribute:"slot-menu-text"})],tt.prototype,"slotMenuText"),nt([u({type:Boolean,attribute:"hide-logo",converter:It})],tt.prototype,"hideLogo"),nt([u({type:Boolean,converter:It})],tt.prototype,"compact"),nt([u({type:Boolean,attribute:"show-search",converter:It})],tt.prototype,"showSearch"),nt([u({type:Boolean,attribute:"can-change-representation",converter:It})],tt.prototype,"canChangeRepresentation"),nt([u({type:Boolean,attribute:"has-log-out",converter:It})],tt.prototype,"hasLogOut"),nt([u({type:Object})],tt.prototype,"user"),nt([u({type:Array,attribute:"user-menu"})],tt.prototype,"userMenu"),nt([u({type:Object})],tt.prototype,"representing"),nt([u({type:Array,attribute:"user-menu-footer"})],tt.prototype,"userMenuFooter"),nt([u({type:Array,attribute:"user-options"})],tt.prototype,"userOptions");try{Se("pkt-header")(tt)}catch{console.warn("Forsøker å definere <pkt-header>, men den er allerede definert")}var dp=Object.defineProperty,vn=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&dp(e,t,i),i};let Qs=class extends wt{constructor(){super(...arguments),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal"}render(){const e=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),t=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return y`
1458
1458
  <a
1459
1459
  href=${this.href}
1460
1460
  class=${e}
@@ -1464,9 +1464,9 @@
1464
1464
  ${this.iconName&&y`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
1465
1465
  ${this.title&&y`<div class=${t}>${this.title}</div>`}
1466
1466
 
1467
- <div class="pkt-linkcard__text">${tt(this)}</div>
1467
+ <div class="pkt-linkcard__text">${Re(this)}</div>
1468
1468
  </a>
1469
- `}};sn([u({type:String,reflect:!0})],Fs.prototype,"title",2),sn([u({type:String,reflect:!0})],Fs.prototype,"href",2),sn([u({type:String,reflect:!0})],Fs.prototype,"iconName",2),sn([u({type:Boolean,reflect:!0})],Fs.prototype,"external",2),sn([u({type:Boolean,reflect:!0})],Fs.prototype,"openInNewTab",2),sn([u({type:String,reflect:!0})],Fs.prototype,"skin",2),Fs=sn([Se("pkt-linkcard")],Fs);var Up=Object.defineProperty,qp=Object.getOwnPropertyDescriptor,_s=(s,e,t,n)=>{for(var i=n>1?void 0:n?qp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Up(e,t,i),i};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/16.7/animations/";let os=class extends xt{constructor(){super(...arguments),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=Z({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=Z({"pkt-contents":!0,"pkt-hide":this.isLoading});return y`<div
1469
+ `}};vn([u({type:String,reflect:!0})],Qs.prototype,"title"),vn([u({type:String,reflect:!0})],Qs.prototype,"href"),vn([u({type:String,reflect:!0})],Qs.prototype,"iconName"),vn([u({type:Boolean,reflect:!0})],Qs.prototype,"external"),vn([u({type:Boolean,reflect:!0})],Qs.prototype,"openInNewTab"),vn([u({type:String,reflect:!0})],Qs.prototype,"skin");try{Se("pkt-linkcard")(Qs)}catch{console.warn("Forsøker å definere <pkt-linkcard>, men den er allerede definert")}var hp=Object.defineProperty,Es=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&hp(e,t,i),i};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/16.7/animations/";class cs extends wt{constructor(){super(...arguments),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=Z({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=Z({"pkt-contents":!0,"pkt-hide":this.isLoading});return y`<div
1470
1470
  role="status"
1471
1471
  aria-live="polite"
1472
1472
  aria-busy=${this.isLoading?"true":"false"}
@@ -1480,8 +1480,8 @@
1480
1480
  ></pkt-icon>
1481
1481
  ${this.message&&y`<p>${this.message}</p>`}
1482
1482
  </div>`:x}
1483
- <div class=${t}>${tt(this)}</div>
1484
- </div>`}getVariant(e){switch(e){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};_s([u({type:Number})],os.prototype,"delay",2),_s([u({type:Boolean})],os.prototype,"inline",2),_s([u({type:Boolean})],os.prototype,"isLoading",2),_s([u({type:String})],os.prototype,"message",2),_s([u({type:String})],os.prototype,"size",2),_s([u({type:String})],os.prototype,"variant",2),_s([u({type:String})],os.prototype,"loadingAnimationPath",2),_s([_e()],os.prototype,"_shouldDisplayLoader",2),os=_s([Se("pkt-loader")],os);const jp={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},jr={props:jp};var Wp=Object.defineProperty,zp=Object.getOwnPropertyDescriptor,Nn=(s,e,t,n)=>{for(var i=n>1?void 0:n?zp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Wp(e,t,i),i};let nn=class extends xt{constructor(){super(),this.closable=jr.props.closable.default,this.compact=jr.props.compact.default,this.title="",this.skin=jr.props.skin.default,this._isClosed=!1,this.close=s=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:s},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:s},bubbles:!0}))},this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&Ra(this,"pkt-hide",this._isClosed)}render(){const s={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return y`<div class=${Z(s)}>
1483
+ <div class=${t}>${Re(this)}</div>
1484
+ </div>`}getVariant(e){switch(e){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}}Es([u({type:Number})],cs.prototype,"delay"),Es([u({type:Boolean})],cs.prototype,"inline"),Es([u({type:Boolean})],cs.prototype,"isLoading"),Es([u({type:String})],cs.prototype,"message"),Es([u({type:String})],cs.prototype,"size"),Es([u({type:String})],cs.prototype,"variant"),Es([u({type:String})],cs.prototype,"loadingAnimationPath"),Es([_e()],cs.prototype,"_shouldDisplayLoader");try{Se("pkt-loader")(cs)}catch{console.warn("Forsøker å definere <pkt-loader>, men den er allerede definert")}const pp={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},Ur={props:pp};var fp=Object.defineProperty,ii=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&fp(e,t,i),i};let yn=class extends wt{constructor(){super(),this.closable=Ur.props.closable.default,this.compact=Ur.props.compact.default,this.title="",this.skin=Ur.props.skin.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0}))},this._isClosed=!1}updated(e){super.updated(e),e.has("_isClosed")&&Qa(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return y`<div class=${Z(e)}>
1485
1485
  ${this.closable?y`<div class="pkt-messagebox__close">
1486
1486
  <button
1487
1487
  @click=${this.close}
@@ -1492,11 +1492,11 @@
1492
1492
  </button>
1493
1493
  </div>`:x}
1494
1494
  ${this.title?y`<div class="pkt-messagebox__title">${this.title}</div>`:x}
1495
- <div class="pkt-messagebox__text">${tt(this)}</div>
1496
- </div>`}};Nn([u({type:Boolean,reflect:!0})],nn.prototype,"closable",2),Nn([u({type:Boolean,reflect:!0})],nn.prototype,"compact",2),Nn([u({type:String,reflect:!0})],nn.prototype,"title",2),Nn([u({type:String,reflect:!0})],nn.prototype,"skin",2),Nn([_e()],nn.prototype,"_isClosed",2),nn=Nn([Se("pkt-messagebox")],nn);const Kp={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},Wr={props:Kp};var Yp=Object.defineProperty,Gp=Object.getOwnPropertyDescriptor,es=(s,e,t,n)=>{for(var i=n>1?void 0:n?Gp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Yp(e,t,i),i};let jt=class extends xt{constructor(){super(),this.open=!1,this.headingText="",this.removePadding=!1,this.hideCloseButton=Wr.props.hideCloseButton.default,this.closeOnBackdropClick=Wr.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=Wr.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.dialogRef=De(),this._isOpen=!1,this.close=(e,t=!1)=>{var n;if(!this._isOpen)return;this._isOpen=!1,this.open=!1,document.body.classList.remove("pkt-modal--open");const i=document.activeElement;i&&!this.isElementInViewport(i)&&i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),t||(n=this.dialogRef.value)==null||n.close(),this.requestUpdate()},this.showModal=(e=null)=>{var t;this._isOpen=!0,this.open=!0,(t=this.dialogRef.value)==null||t.showModal(),document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:e},bubbles:!0,composed:!0})),this.requestUpdate()},this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}updated(e){super.updated(e),e.has("open")&&(this.open&&!this._isOpen?this.showModal():!this.open&&this._isOpen&&this.close(new Event("close"),!1))}async firstUpdated(e){super.firstUpdated(e),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>tv).then(t=>t.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(e){e.key==="Escape"&&this.close(e)}handleBackdropClick(e){var t;this.closeOnBackdropClick&&e.target===((t=this.dialogRef)==null?void 0:t.value)&&this.close(e)}isElementInViewport(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const e={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},n={"pkt-modal__content":!0,"pkt-txt-18-light":!0},i=this.closeButtonSkin==="blue",r={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return y`
1495
+ <div class="pkt-messagebox__text">${Re(this)}</div>
1496
+ </div>`}};ii([u({type:Boolean,reflect:!0})],yn.prototype,"closable"),ii([u({type:Boolean,reflect:!0})],yn.prototype,"compact"),ii([u({type:String,reflect:!0})],yn.prototype,"title"),ii([u({type:String,reflect:!0})],yn.prototype,"skin"),ii([_e()],yn.prototype,"_isClosed");try{Se("pkt-messagebox")(yn)}catch{console.warn("Forsøker å definere <pkt-messagebox>, men den er allerede definert")}const mp={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},qr={props:mp};var gp=Object.defineProperty,ns=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&gp(e,t,i),i};class Qt extends wt{constructor(){super(),this.open=!1,this.headingText="",this.removePadding=!1,this.hideCloseButton=qr.props.hideCloseButton.default,this.closeOnBackdropClick=qr.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=qr.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.dialogRef=Ne(),this._isOpen=!1,this.close=(e,t=!1)=>{var n;if(!this._isOpen)return;this._isOpen=!1,this.open=!1,document.body.classList.remove("pkt-modal--open");const i=document.activeElement;i&&!this.isElementInViewport(i)&&i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),t||(n=this.dialogRef.value)==null||n.close(),this.requestUpdate()},this.showModal=(e=null)=>{var t;this._isOpen=!0,this.open=!0,(t=this.dialogRef.value)==null||t.showModal(),document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:e},bubbles:!0,composed:!0})),this.requestUpdate()},this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}updated(e){super.updated(e),e.has("open")&&(this.open&&!this._isOpen?this.showModal():!this.open&&this._isOpen&&this.close(new Event("close"),!1))}async firstUpdated(e){super.firstUpdated(e),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>bb).then(t=>t.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(e){e.key==="Escape"&&this.close(e)}handleBackdropClick(e){var t;this.closeOnBackdropClick&&e.target===((t=this.dialogRef)==null?void 0:t.value)&&this.close(e)}isElementInViewport(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const e={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},t={"pkt-modal__headingText":!0,"pkt-txt-24":!0},n={"pkt-modal__content":!0,"pkt-txt-18-light":!0},i=this.closeButtonSkin==="blue",r={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return y`
1497
1497
  <dialog
1498
1498
  class=${Z(e)}
1499
- ${Ne(this.dialogRef)}
1499
+ ${De(this.dialogRef)}
1500
1500
  aria-labelledby=${this.headingText?"pkt-modal__headingText":x}
1501
1501
  aria-describedby="pkt-modal__content"
1502
1502
  @close=${a=>this.close(a,!0)}
@@ -1524,18 +1524,18 @@
1524
1524
  <div
1525
1525
  id="pkt-modal__content"
1526
1526
  class=${Z(n)}
1527
- >${tt(this)}</div>
1527
+ >${Re(this)}</div>
1528
1528
  </div>
1529
1529
  </div>
1530
1530
  </dialog>
1531
- `}};es([u({type:Boolean,reflect:!0})],jt.prototype,"open",2),es([u({type:String})],jt.prototype,"headingText",2),es([u({type:Boolean})],jt.prototype,"removePadding",2),es([u({type:Boolean})],jt.prototype,"hideCloseButton",2),es([u({type:Boolean})],jt.prototype,"closeOnBackdropClick",2),es([u({type:String})],jt.prototype,"closeButtonSkin",2),es([u({type:String})],jt.prototype,"size",2),es([u({type:String})],jt.prototype,"variant",2),es([u({type:String})],jt.prototype,"drawerPosition",2),es([u({type:Boolean})],jt.prototype,"transparentBackdrop",2),es([_e()],jt.prototype,"_isOpen",2),jt=es([Se("pkt-modal")],jt);/**
1531
+ `}}ns([u({type:Boolean,reflect:!0})],Qt.prototype,"open"),ns([u({type:String})],Qt.prototype,"headingText"),ns([u({type:Boolean})],Qt.prototype,"removePadding"),ns([u({type:Boolean})],Qt.prototype,"hideCloseButton"),ns([u({type:Boolean})],Qt.prototype,"closeOnBackdropClick"),ns([u({type:String})],Qt.prototype,"closeButtonSkin"),ns([u({type:String})],Qt.prototype,"size"),ns([u({type:String})],Qt.prototype,"variant"),ns([u({type:String})],Qt.prototype,"drawerPosition"),ns([u({type:Boolean})],Qt.prototype,"transparentBackdrop"),ns([_e()],Qt.prototype,"_isOpen");try{Se("pkt-modal")(Qt)}catch{console.warn("Forsøker å definere <pkt-modal>, men den er allerede definert")}/**
1532
1532
  * @license
1533
1533
  * Copyright 2018 Google LLC
1534
1534
  * SPDX-License-Identifier: BSD-3-Clause
1535
- */const jo="important",Xp=" !"+jo,Qp=Ns(class extends vn{constructor(s){var e;if(super(s),s.type!==Xt.ATTRIBUTE||s.name!=="style"||((e=s.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((e,t)=>{const n=s[t];return n==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(s,[e]){const{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const n of this.ft)e[n]==null&&(this.ft.delete(n),n.includes("-")?t.removeProperty(n):t[n]=null);for(const n in e){const i=e[n];if(i!=null){this.ft.add(n);const r=typeof i=="string"&&i.endsWith(Xp);n.includes("-")||r?t.setProperty(n,r?i.slice(0,-11):i,r?jo:""):t[n]=i}}return yt}});var Zp=Object.defineProperty,Jp=Object.getOwnPropertyDescriptor,vt=(s,e,t,n)=>{for(var i=n>1?void 0:n?Jp(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Zp(e,t,i),i};let ft=class extends Gt{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=As(),this.role="progressbar",this.skin="dark-blue",this.statusPlacement="following",this.statusType="none",this.title="",this.titlePosition="left",this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.computedAriaLabelledby=null,this.computedAriaValueText="",this.labelRef=De(),this.progressBarRef=De()}firstUpdated(e){super.firstUpdated(e),this.setComputedValues(),this.syncAttributes()}updated(e){super.updated(e),e.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),e.has("id")&&this.id&&(this.progressBarId=this.id),(e.has("statusType")||e.has("id")||e.has("ariaLabelledby"))&&(this.progressbarId=this.id||As(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(e.has("ariaValueText")||e.has("valueCurrent")||e.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const e=this.statusType!=="none",t=this.valueMax-this.valueMin,n=this.valueCurrent/t*100,i=this.statusType==="fraction"?Math.round(n):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),r=`${this.valueCurrent} av ${t}`,a=Z({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),l=Z({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),c=Z({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),h=Z({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return y` <div
1535
+ */const Ho="important",bp=" !"+Ho,kp=Ts(class extends un{constructor(s){var e;if(super(s),s.type!==Yt.ATTRIBUTE||s.name!=="style"||((e=s.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((e,t)=>{const n=s[t];return n==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(s,[e]){const{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const n of this.ft)e[n]==null&&(this.ft.delete(n),n.includes("-")?t.removeProperty(n):t[n]=null);for(const n in e){const i=e[n];if(i!=null){this.ft.add(n);const r=typeof i=="string"&&i.endsWith(bp);n.includes("-")||r?t.setProperty(n,r?i.slice(0,-11):i,r?Ho:""):t[n]=i}}return bt}});var vp=Object.defineProperty,yt=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&vp(e,t,i),i};class mt extends Kt{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=Ms(),this.role="progressbar",this.skin="dark-blue",this.statusPlacement="following",this.statusType="none",this.title="",this.titlePosition="left",this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.computedAriaLabelledby=null,this.computedAriaValueText="",this.labelRef=Ne(),this.progressBarRef=Ne()}firstUpdated(e){super.firstUpdated(e),this.setComputedValues(),this.syncAttributes()}updated(e){super.updated(e),e.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),e.has("id")&&this.id&&(this.progressBarId=this.id),(e.has("statusType")||e.has("id")||e.has("ariaLabelledby"))&&(this.progressbarId=this.id||Ms(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(e.has("ariaValueText")||e.has("valueCurrent")||e.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const e=this.statusType!=="none",t=this.valueMax-this.valueMin,n=this.valueCurrent/t*100,i=this.statusType==="fraction"?Math.round(n):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),r=`${this.valueCurrent} av ${t}`,a=Z({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),l=Z({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),c=Z({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),h=Z({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return y` <div
1536
1536
  class="pkt-progressbar__container"
1537
1537
  .ref=${this.progressBarRef}
1538
- style=${Qp({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${i}%`})}
1538
+ style=${kp({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${i}%`})}
1539
1539
  >
1540
1540
  ${this.title?y`<p id=${`${this.progressBarId}-title`} class=${l}>${this.title}</p>`:x}
1541
1541
 
@@ -1544,45 +1544,45 @@
1544
1544
  </div>
1545
1545
 
1546
1546
  ${e?y`<div class=${c}>
1547
- <span class=${h} ${Ne(this.labelRef)}>
1547
+ <span class=${h} ${De(this.labelRef)}>
1548
1548
  ${this.statusType==="percentage"?`${i}%`:r}
1549
1549
  </span>
1550
1550
  </div>`:x}
1551
- </div>`}setComputedValues(){this.progressbarId=this.id||As(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""}syncAttributes(){this._handleAttribute("aria-live",this.ariaLive),this._handleAttribute("aria-valuenow",this.valueCurrent),this._handleAttribute("aria-valuemin",this.valueMin),this._handleAttribute("aria-valuemax",this.valueMax),this._handleAttribute("aria-valuetext",this.computedAriaValueText),this._handleAttribute("aria-label",this.ariaLabel),this._handleAttribute("role",this.role),this._handleAttribute("aria-atomic","true"),this._handleAttribute("id",this.progressbarId),this.ariaLabel||this._handleAttribute("aria-labelledby",this.computedAriaLabelledby)}_handleAttribute(e,t){t==null||t===""?this.removeAttribute(e):this.setAttribute(e,String(t))}};vt([u({type:String})],ft.prototype,"ariaLabel",2),vt([u({type:String,reflect:!0})],ft.prototype,"ariaLabelledby",2),vt([u({type:String,reflect:!0})],ft.prototype,"ariaValueText",2),vt([u({type:String})],ft.prototype,"ariaLive",2),vt([u({type:String,reflect:!0})],ft.prototype,"id",2),vt([u({type:String})],ft.prototype,"role",2),vt([u({type:String})],ft.prototype,"skin",2),vt([u({type:String})],ft.prototype,"statusPlacement",2),vt([u({type:String})],ft.prototype,"statusType",2),vt([u({type:String,reflect:!0})],ft.prototype,"title",2),vt([u({type:String})],ft.prototype,"titlePosition",2),vt([u({type:Number,reflect:!0})],ft.prototype,"valueCurrent",2),vt([u({type:Number})],ft.prototype,"valueMax",2),vt([u({type:Number})],ft.prototype,"valueMin",2),vt([_e()],ft.prototype,"labelWidth",2),vt([_e()],ft.prototype,"progressbarId",2),vt([_e()],ft.prototype,"computedAriaLabelledby",2),vt([_e()],ft.prototype,"computedAriaValueText",2),ft=vt([Se("pkt-progressbar")],ft);var Rp=Object.defineProperty,ef=Object.getOwnPropertyDescriptor,Wt=(s,e,t,n)=>{for(var i=n>1?void 0:n?ef(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&Rp(e,t,i),i};let Lt=class extends he{constructor(){super(...arguments),this.inputRef=De(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(s,e,t){s==="defaultChecked"&&(this._checked=this.defaultChecked),s==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(s,e,t)}render(){const s=Z({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=Z({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),t=Z({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),n="pkt-tag pkt-tag--small pkt-tag--thin-text",i=()=>y`
1552
- ${this.tagText?y`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:x}
1553
- ${this.optionalTag?y`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:x}
1554
- ${this.requiredTag?y`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:x}
1555
- `,r=()=>y`
1556
- <label class=${t} for=${this.id+"-internal"}>
1557
- ${this.label} ${i()}
1551
+ </div>`}setComputedValues(){this.progressbarId=this.id||Ms(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""}syncAttributes(){this._handleAttribute("aria-live",this.ariaLive),this._handleAttribute("aria-valuenow",this.valueCurrent),this._handleAttribute("aria-valuemin",this.valueMin),this._handleAttribute("aria-valuemax",this.valueMax),this._handleAttribute("aria-valuetext",this.computedAriaValueText),this._handleAttribute("aria-label",this.ariaLabel),this._handleAttribute("role",this.role),this._handleAttribute("aria-atomic","true"),this._handleAttribute("id",this.progressbarId),this.ariaLabel||this._handleAttribute("aria-labelledby",this.computedAriaLabelledby)}_handleAttribute(e,t){t==null||t===""?this.removeAttribute(e):this.setAttribute(e,String(t))}}yt([u({type:String})],mt.prototype,"ariaLabel"),yt([u({type:String,reflect:!0})],mt.prototype,"ariaLabelledby"),yt([u({type:String,reflect:!0})],mt.prototype,"ariaValueText"),yt([u({type:String})],mt.prototype,"ariaLive"),yt([u({type:String,reflect:!0})],mt.prototype,"id"),yt([u({type:String})],mt.prototype,"role"),yt([u({type:String})],mt.prototype,"skin"),yt([u({type:String})],mt.prototype,"statusPlacement"),yt([u({type:String})],mt.prototype,"statusType"),yt([u({type:String,reflect:!0})],mt.prototype,"title"),yt([u({type:String})],mt.prototype,"titlePosition"),yt([u({type:Number,reflect:!0})],mt.prototype,"valueCurrent"),yt([u({type:Number})],mt.prototype,"valueMax"),yt([u({type:Number})],mt.prototype,"valueMin"),yt([_e()],mt.prototype,"labelWidth"),yt([_e()],mt.prototype,"progressbarId"),yt([_e()],mt.prototype,"computedAriaLabelledby"),yt([_e()],mt.prototype,"computedAriaValueText");try{Se("pkt-progressbar")(mt)}catch{console.warn("Forsøker å definere <pkt-progressbar>, men den er allerede definert")}var yp=Object.defineProperty,Zt=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&yp(e,t,i),i};class qt extends he{constructor(){super(...arguments),this.inputRef=Ne(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e==="defaultChecked"&&(this._checked=this.defaultChecked),e==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){const e=Z({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=Z({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),n=Z({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),i="pkt-tag pkt-tag--small pkt-tag--thin-text",r=()=>y`
1552
+ ${this.tagText?y`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:x}
1553
+ ${this.optionalTag?y`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:x}
1554
+ ${this.requiredTag?y`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:x}
1555
+ `,a=()=>y`
1556
+ <label class=${n} for=${this.id+"-internal"}>
1557
+ ${this.label} ${r()}
1558
1558
  ${this.checkHelptext?y`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:x}
1559
1559
  </label>
1560
1560
  `;return y`
1561
1561
  <div class="pkt-input-check">
1562
- <div class=${s}>
1562
+ <div class=${e}>
1563
1563
  <input
1564
1564
  id=${this.id+"-internal"}
1565
- class=${e}
1565
+ class=${t}
1566
1566
  type="radio"
1567
1567
  role="radio"
1568
1568
  ?disabled=${this.disabled}
1569
1569
  form=""
1570
1570
  name=${this.name+"-internal"}
1571
- ${Ne(this.inputRef)}
1571
+ ${De(this.inputRef)}
1572
1572
  @change=${this.toggleChecked}
1573
1573
  @input=${this.onInput}
1574
1574
  @blur=${this.onBlur}
1575
1575
  @focus=${this.onFocus}
1576
1576
  ?checked=${this.checked}
1577
1577
  />
1578
- ${r()}
1578
+ ${a()}
1579
1579
  </div>
1580
1580
  </div>
1581
- `}toggleChecked(s=null){s&&s.preventDefault(),s&&s.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};Wt([u({type:String,reflect:!0})],Lt.prototype,"value",2),Wt([u({type:String})],Lt.prototype,"checkHelptext",2),Wt([u({type:Boolean})],Lt.prototype,"defaultChecked",2),Wt([u({type:Boolean})],Lt.prototype,"hasTile",2),Wt([u({type:Boolean,reflect:!0})],Lt.prototype,"checked",2),Wt([u({type:String,reflect:!0})],Lt.prototype,"type",2),Wt([u({type:String})],Lt.prototype,"tagText",2),Wt([u({type:Boolean})],Lt.prototype,"optionalTag",2),Wt([u({type:String})],Lt.prototype,"optionalText",2),Wt([u({type:Boolean})],Lt.prototype,"requiredTag",2),Wt([u({type:String})],Lt.prototype,"requiredText",2),Wt([_e()],Lt.prototype,"_checked",2),Lt=Wt([Se("pkt-radiobutton")],Lt);/**
1581
+ `}toggleChecked(e=null){e&&e.preventDefault(),e&&e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}}Zt([u({type:String,reflect:!0})],qt.prototype,"value"),Zt([u({type:String})],qt.prototype,"checkHelptext"),Zt([u({type:Boolean})],qt.prototype,"defaultChecked"),Zt([u({type:Boolean})],qt.prototype,"hasTile"),Zt([u({type:Boolean,reflect:!0})],qt.prototype,"checked"),Zt([u({type:String,reflect:!0})],qt.prototype,"type"),Zt([u({type:String})],qt.prototype,"tagText"),Zt([u({type:Boolean})],qt.prototype,"optionalTag"),Zt([u({type:String})],qt.prototype,"optionalText"),Zt([u({type:Boolean})],qt.prototype,"requiredTag"),Zt([u({type:String})],qt.prototype,"requiredText"),Zt([_e()],qt.prototype,"_checked");try{Se("pkt-radiobutton")(qt)}catch{console.warn("Forsøker å definere <pkt-radiobutton>, men den er allerede definert")}/**
1582
1582
  * @license
1583
1583
  * Copyright 2021 Google LLC
1584
1584
  * SPDX-License-Identifier: BSD-3-Clause
1585
- */let Wo=class extends Event{constructor(e,t,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=i??!1}};/**
1585
+ */let Uo=class extends Event{constructor(s,e,t,n){super("context-request",{bubbles:!0,composed:!0}),this.context=s,this.contextTarget=e,this.callback=t,this.subscribe=n??!1}};/**
1586
1586
  * @license
1587
1587
  * Copyright 2021 Google LLC
1588
1588
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1590,33 +1590,33 @@
1590
1590
  * @license
1591
1591
  * Copyright 2021 Google LLC
1592
1592
  * SPDX-License-Identifier: BSD-3-Clause
1593
- */let zo=class{constructor(e,t,n,i){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,a)),this.unsubscribe=a},this.host=e,t.context!==void 0){const r=t;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=i??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Wo(this.context,this.host,this.t,this.subscribe))}};/**
1593
+ */let qo=class{constructor(e,t,n,i){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,a)),this.unsubscribe=a},this.host=e,t.context!==void 0){const r=t;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=i??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Uo(this.context,this.host,this.t,this.subscribe))}};/**
1594
1594
  * @license
1595
1595
  * Copyright 2021 Google LLC
1596
1596
  * SPDX-License-Identifier: BSD-3-Clause
1597
- */class tf{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){const n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:n}]of this.subscriptions)t(this.o,n)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});const{disposer:i}=this.subscriptions.get(e);e(this.value,i)}clearCallbacks(){this.subscriptions.clear()}}/**
1597
+ */class _p{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){const n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:n}]of this.subscriptions)t(this.o,n)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});const{disposer:i}=this.subscriptions.get(e);e(this.value,i)}clearCallbacks(){this.subscriptions.clear()}}/**
1598
1598
  * @license
1599
1599
  * Copyright 2021 Google LLC
1600
1600
  * SPDX-License-Identifier: BSD-3-Clause
1601
- */let sf=class extends Event{constructor(s,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=s,this.contextTarget=e}},Ko=class extends tf{constructor(e,t,n){var i,r;super(t.context!==void 0?t.initialValue:n),this.onContextRequest=a=>{if(a.context!==this.context)return;const l=a.contextTarget??a.composedPath()[0];l!==this.host&&(a.stopPropagation(),this.addCallback(a.callback,l,a.subscribe))},this.onProviderRequest=a=>{if(a.context!==this.context||(a.contextTarget??a.composedPath()[0])===this.host)return;const l=new Set;for(const[c,{consumerHost:h}]of this.subscriptions)l.has(c)||(l.add(c),h.dispatchEvent(new Wo(this.context,h,c,!0)));a.stopPropagation()},this.host=e,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),(r=(i=this.host).addController)==null||r.call(i,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new sf(this.context,this.host))}};/**
1601
+ */let wp=class extends Event{constructor(e,t){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},Wo=class extends _p{constructor(e,t,n){var i,r;super(t.context!==void 0?t.initialValue:n),this.onContextRequest=a=>{if(a.context!==this.context)return;const l=a.contextTarget??a.composedPath()[0];l!==this.host&&(a.stopPropagation(),this.addCallback(a.callback,l,a.subscribe))},this.onProviderRequest=a=>{if(a.context!==this.context||(a.contextTarget??a.composedPath()[0])===this.host)return;const l=new Set;for(const[c,{consumerHost:h}]of this.subscriptions)l.has(c)||(l.add(c),h.dispatchEvent(new Uo(this.context,h,c,!0)));a.stopPropagation()},this.host=e,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),(r=(i=this.host).addController)==null||r.call(i,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new wp(this.context,this.host))}};/**
1602
1602
  * @license
1603
1603
  * Copyright 2017 Google LLC
1604
1604
  * SPDX-License-Identifier: BSD-3-Clause
1605
- */function nf({context:s}){return(e,t)=>{const n=new WeakMap;if(typeof t=="object")return{get(){return e.get.call(this)},set(i){return n.get(this).setValue(i),e.set.call(this,i)},init(i){return n.set(this,new Ko(this,{context:s,initialValue:i})),i}};{e.constructor.addInitializer((a=>{n.set(a,new Ko(a,{context:s}))}));const i=Object.getOwnPropertyDescriptor(e,t);let r;if(i===void 0){const a=new WeakMap;r={get(){return a.get(this)},set(l){n.get(this).setValue(l),a.set(this,l)},configurable:!0,enumerable:!0}}else{const a=i.set;r={...i,set(l){n.get(this).setValue(l),a==null||a.call(this,l)}}}return void Object.defineProperty(e,t,r)}}}/**
1605
+ */function $p({context:s}){return(e,t)=>{const n=new WeakMap;if(typeof t=="object")return{get(){return e.get.call(this)},set(i){return n.get(this).setValue(i),e.set.call(this,i)},init(i){return n.set(this,new Wo(this,{context:s,initialValue:i})),i}};{e.constructor.addInitializer((a=>{n.set(a,new Wo(a,{context:s}))}));const i=Object.getOwnPropertyDescriptor(e,t);let r;if(i===void 0){const a=new WeakMap;r={get(){return a.get(this)},set(l){n.get(this).setValue(l),a.set(this,l)},configurable:!0,enumerable:!0}}else{const a=i.set;r={...i,set(l){n.get(this).setValue(l),a==null||a.call(this,l)}}}return void Object.defineProperty(e,t,r)}}}/**
1606
1606
  * @license
1607
1607
  * Copyright 2022 Google LLC
1608
1608
  * SPDX-License-Identifier: BSD-3-Clause
1609
- */function rf({context:s,subscribe:e}){return(t,n)=>{typeof n=="object"?n.addInitializer((function(){new zo(this,{context:s,callback:i=>{t.set.call(this,i)},subscribe:e})})):t.constructor.addInitializer((i=>{new zo(i,{context:s,callback:r=>{i[n]=r},subscribe:e})}))}}const Yo=Symbol("pkt-tabs-context");var af=Object.defineProperty,of=Object.getOwnPropertyDescriptor,Mn=(s,e,t,n)=>{for(var i=n>1?void 0:n?of(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&af(e,t,i),i};let rn=class extends xt{constructor(){super(...arguments),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has("arrowNav")||e.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(e,t){this.tabRefs[t]=e,this.tabCount=Math.max(this.tabCount,t+1)}handleClick(e){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){var n,i;this.useArrowNav&&(e.code==="ArrowLeft"&&t!==0&&((n=this.tabRefs[t-1])==null||n.focus()),e.code==="ArrowRight"&&t<this.tabCount-1&&((i=this.tabRefs[t+1])==null||i.focus()),(e.code==="ArrowDown"||e.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0})))}render(){const e=this.useArrowNav?"tablist":"navigation";return y`
1609
+ */function xp({context:s,subscribe:e}){return(t,n)=>{typeof n=="object"?n.addInitializer((function(){new qo(this,{context:s,callback:i=>{t.set.call(this,i)},subscribe:e})})):t.constructor.addInitializer((i=>{new qo(i,{context:s,callback:r=>{i[n]=r},subscribe:e})}))}}const jo=Symbol("pkt-tabs-context");var Sp=Object.defineProperty,ri=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Sp(e,t,i),i};let _n=class extends wt{constructor(){super(...arguments),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has("arrowNav")||e.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(e,t){this.tabRefs[t]=e,this.tabCount=Math.max(this.tabCount,t+1)}handleClick(e){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){var n,i;this.useArrowNav&&(e.code==="ArrowLeft"&&t!==0&&((n=this.tabRefs[t-1])==null||n.focus()),e.code==="ArrowRight"&&t<this.tabCount-1&&((i=this.tabRefs[t+1])==null||i.focus()),(e.code==="ArrowDown"||e.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0})))}render(){const e=this.useArrowNav?"tablist":"navigation";return y`
1610
1610
  <div class="pkt-tabs">
1611
- <div class="pkt-tabs__list" role=${e}>${tt(this)}</div>
1611
+ <div class="pkt-tabs__list" role=${e}>${Re(this)}</div>
1612
1612
  </div>
1613
- `}};Mn([u({type:Boolean,reflect:!0,attribute:"arrow-nav"})],rn.prototype,"arrowNav",2),Mn([u({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],rn.prototype,"disableArrowNav",2),Mn([_e()],rn.prototype,"tabRefs",2),Mn([_e()],rn.prototype,"tabCount",2),Mn([nf({context:Yo}),_e()],rn.prototype,"context",2),rn=Mn([Se("pkt-tabs")],rn);var lf=Object.defineProperty,cf=Object.getOwnPropertyDescriptor,$s=(s,e,t,n)=>{for(var i=n>1?void 0:n?cf(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&lf(e,t,i),i};let ps=class extends xt{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=De()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index)})}handleClick(){this.context&&this.context.handleClick(this.index)}handleKeyUp(e){this.context&&this.context.handleKeyUp(e,this.index)}render(){var e;const t=((e=this.context)==null?void 0:e.useArrowNav)??!0,n=this.active?"active":"",i=t?"tab":void 0,r=t?this.active:void 0,a=this.active||!t?void 0:-1,l=y`
1613
+ `}};ri([u({type:Boolean,reflect:!0,attribute:"arrow-nav"})],_n.prototype,"arrowNav"),ri([u({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],_n.prototype,"disableArrowNav"),ri([_e()],_n.prototype,"tabRefs"),ri([_e()],_n.prototype,"tabCount"),ri([$p({context:jo}),_e()],_n.prototype,"context");try{Se("pkt-tabs")(_n)}catch{console.warn("Forsøker å definere <pkt-tabs>, men den er allerede definert")}var Cp=Object.defineProperty,Os=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Cp(e,t,i),i};let ys=class extends wt{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=Ne()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index)})}handleClick(){this.context&&this.context.handleClick(this.index)}handleKeyUp(e){this.context&&this.context.handleKeyUp(e,this.index)}render(){var e;const t=((e=this.context)==null?void 0:e.useArrowNav)??!0,n=this.active?"active":"",i=t?"tab":void 0,r=t?this.active:void 0,a=this.active||!t?void 0:-1,l=y`
1614
1614
  ${this.icon?y`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
1615
- <span>${tt(this)}</span>
1615
+ <span>${Re(this)}</span>
1616
1616
  ${this.tag?y`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
1617
1617
  `;return this.href?y`
1618
1618
  <a
1619
- ${Ne(this.elementRef)}
1619
+ ${De(this.elementRef)}
1620
1620
  href=${this.href}
1621
1621
  class="pkt-tabs__link ${n}"
1622
1622
  role=${B(i)}
@@ -1630,7 +1630,7 @@
1630
1630
  </a>
1631
1631
  `:y`
1632
1632
  <button
1633
- ${Ne(this.elementRef)}
1633
+ ${De(this.elementRef)}
1634
1634
  type="button"
1635
1635
  class="pkt-tabs__button pkt-link-button ${n}"
1636
1636
  role=${B(i)}
@@ -1642,11 +1642,11 @@
1642
1642
  >
1643
1643
  ${l}
1644
1644
  </button>
1645
- `}};$s([u({type:Boolean,reflect:!0})],ps.prototype,"active",2),$s([u({type:String,reflect:!0})],ps.prototype,"href",2),$s([u({type:String,reflect:!0})],ps.prototype,"icon",2),$s([u({type:String,reflect:!0})],ps.prototype,"controls",2),$s([u({type:String,reflect:!0})],ps.prototype,"tag",2),$s([u({type:String,reflect:!0,attribute:"tag-skin"})],ps.prototype,"tagSkin",2),$s([u({type:Number,reflect:!0})],ps.prototype,"index",2),$s([rf({context:Yo,subscribe:!0}),u({attribute:!1})],ps.prototype,"context",2),ps=$s([Se("pkt-tab-item")],ps);/**
1645
+ `}};Os([u({type:Boolean,reflect:!0})],ys.prototype,"active"),Os([u({type:String,reflect:!0})],ys.prototype,"href"),Os([u({type:String,reflect:!0})],ys.prototype,"icon"),Os([u({type:String,reflect:!0})],ys.prototype,"controls"),Os([u({type:String,reflect:!0})],ys.prototype,"tag"),Os([u({type:String,reflect:!0,attribute:"tag-skin"})],ys.prototype,"tagSkin"),Os([u({type:Number,reflect:!0})],ys.prototype,"index"),Os([xp({context:jo,subscribe:!0}),u({attribute:!1})],ys.prototype,"context");try{Se("pkt-tab-item")(ys)}catch{console.warn("Forsøker å definere <pkt-tab-item>, men den er allerede definert")}/**
1646
1646
  * @license
1647
1647
  * Copyright 2020 Google LLC
1648
1648
  * SPDX-License-Identifier: BSD-3-Clause
1649
- */const uf=Ns(class extends vn{constructor(s){if(super(s),s.type!==Xt.PROPERTY&&s.type!==Xt.ATTRIBUTE&&s.type!==Xt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ja(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[e]){if(e===yt||e===x)return e;const t=s.element,n=s.name;if(s.type===Xt.PROPERTY){if(e===t[n])return yt}else if(s.type===Xt.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(n))return yt}else if(s.type===Xt.ATTRIBUTE&&t.getAttribute(n)===e+"")return yt;return za(s),e}});var df=Object.defineProperty,hf=Object.getOwnPropertyDescriptor,pi=(s,e,t,n)=>{for(var i=n>1?void 0:n?hf(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&df(e,t,i),i};let On=class extends he{constructor(){super(...arguments),this.inputRef=De(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0}attributeChangedCallback(s,e,t){s==="value"&&this.value!==e&&(this.counterCurrent=t?t.length:0,this.valueChanged(t,e)),super.attributeChangedCallback(s,e,t)}updated(s){var e;super.updated(s),s.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const s=Z({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),e=this.ariaLabelledby||`${this.id}-input-label`;return y`<pkt-input-wrapper
1649
+ */const Tp=Ts(class extends un{constructor(s){if(super(s),s.type!==Yt.PROPERTY&&s.type!==Yt.ATTRIBUTE&&s.type!==Yt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ha(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[e]){if(e===bt||e===x)return e;const t=s.element,n=s.name;if(s.type===Yt.PROPERTY){if(e===t[n])return bt}else if(s.type===Yt.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(n))return bt}else if(s.type===Yt.ATTRIBUTE&&t.getAttribute(n)===e+"")return bt;return qa(s),e}});var Np=Object.defineProperty,Yi=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Np(e,t,i),i};let ai=class extends he{constructor(){super(...arguments),this.inputRef=Ne(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e==="value"&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){var t;super.updated(e),e.has("value")&&(this.counterCurrent=((t=this.value)==null?void 0:t.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const e=Z({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),t=this.ariaLabelledby||`${this.id}-input-label`;return y`<pkt-input-wrapper
1650
1650
  label=${this.label}
1651
1651
  ?counter=${this.counter}
1652
1652
  ?disabled=${this.disabled}
@@ -1669,29 +1669,29 @@
1669
1669
  .tagText=${this.tagText}
1670
1670
  class="pkt-textarea"
1671
1671
  >
1672
- <div class="pkt-contents" slot="helptext">${tt(this,"helptext")}</div>
1672
+ <div class="pkt-contents" slot="helptext">${Re(this,"helptext")}</div>
1673
1673
  <textarea
1674
- ${Ne(this.inputRef)}
1675
- class=${s}
1674
+ ${De(this.inputRef)}
1675
+ class=${e}
1676
1676
  id=${this.id+"-input"}
1677
1677
  name=${(this.name||this.id)+"-input"}
1678
1678
  placeholder=${B(this.placeholder)}
1679
- .value=${uf(this.value)}
1679
+ .value=${Tp(this.value)}
1680
1680
  minlength=${B(this.minlength)}
1681
1681
  maxlength=${B(this.maxlength)}
1682
1682
  ?readonly=${this.readonly}
1683
1683
  autocomplete=${this.autocomplete}
1684
- aria-labelledby=${e}
1684
+ aria-labelledby=${t}
1685
1685
  aria-invalid=${this.hasError}
1686
1686
  aria-errormessage=${`${this.id}-error`}
1687
1687
  rows=${this.rows}
1688
1688
  ?disabled=${this.disabled}
1689
- @input=${t=>{this.value=t.target.value,this.onInput(),t.stopImmediatePropagation()}}
1690
- @change=${t=>{t.stopImmediatePropagation()}}
1691
- @focus=${t=>{this.onFocus(),t.stopImmediatePropagation()}}
1692
- @blur=${t=>{this.value=t.target.value,this.onBlur(),t.stopImmediatePropagation()}}
1689
+ @input=${n=>{this.value=n.target.value,this.onInput(),n.stopImmediatePropagation()}}
1690
+ @change=${n=>{n.stopImmediatePropagation()}}
1691
+ @focus=${n=>{this.onFocus(),n.stopImmediatePropagation()}}
1692
+ @blur=${n=>{this.value=n.target.value,this.onBlur(),n.stopImmediatePropagation()}}
1693
1693
  ></textarea>
1694
- </pkt-input-wrapper>`}};pi([u({type:String,reflect:!0})],On.prototype,"value",2),pi([u({type:String})],On.prototype,"autocomplete",2),pi([u({type:Number})],On.prototype,"rows",2),pi([_e()],On.prototype,"counterCurrent",2),On=pi([Se("pkt-textarea")],On);var pf=Object.defineProperty,Go=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&pf(e,t,i),i};let zr=class extends he{constructor(){super(...arguments),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate("_optionsProp",this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){var e,t;const n=this._optionsProp.length>0,i=((t=(e=this.optionsController)==null?void 0:e.nodes)==null?void 0:t.length)&&this.optionsController.nodes.length>0;n?this._options=this._optionsProp:i&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};Go([u({type:Array,attribute:"options"})],zr.prototype,"_optionsProp"),Go([_e()],zr.prototype,"_options");var ff=Object.defineProperty,mf=Object.getOwnPropertyDescriptor,Xo=(s,e,t,n)=>{for(var i=n>1?void 0:n?mf(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&ff(e,t,i),i};let Kr=class extends zr{constructor(){super(),this.inputRef=De(),this.value="",this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new Fo(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)})}add(s,e){const t={value:s.value||s.text,label:s.text||s.value,selected:s.selected,disabled:s.disabled};if(e===void 0)this._options.push(t);else if(typeof e=="number")this._options.splice(e,0,t);else{const n=e.value||e.text,i=this._options.findIndex(r=>r.value===n);i>=0?this._options.splice(i,0,t):this._options.push(t)}s.selected&&(this.value=s.value||s.text,this.selectedIndex=this._options.findIndex(n=>n.value===this.value)),this.requestUpdate()}remove(s){var e;typeof s=="number"&&(this.selectedIndex===s&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(s,1),this.requestUpdate())}item(s){var e;return(e=this.inputRef.value)==null?void 0:e.item(s)}namedItem(s){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(s)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(s,e,t){var n,i;s==="options"&&(this._options=t?JSON.parse(t):[]),s==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((n=this.inputRef.value)==null?void 0:n.selectedIndex):this._options.findIndex(r=>r.value===t),this.selectedOptions=(i=this.inputRef.value)==null?void 0:i.selectedOptions,this.valueChanged(t,e)),super.attributeChangedCallback(s,e,t)}update(s){var e,t;super.update(s),s.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),s.has("value")&&this.value!==s.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(n=>n.value===this.value),this.selectedOptions=(t=this.inputRef.value)==null?void 0:t.selectedOptions,this.valueChanged(this.value,s.get("value"))),s.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(s){var e;super.firstUpdated(s),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(t=>t.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const s=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return y`
1694
+ </pkt-input-wrapper>`}};Yi([u({type:String,reflect:!0})],ai.prototype,"value"),Yi([u({type:String})],ai.prototype,"autocomplete"),Yi([u({type:Number})],ai.prototype,"rows"),Yi([_e()],ai.prototype,"counterCurrent");try{Se("pkt-textarea")(ai)}catch{console.warn("Forsøker å definere <pkt-textarea>, men den er allerede definert")}var Dp=Object.defineProperty,zo=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Dp(e,t,i),i};let Wr=class extends he{constructor(){super(...arguments),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate("_optionsProp",this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){var e,t;const n=this._optionsProp.length>0,i=((t=(e=this.optionsController)==null?void 0:e.nodes)==null?void 0:t.length)&&this.optionsController.nodes.length>0;n?this._options=this._optionsProp:i&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};zo([u({type:Array,attribute:"options"})],Wr.prototype,"_optionsProp"),zo([_e()],Wr.prototype,"_options");var Mp=Object.defineProperty,Ep=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Mp(e,t,i),i};let Ko=class extends Wr{constructor(){super(),this.inputRef=Ne(),this.value="",this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new Io(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){const n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t=="number")this._options.splice(t,0,n);else{const i=t.value||t.text,r=this._options.findIndex(a=>a.value===i);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(i=>i.value===this.value)),this.requestUpdate()}remove(e){var t;typeof e=="number"&&(this.selectedIndex===e&&(this.value=((t=this._options[0])==null?void 0:t.value)||""),this._options.splice(e,1),this.requestUpdate())}item(e){var t;return(t=this.inputRef.value)==null?void 0:t.item(e)}namedItem(e){var t;return(t=this.inputRef.value)==null?void 0:t.namedItem(e)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){var i,r;e==="options"&&(this._options=n?JSON.parse(n):[]),e==="value"&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this._options.findIndex(a=>a.value===n),this.selectedOptions=(r=this.inputRef.value)==null?void 0:r.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){var t,n;super.update(e),e.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has("value")&&this.value!==e.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((t=this.inputRef.value)==null?void 0:t.selectedIndex):this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.selectedOptions,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){var t;super.firstUpdated(e),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(n=>n.value===this.value),this.selectedOptions=(t=this.inputRef.value)==null?void 0:t.selectedOptions}render(){const e=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return y`
1695
1695
  <pkt-input-wrapper
1696
1696
  ?counter=${this.counter}
1697
1697
  ?disabled=${this.disabled}
@@ -1714,7 +1714,7 @@
1714
1714
  tagText=${B(this.tagText)}
1715
1715
  >
1716
1716
  <select
1717
- class=${s}
1717
+ class=${e}
1718
1718
  aria-invalid=${this.hasError}
1719
1719
  aria-errormessage=${`${this.id}-error`}
1720
1720
  aria-labelledby=${B(this.ariaLabelledby)}
@@ -1722,24 +1722,24 @@
1722
1722
  id=${this.id+"-input"}
1723
1723
  name=${(this.name||this.id)+"-input"}
1724
1724
  value=${this.value}
1725
- @change=${e=>{this.touched=!0,this.value=e.target.value,e.stopImmediatePropagation()}}
1726
- @input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
1727
- @focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
1728
- @blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
1729
- ${Ne(this.inputRef)}
1725
+ @change=${t=>{this.touched=!0,this.value=t.target.value,t.stopImmediatePropagation()}}
1726
+ @input=${t=>{this.onInput(),t.stopImmediatePropagation()}}
1727
+ @focus=${t=>{this.onFocus(),t.stopImmediatePropagation()}}
1728
+ @blur=${t=>{this.onBlur(),t.stopImmediatePropagation()}}
1729
+ ${De(this.inputRef)}
1730
1730
  >
1731
- ${this._options.length>0?this._options.map(e=>y`<option
1732
- value=${e.value}
1733
- ?selected=${this.value==e.value||e.selected}
1734
- ?disabled=${e.disabled}
1735
- ?hidden=${e.hidden}
1731
+ ${this._options.length>0?this._options.map(t=>y`<option
1732
+ value=${t.value}
1733
+ ?selected=${this.value==t.value||t.selected}
1734
+ ?disabled=${t.disabled}
1735
+ ?hidden=${t.hidden}
1736
1736
  >
1737
- ${e.label}
1737
+ ${t.label}
1738
1738
  </option>`):""}
1739
1739
  </select>
1740
- <div class="pkt-contents" slot="helptext">${tt(this,"helptext")}</div>
1740
+ <div class="pkt-contents" slot="helptext">${Re(this,"helptext")}</div>
1741
1741
  </pkt-input-wrapper>
1742
- `}returnNumberOrNull(s){return s==null||isNaN(s)?null:s}};Xo([u({type:String})],Kr.prototype,"value",2),Kr=Xo([Se("pkt-select")],Kr);const gf=s=>/^\d{2}:\d{2}$/.test(s)&&parseInt(s.slice(0,2),10)<=23&&parseInt(s.slice(3),10)<=59,Yr=s=>{const[e,t]=s.split(":").map(Number);return e*60+t},Gr=s=>s?Math.max(1,Math.round(s/60)):1,bf=(s,e)=>{const t=s?parseInt(String(s).split(":")[0],10):0,n=e?parseInt(String(e).split(":")[0],10):23;return Array.from({length:n-t+1},(i,r)=>r+t)},vf=s=>{const e=Gr(s);return Array.from({length:Math.floor(60/e)},(t,n)=>n*e)},kf=(s,e,t,n)=>{let i=s!==""?parseInt(s,10):t===1?0:23,r=e!==""?parseInt(e,10):t===1?0:Math.floor(59/n)*n;return r+=t*n,r>59?(r=0,i=(i+1)%24):r<0&&(r=Math.floor(59/n)*n,i=(i-1+24)%24),{hours:String(i).padStart(2,"0"),minutes:String(r).padStart(2,"0")}};var yf=Object.defineProperty,_f=Object.getOwnPropertyDescriptor,an=(s,e,t,n)=>{for(var i=n>1?void 0:n?_f(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&yf(e,t,i),i};let Bs=class extends he{constructor(){super(...arguments),this.hiddenInputRef=De(),this.hoursInputRef=De(),this.minutesInputRef=De(),this.buttonRef=De(),this.value="",this.hidePicker=!1,this.stepArrows=!1,this._hours="",this._minutes="",this._isOpen=!1,this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._hasFocus=!1,this._outsideClickHandler=e=>{this.contains(e.target)||this._closePopup()},this._handleComponentFocusIn=()=>{this._hasFocus||(this._hasFocus=!0,this.onFocus())},this._handleComponentFocusOut=e=>{this.contains(e.relatedTarget)||(this._hasFocus=!1,this.onBlur())},this._handleHoursKeydown=e=>{var t,n,i;const r=e.target;switch(e.key){case"ArrowUp":{e.preventDefault();const a=this._hours!==""?parseInt(this._hours,10):0;this._hours=String((a+1)%24).padStart(2,"0"),this._syncValueFromDisplay(),this.onInput();break}case"ArrowDown":{e.preventDefault();const a=this._hours!==""?parseInt(this._hours,10):0;this._hours=String((a-1+24)%24).padStart(2,"0"),this._syncValueFromDisplay(),this.onInput();break}case"ArrowRight":e.preventDefault(),(t=this.minutesInputRef.value)==null||t.focus();break;case"Backspace":case"Delete":this._hoursDigitCount=0,this._hoursFirstDigit=-1;break;case"Tab":break;case"Enter":{e.preventDefault();const a=this.internals.form;a?a.requestSubmit():r.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();const a=parseInt(e.key,10);if(this._hoursDigitCount===0)this._hoursFirstDigit=a,this._hours=String(a).padStart(2,"0"),this._hoursDigitCount=1,this.onInput(),a>=3&&(this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),(n=this.minutesInputRef.value)==null||n.focus());else{const l=this._hoursFirstDigit*10+a;this._hours=l<=23?String(l).padStart(2,"0"):String(a).padStart(2,"0"),this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.onInput(),(i=this.minutesInputRef.value)==null||i.focus()}}else e.preventDefault()}},this._handleHoursBlur=()=>{this._hours!==""&&(this._hours=String(parseInt(this._hours,10)).padStart(2,"0")),this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._syncValueFromDisplay()},this._handleMinutesKeydown=e=>{var t;const n=e.target;switch(e.key){case"ArrowUp":{e.preventDefault();const i=this._minutes!==""?parseInt(this._minutes,10):0;this._minutes=String((i+this._minuteStep)%60).padStart(2,"0"),this._syncValueFromDisplay(),this.onInput();break}case"ArrowDown":{e.preventDefault();const i=this._minutes!==""?parseInt(this._minutes,10):0;this._minutes=String((i-this._minuteStep+60)%60).padStart(2,"0"),this._syncValueFromDisplay(),this.onInput();break}case"ArrowLeft":e.preventDefault(),(t=this.hoursInputRef.value)==null||t.focus();break;case"Backspace":case"Delete":this._minutesDigitCount=0,this._minutesFirstDigit=-1;break;case"Tab":break;case"Enter":{e.preventDefault();const i=this.internals.form;i?i.requestSubmit():n.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();const i=parseInt(e.key,10);if(this._minutesDigitCount===0)this._minutesFirstDigit=i,this._minutes=String(i).padStart(2,"0"),this._minutesDigitCount=1,this.onInput(),i>=6&&(this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay());else{const r=this._minutesFirstDigit*10+i;this._minutes=r<=59?String(r).padStart(2,"0"):String(i).padStart(2,"0"),this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay(),this.onInput()}}else e.preventDefault()}},this._handleMinutesBlur=()=>{this._minutes!==""&&(this._minutes=String(parseInt(this._minutes,10)).padStart(2,"0")),this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._syncValueFromDisplay()},this._handlePopupKeydown=e=>{var t;const n=document.activeElement,i=n.closest(".pkt-timepicker-popup__col");if(!i)return;const r=Array.from(i.querySelectorAll(".pkt-timepicker-popup__option")),a=r.indexOf(n),l=n.dataset.type??"";switch(e.key){case"ArrowDown":e.preventDefault(),this._focusOptionAndSync(r[Math.min(a+1,r.length-1)],l);break;case"ArrowUp":e.preventDefault(),this._focusOptionAndSync(r[Math.max(a-1,0)],l);break;case"Home":e.preventDefault(),this._focusOptionAndSync(r[0],l);break;case"End":e.preventDefault(),this._focusOptionAndSync(r[r.length-1],l);break;case"ArrowRight":e.preventDefault(),l==="hour"&&(this._focusOptionAndSync(n,l),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst("minute")}));break;case"ArrowLeft":e.preventDefault(),l==="minute"&&(this._focusOptionAndSync(n,l),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst("hour")}));break;case"Enter":case" ":e.preventDefault(),n.click();break;case"Escape":e.preventDefault(),this._closePopup(),(t=this.buttonRef.value)==null||t.focus();break}}}get inputRef(){return this.hiddenInputRef}manageValidity(e){const t=this.hoursInputRef.value;if(!t)return;if(this.required&&!this.value){this.internals.setValidity({valueMissing:!0},dt.forms.messages.required,t),this._setAriaInvalid(!0);return}if(!this.value){this.internals.setValidity({}),this._setAriaInvalid(!1);return}const n=Yr(this.value),i=Gr(this.step);if(this.min&&n<Yr(String(this.min))){this.internals.setValidity({rangeUnderflow:!0},dt.forms.messages.rangeUnderflowMin.replace("{min}",String(this.min)),t),this._setAriaInvalid(!0);return}if(this.max&&n>Yr(String(this.max))){this.internals.setValidity({rangeOverflow:!0},dt.forms.messages.rangeOverflowMax.replace("{max}",String(this.max)),t),this._setAriaInvalid(!0);return}if(this.step&&n%i!==0){const r=i===60?dt.forms.messages.timeStepMismatchHour:i===30?dt.forms.messages.timeStepMismatchHalfHour:dt.forms.messages.timeStepMismatch.replace("{step}",`${i}, ${i*2}, ${i*3}`);this.internals.setValidity({stepMismatch:!0},r,t),this._setAriaInvalid(!0);return}this.internals.setValidity({}),this._setAriaInvalid(!1)}_setAriaInvalid(e){if(!this.touched&&e)return;const t=this.hoursInputRef.value,n=this.minutesInputRef.value;e?(t==null||t.setAttribute("aria-invalid","true"),n==null||n.setAttribute("aria-invalid","true")):(t==null||t.removeAttribute("aria-invalid"),n==null||n.removeAttribute("aria-invalid"))}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this._handleComponentFocusIn),this.addEventListener("focusout",this._handleComponentFocusOut),document.addEventListener("click",this._outsideClickHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focusin",this._handleComponentFocusIn),this.removeEventListener("focusout",this._handleComponentFocusOut),document.removeEventListener("click",this._outsideClickHandler)}willUpdate(e){super.willUpdate(e),e.has("value")&&this._syncDisplayFromValue()}updated(e){super.updated(e),this.classList.toggle("pkt-timepicker--stepper",this.stepArrows),this.classList.toggle("pkt-timepicker--fullwidth",this.fullwidth),e.has("step")&&this.step!==null&&!this._isValidStep(this.step)&&console.warn(`pkt-timepicker: step="${this.step}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)}formResetCallback(){super.formResetCallback(),this._hours="",this._minutes="",this._isOpen=!1}_isValidStep(e){return e===3600||e<3600&&3600%e===0&&e%60===0}_syncDisplayFromValue(){const e=gf(this.value)?this.value.split(":"):null;e?(this._hours=e[0],this._minutes=e[1]):(this._hours="",this._minutes="")}_syncValueFromDisplay(){if(this._hours!==""&&this._minutes!==""){const e=`${this._hours}:${this._minutes}`;e!==this.value&&(this.value=e,this.onChange(e))}else this.value!==""&&(this.value="",this.onChange(""))}get _minuteStep(){return Gr(this.step)}get _hourOptions(){return bf(this.min,this.max)}get _minuteOptions(){return vf(this.step)}_openPopup(){this._isOpen=!0,this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst("hour")})}_closePopup(){this._isOpen=!1,this._syncValueFromDisplay()}_togglePopup(){this._isOpen?this._closePopup():this._openPopup()}_scrollToSelected(){const e=this.querySelector(".pkt-timepicker-popup");e&&e.querySelectorAll(".pkt-timepicker-popup__col").forEach(t=>{const n=t.querySelector(".pkt-timepicker-popup__option--selected");n&&n.scrollIntoView({block:"center"})})}_focusSelectedOrFirst(e){var t;const n=this.querySelector(".pkt-timepicker-popup");if(!n)return;const i=n.querySelectorAll(".pkt-timepicker-popup__col"),r=e==="hour"?i[0]:i[1];if(!r)return;const a=r.querySelector(".pkt-timepicker-popup__option--selected"),l=r.querySelector(".pkt-timepicker-popup__option");(t=a||l)==null||t.focus()}_handleOptionClick(e,t){var n;const i=String(e).padStart(2,"0");t==="hour"?(this._hours=i,this.updateComplete.then(()=>this._focusSelectedOrFirst("minute"))):(this._minutes=i,this._closePopup(),(n=this.buttonRef.value)==null||n.focus())}_focusOptionAndSync(e,t){if(!e)return;const n=parseInt(e.dataset.value??"0",10);t==="hour"?this._hours=String(n).padStart(2,"0"):this._minutes=String(n).padStart(2,"0"),e.focus()}_stepTime(e){const t=kf(this._hours,this._minutes,e,this._minuteStep);this._hours=t.hours,this._minutes=t.minutes,this._syncValueFromDisplay()}_renderOption(e,t){const n=String(e).padStart(2,"0"),i=t==="hour"?this._hours!==""?parseInt(this._hours,10):NaN:this._minutes!==""?parseInt(this._minutes,10):NaN,r=e===i;return y`
1742
+ `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};Ep([u({type:String})],Ko.prototype,"value");try{Se("pkt-select")(Ko)}catch{console.warn("Forsøker å definere <pkt-select>, men den er allerede definert")}const Op=s=>/^\d{2}:\d{2}$/.test(s)&&parseInt(s.slice(0,2),10)<=23&&parseInt(s.slice(3),10)<=59,jr=s=>{const[e,t]=s.split(":").map(Number);return e*60+t},zr=s=>s?Math.max(1,Math.round(s/60)):1,Ap=(s,e)=>{const t=s?parseInt(String(s).split(":")[0],10):0,n=e?parseInt(String(e).split(":")[0],10):23;return Array.from({length:n-t+1},(i,r)=>r+t)},Ip=s=>{const e=zr(s);return Array.from({length:Math.floor(60/e)},(t,n)=>n*e)},Pp=(s,e,t,n)=>{let i=s!==""?parseInt(s,10):t===1?0:23,r=e!==""?parseInt(e,10):t===1?0:Math.floor(59/n)*n;return r+=t*n,r>59?(r=0,i=(i+1)%24):r<0&&(r=Math.floor(59/n)*n,i=(i-1+24)%24),{hours:String(i).padStart(2,"0"),minutes:String(r).padStart(2,"0")}};var Lp=Object.defineProperty,wn=(s,e,t,n)=>{for(var i=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(i=a(e,t,i)||i);return i&&Lp(e,t,i),i};let Zs=class extends he{constructor(){super(...arguments),this.hiddenInputRef=Ne(),this.hoursInputRef=Ne(),this.minutesInputRef=Ne(),this.buttonRef=Ne(),this.value="",this.hidePicker=!1,this.stepArrows=!1,this._hours="",this._minutes="",this._isOpen=!1,this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._hasFocus=!1,this._outsideClickHandler=e=>{this.contains(e.target)||this._closePopup()},this._handleComponentFocusIn=()=>{this._hasFocus||(this._hasFocus=!0,this.onFocus())},this._handleComponentFocusOut=e=>{this.contains(e.relatedTarget)||(this._hasFocus=!1,this.onBlur())},this._handleHoursKeydown=e=>{var t,n,i;const r=e.target;switch(e.key){case"ArrowUp":{e.preventDefault();const a=this._hours!==""?parseInt(this._hours,10):0;this._hours=String((a+1)%24).padStart(2,"0"),this._syncValueFromDisplay(),this.onInput();break}case"ArrowDown":{e.preventDefault();const a=this._hours!==""?parseInt(this._hours,10):0;this._hours=String((a-1+24)%24).padStart(2,"0"),this._syncValueFromDisplay(),this.onInput();break}case"ArrowRight":e.preventDefault(),(t=this.minutesInputRef.value)==null||t.focus();break;case"Backspace":case"Delete":this._hoursDigitCount=0,this._hoursFirstDigit=-1;break;case"Tab":break;case"Enter":{e.preventDefault();const a=this.internals.form;a?a.requestSubmit():r.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();const a=parseInt(e.key,10);if(this._hoursDigitCount===0)this._hoursFirstDigit=a,this._hours=String(a).padStart(2,"0"),this._hoursDigitCount=1,this.onInput(),a>=3&&(this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),(n=this.minutesInputRef.value)==null||n.focus());else{const l=this._hoursFirstDigit*10+a;this._hours=l<=23?String(l).padStart(2,"0"):String(a).padStart(2,"0"),this._hoursFirstDigit=-1,this._hoursDigitCount=0,this._syncValueFromDisplay(),this.onInput(),(i=this.minutesInputRef.value)==null||i.focus()}}else e.preventDefault()}},this._handleHoursBlur=()=>{this._hours!==""&&(this._hours=String(parseInt(this._hours,10)).padStart(2,"0")),this._hoursDigitCount=0,this._hoursFirstDigit=-1,this._syncValueFromDisplay()},this._handleMinutesKeydown=e=>{var t;const n=e.target;switch(e.key){case"ArrowUp":{e.preventDefault();const i=this._minutes!==""?parseInt(this._minutes,10):0;this._minutes=String((i+this._minuteStep)%60).padStart(2,"0"),this._syncValueFromDisplay(),this.onInput();break}case"ArrowDown":{e.preventDefault();const i=this._minutes!==""?parseInt(this._minutes,10):0;this._minutes=String((i-this._minuteStep+60)%60).padStart(2,"0"),this._syncValueFromDisplay(),this.onInput();break}case"ArrowLeft":e.preventDefault(),(t=this.hoursInputRef.value)==null||t.focus();break;case"Backspace":case"Delete":this._minutesDigitCount=0,this._minutesFirstDigit=-1;break;case"Tab":break;case"Enter":{e.preventDefault();const i=this.internals.form;i?i.requestSubmit():n.blur();break}default:if(/^\d$/.test(e.key)){e.preventDefault();const i=parseInt(e.key,10);if(this._minutesDigitCount===0)this._minutesFirstDigit=i,this._minutes=String(i).padStart(2,"0"),this._minutesDigitCount=1,this.onInput(),i>=6&&(this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay());else{const r=this._minutesFirstDigit*10+i;this._minutes=r<=59?String(r).padStart(2,"0"):String(i).padStart(2,"0"),this._minutesFirstDigit=-1,this._minutesDigitCount=0,this._syncValueFromDisplay(),this.onInput()}}else e.preventDefault()}},this._handleMinutesBlur=()=>{this._minutes!==""&&(this._minutes=String(parseInt(this._minutes,10)).padStart(2,"0")),this._minutesDigitCount=0,this._minutesFirstDigit=-1,this._syncValueFromDisplay()},this._handlePopupKeydown=e=>{var t;const n=document.activeElement,i=n.closest(".pkt-timepicker-popup__col");if(!i)return;const r=Array.from(i.querySelectorAll(".pkt-timepicker-popup__option")),a=r.indexOf(n),l=n.dataset.type??"";switch(e.key){case"ArrowDown":e.preventDefault(),this._focusOptionAndSync(r[Math.min(a+1,r.length-1)],l);break;case"ArrowUp":e.preventDefault(),this._focusOptionAndSync(r[Math.max(a-1,0)],l);break;case"Home":e.preventDefault(),this._focusOptionAndSync(r[0],l);break;case"End":e.preventDefault(),this._focusOptionAndSync(r[r.length-1],l);break;case"ArrowRight":e.preventDefault(),l==="hour"&&(this._focusOptionAndSync(n,l),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst("minute")}));break;case"ArrowLeft":e.preventDefault(),l==="minute"&&(this._focusOptionAndSync(n,l),this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst("hour")}));break;case"Enter":case" ":e.preventDefault(),n.click();break;case"Escape":e.preventDefault(),this._closePopup(),(t=this.buttonRef.value)==null||t.focus();break}}}get inputRef(){return this.hiddenInputRef}manageValidity(e){const t=this.hoursInputRef.value;if(!t)return;if(this.required&&!this.value){this.internals.setValidity({valueMissing:!0},dt.forms.messages.required,t),this._setAriaInvalid(!0);return}if(!this.value){this.internals.setValidity({}),this._setAriaInvalid(!1);return}const n=jr(this.value),i=zr(this.step);if(this.min&&n<jr(String(this.min))){this.internals.setValidity({rangeUnderflow:!0},dt.forms.messages.rangeUnderflowMin.replace("{min}",String(this.min)),t),this._setAriaInvalid(!0);return}if(this.max&&n>jr(String(this.max))){this.internals.setValidity({rangeOverflow:!0},dt.forms.messages.rangeOverflowMax.replace("{max}",String(this.max)),t),this._setAriaInvalid(!0);return}if(this.step&&n%i!==0){const r=i===60?dt.forms.messages.timeStepMismatchHour:i===30?dt.forms.messages.timeStepMismatchHalfHour:dt.forms.messages.timeStepMismatch.replace("{step}",`${i}, ${i*2}, ${i*3}`);this.internals.setValidity({stepMismatch:!0},r,t),this._setAriaInvalid(!0);return}this.internals.setValidity({}),this._setAriaInvalid(!1)}_setAriaInvalid(e){if(!this.touched&&e)return;const t=this.hoursInputRef.value,n=this.minutesInputRef.value;e?(t==null||t.setAttribute("aria-invalid","true"),n==null||n.setAttribute("aria-invalid","true")):(t==null||t.removeAttribute("aria-invalid"),n==null||n.removeAttribute("aria-invalid"))}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this._handleComponentFocusIn),this.addEventListener("focusout",this._handleComponentFocusOut),document.addEventListener("click",this._outsideClickHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focusin",this._handleComponentFocusIn),this.removeEventListener("focusout",this._handleComponentFocusOut),document.removeEventListener("click",this._outsideClickHandler)}willUpdate(e){super.willUpdate(e),e.has("value")&&this._syncDisplayFromValue()}updated(e){super.updated(e),this.classList.toggle("pkt-timepicker--stepper",this.stepArrows),this.classList.toggle("pkt-timepicker--fullwidth",this.fullwidth),e.has("step")&&this.step!==null&&!this._isValidStep(this.step)&&console.warn(`pkt-timepicker: step="${this.step}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)}formResetCallback(){super.formResetCallback(),this._hours="",this._minutes="",this._isOpen=!1}_isValidStep(e){return e===3600||e<3600&&3600%e===0&&e%60===0}_syncDisplayFromValue(){const e=Op(this.value)?this.value.split(":"):null;e?(this._hours=e[0],this._minutes=e[1]):(this._hours="",this._minutes="")}_syncValueFromDisplay(){if(this._hours!==""&&this._minutes!==""){const e=`${this._hours}:${this._minutes}`;e!==this.value&&(this.value=e,this.onChange(e))}else this.value!==""&&(this.value="",this.onChange(""))}get _minuteStep(){return zr(this.step)}get _hourOptions(){return Ap(this.min,this.max)}get _minuteOptions(){return Ip(this.step)}_openPopup(){this._isOpen=!0,this.updateComplete.then(()=>{this._scrollToSelected(),this._focusSelectedOrFirst("hour")})}_closePopup(){this._isOpen=!1,this._syncValueFromDisplay()}_togglePopup(){this._isOpen?this._closePopup():this._openPopup()}_scrollToSelected(){const e=this.querySelector(".pkt-timepicker-popup");e&&e.querySelectorAll(".pkt-timepicker-popup__col").forEach(t=>{const n=t.querySelector(".pkt-timepicker-popup__option--selected");n&&n.scrollIntoView({block:"center"})})}_focusSelectedOrFirst(e){var t;const n=this.querySelector(".pkt-timepicker-popup");if(!n)return;const i=n.querySelectorAll(".pkt-timepicker-popup__col"),r=e==="hour"?i[0]:i[1];if(!r)return;const a=r.querySelector(".pkt-timepicker-popup__option--selected"),l=r.querySelector(".pkt-timepicker-popup__option");(t=a||l)==null||t.focus()}_handleOptionClick(e,t){var n;const i=String(e).padStart(2,"0");t==="hour"?(this._hours=i,this.updateComplete.then(()=>this._focusSelectedOrFirst("minute"))):(this._minutes=i,this._closePopup(),(n=this.buttonRef.value)==null||n.focus())}_focusOptionAndSync(e,t){if(!e)return;const n=parseInt(e.dataset.value??"0",10);t==="hour"?this._hours=String(n).padStart(2,"0"):this._minutes=String(n).padStart(2,"0"),e.focus()}_stepTime(e){const t=Pp(this._hours,this._minutes,e,this._minuteStep);this._hours=t.hours,this._minutes=t.minutes,this._syncValueFromDisplay()}_renderOption(e,t){const n=String(e).padStart(2,"0"),i=t==="hour"?this._hours!==""?parseInt(this._hours,10):NaN:this._minutes!==""?parseInt(this._minutes,10):NaN,r=e===i;return y`
1743
1743
  <button
1744
1744
  class=${Z({"pkt-btn":!0,"pkt-btn--tertiary":!0,"pkt-btn--small":!0,"pkt-btn--label-only":!0,"pkt-timepicker-popup__option":!0,"pkt-timepicker-popup__option--selected":r})}
1745
1745
  type="button"
@@ -1782,7 +1782,7 @@
1782
1782
  `}_renderContainer(){var e,t,n,i,r,a,l,c;const h=((e=this.strings.timepicker)==null?void 0:e.hours)??"Timer",g=((t=this.strings.timepicker)==null?void 0:t.minutes)??"Minutter",m=this.label?`${h}, ${this.label}`:h,f=this.label?`${g}, ${this.label}`:g;return y`
1783
1783
  <div
1784
1784
  class="pkt-input__container"
1785
- @click=${v=>{var b;v.target.closest("button, input")||(b=this.hoursInputRef.value)==null||b.focus()}}
1785
+ @click=${k=>{var b;k.target.closest("button, input")||(b=this.hoursInputRef.value)==null||b.focus()}}
1786
1786
  >
1787
1787
  ${this.stepArrows?y`
1788
1788
  <button
@@ -1799,7 +1799,7 @@
1799
1799
  </button>
1800
1800
  `:x}
1801
1801
  <input
1802
- ${Ne(this.hoursInputRef)}
1802
+ ${De(this.hoursInputRef)}
1803
1803
  type="text"
1804
1804
  inputmode="numeric"
1805
1805
  maxlength="2"
@@ -1821,11 +1821,11 @@
1821
1821
  ?disabled=${this.disabled}
1822
1822
  @keydown=${this._handleHoursKeydown}
1823
1823
  @blur=${this._handleHoursBlur}
1824
- @focus=${v=>{v.target.select(),v.stopImmediatePropagation()}}
1824
+ @focus=${k=>{k.target.select(),k.stopImmediatePropagation()}}
1825
1825
  />
1826
1826
  <span class="pkt-timepicker__separator">:</span>
1827
1827
  <input
1828
- ${Ne(this.minutesInputRef)}
1828
+ ${De(this.minutesInputRef)}
1829
1829
  type="text"
1830
1830
  inputmode="numeric"
1831
1831
  maxlength="2"
@@ -1847,7 +1847,7 @@
1847
1847
  ?disabled=${this.disabled}
1848
1848
  @keydown=${this._handleMinutesKeydown}
1849
1849
  @blur=${this._handleMinutesBlur}
1850
- @focus=${v=>{v.target.select(),v.stopImmediatePropagation()}}
1850
+ @focus=${k=>{k.target.select(),k.stopImmediatePropagation()}}
1851
1851
  />
1852
1852
  ${this.hidePicker&&!this.stepArrows?y`<pkt-icon
1853
1853
  class="pkt-input-icon pkt-timepicker__icon"
@@ -1856,7 +1856,7 @@
1856
1856
  ></pkt-icon>`:x}
1857
1857
  ${!this.hidePicker&&!this.stepArrows?y`
1858
1858
  <button
1859
- ${Ne(this.buttonRef)}
1859
+ ${De(this.buttonRef)}
1860
1860
  class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button"
1861
1861
  type="button"
1862
1862
  aria-label=${((r=this.strings.timepicker)==null?void 0:r.openPicker)??"Åpne tidspunkt-velger"}
@@ -1887,7 +1887,7 @@
1887
1887
  </button>
1888
1888
  `:x}
1889
1889
  <input
1890
- ${Ne(this.hiddenInputRef)}
1890
+ ${De(this.hiddenInputRef)}
1891
1891
  type="time"
1892
1892
  hidden
1893
1893
  name=${this.name||this.id}
@@ -1922,15 +1922,15 @@
1922
1922
  .requiredText=${this.requiredText}
1923
1923
  .tagText=${this.tagText}
1924
1924
  >
1925
- <div class="pkt-contents" slot="helptext">${tt(this,"helptext")}</div>
1925
+ <div class="pkt-contents" slot="helptext">${Re(this,"helptext")}</div>
1926
1926
  ${!this.hidePicker&&!this.stepArrows?y`
1927
1927
  <div class="pkt-timepicker__anchor">
1928
1928
  ${this._renderContainer()} ${this._renderPopup()}
1929
1929
  </div>
1930
1930
  `:this._renderContainer()}
1931
1931
  </pkt-input-wrapper>
1932
- `}};an([u({type:String,reflect:!0})],Bs.prototype,"value",2),an([u({type:Boolean,reflect:!0,attribute:"hide-picker"})],Bs.prototype,"hidePicker",2),an([u({type:Boolean,reflect:!0,attribute:"step-arrows"})],Bs.prototype,"stepArrows",2),an([_e()],Bs.prototype,"_hours",2),an([_e()],Bs.prototype,"_minutes",2),an([_e()],Bs.prototype,"_isOpen",2),Bs=an([Se("pkt-timepicker")],Bs);const te=Bn({tagName:"pkt-icon",elementClass:Ys,react:d,displayName:"PktIcon",events:{}}),Qo=d.forwardRef(({defaultOpen:s=!1,id:e,title:t,skin:n,compact:i=!1,isOpen:r,children:a,name:l,className:c,onClick:h,onToggle:g},m)=>{const[f,v]=d.useState(s),{name:b}=yc(),w=l||b,C=r!==void 0?r:f;d.useEffect(()=>{r===void 0&&v(s)},[s,r]);const S=E=>{const U=E.currentTarget.open;U!==C&&(r===void 0&&v(U),g==null||g(E))},T=E=>{setTimeout(()=>{h==null||h(E)},0)},F=["pkt-accordion-item",i&&"pkt-accordion-item--compact",n&&`pkt-accordion-item--${n}`,c].filter(Boolean).join(" ");return o.jsxs("details",{ref:m,className:F,id:e,open:C,onClick:T,name:w,onToggle:S,children:[o.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${e}`,children:[t,o.jsx(te,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),o.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${e}`,role:"region",children:o.jsx("div",{className:"pkt-accordion-item__content-inner",children:a})})]})});Qo.displayName="PktAccordionItem";function $f(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Xr={exports:{}};/*!
1932
+ `}};wn([u({type:String,reflect:!0})],Zs.prototype,"value"),wn([u({type:Boolean,reflect:!0,attribute:"hide-picker"})],Zs.prototype,"hidePicker"),wn([u({type:Boolean,reflect:!0,attribute:"step-arrows"})],Zs.prototype,"stepArrows"),wn([_e()],Zs.prototype,"_hours"),wn([_e()],Zs.prototype,"_minutes"),wn([_e()],Zs.prototype,"_isOpen");try{Se("pkt-timepicker")(Zs)}catch{console.warn("Forsøker å definere <pkt-timepicker>, men den er allerede definert")}const te=Dn({tagName:"pkt-icon",elementClass:dn,react:d,displayName:"PktIcon",events:{}}),Yo=d.forwardRef(({defaultOpen:s=!1,id:e,title:t,skin:n,compact:i=!1,isOpen:r,children:a,name:l,className:c,onClick:h,onToggle:g},m)=>{const[f,k]=d.useState(s),{name:b}=bc(),$=l||b,C=r!==void 0?r:f;d.useEffect(()=>{r===void 0&&k(s)},[s,r]);const S=O=>{const U=O.currentTarget.open;U!==C&&(r===void 0&&k(U),g==null||g(O))},T=O=>{setTimeout(()=>{h==null||h(O)},0)},F=["pkt-accordion-item",i&&"pkt-accordion-item--compact",n&&`pkt-accordion-item--${n}`,c].filter(Boolean).join(" ");return o.jsxs("details",{ref:m,className:F,id:e,open:C,onClick:T,name:$,onToggle:S,children:[o.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${e}`,children:[t,o.jsx(te,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),o.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${e}`,role:"region",children:o.jsx("div",{className:"pkt-accordion-item__content-inner",children:a})})]})});Yo.displayName="PktAccordionItem";function Fp(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Kr={exports:{}};/*!
1933
1933
  Copyright (c) 2018 Jed Watson.
1934
1934
  Licensed under the MIT License (MIT), see
1935
1935
  http://jedwatson.github.io/classnames
1936
- */var Zo;function wf(){return Zo||(Zo=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(r=i(r,n(l)))}return r}function n(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var l in r)e.call(r,l)&&r[l]&&(a=i(a,l));return a}function i(r,a){return a?r?r+" "+a:r+a:r}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(Xr)),Xr.exports}var xf=wf();const pe=$f(xf),Zi=({children:s,closeAlert:e,compact:t,title:n,date:i,ariaLive:r,"aria-live":a="polite",role:l="status",skin:c="info",className:h,...g})=>{const[m,f]=d.useState(!1),v={"pkt-alert":!0,"pkt-alert--compact":t,[`pkt-alert--${c}`]:c,"pkt-hide":m},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!n,"pkt-alert__noDate":!i},w=d.useCallback(()=>{f(!0),g.onClose&&g.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[g.onClose,f]),C=r||a;return o.jsx("div",{...g,"aria-live":C,role:l,className:pe(v,h),children:o.jsxs("div",{className:pe(b),children:[o.jsx(te,{className:"pkt-alert__icon","aria-hidden":"true",name:c==="info"?"alert-information":`alert-${c}`}),e&&o.jsx("div",{className:"pkt-alert__close",children:o.jsx(wt,{tabIndex:0,"aria-label":"close",size:t?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:w,children:o.jsx("span",{className:"sr-only",children:"Lukk"})})}),n&&o.jsx("div",{className:"pkt-alert__title",children:n}),o.jsx("div",{className:"pkt-alert__text",children:s}),i&&o.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",i]})]})})};Zi.displayName="PktAlert";const Jo=d.forwardRef(({href:s="/",text:e="Forsiden",ariaLabel:t,renderLink:n,...i},r)=>{const a=o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),o.jsx("span",{className:"pkt-back-link__text",children:e})]}),l=n||(({href:c,className:h,children:g,props:m})=>o.jsx("a",{href:c,className:h,...m,children:g}));return o.jsx("nav",{className:"pkt-back-link","aria-label":t||"Gå tilbake til forrige side",ref:r,children:l({href:s,className:"pkt-link pkt-link--icon-left",children:a,props:i})})});Jo.displayName="PktBackLink";const Ro=d.forwardRef(({breadcrumbs:s,navigationType:e,renderLink:t,className:n,...i},r)=>{const a=s,l=a[a.length-2],c=[n,"pkt-breadcrumbs"].filter(Boolean).join(" "),h=t||(e==="router"?({href:g,className:m,children:f,props:v})=>o.jsx(kc.Link,{to:g,className:m,...v,children:f}):({href:g,className:m,children:f,props:v})=>o.jsx("a",{href:g,className:m,...v,children:f}));return o.jsxs("nav",{ref:r,"aria-label":"brødsmulemeny",className:c,children:[o.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((g,m)=>o.jsx("li",{className:"pkt-breadcrumbs__item",children:m===a.length-1?o.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:o.jsx("span",{className:"pkt-breadcrumbs__text",children:g.text})}):h({href:g.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:g.text})]}),props:i})},`breadcrumb-${m}`))}),h({href:l.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:l.text})]}),props:i})]})});Ro.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/16.7/animations/";const wt=d.forwardRef(({children:s,className:e,iconName:t="user",secondIconName:n="user",iconPath:i,secondIconPath:r,size:a="medium",fullWidth:l=!1,fullWidthOnMobile:c=!1,skin:h="primary",type:g="button",variant:m="label-only",state:f,color:v,isLoading:b=void 0,disabled:w=void 0,loadingAnimationPath:C=window.pktAnimationPath,...S},T)=>{const F=[e,"pkt-btn",a&&`pkt-btn--${a}`,l&&"pkt-btn--full",c&&"pkt-btn--full-small",h&&`pkt-btn--${h}`,m&&`pkt-btn--${m}`,v&&`pkt-btn--${v}`,f&&`pkt-btn--${f}`,b&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return o.jsxs("button",{...S,"aria-busy":b||void 0,"aria-disabled":w||void 0,disabled:w,className:F,type:g,ref:T,children:[b&&o.jsx(te,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:C}),m!=="label-only"&&o.jsx(te,{className:"pkt-btn__icon",name:t,...i&&{path:i}}),o.jsx("span",{className:"pkt-btn__text",children:s}),m==="icons-right-and-left"&&o.jsx(te,{className:"pkt-btn__icon",name:n,...r&&{path:r}})]})});wt.displayName="PktButton";const el=6048e5,Sf=864e5,tl=Symbol.for("constructDateFrom");function fs(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&tl in s?s[tl](e):s instanceof Date?new s.constructor(e):new Date(e)}function Ft(s,e){return fs(e||s,s)}function sl(s,e,t){const n=Ft(s,t==null?void 0:t.in);return isNaN(e)?fs(s,NaN):(e&&n.setDate(n.getDate()+e),n)}let Cf={};function Ji(){return Cf}function fi(s,e){var l,c,h,g;const t=Ji(),n=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((g=(h=t.locale)==null?void 0:h.options)==null?void 0:g.weekStartsOn)??0,i=Ft(s,e==null?void 0:e.in),r=i.getDay(),a=(r<n?7:0)+r-n;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function Ri(s,e){return fi(s,{...e,weekStartsOn:1})}function nl(s,e){const t=Ft(s,e==null?void 0:e.in),n=t.getFullYear(),i=fs(t,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const r=Ri(i),a=fs(t,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const l=Ri(a);return t.getTime()>=r.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}function il(s){const e=Ft(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function rl(s,...e){const t=fs.bind(null,e.find(n=>typeof n=="object"));return e.map(t)}function Qr(s,e){const t=Ft(s,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function Tf(s,e,t){const[n,i]=rl(t==null?void 0:t.in,s,e),r=Qr(n),a=Qr(i),l=+r-il(r),c=+a-il(a);return Math.round((l-c)/Sf)}function Df(s,e){const t=nl(s,e),n=fs(s,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Ri(n)}function Nf(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Mf(s){return!(!Nf(s)&&typeof s!="number"||isNaN(+Ft(s)))}function Of(s,e){const t=Ft(s,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function Ef(s,e){const[t,n]=rl(s,e.start,e.end);return{start:t,end:n}}function al(s,e){const{start:t,end:n}=Ef(e==null?void 0:e.in,s);let i=+t>+n;const r=i?+t:+n,a=i?n:t;a.setHours(0,0,0,0);let l=1;const c=[];for(;+a<=r;)c.push(fs(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return i?c.reverse():c}function Pf(s,e){const t=Ft(s,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Af={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},If=(s,e,t)=>{let n;const i=Af[s];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function Zr(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Lf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ff={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Bf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Vf={date:Zr({formats:Lf,defaultWidth:"full"}),time:Zr({formats:Ff,defaultWidth:"full"}),dateTime:Zr({formats:Bf,defaultWidth:"full"})},Hf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Uf=(s,e,t,n)=>Hf[s];function mi(s){return(e,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let i;if(n==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;i=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;i=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return i[r]}}const qf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wf={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},zf={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Kf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Yf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Gf={ordinalNumber:(s,e)=>{const t=Number(s),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:mi({values:qf,defaultWidth:"wide"}),quarter:mi({values:jf,defaultWidth:"wide",argumentCallback:s=>s-1}),month:mi({values:Wf,defaultWidth:"wide"}),day:mi({values:zf,defaultWidth:"wide"}),dayPeriod:mi({values:Kf,defaultWidth:"wide",formattingValues:Yf,defaultFormattingWidth:"wide"})};function gi(s){return(e,t={})=>{const n=t.width,i=n&&s.matchPatterns[n]||s.matchPatterns[s.defaultMatchWidth],r=e.match(i);if(!r)return null;const a=r[0],l=n&&s.parsePatterns[n]||s.parsePatterns[s.defaultParseWidth],c=Array.isArray(l)?Qf(l,m=>m.test(a)):Xf(l,m=>m.test(a));let h;h=s.valueCallback?s.valueCallback(c):c,h=t.valueCallback?t.valueCallback(h):h;const g=e.slice(a.length);return{value:h,rest:g}}}function Xf(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Qf(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function Zf(s){return(e,t={})=>{const n=e.match(s.matchPattern);if(!n)return null;const i=n[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(i.length);return{value:a,rest:l}}}const Jf=/^(\d+)(th|st|nd|rd)?/i,Rf=/\d+/i,em={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},tm={any:[/^b/i,/^(a|c)/i]},sm={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},nm={any:[/1/i,/2/i,/3/i,/4/i]},im={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rm={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},am={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},om={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lm={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cm={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},um={ordinalNumber:Zf({matchPattern:Jf,parsePattern:Rf,valueCallback:s=>parseInt(s,10)}),era:gi({matchPatterns:em,defaultMatchWidth:"wide",parsePatterns:tm,defaultParseWidth:"any"}),quarter:gi({matchPatterns:sm,defaultMatchWidth:"wide",parsePatterns:nm,defaultParseWidth:"any",valueCallback:s=>s+1}),month:gi({matchPatterns:im,defaultMatchWidth:"wide",parsePatterns:rm,defaultParseWidth:"any"}),day:gi({matchPatterns:am,defaultMatchWidth:"wide",parsePatterns:om,defaultParseWidth:"any"}),dayPeriod:gi({matchPatterns:lm,defaultMatchWidth:"any",parsePatterns:cm,defaultParseWidth:"any"})},dm={code:"en-US",formatDistance:If,formatLong:Vf,formatRelative:Uf,localize:Gf,match:um,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hm(s,e){const t=Ft(s,e==null?void 0:e.in);return Tf(t,Pf(t))+1}function pm(s,e){const t=Ft(s,e==null?void 0:e.in),n=+Ri(t)-+Df(t);return Math.round(n/el)+1}function ol(s,e){var g,m,f,v;const t=Ft(s,e==null?void 0:e.in),n=t.getFullYear(),i=Ji(),r=(e==null?void 0:e.firstWeekContainsDate)??((m=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)??i.firstWeekContainsDate??((v=(f=i.locale)==null?void 0:f.options)==null?void 0:v.firstWeekContainsDate)??1,a=fs((e==null?void 0:e.in)||s,0);a.setFullYear(n+1,0,r),a.setHours(0,0,0,0);const l=fi(a,e),c=fs((e==null?void 0:e.in)||s,0);c.setFullYear(n,0,r),c.setHours(0,0,0,0);const h=fi(c,e);return+t>=+l?n+1:+t>=+h?n:n-1}function fm(s,e){var l,c,h,g;const t=Ji(),n=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((g=(h=t.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,i=ol(s,e),r=fs((e==null?void 0:e.in)||s,0);return r.setFullYear(i,0,n),r.setHours(0,0,0,0),fi(r,e)}function ll(s,e){const t=Ft(s,e==null?void 0:e.in),n=+fi(t,e)-+fm(t,e);return Math.round(n/el)+1}function je(s,e){const t=s<0?"-":"",n=Math.abs(s).toString().padStart(e,"0");return t+n}const Vs={y(s,e){const t=s.getFullYear(),n=t>0?t:1-t;return je(e==="yy"?n%100:n,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):je(t+1,2)},d(s,e){return je(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return je(s.getHours()%12||12,e.length)},H(s,e){return je(s.getHours(),e.length)},m(s,e){return je(s.getMinutes(),e.length)},s(s,e){return je(s.getSeconds(),e.length)},S(s,e){const t=e.length,n=s.getMilliseconds(),i=Math.trunc(n*Math.pow(10,t-3));return je(i,e.length)}},En={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cl={G:function(s,e,t){const n=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const n=s.getFullYear(),i=n>0?n:1-n;return t.ordinalNumber(i,{unit:"year"})}return Vs.y(s,e)},Y:function(s,e,t,n){const i=ol(s,n),r=i>0?i:1-i;if(e==="YY"){const a=r%100;return je(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):je(r,e.length)},R:function(s,e){const t=nl(s);return je(t,e.length)},u:function(s,e){const t=s.getFullYear();return je(t,e.length)},Q:function(s,e,t){const n=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return je(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(s,e,t){const n=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return je(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(s,e,t){const n=s.getMonth();switch(e){case"M":case"MM":return Vs.M(s,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(s,e,t){const n=s.getMonth();switch(e){case"L":return String(n+1);case"LL":return je(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(s,e,t,n){const i=ll(s,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):je(i,e.length)},I:function(s,e,t){const n=pm(s);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):je(n,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):Vs.d(s,e)},D:function(s,e,t){const n=hm(s);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):je(n,e.length)},E:function(s,e,t){const n=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(s,e,t,n){const i=s.getDay(),r=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return je(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(s,e,t,n){const i=s.getDay(),r=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return je(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(s,e,t){const n=s.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return je(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(s,e,t){const i=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,e,t){const n=s.getHours();let i;switch(n===12?i=En.noon:n===0?i=En.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(s,e,t){const n=s.getHours();let i;switch(n>=17?i=En.evening:n>=12?i=En.afternoon:n>=4?i=En.morning:i=En.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let n=s.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return Vs.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):Vs.H(s,e)},K:function(s,e,t){const n=s.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):je(n,e.length)},k:function(s,e,t){let n=s.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):je(n,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):Vs.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):Vs.s(s,e)},S:function(s,e){return Vs.S(s,e)},X:function(s,e,t){const n=s.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return dl(n);case"XXXX":case"XX":return on(n);case"XXXXX":case"XXX":default:return on(n,":")}},x:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"x":return dl(n);case"xxxx":case"xx":return on(n);case"xxxxx":case"xxx":default:return on(n,":")}},O:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ul(n,":");case"OOOO":default:return"GMT"+on(n,":")}},z:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ul(n,":");case"zzzz":default:return"GMT"+on(n,":")}},t:function(s,e,t){const n=Math.trunc(+s/1e3);return je(n,e.length)},T:function(s,e,t){return je(+s,e.length)}};function ul(s,e=""){const t=s>0?"-":"+",n=Math.abs(s),i=Math.trunc(n/60),r=n%60;return r===0?t+String(i):t+String(i)+e+je(r,2)}function dl(s,e){return s%60===0?(s>0?"-":"+")+je(Math.abs(s)/60,2):on(s,e)}function on(s,e=""){const t=s>0?"-":"+",n=Math.abs(s),i=je(Math.trunc(n/60),2),r=je(n%60,2);return t+i+e+r}const hl=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},pl=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},mm={p:pl,P:(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return hl(s,e);let r;switch(n){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",hl(n,e)).replace("{{time}}",pl(i,e))}},gm=/^D+$/,bm=/^Y+$/,vm=["D","DD","YY","YYYY"];function km(s){return gm.test(s)}function ym(s){return bm.test(s)}function _m(s,e,t){const n=$m(s,e,t);if(console.warn(n),vm.includes(s))throw new RangeError(n)}function $m(s,e,t){const n=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const wm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xm=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sm=/^'([^]*?)'?$/,Cm=/''/g,Tm=/[a-zA-Z]/;function Dm(s,e,t){var g,m,f,v;const n=Ji(),i=n.locale??dm,r=n.firstWeekContainsDate??((m=(g=n.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)??1,a=n.weekStartsOn??((v=(f=n.locale)==null?void 0:f.options)==null?void 0:v.weekStartsOn)??0,l=Ft(s,t==null?void 0:t.in);if(!Mf(l))throw new RangeError("Invalid time value");let c=e.match(xm).map(b=>{const w=b[0];if(w==="p"||w==="P"){const C=mm[w];return C(b,i.formatLong)}return b}).join("").match(wm).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const w=b[0];if(w==="'")return{isToken:!1,value:Nm(b)};if(cl[w])return{isToken:!0,value:b};if(w.match(Tm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:b}});i.localize.preprocessor&&(c=i.localize.preprocessor(l,c));const h={firstWeekContainsDate:r,weekStartsOn:a,locale:i};return c.map(b=>{if(!b.isToken)return b.value;const w=b.value;(ym(w)||km(w))&&_m(w,e,String(s));const C=cl[w[0]];return C(l,w,i.localize,h)}).join("")}function Nm(s){const e=s.match(Sm);return e?e[1].replace(Cm,"'"):s}function Mm(s,e){const t=Ft(s,e==null?void 0:e.in).getDay();return t===0?7:t}function Om(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const Jr={},bi={};function ln(s,e){try{const n=(Jr[s]||(Jr[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return n in bi?bi[n]:fl(n,n.split(":"))}catch{if(s in bi)return bi[s];const t=s==null?void 0:s.match(Em);return t?fl(s,t.slice(1)):NaN}}const Em=/([+-]\d\d):?(\d\d)?/;function fl(s,e){const t=+(e[0]||0),n=+(e[1]||0),i=+(e[2]||0)/60;return bi[s]=t*60+n>0?t*60+n+i:t*60-n-i}class ms extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ln(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),gl(this),Rr(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new ms(...t,e):new ms(Date.now(),e)}withTimeZone(e){return new ms(+this,e)}getTimezoneOffset(){const e=-ln(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Rr(this),+this}[Symbol.for("constructDateFrom")](e){return new ms(+new Date(e),this.timeZone)}}const ml=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ml.test(s))return;const e=s.replace(ml,"$1UTC");ms.prototype[e]&&(s.startsWith("get")?ms.prototype[s]=function(){return this.internal[e]()}:(ms.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Pm(this),+this},ms.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Rr(this),+this}))});function Rr(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ln(s.timeZone,s)*60))}function Pm(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),gl(s)}function gl(s){const e=ln(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),n=new Date(+s);n.setUTCHours(n.getUTCHours()-1);const i=-new Date(+s).getTimezoneOffset(),r=-new Date(+n).getTimezoneOffset(),a=i-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const c=i-t;c&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+c);const h=new Date(+s);h.setUTCSeconds(0);const g=i>0?h.getSeconds():(h.getSeconds()-60)%60,m=Math.round(-(ln(s.timeZone,s)*60))%60;(m||g)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+m+g));const f=ln(s.timeZone,s),v=f>0?Math.floor(f):Math.ceil(f),w=-new Date(+s).getTimezoneOffset()-v,C=v!==t,S=w-c;if(C&&S){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+S);const T=ln(s.timeZone,s),F=T>0?Math.floor(T):Math.ceil(T),E=v-F;E&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+E),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+E))}}class Hs extends ms{static tz(e,...t){return t.length?new Hs(...t,e):new Hs(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),i=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,i]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${n} ${t} ${i}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,i]=this.tzComponents();return`${e} GMT${t}${n}${i} (${Om(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",n=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),i=String(Math.abs(e)%60).padStart(2,"0");return[t,n,i]}withTimeZone(e){return new Hs(+this,e)}[Symbol.for("constructDateFrom")](e){return new Hs(+new Date(e),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Am=(s=window.pktTz)=>{const e=new Hs(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function gs(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,n]=s.split("-").map(Number);return new Date(e,t-1,n)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const Dt=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),n=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${n}`},vi=s=>{if(!s)return null;const e=gs(s);return isNaN(e.getTime())?null:e},Im=(s,e)=>{const t=ws(s);return isNaN(t.getTime())?"":Dm(t,e)},ws=(s="",e)=>{const t=typeof s=="string"?gs(s):s;return!t||isNaN(t.getTime())?new Date:e?e==="end"?Of(t):Qr(t):t},Pn=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const n=new Date(s,e,t);return isNaN(n.getTime())?new Date:n},ki=s=>{let e;return typeof s=="number"?e=new Hs(s,window.pktTz):e=new Hs(s,window.pktTz),e.setHours(12,0,0,0),e};let ea=null,bl;const Lm=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!ea||bl!==e)&&(ea=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),bl=e),ea.format(s)},Fm=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const n=e?ws(e):null,i=t?ws(t):null;return!(n&&s<n||i&&s>i)},Bm=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=Dt(s);return e.includes(t)},Vm=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},vl=(s,e,t,n,i)=>!(!s||isNaN(s.getTime())||!Fm(s,e,t)||n&&Bm(s,n)||i&&Vm(s,i)),Hm=(s,e,t,n,i)=>s.filter(r=>{const a=vi(r);return a&&vl(a,e,t,n,i)}),Um=s=>s.slice().sort((e,t)=>{const n=vi(e),i=vi(t);return!n||!i?0:n.getTime()-i.getTime()}),qm=(s,e)=>{const t=vi(s),n=vi(e);return!t||!n?!1:t<=n};function kl(s,e){const t=(e.excludedates??[]).map(n=>typeof n=="string"?n:Dt(n));return!vl(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function jm(s,e,t,n){return!!(kl(s,t)||!e&&n.multiple&&n.maxMultiple>0&&n.selectedCount>=n.maxMultiple)}function Wm(s,e,t){const n=Pn(s,e,0);return!(t&&ws(t)>n)}function zm(s,e,t){const n=Pn(e===11?s+1:s,e===11?0:e+1,1);return!(t&&ws(t)<n)}function yl(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>gs(e))}function _l(s,e){const t=al({start:s,end:e}),n={};if(Array.isArray(t)&&t.length)for(let i=0;i<t.length;i++){const r=t[i],a=r>s&&r<e;n[Dt(r)]=a}return n}function $l(s,e,t,n){if(e.length!==1)return!0;const i=al({start:e[0],end:s});if(!Array.isArray(i)||!i.length)return!0;for(let r=0;r<i.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((n??[]).includes(Mm(i[r]).toString()))return!1}return!0}function ta(s,e){const t=Dt(s);return e.includes(t)?e:[...e,t]}function sa(s,e){const t=Dt(s),n=e.indexOf(t);if(n===-1)return e;if(e.length===1)return[];const i=[...e];return i.splice(n,1),i}function wl(s,e,t){const n=Dt(s);return e.includes(n)?sa(s,e):t>0&&e.length>=t?e:ta(s,e)}function Km(s,e,t){const n=Dt(s),i=yl(e);if(e.includes(n))return e.indexOf(n)===0?[]:sa(s,e);if(e.length>1)return[n];if(e.length===1){if(!$l(s,i,t.excludedates,t.excludeweekdays))return[n];if(i[0]>s)return[n]}return ta(s,e)}const yi=7,Ym=6;function Gm(s,e){const t=Pn(s,e,1),n=Pn(s,e+1,0),i=(t.getDay()+Ym)%yi,r=n.getDate(),a=Math.ceil((r+i)/yi),c=Pn(s,e,0).getDate(),h=ll(t);return{firstDayOfMonth:t,lastDayOfMonth:n,startingDay:i,numDays:r,numRows:a,numDaysPrevMonth:c,initialWeek:h}}function Xm(s,e,t,n){const{startingDay:i,numDays:r}=n;return s===0&&e<i?"prev-month":t>r?"next-month":"current-month"}function Qm(s,e,t,n){const{startingDay:i,numDaysPrevMonth:r,numDays:a}=n;return s==="prev-month"?r-(i-e-1):s==="next-month"?t-a:t}const Zm={ArrowLeft:-1,ArrowRight:1,ArrowUp:-yi,ArrowDown:yi};function Jm(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Rm(s,e,t){let n=sl(s,e);if(!n)return null;let i=t(`button[data-date="${Dt(n)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(n=sl(n,e),i=t(`button[data-date="${Dt(n)}"]`),!i)return null;return n}function eg(s){return Zm[s]??null}const tg={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"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"};function sg(s){const{selected:e,multiple:t=!1,maxMultiple:n=0,range:i=!1,earliest:r=null,latest:a=null,excludedates:l,excludeweekdays:c=[],weeknumbers:h=!1,withcontrols:g=!1,currentmonth:m,today:f,strings:v,onDateSelected:b,onClose:w,id:C,className:S}=s,T=d.useId(),F=C??T,E=d.useMemo(()=>({...tg,...v}),[v]),W=d.useMemo(()=>f?gs(f):Am(),[f]),U=d.useMemo(()=>l?l.map(k=>typeof k=="string"?gs(k):k):[],[l]),Q=e!==void 0,[$e,z]=d.useState([]),M=Q?e:$e,G=d.useMemo(()=>yl(M),[M]),[V,ee]=d.useState(0),[le,ne]=d.useState(0),[me,ke]=d.useState({}),[fe,ce]=d.useState(null),[de,Qe]=d.useState(null),J=d.useRef(null),P=d.useRef([]),Le=d.useRef(0),Ve=d.useRef(!1),ae=d.useRef(!1),Ye=d.useMemo(()=>({earliest:r,latest:a,excludedates:U,excludeweekdays:c}),[r,a,U,c]);d.useEffect(()=>{let k=null;if(m!=null&&(m instanceof Date?k=ki(m):typeof m=="string"&&(k=gs(m))),!k||isNaN(k.getTime()))if(M.length>0&&M[0]!==""){const p=gs(M[M.length-1]);k=isNaN(p.getTime())?ki(W):p}else k=ki(W);if((!k||isNaN(k.getTime()))&&(k=ki(W)),a){const p=typeof a=="string"?gs(a):a;!isNaN(p.getTime())&&k>p&&(k=p)}if(r){const p=typeof r=="string"?gs(r):r;!isNaN(p.getTime())&&k<p&&(k=p)}ee(k.getFullYear()),ne(k.getMonth()),ae.current=!0},[]),d.useEffect(()=>{if(ae.current&&!Ve.current&&M.length>0&&M[0]!==""){const k=gs(M[M.length-1]);isNaN(k.getTime())||(ee(k.getFullYear()),ne(k.getMonth()))}},[M]),d.useEffect(()=>{i&&G.length===2?ke(_l(G[0],G[1])):(!i||G.length<2)&&ke({})},[i,G]);const xe=d.useCallback(k=>{Q||z(k),b==null||b(k)},[Q,b]),ve=d.useCallback(()=>{w==null||w()},[w]),oe=d.useCallback((k,p)=>{ee(typeof k=="string"?parseInt(k):k),ne(typeof p=="string"?parseInt(p):p),Le.current=0,Qe(null),P.current=[],Ve.current=!0},[]),ue=d.useCallback(()=>{const k=le===0?11:le-1,p=le===0?V-1:V;oe(p,k)},[V,le,oe]),Me=d.useCallback(()=>{const k=le===11?0:le+1,p=le===11?V+1:V;oe(p,k)},[V,le,oe]),Ae=d.useCallback(k=>kl(k,Ye),[Ye]),Te=d.useCallback((k,p)=>jm(k,p,Ye,{multiple:t,maxMultiple:n,selectedCount:M.length}),[Ye,t,n,M.length]),I=d.useCallback(()=>typeof M=="string"?M.split(","):M,[M]),We=d.useCallback(k=>{if(!i||G.length!==1||!$l(k,G,U,c)||G[0]>=k){ce(null);return}ce(k),ke(_l(G[0],k))},[i,G,U,c]),Ie=d.useCallback(k=>{if(!k)return;let p;if(i)p=Km(k,I(),{excludedates:U,excludeweekdays:c}),Q||z(p),p.length===2?(b==null||b(p),ve()):(p.length===1&&ke({}),b==null||b(p));else if(t)p=wl(k,I(),n),xe(p);else{const $=Dt(k);M.includes($)?p=[]:p=[$],xe(p),ve()}},[i,t,n,I,M,U,c,Q,xe,ve,b]),j=d.useCallback(k=>{const p=ta(k,I());Q||z(p),i&&p.length===2&&(b==null||b(p),ve())},[I,Q,i,b,ve]),q=d.useCallback(k=>{const p=sa(k,I());Q||z(p)},[I,Q]),se=d.useCallback(k=>{const p=wl(k,I(),n);Q||z(p)},[I,n,Q]),ge=d.useCallback(()=>{var D,Y;const k=Dt(ki(W)),p=(D=J.current)==null?void 0:D.querySelector(`button[data-date="${k}"]`);if(p instanceof HTMLButtonElement){Qe(k),p.focus();return}const $=P.current.find(K=>!K.isDisabled);if($){const K=(Y=J.current)==null?void 0:Y.querySelector(`button[data-date="${$.currentDateISO}"]`);K instanceof HTMLButtonElement&&(Qe($.currentDateISO),K.focus())}},[]),R=d.useCallback((k,p)=>{const $=k.target;if(Jm($))return;if(k.preventDefault(),!de){ge();return}const D=ws(de),Y=Rm(D,p,J.current.querySelector.bind(J.current));if(Y){const K=J.current.querySelector(`button[data-date="${Dt(Y)}"]`);K instanceof HTMLButtonElement&&!K.dataset.disabled&&(Qe(Dt(Y)),K.focus())}},[de,ge]),ze=d.useCallback(k=>{if(k.key==="Escape"){k.preventDefault(),ve();return}const p=eg(k.key);p!==null&&R(k.nativeEvent,p)},[ve,R]),He=d.useCallback(k=>{J.current&&!J.current.contains(k.relatedTarget)&&!k.target.classList.contains("pkt-hide")&&ve()},[ve]);return{componentId:F,strings:E,todayDate:W,year:V,month:le,activeSelected:M,_selected:G,inRange:me,rangeHovered:fe,focusedDate:de,range:i,multiple:t,weeknumbers:h,withcontrols:g,earliest:r,latest:a,excludedates:U,excludeweekdays:c,className:S,dateConstraints:Ye,calendarRef:J,selectableDatesRef:P,tabIndexSetRef:Le,prevMonth:ue,nextMonth:Me,changeMonth:oe,handleDateSelect:Ie,addToSelected:j,removeFromSelected:q,toggleSelectedDate:se,handleRangeHover:We,isExcluded:Ae,isDayDisabled:Te,focusOnCurrentDate:ge,handleKeydown:ze,handleFocusOut:He,close:ve,setFocusedDate:Qe}}const ng=({componentId:s,strings:e,year:t,month:n,earliest:i,latest:r,withcontrols:a,prevMonth:l,nextMonth:c,changeMonth:h})=>{const g=f=>{const v=f==="prev",b=v?Wm(t,n,i):zm(t,n,r),w=v?e.prevMonth:e.nextMonth,C=v?"chevron-thin-left":"chevron-thin-right",S=v?"pkt-calendar__prev-month":"pkt-calendar__next-month",T=v?l:c;return o.jsx("div",{children:o.jsxs("button",{type:"button","aria-label":w,onClick:()=>b&&T(),onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),b&&T())},className:["pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",S,!b&&"pkt-invisible"].filter(Boolean).join(" "),"data-disabled":b?void 0:"disabled","aria-disabled":!b||void 0,tabIndex:b?0:-1,children:[o.jsx(te,{className:"pkt-btn__icon",name:C}),o.jsx("span",{className:"pkt-btn__text",children:w})]})})},m=()=>a?o.jsxs("div",{className:"pkt-cal-month-picker",children:[o.jsx("label",{htmlFor:`${s}-monthnav`,className:"pkt-hide",children:e.month}),o.jsx("select",{"aria-label":e.month,className:"pkt-input pkt-input-compact",id:`${s}-monthnav`,value:n,onChange:f=>{f.stopPropagation(),h(t,parseInt(f.target.value))},children:e.months.map((f,v)=>o.jsx("option",{value:v,children:f},v))}),o.jsx("label",{htmlFor:`${s}-yearnav`,className:"pkt-hide",children:e.year}),o.jsx("input",{"aria-label":e.year,className:"pkt-input pkt-cal-input-year pkt-input-compact",id:`${s}-yearnav`,type:"number",size:4,placeholder:"0000",value:t,onChange:f=>{f.stopPropagation(),h(parseInt(f.target.value),n)}})]}):o.jsxs("div",{className:"pkt-txt-16-medium pkt-calendar__month-title","aria-live":"polite",children:[e.months[n]," ",t]});return o.jsxs("nav",{className:"pkt-cal-month-nav",children:[g("prev"),m(),g("next")]})};function ig(s,e,t){const n=Pn(t.year,t.month,s),i=Dt(n),r=i===Dt(e),a=t.activeSelected.includes(i),l=t.isDayDisabled(n,a);let c;return t.focusedDate?c=t.focusedDate===i&&!l?"0":"-1":!l&&t.tabIndexSetRef.current===0?(t.tabIndexSetRef.current=s,c="0"):c=t.tabIndexSetRef.current===s?"0":"-1",{currentDate:n,currentDateISO:i,isToday:r,isSelected:a,isDisabled:l,ariaLabel:Lm(n),tabindex:c}}function rg(s,e){const{currentDateISO:t,isToday:n,isSelected:i}=s,r=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],a=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return pe({"pkt-cal-today":n,"pkt-cal-selected":i,"pkt-cal-in-range":e.inRange[t],"pkt-cal-excluded":e.isExcluded(s.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":e.rangeHovered!==null&&t===Dt(e.rangeHovered)})}function ag(s,e){const{currentDateISO:t,isToday:n,isSelected:i,isDisabled:r}=s,a=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],l=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return pe({"pkt-calendar__date":!0,"pkt-calendar__date--today":n,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":e.inRange[t],"pkt-calendar__date--in-range-hover":e.rangeHovered!==null&&t===Dt(e.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l})}const og=({state:s})=>{const{strings:e,year:t,month:n,activeSelected:i,focusedDate:r,inRange:a,rangeHovered:l,range:c,multiple:h,weeknumbers:g,selectableDatesRef:m,tabIndexSetRef:f,handleDateSelect:v,handleRangeHover:b,isExcluded:w,isDayDisabled:C,setFocusedDate:S,todayDate:T}=s,F={year:t,month:n,activeSelected:i,focusedDate:r,tabIndexSetRef:f,isDayDisabled:C},E={range:c,activeSelected:i,rangeHovered:l,inRange:a,isExcluded:w},W=()=>{const z=[];g&&z.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__week-number",children:e.week})},"week-header"));for(let M=0;M<e.daysShort.length;M++)z.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__day-name","aria-label":e.days[M],children:e.daysShort[M]})},`day-${M}`));return o.jsx("tr",{className:"pkt-cal-week-row",children:z})},U=(z,M)=>{const G=ig(z,M,F),{currentDate:V,currentDateISO:ee,isSelected:le,isDisabled:ne,ariaLabel:me,tabindex:ke}=G;m.current.push({currentDateISO:ee,isDisabled:ne,tabindex:ke});const fe=rg(G,E),ce=ag(G,E);return o.jsx("td",{className:fe,children:o.jsx("button",{type:"button","aria-pressed":le?"true":"false",disabled:ne,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${ce}`,onMouseOver:()=>c&&!w(V)&&b(V),onFocus:()=>{c&&!w(V)&&b(V),S(ee)},"aria-label":me,tabIndex:parseInt(ke),"data-disabled":ne?"disabled":void 0,"data-date":ee,onKeyDown:de=>{(de.key==="Enter"||de.key===" ")&&(de.preventDefault(),v(V))},onClick:de=>{ne||(de.preventDefault(),v(V))},children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:z})})},ee)},Q=(z,M)=>o.jsx("td",{className:"pkt-cal-other",children:o.jsx("div",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only","data-disabled":"disabled",children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:z})})},M),$e=()=>{const z=T,M=Gm(t,n);m.current=[],f.current=0;let G=1,V=M.initialWeek;const ee=[];for(let le=0;le<M.numRows;le++){const ne=[];g&&ne.push(o.jsx("td",{className:"pkt-cal-week",children:V},`week-${V}`)),V++;for(let me=0;me<yi;me++){const ke=Xm(le,me,G,M);if(ke==="current-month")ne.push(U(G,z)),G++;else{const fe=Qm(ke,me,G,M);ne.push(Q(fe,`${ke}-${le}-${me}`)),ke==="next-month"&&G++}}ee.push(o.jsx("tr",{className:"pkt-cal-week-row",role:"row",children:ne},`row-${le}`))}return ee};return o.jsxs("table",{className:"pkt-cal-days pkt-txt-12-medium pkt-calendar__body",role:"grid","aria-multiselectable":c||h||void 0,children:[o.jsx("thead",{children:W()}),o.jsx("tbody",{children:$e()})]})},na=d.forwardRef((s,e)=>{const t=sg(s);return d.useImperativeHandle(e,()=>({handleDateSelect:t.handleDateSelect,addToSelected:t.addToSelected,removeFromSelected:t.removeFromSelected,toggleSelected:t.toggleSelectedDate,focusOnCurrentDate:t.focusOnCurrentDate,close:t.close}),[t.handleDateSelect,t.addToSelected,t.removeFromSelected,t.toggleSelectedDate,t.focusOnCurrentDate,t.close]),o.jsxs("div",{ref:t.calendarRef,className:["pkt-calendar",t.weeknumbers&&"pkt-cal-weeknumbers",t.className].filter(Boolean).join(" "),onBlur:t.handleFocusOut,onKeyDown:t.handleKeydown,children:[o.jsx(ng,{componentId:t.componentId,strings:t.strings,year:t.year,month:t.month,earliest:t.earliest,latest:t.latest,withcontrols:t.withcontrols,prevMonth:t.prevMonth,nextMonth:t.nextMonth,changeMonth:t.changeMonth}),o.jsx(og,{state:t})]})});na.displayName="PktCalendar";const Us=d.forwardRef(({children:s,skin:e,textStyle:t,size:n,closeTag:i,className:r,iconName:a,ariaLabel:l,onClose:c,type:h,"aria-description":g,...m},f)=>{const[v,b]=d.useState(!1),w=d.useCallback(()=>{b(!0),c&&c()},[c]),C=d.useRef(null),[S,T]=d.useState("");d.useEffect(()=>{var U,Q;T(((Q=(U=C.current)==null?void 0:U.textContent)==null?void 0:Q.trim())??"")},[s]);const F=d.useMemo(()=>{if(i&&!l)return S&&`Klikk for å fjerne ${S}`||g},[i,l,S,g]),E={"pkt-tag":!0,[`pkt-tag--${n}`]:!!n,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${t}`]:!!t},W={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${n}`]:!!n,[`pkt-tag--${e}`]:!!e,"pkt-btn--icons-right-and-left":i&&!!a,"pkt-hide":v};return i?o.jsxs("button",{...m,className:pe(W,r),type:h,onClick:w,"aria-label":l,"aria-description":F,ref:f,children:[a&&o.jsx(te,{className:"pkt-tag__icon",name:a}),o.jsx("span",{ref:C,children:s}),o.jsx(te,{className:"pkt-tag__close-btn",name:"close"})]}):o.jsxs("span",{...m,className:pe(E,r),ref:f,children:[a&&o.jsx(te,{className:"pkt-tag__icon",name:a,"aria-hidden":"true"}),o.jsx("span",{ref:C,children:s})]})});Us.displayName="PktTag";const xl=d.forwardRef(({children:s,className:e,ariaLabel:t,metaLead:n,borderOnHover:i=!0,metaTrail:r,layout:a="vertical",heading:l="",headingLevel:c=3,image:h,imageShape:g="square",clickCardLink:m,padding:f="default",openLinkInNewTab:v=!1,skin:b="outlined",subheading:w="",tagPosition:C="top",tags:S=[],...T},F)=>{const E=pe({"pkt-card":!0,[`pkt-card--${b}`]:b,[`pkt-card--${a}`]:a,[`pkt-card--padding-${f}`]:f,"pkt-card--border-on-hover":i}),W=(t==null?void 0:t.trim())||(l?`${l} lenkekort`:"lenkekort"),U=(t==null?void 0:t.trim())||l||"kort",Q=`h${c}`,$e=()=>h!=null&&h.src?o.jsx("div",{className:pe("pkt-card__image",`pkt-card__image-${g}`),children:o.jsx("img",{src:h.src,alt:h.alt||""})}):null,z=()=>S.length===0?null:o.jsx("div",{className:pe("pkt-card__tags",`pkt-card__tags-${C}`),role:"list","aria-label":S.length>1?"merkelapper":"merkelapp",children:S.map((ne,me)=>o.jsx(Us,{role:"listitem",textStyle:"normal-text",size:"medium",skin:ne.skin,iconName:ne.iconName,children:o.jsx("span",{children:ne.text})},me))}),M=()=>!l||m?null:o.jsx(Q,{className:"pkt-heading pkt-heading--medium pkt-heading--fw-regular pkt-card__heading",children:l}),G=()=>m?o.jsx(Q,{className:"pkt-heading pkt-heading--medium pkt-heading--fw-regular pkt-card__link-heading pkt-card__heading",children:o.jsx("a",{className:"pkt-card__link",href:m,target:v?"_blank":"_self",rel:v?"noopener noreferrer":void 0,children:l})}):null,V=()=>w?o.jsx("p",{className:"pkt-card__subheading",children:w}):null,ee=()=>!l&&!w?null:o.jsxs("header",{className:"pkt-card__header",children:[M(),G(),V()]}),le=()=>!n&&!r?null:o.jsxs("footer",{className:"pkt-card__metadata",children:[n&&o.jsx("span",{className:"pkt-card__metadata-lead",children:n}),r&&o.jsx("span",{className:"pkt-card__metadata-trail",children:r})]});return o.jsx("div",{ref:F,className:pe("pkt-card-root",e),style:{display:"block",width:"100%"},children:o.jsxs("article",{...T,className:E,"aria-label":m?W:U,children:[$e(),o.jsxs("div",{className:"pkt-card__wrapper",children:[C==="top"&&z(),ee(),o.jsx("section",{className:"pkt-card__content",children:s}),C==="bottom"&&z(),le()]})]})})});xl.displayName="PktCard";const Sl=d.forwardRef(({id:s,hasTile:e=!1,disabled:t=!1,label:n,checkHelptext:i,hasError:r=!1,className:a,isSwitch:l=!1,hideLabel:c=!1,labelPosition:h="right",defaultChecked:g,checked:m,indeterminate:f,optionalTag:v,optionalText:b="Valgfritt",requiredTag:w,requiredText:C="Må fylles ut",tagText:S,...T},F)=>{const E=d.useRef(null);d.useEffect(()=>{E.current&&f!==void 0&&(E.current.indeterminate=f)},[f]),d.useEffect(()=>{typeof F=="function"?F(E.current):F&&(F.current=E.current)},[F]);const W=[a,"pkt-input-check"].filter(Boolean).join(" "),U=["pkt-input-check__input-label",t?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${h}`,c?"pkt-sr-only":""].filter(Boolean).join(" "),Q=["pkt-input-check__input",e?"pkt-input-check__input--tile":"",t&&e?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),$e=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),z=()=>o.jsxs(o.Fragment,{children:[S&&o.jsx("span",{className:$e+" pkt-tag--gray",children:S}),v&&o.jsx("span",{className:$e+" pkt-tag--blue-light",children:b}),w&&o.jsx("span",{className:$e+" pkt-tag--beige",children:C})]});return o.jsx("div",{className:W,children:o.jsxs("div",{className:Q,children:[h==="left"&&o.jsxs("label",{className:U,htmlFor:s,children:[n," ",z(),i&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:i})]}),o.jsx("input",{role:l?"switch":"checkbox",ref:E,className:`pkt-input-check__input-checkbox ${r?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:t,...m!==void 0?{checked:m}:{defaultChecked:g},...T}),h==="right"&&o.jsxs("label",{className:U,htmlFor:s,children:[n," ",z(),i&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:i})]})]})})});Sl.displayName="PktCheckbox";const xs=d.forwardRef(({forId:s,label:e,helptext:t,helptextDropdown:n,helptextDropdownButton:i,counter:r,counterCurrent:a=0,counterMaxLength:l,optionalTag:c=!1,optionalText:h="Valgfritt",requiredTag:g=!1,requiredText:m="Må fylles ut",tagText:f=null,hasError:v=!1,errorMessage:b,disabled:w=!1,inline:C=!1,ariaDescribedby:S,useWrapper:T=!0,children:F,className:E="",hasFieldset:W=!1,role:U="group",counterPosition:Q="bottom"},$e)=>{const[z,M]=d.useState(!1),G=S||(t?`${s}-helptext`:void 0),V=!!r,ee=V&&Q==="top",le=V&&Q==="bottom",ne=()=>M(P=>!P),me=["pkt-inputwrapper",E,v?"pkt-inputwrapper--error":"",w?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),ke=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),fe=()=>V?o.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[a,l?`/${l}`:""]}):null,ce=()=>o.jsxs(o.Fragment,{children:[f&&o.jsx("span",{className:ke+" pkt-tag--gray",children:f}),c&&o.jsx("span",{className:ke+" pkt-tag--blue-light",children:h}),g&&o.jsx("span",{className:ke+" pkt-tag--beige",children:m})]}),de=()=>{const P=o.jsxs(o.Fragment,{children:[e," ",ce()]});return T?W?o.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:P}):o.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":G,id:`${s}-label`,children:P}):o.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":G,id:`${s}-label`,children:e})},Qe=()=>!t&&!n?null:o.jsxs(o.Fragment,{children:[t&&T&&o.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:t}),n&&o.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[o.jsx(wt,{skin:"tertiary",size:"small",variant:"icon-right",iconName:z?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ne,children:o.jsx("span",{dangerouslySetInnerHTML:{__html:i??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),o.jsx("div",{className:`pkt-inputwrapper__helptext ${z?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:n})]})]}),J=o.jsxs(o.Fragment,{children:[de(),Qe(),ee&&o.jsx(fe,{}),F,le&&o.jsx(fe,{}),v&&b&&o.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:o.jsx(Zi,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:b})})]});return o.jsx("div",{className:me,ref:$e,role:U,children:W?o.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":G,children:J}):o.jsx("div",{className:"pkt-inputwrapper__fieldset",children:J})})});xs.displayName="PktInputWrapper";const Ss=(s,e)=>e&&(s.find(t=>t.value===e)||s.find(t=>t.label===e))||null,lg=(s,e)=>{if(!e)return-1;const t=s.findIndex(n=>n.value===e);return t>=0?t:s.findIndex(n=>n.label===e)},cg=(s,e)=>{if(!e)return[...s];const t=e.toLowerCase();return s.filter(n=>(n.fulltext||n.value+(n.label||"")+(n.prefix||"")).toLowerCase().includes(t))},er=s=>s.value+(s.label||"")+(s.prefix||""),tr=(s,e)=>e!==null&&s>=e,Cl=(s,e)=>{if(!s)return"";switch(e){case"prefixAndValue":return`${s.prefix||""} ${s.value}`.trim();case"value":return s.value;case"label":default:return s.label||s.value}},ia=(s,e)=>s?Array.isArray(s)?e?s:s.length>0?[s[0]]:[]:e?s.split(",").filter(Boolean):[s]:[],Tl=(s,e)=>{if(!e)return{filtered:[...s],suggestion:null};const t=e.toLowerCase(),n=s.filter(r=>{var a;return(a=r.fulltext)==null?void 0:a.toLowerCase().includes(t)}),i=n.find(r=>{var a;return!r.selected&&((a=r.label)==null?void 0:a.toLowerCase().startsWith(t))})||null;return{filtered:n,suggestion:i}},ug=(s,e,t,n)=>{if(!s.trim())return{addValueText:null,userInfoMessage:""};const i=s.trim().toLowerCase(),r=e.find(c=>c.toLowerCase()===i),a=t.filter(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase().includes(i))||c.value.toLowerCase().includes(i)}),l=a.find(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase())===i||c.value.toLowerCase()===i});return(a.length===0||!l)&&n?{addValueText:s,userInfoMessage:""}:a.length===0&&!n?{addValueText:null,userInfoMessage:"Ingen treff i søket"}:r?{addValueText:null,userInfoMessage:"Verdien er allerede valgt"}:{addValueText:null,userInfoMessage:""}},dg=(s,e,t)=>{switch(s){case",":return t?"addValue":null;case"Enter":return"addValue";case"Tab":case"ArrowDown":return e?null:"focusListbox";case"Escape":return"closeOptions";default:return null}},hg=(s,e,t,n,i)=>{if(!s)return{action:"none",value:null};const r=Ss(t,s);return!e.includes(s)&&!r?n?{action:"addUserValue",value:s}:i?{action:"none",value:null}:{action:"removeValue",value:e[0]}:r&&!e.includes(r.value)?{action:"selectOption",value:r.value}:{action:"none",value:null}},sr=(s,e,t)=>{const n=Ss(e,s);return t==="label"&&(n!=null&&n.label)?n.label:s},cn=s=>{s.scrollIntoView({block:"nearest"}),window.setTimeout(()=>s.focus(),0)},Dl=s=>Array.from(s.querySelectorAll('[role="option"]:not([data-disabled])')||[]),pg=s=>{const e=s.nextElementSibling;e&&cn(e)},Nl=(s,e,t)=>{const n=s.previousElementSibling;if(s.dataset.index==="0"&&t){const i=e.querySelector('[role="searchbox"]');i&&cn(i)}else n&&cn(n)},fg=s=>{const e=Dl(s);e[0]&&cn(e[0])},nr=(s,e)=>{if(e.disabled)return;const t=Dl(s);if(e.allowUserInput&&e.customUserInput){const i=s.querySelector('[data-type="new-option"]');if(i){cn(i);return}}const n=t.find(i=>i.dataset.selected==="true");if(n){cn(n);return}if(e.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const i=s.querySelector('[role="searchbox"]');if(i){window.setTimeout(()=>i.focus(),0);return}}t[0]&&cn(t[0])},Ml=({state:s,outside:e=!1})=>{const{values:t,options:n,disabled:i,displayValueAs:r,handleTagRemove:a,handleTagKeydown:l,focusedTagIndex:c}=s,h=d.useRef([]);if(d.useEffect(()=>{var f;!e&&c>=0&&c<t.length&&((f=h.current[c])==null||f.focus())},[e,c,t.length]),t.length===0)return null;const g=(f,v)=>{const b=Ss(n,f),w=b==null?void 0:b.tagSkinColor,C=b?Cl(b,r):f;return i?o.jsx("li",{role:"listitem",children:o.jsx(Us,{skin:w||"blue-dark",children:o.jsx("span",{className:"pkt-combobox__value",children:C})})},f):e?o.jsx("li",{role:"listitem",children:o.jsx(Us,{skin:w||"blue-dark",closeTag:!0,onClose:()=>a(f),children:o.jsx("span",{className:"pkt-combobox__value",children:C})})},f):o.jsx("li",{role:"listitem",onClick:S=>S.stopPropagation(),onMouseDown:S=>S.preventDefault(),children:o.jsx(Us,{ref:S=>{h.current[v]=S},skin:w||"blue-dark",closeTag:!0,tabIndex:c===v?0:-1,onClose:()=>a(f),onKeyDown:S=>l(S,v),children:o.jsx("span",{className:"pkt-combobox__value",children:C})})},f)},m=t.map(g);return e?o.jsx("div",{className:"pkt-combobox__tags-outside",children:o.jsx("ul",{role:"list",className:"pkt-combobox__tag-list",children:m})}):o.jsx("ul",{role:"list",className:"pkt-combobox__tag-list",children:m})},mg=({state:s})=>{const{values:e,options:t,editingSingleValue:n,displayValueAs:i}=s;if(n||e.length===0)return null;const r=Ss(t,e[0]);if(!r)return null;const a=Cl(r,i);return o.jsx("span",{className:"pkt-combobox__value",children:a})},gg=({state:s})=>{const{id:e,inputId:t,listboxId:n,values:i,options:r,isOpen:a,multiple:l,typeahead:c,allowUserInput:h,tagPlacement:g,placeholder:m,disabled:f,fullwidth:v,hasError:b,label:w,inputFocus:C,inputRef:S,triggerRef:T,handleInputChange:F,handleInputKeydown:E,handleInputFocus:W,handleInputBlur:U,handleInputClick:Q,handlePlaceholderClick:$e,handleSelectOnlyKeydown:z,name:M}=s,G=["pkt-combobox__input",v&&"pkt-combobox__input--fullwidth",a&&"pkt-combobox__input--open",b&&"pkt-combobox__input--error",f&&"pkt-combobox__input--disabled"].filter(Boolean).join(" "),V=["pkt-combobox__arrow-icon",a&&"pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "),ee=c||h,le=!ee&&m&&(!i.length||l&&g==="outside")&&!C,ne=g!=="outside",me=i[0]&&Ss(r,i[0])?`${n}-${lg(r,i[0])}`:void 0,ke=l&&i.length>0?`${i.length} valgt`:void 0,fe=ee?{tabIndex:-1}:{id:`${e}-combobox`,role:"combobox","aria-expanded":a?"true":"false","aria-controls":n,"aria-haspopup":"listbox","aria-labelledby":`${e}-combobox-label`,"aria-activedescendant":me,"aria-description":ke,tabIndex:f?-1:0,onKeyDown:z};return o.jsxs("div",{ref:T,className:G,onClick:Q,...fe,children:[le?o.jsx("span",{className:"pkt-combobox__placeholder",onClick:$e,children:m}):ne?l?o.jsx(Ml,{state:s}):ee?null:o.jsx(mg,{state:s}):null,ee?o.jsx("div",{className:"pkt-combobox__input-div combobox__input",children:o.jsx("input",{ref:S,type:"text",id:t,name:`${M||e}-input`,onChange:F,onKeyDown:E,onFocus:W,onBlur:U,placeholder:!i.length||l&&g==="outside"?m:void 0,autoComplete:"off",role:"combobox","aria-expanded":a?"true":"false","aria-label":w,"aria-autocomplete":c?"both":h?"list":"none","aria-controls":n,"aria-activedescendant":me,"aria-description":ke,disabled:f})}):o.jsx("input",{ref:S,type:"hidden",id:t,name:`${M||e}-input`,value:i.join(","),readOnly:!0}),o.jsx(te,{className:V,name:"chevron-thin-down","aria-hidden":"true"})]})},bg=({state:s})=>{const{listboxId:e,label:t,isOpen:n,options:i,filteredOptions:r,multiple:a,disabled:l,maxIsReached:c,maxlength:h,includeSearch:g,allowUserInput:m,addValueText:f,userInfoMessage:v,searchPlaceholder:b,searchValue:w,handleOptionClick:C,handleOptionKeydown:S,handleSearchInput:T,handleSearchKeydown:F,handleNewOptionClick:E,handleNewOptionKeydown:W,listboxRef:U}=s,Q=r.filter(V=>V.selected).length,$e=a&&Q>0&&h!=null&&h>0,z=m&&f&&!c,M=!!v,G=["pkt-listbox",n&&"pkt-listbox__open","pkt-txt-16-light"].filter(Boolean).join(" ");return o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:U,id:e,className:G,role:r.length>0?"listbox":void 0,"aria-label":r.length>0?`Liste: ${t||""}`:void 0,"aria-multiselectable":r.length>0&&a?"true":void 0,children:[o.jsxs("div",{className:"pkt-listbox__banners",children:[g&&o.jsxs("div",{className:"pkt-listbox__search",children:[o.jsx("span",{className:"pkt-listbox__search-icon",children:o.jsx(te,{name:"magnifying-glass-small"})}),o.jsx("input",{className:"pkt-txt-16-light",type:"text","aria-label":"Søk i listen",form:"",placeholder:b||"Søk...",onChange:T,onKeyDown:F,value:w,"data-type":"searchbox",disabled:l,readOnly:l,role:"searchbox"})]}),$e&&o.jsxs("div",{className:"pkt-listbox__banner pkt-listbox__banner--maximum-reached",children:[Q," av maks ",h," mulige er valgt."]}),M&&o.jsxs("div",{className:"pkt-listbox__banner pkt-listbox__banner--user-message",children:[o.jsx(te,{className:"pkt-listbox__banner-icon",name:"exclamation-mark-circle"}),v]}),z&&o.jsxs("div",{className:"pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option","data-type":"new-option","data-value":f,"data-selected":"false",tabIndex:0,onClick:()=>E(f),onKeyDown:W,children:[o.jsx(te,{className:"pkt-listbox__banner-icon",name:"plus-sign"}),'Legg til "',f,'"']}),i.length===0&&r.length===0&&!M&&o.jsxs("div",{className:"pkt-listbox__banner pkt-listbox__banner--empty",children:[o.jsx(te,{className:"pkt-listbox__banner-icon",name:"exclamation-mark-circle"}),"Tom liste"]})]}),o.jsx("ul",{className:"pkt-listbox__options",role:"presentation",children:r.map((V,ee)=>{const le=["pkt-listbox__option",!a&&V.selected&&"pkt-listbox__option--selected",a&&"pkt-listbox__option--checkBox"].filter(Boolean).join(" "),ne=l||V.disabled||c&&!V.selected;return o.jsxs("li",{className:le,onClick:()=>C(V.value),onKeyDown:me=>S(me,V.value),"aria-selected":V.selected?"true":"false",tabIndex:ne?-1:0,"data-index":ee,"data-value":V.value,"data-selected":V.selected?"true":"false","data-disabled":ne||void 0,"aria-disabled":ne?"true":"false",role:"option",id:`${e}-${ee}`,children:[a?o.jsx("input",{className:"pkt-input-check__input-checkbox",type:"checkbox",tabIndex:-1,value:V.value,checked:V.selected||!1,readOnly:!0,"aria-hidden":"true",disabled:ne}):V.selected?o.jsx(te,{name:"check-big"}):null,o.jsxs("span",{className:"pkt-listbox__option-label",id:`${e}-option-label-${ee}`,children:[V.prefix&&o.jsx("span",{className:"pkt-listbox__option-prefix",children:V.prefix}),V.label||V.value]}),V.description&&o.jsx("span",{className:"pkt-listbox__option-description pkt-txt-14-light",children:V.description})]},`${V.value}-${ee}`)})})]}),o.jsx("div",{"aria-live":"polite",className:"pkt-visually-hidden",children:v})]})};function vg(s,e){return s.map(t=>({...t,label:t.label||t.value,fulltext:er(t),selected:e.includes(t.value)}))}function kg(s,e){const{id:t="",label:n,value:i,defaultValue:r,options:a,defaultOptions:l,multiple:c=!1,maxlength:h,typeahead:g=!1,includeSearch:m=!1,allowUserInput:f=!1,displayValueAs:v="label",tagPlacement:b,searchPlaceholder:w,placeholder:C,disabled:S=!1,required:T=!1,fullwidth:F=!1,hasError:E=!1,errorMessage:W,helptext:U,helptextDropdown:Q,helptextDropdownButton:$e,optionalTag:z=!1,optionalText:M,requiredTag:G=!1,requiredText:V,tagText:ee,useWrapper:le=!0,name:ne,className:me,onChange:ke,onValueChange:fe,children:ce}=s,de=`${t}-input`,Qe=`${t}-listbox`,J=g||f,P=d.useRef(null),Le=d.useRef(null),Ve=d.useRef(null),ae=d.useRef(null),Ye=d.useRef(null),xe=d.useCallback(()=>{var _,L;J?(_=P.current)==null||_.focus():(L=Ve.current)==null||L.focus()},[J]),ve=d.useMemo(()=>{const _=[];return d.Children.forEach(ce,L=>{if(d.isValidElement(L)&&L.type==="option"){const re=L.props;_.push({value:re.value??re.children??"",label:re.children??re.value??"",selected:re.selected,disabled:re.disabled})}}),_},[ce]),oe=d.useMemo(()=>l&&l.length>0?l.map(_=>({..._,fulltext:er(_)})):a&&a.length>0?a.map(_=>({..._,fulltext:er(_)})):ve.length>0?ve.map(_=>({..._,fulltext:er(_)})):[],[l,a,ve]),ue=i!==void 0,[Me,Ae]=d.useState(()=>ia(i??r,c)),Te=d.useRef(Me);d.useEffect(()=>{ue&&Ae(ia(i,c))},[i,ue,c]);const I=ue?ia(i,c):Me,[We,Ie]=d.useState([]),j=d.useMemo(()=>{const _=[...We.filter(L=>!oe.some(re=>re.value===L.value)),...oe];return vg(_,I)},[oe,We,I]),[q,se]=d.useState(!1),[ge,R]=d.useState(""),[ze,He]=d.useState(""),[k,p]=d.useState(""),[$,D]=d.useState(null),[Y,K]=d.useState(!1),[ye,ot]=d.useState(!1),[it,Ge]=d.useState(-1),zt=d.useRef(!1),Kt=tr(I.length,h??null),Oe=c&&h!=null,Bt=d.useMemo(()=>ge?g?Tl(j,ge).filtered:cg(j,ge):j,[j,ge,g]),Ze=d.useMemo(()=>{var _;return(_=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:_.set},[]),kt=d.useCallback(_=>{const L=Le.current;if(!L||!Ze)return;const re=c?_.join(","):_[0]||"";Ze.call(L,re),L.dispatchEvent(new Event("input",{bubbles:!0}))},[Ze,c]),ut=c?I.join(","):I[0]||"";d.useEffect(()=>{Le.current&&(Le.current.value=ut)},[ut]),d.useEffect(()=>{if(q||c||!P.current)return;const _=I[0]?sr(I[0],j,v):"";P.current.value!==_&&(P.current.value=_)},[I,j,v,c,q]);const Et=d.useCallback((_,L=!0)=>{ue||Ae(_),L&&(fe==null||fe(_),kt(_))},[ue,fe,kt]),bs=d.useCallback(_=>{if(!_||I.includes(_))return;if(c&&tr(I.length,h??null)){p("Maks antall valg nådd");return}const L=c?[...I,_]:[_];Et(L)},[I,c,h,Et]),rt=d.useCallback(_=>{if(!_)return;const L=I.filter(Je=>Je!==_),re=Ss(j,_);re!=null&&re.userAdded&&Ie(Je=>Je.filter(Ht=>Ht.value!==_)),Et(L)},[I,j,Et]),dn=d.useCallback(()=>{Ie([]),Et([])},[Et]),Cs=d.useCallback(_=>{if(!_||_.trim()==="")return;let L;if(!c)L=[_];else{if(Ss(j,_)||tr(I.length,h??null))return;L=[...I,_]}const re={value:_,label:_,userAdded:!0,selected:!0};Ie(Je=>[re,...Je.filter(Ht=>Ht.value!==_)]),Et(L)},[c,j,I,h,Et]),hn=d.useCallback((_=!0,L)=>{if(D(null),_&&P.current&&P.current.type!=="hidden"){R(""),He("");const re=L!==void 0?L:I[0];!c&&re?P.current.value=sr(re,j,v):P.current.value="",c||(ot(!1),p(""))}},[c,I,j,v]),Vt=d.useCallback(_=>{var fc,mc;if(S)return;p(""),D(null);const L=((fc=Ss(j,_))==null?void 0:fc.value)||null,re=I.includes(_||L||""),Je=!!L,Ht=((mc=j.find(sv=>sv.value===_))==null?void 0:mc.disabled)||!1,pn=!(_!=null&&_.trim()),Yt=!c,ns=c,dr=tr(I.length,h??null);let Ts=!1,hr=!0,Ci="",ga="",Fn;Ht||(!Je&&f&&!pn?(Cs(_),Ci="Ny verdi lagt til",Ts=ns,Yt&&(Fn=_||"")):!Je&&!f?(Yt&&I[0]&&rt(I[0]),hr=!1,Ts=!0,Ci="Ingen treff i søket"):re?(rt(L),Ts=!0,Fn="",Yt&&J&&P.current&&P.current.type!=="hidden"&&(P.current.value="")):pn&&Yt?(dn(),Ts=!0,Fn=""):Yt?(I[0]&&rt(I[0]),bs(L),Ts=!1,Fn=L||""):ns&&!dr?(bs(L),Ts=!0):ns&&dr?(Ci="Maks antall valg nådd",hr=!1,ga=_||""):(Yt&&dn(),Ci="Ingen gyldig verdi valgt",hr=!1,Ts=!0,ga=_||"",Fn=""),se(Ts),p(Ci),R(ga),hn(hr,Fn),Ts||(Yt&&J&&(zt.current=!0),window.setTimeout(()=>{xe()},0)))},[S,j,I,c,h,f,Cs,rt,dn,bs,hn,xe]),Pt=d.useCallback(()=>{if(K(!1),D(null),p(""),R(""),P.current&&P.current.type!=="hidden"){const _=P.current.value;let L=I[0];if(c){if(_!==""){const{action:re,value:Je}=hg(_,I,j,f,c);switch(re){case"addUserValue":Cs(Je);break;case"selectOption":bs(Je);break;case"removeValue":rt(Je);break}}}else if(!_)I[0]&&rt(I[0]),L=void 0;else{const re=Ss(j,_);re&&re.value!==I[0]?(I[0]&&rt(I[0]),bs(re.value),L=re.value):!re&&f&&(I[0]&&rt(I[0]),Cs(_),L=_)}!c&&L?P.current.value=sr(L,j,v):P.current.value=""}se(!1),ot(!1)},[I,j,f,c,v,Cs,bs,rt]),qs=d.useCallback(_=>{if(!_.trim().toLowerCase()){D(null),p(""),!c&&I[0]&&rt(I[0]);return}const re=ug(_,I,j,f);D(re.addValueText),p(re.userInfoMessage)},[I,j,f,c,rt]),Ln=d.useCallback(_=>{var re;if(S)return;const L=_.target.value;if(He(L),R(L),qs(L),g&&L){const{suggestion:Je}=Tl(j,L);Je!=null&&Je.label&&P.current&&!((re=_.nativeEvent.inputType)!=null&&re.includes("deleteContent"))&&(P.current.value=Je.label,window.setTimeout(()=>{var Ht;return(Ht=P.current)==null?void 0:Ht.setSelectionRange(L.length,Je.label.length)},0))}},[S,g,j,qs]),xi=d.useCallback(_=>{var re,Je,Ht,pn,Yt;if(_.key==="Backspace"){const ns=!((re=P.current)!=null&&re.value);if(!ge&&ns&&c&&I.length>0){_.preventDefault();const dr=I[I.length-1];rt(dr)}return}if(_.key==="ArrowLeft"&&c&&I.length>0&&(((Je=P.current)==null?void 0:Je.selectionStart)??0)===0&&!((Ht=P.current)!=null&&Ht.value)){_.preventDefault(),Ge(I.length-1);return}const L=dg(_.key,_.shiftKey,c);if(L&&!(_.key==="Tab"&&!q)){if(L==="focusListbox"&&_.key==="Tab"&&!((pn=ae.current)==null?void 0:pn.querySelector('[role="option"]:not([data-disabled]), [data-type="new-option"]'))){Pt();return}switch(_.preventDefault(),L){case"addValue":{const ns=((Yt=P.current)==null?void 0:Yt.value.trim())||"";if(R(ns),ns&&I.includes(ns)){hn(!0),p("Verdien er allerede valgt");break}Vt(ns);break}case"focusListbox":ae.current&&(q||se(!0),nr(ae.current,{disabled:S,allowUserInput:f,customUserInput:$,includeSearch:m}));break;case"closeOptions":se(!1);break}}},[ge,I,c,S,f,$,m,q,rt,Vt,xe]),ts=d.useCallback(()=>{if(!S){if(zt.current){zt.current=!1,K(!0);return}!c&&I[0]&&P.current&&P.current.type!=="hidden"&&(ot(!0),P.current.value=sr(I[0],j,v)),K(!0),R(""),se(!0)}},[S,c,I,j,v]),Si=d.useCallback(()=>{K(!1),ot(!1)},[]),O=d.useCallback(_=>{if(S||!q)return;const L=_.relatedTarget,re=Ye.current;re&&L&&re.contains(L)||Pt()},[S,q,Pt]),H=d.useCallback(_=>{var L;if(S){_.preventDefault(),_.stopPropagation();return}if(J)(L=P.current)==null||L.focus();else{_.stopPropagation(),_.preventDefault();const re=!q;se(re),re&&ae.current&&nr(ae.current,{disabled:S,allowUserInput:f,customUserInput:$,includeSearch:m})}},[S,J,q,f,$,m]),ie=d.useCallback(_=>{S||(_.stopPropagation(),J&&P.current?(P.current.focus(),K(!0)):se(L=>!L))},[S,J]),N=d.useCallback(_=>{if(!S)switch(_.key){case"Enter":case" ":case"ArrowDown":case"ArrowUp":_.preventDefault(),q?se(!1):(se(!0),ae.current&&window.setTimeout(()=>{ae.current&&nr(ae.current,{disabled:S,allowUserInput:f&&!Kt,customUserInput:$,includeSearch:m})},0));break;case"Escape":q&&(_.preventDefault(),se(!1));break;case"Home":case"End":_.preventDefault(),q||se(!0),ae.current&&window.setTimeout(()=>{ae.current&&nr(ae.current,{disabled:S,allowUserInput:f&&!Kt,customUserInput:$,includeSearch:m})},0);break;case"ArrowLeft":c&&I.length>0&&(_.preventDefault(),Ge(I.length-1));break;case"Backspace":case"Delete":if(c&&I.length>0){_.preventDefault();const L=I[I.length-1];rt(L)}break}},[S,q,f,Kt,$,m,c,I,rt]),A=d.useCallback(_=>{Vt(_)},[Vt]),be=d.useCallback((_,L)=>{switch(_.key){case"Enter":case" ":_.preventDefault(),Vt(L);break;case"ArrowDown":_.preventDefault(),pg(_.currentTarget);break;case"ArrowUp":_.preventDefault(),ae.current&&Nl(_.currentTarget,ae.current,m);break;case"Escape":_.preventDefault(),se(!1),xe();break;case"Tab":Pt();break}},[Vt,m,xe,Pt]),we=d.useCallback(_=>{rt(_),Ge(-1),J&&P.current&&(K(!0),P.current.focus())},[rt,J]),at=d.useCallback((_,L)=>{var re,Je,Ht;switch(_.stopPropagation(),_.key){case"ArrowLeft":_.preventDefault(),L>0&&Ge(L-1);break;case"ArrowRight":_.preventDefault(),L<I.length-1?Ge(L+1):(Ge(-1),J&&P.current?P.current.focus():(re=Ve.current)==null||re.focus());break;case"Backspace":case"Delete":_.preventDefault();{const pn=I[L],Yt=L>=I.length-1?L-1:L;rt(pn),Yt>=0?Ge(Yt):(Ge(-1),J&&P.current?P.current.focus():(Je=Ve.current)==null||Je.focus())}break;case"Tab":Ge(-1);break;case"Escape":_.preventDefault(),Ge(-1),J&&P.current?P.current.focus():(Ht=Ve.current)==null||Ht.focus();break}},[I,J,rt]),Fe=d.useCallback(_=>{R(_.target.value),qs(_.target.value)},[qs]),lt=d.useCallback(_=>{switch(_.key){case"ArrowDown":if(_.preventDefault(),ae.current){const L=ae.current.querySelector('[role="option"]:not([data-disabled]), [data-type="new-option"]');L==null||L.focus()}break;case"Tab":Pt();break;case"Escape":_.preventDefault(),se(!1),xe();break}},[xe,Pt]),Ee=d.useCallback(_=>{Vt(_)},[Vt]),ss=d.useCallback(_=>{switch(_.key){case"Enter":case" ":_.preventDefault(),Vt(_.currentTarget.dataset.value||"");break;case"ArrowDown":_.preventDefault(),ae.current&&fg(ae.current);break;case"ArrowUp":_.preventDefault(),ae.current&&Nl(_.currentTarget,ae.current,m);break;case"Escape":_.preventDefault(),se(!1),xe();break}},[Vt,m,xe]);return d.useEffect(()=>{if(!q)return;const _=L=>{const re=L.target;Ye.current&&!Ye.current.contains(re)&&Pt()};return document.addEventListener("click",_,!0),()=>{document.removeEventListener("click",_,!0)}},[q,Pt]),d.useEffect(()=>{var re;const _=(re=Ye.current)==null?void 0:re.closest("form");if(!_)return;const L=()=>{window.setTimeout(()=>{if(Ae(Te.current),Ie([]),He(""),R(""),D(null),p(""),Le.current){const Je=c?Te.current.join(","):Te.current[0]||"";Le.current.value=Je}},0)};return _.addEventListener("reset",L),()=>_.removeEventListener("reset",L)},[c]),d.useImperativeHandle(e,()=>({get value(){var _;return((_=Le.current)==null?void 0:_.value)??""},set value(_){const L=Array.isArray(_)?_:_?String(_).split(",").filter(Boolean):[];ue||Ae(L),Le.current&&(Le.current.value=L.join(","))},focus(){var _,L;J?(_=P.current)==null||_.focus():(L=Ve.current)==null||L.focus()},blur(){var _,L;J?(_=P.current)==null||_.blur():(L=Ve.current)==null||L.blur()}}),[ue]),{id:t,inputId:de,listboxId:Qe,values:I,inputValue:ze,searchValue:ge,options:j,filteredOptions:Bt,isOpen:q,userInfoMessage:k,addValueText:$,maxIsReached:Kt,editingSingleValue:ye,inputFocus:Y,focusedTagIndex:it,label:n,multiple:c,maxlength:h,typeahead:g,includeSearch:m,allowUserInput:f,displayValueAs:v,tagPlacement:b,searchPlaceholder:w,placeholder:C,disabled:S,required:T,fullwidth:F,hasError:E,errorMessage:W,helptext:U,helptextDropdown:Q,helptextDropdownButton:$e,optionalTag:z,optionalText:M,requiredTag:G,requiredText:V,tagText:ee,useWrapper:le,name:ne,className:me,hasCounter:Oe,inputRef:P,changeInputRef:Le,triggerRef:Ve,listboxRef:ae,wrapperRef:Ye,handleInputChange:Ln,handleInputKeydown:xi,handleInputFocus:ts,handleInputBlur:Si,handleFocusOut:O,handleInputClick:H,handlePlaceholderClick:ie,handleSelectOnlyKeydown:N,handleOptionClick:A,handleOptionKeydown:be,handleTagRemove:we,handleTagKeydown:at,handleSearchInput:Fe,handleSearchKeydown:lt,handleNewOptionClick:Ee,handleNewOptionKeydown:ss,onChange:ke}}const Ol=d.forwardRef((s,e)=>{const t=kg(s,e),n=["pkt-combobox-component",t.fullwidth&&"pkt-combobox-component--fullwidth",t.className].filter(Boolean).join(" "),i=t.allowUserInput||t.typeahead,r=i?t.inputId:`${t.id}-combobox`;return o.jsxs("div",{className:n,ref:t.wrapperRef,children:[o.jsxs(xs,{forId:r,hasFieldset:!i,label:t.label||"",helptext:t.helptext,helptextDropdown:t.helptextDropdown,helptextDropdownButton:t.helptextDropdownButton,hasError:t.hasError,errorMessage:t.errorMessage,disabled:t.disabled,optionalTag:t.optionalTag,optionalText:t.optionalText,requiredTag:t.requiredTag,requiredText:t.requiredText,tagText:t.tagText,useWrapper:t.useWrapper,counter:t.hasCounter,counterCurrent:t.values.length,counterMaxLength:t.maxlength,className:"pkt-combobox__wrapper",children:[o.jsxs("div",{className:"pkt-combobox",onBlur:t.handleFocusOut,children:[o.jsx(gg,{state:t}),o.jsx(bg,{state:t})]}),t.tagPlacement==="outside"&&t.multiple&&o.jsx(Ml,{state:t,outside:!0})]}),o.jsx("input",{ref:t.changeInputRef,type:"text",name:t.name||t.id,onChange:t.onChange,tabIndex:-1,"aria-hidden":"true",className:"pkt-visually-hidden"})]})});Ol.displayName="PktCombobox";const ir=Bn({tagName:"pkt-consent",elementClass:Jt,react:d,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});ir.displayName="PktConsent";const El=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},yg=()=>El()?"text":"date",_g=s=>!s||s.length!==2?!0:qm(s[0],s[1]),$g=(s,e,t,n,i,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":n,"ios-readonly-hack":i===!1&&r==="text"}),wg=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),xg=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),Sg=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,Cg=(s,e,t=!1)=>{var l;if(!s||!e)return;const n=((l=e.parentElement)==null?void 0:l.getBoundingClientRect())||e.getBoundingClientRect(),i=t?n.height+30:n.height,r=s.getBoundingClientRect().height;let a=t?"calc(100% - 30px)":"100%";n&&n.top+r>window.innerHeight&&n.top-r>0&&(a=`calc(100% - ${i}px - ${r}px)`),s.style.top=a},rr=(s,e,t,n,i,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):i&&i()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():n?n():i&&i())},Tg=({open:s,multiple:e=!1,range:t=!1,weeknumbers:n=!1,withcontrols:i=!1,selected:r=[],earliest:a,latest:l,excludedates:c,excludeweekdays:h,maxMultiple:g,currentmonth:m,today:f,inputRef:v,hasCounter:b=!1,onDateSelected:w,onClose:C})=>{const S=d.useRef(null),T=d.useRef(!1);s&&(T.current=!0),d.useEffect(()=>{s&&Cg(S.current,(v==null?void 0:v.current)??null,b)},[s,v,b]);const F=["pkt-calendar-popup",s?"show":"hide"].join(" "),E=s||T.current;return o.jsx("div",{ref:S,className:F,hidden:!s,"aria-hidden":!s,children:E&&o.jsx(na,{multiple:e,range:t,weeknumbers:n,withcontrols:i,selected:r,earliest:a,latest:l,excludedates:c,excludeweekdays:h,maxMultiple:g,currentmonth:m,today:f,onDateSelected:w,onClose:C})})},Dg=({dates:s,dateformat:e,idBase:t,strings:n,onDateRemoved:i})=>{var l;const r=Um(s),a=((l=n==null?void 0:n.calendar)==null?void 0:l.buttonAltText)??"Slett dato";return o.jsx("div",{className:"pkt-date-tags pkt-datepicker__tags","aria-live":"polite",children:r.map(c=>{const h=Im(c,e);return o.jsx(Us,{id:`${t}${c}-tag`,closeTag:!0,ariaLabel:`${a} ${h}`,onClose:()=>i(c),children:o.jsx("time",{dateTime:c,children:h})},c)})})},Ng=({state:s})=>{var xe,ve,oe,ue;const{id:e,inputId:t,values:n,dateformat:i,multiple:r,range:a,showRangeLabels:l,disabled:c,readOnly:h,required:g,label:m,name:f,placeholder:v,hasError:b,helptext:w,minStr:C,maxStr:S,inputType:T,isIOSDevice:F,strings:E,inputClasses:W,buttonClasses:U,rangeLabelClasses:Q,datepickerInputsClasses:$e,isInputDisabled:z,inputRef:M,inputRefTo:G,btnRef:V,toggleCalendar:ee,handleFocus:le,handleSingleInputChange:ne,handleRangeFromChange:me,handleRangeToChange:ke,handleRangeBlur:fe,handleMultipleBlur:ce,handleTagRemoved:de,handleSingleKeydown:Qe,handleRangeFromKeydown:J,handleRangeToKeydown:P,handleMultipleKeydown:Le,restProps:Ve}=s,ae=Me=>{Me.preventDefault(),ee()},Ye=()=>{var Me,Ae;return o.jsxs("button",{ref:V,className:U,type:"button",onClick:ee,disabled:c,"aria-label":((Me=E.calendar)==null?void 0:Me.buttonAltText)??"Åpne kalender",children:[o.jsx(te,{name:"calendar"}),o.jsx("span",{className:"pkt-btn__text",children:((Ae=E.calendar)==null?void 0:Ae.buttonAltText)??"Åpne kalender"})]})};return r?o.jsxs(o.Fragment,{children:[o.jsx(Dg,{dates:n,dateformat:i,idBase:e,strings:E,onDateRemoved:de}),o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Ve,ref:M,className:W,type:T,id:t,name:f??e,placeholder:v,readOnly:h||F&&!h,disabled:z,"aria-describedby":w?`${e}-helptext`:void 0,"aria-invalid":b,"aria-errormessage":b?`${e}-error`:void 0,onClick:ae,onKeyDown:Le,onFocus:le,onBlur:ce}),Ye()]})})]}):a?o.jsx("div",{className:$e,children:o.jsxs("div",{className:"pkt-input__container",children:[l&&o.jsx("div",{className:"pkt-input-prefix",children:((xe=E.generic)==null?void 0:xe.from)??"Fra"}),o.jsx("input",{...Ve,ref:M,className:W,type:T,id:t,name:f?`${f}-from`:`${e}-from`,value:n[0]??"",min:C,max:S,placeholder:v,readOnly:h||F&&!h,disabled:c,required:g,"aria-label":`${m} ${((ve=E.generic)==null?void 0:ve.from)??"Fra"}`,"aria-describedby":w?`${e}-helptext`:void 0,"aria-invalid":b,"aria-errormessage":b?`${e}-error`:void 0,onClick:ae,onKeyDown:J,onFocus:le,onBlur:fe,onChange:me}),o.jsx("div",{className:Q,id:`${e}-to-label`,children:((oe=E.generic)==null?void 0:oe.to)??"Til"}),!l&&o.jsx("div",{className:"pkt-input-separator",children:"–"}),o.jsx("input",{ref:G,className:W,type:T,id:`${e}-to`,name:f?`${f}-to`:`${e}-to`,value:n[1]??"",min:C,max:S,readOnly:h||F&&!h,disabled:c,"aria-label":`${m} ${((ue=E.generic)==null?void 0:ue.to)??"Til"}`,"aria-invalid":b,onClick:ae,onKeyDown:P,onFocus:le,onBlur:fe,onChange:ke}),Ye()]})}):o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Ve,ref:M,className:W,type:T,id:t,name:f??e,value:n[0]??"",min:C,max:S,placeholder:v,readOnly:h||F&&!h,disabled:c,required:g,"aria-describedby":w?`${e}-helptext`:void 0,"aria-invalid":b,"aria-errormessage":b?`${e}-error`:void 0,onClick:ae,onKeyDown:Qe,onFocus:le,onBlur:void 0,onChange:ne}),Ye()]})})},Mg={calendar:{buttonAltText:"Åpne kalender"}},Og={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}},Pl=s=>{if(!s)return[];if(Array.isArray(s))return s.filter(Boolean);if(typeof s=="string"&&s.trimStart().startsWith("["))try{const e=JSON.parse(s);if(Array.isArray(e))return e.filter(Boolean)}catch{}return String(s).split(",").map(e=>e.trim()).filter(Boolean)};function Eg(s,e){const{id:t,label:n,value:i,defaultValue:r,dateformat:a="dd.MM.yyyy",multiple:l=!1,maxlength:c,range:h=!1,showRangeLabels:g=!1,weeknumbers:m=!1,withcontrols:f=!1,excludedates:v,excludeweekdays:b,currentmonth:w,today:C,calendarOpen:S,timezone:T,fullwidth:F=!1,hasFieldset:E=!1,inline:W=!1,helptext:U,helptextDropdown:Q,helptextDropdownButton:$e,hasError:z=!1,errorMessage:M,optionalTag:G=!1,optionalText:V,requiredTag:ee=!1,requiredText:le,tagText:ne,useWrapper:me=!0,strings:ke,disabled:fe=!1,readOnly:ce=!1,required:de=!1,name:Qe,min:J,max:P,placeholder:Le,onChange:Ve,onValueChange:ae,className:Ye,...xe}=s,ve=d.useCallback(N=>N===void 0?[]:Pl(N),[]),oe=i!==void 0,ue=typeof r=="number"?void 0:r,[Me,Ae]=d.useState(()=>ve(i??ue)),Te=oe?ve(i):Me,I=d.useRef(Me);d.useEffect(()=>{oe&&Ae(ve(i))},[i,oe,ve]);const[We,Ie]=d.useState(S??!1);d.useEffect(()=>{S!==void 0&&Ie(S)},[S]);const j=d.useRef(null),q=d.useRef(null),se=d.useRef(null),ge=d.useRef(null),R=d.useRef(null),ze=d.useMemo(()=>yg(),[]),He=d.useMemo(()=>El(),[]),k=d.useMemo(()=>ke??(h?Og:Mg),[ke,h]),p=typeof J=="string"?J:J!==void 0?String(J):void 0,$=typeof P=="string"?P:P!==void 0?String(P):void 0,D=d.useMemo(()=>{const N=$g(F,g,l,h,ce,ze);return Object.entries(N).filter(([,A])=>A).map(([A])=>A).join(" ")},[F,g,l,h,ce,ze]),Y=d.useMemo(()=>{const N=wg();return Object.entries(N).filter(([,A])=>A).map(([A])=>A).join(" ")},[]),K=d.useMemo(()=>{const N=xg(g);return Object.entries(N).filter(([,A])=>A).map(([A])=>A).join(" ")},[g]),ye=d.useMemo(()=>["pkt-datepicker__inputs",h&&"pkt-input__range-inputs"].filter(Boolean).join(" "),[h,g]),ot=d.useMemo(()=>{if(w)return w;if($)return $.slice(0,7)},[w,$]),it=fe||l&&c!=null&&Te.length>=c,Ge=l&&c!=null,zt=`${t}-input`,Kt=Te.join(",");d.useEffect(()=>{se.current&&(se.current.value=Kt)},[Kt]),d.useEffect(()=>{T&&typeof window<"u"&&T!==window.pktTz&&(window.pktTz=T)},[T]);const Oe=d.useCallback((N,A=!0)=>{oe||Ae(N),A&&(ae==null||ae(N))},[oe,ae]),Bt=d.useMemo(()=>{var N;return(N=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:N.set},[]),Ze=d.useCallback(N=>{const A=se.current;!A||!Bt||(Bt.call(A,N.join(",")),A.dispatchEvent(new Event("input",{bubbles:!0})))},[Bt]),kt=d.useCallback(()=>{fe||Ie(N=>!N)},[fe]),ut=d.useCallback(()=>{Ie(!1)},[]);d.useEffect(()=>{if(!We)return;const N=be=>{var at;const we=be.target;R.current&&!R.current.contains(we)&&!((at=we.closest)!=null&&at.call(we,".pkt-calendar-popup"))&&ut()},A=be=>{var we;be.key==="Escape"&&(ut(),(we=j.current)==null||we.focus())};return document.addEventListener("click",N,!0),document.addEventListener("keydown",A),()=>{document.removeEventListener("click",N,!0),document.removeEventListener("keydown",A)}},[We,ut]);const Et=d.useCallback(()=>{He&&!We&&Ie(!0)},[He,We]),bs=d.useCallback(N=>{var we;const A=Sg(N,l,h),be=Pl(A);Oe(be),Ze(be),!l&&!h&&(ut(),(we=j.current)==null||we.focus())},[l,h,Oe,Ze,ut]),rt=d.useCallback(()=>{var N;ut(),(N=j.current)==null||N.focus()},[ut]),dn=d.useCallback(N=>{const A=N.target.value,be=A?[A]:[];Oe(be),Ze(be)},[Oe,Ze]),Cs=d.useCallback(N=>{const A=N.target.value,be=Te[1]??"",we=[A,be].filter(Boolean);Oe(we),Ze(we)},[Te,Oe,Ze]),hn=d.useCallback(N=>{const A=Te[0]??"",be=N.target.value,we=[A,be].filter(Boolean);Oe(we),Ze(we)},[Te,Oe,Ze]),Vt=d.useCallback(()=>{Te.length===2&&!_g(Te)&&(Oe([Te[0]]),Ze([Te[0]]))},[Te,Oe,Ze]),Pt=d.useCallback(N=>{const A=ws(N),be=p?ws(p):null,we=$?ws($):null;if(A&&!isNaN(A.getTime())&&(!be||A>=be)&&(!we||A<=we)){const at=Hm([...Te,N],p,$,v,b),Fe=[...new Set(at)];Oe(Fe),Ze(Fe)}},[Te,p,$,v,b,Oe,Ze]),qs=d.useCallback(N=>{const A=N.target;A.value&&(Pt(A.value.split(",")[0]),A.value="")},[Pt]),Ln=d.useCallback(N=>{const A=N.target;A.value&&(Pt(A.value.split(",")[0]),A.value="")},[Pt]),xi=d.useCallback(N=>{const A=Te.filter(be=>be!==N);Oe(A),Ze(A)},[Te,Oe,Ze]),ts=d.useCallback(N=>{const A=N==null?void 0:N.closest("form");A?A.requestSubmit():N==null||N.blur()},[]),Si=d.useCallback(N=>{rr(N.nativeEvent,()=>kt(),()=>ts(j.current),void 0,()=>{var A;return(A=j.current)==null?void 0:A.blur()})},[kt,ts]),O=d.useCallback(N=>{rr(N.nativeEvent,()=>kt(),()=>ts(j.current),()=>{var A;return(A=q.current)==null?void 0:A.focus()},()=>{var A;return(A=j.current)==null?void 0:A.blur()})},[kt,ts]),H=d.useCallback(N=>{rr(N.nativeEvent,()=>kt(),()=>ts(q.current),void 0,()=>{var A;return(A=q.current)==null?void 0:A.blur()})},[kt,ts]),ie=d.useCallback(N=>{rr(N.nativeEvent,()=>kt(),()=>ts(j.current),void 0,()=>{var A;return(A=j.current)==null?void 0:A.blur()},Ln)},[kt,ts,Ln]);return d.useEffect(()=>{var be;const N=(be=R.current)==null?void 0:be.closest("form");if(!N)return;const A=()=>{window.setTimeout(()=>{Ae(I.current),Ie(!1),se.current&&(se.current.value=I.current.join(","))},0)};return N.addEventListener("reset",A),()=>N.removeEventListener("reset",A)},[]),d.useImperativeHandle(e,()=>({get value(){var N;return((N=se.current)==null?void 0:N.value)??""},set value(N){const A=N?N.split(",").filter(Boolean):[];Ae(A),se.current&&(se.current.value=N??"")},focus(){var N;(N=j.current)==null||N.focus()},blur(){var N;(N=j.current)==null||N.blur()}}),[]),{id:t,inputId:zt,label:n,values:Te,calendarOpen:We,dateformat:a,multiple:l,maxlength:c,range:h,showRangeLabels:g,weeknumbers:m,withcontrols:f,excludedates:v,excludeweekdays:b,disabled:fe,readOnly:ce,required:de,name:Qe,placeholder:Le,fullwidth:F,hasFieldset:E,inline:W,helptext:U,helptextDropdown:Q,helptextDropdownButton:$e,hasError:z,errorMessage:M,optionalTag:G,optionalText:V,requiredTag:ee,requiredText:le,tagText:ne,useWrapper:me,className:Ye,minStr:p,maxStr:$,effectiveCurrentMonth:ot,today:C,inputType:ze,isIOSDevice:He,strings:k,inputClasses:D,buttonClasses:Y,rangeLabelClasses:K,datepickerInputsClasses:ye,isInputDisabled:it,hasCounter:Ge,inputRef:j,inputRefTo:q,changeInputRef:se,btnRef:ge,wrapperRef:R,onChange:Ve,toggleCalendar:kt,hideCalendar:ut,handleDateSelected:bs,handleCalendarClose:rt,handleFocus:Et,handleSingleInputChange:dn,handleRangeFromChange:Cs,handleRangeToChange:hn,handleRangeBlur:Vt,handleMultipleBlur:qs,handleTagRemoved:xi,handleSingleKeydown:Si,handleRangeFromKeydown:O,handleRangeToKeydown:H,handleMultipleKeydown:ie,restProps:xe}}const Al=d.forwardRef((s,e)=>{const t=Eg(s,e),n=["pkt-datepicker",t.className].filter(Boolean).join(" ");return o.jsxs("div",{className:n,children:[o.jsx(xs,{ref:t.wrapperRef,forId:t.inputId,label:t.label,hasFieldset:t.hasFieldset,inline:t.inline,helptext:t.helptext,helptextDropdown:t.helptextDropdown,helptextDropdownButton:t.helptextDropdownButton,hasError:t.hasError,errorMessage:t.errorMessage,disabled:t.disabled,optionalTag:t.optionalTag,optionalText:t.optionalText,requiredTag:t.requiredTag,requiredText:t.requiredText,tagText:t.tagText,useWrapper:t.useWrapper,counter:t.hasCounter,counterCurrent:t.values.length,counterMaxLength:t.maxlength,children:o.jsx(Ng,{state:t})}),o.jsx(Tg,{open:t.calendarOpen,multiple:t.multiple,range:t.range,weeknumbers:t.weeknumbers,withcontrols:t.withcontrols,selected:t.values,earliest:t.minStr,latest:t.maxStr,excludedates:t.excludedates,excludeweekdays:t.excludeweekdays,maxMultiple:t.maxlength,currentmonth:t.effectiveCurrentMonth,today:t.today,inputRef:t.inputRef,hasCounter:t.hasCounter,onDateSelected:t.handleDateSelected,onClose:t.handleCalendarClose}),o.jsx("input",{ref:t.changeInputRef,type:"text",name:t.name,onChange:t.onChange,tabIndex:-1,"aria-hidden":"true",className:"pkt-visually-hidden"})]})});Al.displayName="PktDatepicker";const Pg={dropFilesHere:"Slipp filene her ...",selectOrDragFiles:"Dra filer hit for å laste dem opp eller ",chooseFiles:"velg filer"},Ag={dropFilesHere:"Slipp filen her ...",selectOrDragFiles:"Dra en fil for å laste den opp eller ",chooseFiles:"velg en fil"},Ig={dropFilesHere:"Slipp bildene her ...",selectOrDragFiles:"Dra bilder hit for å laste dem opp eller ",chooseFiles:"velg fra kamerarull"},Lg={dropFilesHere:"Slipp bildet her ...",selectOrDragFiles:"Dra et bilde for å laste det opp eller ",chooseFiles:"velg fra kamerarull"},Il=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Fg=()=>{const s=Il(),e=Il();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)};class Ll{constructor(e,t){pr(this,"fileId");pr(this,"file");pr(this,"attributes",{});this.fileId=t||Fg(),this.file=e,this.attributes={targetFilename:e.name}}}const ra=d.createContext({}),Bg=".PDF, .JPEG, .JPG, .PNG, .HEIC, .DOC, .DOCX, .ODT",Vg=d.forwardRef(({id:s,multiple:e,value:t,onFilesAdded:n=()=>{},name:i,uploadStrategy:r,accept:a,isThumbnailView:l=!1,disabled:c=!1,srAnnouncementIds:h,...g},m)=>{const f=d.useRef(null),v=typeof a=="string"&&a.trim().length>0?a:void 0,b=d.useMemo(()=>v?v.split(/\s*,\s*/).map(M=>M.trim()).filter(Boolean).join(", ").toUpperCase():Bg,[v]);d.useImperativeHandle(m,()=>f.current);const[w,C]=d.useState(!1),S=d.useMemo(()=>l?e?Ig:Lg:e?Pg:Ag,[e,l]),T=d.useCallback(M=>{if(f.current)try{f.current.files=Hg(M)}catch{}},[f.current,t]);d.useEffect(()=>{T(t)},[f,t]);const F=d.useCallback(M=>{const G=M.map(V=>new Ll(V));n(G),f.current&&(f.current.value="")},[n]),E=M=>{const G=M.target.files;if(G.length===0){e&&T(t);return}F(Array.from(G))},W=M=>{F(M)},U=M=>{if(M.preventDefault(),C(!1),c)return;const G=M.dataTransfer.files,V=Array.from(G);W(V)},Q=M=>{M.preventDefault(),!c&&C(!0)},$e=()=>{C(!1)},z=d.useCallback(M=>{var V;c||M.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog")||(V=f.current)==null||V.click()},[c]);return o.jsxs("div",{onDrop:U,onDragOver:Q,onDragLeave:$e,onClick:z,className:pe("pkt-fileupload__drop-zone",{"pkt-fileupload__drop-zone--drag-active":w,"pkt-fileupload__drop-zone--disabled":c}),children:[o.jsx("input",{...g,id:s,type:"file",ref:f,multiple:e,onChange:E,accept:v,disabled:c,name:r==="form"&&i||void 0,"aria-label":e?"Velg filer":"Velg fil"}),r==="custom"&&o.jsx(o.Fragment,{children:t==null?void 0:t.map(M=>o.jsx("input",{type:"hidden",name:i,value:M.fileId},M.fileId))}),o.jsxs("div",{className:"pkt-fileupload__drop-zone__placeholder",children:[o.jsx(te,{name:"attachment",className:"pkt-fileupload__drop-zone__placeholder__icon","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__drop-zone__placeholder__title",children:w?`${S.dropFilesHere} ...`:o.jsxs(o.Fragment,{children:[S.selectOrDragFiles," ",o.jsx("button",{className:"pkt-fileupload__drop-zone__placeholder__title__open-file-dialog",onClick:M=>{var G;M.preventDefault(),M.stopPropagation(),(G=f.current)==null||G.click()},type:"button",children:S.chooseFiles})]})}),o.jsxs("p",{className:"pkt-fileupload__drop-zone__placeholder__formats",children:["Format: ",b]})]})]})}),Hg=s=>{const e=new DataTransfer;for(const t of s)e.items.add(t.file);return e.files},aa=d.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,counter:n,counterMaxLength:i,className:r,disabled:a,errorMessage:l,hasError:c,helptext:h,helptextDropdown:g,helptextDropdownButton:m,inline:f,fullwidth:v=!1,label:b,name:w,optionalTag:C=!1,optionalText:S,requiredTag:T=!1,requiredText:F,tagText:E=null,placeholder:W,rows:U,useWrapper:Q=!0,onChange:$e,value:z,autoComplete:M="off",minLength:G,maxLength:V,readOnly:ee,skipForwardTestid:le=!1,...ne},me)=>{const ke=[r,"pkt-textinput","pkt-textarea"].join(" "),fe=`${s}-input`,ce=`${fe}-label`,de=t||ce,[Qe,J]=d.useState(0),P=Le=>{var Ve,ae;n&&J(((ae=(Ve=Le.currentTarget)==null?void 0:Ve.value)==null?void 0:ae.length)||0),$e&&$e(Le)};return d.useEffect(()=>{z!==void 0&&J((z==null?void 0:z.length)||0)},[z]),o.jsx(xs,{ariaDescribedby:e,className:ke,disabled:a,errorMessage:l,forId:fe,hasError:c,helptext:h,helptextDropdown:g,helptextDropdownButton:m,inline:f,label:b,optionalTag:C,optionalText:S,requiredTag:T,requiredText:F,tagText:E,useWrapper:Q,counter:n,counterCurrent:Qe,counterMaxLength:i,children:o.jsx("textarea",{ref:me,className:`pkt-input ${v?"pkt-input--fullwidth":""} ${i&&Qe>i?"pkt-input--counter-error":""}`,name:`${w||s}`,id:fe,placeholder:W,disabled:a,rows:U,"aria-labelledby":de,"aria-invalid":c,"aria-errormessage":`${s}-error`,...ne,onChange:P,value:z,autoComplete:M,minLength:G,maxLength:V,readOnly:ee,"data-skip-forward-testid":le?"true":void 0})})});aa.displayName="PktTextarea";const Ug=Symbol("comment"),qg=s=>{const e=String(s.getDate()).padStart(2,"0"),t=String(s.getMonth()+1).padStart(2,"0"),n=s.getFullYear(),i=String(s.getHours()).padStart(2,"0"),r=String(s.getMinutes()).padStart(2,"0");return`${e}.${t}.${n} kl. ${i}:${r}`},jg=({fileItem:s,closeOperationUi:e,onAddComment:t,existingComment:n})=>{const i=d.useRef(null),r=!!n,a=()=>{var c,h;const l=(h=(c=i.current)==null?void 0:c.value)==null?void 0:h.trim();l&&t({text:l,timestamp:new Date}),e()};return d.useLayoutEffect(()=>{const l=setTimeout(()=>{var c;return(c=i.current)==null?void 0:c.focus({preventScroll:!0})},0);return()=>clearTimeout(l)},[s.fileId]),o.jsxs(o.Fragment,{children:[o.jsx(aa,{autoFocus:!0,label:r?"Rediger kommentar":"Legg til kommentar",name:`comment-${s.fileId}`,className:"pkt-fileupload__queue-display__item__comment-input",placeholder:"Skriv inn kommentar",rows:2,id:`comment-${s.fileId}`,ref:i,defaultValue:n==null?void 0:n.text}),o.jsx(wt,{skin:"secondary",size:"small",onClick:a,children:r?"Lagre kommentar":"Legg til kommentar"}),o.jsx(wt,{skin:"tertiary",size:"small",onClick:e,children:"Avbryt"})]})},Wg=({comments:s,onDeleteComment:e,onEditComment:t})=>s&&s.length>0?o.jsx("div",{className:"pkt-fileupload__queue-display__item__comments",children:s.map((n,i)=>o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment",children:[o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__content",children:[o.jsx("span",{className:"pkt-fileupload__queue-display__item__comment__text","aria-label":"Kommentar tekst",children:n.text}),o.jsx("time",{className:"pkt-fileupload__queue-display__item__comment__time",children:qg(n.timestamp)})]}),o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__actions",children:[e&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>e(i),"aria-label":"Slett kommentar",children:o.jsx(te,{name:"trash-can"})}),t&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>t(i),"aria-label":"Rediger kommentar",children:o.jsx(te,{name:"edit"})})]})]},i))}):null,zg=s=>{const e=d.useContext(ra);return o.jsx("input",{type:"hidden",name:`${e.name}-comments`,value:s.comments?JSON.stringify(s.comments):""})},Kg=s=>{const e=s("comments"),t=(i,r)=>{e.set(i,[r])},n=(i,r)=>{const l=(e.get(i)||[]).filter((c,h)=>h!==r);e.set(i,l.length>0?l:void 0)};return{title:i=>{const r=e.get(i.fileId);return r&&r.length>0?"":"Legg til kommentar"},renderExtendedUI:(i,r)=>{const a=e.get(i.fileId),l=a==null?void 0:a[0];return o.jsx(jg,{fileItem:i,closeOperationUi:r,onAddComment:c=>t(i.fileId,c),existingComment:l})},renderContent:(i,r,a)=>{if(a)return null;const l=e.get(i.fileId);return o.jsx(Wg,{comments:l,onDeleteComment:c=>n(i.fileId,c),onEditComment:r?()=>r():void 0})},renderHidden:i=>o.jsx(zg,{comments:e.get(i.fileId)},`comments${i.fileId}`),symbol:Ug}},Yg=Symbol("deleteFile"),Gg=s=>({title:"Slett",ariaLabel:"Slett fil",onClick:e=>s(e.fileId),symbol:Yg}),Xg=Symbol("renameFile"),Qg=s=>{const e=d.useRef(null),t=d.useId(),n=()=>{var i;s.onSave(((i=e.current)==null?void 0:i.value)??"")};return o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:t,className:"pkt-sr-only",children:"Endre filnavn"}),o.jsx("input",{id:t,ref:e,type:"text",autoFocus:!0,defaultValue:s.value,className:"pkt-fileupload__queue-display__item__rename-input",onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),i.stopPropagation(),n()),i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),s.onCancel())}}),o.jsx(wt,{skin:"secondary",size:"small",onClick:()=>s.onSave(e.current.value),children:"Lagre"}),o.jsx(wt,{skin:"tertiary",size:"small",onClick:s.onCancel,children:"Avbryt"})]})},Zg=s=>{const e=d.useContext(ra);return o.jsx("input",{type:"hidden",name:`${e.name}-targetFilename`,value:s.targetFilename})},Jg=s=>{const e=s("targetFilename");return{title:"Rediger",ariaLabel:"Rediger filnavn",renderInlineUI:(t,n)=>o.jsx(Qg,{value:e.get(t.fileId)||void 0,onSave:i=>{e.set(t.fileId,i),n()},onCancel:n}),renderHidden:t=>o.jsx(Zg,{targetFilename:e.get(t.fileId)||t.file.name},`rename${t.fileId}`),symbol:Xg}},Rg=(s,e)=>{const t=d.useCallback((r,a,l)=>{const c=s.find(g=>g.fileId===r),h=c.attributes||{};c.attributes={...h,[a]:l},e(r,{attributes:c.attributes})},[e,s]),n=d.useCallback((r,a)=>(s.find(h=>h.fileId===r).attributes||{})[a],[s]);return{fileAttributes:d.useCallback(r=>({get:a=>n(a,r),set:(a,l)=>{t(a,r,l)}}),[n,t])}},eb=s=>{const[e,t]=d.useState(!1),[n,i]=d.useState(0),r=d.useRef(null),a=d.useCallback(h=>{var m;const g=s.findIndex(f=>f.fileId===h);g>=0&&(i(g),t(!0),(m=r.current)==null||m.showModal())},[s]),l=d.useCallback(()=>{var h;t(!1),(h=r.current)==null||h.close()},[]),c=d.useCallback(h=>{s.length!==0&&i(g=>h==="prev"?g<=0?s.length-1:g-1:g>=s.length-1?0:g+1)},[s.length]);return{isOpen:e,currentIndex:n,modalRef:r,open:a,close:l,navigate:c}},tb=s=>{const[e,t]=d.useState({}),n=d.useCallback(a=>{const l=e[a];if(l)return s.find(c=>c.symbol===l)},[e,s]),i=d.useCallback((a,l)=>{t(c=>({...c,[a]:l.symbol}))},[]),r=d.useCallback(a=>{t(l=>{const c={...l};return delete c[a],c})},[]);return{getActivated:n,activate:i,close:r}},oa=d.forwardRef(({children:s,className:e,open:t=!1,headingText:n="",hideCloseButton:i=!1,closeOnBackdropClick:r=!1,size:a="medium",removePadding:l=!1,closeButtonSkin:c="blue",variant:h="dialog",drawerPosition:g="right",transparentBackdrop:m=!1,onClose:f,...v},b)=>{const w=d.useRef(null),C=b||w,S=d.useCallback(()=>{var U,Q;(U=C.current)!=null&&U.open&&((Q=C.current)==null||Q.close(),f==null||f())},[C,f]);d.useEffect(()=>{const U=C.current;if(!U)return;const Q=new MutationObserver(()=>{U.open?document.body.classList.add("pkt-modal--open"):document.body.classList.remove("pkt-modal--open")});return Q.observe(U,{attributes:!0,attributeFilter:["open"]}),()=>Q.disconnect()},[C]),d.useEffect(()=>{var U,Q,$e,z;t?(U=C.current)!=null&&U.open||(Q=C.current)==null||Q.showModal():($e=C.current)!=null&&$e.open&&((z=C.current)==null||z.close())},[t,C]);const T=d.useCallback(U=>{r&&U.target===C.current&&S()},[r,C,S]),F=d.useCallback(()=>{f==null||f()},[f]),E=c==="blue",W=pe({"pkt-modal":!0,"pkt-modal--removePadding":l,"pkt-modal--noHeadingText":!n,"pkt-modal--noShadow":c==="yellow-filled","pkt-modal--transparentBackdrop":m,[`pkt-modal--${a}`]:a,[`pkt-modal__${h}`]:h,[`pkt-modal__drawer--${g}`]:h==="drawer"},e);return o.jsx("dialog",{...v,className:W,ref:C,"aria-labelledby":n?"pkt-modal__headingText":void 0,"aria-describedby":"pkt-modal__content",onClick:T,onClose:F,children:o.jsxs("div",{className:"pkt-modal__wrapper",children:[(n||!i)&&o.jsxs("div",{className:"pkt-modal__header",children:[o.jsx("div",{className:"pkt-modal__header-background"}),n?o.jsx("h1",{id:"pkt-modal__headingText",className:"pkt-modal__headingText pkt-txt-24",children:n}):o.jsx("div",{className:"pkt-modal__headingText"}),i?o.jsx("div",{className:"pkt-modal__noCloseButton"}):o.jsx("div",{className:pe("pkt-modal__closeButton",{[`pkt-modal__closeButton--${c}`]:!0}),children:o.jsx(wt,{onClick:S,"aria-label":"close",iconName:"close",variant:"icon-only",size:"medium",skin:E?"tertiary":"primary",children:"Lukk"})})]}),o.jsx("div",{className:"pkt-modal__container",children:o.jsx("div",{id:"pkt-modal__content",className:"pkt-modal__content pkt-txt-18-light",children:s})})]})})});oa.displayName="PktModal";const Fl=2,sb=s=>{const e=window.getComputedStyle(s),t=parseFloat(e.lineHeight);if(!Number.isNaN(t)&&t>0)return t;const n=parseFloat(e.fontSize);return(!Number.isNaN(n)&&n>0?n:16)*1.2},nb=(s,e,t)=>{const n=e*t;return s.getBoundingClientRect().height>n+.5},Bl=d.createContext({tail:5}),_i=({children:s,tail:e,...t})=>{const n=s,i=d.useContext(Bl),r=e!==void 0?e:i.tail||0,a=s.length<=r+3?null:s.slice(-r),l=d.useRef(null),c=d.useRef(null),[h,g]=d.useState(!1),m=d.useCallback(()=>{const v=l.current,b=c.current;if(!v||!b)return;const w=sb(v);g(nb(b,w,Fl))},[]),f=d.useMemo(()=>new ResizeObserver(v=>{v.some(b=>b.target===l.current)&&m()}),[m]);return d.useLayoutEffect(()=>(l.current&&f.observe(l.current),m(),()=>f.disconnect()),[s,f,m]),o.jsxs("span",{ref:l,...t,"data-pkt-truncate-part":"wrapper",style:{maxWidth:"100%",width:"100%",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"end",columnGap:"0.25rem",overflow:"hidden",position:"relative",...t.style},children:[o.jsx("span",{"data-pkt-truncate-part":"first",style:{minWidth:0,display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Fl,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",overflowWrap:"anywhere"},children:n}),r!==0&&o.jsx("span",{"data-pkt-truncate-part":"tail",style:{whiteSpace:"nowrap",display:h?"inline":"none",paddingRight:"0.5rem"},"aria-hidden":!0,children:a}),o.jsx("span",{ref:c,"aria-hidden":!0,"data-pkt-truncate-part":"measure",style:{position:"absolute",top:0,left:0,width:"100%",visibility:"hidden",pointerEvents:"none",whiteSpace:"normal",overflowWrap:"anywhere"},children:s})]})},ib=s=>{if(typeof s=="number")return s;const e=s.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!e)return console.warn(`PktFileUpload: Invalid maxFileSize format "${s}". Use format like "5MB", "500KB", or a number in bytes.`),0;const t=parseFloat(e[1]);switch(e[2].toUpperCase()){case"B":return t;case"KB":return t*1024;case"MB":return t*1024*1024;case"GB":return t*1024*1024*1024;default:return t}},ar=s=>s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:s<1024*1024*1024?`${Math.round(s/(1024*1024))} MB`:`${Math.round(s/(1024*1024*1024))} GB`,la=s=>o.jsx("button",{onClick:s.onClick,className:"pkt-fileupload__queue-display__item__cancel-button","aria-label":s.ariaLabel||"Avbryt opplasting",children:s.label||"Avbryt"}),rb=()=>{const[s,e]=d.useState(1);return d.useEffect(()=>{const t=setInterval(()=>{e(n=>n>=3?1:n+1)},400);return()=>clearInterval(t)},[]),o.jsxs("span",{className:"pkt-fileupload__queue-display__item__loading-text","aria-label":"Laster opp fil",children:["Laster opp",".".repeat(s)]})},ab=({cancelTransfer:s,transferItem:e})=>{const t=e.showProgress??e.progress!==0;return o.jsxs(o.Fragment,{children:[o.jsx(te,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title","aria-label":"Filnavn",children:o.jsx(_i,{children:e.attributes.targetFilename})}),o.jsx(la,{onClick:s}),t?o.jsxs(o.Fragment,{children:[o.jsx(ur,{valueCurrent:e.progress*100,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:ar(e.file.size)}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__percentage","aria-hidden":"true",children:`${Math.round(e.progress*100)}%`})]}):o.jsx(rb,{})]})},ob=({transferItem:s,onRemove:e})=>{const t=(s.lastProgress??1)*100;return o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(_i,{children:s.attributes.targetFilename})}),o.jsx(la,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),o.jsx(ur,{valueCurrent:t,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:ar(s.file.size)}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]})},lb=({transferItem:s,onRemove:e})=>o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(_i,{children:s.attributes.targetFilename})}),o.jsx(la,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]}),cb=({transferItem:s,onRemove:e})=>s.showProgress?o.jsx(ob,{transferItem:s,onRemove:e}):o.jsx(lb,{transferItem:s,onRemove:e}),ub=({operation:s,onActivate:e,transferItem:t})=>{const n=typeof s.title=="function"?s.title(t):s.title;if(!n)return null;const i=()=>{(s.renderInlineUI||s.renderExtendedUI)&&e(t.fileId,s),s.onClick&&s.onClick(t)};return o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__operation",onClick:i,"aria-label":typeof s.ariaLabel=="function"?s.ariaLabel(t):s.ariaLabel,children:n})},Vl=({transferItem:s})=>o.jsxs(o.Fragment,{children:[o.jsx(te,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(_i,{children:s.attributes.targetFilename})}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:ar(s.file.size)})]}),db=({transferItem:s,onPreviewClick:e})=>{const[t,n]=d.useState(null),[i,r]=d.useState(!1),a=s.file;d.useEffect(()=>{if(r(!1),a.type.startsWith("image/")){const g=URL.createObjectURL(a);return n(g),()=>{URL.revokeObjectURL(g)}}n(null)},[a]);const l=t&&!i&&o.jsx("img",{src:t,alt:s.attributes.targetFilename,onError:()=>r(!0)})||o.jsx(te,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"}),c=!!e,h=!!t&&!i;return o.jsxs("div",{className:`pkt-fileupload__queue-display__item__thumbnail${h?"":" pkt-fileupload__queue-display__item__thumbnail--fallback"}`,children:[o.jsxs(wt,{className:"pkt-fileupload__queue-display__item__thumbnail__image-wrapper","aria-label":`Forhåndsvis bilde ${s.attributes.targetFilename}`,type:"button",skin:"secondary",onClick:e,children:[c&&o.jsx(te,{name:"expand",className:"pkt-fileupload__queue-display__item__thumbnail__expand-icon","aria-hidden":"true"}),l]}),o.jsx(_i,{className:"pkt-fileupload__queue-display__item__thumbnail__title",children:s.attributes.targetFilename})]})},Hl=d.forwardRef(({isOpen:s,images:e,currentIndex:t,onClose:n,onNavigate:i},r)=>{const[a,l]=d.useState(null),[c,h]=d.useState(!1),g=e[t],m=e.length>1;return d.useEffect(()=>{if(h(!1),g&&g.file.type.startsWith("image/")){const f=URL.createObjectURL(g.file);return l(f),()=>URL.revokeObjectURL(f)}l(null)},[g]),d.useEffect(()=>{if(!s)return;const f=v=>{switch(v.key){case"ArrowLeft":v.preventDefault(),i("prev");break;case"ArrowRight":v.preventDefault(),i("next");break;case"Escape":v.preventDefault(),n();break}};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[s,i,n]),g?o.jsx(oa,{ref:r,headingText:g.attributes.targetFilename,closeOnBackdropClick:!0,className:"pkt-fileupload__image-preview-modal",children:o.jsxs("div",{className:"pkt-fileupload__image-preview",children:[m&&o.jsx(wt,{variant:"icon-only",iconName:"chevron-thin-left",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev",onClick:()=>i("prev"),"aria-label":`Forrige bilde ${t} / ${e.length}`}),o.jsx("div",{className:"pkt-fileupload__image-preview__content",children:a&&!c?o.jsx("img",{src:a,alt:`${g.attributes.targetFilename} - ${t+1} av ${e.length}`,className:"pkt-fileupload__image-preview__image",onError:()=>h(!0)}):o.jsx(te,{name:"picture",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"})}),m&&o.jsxs("span",{className:"pkt-fileupload__image-preview__counter",children:[t+1," / ",e.length]}),m&&o.jsx(wt,{variant:"icon-only",iconName:"chevron-thin-right",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next",onClick:()=>i("next"),"aria-label":`Neste bilde ${t+2} / ${e.length}`})]})}):null});Hl.displayName="ImagePreviewModal";const hb=s=>{var e;return(e=s.file.type)!=null&&e.startsWith("image/")?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(s.file.name||"")},ca=s=>typeof s=="number"?"in-progress":s==="error"?"error":"idle",pb=({operations:s,activatedOperation:e,onActivate:t,transferItem:n})=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__actions",children:s.filter(i=>!e||i.symbol!==e.symbol).map(i=>o.jsx(ub,{operation:i,onActivate:t,transferItem:n},i.symbol.toString()))}),fb=({operations:s,activatedOperation:e,onActivate:t,transferItem:n})=>o.jsx(o.Fragment,{children:s.filter(i=>i.renderContent).map(i=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__operation-content",children:i.renderContent(n,()=>t(n.fileId,i),(e==null?void 0:e.symbol)===i.symbol)},i.symbol.toString()))}),mb=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:n,onActivate:i,onClose:r,onPreviewClick:a})=>{const l=()=>r(s.fileId),h=(e==null?void 0:e.renderInlineUI)||(e==null?void 0:e.renderExtendedUI)?[]:t;return o.jsxs(o.Fragment,{children:[e!=null&&e.renderInlineUI?o.jsxs(o.Fragment,{children:[o.jsx(te,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon"}),o.jsx("div",{className:"pkt-fileupload__queue-display__item__inline-ui",children:e.renderInlineUI(s,l)})]}):o.jsx(n,{transferItem:s,queueItemOperations:t,onPreviewClick:a}),h.length>0&&o.jsx(pb,{operations:h,activatedOperation:e,onActivate:i,transferItem:s}),o.jsx(fb,{operations:t,activatedOperation:e,onActivate:i,transferItem:s}),(e==null?void 0:e.renderExtendedUI)&&o.jsx("div",{className:"pkt-fileupload__queue-display__item__expanded-operation-ui",children:e.renderExtendedUI(s,l)})]})},gb=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:n,enableImagePreview:i,onActivate:r,onClose:a,onCancelTransfer:l,onOpenPreview:c})=>{const h=ca(s.progress),g=i&&s.progress==="done"&&hb(s);switch(h){case"in-progress":return o.jsx(ab,{"aria-live":"off",transferItem:s,cancelTransfer:()=>l(s.fileId)});case"error":return o.jsx(cb,{transferItem:s,onRemove:()=>l(s.fileId)});case"idle":return o.jsx(mb,{transferItem:s,activatedOperation:e,operations:t,ItemRenderer:n,onActivate:r,onClose:a,onPreviewClick:g?()=>c(s.fileId):void 0})}},bb=s=>{var e;return(e=s.file.type)!=null&&e.startsWith("image/")?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(s.file.name||"")},vb=(s,e,t)=>d.useMemo(()=>{const n=s.map(r=>{const a=e.find(l=>l.fileId===r.fileId);return{...r,progress:(a==null?void 0:a.progress)??(t==="form"?"done":"queued"),errorMessage:a==null?void 0:a.errorMessage,showProgress:a==null?void 0:a.showProgress,lastProgress:a==null?void 0:a.lastProgress}}),i={"in-progress":0,error:1,idle:2};return n.sort((r,a)=>i[ca(r.progress)]-i[ca(a.progress)])},[s,e,t]),kb=(s,e)=>d.useMemo(()=>e?s.filter(t=>t.progress==="done"&&bb(t)):[],[s,e]),yb=({files:s,cancelTransfer:e,transfers:t=[],queueItemOperations:n=[],ItemRenderer:i=Vl,truncateTail:r,enableImagePreview:a=!1,uploadStrategy:l="form"})=>{const c=vb(s,t,l),h=kb(c,a),g=tb(n),m=eb(h);return o.jsxs(o.Fragment,{children:[o.jsx("ul",{className:"pkt-fileupload__queue-display",children:o.jsx(Bl.Provider,{value:{tail:r},children:c.map(f=>o.jsxs("li",{className:pe("pkt-fileupload__queue-display__item",{"pkt-fileupload__queue-display__item--in-progress":typeof f.progress=="number",[`pkt-fileupload__queue-display__item--${f.progress}`]:typeof f.progress=="string"}),children:[n.filter(v=>v.renderHidden).map(v=>v.renderHidden(f)),o.jsx(gb,{transferItem:f,activatedOperation:g.getActivated(f.fileId),operations:n,ItemRenderer:i,enableImagePreview:a,onActivate:g.activate,onClose:g.close,onCancelTransfer:e,onOpenPreview:m.open})]},f.fileId))})}),a&&h.length>0&&o.jsx(Hl,{ref:m.modalRef,isOpen:m.isOpen,images:h,currentIndex:m.currentIndex,onClose:m.close,onNavigate:m.navigate})]})},ua={filename:Vl,thumbnail:db},Ul=d.forwardRef(({value:s,defaultValue:e,id:t="fileupload-id",multiple:n=!1,uploadStrategy:i="form",addCommentsEnabled:r=!1,renameFilesEnabled:a=!1,truncateTail:l,onFilesChanged:c,onFileUploadRequested:h,extraOperations:g=[],itemRenderer:m=ua.filename,fullWidth:f=!1,allowedFormats:v,formatErrorMessage:b,maxFileSize:w,sizeErrorMessage:C,onFileValidation:S,errorMessage:T,hasError:F=!1,disabled:E=!1,label:W,helptext:U,optionalTag:Q,requiredTag:$e,enableImagePreview:z=!1,...M},G)=>{const V="transfers"in M?M.transfers:void 0,[ee,le]=d.useState(null),ne=F||!!ee,me=T||ee,ke=w?ib(w):void 0,fe=d.useCallback(q=>{var se;if(v&&v.length>0){const ge=((se=q.name.split(".").pop())==null?void 0:se.toLowerCase())||"",R=q.type.toLowerCase();if(!v.some(He=>{const k=He.toLowerCase().replace(/^\./,"");if(k.includes("/")){if(k.endsWith("/*")){const p=k.replace("/*","");return R.startsWith(p+"/")}return R===k}return ge===k})){const He=v.join(", "),k=`Ugyldig filtype. Tillatte formater: ${He}`;return(b==null?void 0:b.replace("{formats}",He))||k}}if(ke&&q.size>ke){const ge=ar(ke),R=`Filen er for stor. Maks størrelse er ${ge}.`;return(C==null?void 0:C.replace("{maxSize}",ge))||R}return S?S(q):null},[v,b,ke,C,S]);s!==void 0&&e!==void 0&&console.warn("PktFileupload: Både value og defaultValue er angitt. Komponenten kan være enten 'controlled' eller 'uncontrolled', ikke begge deler. Bruk kun én av dem. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable"),s!==void 0&&c===void 0&&console.warn("PktFileupload: value-prop er angitt uten onFilesChanged-callback. Når en komponent er 'controlled', må endringer håndteres via en callback. Vennligst legg til onFilesChanged-callback for å håndtere endringer i fil-listen. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable");const de=s!==void 0?s:e||[],Qe=typeof m=="string"?ua[m]:m,J=m==="thumbnail",P=typeof M.accept=="string"?M.accept.trim():void 0,Le=d.useMemo(()=>{if(!(!v||v.length===0))return v.map(q=>q.trim()).filter(Boolean).map(q=>{const se=q.toLowerCase();return se.includes("/")||se.startsWith(".")?se:`.${se}`}).join(", ")},[v]),Ve=P||Le,ae=a&&!J,Ye=r&&!J,xe=d.useCallback(q=>{for(const ge of q){const R=fe(ge.file);if(R){le(R);return}}le(null);const se=n?[...de,...q]:[q[0]];c&&c(se),i==="custom"&&h&&q.forEach(ge=>{h==null||h(ge)})},[c,de,n,i,h,fe]),ve=d.useCallback((q,se)=>{const ge=de.map(R=>R.fileId===q?{...R,...se}:R);c&&c(ge)},[c,de]),oe=d.useCallback(q=>{var ge;const se=de.filter(R=>R.fileId!==q);c&&c(se),"onTransferCancelled"in M&&M.onTransferCancelled&&((ge=M.onTransferCancelled)==null||ge.call(M,q))},[c,de,M]),{fileAttributes:ue}=Rg(de,ve),Me=d.useMemo(()=>[{op:Jg,enabled:ae},{op:q=>Kg(q),enabled:Ye}].filter(({enabled:q})=>q).map(({op:q})=>q).concat(...g),[ae,Ye]),Ae=d.useMemo(()=>({uploaded:`${t}-uploaded`,errors:`${t}-errors`}),[t]),{totalCount:Te,uploadedCount:I,failedCount:We}=d.useMemo(()=>{const q=de.length;if(!V)return{totalCount:q,uploadedCount:0,failedCount:0};let se=0,ge=0;for(const R of de){const ze=V.find(He=>He.fileId===R.fileId);(ze==null?void 0:ze.progress)==="done"&&se++,(ze==null?void 0:ze.progress)==="error"&&ge++}return{totalCount:q,uploadedCount:se,failedCount:ge}},[de,V]),Ie=Te===1?"fil":"filer",j=o.jsx("div",{className:pe("pkt-fileupload",{"pkt-fileupload--full-width":f,"pkt-fileupload--error":ne,"pkt-fileupload--disabled":E}),"aria-disabled":E,...E?{inert:""}:{},children:o.jsxs(ra.Provider,{value:{name:M.name||"",multiple:!!n,id:t},children:[o.jsx("div",{id:Ae.uploaded,className:"pkt-sr-only","aria-live":"polite","aria-atomic":"true",children:Te>0&&I>0&&`${I} av ${Te} ${Ie} lastet opp`}),o.jsx("div",{id:Ae.errors,className:"pkt-sr-only","aria-live":"assertive","aria-atomic":"true",children:Te>0&&We>0&&`Feil ved opplasting: ${We} av ${Te} ${Ie} feilet`}),o.jsx(Vg,{id:t,name:M.name||"",value:de,onFilesAdded:xe,multiple:n,uploadStrategy:i,ref:G,accept:J?".jpeg, .jpg, .png, .gif, .webp, .heic":Ve,isThumbnailView:J,disabled:E,srAnnouncementIds:Ae}),ne&&me&&o.jsx(Zi,{skin:"error","aria-live":"assertive",role:"alert",compact:!0,children:me}),o.jsx(yb,{files:de,cancelTransfer:oe,truncateTail:l,transfers:V,uploadStrategy:i,ItemRenderer:Qe,enableImagePreview:J&&z,queueItemOperations:Me.map(q=>q(ue)).concat(Gg(oe))})]})});return W?o.jsx(xs,{forId:t,label:W,helptext:U,disabled:E,hasError:ne,optionalTag:Q,requiredTag:$e,className:pe("pkt-fileupload-wrapper",{"pkt-fileupload-wrapper--full-width":f}),children:j}):j});Ul.displayName="PktFileUpload";const _b=({columnOne:s,columnTwo:e,socialLinks:t,className:n,openLinksInNewTab:i=!1,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:l=!1,hotjarId:c=null,googleAnalyticsId:h=null,devMode:g=!1,cookieDomain:m=null,cookieSecure:f=null,cookieExpiryDays:v=null,onToggleConsent:b=w=>{console.log(w.detail)}})=>{var C,S;const w=[n,"pkt-footer"].filter(Boolean).join(" ");return o.jsx("footer",{className:w,"data-mode":"dark",children:o.jsxs("div",{className:"pkt-footer__container",children:[o.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:s.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&o.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((T,F)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${T.external?"pkt-link--external":""}`,href:T.href,target:T.openInNewTab||i?"_blank":"_self",rel:T.openInNewTab||i?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer__link-icon",name:"chevron-right"}),T.text]})},`links-${F}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:e.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&o.jsx("li",{className:"pkt-footer__text",children:e.text}),(S=e.links)==null?void 0:S.map((T,F)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${T.external?"pkt-link--external":""}`,href:T.href,target:T.openInNewTab||i?"_blank":"_self",rel:T.openInNewTab||i?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer__link-icon",name:"chevron-right"}),T.text]})},`links-${F}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),o.jsxs("ul",{className:"pkt-footer__list",children:[o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:r,target:i?"_blank":"_self",rel:i?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:a,target:i?"_blank":"_self",rel:i?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),l&&o.jsx("li",{className:"pkt-footer__list-item",children:o.jsx(ir,{triggerType:"footerlink",hotjarId:c,googleAnalyticsId:h,devMode:g,cookieDomain:m,cookieSecure:f,cookieExpiryDays:v,onToggleConsent:b})})]})]})]}),t&&o.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[o.jsx("div",{className:"pkt-footer__social-languages",children:t.filter(T=>T.language).map((T,F)=>o.jsx("div",{className:"pkt-footer__social-language",children:o.jsx("a",{href:T.href,"aria-label":`til ${T.language} versjon av nettsiden`,target:T.openInNewTab||i?"_blank":"_self",rel:T.openInNewTab||i?"noopener noreferrer":void 0,children:T.language})},`sociallinks-language-${F}`))}),o.jsx("div",{className:"pkt-footer__social-icons",children:t.filter(T=>T.iconName).map((T,F)=>o.jsx(d.Fragment,{children:o.jsx("a",{href:T.href,"aria-label":`til ${T.iconName}`,className:"pkt-footer__social-icon-link",target:T.openInNewTab||i?"_blank":"_self",rel:T.openInNewTab||i?"noopener noreferrer":void 0,children:o.jsx(te,{className:"pkt-footer__social-icon",name:T.iconName})})},`sociallinks-${F}`))})]})]})})},$b=({links:s=[],openLinksInNewTab:e=!1,personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:n="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:i=!1,hotjarId:r=null,googleAnalyticsId:a=null,devMode:l=!1,cookieDomain:c=null,cookieSecure:h=null,cookieExpiryDays:g=null,onToggleConsent:m=v=>{console.log(v.detail)},className:f})=>{const v=[f,"pkt-footer-simple"].filter(Boolean).join(" ");return o.jsx("footer",{className:v,"data-mode":"dark",children:o.jsx("div",{className:"pkt-footer-simple__container",children:o.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((b,w)=>o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:`pkt-footer-simple__link ${b.external?" pkt-link--external":""}`,href:b.href,target:b.openInNewTab||e?"_blank":"_self",rel:b.openInNewTab||e?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),b.text]})},w)),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:t,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:n,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),i&&o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsx(ir,{triggerType:"footerlink",hotjarId:r,googleAnalyticsId:a,devMode:l,cookieDomain:c,cookieSecure:h,cookieExpiryDays:g,onToggleConsent:m})})]})})})},wb=(s,e)=>{const t=()=>typeof window>"u"?0:window.innerWidth,[n,i]=d.useState(t);return d.useEffect(()=>{const r=s.current;if(!r)return;if(i(r.offsetWidth),typeof ResizeObserver>"u"){const l=()=>{r&&i(r.offsetWidth)};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}const a=new ResizeObserver(l=>{for(const c of l)c.borderBoxSize&&c.borderBoxSize.length>0?i(c.borderBoxSize[0].inlineSize):i(c.contentRect.width)});return a.observe(r),()=>{a.disconnect()}},[s]),n};function xb(s){const e=d.useRef(0);d.useEffect(()=>{const t=document.body,n=document.documentElement;if(s){e.current=window.scrollY||window.pageYOffset;const i=window.innerWidth-n.clientWidth;i>0&&(t.style.paddingRight=`${i}px`),t.style.position="fixed",t.style.top=`-${e.current}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",n.classList.add("is-scroll-locked")}else t.style.removeProperty("position"),t.style.removeProperty("top"),t.style.removeProperty("left"),t.style.removeProperty("right"),t.style.removeProperty("width"),t.style.removeProperty("overflow"),t.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current});return()=>{s&&(t.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current}))}},[s])}const or=({href:s,iconName:e,className:t,iconPosition:n,external:i,target:r,children:a,...l})=>{const c={"pkt-link":!0,"pkt-link--icon-left":!!e&&n==="left"||!!(e&&!n),"pkt-link--icon-right":!!e&&n==="right","pkt-link--external":i};return o.jsxs("a",{...l,className:pe(c,t),href:s,target:r,rel:i?"noopener noreferrer":void 0,children:[e&&o.jsx(te,{name:e,className:"pkt-link__icon"}),a]})};or.displayName="PktLink";const Sb=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},lr=({item:s,className:e})=>"href"in s?o.jsx(or,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:pe("pkt-user-menu__link",e),children:s.title}):o.jsxs("button",{className:pe("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",e),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&o.jsx(te,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),Cb=({links:s})=>o.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((e,t)=>o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(lr,{item:e})},t))}),ql=d.forwardRef(({user:s,formattedLastLoggedIn:e,representing:t,userMenu:n,canChangeRepresentation:i,changeRepresentation:r,logoutOnClick:a},l)=>{const c=n==null?void 0:n.map(Sb);return o.jsx("nav",{className:"pkt-user-menu",ref:l,"aria-label":"Meny for innlogget bruker",children:o.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),e&&o.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",o.jsx("time",{children:e})]})]}),c&&c.length>0&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(Cb,{links:c})}),t&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:t.name}),t.orgNumber&&o.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",t.orgNumber]}),i&&r&&o.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(lr,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})]}),!t&&i&&r&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx("ul",{className:"pkt-user-menu__sublist",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(lr,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})}),a&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(lr,{item:{title:"Logg ut",iconName:"exit",onClick:a}})})]})})});ql.displayName="PktHeaderUserMenu";const cr=d.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,autocomplete:n="off",counter:i,counterMaxLength:r,className:a,disabled:l=!1,errorMessage:c,hasError:h=!1,helptext:g,helptextDropdown:m,helptextDropdownButton:f,iconNameRight:v,inline:b=!1,fullwidth:w=!1,label:C,name:S,optionalTag:T=!1,optionalText:F,requiredTag:E=!1,requiredText:W,tagText:U=null,placeholder:Q,prefix:$e,suffix:z,type:M="text",useWrapper:G=!0,omitSearchIcon:V=!1,value:ee,minLength:le,maxLength:ne,min:me,max:ke,step:fe,size:ce,readonly:de,required:Qe,dataTestid:J,onChange:P,skipForwardTestid:Le=!1,...Ve},ae)=>{const Ye=[a,"pkt-textinput"].join(" "),xe=M==="search"&&!v&&!V,ve=M==="date"&&ee?ee.slice(0,10):ee,[oe,ue]=d.useState((ee==null?void 0:ee.length)||0),Me=`${s}`,Ae=`${Me}-label`,Te=t||Ae,I=We=>{var Ie,j;i&&ue(((j=(Ie=We.currentTarget)==null?void 0:Ie.value)==null?void 0:j.length)||0),P&&P(We)};return d.useEffect(()=>{ee!==void 0&&ue((ee==null?void 0:ee.length)||0)},[ee]),o.jsx(xs,{ariaDescribedby:e,className:Ye,disabled:l,errorMessage:c,forId:Me,hasError:h,helptext:g,helptextDropdown:m,helptextDropdownButton:f,inline:b,label:C,optionalTag:T,optionalText:F,requiredTag:E,requiredText:W,tagText:U,useWrapper:G,counter:i,counterCurrent:oe,counterMaxLength:r,children:o.jsxs("div",{className:"pkt-input__container","data-testid":J,"data-skip-forward-testid":Le?"true":void 0,children:[$e&&o.jsx("div",{className:"pkt-input-prefix",children:$e}),o.jsx("input",{...Ve,ref:ae,className:`pkt-input ${w?"pkt-input--fullwidth":""} ${r&&oe>r?"pkt-input--counter-error":""}`,type:M,name:`${S||s}`,value:ve,id:Me,placeholder:Q,autoComplete:n,disabled:l,"aria-invalid":h,"aria-errormessage":`${s}-error`,"aria-labelledby":Te,min:me,max:ke,onChange:I,step:fe,minLength:le,maxLength:ne,size:ce,readOnly:de,required:Qe}),z&&o.jsxs("p",{className:"pkt-input-suffix",children:[z,v&&o.jsx(te,{className:"pkt-input-suffix-icon",name:v}),xe&&o.jsx(te,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!z&&v&&o.jsx(te,{className:"pkt-input-icon",name:v}),!z&&xe&&o.jsx(te,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});cr.displayName="PktTextinput";const da=d.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:e=1280,children:t,className:n,compact:i=!1,"data-mode":r,logOutButtonPlacement:a="none",logOut:l,openedMenu:c,showSearch:h=!1,onSearch:g,onSearchChange:m,searchValue:f,searchPlaceholder:v="Søk",representing:b,serviceLink:w,serviceClick:C,serviceName:S,user:T,userMenu:F,userMenuFooter:E,userOptions:W,canChangeRepresentation:U=!1,changeRepresentation:Q,hideLogo:$e=!1,logoLink:z,logoClick:M,position:G="fixed",scrollBehavior:V="hide",slotMenuVariant:ee="icon-only",slotMenuText:le="Meny"},ne)=>{const me=G==="fixed",ke=V==="hide";d.useEffect(()=>{E&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[E]),d.useEffect(()=>{W&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[W]),d.useEffect(()=>{T!=null&&T.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),b!=null&&b.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[T==null?void 0:T.shortname,b==null?void 0:b.shortname]);const fe=d.useMemo(()=>{if(T!=null&&T.lastLoggedIn)return typeof T.lastLoggedIn=="string"?T.lastLoggedIn:new Date(T.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[T==null?void 0:T.lastLoggedIn]),[ce,de]=d.useState(c||"none");d.useEffect(()=>{c!==void 0&&de(c)},[c]);const[Qe,J]=d.useState(!1),[P,Le]=d.useState(0),[Ve,ae]=d.useState(!1),[Ye,xe]=d.useState(!1),ve=d.useRef(null),oe=d.useRef(null),ue=d.useRef(null),Me=d.useRef(null),Ae=d.useRef(null),Te=d.useRef(null),I=d.useRef(null),We=d.useRef(!1),Ie=wb(ve),j=Ie<s,q=Ie<e,se=d.useCallback(p=>{ve.current=p,typeof ne=="function"?ne(p):ne&&(ne.current=p)},[ne]);xb(me&&j&&ce!=="none");const ge=d.useCallback((p,$)=>{const D=p.relatedTarget;let Y;switch($){case"user":Y=oe;break;case"slot":Y=ue;break;case"search":Y=Me;break;default:return}const K=Y.current;K&&(!D||!K.contains(D))&&de("none")},[]),R=d.useCallback(()=>{We.current&&I.current&&document.contains(I.current)&&I.current.focus(),I.current=null,We.current=!1},[]);d.useEffect(()=>{const p=D=>{T&&ce==="user"&&!D.target.closest(".pkt-header-service__user-container")&&de("none"),ce==="slot"&&!D.target.closest(".pkt-header-service__slot-container")&&de("none"),ce==="search"&&!D.target.closest(".pkt-header-service__search-container")&&!D.target.closest(".pkt-header-service__search-input")&&de("none")},$=D=>{D.key==="Escape"&&ce!=="none"&&(D.preventDefault(),We.current=!0,de("none"))};if(ce!=="none")return document.addEventListener("mousedown",p),document.addEventListener("keydown",$),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",$)};R()},[ce,T,R]),d.useEffect(()=>{const p=()=>{if(ke){const $=window.pageYOffset||document.documentElement.scrollTop;if($<0||Math.abs($-P)<60)return;J($>P),Le($)}};return document&&window.addEventListener("scroll",p),()=>{document&&window.removeEventListener("scroll",p)}},[ke,P]);const ze=d.useCallback(p=>{const $=p==="slot"?ue:Me,D=p==="slot"?Ae:Te;if(!$.current||!D.current||!q||j)return;const Y=$.current.getBoundingClientRect(),K=D.current.offsetWidth,ye=Y.left+K>window.innerWidth;p==="slot"?ae(ye):xe(ye)},[q,j]),He=d.useCallback(p=>{ce!=="none"?de("none"):(I.current=document.activeElement,de(p))},[ce]);d.useEffect(()=>{(ce==="slot"||ce==="search")&&requestAnimationFrame(()=>{ze(ce)})},[ce,ze]);const k=o.jsxs("header",{className:pe("pkt-header-service",i&&"pkt-header-service--compact",j&&"pkt-header-service--mobile",q&&"pkt-header-service--tablet",me&&"pkt-header-service--fixed",ke&&"pkt-header-service--scroll-to-hide",Qe&&"pkt-header-service--hidden",n),"data-mode":r,ref:se,children:[o.jsxs("div",{className:pe("pkt-header-service__logo-area",(!S||S==="")&&"pkt-header-service__logo-area--without-service"),children:[!$e&&o.jsx("span",{className:"pkt-header-service__logo",children:z?o.jsx("a",{href:z,"aria-label":"Tilbake til forside",children:o.jsx(te,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/16.7/logos/"})}):M?o.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:M,children:o.jsx(te,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/16.7/logos/"})}):o.jsx(te,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/16.7/logos/"})}),S&&o.jsx("span",{className:"pkt-header-service__service-name",children:w?o.jsx(or,{href:w,className:"pkt-header-service__service-link ",children:S}):C?o.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:C,children:S}):o.jsx("span",{className:"pkt-header-service__service-link",children:S})})]}),t||h||q&&l&&(a==="header"||a==="both")?o.jsxs("div",{className:"pkt-header-service__content",children:[o.jsxs("div",{className:pe("pkt-header-service__slot-container",ce==="slot"&&"is-open"),onBlur:p=>ge(p,"slot"),ref:ue,children:[q&&t&&o.jsx(wt,{skin:"secondary",variant:ee,iconName:"menu",size:j?"small":"medium",state:ce==="slot"?"active":"normal",onClick:()=>He("slot"),"aria-expanded":ce==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:le}),o.jsx("div",{className:pe("pkt-header-service__slot-content",Ve&&"align-right"),id:"mobile-slot-menu",role:q?"menu":void 0,"aria-label":q?"Meny":void 0,ref:Ae,children:o.jsx("div",{className:"pkt-contents",children:t})})]}),h&&o.jsx(o.Fragment,{children:q?o.jsxs("div",{className:pe("pkt-header-service__search-container",ce==="search"&&"is-open"),onBlur:p=>ge(p,"search"),ref:Me,children:[o.jsx(wt,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:j?"small":"medium",onClick:()=>He("search"),state:ce==="search"?"active":"normal","aria-expanded":ce==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),o.jsx("div",{className:pe("pkt-header-service__mobile-menu",ce==="search"&&"is-open",Ye&&"align-right"),ref:Te,children:ce==="search"&&o.jsx(cr,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:v,value:f,autoFocus:!0,fullwidth:!0,onChange:p=>m==null?void 0:m(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(g==null||g(p.target.value))}})})]}):o.jsx(cr,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:v,value:f,onChange:p=>m==null?void 0:m(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(g==null||g(p.target.value))}})}),j&&l&&(a==="header"||a==="both")&&o.jsx(wt,{skin:"secondary",size:j?"small":"medium",variant:"icon-only",iconName:"exit",onClick:l,children:"Logg ut"})]}):null,(T||!j&&l&&(a==="header"||a==="both"))&&o.jsxs("div",{className:"pkt-header-service__user",children:[T&&o.jsxs("div",{className:"pkt-header-service__user-container",onBlur:p=>ge(p,"user"),ref:oe,children:[o.jsxs(wt,{className:pe("pkt-header-service__user-button",j&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:j?"small":"medium",state:ce==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:ce==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>He("user"),children:[o.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||T.name]}),ce==="user"&&T&&o.jsx("div",{className:pe(j?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:o.jsx(ql,{user:T,formattedLastLoggedIn:fe,representing:b,userMenu:F,canChangeRepresentation:U,changeRepresentation:Q,logoutOnClick:a==="userMenu"||a==="both"?l:void 0})})]}),!j&&l&&(a==="header"||a==="both")&&o.jsx(wt,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:l,children:"Logg ut"})]})]});return me?o.jsxs("div",{className:"pkt-header-service-wrapper",children:[k,o.jsx("div",{className:pe("pkt-header-service-spacer",i&&"pkt-header-service-spacer--compact",T&&"pkt-header-service-spacer--has-user",j&&"pkt-header-service-spacer--mobile",q&&"pkt-header-service-spacer--tablet")})]}):k});da.displayName="PktHeaderService";const jl=d.forwardRef((s,e)=>o.jsx(da,{...s,ref:e}));jl.displayName="PktHeader";const Tb=Bn({tagName:"pkt-heading",elementClass:Ps,react:d,displayName:"PktHeading"}),Wl=d.forwardRef(({children:s,...e},t)=>o.jsx(Tb,{"data-testid":"pkt-heading",...e,ref:t,children:s}));Wl.displayName="PktHeading";const Db=Bn({tagName:"pkt-helptext",elementClass:Is,react:d,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),zl=d.forwardRef(({children:s,...e},t)=>o.jsx(Db,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));zl.displayName="PktHelptext";const Kl=d.forwardRef(({label:s,id:e,children:t,...n},i)=>o.jsxs("div",{className:"pkt-form-group",children:[o.jsx("label",{htmlFor:e,className:"pkt-form-label",children:s}),o.jsx("input",{className:"pkt-form-input",id:e,...n,ref:i}),t]}));Kl.displayName="PktInput";const Yl=({children:s,skin:e,title:t,href:n,iconName:i,openInNewTab:r,external:a,className:l,...c})=>{const h=["pkt-linkcard",e&&`pkt-linkcard--${e}`].filter(Boolean).join(" "),g=["pkt-linkcard__title",a&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return o.jsxs("a",{...c,href:n,className:pe(h,l),target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,children:[i&&o.jsx(te,{className:"pkt-link__icon",name:i}),t&&o.jsx("div",{className:pe(g),children:t}),o.jsx("div",{className:"pkt-linkcard__text",children:s})]})};Yl.displayName="PktLinkCard";const Nb=Bn({tagName:"pkt-loader",elementClass:os,react:d,displayName:"PktLoader",events:{}}),Gl=d.forwardRef(({children:s,...e},t)=>o.jsx(Nb,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));Gl.displayName="PktLoader";const Xl=({children:s,className:e,skin:t,title:n,compact:i,closable:r,onClose:a,...l})=>{const[c,h]=d.useState(!1),g={"pkt-messagebox":!0,"pkt-messagebox--compact":i,[`pkt-messagebox--${t}`]:t,"pkt-messagebox--closable":r,"pkt-hide":c},m=d.createRef(),f=d.useCallback(()=>{h(!0),a&&a()},[h,a]);return o.jsxs("div",{...l,className:pe(g,e),ref:m,children:[r&&o.jsx("div",{className:"pkt-messagebox__close",children:o.jsx("button",{onClick:f,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:o.jsx(te,{name:"close",className:"pkt-link__icon"})})}),n&&o.jsx("div",{className:"pkt-messagebox__title",children:n}),o.jsx("div",{className:"pkt-messagebox__text",children:s})]})};Xl.displayName="PktMessagebox";const Ql=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Mb=()=>{const s=Ql(),e=Ql();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)},ur=d.forwardRef(({ariaLabel:s,ariaLabelledby:e,ariaLive:t="polite",ariaValueText:n,id:i,role:r="progressbar",skin:a="dark-blue",statusPlacement:l="following",statusType:c="none",title:h,titlePosition:g="left",valueCurrent:m=0,valueMax:f=100,valueMin:v=0,className:b,...w},C)=>{const S=d.useMemo(()=>Mb(),[]),T=i||S,F=d.useRef(null),[E,W]=d.useState(0);d.useEffect(()=>{F.current&&W(F.current.getBoundingClientRect().width||0)},[m]);const U=f-v,Q=Math.round(c==="fraction"?m/U*100:(m-v)/U*100),$e=`${m} av ${U}`,z=c==="fraction"&&!n?`${m} av ${f-v}`:n||void 0,M=s?void 0:e||`${T}-title`;return o.jsx("div",{ref:C,id:T,role:r,"aria-live":t,"aria-atomic":"true","aria-valuenow":m,"aria-valuemin":v,"aria-valuemax":f,"aria-valuetext":z,"aria-label":s||void 0,"aria-labelledby":M,className:pe("pkt-progressbar",b),...w,children:o.jsxs("div",{className:"pkt-progressbar__container",style:{"--pkt-progress-label-width":`${E}px`,"--pkt-progress-width":`${Q}%`},children:[h&&o.jsx("p",{id:`${T}-title`,className:pe("pkt-progressbar__title",{"pkt-progressbar__title-center":g==="center"}),children:h}),o.jsx("div",{className:"pkt-progressbar__bar-wrapper",children:o.jsx("div",{className:pe("pkt-progressbar__bar",`pkt-progressbar__bar--${a}`)})}),c!=="none"&&o.jsx("div",{className:pe("pkt-progressbar__status",{"pkt-progressbar__status--center":l==="center"}),children:o.jsx("span",{ref:F,className:pe({"pkt-progressbar__status-placement--following":l==="following","pkt-progressbar__status-placement--center":l==="center","pkt-progressbar__status-placement--left":l==="left"}),children:c==="percentage"?`${Q}%`:$e})})]})})});ur.displayName="PktProgressbar";const Zl=d.forwardRef(({id:s,name:e,label:t,className:n,hasTile:i=!1,disabled:r=!1,checkHelptext:a,hasError:l=!1,defaultChecked:c,checked:h,optionalTag:g,optionalText:m,requiredTag:f,requiredText:v,tagText:b,...w},C)=>{const S=[n,"pkt-input-check"].filter(Boolean).join(" "),T=["pkt-input-check__input",i?"pkt-input-check__input--tile":"",r&&i?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),F=["pkt-input-check__input-checkbox",l?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),E=["pkt-input-check__input-label",r?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),W=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),U=()=>o.jsxs(o.Fragment,{children:[b&&o.jsx("span",{className:W+" pkt-tag--gray",children:b}),g&&o.jsx("span",{className:W+" pkt-tag--blue-light",children:m}),f&&o.jsx("span",{className:W+" pkt-tag--beige",children:v})]});return o.jsx("div",{className:S,children:o.jsxs("div",{className:T,children:[o.jsx("input",{ref:C,id:s,type:"radio",name:e,disabled:r,className:F,...h!==void 0?{checked:h}:{defaultChecked:c},...w}),o.jsxs("label",{className:E,htmlFor:s,children:[t," ",U(),a&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});Zl.displayName="PktRadioButton";const Jl=d.forwardRef(({appearance:s="local",disabled:e=!1,fullwidth:t=!1,id:n,label:i,name:r,placeholder:a="Søk…",suggestions:l,value:c="",action:h,method:g,onChange:m,onSearch:f,onSuggestionClick:v,...b},w)=>{const C=(E,W)=>{E?E():v&&v(W)},S=E=>{c=E.target.value},T=`pkt-searchinput pkt-searchinput--${s} ${t?"pkt-searchinput--fullwidth":""}`;let F;return h?F=E=>o.jsx("form",{role:"search",className:T,action:h,method:g,children:E}):F=E=>o.jsx("div",{role:"search",className:T,children:E}),F(o.jsxs(o.Fragment,{children:[i&&o.jsx("label",{htmlFor:i?n:void 0,className:i?"pkt-inputwrapper__label":"",children:i}),o.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[o.jsx("input",{className:`pkt-input ${t?"pkt-input--fullwidth":""}`,type:"search",name:r||n,id:n,placeholder:a,defaultValue:c,disabled:e,autoComplete:"off","aria-autocomplete":"list",ref:w,"aria-controls":`${n}-suggestions`,onChange:m||S,onKeyUp:f&&(E=>{E.key==="Enter"&&(E.preventDefault(),f(c))}),...b}),o.jsx(wt,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:e,onClick:f&&(E=>{E.preventDefault(),f(c)}),children:i||a})]}),l&&o.jsx("ul",{id:`${n}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:l.map((E,W)=>o.jsx("li",{children:d.createElement(E.href?"a":E.onClick?"button":"div",{href:E.href,className:`pkt-searchinput__suggestion ${E.onClick?"pkt-link-button":""} ${E.href||E.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:E.onClick?"button":void 0,onClick:()=>C(E.onClick,W),onKeyUp:U=>U.key==="Enter"&&C(E.onClick,W)},o.jsxs(o.Fragment,{children:[E.title&&o.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:E.title}),E.text&&o.jsx("p",{className:"pkt-searchinput__suggestion-text",children:E.text})]}))},`search-suggestion-${W}`))})]}))});Jl.displayName="PktSearchInput";const Rl=d.forwardRef(({ariaDescribedby:s,ariaLabelledby:e,children:t,className:n,disabled:i=!1,errorMessage:r,hasError:a,helptext:l,helptextDropdown:c,helptextDropdownButton:h,id:g,inline:m=!1,fullwidth:f=!1,label:v,name:b,optionalTag:w=!1,optionalText:C,requiredTag:S=!1,requiredText:T,tagText:F,...E},W)=>{const U=[n,"pkt-select"].join(" ");return o.jsx(xs,{className:U,forId:`${g}-input`,label:v,helptext:l,helptextDropdown:c,helptextDropdownButton:h,optionalTag:w,optionalText:C,requiredTag:S,requiredText:T,tagText:F,hasError:a,errorMessage:r,disabled:i,inline:m,ariaDescribedby:s,children:o.jsx("select",{ref:W,className:`pkt-input ${f?"pkt-input--fullwidth":""}`,"aria-invalid":a,"aria-errormessage":`${g}-error`,"aria-labelledby":e||void 0,disabled:i,id:`${g}-input`,name:b||g,...E,children:t})})});Rl.displayName="PktSelect";const Ob=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:o.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),Eb=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),o.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),Pb=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),o.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),Ab=({children:s,className:e,status:t="incomplete",title:n})=>o.jsxs("li",{className:pe("pkt-step",e,`pkt-step--${t}`),"data-testid":"pkt-step",children:[o.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),o.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),o.jsx("span",{className:pe("pkt-step__indicator"),children:t==="current"?Eb:t==="completed"?Pb:Ob}),o.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),o.jsxs("div",{className:"pkt-step__wrapper",children:[o.jsx("div",{className:"pkt-step__title",children:n}),o.jsx("div",{className:"pkt-step__content",children:s})]})]}),ec=d.forwardRef(({activeStep:s,className:e,children:t,hideNonActiveSteps:n=!1,hideNonActiveStepsContent:i=!0,orientation:r="vertical",...a},l)=>{const c=pe(e,"pkt-stepper",r==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),h=d.Children.map(t,(g,m)=>d.isValidElement(g)?d.cloneElement(g,{className:pe(g.props.className,{"pkt-step--hideStep":n&&m!==s,"pkt-step--hideContent":i&&m!==s})}):g);return o.jsx("ol",{"data-testid":"pkt-stepper",className:c,ref:l,...a,children:h})});ec.displayName="PktStepper";const Ib=({className:s,compact:e=!1,skin:t="basic",responsiveView:n=!0,children:i,...r})=>o.jsx("table",{"data-testid":"pkt-table",className:pe(s,"pkt-table",{"pkt-table--responsive":n,"pkt-table--compact":e,"pkt-table--basic":t==="basic","pkt-table--zebra-blue":t==="zebra-blue"}),role:"table",...r,children:i}),Lb=({id:s,children:e,className:t,...n})=>o.jsx("tbody",{id:s,className:pe(t,"pkt-table__body",{}),...n,role:"rowgroup",children:e}),Fb=({children:s,className:e,dataLabel:t,...n})=>o.jsx("td",{className:pe(e,"pkt-table__data-cell",{}),"data-label":t,role:"cell","data-testid":"pkt-table__data-cell",...n,children:s}),Bb=({className:s,children:e,...t})=>o.jsx("thead",{className:pe(s,"pkt-table__header",{}),role:"rowgroup",...t,children:e}),Vb=({className:s,children:e,...t})=>o.jsx("th",{className:pe(s,"pkt-table__header-cell",{}),role:"columnheader",...t,children:e}),Hb=({className:s,children:e,...t})=>o.jsx("tr",{className:pe(s,"pkt-table__row",{}),role:"row",...t,children:e}),ha=d.forwardRef(({children:s,active:e,href:t,onClick:n,icon:i,controls:r,tag:a,tagSkin:l,index:c=0},h)=>{const{arrowNav:g,registerTabRef:m,handleKeyPress:f,selectTab:v}=Ub(),w={"aria-selected":g?!!e:void 0,"aria-controls":r,role:g?"tab":void 0,onKeyUp:S=>f(c,S),onClick:S=>{v(c),n==null||n(S)},tabIndex:e||!g?void 0:-1,ref:S=>{m(c,S),typeof h=="function"?h(S):h&&(h.current=S)}},C=o.jsxs(o.Fragment,{children:[i&&o.jsx(te,{name:i,className:"pkt-icon--small"}),s,a&&o.jsx(Us,{skin:l,size:"small",children:a})]});return t?o.jsx("a",{...w,href:t,className:`pkt-tabs__link ${e?"active":""}`,children:C}):o.jsx("button",{...w,type:"button",className:`pkt-tabs__button pkt-link-button ${e?"active":""}`,children:C})});ha.displayName="PktTabItem";const tc=d.createContext(null),Ub=()=>{const s=d.useContext(tc);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},sc=d.forwardRef(({arrowNav:s=!0,disableArrowNav:e=!1,tabs:t,onTabSelected:n,children:i},r)=>{const a=d.useRef([]),l=s&&!e,h=i&&d.Children.count(i)>0?d.Children.count(i):(t==null?void 0:t.length)||0;d.useEffect(()=>{a.current=a.current.slice(0,h)},[h]);const g=b=>{const w=t==null?void 0:t[b];w!=null&&w.action&&w.action(b),n&&n(b)},m=(b,w)=>{var C,S;l&&(w.code==="ArrowLeft"&&b!==0&&((C=a.current[b-1])==null||C.focus()),w.code==="ArrowRight"&&b<h-1&&((S=a.current[b+1])==null||S.focus()),(w.code==="ArrowDown"||w.code==="Space")&&g(b))},f=(b,w)=>{a.current[b]=w},v=t==null?void 0:t.map((b,w)=>{var C,S;return o.jsx(ha,{active:b.active,href:b.href,onClick:()=>g(w),icon:b.icon,controls:b.controls,tag:(C=b.tag)==null?void 0:C.text,tagSkin:(S=b.tag)==null?void 0:S.skin,index:w,children:b.text},w)});return o.jsx(tc.Provider,{value:{arrowNav:l,registerTabRef:f,handleKeyPress:m,selectTab:g},children:o.jsx("div",{className:"pkt-tabs",ref:r,children:o.jsx("div",{className:"pkt-tabs__list",role:l?"tablist":"navigation",children:i||v})})})});sc.displayName="PktTabs";const qb={hours:"Timer",minutes:"Minutter",openPicker:"Åpne tidspunkt-velger",prevTime:"Forrige tidspunkt",nextTime:"Neste tidspunkt",selectTime:"Velg tidspunkt"},pa=s=>s?Math.max(1,Math.round(s/60)):1,jb=(s,e)=>{const t=s?parseInt(String(s).split(":")[0],10):0,n=e?parseInt(String(e).split(":")[0],10):23;return Array.from({length:n-t+1},(i,r)=>r+t)},Wb=s=>{const e=pa(s);return Array.from({length:Math.floor(60/e)},(t,n)=>n*e)},zb=(s,e,t,n)=>{let a=s!==""?parseInt(s,10):t===1?0:23,l=e!==""?parseInt(e,10):t===1?0:Math.floor(59/n)*n;return l+=t*n,l>59?(l=0,a=(a+1)%24):l<0&&(l=Math.floor(59/n)*n,a=(a-1+24)%24),{hours:String(a).padStart(2,"0"),minutes:String(l).padStart(2,"0")}},nc=s=>/^\d{2}:\d{2}$/.test(s)&&parseInt(s.slice(0,2),10)<=23&&parseInt(s.slice(3),10)<=59,fa=s=>{const[e,t]=s.split(":").map(Number);return e*60+t},un={required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",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}."};function $i(s){if(s&&nc(s)){const[e,t]=s.split(":");return[e,t]}return["",""]}function ic(s,e){return`${String(parseInt(s,10)).padStart(2,"0")}:${String(parseInt(e,10)).padStart(2,"0")}`}function rc(s,e){const{required:t,min:n,max:i,step:r}=e;if(t&&!s)return{valid:!1,message:un.required};if(!s)return{valid:!0};if(!nc(s))return{valid:!1,message:un.invalid};const a=fa(s),l=pa(r);return n&&a<fa(String(n))?{valid:!1,message:un.rangeUnderflowMin.replace("{min}",String(n))}:i&&a>fa(String(i))?{valid:!1,message:un.rangeOverflowMax.replace("{max}",String(i))}:r&&a%l!==0?{valid:!1,message:l===60?un.timeStepMismatchHour:l===30?un.timeStepMismatchHalfHour:un.timeStepMismatch.replace("{step}",`${l}, ${l*2}, ${l*3}`)}:{valid:!0}}function Kb(s){return s===3600||s<3600&&3600%s===0&&s%60===0}function Yb(s,e){const{id:t,label:n,value:i,defaultValue:r,min:a,max:l,step:c=60,hidePicker:h=!1,stepArrows:g=!1,fullwidth:m=!1,name:f,disabled:v=!1,required:b=!1,helptext:w,helptextDropdown:C,helptextDropdownButton:S,hasError:T=!1,errorMessage:F,optionalTag:E=!1,optionalText:W,requiredTag:U=!1,requiredText:Q,tagText:$e,inline:z=!1,useWrapper:M=!0,ariaDescribedby:G,strings:V,className:ee,onValueChange:le,onFocus:ne,onBlur:me}=s,ke=d.useMemo(()=>V??qb,[V]),fe=i!==void 0,ce=i!==void 0?i??"":r??"",de=d.useRef(ce),[Qe,J]=d.useState(()=>ce),P=fe?i??"":Qe,[Le,Ve]=d.useState(()=>$i(i!==void 0?i:r)[0]),[ae,Ye]=d.useState(()=>$i(i!==void 0?i:r)[1]),xe=d.useRef(Le),ve=d.useRef(ae),oe=d.useCallback(O=>{xe.current=O,Ve(O)},[]),ue=d.useCallback(O=>{ve.current=O,Ye(O)},[]),[Me,Ae]=d.useState(!1),[Te,I]=d.useState(!1),We=d.useRef(i);d.useEffect(()=>{if(!fe||i===We.current)return;We.current=i;const[O,H]=$i(i);oe(O),ue(H)},[i,fe,oe,ue]),d.useEffect(()=>{c!=null&&!Kb(c)&&console.warn(`PktTimepicker: step="${c}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)},[c]);const Ie=d.useRef(null),j=d.useRef(null),q=d.useRef(null),se=d.useRef(null),ge=d.useRef(null),R=d.useRef(null),ze=d.useRef(0),He=d.useRef(-1),k=d.useRef(0),p=d.useRef(-1),[$,D]=d.useState(!1),Y=d.useMemo(()=>{var O;return(O=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:O.set},[]),K=d.useMemo(()=>pa(c),[c]),ye=d.useMemo(()=>jb(a,l),[a,l]),ot=d.useMemo(()=>Wb(c),[c]),it=`${t}-hours`,Ge=`${t}-minutes`,zt=`${t}-popup`,Kt=`${t}-input`;d.useEffect(()=>{const O=Ie.current;if(!O)return;const H=rc(P,{required:b,min:a,max:l,step:c});O.setCustomValidity(H.valid?"":H.message??""),I($&&!H.valid)},[P,b,a,l,c,$]);const Oe=d.useCallback(O=>{fe||J(O);const H=R.current;!H||!Y||(Y.call(H,O),H.dispatchEvent(new Event("input",{bubbles:!0})),le==null||le(O))},[fe,Y,le]),Bt=d.useCallback(()=>{const O=xe.current,H=ve.current;if(O!==""&&H!==""){const ie=ic(O,H);ie!==P&&Oe(ie)}else P!==""&&Oe("")},[P,Oe]),Ze=d.useCallback(()=>{var ie,N;const O=xe.current,H=ve.current;if(O!==""&&H!==""){const A=ic(O,H);A!==P?Oe(A):(ie=R.current)==null||ie.dispatchEvent(new Event("input",{bubbles:!0}))}else P!==""?Oe(""):(N=R.current)==null||N.dispatchEvent(new Event("input",{bubbles:!0}))},[P,Oe]),kt=d.useCallback(()=>{D(!0),Bt();const O=Ie.current,H=R.current;if(!O)return;const ie=(H==null?void 0:H.value)??"",N=rc(ie,{required:b,min:a,max:l,step:c});O.setCustomValidity(N.valid?"":N.message??"")},[Bt,b,a,l,c]);d.useEffect(()=>{const O=ge.current,H=O==null?void 0:O.closest("form");if(!H)return;const ie=A=>{const be=A;if(!be||!H.contains(be))return!1;const we=be.closest('button, input[type="submit"], input[type="image"]');return!we||!H.contains(we)?!1:we instanceof HTMLButtonElement?we.type!=="button"&&we.type!=="reset":we instanceof HTMLInputElement},N=A=>{ie(A.target)&&kt()};return H.addEventListener("pointerdown",N,!0),()=>H.removeEventListener("pointerdown",N,!0)},[kt]),d.useEffect(()=>{R.current&&(R.current.value=P)},[P]);const ut=d.useCallback(()=>{Ae(!1),Bt()},[Bt]);d.useLayoutEffect(()=>{var be;if(!Me)return;const O=se.current;if(!O)return;O.querySelectorAll(".pkt-timepicker-popup__col").forEach(we=>{const at=we.querySelector(".pkt-timepicker-popup__option--selected");at&&at.scrollIntoView({block:"center"})});const ie=O.querySelectorAll(".pkt-timepicker-popup__col")[0];if(!ie)return;const N=ie.querySelector(".pkt-timepicker-popup__option--selected"),A=ie.querySelector(".pkt-timepicker-popup__option");(be=N||A)==null||be.focus()},[Me]),d.useEffect(()=>{if(!Me)return;const O=H=>{const ie=H.target;ge.current&&!ge.current.contains(ie)&&ut()};return document.addEventListener("click",O,!0),()=>document.removeEventListener("click",O,!0)},[Me,ut]);const Et=d.useCallback(O=>{var we;const H=se.current;if(!H)return;const ie=H.querySelectorAll(".pkt-timepicker-popup__col"),N=O==="hour"?ie[0]:ie[1];if(!N)return;const A=N.querySelector(".pkt-timepicker-popup__option--selected"),be=N.querySelector(".pkt-timepicker-popup__option");(we=A||be)==null||we.focus()},[]),bs=d.useCallback((O,H)=>{const ie=String(O).padStart(2,"0");if(H==="hour")oe(ie),requestAnimationFrame(()=>Et("minute"));else{ue(ie),Ae(!1);const N=xe.current;N!==""&&Oe(`${N}:${ie}`),requestAnimationFrame(()=>{var A;return(A=q.current)==null?void 0:A.focus()})}},[Oe,Et,oe,ue]),rt=d.useCallback(O=>{const H=zb(xe.current,ve.current,O,K);oe(H.hours),ue(H.minutes),`${H.hours}:${H.minutes}`!==P&&Oe(`${H.hours}:${H.minutes}`)},[K,P,Oe,oe,ue]),dn=d.useCallback(O=>{var N,A,be,we,at,Fe,lt;(N=Ie.current)==null||N.setCustomValidity("");const H=O.currentTarget,ie=ve.current;switch(O.key){case"ArrowUp":{O.preventDefault();const Ee=xe.current!==""?parseInt(xe.current,10):0,ss=String((Ee+1)%24).padStart(2,"0");if(oe(ss),ie!==""){const _=`${ss}:${ie}`;_!==P?Oe(_):(A=R.current)==null||A.dispatchEvent(new Event("input",{bubbles:!0}))}break}case"ArrowDown":{O.preventDefault();const Ee=xe.current!==""?parseInt(xe.current,10):0,ss=String((Ee-1+24)%24).padStart(2,"0");if(oe(ss),ie!==""){const _=`${ss}:${ie}`;_!==P?Oe(_):(be=R.current)==null||be.dispatchEvent(new Event("input",{bubbles:!0}))}break}case"ArrowRight":O.preventDefault(),(we=j.current)==null||we.focus();break;case"Backspace":case"Delete":{O.preventDefault(),ze.current=0,He.current=-1;const Ee=xe.current;Ee.length>0&&oe(Ee.slice(0,-1)),Ze();break}case"Tab":break;case"Enter":{O.preventDefault(),kt();const Ee=H.form;Ee?Ee.requestSubmit():H.blur();break}default:if(/^\d$/.test(O.key)){O.preventDefault();const Ee=parseInt(O.key,10);if(ze.current===0){He.current=Ee;const ss=String(Ee).padStart(2,"0");oe(ss),ze.current=1,(at=R.current)==null||at.dispatchEvent(new Event("input",{bubbles:!0})),Ee>=3&&(He.current=-1,ze.current=0,Ze(),(Fe=j.current)==null||Fe.focus())}else{const ss=He.current*10+Ee,_=ss<=23?String(ss).padStart(2,"0"):String(Ee).padStart(2,"0");oe(_),He.current=-1,ze.current=0,Ze(),(lt=j.current)==null||lt.focus()}}else O.preventDefault()}},[P,Oe,oe,Ze,kt]),Cs=d.useCallback(()=>{if(D(!0),xe.current!==""){const O=String(parseInt(xe.current,10)).padStart(2,"0");oe(O)}ze.current=0,He.current=-1,Bt()},[oe,Bt]),hn=d.useCallback(O=>{var N,A,be,we,at;(N=Ie.current)==null||N.setCustomValidity("");const H=O.currentTarget,ie=xe.current;switch(O.key){case"ArrowUp":{O.preventDefault();const Fe=ve.current!==""?parseInt(ve.current,10):0,lt=String((Fe+K)%60).padStart(2,"0");if(ue(lt),ie!==""){const Ee=`${ie}:${lt}`;Ee!==P?Oe(Ee):(A=R.current)==null||A.dispatchEvent(new Event("input",{bubbles:!0}))}break}case"ArrowDown":{O.preventDefault();const Fe=ve.current!==""?parseInt(ve.current,10):0,lt=String((Fe-K+60)%60).padStart(2,"0");if(ue(lt),ie!==""){const Ee=`${ie}:${lt}`;Ee!==P?Oe(Ee):(be=R.current)==null||be.dispatchEvent(new Event("input",{bubbles:!0}))}break}case"ArrowLeft":O.preventDefault(),(we=Ie.current)==null||we.focus();break;case"Backspace":case"Delete":{O.preventDefault(),k.current=0,p.current=-1;const Fe=ve.current;Fe.length>0&&ue(Fe.slice(0,-1)),Ze();break}case"Tab":break;case"Enter":{O.preventDefault(),kt();const Fe=H.form;Fe?Fe.requestSubmit():H.blur();break}default:if(/^\d$/.test(O.key)){O.preventDefault();const Fe=parseInt(O.key,10);if(k.current===0){p.current=Fe;const lt=String(Fe).padStart(2,"0");ue(lt),k.current=1,(at=R.current)==null||at.dispatchEvent(new Event("input",{bubbles:!0})),Fe>=6&&(p.current=-1,k.current=0,Ze())}else{const lt=p.current*10+Fe,Ee=lt<=59?String(lt).padStart(2,"0"):String(Fe).padStart(2,"0");ue(Ee),p.current=-1,k.current=0,Ze()}}else O.preventDefault()}},[K,P,Oe,ue,Ze,kt]),Vt=d.useCallback(()=>{if(D(!0),ve.current!==""){const O=String(parseInt(ve.current,10)).padStart(2,"0");ue(O)}k.current=0,p.current=-1,Bt()},[ue,Bt]),Pt=d.useCallback(O=>{var we;const H=document.activeElement,ie=H.closest(".pkt-timepicker-popup__col");if(!ie)return;const N=Array.from(ie.querySelectorAll(".pkt-timepicker-popup__option")),A=N.indexOf(H),be=at=>{if(!at)return;const Fe=parseInt(at.dataset.value??"0",10),lt=String(Fe).padStart(2,"0");H.dataset.type==="hour"?oe(lt):ue(lt),at.focus()};switch(O.key){case"ArrowDown":O.preventDefault(),be(N[Math.min(A+1,N.length-1)]);break;case"ArrowUp":O.preventDefault(),be(N[Math.max(A-1,0)]);break;case"Home":O.preventDefault(),be(N[0]);break;case"End":O.preventDefault(),be(N[N.length-1]);break;case"ArrowRight":if(O.preventDefault(),H.dataset.type==="hour"){const at=parseInt(H.dataset.value??"0",10);oe(String(at).padStart(2,"0")),requestAnimationFrame(()=>{var Fe;(Fe=se.current)==null||Fe.querySelectorAll(".pkt-timepicker-popup__col").forEach(lt=>{const Ee=lt.querySelector(".pkt-timepicker-popup__option--selected");Ee==null||Ee.scrollIntoView({block:"center"})}),Et("minute")})}break;case"ArrowLeft":if(O.preventDefault(),H.dataset.type==="minute"){const at=parseInt(H.dataset.value??"0",10);ue(String(at).padStart(2,"0")),requestAnimationFrame(()=>{var Fe;(Fe=se.current)==null||Fe.querySelectorAll(".pkt-timepicker-popup__col").forEach(lt=>{const Ee=lt.querySelector(".pkt-timepicker-popup__option--selected");Ee==null||Ee.scrollIntoView({block:"center"})}),Et("hour")})}break;case"Enter":case" ":O.preventDefault(),H.click();break;case"Escape":O.preventDefault(),ut(),(we=q.current)==null||we.focus();break}},[ut,Et,oe,ue]),qs=d.useCallback(O=>{const H=se.current;if(!H)return;const ie=O.relatedTarget;(!ie||!H.contains(ie))&&ut()},[ut]),Ln=d.useCallback(O=>{const H=ge.current;if(!H)return;const ie=O.relatedTarget;ie&&H.contains(ie)||ne==null||ne(O)},[ne]),xi=d.useCallback(O=>{const H=ge.current;if(!H)return;const ie=O.relatedTarget;ie&&H.contains(ie)||me==null||me(O)},[me]),ts=d.useCallback(()=>{v||(Me?ut():Ae(!0))},[v,Me,ut]);d.useImperativeHandle(e,()=>({get value(){var O;return((O=R.current)==null?void 0:O.value)??""},set value(O){const H=O??"";fe||J(H);const[ie,N]=$i(H);oe(ie),ue(N),R.current&&(R.current.value=H)},focus(){var O;(O=Ie.current)==null||O.focus()},blur(){var O;(O=Ie.current)==null||O.blur()}}),[fe,oe,ue]),d.useEffect(()=>{const O=ge.current,H=O==null?void 0:O.closest("form");if(!H)return;const ie=()=>{window.setTimeout(()=>{const N=de.current,[A,be]=$i(N);oe(A),ue(be),fe||J(N),R.current&&(R.current.value=N),Ae(!1),D(!1)},0)};return H.addEventListener("reset",ie),()=>H.removeEventListener("reset",ie)},[fe,oe,ue]);const Si=["pkt-timepicker",m?"pkt-timepicker--fullwidth":"",g?"pkt-timepicker--stepper":"",ee??""].filter(Boolean).join(" ");return{id:t,containerRef:ge,outerClasses:Si,strings:ke,label:n,disabled:v,required:b,helptext:w,helptextDropdown:C,helptextDropdownButton:S,hasError:T,isInvalid:Te,errorMessage:F,optionalTag:E,optionalText:W,requiredTag:U,requiredText:Q,tagText:$e,inline:z,useWrapper:M,ariaDescribedby:G,hidePicker:h,stepArrows:g,min:a,max:l,step:c,hours:Le,minutes:ae,hoursId:it,minutesId:Ge,popupId:zt,hiddenInputId:Kt,name:f??t,isOpen:Me,hourOptions:ye,minuteOptions:ot,hoursInputRef:Ie,minutesInputRef:j,buttonRef:q,popupRef:se,changeInputRef:R,handleHoursKeydown:dn,handleHoursBlur:Cs,handleMinutesKeydown:hn,handleMinutesBlur:Vt,handlePopupKeydown:Pt,handlePopupFocusOut:qs,handleFocusIn:Ln,handleFocusOut:xi,handleOptionClick:bs,handleClockButtonClick:ts,closePopup:ut,stepTimeDelta:rt,effectiveValue:P}}const ac=d.forwardRef((s,e)=>{const{onChange:t,onInput:n}=s,i=Yb(s,e),r=i.strings.hours,a=i.strings.minutes,l=i.label?`${r}, ${i.label}`:r,c=i.label?`${a}, ${i.label}`:a,h=(f,v)=>{const b=String(f).padStart(2,"0"),w=v==="hour"?i.hours!==""?parseInt(i.hours,10):NaN:i.minutes!==""?parseInt(i.minutes,10):NaN,C=f===w;return o.jsx("button",{type:"button",className:["pkt-btn","pkt-btn--tertiary","pkt-btn--small","pkt-btn--label-only","pkt-timepicker-popup__option",C?"pkt-timepicker-popup__option--selected":""].filter(Boolean).join(" "),role:"option","aria-selected":C?"true":"false",tabIndex:C?0:-1,"data-type":v,"data-value":f,onClick:S=>{S.stopPropagation(),i.handleOptionClick(f,v)},children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:b})},`${v}-${f}`)},g=()=>o.jsxs("div",{ref:i.popupRef,className:"pkt-timepicker-popup",id:i.popupId,hidden:!i.isOpen,role:"group","aria-label":i.strings.selectTime,onKeyDown:i.handlePopupKeydown,onBlur:i.handlePopupFocusOut,children:[o.jsx("div",{className:"pkt-timepicker-popup__col",role:"listbox","aria-label":r,"aria-orientation":"vertical",children:i.hourOptions.map(f=>h(f,"hour"))}),o.jsx("div",{className:"pkt-timepicker-popup__col",role:"listbox","aria-label":a,"aria-orientation":"vertical",children:i.minuteOptions.map(f=>h(f,"minute"))})]}),m=()=>o.jsxs("div",{className:"pkt-input__container",onClick:f=>{var b;f.target.closest("button, input")||(b=i.hoursInputRef.current)==null||b.focus()},children:[i.stepArrows&&o.jsxs("button",{type:"button",className:"pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--prev","aria-label":i.strings.prevTime,disabled:i.disabled,onClick:()=>i.stepTimeDelta(-1),children:[o.jsx(te,{name:"chevron-thin-left"}),o.jsx("span",{className:"pkt-btn__text",children:i.strings.prevTime})]}),o.jsx("input",{ref:i.hoursInputRef,type:"text",inputMode:"numeric",maxLength:2,size:2,className:"pkt-input pkt-timepicker__input",id:i.hoursId,"data-min":"0","data-max":"23",value:i.hours,placeholder:"––","aria-label":l,role:"spinbutton","aria-invalid":i.hasError||i.isInvalid||void 0,"aria-valuemin":0,"aria-valuemax":23,"aria-valuenow":i.hours!==""?parseInt(i.hours,10):void 0,"aria-valuetext":i.hours!==""?`${i.hours} ${r.toLowerCase()}`:void 0,autoComplete:"off",disabled:i.disabled,onKeyDown:i.handleHoursKeydown,onBlur:i.handleHoursBlur,onFocus:f=>{f.currentTarget.select()},onChange:()=>{},onPaste:f=>f.preventDefault()}),o.jsx("span",{className:"pkt-timepicker__separator",children:":"}),o.jsx("input",{ref:i.minutesInputRef,type:"text",inputMode:"numeric",maxLength:2,size:2,className:"pkt-input pkt-timepicker__input",id:i.minutesId,"data-min":"0","data-max":"59",value:i.minutes,placeholder:"––","aria-label":c,role:"spinbutton","aria-invalid":i.hasError||i.isInvalid||void 0,"aria-valuemin":0,"aria-valuemax":59,"aria-valuenow":i.minutes!==""?parseInt(i.minutes,10):void 0,"aria-valuetext":i.minutes!==""?`${i.minutes} ${a.toLowerCase()}`:void 0,autoComplete:"off",disabled:i.disabled,onKeyDown:i.handleMinutesKeydown,onBlur:i.handleMinutesBlur,onFocus:f=>{f.currentTarget.select()},onChange:()=>{},onPaste:f=>f.preventDefault()}),i.hidePicker&&!i.stepArrows&&o.jsx(te,{className:"pkt-input-icon pkt-timepicker__icon",name:"clock","aria-hidden":!0}),!i.hidePicker&&!i.stepArrows&&o.jsxs("button",{ref:i.buttonRef,type:"button",className:"pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button","aria-label":i.strings.openPicker,"aria-haspopup":"listbox","aria-expanded":i.isOpen,"aria-controls":i.popupId,disabled:i.disabled,onClick:i.handleClockButtonClick,children:[o.jsx(te,{name:"clock"}),o.jsx("span",{className:"pkt-btn__text",children:i.strings.openPicker})]}),i.stepArrows&&o.jsxs("button",{type:"button",className:"pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--next","aria-label":i.strings.nextTime,disabled:i.disabled,onClick:()=>i.stepTimeDelta(1),children:[o.jsx(te,{name:"chevron-thin-right"}),o.jsx("span",{className:"pkt-btn__text",children:i.strings.nextTime})]}),o.jsx("input",{ref:i.changeInputRef,type:"time",hidden:!0,name:i.name,id:i.hiddenInputId,disabled:i.disabled,tabIndex:-1,"aria-hidden":!0,onChange:t,onInput:n})]});return o.jsx("div",{ref:i.containerRef,className:i.outerClasses,onFocus:i.handleFocusIn,onBlur:i.handleFocusOut,children:o.jsx(xs,{forId:i.hoursId,label:i.label,disabled:i.disabled,hasError:i.hasError,inline:i.inline,optionalTag:i.optionalTag,optionalText:i.optionalText,requiredTag:i.requiredTag,requiredText:i.requiredText,useWrapper:i.useWrapper,ariaDescribedby:i.ariaDescribedby,errorMessage:i.errorMessage,helptext:i.helptext,helptextDropdown:i.helptextDropdown,helptextDropdownButton:i.helptextDropdownButton,tagText:i.tagText,children:!i.hidePicker&&!i.stepArrows?o.jsxs("div",{className:"pkt-timepicker__anchor",children:[m(),g()]}):m()})})});ac.displayName="PktTimepicker";var An=window.CustomEvent;(!An||typeof An=="object")&&(An=function(s,e){e=e||{};var t=document.createEvent("CustomEvent");return t.initCustomEvent(s,!!e.bubbles,!!e.cancelable,e.detail||null),t},An.prototype=window.Event.prototype);function oc(s,e){var t="on"+e.type.toLowerCase();return typeof s[t]=="function"&&s[t](e),s.dispatchEvent(e)}function Gb(s){for(;s&&s!==document.body;){var e=window.getComputedStyle(s),t=function(n,i){return!(e[n]===void 0||e[n]===i)};if(e.opacity<1||t("zIndex","auto")||t("transform","none")||t("mixBlendMode","normal")||t("filter","none")||t("perspective","none")||e.isolation==="isolate"||e.position==="fixed"||e.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function wi(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function lc(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Xb(s,e){for(var t=0;t<s.length;++t)if(s[t]===e)return!0;return!1}function ma(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function cc(s){var e=["button","input","keygen","select","textarea"],t=e.map(function(a){return a+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');var n=s.querySelector(t.join(", "));if(!n&&"attachShadow"in Element.prototype)for(var i=s.querySelectorAll("*"),r=0;r<i.length&&!(i[r].tagName&&i[r].shadowRoot&&(n=cc(i[r].shadowRoot),n));r++);return n}function uc(s){return s.isConnected||document.body.contains(s)}function dc(s){if(s.submitter)return s.submitter;var e=s.target;if(!(e instanceof HTMLFormElement))return null;var t=Pe.formSubmitter;if(!t){var n=s.target,i="getRootNode"in n&&n.getRootNode()||document;t=i.activeElement}return!t||t.form!==e?null:t}function Qb(s){if(!s.defaultPrevented){var e=s.target,t=Pe.imagemapUseValue,n=dc(s);t===null&&n&&(t=n.value);var i=wi(e);if(i){var r=n&&n.getAttribute("formmethod")||e.getAttribute("method");r==="dialog"&&(s.preventDefault(),t!=null?i.close(t):i.close())}}}function hc(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",Qb,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var e=new MutationObserver(this.maybeHideModal.bind(this));e.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var t=!1,n=(function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}).bind(this),i,r=function(a){if(a.target===s){var l="DOMNodeRemoved";t|=a.type.substr(0,l.length)===l,window.clearTimeout(i),i=window.setTimeout(n,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(a){s.addEventListener(a,r)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}hc.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&uc(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),Pe.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var e=document.createElement("div");this.dialog_.insertBefore(e,this.dialog_.firstChild),e.tabIndex=-1,e.focus(),this.dialog_.removeChild(e)}var t=document.createEvent("MouseEvents");t.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(t),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=cc(this.dialog_)),lc(document.activeElement),s&&s.focus()},updateZIndex:function(s,e){if(s<e)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=e},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!uc(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!Pe.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Gb(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,Pe.needsCentering(this.dialog_)?(Pe.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var e=new An("close",{bubbles:!1,cancelable:!1});oc(this.dialog_,e)}};var Pe={};if(Pe.reposition=function(s){var e=document.body.scrollTop||document.documentElement.scrollTop,t=e+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(e,t)+"px"},Pe.isInlinePositionSetByStylesheet=function(s){for(var e=0;e<document.styleSheets.length;++e){var t=document.styleSheets[e],n=null;try{n=t.cssRules}catch{}if(n)for(var i=0;i<n.length;++i){var r=n[i],a=null;try{a=document.querySelectorAll(r.selectorText)}catch{}if(!(!a||!Xb(a,s))){var l=r.style.getPropertyValue("top"),c=r.style.getPropertyValue("bottom");if(l&&l!=="auto"||c&&c!=="auto")return!0}}}return!1},Pe.needsCentering=function(s){var e=window.getComputedStyle(s);return e.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!Pe.isInlinePositionSetByStylesheet(s)},Pe.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new hc(s)},Pe.registerDialog=function(s){s.showModal||Pe.forceRegisterDialog(s)},Pe.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(e){this.forwardTab_=void 0,e.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(e){var t=[];e.forEach(function(n){for(var i=0,r;r=n.removedNodes[i];++i){if(r instanceof Element)r.localName==="dialog"&&t.push(r);else continue;t=t.concat(r.querySelectorAll("dialog"))}}),t.length&&s(t)}))},Pe.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},Pe.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},Pe.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,e=0,t;t=this.pendingDialogStack[e];++e)t.updateZIndex(--s,--s),e===0&&(this.overlay.style.zIndex=--s);var n=this.pendingDialogStack[0];if(n){var i=n.dialog.parentNode||document.body;i.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},Pe.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=wi(s);){for(var e=0,t;t=this.pendingDialogStack[e];++e)if(t.dialog===s)return e===0;s=s.parentElement}return!1},Pe.DialogManager.prototype.handleFocus_=function(s){var e=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(e)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),lc(e),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],n=t.dialog,i=n.compareDocumentPosition(e);return i&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e!==document.documentElement&&document.documentElement.focus()),!1}},Pe.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var e=new An("cancel",{bubbles:!1,cancelable:!0}),t=this.pendingDialogStack[0];t&&oc(t.dialog,e)&&t.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},Pe.DialogManager.prototype.checkDOM_=function(s){var e=this.pendingDialogStack.slice();e.forEach(function(t){s.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},Pe.DialogManager.prototype.pushDialog=function(s){var e=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=e?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},Pe.DialogManager.prototype.removeDialog=function(s){var e=this.pendingDialogStack.indexOf(s);e!==-1&&(this.pendingDialogStack.splice(e,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},Pe.dm=new Pe.DialogManager,Pe.formSubmitter=null,Pe.imagemapUseValue=null,window.HTMLDialogElement===void 0){var pc=document.createElement("form");if(pc.setAttribute("method","dialog"),pc.method!=="dialog"){var In=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(In){var Zb=In.get;In.get=function(){return ma(this)?"dialog":Zb.call(this)};var Jb=In.set;In.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Jb.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",In)}}document.addEventListener("click",function(s){if(Pe.formSubmitter=null,Pe.imagemapUseValue=null,!s.defaultPrevented){var e=s.target;if("composedPath"in s){var t=s.composedPath();e=t.shift()||e}if(!(!e||!ma(e.form))){var n=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!n){if(!(e.localName==="input"&&e.type==="image"))return;Pe.imagemapUseValue=s.offsetX+","+s.offsetY}var i=wi(e);i&&(Pe.formSubmitter=e)}}},!1),document.addEventListener("submit",function(s){var e=s.target,t=wi(e);if(!t){var n=dc(s),i=n&&n.getAttribute("formmethod")||e.getAttribute("method");i==="dialog"&&s.preventDefault()}});var Rb=HTMLFormElement.prototype.submit,ev=function(){if(!ma(this))return Rb.call(this);var s=wi(this);s&&s.close()};HTMLFormElement.prototype.submit=ev}const tv=Object.freeze(Object.defineProperty({__proto__:null,default:Pe},Symbol.toStringTag,{value:"Module"}));X.FileItem=Ll,X.ItemRenderers=ua,X.PktAccordion=va,X.PktAccordionItem=Qo,X.PktAlert=Zi,X.PktBackLink=Jo,X.PktBreadcrumbs=Ro,X.PktButton=wt,X.PktCalendar=na,X.PktCard=xl,X.PktCheckbox=Sl,X.PktCombobox=Ol,X.PktConsent=ir,X.PktDatepicker=Al,X.PktFileUpload=Ul,X.PktFooter=_b,X.PktFooterSimple=$b,X.PktHeader=jl,X.PktHeaderService=da,X.PktHeading=Wl,X.PktHelptext=zl,X.PktIcon=te,X.PktInput=Kl,X.PktInputWrapper=xs,X.PktLink=or,X.PktLinkCard=Yl,X.PktLoader=Gl,X.PktMessagebox=Xl,X.PktModal=oa,X.PktProgressbar=ur,X.PktRadioButton=Zl,X.PktSearchInput=Jl,X.PktSelect=Rl,X.PktStep=Ab,X.PktStepper=ec,X.PktTabItem=ha,X.PktTable=Ib,X.PktTableBody=Lb,X.PktTableDataCell=Fb,X.PktTableHeader=Bb,X.PktTableHeaderCell=Vb,X.PktTableRow=Hb,X.PktTabs=sc,X.PktTag=Us,X.PktTextarea=aa,X.PktTextinput=cr,X.PktTimepicker=ac,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
1936
+ */var Go;function Bp(){return Go||(Go=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(r=i(r,n(l)))}return r}function n(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var l in r)e.call(r,l)&&r[l]&&(a=i(a,l));return a}function i(r,a){return a?r?r+" "+a:r+a:r}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(Kr)),Kr.exports}var Vp=Bp();const pe=Fp(Vp),Gi=({children:s,closeAlert:e,compact:t,title:n,date:i,ariaLive:r,"aria-live":a="polite",role:l="status",skin:c="info",className:h,...g})=>{const[m,f]=d.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":t,[`pkt-alert--${c}`]:c,"pkt-hide":m},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!n,"pkt-alert__noDate":!i},$=d.useCallback(()=>{f(!0),g.onClose&&g.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[g.onClose,f]),C=r||a;return o.jsx("div",{...g,"aria-live":C,role:l,className:pe(k,h),children:o.jsxs("div",{className:pe(b),children:[o.jsx(te,{className:"pkt-alert__icon","aria-hidden":"true",name:c==="info"?"alert-information":`alert-${c}`}),e&&o.jsx("div",{className:"pkt-alert__close",children:o.jsx(_t,{tabIndex:0,"aria-label":"close",size:t?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:$,children:o.jsx("span",{className:"sr-only",children:"Lukk"})})}),n&&o.jsx("div",{className:"pkt-alert__title",children:n}),o.jsx("div",{className:"pkt-alert__text",children:s}),i&&o.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",i]})]})})};Gi.displayName="PktAlert";const Xo=d.forwardRef(({href:s="/",text:e="Forsiden",ariaLabel:t,renderLink:n,...i},r)=>{const a=o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left","aria-hidden":"true"}),o.jsx("span",{className:"pkt-back-link__text",children:e})]}),l=n||(({href:c,className:h,children:g,props:m})=>o.jsx("a",{href:c,className:h,...m,children:g}));return o.jsx("nav",{className:"pkt-back-link","aria-label":t||"Gå tilbake til forrige side",ref:r,children:l({href:s,className:"pkt-link pkt-link--icon-left",children:a,props:i})})});Xo.displayName="PktBackLink";const Qo=d.forwardRef(({breadcrumbs:s,navigationType:e,renderLink:t,className:n,...i},r)=>{const a=s,l=a[a.length-2],c=[n,"pkt-breadcrumbs"].filter(Boolean).join(" "),h=t||(e==="router"?({href:g,className:m,children:f,props:k})=>o.jsx(gc.Link,{to:g,className:m,...k,children:f}):({href:g,className:m,children:f,props:k})=>o.jsx("a",{href:g,className:m,...k,children:f}));return o.jsxs("nav",{ref:r,"aria-label":"brødsmulemeny",className:c,children:[o.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((g,m)=>o.jsx("li",{className:"pkt-breadcrumbs__item",children:m===a.length-1?o.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:o.jsx("span",{className:"pkt-breadcrumbs__text",children:g.text})}):h({href:g.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:g.text})]}),props:i})},`breadcrumb-${m}`))}),h({href:l.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:l.text})]}),props:i})]})});Qo.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/16.7/animations/";const _t=d.forwardRef(({children:s,className:e,iconName:t="user",secondIconName:n="user",iconPath:i,secondIconPath:r,size:a="medium",fullWidth:l=!1,fullWidthOnMobile:c=!1,skin:h="primary",type:g="button",variant:m="label-only",state:f,color:k,isLoading:b=void 0,disabled:$=void 0,loadingAnimationPath:C=window.pktAnimationPath,...S},T)=>{const F=[e,"pkt-btn",a&&`pkt-btn--${a}`,l&&"pkt-btn--full",c&&"pkt-btn--full-small",h&&`pkt-btn--${h}`,m&&`pkt-btn--${m}`,k&&`pkt-btn--${k}`,f&&`pkt-btn--${f}`,b&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return o.jsxs("button",{...S,"aria-busy":b||void 0,"aria-disabled":$||void 0,disabled:$,className:F,type:g,ref:T,children:[b&&o.jsx(te,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:C}),m!=="label-only"&&o.jsx(te,{className:"pkt-btn__icon",name:t,...i&&{path:i}}),o.jsx("span",{className:"pkt-btn__text",children:s}),m==="icons-right-and-left"&&o.jsx(te,{className:"pkt-btn__icon",name:n,...r&&{path:r}})]})});_t.displayName="PktButton";const Zo=6048e5,Hp=864e5,Jo=Symbol.for("constructDateFrom");function us(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Jo in s?s[Jo](e):s instanceof Date?new s.constructor(e):new Date(e)}function Lt(s,e){return us(e||s,s)}function Ro(s,e,t){const n=Lt(s,t==null?void 0:t.in);return isNaN(e)?us(s,NaN):(e&&n.setDate(n.getDate()+e),n)}let Up={};function Xi(){return Up}function oi(s,e){var l,c,h,g;const t=Xi(),n=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??t.weekStartsOn??((g=(h=t.locale)==null?void 0:h.options)==null?void 0:g.weekStartsOn)??0,i=Lt(s,e==null?void 0:e.in),r=i.getDay(),a=(r<n?7:0)+r-n;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function Qi(s,e){return oi(s,{...e,weekStartsOn:1})}function el(s,e){const t=Lt(s,e==null?void 0:e.in),n=t.getFullYear(),i=us(t,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const r=Qi(i),a=us(t,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const l=Qi(a);return t.getTime()>=r.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}function tl(s){const e=Lt(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function sl(s,...e){const t=us.bind(null,e.find(n=>typeof n=="object"));return e.map(t)}function Yr(s,e){const t=Lt(s,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function qp(s,e,t){const[n,i]=sl(t==null?void 0:t.in,s,e),r=Yr(n),a=Yr(i),l=+r-tl(r),c=+a-tl(a);return Math.round((l-c)/Hp)}function Wp(s,e){const t=el(s,e),n=us(s,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Qi(n)}function jp(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function zp(s){return!(!jp(s)&&typeof s!="number"||isNaN(+Lt(s)))}function Kp(s,e){const t=Lt(s,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function Yp(s,e){const[t,n]=sl(s,e.start,e.end);return{start:t,end:n}}function nl(s,e){const{start:t,end:n}=Yp(e==null?void 0:e.in,s);let i=+t>+n;const r=i?+t:+n,a=i?n:t;a.setHours(0,0,0,0);let l=1;const c=[];for(;+a<=r;)c.push(us(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return i?c.reverse():c}function Gp(s,e){const t=Lt(s,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Xp={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Qp=(s,e,t)=>{let n;const i=Xp[s];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function Gr(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Zp={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jp={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rp={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ef={date:Gr({formats:Zp,defaultWidth:"full"}),time:Gr({formats:Jp,defaultWidth:"full"}),dateTime:Gr({formats:Rp,defaultWidth:"full"})},tf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sf=(s,e,t,n)=>tf[s];function li(s){return(e,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let i;if(n==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;i=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;i=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return i[r]}}const nf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},af={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},of={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},lf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},cf={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},uf={ordinalNumber:(s,e)=>{const t=Number(s),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:li({values:nf,defaultWidth:"wide"}),quarter:li({values:rf,defaultWidth:"wide",argumentCallback:s=>s-1}),month:li({values:af,defaultWidth:"wide"}),day:li({values:of,defaultWidth:"wide"}),dayPeriod:li({values:lf,defaultWidth:"wide",formattingValues:cf,defaultFormattingWidth:"wide"})};function ci(s){return(e,t={})=>{const n=t.width,i=n&&s.matchPatterns[n]||s.matchPatterns[s.defaultMatchWidth],r=e.match(i);if(!r)return null;const a=r[0],l=n&&s.parsePatterns[n]||s.parsePatterns[s.defaultParseWidth],c=Array.isArray(l)?hf(l,m=>m.test(a)):df(l,m=>m.test(a));let h;h=s.valueCallback?s.valueCallback(c):c,h=t.valueCallback?t.valueCallback(h):h;const g=e.slice(a.length);return{value:h,rest:g}}}function df(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function hf(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function pf(s){return(e,t={})=>{const n=e.match(s.matchPattern);if(!n)return null;const i=n[0],r=e.match(s.parsePattern);if(!r)return null;let a=s.valueCallback?s.valueCallback(r[0]):r[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(i.length);return{value:a,rest:l}}}const ff=/^(\d+)(th|st|nd|rd)?/i,mf=/\d+/i,gf={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bf={any:[/^b/i,/^(a|c)/i]},kf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vf={any:[/1/i,/2/i,/3/i,/4/i]},yf={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_f={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},wf={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},$f={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},xf={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Sf={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Cf={ordinalNumber:pf({matchPattern:ff,parsePattern:mf,valueCallback:s=>parseInt(s,10)}),era:ci({matchPatterns:gf,defaultMatchWidth:"wide",parsePatterns:bf,defaultParseWidth:"any"}),quarter:ci({matchPatterns:kf,defaultMatchWidth:"wide",parsePatterns:vf,defaultParseWidth:"any",valueCallback:s=>s+1}),month:ci({matchPatterns:yf,defaultMatchWidth:"wide",parsePatterns:_f,defaultParseWidth:"any"}),day:ci({matchPatterns:wf,defaultMatchWidth:"wide",parsePatterns:$f,defaultParseWidth:"any"}),dayPeriod:ci({matchPatterns:xf,defaultMatchWidth:"any",parsePatterns:Sf,defaultParseWidth:"any"})},Tf={code:"en-US",formatDistance:Qp,formatLong:ef,formatRelative:sf,localize:uf,match:Cf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Nf(s,e){const t=Lt(s,e==null?void 0:e.in);return qp(t,Gp(t))+1}function Df(s,e){const t=Lt(s,e==null?void 0:e.in),n=+Qi(t)-+Wp(t);return Math.round(n/Zo)+1}function il(s,e){var g,m,f,k;const t=Lt(s,e==null?void 0:e.in),n=t.getFullYear(),i=Xi(),r=(e==null?void 0:e.firstWeekContainsDate)??((m=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)??i.firstWeekContainsDate??((k=(f=i.locale)==null?void 0:f.options)==null?void 0:k.firstWeekContainsDate)??1,a=us((e==null?void 0:e.in)||s,0);a.setFullYear(n+1,0,r),a.setHours(0,0,0,0);const l=oi(a,e),c=us((e==null?void 0:e.in)||s,0);c.setFullYear(n,0,r),c.setHours(0,0,0,0);const h=oi(c,e);return+t>=+l?n+1:+t>=+h?n:n-1}function Mf(s,e){var l,c,h,g;const t=Xi(),n=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??t.firstWeekContainsDate??((g=(h=t.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,i=il(s,e),r=us((e==null?void 0:e.in)||s,0);return r.setFullYear(i,0,n),r.setHours(0,0,0,0),oi(r,e)}function rl(s,e){const t=Lt(s,e==null?void 0:e.in),n=+oi(t,e)-+Mf(t,e);return Math.round(n/Zo)+1}function qe(s,e){const t=s<0?"-":"",n=Math.abs(s).toString().padStart(e,"0");return t+n}const As={y(s,e){const t=s.getFullYear(),n=t>0?t:1-t;return qe(e==="yy"?n%100:n,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):qe(t+1,2)},d(s,e){return qe(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return qe(s.getHours()%12||12,e.length)},H(s,e){return qe(s.getHours(),e.length)},m(s,e){return qe(s.getMinutes(),e.length)},s(s,e){return qe(s.getSeconds(),e.length)},S(s,e){const t=e.length,n=s.getMilliseconds(),i=Math.trunc(n*Math.pow(10,t-3));return qe(i,e.length)}},$n={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},al={G:function(s,e,t){const n=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const n=s.getFullYear(),i=n>0?n:1-n;return t.ordinalNumber(i,{unit:"year"})}return As.y(s,e)},Y:function(s,e,t,n){const i=il(s,n),r=i>0?i:1-i;if(e==="YY"){const a=r%100;return qe(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):qe(r,e.length)},R:function(s,e){const t=el(s);return qe(t,e.length)},u:function(s,e){const t=s.getFullYear();return qe(t,e.length)},Q:function(s,e,t){const n=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return qe(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(s,e,t){const n=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return qe(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(s,e,t){const n=s.getMonth();switch(e){case"M":case"MM":return As.M(s,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(s,e,t){const n=s.getMonth();switch(e){case"L":return String(n+1);case"LL":return qe(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(s,e,t,n){const i=rl(s,n);return e==="wo"?t.ordinalNumber(i,{unit:"week"}):qe(i,e.length)},I:function(s,e,t){const n=Df(s);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):qe(n,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):As.d(s,e)},D:function(s,e,t){const n=Nf(s);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):qe(n,e.length)},E:function(s,e,t){const n=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(s,e,t,n){const i=s.getDay(),r=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return qe(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});case"eee":return t.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(i,{width:"short",context:"formatting"});case"eeee":default:return t.day(i,{width:"wide",context:"formatting"})}},c:function(s,e,t,n){const i=s.getDay(),r=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return qe(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(i,{width:"narrow",context:"standalone"});case"cccccc":return t.day(i,{width:"short",context:"standalone"});case"cccc":default:return t.day(i,{width:"wide",context:"standalone"})}},i:function(s,e,t){const n=s.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return qe(i,e.length);case"io":return t.ordinalNumber(i,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(s,e,t){const i=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,e,t){const n=s.getHours();let i;switch(n===12?i=$n.noon:n===0?i=$n.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(s,e,t){const n=s.getHours();let i;switch(n>=17?i=$n.evening:n>=12?i=$n.afternoon:n>=4?i=$n.morning:i=$n.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let n=s.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return As.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):As.H(s,e)},K:function(s,e,t){const n=s.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):qe(n,e.length)},k:function(s,e,t){let n=s.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):qe(n,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):As.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):As.s(s,e)},S:function(s,e){return As.S(s,e)},X:function(s,e,t){const n=s.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return ll(n);case"XXXX":case"XX":return Js(n);case"XXXXX":case"XXX":default:return Js(n,":")}},x:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"x":return ll(n);case"xxxx":case"xx":return Js(n);case"xxxxx":case"xxx":default:return Js(n,":")}},O:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ol(n,":");case"OOOO":default:return"GMT"+Js(n,":")}},z:function(s,e,t){const n=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ol(n,":");case"zzzz":default:return"GMT"+Js(n,":")}},t:function(s,e,t){const n=Math.trunc(+s/1e3);return qe(n,e.length)},T:function(s,e,t){return qe(+s,e.length)}};function ol(s,e=""){const t=s>0?"-":"+",n=Math.abs(s),i=Math.trunc(n/60),r=n%60;return r===0?t+String(i):t+String(i)+e+qe(r,2)}function ll(s,e){return s%60===0?(s>0?"-":"+")+qe(Math.abs(s)/60,2):Js(s,e)}function Js(s,e=""){const t=s>0?"-":"+",n=Math.abs(s),i=qe(Math.trunc(n/60),2),r=qe(n%60,2);return t+i+e+r}const cl=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ul=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ef={p:ul,P:(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],n=t[1],i=t[2];if(!i)return cl(s,e);let r;switch(n){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",cl(n,e)).replace("{{time}}",ul(i,e))}},Of=/^D+$/,Af=/^Y+$/,If=["D","DD","YY","YYYY"];function Pf(s){return Of.test(s)}function Lf(s){return Af.test(s)}function Ff(s,e,t){const n=Bf(s,e,t);if(console.warn(n),If.includes(s))throw new RangeError(n)}function Bf(s,e,t){const n=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vf=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Hf=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Uf=/^'([^]*?)'?$/,qf=/''/g,Wf=/[a-zA-Z]/;function jf(s,e,t){var g,m,f,k;const n=Xi(),i=n.locale??Tf,r=n.firstWeekContainsDate??((m=(g=n.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)??1,a=n.weekStartsOn??((k=(f=n.locale)==null?void 0:f.options)==null?void 0:k.weekStartsOn)??0,l=Lt(s,t==null?void 0:t.in);if(!zp(l))throw new RangeError("Invalid time value");let c=e.match(Hf).map(b=>{const $=b[0];if($==="p"||$==="P"){const C=Ef[$];return C(b,i.formatLong)}return b}).join("").match(Vf).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const $=b[0];if($==="'")return{isToken:!1,value:zf(b)};if(al[$])return{isToken:!0,value:b};if($.match(Wf))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:b}});i.localize.preprocessor&&(c=i.localize.preprocessor(l,c));const h={firstWeekContainsDate:r,weekStartsOn:a,locale:i};return c.map(b=>{if(!b.isToken)return b.value;const $=b.value;(Lf($)||Pf($))&&Ff($,e,String(s));const C=al[$[0]];return C(l,$,i.localize,h)}).join("")}function zf(s){const e=s.match(Uf);return e?e[1].replace(qf,"'"):s}function Kf(s,e){const t=Lt(s,e==null?void 0:e.in).getDay();return t===0?7:t}function Yf(s,e,t="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:t}).format(e).split(/\s/g).slice(2).join(" ")}const Xr={},ui={};function Rs(s,e){try{const n=(Xr[s]||(Xr[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return n in ui?ui[n]:dl(n,n.split(":"))}catch{if(s in ui)return ui[s];const t=s==null?void 0:s.match(Gf);return t?dl(s,t.slice(1)):NaN}}const Gf=/([+-]\d\d):?(\d\d)?/;function dl(s,e){const t=+(e[0]||0),n=+(e[1]||0),i=+(e[2]||0)/60;return ui[s]=t*60+n>0?t*60+n+i:t*60-n-i}class ds extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Rs(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),pl(this),Qr(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new ds(...t,e):new ds(Date.now(),e)}withTimeZone(e){return new ds(+this,e)}getTimezoneOffset(){const e=-Rs(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Qr(this),+this}[Symbol.for("constructDateFrom")](e){return new ds(+new Date(e),this.timeZone)}}const hl=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!hl.test(s))return;const e=s.replace(hl,"$1UTC");ds.prototype[e]&&(s.startsWith("get")?ds.prototype[s]=function(){return this.internal[e]()}:(ds.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Xf(this),+this},ds.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Qr(this),+this}))});function Qr(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Rs(s.timeZone,s)*60))}function Xf(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),pl(s)}function pl(s){const e=Rs(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),n=new Date(+s);n.setUTCHours(n.getUTCHours()-1);const i=-new Date(+s).getTimezoneOffset(),r=-new Date(+n).getTimezoneOffset(),a=i-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const c=i-t;c&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+c);const h=new Date(+s);h.setUTCSeconds(0);const g=i>0?h.getSeconds():(h.getSeconds()-60)%60,m=Math.round(-(Rs(s.timeZone,s)*60))%60;(m||g)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+m+g));const f=Rs(s.timeZone,s),k=f>0?Math.floor(f):Math.ceil(f),$=-new Date(+s).getTimezoneOffset()-k,C=k!==t,S=$-c;if(C&&S){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+S);const T=Rs(s.timeZone,s),F=T>0?Math.floor(T):Math.ceil(T),O=k-F;O&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+O),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+O))}}class Is extends ds{static tz(e,...t){return t.length?new Is(...t,e):new Is(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),i=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,i]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${n} ${t} ${i}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,i]=this.tzComponents();return`${e} GMT${t}${n}${i} (${Yf(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:(t==null?void 0:t.timeZone)||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),t=e>0?"-":"+",n=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),i=String(Math.abs(e)%60).padStart(2,"0");return[t,n,i]}withTimeZone(e){return new Is(+this,e)}[Symbol.for("constructDateFrom")](e){return new Is(+new Date(e),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Qf=(s=window.pktTz)=>{const e=new Is(new Date().toISOString(),s);return e.setHours(0,0,0,0),isNaN(e.getTime())?new Date:new Date(e.getFullYear(),e.getMonth(),e.getDate())};function hs(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,n]=s.split("-").map(Number);return new Date(e,t-1,n)}if(/^\d{4}-\d{2}$/.test(s)){const[e,t]=s.split("-").map(Number);return new Date(e,t-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const St=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),n=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${n}`},di=s=>{if(!s)return null;const e=hs(s);return isNaN(e.getTime())?null:e},Zf=(s,e)=>{const t=_s(s);return isNaN(t.getTime())?"":jf(t,e)},_s=(s="",e)=>{const t=typeof s=="string"?hs(s):s;return!t||isNaN(t.getTime())?new Date:e?e==="end"?Kp(t):Yr(t):t},xn=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const n=new Date(s,e,t);return isNaN(n.getTime())?new Date:n},hi=s=>{let e;return typeof s=="number"?e=new Is(s,window.pktTz):e=new Is(s,window.pktTz),e.setHours(12,0,0,0),e};let Zr=null,fl;const Jf=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Zr||fl!==e)&&(Zr=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),fl=e),Zr.format(s)},Rf=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const n=e?_s(e):null,i=t?_s(t):null;return!(n&&s<n||i&&s>i)},em=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=St(s);return e.includes(t)},tm=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},ml=(s,e,t,n,i)=>!(!s||isNaN(s.getTime())||!Rf(s,e,t)||n&&em(s,n)||i&&tm(s,i)),sm=(s,e,t,n,i)=>s.filter(r=>{const a=di(r);return a&&ml(a,e,t,n,i)}),nm=s=>s.slice().sort((e,t)=>{const n=di(e),i=di(t);return!n||!i?0:n.getTime()-i.getTime()}),im=(s,e)=>{const t=di(s),n=di(e);return!t||!n?!1:t<=n};function gl(s,e){const t=(e.excludedates??[]).map(n=>typeof n=="string"?n:St(n));return!ml(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function rm(s,e,t,n){return!!(gl(s,t)||!e&&n.multiple&&n.maxMultiple>0&&n.selectedCount>=n.maxMultiple)}function am(s,e,t){const n=xn(s,e,0);return!(t&&_s(t)>n)}function om(s,e,t){const n=xn(e===11?s+1:s,e===11?0:e+1,1);return!(t&&_s(t)<n)}function bl(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>hs(e))}function kl(s,e){const t=nl({start:s,end:e}),n={};if(Array.isArray(t)&&t.length)for(let i=0;i<t.length;i++){const r=t[i],a=r>s&&r<e;n[St(r)]=a}return n}function vl(s,e,t,n){if(e.length!==1)return!0;const i=nl({start:e[0],end:s});if(!Array.isArray(i)||!i.length)return!0;for(let r=0;r<i.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((n??[]).includes(Kf(i[r]).toString()))return!1}return!0}function Jr(s,e){const t=St(s);return e.includes(t)?e:[...e,t]}function Rr(s,e){const t=St(s),n=e.indexOf(t);if(n===-1)return e;if(e.length===1)return[];const i=[...e];return i.splice(n,1),i}function yl(s,e,t){const n=St(s);return e.includes(n)?Rr(s,e):t>0&&e.length>=t?e:Jr(s,e)}function lm(s,e,t){const n=St(s),i=bl(e);if(e.includes(n))return e.indexOf(n)===0?[]:Rr(s,e);if(e.length>1)return[n];if(e.length===1){if(!vl(s,i,t.excludedates,t.excludeweekdays))return[n];if(i[0]>s)return[n]}return Jr(s,e)}const pi=7,cm=6;function um(s,e){const t=xn(s,e,1),n=xn(s,e+1,0),i=(t.getDay()+cm)%pi,r=n.getDate(),a=Math.ceil((r+i)/pi),c=xn(s,e,0).getDate(),h=rl(t);return{firstDayOfMonth:t,lastDayOfMonth:n,startingDay:i,numDays:r,numRows:a,numDaysPrevMonth:c,initialWeek:h}}function dm(s,e,t,n){const{startingDay:i,numDays:r}=n;return s===0&&e<i?"prev-month":t>r?"next-month":"current-month"}function hm(s,e,t,n){const{startingDay:i,numDaysPrevMonth:r,numDays:a}=n;return s==="prev-month"?r-(i-e-1):s==="next-month"?t-a:t}const pm={ArrowLeft:-1,ArrowRight:1,ArrowUp:-pi,ArrowDown:pi};function fm(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function mm(s,e,t){let n=Ro(s,e);if(!n)return null;let i=t(`button[data-date="${St(n)}"]`);for(;i instanceof HTMLButtonElement&&i.dataset.disabled;)if(n=Ro(n,e),i=t(`button[data-date="${St(n)}"]`),!i)return null;return n}function gm(s){return pm[s]??null}const bm={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"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"};function km(s){const{selected:e,multiple:t=!1,maxMultiple:n=0,range:i=!1,earliest:r=null,latest:a=null,excludedates:l,excludeweekdays:c=[],weeknumbers:h=!1,withcontrols:g=!1,currentmonth:m,today:f,strings:k,onDateSelected:b,onClose:$,id:C,className:S}=s,T=d.useId(),F=C??T,O=d.useMemo(()=>({...bm,...k}),[k]),j=d.useMemo(()=>f?hs(f):Qf(),[f]),U=d.useMemo(()=>l?l.map(v=>typeof v=="string"?hs(v):v):[],[l]),Q=e!==void 0,[we,z]=d.useState([]),M=Q?e:we,G=d.useMemo(()=>bl(M),[M]),[V,ee]=d.useState(0),[le,ne]=d.useState(0),[me,ve]=d.useState({}),[fe,ce]=d.useState(null),[de,Xe]=d.useState(null),J=d.useRef(null),A=d.useRef([]),Le=d.useRef(0),Be=d.useRef(!1),ae=d.useRef(!1),Ke=d.useMemo(()=>({earliest:r,latest:a,excludedates:U,excludeweekdays:c}),[r,a,U,c]);d.useEffect(()=>{let v=null;if(m!=null&&(m instanceof Date?v=hi(m):typeof m=="string"&&(v=hs(m))),!v||isNaN(v.getTime()))if(M.length>0&&M[0]!==""){const p=hs(M[M.length-1]);v=isNaN(p.getTime())?hi(j):p}else v=hi(j);if((!v||isNaN(v.getTime()))&&(v=hi(j)),a){const p=typeof a=="string"?hs(a):a;!isNaN(p.getTime())&&v>p&&(v=p)}if(r){const p=typeof r=="string"?hs(r):r;!isNaN(p.getTime())&&v<p&&(v=p)}ee(v.getFullYear()),ne(v.getMonth()),ae.current=!0},[]),d.useEffect(()=>{if(ae.current&&!Be.current&&M.length>0&&M[0]!==""){const v=hs(M[M.length-1]);isNaN(v.getTime())||(ee(v.getFullYear()),ne(v.getMonth()))}},[M]),d.useEffect(()=>{i&&G.length===2?ve(kl(G[0],G[1])):(!i||G.length<2)&&ve({})},[i,G]);const xe=d.useCallback(v=>{Q||z(v),b==null||b(v)},[Q,b]),ke=d.useCallback(()=>{$==null||$()},[$]),oe=d.useCallback((v,p)=>{ee(typeof v=="string"?parseInt(v):v),ne(typeof p=="string"?parseInt(p):p),Le.current=0,Xe(null),A.current=[],Be.current=!0},[]),ue=d.useCallback(()=>{const v=le===0?11:le-1,p=le===0?V-1:V;oe(p,v)},[V,le,oe]),Me=d.useCallback(()=>{const v=le===11?0:le+1,p=le===11?V+1:V;oe(p,v)},[V,le,oe]),Ie=d.useCallback(v=>gl(v,Ke),[Ke]),Te=d.useCallback((v,p)=>rm(v,p,Ke,{multiple:t,maxMultiple:n,selectedCount:M.length}),[Ke,t,n,M.length]),P=d.useCallback(()=>typeof M=="string"?M.split(","):M,[M]),We=d.useCallback(v=>{if(!i||G.length!==1||!vl(v,G,U,c)||G[0]>=v){ce(null);return}ce(v),ve(kl(G[0],v))},[i,G,U,c]),Pe=d.useCallback(v=>{if(!v)return;let p;if(i)p=lm(v,P(),{excludedates:U,excludeweekdays:c}),Q||z(p),p.length===2?(b==null||b(p),ke()):(p.length===1&&ve({}),b==null||b(p));else if(t)p=yl(v,P(),n),xe(p);else{const w=St(v);M.includes(w)?p=[]:p=[w],xe(p),ke()}},[i,t,n,P,M,U,c,Q,xe,ke,b]),W=d.useCallback(v=>{const p=Jr(v,P());Q||z(p),i&&p.length===2&&(b==null||b(p),ke())},[P,Q,i,b,ke]),q=d.useCallback(v=>{const p=Rr(v,P());Q||z(p)},[P,Q]),se=d.useCallback(v=>{const p=yl(v,P(),n);Q||z(p)},[P,n,Q]),ge=d.useCallback(()=>{var N,Y;const v=St(hi(j)),p=(N=J.current)==null?void 0:N.querySelector(`button[data-date="${v}"]`);if(p instanceof HTMLButtonElement){Xe(v),p.focus();return}const w=A.current.find(K=>!K.isDisabled);if(w){const K=(Y=J.current)==null?void 0:Y.querySelector(`button[data-date="${w.currentDateISO}"]`);K instanceof HTMLButtonElement&&(Xe(w.currentDateISO),K.focus())}},[]),R=d.useCallback((v,p)=>{const w=v.target;if(fm(w))return;if(v.preventDefault(),!de){ge();return}const N=_s(de),Y=mm(N,p,J.current.querySelector.bind(J.current));if(Y){const K=J.current.querySelector(`button[data-date="${St(Y)}"]`);K instanceof HTMLButtonElement&&!K.dataset.disabled&&(Xe(St(Y)),K.focus())}},[de,ge]),je=d.useCallback(v=>{if(v.key==="Escape"){v.preventDefault(),ke();return}const p=gm(v.key);p!==null&&R(v.nativeEvent,p)},[ke,R]),Ve=d.useCallback(v=>{J.current&&!J.current.contains(v.relatedTarget)&&!v.target.classList.contains("pkt-hide")&&ke()},[ke]);return{componentId:F,strings:O,todayDate:j,year:V,month:le,activeSelected:M,_selected:G,inRange:me,rangeHovered:fe,focusedDate:de,range:i,multiple:t,weeknumbers:h,withcontrols:g,earliest:r,latest:a,excludedates:U,excludeweekdays:c,className:S,dateConstraints:Ke,calendarRef:J,selectableDatesRef:A,tabIndexSetRef:Le,prevMonth:ue,nextMonth:Me,changeMonth:oe,handleDateSelect:Pe,addToSelected:W,removeFromSelected:q,toggleSelectedDate:se,handleRangeHover:We,isExcluded:Ie,isDayDisabled:Te,focusOnCurrentDate:ge,handleKeydown:je,handleFocusOut:Ve,close:ke,setFocusedDate:Xe}}const vm=({componentId:s,strings:e,year:t,month:n,earliest:i,latest:r,withcontrols:a,prevMonth:l,nextMonth:c,changeMonth:h})=>{const g=f=>{const k=f==="prev",b=k?am(t,n,i):om(t,n,r),$=k?e.prevMonth:e.nextMonth,C=k?"chevron-thin-left":"chevron-thin-right",S=k?"pkt-calendar__prev-month":"pkt-calendar__next-month",T=k?l:c;return o.jsx("div",{children:o.jsxs("button",{type:"button","aria-label":$,onClick:()=>b&&T(),onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),b&&T())},className:["pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",S,!b&&"pkt-invisible"].filter(Boolean).join(" "),"data-disabled":b?void 0:"disabled","aria-disabled":!b||void 0,tabIndex:b?0:-1,children:[o.jsx(te,{className:"pkt-btn__icon",name:C}),o.jsx("span",{className:"pkt-btn__text",children:$})]})})},m=()=>a?o.jsxs("div",{className:"pkt-cal-month-picker",children:[o.jsx("label",{htmlFor:`${s}-monthnav`,className:"pkt-hide",children:e.month}),o.jsx("select",{"aria-label":e.month,className:"pkt-input pkt-input-compact",id:`${s}-monthnav`,value:n,onChange:f=>{f.stopPropagation(),h(t,parseInt(f.target.value))},children:e.months.map((f,k)=>o.jsx("option",{value:k,children:f},k))}),o.jsx("label",{htmlFor:`${s}-yearnav`,className:"pkt-hide",children:e.year}),o.jsx("input",{"aria-label":e.year,className:"pkt-input pkt-cal-input-year pkt-input-compact",id:`${s}-yearnav`,type:"number",size:4,placeholder:"0000",value:t,onChange:f=>{f.stopPropagation(),h(parseInt(f.target.value),n)}})]}):o.jsxs("div",{className:"pkt-txt-16-medium pkt-calendar__month-title","aria-live":"polite",children:[e.months[n]," ",t]});return o.jsxs("nav",{className:"pkt-cal-month-nav",children:[g("prev"),m(),g("next")]})};function ym(s,e,t){const n=xn(t.year,t.month,s),i=St(n),r=i===St(e),a=t.activeSelected.includes(i),l=t.isDayDisabled(n,a);let c;return t.focusedDate?c=t.focusedDate===i&&!l?"0":"-1":!l&&t.tabIndexSetRef.current===0?(t.tabIndexSetRef.current=s,c="0"):c=t.tabIndexSetRef.current===s?"0":"-1",{currentDate:n,currentDateISO:i,isToday:r,isSelected:a,isDisabled:l,ariaLabel:Jf(n),tabindex:c}}function _m(s,e){const{currentDateISO:t,isToday:n,isSelected:i}=s,r=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],a=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return pe({"pkt-cal-today":n,"pkt-cal-selected":i,"pkt-cal-in-range":e.inRange[t],"pkt-cal-excluded":e.isExcluded(s.currentDate),"pkt-cal-in-range-first":r,"pkt-cal-in-range-last":a,"pkt-cal-range-hover":e.rangeHovered!==null&&t===St(e.rangeHovered)})}function wm(s,e){const{currentDateISO:t,isToday:n,isSelected:i,isDisabled:r}=s,a=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],l=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return pe({"pkt-calendar__date":!0,"pkt-calendar__date--today":n,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":e.inRange[t],"pkt-calendar__date--in-range-hover":e.rangeHovered!==null&&t===St(e.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l})}const $m=({state:s})=>{const{strings:e,year:t,month:n,activeSelected:i,focusedDate:r,inRange:a,rangeHovered:l,range:c,multiple:h,weeknumbers:g,selectableDatesRef:m,tabIndexSetRef:f,handleDateSelect:k,handleRangeHover:b,isExcluded:$,isDayDisabled:C,setFocusedDate:S,todayDate:T}=s,F={year:t,month:n,activeSelected:i,focusedDate:r,tabIndexSetRef:f,isDayDisabled:C},O={range:c,activeSelected:i,rangeHovered:l,inRange:a,isExcluded:$},j=()=>{const z=[];g&&z.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__week-number",children:e.week})},"week-header"));for(let M=0;M<e.daysShort.length;M++)z.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__day-name","aria-label":e.days[M],children:e.daysShort[M]})},`day-${M}`));return o.jsx("tr",{className:"pkt-cal-week-row",children:z})},U=(z,M)=>{const G=ym(z,M,F),{currentDate:V,currentDateISO:ee,isSelected:le,isDisabled:ne,ariaLabel:me,tabindex:ve}=G;m.current.push({currentDateISO:ee,isDisabled:ne,tabindex:ve});const fe=_m(G,O),ce=wm(G,O);return o.jsx("td",{className:fe,children:o.jsx("button",{type:"button","aria-pressed":le?"true":"false",disabled:ne,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${ce}`,onMouseOver:()=>c&&!$(V)&&b(V),onFocus:()=>{c&&!$(V)&&b(V),S(ee)},"aria-label":me,tabIndex:parseInt(ve),"data-disabled":ne?"disabled":void 0,"data-date":ee,onKeyDown:de=>{(de.key==="Enter"||de.key===" ")&&(de.preventDefault(),k(V))},onClick:de=>{ne||(de.preventDefault(),k(V))},children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:z})})},ee)},Q=(z,M)=>o.jsx("td",{className:"pkt-cal-other",children:o.jsx("div",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only","data-disabled":"disabled",children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:z})})},M),we=()=>{const z=T,M=um(t,n);m.current=[],f.current=0;let G=1,V=M.initialWeek;const ee=[];for(let le=0;le<M.numRows;le++){const ne=[];g&&ne.push(o.jsx("td",{className:"pkt-cal-week",children:V},`week-${V}`)),V++;for(let me=0;me<pi;me++){const ve=dm(le,me,G,M);if(ve==="current-month")ne.push(U(G,z)),G++;else{const fe=hm(ve,me,G,M);ne.push(Q(fe,`${ve}-${le}-${me}`)),ve==="next-month"&&G++}}ee.push(o.jsx("tr",{className:"pkt-cal-week-row",role:"row",children:ne},`row-${le}`))}return ee};return o.jsxs("table",{className:"pkt-cal-days pkt-txt-12-medium pkt-calendar__body",role:"grid","aria-multiselectable":c||h||void 0,children:[o.jsx("thead",{children:j()}),o.jsx("tbody",{children:we()})]})},ea=d.forwardRef((s,e)=>{const t=km(s);return d.useImperativeHandle(e,()=>({handleDateSelect:t.handleDateSelect,addToSelected:t.addToSelected,removeFromSelected:t.removeFromSelected,toggleSelected:t.toggleSelectedDate,focusOnCurrentDate:t.focusOnCurrentDate,close:t.close}),[t.handleDateSelect,t.addToSelected,t.removeFromSelected,t.toggleSelectedDate,t.focusOnCurrentDate,t.close]),o.jsxs("div",{ref:t.calendarRef,className:["pkt-calendar",t.weeknumbers&&"pkt-cal-weeknumbers",t.className].filter(Boolean).join(" "),onBlur:t.handleFocusOut,onKeyDown:t.handleKeydown,children:[o.jsx(vm,{componentId:t.componentId,strings:t.strings,year:t.year,month:t.month,earliest:t.earliest,latest:t.latest,withcontrols:t.withcontrols,prevMonth:t.prevMonth,nextMonth:t.nextMonth,changeMonth:t.changeMonth}),o.jsx($m,{state:t})]})});ea.displayName="PktCalendar";const Ps=d.forwardRef(({children:s,skin:e,textStyle:t,size:n,closeTag:i,className:r,iconName:a,ariaLabel:l,onClose:c,type:h,"aria-description":g,...m},f)=>{const[k,b]=d.useState(!1),$=d.useCallback(()=>{b(!0),c&&c()},[c]),C=d.useRef(null),[S,T]=d.useState("");d.useEffect(()=>{var U,Q;T(((Q=(U=C.current)==null?void 0:U.textContent)==null?void 0:Q.trim())??"")},[s]);const F=d.useMemo(()=>{if(i&&!l)return S&&`Klikk for å fjerne ${S}`||g},[i,l,S,g]),O={"pkt-tag":!0,[`pkt-tag--${n}`]:!!n,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${t}`]:!!t},j={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${n}`]:!!n,[`pkt-tag--${e}`]:!!e,"pkt-btn--icons-right-and-left":i&&!!a,"pkt-hide":k};return i?o.jsxs("button",{...m,className:pe(j,r),type:h,onClick:$,"aria-label":l,"aria-description":F,ref:f,children:[a&&o.jsx(te,{className:"pkt-tag__icon",name:a}),o.jsx("span",{ref:C,children:s}),o.jsx(te,{className:"pkt-tag__close-btn",name:"close"})]}):o.jsxs("span",{...m,className:pe(O,r),ref:f,children:[a&&o.jsx(te,{className:"pkt-tag__icon",name:a,"aria-hidden":"true"}),o.jsx("span",{ref:C,children:s})]})});Ps.displayName="PktTag";const _l=d.forwardRef(({children:s,className:e,ariaLabel:t,metaLead:n,borderOnHover:i=!0,metaTrail:r,layout:a="vertical",heading:l="",headingLevel:c=3,image:h,imageShape:g="square",clickCardLink:m,padding:f="default",openLinkInNewTab:k=!1,skin:b="outlined",subheading:$="",tagPosition:C="top",tags:S=[],...T},F)=>{const O=pe({"pkt-card":!0,[`pkt-card--${b}`]:b,[`pkt-card--${a}`]:a,[`pkt-card--padding-${f}`]:f,"pkt-card--border-on-hover":i}),j=(t==null?void 0:t.trim())||(l?`${l} lenkekort`:"lenkekort"),U=(t==null?void 0:t.trim())||l||"kort",Q=`h${c}`,we=()=>h!=null&&h.src?o.jsx("div",{className:pe("pkt-card__image",`pkt-card__image-${g}`),children:o.jsx("img",{src:h.src,alt:h.alt||""})}):null,z=()=>S.length===0?null:o.jsx("div",{className:pe("pkt-card__tags",`pkt-card__tags-${C}`),role:"list","aria-label":S.length>1?"merkelapper":"merkelapp",children:S.map((ne,me)=>o.jsx(Ps,{role:"listitem",textStyle:"normal-text",size:"medium",skin:ne.skin,iconName:ne.iconName,children:o.jsx("span",{children:ne.text})},me))}),M=()=>!l||m?null:o.jsx(Q,{className:"pkt-heading pkt-heading--medium pkt-heading--fw-regular pkt-card__heading",children:l}),G=()=>m?o.jsx(Q,{className:"pkt-heading pkt-heading--medium pkt-heading--fw-regular pkt-card__link-heading pkt-card__heading",children:o.jsx("a",{className:"pkt-card__link",href:m,target:k?"_blank":"_self",rel:k?"noopener noreferrer":void 0,children:l})}):null,V=()=>$?o.jsx("p",{className:"pkt-card__subheading",children:$}):null,ee=()=>!l&&!$?null:o.jsxs("header",{className:"pkt-card__header",children:[M(),G(),V()]}),le=()=>!n&&!r?null:o.jsxs("footer",{className:"pkt-card__metadata",children:[n&&o.jsx("span",{className:"pkt-card__metadata-lead",children:n}),r&&o.jsx("span",{className:"pkt-card__metadata-trail",children:r})]});return o.jsx("div",{ref:F,className:pe("pkt-card-root",e),style:{display:"block",width:"100%"},children:o.jsxs("article",{...T,className:O,"aria-label":m?j:U,children:[we(),o.jsxs("div",{className:"pkt-card__wrapper",children:[C==="top"&&z(),ee(),o.jsx("section",{className:"pkt-card__content",children:s}),C==="bottom"&&z(),le()]})]})})});_l.displayName="PktCard";const wl=d.forwardRef(({id:s,hasTile:e=!1,disabled:t=!1,label:n,checkHelptext:i,hasError:r=!1,className:a,isSwitch:l=!1,hideLabel:c=!1,labelPosition:h="right",defaultChecked:g,checked:m,indeterminate:f,optionalTag:k,optionalText:b="Valgfritt",requiredTag:$,requiredText:C="Må fylles ut",tagText:S,...T},F)=>{const O=d.useRef(null);d.useEffect(()=>{O.current&&f!==void 0&&(O.current.indeterminate=f)},[f]),d.useEffect(()=>{typeof F=="function"?F(O.current):F&&(F.current=O.current)},[F]);const j=[a,"pkt-input-check"].filter(Boolean).join(" "),U=["pkt-input-check__input-label",t?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${h}`,c?"pkt-sr-only":""].filter(Boolean).join(" "),Q=["pkt-input-check__input",e?"pkt-input-check__input--tile":"",t&&e?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),we=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),z=()=>o.jsxs(o.Fragment,{children:[S&&o.jsx("span",{className:we+" pkt-tag--gray",children:S}),k&&o.jsx("span",{className:we+" pkt-tag--blue-light",children:b}),$&&o.jsx("span",{className:we+" pkt-tag--beige",children:C})]});return o.jsx("div",{className:j,children:o.jsxs("div",{className:Q,children:[h==="left"&&o.jsxs("label",{className:U,htmlFor:s,children:[n," ",z(),i&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:i})]}),o.jsx("input",{role:l?"switch":"checkbox",ref:O,className:`pkt-input-check__input-checkbox ${r?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:t,...m!==void 0?{checked:m}:{defaultChecked:g},...T}),h==="right"&&o.jsxs("label",{className:U,htmlFor:s,children:[n," ",z(),i&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:i})]})]})})});wl.displayName="PktCheckbox";const ws=d.forwardRef(({forId:s,label:e,helptext:t,helptextDropdown:n,helptextDropdownButton:i,counter:r,counterCurrent:a=0,counterMaxLength:l,optionalTag:c=!1,optionalText:h="Valgfritt",requiredTag:g=!1,requiredText:m="Må fylles ut",tagText:f=null,hasError:k=!1,errorMessage:b,disabled:$=!1,inline:C=!1,ariaDescribedby:S,useWrapper:T=!0,children:F,className:O="",hasFieldset:j=!1,role:U="group",counterPosition:Q="bottom"},we)=>{const[z,M]=d.useState(!1),G=S||(t?`${s}-helptext`:void 0),V=!!r,ee=V&&Q==="top",le=V&&Q==="bottom",ne=()=>M(A=>!A),me=["pkt-inputwrapper",O,k?"pkt-inputwrapper--error":"",$?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),ve=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),fe=()=>V?o.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[a,l?`/${l}`:""]}):null,ce=()=>o.jsxs(o.Fragment,{children:[f&&o.jsx("span",{className:ve+" pkt-tag--gray",children:f}),c&&o.jsx("span",{className:ve+" pkt-tag--blue-light",children:h}),g&&o.jsx("span",{className:ve+" pkt-tag--beige",children:m})]}),de=()=>{const A=o.jsxs(o.Fragment,{children:[e," ",ce()]});return T?j?o.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:A}):o.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":G,id:`${s}-label`,children:A}):o.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":G,id:`${s}-label`,children:e})},Xe=()=>!t&&!n?null:o.jsxs(o.Fragment,{children:[t&&T&&o.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:t}),n&&o.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[o.jsx(_t,{skin:"tertiary",size:"small",variant:"icon-right",iconName:z?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ne,children:o.jsx("span",{dangerouslySetInnerHTML:{__html:i??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),o.jsx("div",{className:`pkt-inputwrapper__helptext ${z?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:n})]})]}),J=o.jsxs(o.Fragment,{children:[de(),Xe(),ee&&o.jsx(fe,{}),F,le&&o.jsx(fe,{}),k&&b&&o.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:o.jsx(Gi,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:b})})]});return o.jsx("div",{className:me,ref:we,role:U,children:j?o.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":G,children:J}):o.jsx("div",{className:"pkt-inputwrapper__fieldset",children:J})})});ws.displayName="PktInputWrapper";const $s=(s,e)=>e&&(s.find(t=>t.value===e)||s.find(t=>t.label===e))||null,xm=(s,e)=>{if(!e)return-1;const t=s.findIndex(n=>n.value===e);return t>=0?t:s.findIndex(n=>n.label===e)},Sm=(s,e)=>{if(!e)return[...s];const t=e.toLowerCase();return s.filter(n=>(n.fulltext||n.value+(n.label||"")+(n.prefix||"")).toLowerCase().includes(t))},Zi=s=>s.value+(s.label||"")+(s.prefix||""),Ji=(s,e)=>e!==null&&s>=e,$l=(s,e)=>{if(!s)return"";switch(e){case"prefixAndValue":return`${s.prefix||""} ${s.value}`.trim();case"value":return s.value;case"label":default:return s.label||s.value}},ta=(s,e)=>s?Array.isArray(s)?e?s:s.length>0?[s[0]]:[]:e?s.split(",").filter(Boolean):[s]:[],xl=(s,e)=>{if(!e)return{filtered:[...s],suggestion:null};const t=e.toLowerCase(),n=s.filter(r=>{var a;return(a=r.fulltext)==null?void 0:a.toLowerCase().includes(t)}),i=n.find(r=>{var a;return!r.selected&&((a=r.label)==null?void 0:a.toLowerCase().startsWith(t))})||null;return{filtered:n,suggestion:i}},Cm=(s,e,t,n)=>{if(!s.trim())return{addValueText:null,userInfoMessage:""};const i=s.trim().toLowerCase(),r=e.find(c=>c.toLowerCase()===i),a=t.filter(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase().includes(i))||c.value.toLowerCase().includes(i)}),l=a.find(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase())===i||c.value.toLowerCase()===i});return(a.length===0||!l)&&n?{addValueText:s,userInfoMessage:""}:a.length===0&&!n?{addValueText:null,userInfoMessage:"Ingen treff i søket"}:r?{addValueText:null,userInfoMessage:"Verdien er allerede valgt"}:{addValueText:null,userInfoMessage:""}},Tm=(s,e,t)=>{switch(s){case",":return t?"addValue":null;case"Enter":return"addValue";case"Tab":case"ArrowDown":return e?null:"focusListbox";case"Escape":return"closeOptions";default:return null}},Nm=(s,e,t,n,i)=>{if(!s)return{action:"none",value:null};const r=$s(t,s);return!e.includes(s)&&!r?n?{action:"addUserValue",value:s}:i?{action:"none",value:null}:{action:"removeValue",value:e[0]}:r&&!e.includes(r.value)?{action:"selectOption",value:r.value}:{action:"none",value:null}},Ri=(s,e,t)=>{const n=$s(e,s);return t==="label"&&(n!=null&&n.label)?n.label:s},en=s=>{s.scrollIntoView({block:"nearest"}),window.setTimeout(()=>s.focus(),0)},Sl=s=>Array.from(s.querySelectorAll('[role="option"]:not([data-disabled])')||[]),Dm=s=>{const e=s.nextElementSibling;e&&en(e)},Cl=(s,e,t)=>{const n=s.previousElementSibling;if(s.dataset.index==="0"&&t){const i=e.querySelector('[role="searchbox"]');i&&en(i)}else n&&en(n)},Mm=s=>{const e=Sl(s);e[0]&&en(e[0])},er=(s,e)=>{if(e.disabled)return;const t=Sl(s);if(e.allowUserInput&&e.customUserInput){const i=s.querySelector('[data-type="new-option"]');if(i){en(i);return}}const n=t.find(i=>i.dataset.selected==="true");if(n){en(n);return}if(e.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const i=s.querySelector('[role="searchbox"]');if(i){window.setTimeout(()=>i.focus(),0);return}}t[0]&&en(t[0])},Tl=({state:s,outside:e=!1})=>{const{values:t,options:n,disabled:i,displayValueAs:r,handleTagRemove:a,handleTagKeydown:l,focusedTagIndex:c}=s,h=d.useRef([]);if(d.useEffect(()=>{var f;!e&&c>=0&&c<t.length&&((f=h.current[c])==null||f.focus())},[e,c,t.length]),t.length===0)return null;const g=(f,k)=>{const b=$s(n,f),$=b==null?void 0:b.tagSkinColor,C=b?$l(b,r):f;return i?o.jsx("li",{role:"listitem",children:o.jsx(Ps,{skin:$||"blue-dark",children:o.jsx("span",{className:"pkt-combobox__value",children:C})})},f):e?o.jsx("li",{role:"listitem",children:o.jsx(Ps,{skin:$||"blue-dark",closeTag:!0,onClose:()=>a(f),children:o.jsx("span",{className:"pkt-combobox__value",children:C})})},f):o.jsx("li",{role:"listitem",onClick:S=>S.stopPropagation(),onMouseDown:S=>S.preventDefault(),children:o.jsx(Ps,{ref:S=>{h.current[k]=S},skin:$||"blue-dark",closeTag:!0,tabIndex:c===k?0:-1,onClose:()=>a(f),onKeyDown:S=>l(S,k),children:o.jsx("span",{className:"pkt-combobox__value",children:C})})},f)},m=t.map(g);return e?o.jsx("div",{className:"pkt-combobox__tags-outside",children:o.jsx("ul",{role:"list",className:"pkt-combobox__tag-list",children:m})}):o.jsx("ul",{role:"list",className:"pkt-combobox__tag-list",children:m})},Em=({state:s})=>{const{values:e,options:t,editingSingleValue:n,displayValueAs:i}=s;if(n||e.length===0)return null;const r=$s(t,e[0]);if(!r)return null;const a=$l(r,i);return o.jsx("span",{className:"pkt-combobox__value",children:a})},Om=({state:s})=>{const{id:e,inputId:t,listboxId:n,values:i,options:r,isOpen:a,multiple:l,typeahead:c,allowUserInput:h,tagPlacement:g,placeholder:m,disabled:f,fullwidth:k,hasError:b,label:$,inputFocus:C,inputRef:S,triggerRef:T,handleInputChange:F,handleInputKeydown:O,handleInputFocus:j,handleInputBlur:U,handleInputClick:Q,handlePlaceholderClick:we,handleSelectOnlyKeydown:z,name:M}=s,G=["pkt-combobox__input",k&&"pkt-combobox__input--fullwidth",a&&"pkt-combobox__input--open",b&&"pkt-combobox__input--error",f&&"pkt-combobox__input--disabled"].filter(Boolean).join(" "),V=["pkt-combobox__arrow-icon",a&&"pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "),ee=c||h,le=!ee&&m&&(!i.length||l&&g==="outside")&&!C,ne=g!=="outside",me=i[0]&&$s(r,i[0])?`${n}-${xm(r,i[0])}`:void 0,ve=l&&i.length>0?`${i.length} valgt`:void 0,fe=ee?{tabIndex:-1}:{id:`${e}-combobox`,role:"combobox","aria-expanded":a?"true":"false","aria-controls":n,"aria-haspopup":"listbox","aria-labelledby":`${e}-combobox-label`,"aria-activedescendant":me,"aria-description":ve,tabIndex:f?-1:0,onKeyDown:z};return o.jsxs("div",{ref:T,className:G,onClick:Q,...fe,children:[le?o.jsx("span",{className:"pkt-combobox__placeholder",onClick:we,children:m}):ne?l?o.jsx(Tl,{state:s}):ee?null:o.jsx(Em,{state:s}):null,ee?o.jsx("div",{className:"pkt-combobox__input-div combobox__input",children:o.jsx("input",{ref:S,type:"text",id:t,name:`${M||e}-input`,onChange:F,onKeyDown:O,onFocus:j,onBlur:U,placeholder:!i.length||l&&g==="outside"?m:void 0,autoComplete:"off",role:"combobox","aria-expanded":a?"true":"false","aria-label":$,"aria-autocomplete":c?"both":h?"list":"none","aria-controls":n,"aria-activedescendant":me,"aria-description":ve,disabled:f})}):o.jsx("input",{ref:S,type:"hidden",id:t,name:`${M||e}-input`,value:i.join(","),readOnly:!0}),o.jsx(te,{className:V,name:"chevron-thin-down","aria-hidden":"true"})]})},Am=({state:s})=>{const{listboxId:e,label:t,isOpen:n,options:i,filteredOptions:r,multiple:a,disabled:l,maxIsReached:c,maxlength:h,includeSearch:g,allowUserInput:m,addValueText:f,userInfoMessage:k,searchPlaceholder:b,searchValue:$,handleOptionClick:C,handleOptionKeydown:S,handleSearchInput:T,handleSearchKeydown:F,handleNewOptionClick:O,handleNewOptionKeydown:j,listboxRef:U}=s,Q=r.filter(V=>V.selected).length,we=a&&Q>0&&h!=null&&h>0,z=m&&f&&!c,M=!!k,G=["pkt-listbox",n&&"pkt-listbox__open","pkt-txt-16-light"].filter(Boolean).join(" ");return o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:U,id:e,className:G,role:r.length>0?"listbox":void 0,"aria-label":r.length>0?`Liste: ${t||""}`:void 0,"aria-multiselectable":r.length>0&&a?"true":void 0,children:[o.jsxs("div",{className:"pkt-listbox__banners",children:[g&&o.jsxs("div",{className:"pkt-listbox__search",children:[o.jsx("span",{className:"pkt-listbox__search-icon",children:o.jsx(te,{name:"magnifying-glass-small"})}),o.jsx("input",{className:"pkt-txt-16-light",type:"text","aria-label":"Søk i listen",form:"",placeholder:b||"Søk...",onChange:T,onKeyDown:F,value:$,"data-type":"searchbox",disabled:l,readOnly:l,role:"searchbox"})]}),we&&o.jsxs("div",{className:"pkt-listbox__banner pkt-listbox__banner--maximum-reached",children:[Q," av maks ",h," mulige er valgt."]}),M&&o.jsxs("div",{className:"pkt-listbox__banner pkt-listbox__banner--user-message",children:[o.jsx(te,{className:"pkt-listbox__banner-icon",name:"exclamation-mark-circle"}),k]}),z&&o.jsxs("div",{className:"pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option","data-type":"new-option","data-value":f,"data-selected":"false",tabIndex:0,onClick:()=>O(f),onKeyDown:j,children:[o.jsx(te,{className:"pkt-listbox__banner-icon",name:"plus-sign"}),'Legg til "',f,'"']}),i.length===0&&r.length===0&&!M&&o.jsxs("div",{className:"pkt-listbox__banner pkt-listbox__banner--empty",children:[o.jsx(te,{className:"pkt-listbox__banner-icon",name:"exclamation-mark-circle"}),"Tom liste"]})]}),o.jsx("ul",{className:"pkt-listbox__options",role:"presentation",children:r.map((V,ee)=>{const le=["pkt-listbox__option",!a&&V.selected&&"pkt-listbox__option--selected",a&&"pkt-listbox__option--checkBox"].filter(Boolean).join(" "),ne=l||V.disabled||c&&!V.selected;return o.jsxs("li",{className:le,onClick:()=>C(V.value),onKeyDown:me=>S(me,V.value),"aria-selected":V.selected?"true":"false",tabIndex:ne?-1:0,"data-index":ee,"data-value":V.value,"data-selected":V.selected?"true":"false","data-disabled":ne||void 0,"aria-disabled":ne?"true":"false",role:"option",id:`${e}-${ee}`,children:[a?o.jsx("input",{className:"pkt-input-check__input-checkbox",type:"checkbox",tabIndex:-1,value:V.value,checked:V.selected||!1,readOnly:!0,"aria-hidden":"true",disabled:ne}):V.selected?o.jsx(te,{name:"check-big"}):null,o.jsxs("span",{className:"pkt-listbox__option-label",id:`${e}-option-label-${ee}`,children:[V.prefix&&o.jsx("span",{className:"pkt-listbox__option-prefix",children:V.prefix}),V.label||V.value]}),V.description&&o.jsx("span",{className:"pkt-listbox__option-description pkt-txt-14-light",children:V.description})]},`${V.value}-${ee}`)})})]}),o.jsx("div",{"aria-live":"polite",className:"pkt-visually-hidden",children:k})]})};function Im(s,e){return s.map(t=>({...t,label:t.label||t.value,fulltext:Zi(t),selected:e.includes(t.value)}))}function Pm(s,e){const{id:t="",label:n,value:i,defaultValue:r,options:a,defaultOptions:l,multiple:c=!1,maxlength:h,typeahead:g=!1,includeSearch:m=!1,allowUserInput:f=!1,displayValueAs:k="label",tagPlacement:b,searchPlaceholder:$,placeholder:C,disabled:S=!1,required:T=!1,fullwidth:F=!1,hasError:O=!1,errorMessage:j,helptext:U,helptextDropdown:Q,helptextDropdownButton:we,optionalTag:z=!1,optionalText:M,requiredTag:G=!1,requiredText:V,tagText:ee,useWrapper:le=!0,name:ne,className:me,onChange:ve,onValueChange:fe,children:ce}=s,de=`${t}-input`,Xe=`${t}-listbox`,J=g||f,A=d.useRef(null),Le=d.useRef(null),Be=d.useRef(null),ae=d.useRef(null),Ke=d.useRef(null),xe=d.useCallback(()=>{var _,L;J?(_=A.current)==null||_.focus():(L=Be.current)==null||L.focus()},[J]),ke=d.useMemo(()=>{const _=[];return d.Children.forEach(ce,L=>{if(d.isValidElement(L)&&L.type==="option"){const re=L.props;_.push({value:re.value??re.children??"",label:re.children??re.value??"",selected:re.selected,disabled:re.disabled})}}),_},[ce]),oe=d.useMemo(()=>l&&l.length>0?l.map(_=>({..._,fulltext:Zi(_)})):a&&a.length>0?a.map(_=>({..._,fulltext:Zi(_)})):ke.length>0?ke.map(_=>({..._,fulltext:Zi(_)})):[],[l,a,ke]),ue=i!==void 0,[Me,Ie]=d.useState(()=>ta(i??r,c)),Te=d.useRef(Me);d.useEffect(()=>{ue&&Ie(ta(i,c))},[i,ue,c]);const P=ue?ta(i,c):Me,[We,Pe]=d.useState([]),W=d.useMemo(()=>{const _=[...We.filter(L=>!oe.some(re=>re.value===L.value)),...oe];return Im(_,P)},[oe,We,P]),[q,se]=d.useState(!1),[ge,R]=d.useState(""),[je,Ve]=d.useState(""),[v,p]=d.useState(""),[w,N]=d.useState(null),[Y,K]=d.useState(!1),[ye,ot]=d.useState(!1),[it,Ye]=d.useState(-1),Wt=d.useRef(!1),jt=Ji(P.length,h??null),Ee=c&&h!=null,Ft=d.useMemo(()=>ge?g?xl(W,ge).filtered:Sm(W,ge):W,[W,ge,g]),Qe=d.useMemo(()=>{var _;return(_=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:_.set},[]),gt=d.useCallback(_=>{const L=Le.current;if(!L||!Qe)return;const re=c?_.join(","):_[0]||"";Qe.call(L,re),L.dispatchEvent(new Event("input",{bubbles:!0}))},[Qe,c]),ut=c?P.join(","):P[0]||"";d.useEffect(()=>{Le.current&&(Le.current.value=ut)},[ut]),d.useEffect(()=>{if(q||c||!A.current)return;const _=P[0]?Ri(P[0],W,k):"";A.current.value!==_&&(A.current.value=_)},[P,W,k,c,q]);const Dt=d.useCallback((_,L=!0)=>{ue||Ie(_),L&&(fe==null||fe(_),gt(_))},[ue,fe,gt]),ps=d.useCallback(_=>{if(!_||P.includes(_))return;if(c&&Ji(P.length,h??null)){p("Maks antall valg nådd");return}const L=c?[...P,_]:[_];Dt(L)},[P,c,h,Dt]),rt=d.useCallback(_=>{if(!_)return;const L=P.filter(Je=>Je!==_),re=$s(W,_);re!=null&&re.userAdded&&Pe(Je=>Je.filter(Vt=>Vt.value!==_)),Dt(L)},[P,W,Dt]),sn=d.useCallback(()=>{Pe([]),Dt([])},[Dt]),xs=d.useCallback(_=>{if(!_||_.trim()==="")return;let L;if(!c)L=[_];else{if($s(W,_)||Ji(P.length,h??null))return;L=[...P,_]}const re={value:_,label:_,userAdded:!0,selected:!0};Pe(Je=>[re,...Je.filter(Vt=>Vt.value!==_)]),Dt(L)},[c,W,P,h,Dt]),nn=d.useCallback((_=!0,L)=>{if(N(null),_&&A.current&&A.current.type!=="hidden"){R(""),Ve("");const re=L!==void 0?L:P[0];!c&&re?A.current.value=Ri(re,W,k):A.current.value="",c||(ot(!1),p(""))}},[c,P,W,k]),Bt=d.useCallback(_=>{var dc,hc;if(S)return;p(""),N(null);const L=((dc=$s(W,_))==null?void 0:dc.value)||null,re=P.includes(_||L||""),Je=!!L,Vt=((hc=W.find(kb=>kb.value===_))==null?void 0:hc.disabled)||!1,rn=!(_!=null&&_.trim()),zt=!c,es=c,lr=Ji(P.length,h??null);let Ss=!1,cr=!0,vi="",pa="",Nn;Vt||(!Je&&f&&!rn?(xs(_),vi="Ny verdi lagt til",Ss=es,zt&&(Nn=_||"")):!Je&&!f?(zt&&P[0]&&rt(P[0]),cr=!1,Ss=!0,vi="Ingen treff i søket"):re?(rt(L),Ss=!0,Nn="",zt&&J&&A.current&&A.current.type!=="hidden"&&(A.current.value="")):rn&&zt?(sn(),Ss=!0,Nn=""):zt?(P[0]&&rt(P[0]),ps(L),Ss=!1,Nn=L||""):es&&!lr?(ps(L),Ss=!0):es&&lr?(vi="Maks antall valg nådd",cr=!1,pa=_||""):(zt&&sn(),vi="Ingen gyldig verdi valgt",cr=!1,Ss=!0,pa=_||"",Nn=""),se(Ss),p(vi),R(pa),nn(cr,Nn),Ss||(zt&&J&&(Wt.current=!0),window.setTimeout(()=>{xe()},0)))},[S,W,P,c,h,f,xs,rt,sn,ps,nn,xe]),Mt=d.useCallback(()=>{if(K(!1),N(null),p(""),R(""),A.current&&A.current.type!=="hidden"){const _=A.current.value;let L=P[0];if(c){if(_!==""){const{action:re,value:Je}=Nm(_,P,W,f,c);switch(re){case"addUserValue":xs(Je);break;case"selectOption":ps(Je);break;case"removeValue":rt(Je);break}}}else if(!_)P[0]&&rt(P[0]),L=void 0;else{const re=$s(W,_);re&&re.value!==P[0]?(P[0]&&rt(P[0]),ps(re.value),L=re.value):!re&&f&&(P[0]&&rt(P[0]),xs(_),L=_)}!c&&L?A.current.value=Ri(L,W,k):A.current.value=""}se(!1),ot(!1)},[P,W,f,c,k,xs,ps,rt]),Ls=d.useCallback(_=>{if(!_.trim().toLowerCase()){N(null),p(""),!c&&P[0]&&rt(P[0]);return}const re=Cm(_,P,W,f);N(re.addValueText),p(re.userInfoMessage)},[P,W,f,c,rt]),Tn=d.useCallback(_=>{var re;if(S)return;const L=_.target.value;if(Ve(L),R(L),Ls(L),g&&L){const{suggestion:Je}=xl(W,L);Je!=null&&Je.label&&A.current&&!((re=_.nativeEvent.inputType)!=null&&re.includes("deleteContent"))&&(A.current.value=Je.label,window.setTimeout(()=>{var Vt;return(Vt=A.current)==null?void 0:Vt.setSelectionRange(L.length,Je.label.length)},0))}},[S,g,W,Ls]),bi=d.useCallback(_=>{var re,Je,Vt,rn,zt;if(_.key==="Backspace"){const es=!((re=A.current)!=null&&re.value);if(!ge&&es&&c&&P.length>0){_.preventDefault();const lr=P[P.length-1];rt(lr)}return}if(_.key==="ArrowLeft"&&c&&P.length>0&&(((Je=A.current)==null?void 0:Je.selectionStart)??0)===0&&!((Vt=A.current)!=null&&Vt.value)){_.preventDefault(),Ye(P.length-1);return}const L=Tm(_.key,_.shiftKey,c);if(L&&!(_.key==="Tab"&&!q)){if(L==="focusListbox"&&_.key==="Tab"&&!((rn=ae.current)==null?void 0:rn.querySelector('[role="option"]:not([data-disabled]), [data-type="new-option"]'))){Mt();return}switch(_.preventDefault(),L){case"addValue":{const es=((zt=A.current)==null?void 0:zt.value.trim())||"";if(R(es),es&&P.includes(es)){nn(!0),p("Verdien er allerede valgt");break}Bt(es);break}case"focusListbox":ae.current&&(q||se(!0),er(ae.current,{disabled:S,allowUserInput:f,customUserInput:w,includeSearch:m}));break;case"closeOptions":se(!1);break}}},[ge,P,c,S,f,w,m,q,rt,Bt,xe]),Jt=d.useCallback(()=>{if(!S){if(Wt.current){Wt.current=!1,K(!0);return}!c&&P[0]&&A.current&&A.current.type!=="hidden"&&(ot(!0),A.current.value=Ri(P[0],W,k)),K(!0),R(""),se(!0)}},[S,c,P,W,k]),ki=d.useCallback(()=>{K(!1),ot(!1)},[]),E=d.useCallback(_=>{if(S||!q)return;const L=_.relatedTarget,re=Ke.current;re&&L&&re.contains(L)||Mt()},[S,q,Mt]),H=d.useCallback(_=>{var L;if(S){_.preventDefault(),_.stopPropagation();return}if(J)(L=A.current)==null||L.focus();else{_.stopPropagation(),_.preventDefault();const re=!q;se(re),re&&ae.current&&er(ae.current,{disabled:S,allowUserInput:f,customUserInput:w,includeSearch:m})}},[S,J,q,f,w,m]),ie=d.useCallback(_=>{S||(_.stopPropagation(),J&&A.current?(A.current.focus(),K(!0)):se(L=>!L))},[S,J]),D=d.useCallback(_=>{if(!S)switch(_.key){case"Enter":case" ":case"ArrowDown":case"ArrowUp":_.preventDefault(),q?se(!1):(se(!0),ae.current&&window.setTimeout(()=>{ae.current&&er(ae.current,{disabled:S,allowUserInput:f&&!jt,customUserInput:w,includeSearch:m})},0));break;case"Escape":q&&(_.preventDefault(),se(!1));break;case"Home":case"End":_.preventDefault(),q||se(!0),ae.current&&window.setTimeout(()=>{ae.current&&er(ae.current,{disabled:S,allowUserInput:f&&!jt,customUserInput:w,includeSearch:m})},0);break;case"ArrowLeft":c&&P.length>0&&(_.preventDefault(),Ye(P.length-1));break;case"Backspace":case"Delete":if(c&&P.length>0){_.preventDefault();const L=P[P.length-1];rt(L)}break}},[S,q,f,jt,w,m,c,P,rt]),I=d.useCallback(_=>{Bt(_)},[Bt]),be=d.useCallback((_,L)=>{switch(_.key){case"Enter":case" ":_.preventDefault(),Bt(L);break;case"ArrowDown":_.preventDefault(),Dm(_.currentTarget);break;case"ArrowUp":_.preventDefault(),ae.current&&Cl(_.currentTarget,ae.current,m);break;case"Escape":_.preventDefault(),se(!1),xe();break;case"Tab":Mt();break}},[Bt,m,xe,Mt]),$e=d.useCallback(_=>{rt(_),Ye(-1),J&&A.current&&(K(!0),A.current.focus())},[rt,J]),at=d.useCallback((_,L)=>{var re,Je,Vt;switch(_.stopPropagation(),_.key){case"ArrowLeft":_.preventDefault(),L>0&&Ye(L-1);break;case"ArrowRight":_.preventDefault(),L<P.length-1?Ye(L+1):(Ye(-1),J&&A.current?A.current.focus():(re=Be.current)==null||re.focus());break;case"Backspace":case"Delete":_.preventDefault();{const rn=P[L],zt=L>=P.length-1?L-1:L;rt(rn),zt>=0?Ye(zt):(Ye(-1),J&&A.current?A.current.focus():(Je=Be.current)==null||Je.focus())}break;case"Tab":Ye(-1);break;case"Escape":_.preventDefault(),Ye(-1),J&&A.current?A.current.focus():(Vt=Be.current)==null||Vt.focus();break}},[P,J,rt]),Fe=d.useCallback(_=>{R(_.target.value),Ls(_.target.value)},[Ls]),lt=d.useCallback(_=>{switch(_.key){case"ArrowDown":if(_.preventDefault(),ae.current){const L=ae.current.querySelector('[role="option"]:not([data-disabled]), [data-type="new-option"]');L==null||L.focus()}break;case"Tab":Mt();break;case"Escape":_.preventDefault(),se(!1),xe();break}},[xe,Mt]),Oe=d.useCallback(_=>{Bt(_)},[Bt]),Rt=d.useCallback(_=>{switch(_.key){case"Enter":case" ":_.preventDefault(),Bt(_.currentTarget.dataset.value||"");break;case"ArrowDown":_.preventDefault(),ae.current&&Mm(ae.current);break;case"ArrowUp":_.preventDefault(),ae.current&&Cl(_.currentTarget,ae.current,m);break;case"Escape":_.preventDefault(),se(!1),xe();break}},[Bt,m,xe]);return d.useEffect(()=>{if(!q)return;const _=L=>{const re=L.target;Ke.current&&!Ke.current.contains(re)&&Mt()};return document.addEventListener("click",_,!0),()=>{document.removeEventListener("click",_,!0)}},[q,Mt]),d.useEffect(()=>{var re;const _=(re=Ke.current)==null?void 0:re.closest("form");if(!_)return;const L=()=>{window.setTimeout(()=>{if(Ie(Te.current),Pe([]),Ve(""),R(""),N(null),p(""),Le.current){const Je=c?Te.current.join(","):Te.current[0]||"";Le.current.value=Je}},0)};return _.addEventListener("reset",L),()=>_.removeEventListener("reset",L)},[c]),d.useImperativeHandle(e,()=>({get value(){var _;return((_=Le.current)==null?void 0:_.value)??""},set value(_){const L=Array.isArray(_)?_:_?String(_).split(",").filter(Boolean):[];ue||Ie(L),Le.current&&(Le.current.value=L.join(","))},focus(){var _,L;J?(_=A.current)==null||_.focus():(L=Be.current)==null||L.focus()},blur(){var _,L;J?(_=A.current)==null||_.blur():(L=Be.current)==null||L.blur()}}),[ue]),{id:t,inputId:de,listboxId:Xe,values:P,inputValue:je,searchValue:ge,options:W,filteredOptions:Ft,isOpen:q,userInfoMessage:v,addValueText:w,maxIsReached:jt,editingSingleValue:ye,inputFocus:Y,focusedTagIndex:it,label:n,multiple:c,maxlength:h,typeahead:g,includeSearch:m,allowUserInput:f,displayValueAs:k,tagPlacement:b,searchPlaceholder:$,placeholder:C,disabled:S,required:T,fullwidth:F,hasError:O,errorMessage:j,helptext:U,helptextDropdown:Q,helptextDropdownButton:we,optionalTag:z,optionalText:M,requiredTag:G,requiredText:V,tagText:ee,useWrapper:le,name:ne,className:me,hasCounter:Ee,inputRef:A,changeInputRef:Le,triggerRef:Be,listboxRef:ae,wrapperRef:Ke,handleInputChange:Tn,handleInputKeydown:bi,handleInputFocus:Jt,handleInputBlur:ki,handleFocusOut:E,handleInputClick:H,handlePlaceholderClick:ie,handleSelectOnlyKeydown:D,handleOptionClick:I,handleOptionKeydown:be,handleTagRemove:$e,handleTagKeydown:at,handleSearchInput:Fe,handleSearchKeydown:lt,handleNewOptionClick:Oe,handleNewOptionKeydown:Rt,onChange:ve}}const Nl=d.forwardRef((s,e)=>{const t=Pm(s,e),n=["pkt-combobox-component",t.fullwidth&&"pkt-combobox-component--fullwidth",t.className].filter(Boolean).join(" "),i=t.allowUserInput||t.typeahead,r=i?t.inputId:`${t.id}-combobox`;return o.jsxs("div",{className:n,ref:t.wrapperRef,children:[o.jsxs(ws,{forId:r,hasFieldset:!i,label:t.label||"",helptext:t.helptext,helptextDropdown:t.helptextDropdown,helptextDropdownButton:t.helptextDropdownButton,hasError:t.hasError,errorMessage:t.errorMessage,disabled:t.disabled,optionalTag:t.optionalTag,optionalText:t.optionalText,requiredTag:t.requiredTag,requiredText:t.requiredText,tagText:t.tagText,useWrapper:t.useWrapper,counter:t.hasCounter,counterCurrent:t.values.length,counterMaxLength:t.maxlength,className:"pkt-combobox__wrapper",children:[o.jsxs("div",{className:"pkt-combobox",onBlur:t.handleFocusOut,children:[o.jsx(Om,{state:t}),o.jsx(Am,{state:t})]}),t.tagPlacement==="outside"&&t.multiple&&o.jsx(Tl,{state:t,outside:!0})]}),o.jsx("input",{ref:t.changeInputRef,type:"text",name:t.name||t.id,onChange:t.onChange,tabIndex:-1,"aria-hidden":"true",className:"pkt-visually-hidden"})]})});Nl.displayName="PktCombobox";const tr=Dn({tagName:"pkt-consent",elementClass:ss,react:d,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});tr.displayName="PktConsent";const Dl=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},Lm=()=>Dl()?"text":"date",Fm=s=>!s||s.length!==2?!0:im(s[0],s[1]),Bm=(s,e,t,n,i,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":n,"ios-readonly-hack":i===!1&&r==="text"}),Vm=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),Hm=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),Um=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,qm=(s,e,t=!1)=>{var l;if(!s||!e)return;const n=((l=e.parentElement)==null?void 0:l.getBoundingClientRect())||e.getBoundingClientRect(),i=t?n.height+30:n.height,r=s.getBoundingClientRect().height;let a=t?"calc(100% - 30px)":"100%";n&&n.top+r>window.innerHeight&&n.top-r>0&&(a=`calc(100% - ${i}px - ${r}px)`),s.style.top=a},sr=(s,e,t,n,i,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):i&&i()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():n?n():i&&i())},Wm=({open:s,multiple:e=!1,range:t=!1,weeknumbers:n=!1,withcontrols:i=!1,selected:r=[],earliest:a,latest:l,excludedates:c,excludeweekdays:h,maxMultiple:g,currentmonth:m,today:f,inputRef:k,hasCounter:b=!1,onDateSelected:$,onClose:C})=>{const S=d.useRef(null),T=d.useRef(!1);s&&(T.current=!0),d.useEffect(()=>{s&&qm(S.current,(k==null?void 0:k.current)??null,b)},[s,k,b]);const F=["pkt-calendar-popup",s?"show":"hide"].join(" "),O=s||T.current;return o.jsx("div",{ref:S,className:F,hidden:!s,"aria-hidden":!s,children:O&&o.jsx(ea,{multiple:e,range:t,weeknumbers:n,withcontrols:i,selected:r,earliest:a,latest:l,excludedates:c,excludeweekdays:h,maxMultiple:g,currentmonth:m,today:f,onDateSelected:$,onClose:C})})},jm=({dates:s,dateformat:e,idBase:t,strings:n,onDateRemoved:i})=>{var l;const r=nm(s),a=((l=n==null?void 0:n.calendar)==null?void 0:l.buttonAltText)??"Slett dato";return o.jsx("div",{className:"pkt-date-tags pkt-datepicker__tags","aria-live":"polite",children:r.map(c=>{const h=Zf(c,e);return o.jsx(Ps,{id:`${t}${c}-tag`,closeTag:!0,ariaLabel:`${a} ${h}`,onClose:()=>i(c),children:o.jsx("time",{dateTime:c,children:h})},c)})})},zm=({state:s})=>{var xe,ke,oe,ue;const{id:e,inputId:t,values:n,dateformat:i,multiple:r,range:a,showRangeLabels:l,disabled:c,readOnly:h,required:g,label:m,name:f,placeholder:k,hasError:b,helptext:$,minStr:C,maxStr:S,inputType:T,isIOSDevice:F,strings:O,inputClasses:j,buttonClasses:U,rangeLabelClasses:Q,datepickerInputsClasses:we,isInputDisabled:z,inputRef:M,inputRefTo:G,btnRef:V,toggleCalendar:ee,handleFocus:le,handleSingleInputChange:ne,handleRangeFromChange:me,handleRangeToChange:ve,handleRangeBlur:fe,handleMultipleBlur:ce,handleTagRemoved:de,handleSingleKeydown:Xe,handleRangeFromKeydown:J,handleRangeToKeydown:A,handleMultipleKeydown:Le,restProps:Be}=s,ae=Me=>{Me.preventDefault(),ee()},Ke=()=>{var Me,Ie;return o.jsxs("button",{ref:V,className:U,type:"button",onClick:ee,disabled:c,"aria-label":((Me=O.calendar)==null?void 0:Me.buttonAltText)??"Åpne kalender",children:[o.jsx(te,{name:"calendar"}),o.jsx("span",{className:"pkt-btn__text",children:((Ie=O.calendar)==null?void 0:Ie.buttonAltText)??"Åpne kalender"})]})};return r?o.jsxs(o.Fragment,{children:[o.jsx(jm,{dates:n,dateformat:i,idBase:e,strings:O,onDateRemoved:de}),o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Be,ref:M,className:j,type:T,id:t,name:f??e,placeholder:k,readOnly:h||F&&!h,disabled:z,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":b,"aria-errormessage":b?`${e}-error`:void 0,onClick:ae,onKeyDown:Le,onFocus:le,onBlur:ce}),Ke()]})})]}):a?o.jsx("div",{className:we,children:o.jsxs("div",{className:"pkt-input__container",children:[l&&o.jsx("div",{className:"pkt-input-prefix",children:((xe=O.generic)==null?void 0:xe.from)??"Fra"}),o.jsx("input",{...Be,ref:M,className:j,type:T,id:t,name:f?`${f}-from`:`${e}-from`,value:n[0]??"",min:C,max:S,placeholder:k,readOnly:h||F&&!h,disabled:c,required:g,"aria-label":`${m} ${((ke=O.generic)==null?void 0:ke.from)??"Fra"}`,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":b,"aria-errormessage":b?`${e}-error`:void 0,onClick:ae,onKeyDown:J,onFocus:le,onBlur:fe,onChange:me}),o.jsx("div",{className:Q,id:`${e}-to-label`,children:((oe=O.generic)==null?void 0:oe.to)??"Til"}),!l&&o.jsx("div",{className:"pkt-input-separator",children:"–"}),o.jsx("input",{ref:G,className:j,type:T,id:`${e}-to`,name:f?`${f}-to`:`${e}-to`,value:n[1]??"",min:C,max:S,readOnly:h||F&&!h,disabled:c,"aria-label":`${m} ${((ue=O.generic)==null?void 0:ue.to)??"Til"}`,"aria-invalid":b,onClick:ae,onKeyDown:A,onFocus:le,onBlur:fe,onChange:ve}),Ke()]})}):o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Be,ref:M,className:j,type:T,id:t,name:f??e,value:n[0]??"",min:C,max:S,placeholder:k,readOnly:h||F&&!h,disabled:c,required:g,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":b,"aria-errormessage":b?`${e}-error`:void 0,onClick:ae,onKeyDown:Xe,onFocus:le,onBlur:void 0,onChange:ne}),Ke()]})})},Km={calendar:{buttonAltText:"Åpne kalender"}},Ym={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}},Ml=s=>{if(!s)return[];if(Array.isArray(s))return s.filter(Boolean);if(typeof s=="string"&&s.trimStart().startsWith("["))try{const e=JSON.parse(s);if(Array.isArray(e))return e.filter(Boolean)}catch{}return String(s).split(",").map(e=>e.trim()).filter(Boolean)};function Gm(s,e){const{id:t,label:n,value:i,defaultValue:r,dateformat:a="dd.MM.yyyy",multiple:l=!1,maxlength:c,range:h=!1,showRangeLabels:g=!1,weeknumbers:m=!1,withcontrols:f=!1,excludedates:k,excludeweekdays:b,currentmonth:$,today:C,calendarOpen:S,timezone:T,fullwidth:F=!1,hasFieldset:O=!1,inline:j=!1,helptext:U,helptextDropdown:Q,helptextDropdownButton:we,hasError:z=!1,errorMessage:M,optionalTag:G=!1,optionalText:V,requiredTag:ee=!1,requiredText:le,tagText:ne,useWrapper:me=!0,strings:ve,disabled:fe=!1,readOnly:ce=!1,required:de=!1,name:Xe,min:J,max:A,placeholder:Le,onChange:Be,onValueChange:ae,className:Ke,...xe}=s,ke=d.useCallback(D=>D===void 0?[]:Ml(D),[]),oe=i!==void 0,ue=typeof r=="number"?void 0:r,[Me,Ie]=d.useState(()=>ke(i??ue)),Te=oe?ke(i):Me,P=d.useRef(Me);d.useEffect(()=>{oe&&Ie(ke(i))},[i,oe,ke]);const[We,Pe]=d.useState(S??!1);d.useEffect(()=>{S!==void 0&&Pe(S)},[S]);const W=d.useRef(null),q=d.useRef(null),se=d.useRef(null),ge=d.useRef(null),R=d.useRef(null),je=d.useMemo(()=>Lm(),[]),Ve=d.useMemo(()=>Dl(),[]),v=d.useMemo(()=>ve??(h?Ym:Km),[ve,h]),p=typeof J=="string"?J:J!==void 0?String(J):void 0,w=typeof A=="string"?A:A!==void 0?String(A):void 0,N=d.useMemo(()=>{const D=Bm(F,g,l,h,ce,je);return Object.entries(D).filter(([,I])=>I).map(([I])=>I).join(" ")},[F,g,l,h,ce,je]),Y=d.useMemo(()=>{const D=Vm();return Object.entries(D).filter(([,I])=>I).map(([I])=>I).join(" ")},[]),K=d.useMemo(()=>{const D=Hm(g);return Object.entries(D).filter(([,I])=>I).map(([I])=>I).join(" ")},[g]),ye=d.useMemo(()=>["pkt-datepicker__inputs",h&&"pkt-input__range-inputs"].filter(Boolean).join(" "),[h,g]),ot=d.useMemo(()=>{if($)return $;if(w)return w.slice(0,7)},[$,w]),it=fe||l&&c!=null&&Te.length>=c,Ye=l&&c!=null,Wt=`${t}-input`,jt=Te.join(",");d.useEffect(()=>{se.current&&(se.current.value=jt)},[jt]),d.useEffect(()=>{T&&typeof window<"u"&&T!==window.pktTz&&(window.pktTz=T)},[T]);const Ee=d.useCallback((D,I=!0)=>{oe||Ie(D),I&&(ae==null||ae(D))},[oe,ae]),Ft=d.useMemo(()=>{var D;return(D=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:D.set},[]),Qe=d.useCallback(D=>{const I=se.current;!I||!Ft||(Ft.call(I,D.join(",")),I.dispatchEvent(new Event("input",{bubbles:!0})))},[Ft]),gt=d.useCallback(()=>{fe||Pe(D=>!D)},[fe]),ut=d.useCallback(()=>{Pe(!1)},[]);d.useEffect(()=>{if(!We)return;const D=be=>{var at;const $e=be.target;R.current&&!R.current.contains($e)&&!((at=$e.closest)!=null&&at.call($e,".pkt-calendar-popup"))&&ut()},I=be=>{var $e;be.key==="Escape"&&(ut(),($e=W.current)==null||$e.focus())};return document.addEventListener("click",D,!0),document.addEventListener("keydown",I),()=>{document.removeEventListener("click",D,!0),document.removeEventListener("keydown",I)}},[We,ut]);const Dt=d.useCallback(()=>{Ve&&!We&&Pe(!0)},[Ve,We]),ps=d.useCallback(D=>{var $e;const I=Um(D,l,h),be=Ml(I);Ee(be),Qe(be),!l&&!h&&(ut(),($e=W.current)==null||$e.focus())},[l,h,Ee,Qe,ut]),rt=d.useCallback(()=>{var D;ut(),(D=W.current)==null||D.focus()},[ut]),sn=d.useCallback(D=>{const I=D.target.value,be=I?[I]:[];Ee(be),Qe(be)},[Ee,Qe]),xs=d.useCallback(D=>{const I=D.target.value,be=Te[1]??"",$e=[I,be].filter(Boolean);Ee($e),Qe($e)},[Te,Ee,Qe]),nn=d.useCallback(D=>{const I=Te[0]??"",be=D.target.value,$e=[I,be].filter(Boolean);Ee($e),Qe($e)},[Te,Ee,Qe]),Bt=d.useCallback(()=>{Te.length===2&&!Fm(Te)&&(Ee([Te[0]]),Qe([Te[0]]))},[Te,Ee,Qe]),Mt=d.useCallback(D=>{const I=_s(D),be=p?_s(p):null,$e=w?_s(w):null;if(I&&!isNaN(I.getTime())&&(!be||I>=be)&&(!$e||I<=$e)){const at=sm([...Te,D],p,w,k,b),Fe=[...new Set(at)];Ee(Fe),Qe(Fe)}},[Te,p,w,k,b,Ee,Qe]),Ls=d.useCallback(D=>{const I=D.target;I.value&&(Mt(I.value.split(",")[0]),I.value="")},[Mt]),Tn=d.useCallback(D=>{const I=D.target;I.value&&(Mt(I.value.split(",")[0]),I.value="")},[Mt]),bi=d.useCallback(D=>{const I=Te.filter(be=>be!==D);Ee(I),Qe(I)},[Te,Ee,Qe]),Jt=d.useCallback(D=>{const I=D==null?void 0:D.closest("form");I?I.requestSubmit():D==null||D.blur()},[]),ki=d.useCallback(D=>{sr(D.nativeEvent,()=>gt(),()=>Jt(W.current),void 0,()=>{var I;return(I=W.current)==null?void 0:I.blur()})},[gt,Jt]),E=d.useCallback(D=>{sr(D.nativeEvent,()=>gt(),()=>Jt(W.current),()=>{var I;return(I=q.current)==null?void 0:I.focus()},()=>{var I;return(I=W.current)==null?void 0:I.blur()})},[gt,Jt]),H=d.useCallback(D=>{sr(D.nativeEvent,()=>gt(),()=>Jt(q.current),void 0,()=>{var I;return(I=q.current)==null?void 0:I.blur()})},[gt,Jt]),ie=d.useCallback(D=>{sr(D.nativeEvent,()=>gt(),()=>Jt(W.current),void 0,()=>{var I;return(I=W.current)==null?void 0:I.blur()},Tn)},[gt,Jt,Tn]);return d.useEffect(()=>{var be;const D=(be=R.current)==null?void 0:be.closest("form");if(!D)return;const I=()=>{window.setTimeout(()=>{Ie(P.current),Pe(!1),se.current&&(se.current.value=P.current.join(","))},0)};return D.addEventListener("reset",I),()=>D.removeEventListener("reset",I)},[]),d.useImperativeHandle(e,()=>({get value(){var D;return((D=se.current)==null?void 0:D.value)??""},set value(D){const I=D?D.split(",").filter(Boolean):[];Ie(I),se.current&&(se.current.value=D??"")},focus(){var D;(D=W.current)==null||D.focus()},blur(){var D;(D=W.current)==null||D.blur()}}),[]),{id:t,inputId:Wt,label:n,values:Te,calendarOpen:We,dateformat:a,multiple:l,maxlength:c,range:h,showRangeLabels:g,weeknumbers:m,withcontrols:f,excludedates:k,excludeweekdays:b,disabled:fe,readOnly:ce,required:de,name:Xe,placeholder:Le,fullwidth:F,hasFieldset:O,inline:j,helptext:U,helptextDropdown:Q,helptextDropdownButton:we,hasError:z,errorMessage:M,optionalTag:G,optionalText:V,requiredTag:ee,requiredText:le,tagText:ne,useWrapper:me,className:Ke,minStr:p,maxStr:w,effectiveCurrentMonth:ot,today:C,inputType:je,isIOSDevice:Ve,strings:v,inputClasses:N,buttonClasses:Y,rangeLabelClasses:K,datepickerInputsClasses:ye,isInputDisabled:it,hasCounter:Ye,inputRef:W,inputRefTo:q,changeInputRef:se,btnRef:ge,wrapperRef:R,onChange:Be,toggleCalendar:gt,hideCalendar:ut,handleDateSelected:ps,handleCalendarClose:rt,handleFocus:Dt,handleSingleInputChange:sn,handleRangeFromChange:xs,handleRangeToChange:nn,handleRangeBlur:Bt,handleMultipleBlur:Ls,handleTagRemoved:bi,handleSingleKeydown:ki,handleRangeFromKeydown:E,handleRangeToKeydown:H,handleMultipleKeydown:ie,restProps:xe}}const El=d.forwardRef((s,e)=>{const t=Gm(s,e),n=["pkt-datepicker",t.className].filter(Boolean).join(" ");return o.jsxs("div",{className:n,children:[o.jsx(ws,{ref:t.wrapperRef,forId:t.inputId,label:t.label,hasFieldset:t.hasFieldset,inline:t.inline,helptext:t.helptext,helptextDropdown:t.helptextDropdown,helptextDropdownButton:t.helptextDropdownButton,hasError:t.hasError,errorMessage:t.errorMessage,disabled:t.disabled,optionalTag:t.optionalTag,optionalText:t.optionalText,requiredTag:t.requiredTag,requiredText:t.requiredText,tagText:t.tagText,useWrapper:t.useWrapper,counter:t.hasCounter,counterCurrent:t.values.length,counterMaxLength:t.maxlength,children:o.jsx(zm,{state:t})}),o.jsx(Wm,{open:t.calendarOpen,multiple:t.multiple,range:t.range,weeknumbers:t.weeknumbers,withcontrols:t.withcontrols,selected:t.values,earliest:t.minStr,latest:t.maxStr,excludedates:t.excludedates,excludeweekdays:t.excludeweekdays,maxMultiple:t.maxlength,currentmonth:t.effectiveCurrentMonth,today:t.today,inputRef:t.inputRef,hasCounter:t.hasCounter,onDateSelected:t.handleDateSelected,onClose:t.handleCalendarClose}),o.jsx("input",{ref:t.changeInputRef,type:"text",name:t.name,onChange:t.onChange,tabIndex:-1,"aria-hidden":"true",className:"pkt-visually-hidden"})]})});El.displayName="PktDatepicker";const Xm={dropFilesHere:"Slipp filene her ...",selectOrDragFiles:"Dra filer hit for å laste dem opp eller ",chooseFiles:"velg filer"},Qm={dropFilesHere:"Slipp filen her ...",selectOrDragFiles:"Dra en fil for å laste den opp eller ",chooseFiles:"velg en fil"},Zm={dropFilesHere:"Slipp bildene her ...",selectOrDragFiles:"Dra bilder hit for å laste dem opp eller ",chooseFiles:"velg fra kamerarull"},Jm={dropFilesHere:"Slipp bildet her ...",selectOrDragFiles:"Dra et bilde for å laste det opp eller ",chooseFiles:"velg fra kamerarull"},Ol=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Rm=()=>{const s=Ol(),e=Ol();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)};class Al{constructor(e,t){ur(this,"fileId");ur(this,"file");ur(this,"attributes",{});this.fileId=t||Rm(),this.file=e,this.attributes={targetFilename:e.name}}}const sa=d.createContext({}),eg=".PDF, .JPEG, .JPG, .PNG, .HEIC, .DOC, .DOCX, .ODT",tg=d.forwardRef(({id:s,multiple:e,value:t,onFilesAdded:n=()=>{},name:i,uploadStrategy:r,accept:a,isThumbnailView:l=!1,disabled:c=!1,srAnnouncementIds:h,...g},m)=>{const f=d.useRef(null),k=typeof a=="string"&&a.trim().length>0?a:void 0,b=d.useMemo(()=>k?k.split(/\s*,\s*/).map(M=>M.trim()).filter(Boolean).join(", ").toUpperCase():eg,[k]);d.useImperativeHandle(m,()=>f.current);const[$,C]=d.useState(!1),S=d.useMemo(()=>l?e?Zm:Jm:e?Xm:Qm,[e,l]),T=d.useCallback(M=>{if(f.current)try{f.current.files=sg(M)}catch{}},[f.current,t]);d.useEffect(()=>{T(t)},[f,t]);const F=d.useCallback(M=>{const G=M.map(V=>new Al(V));n(G),f.current&&(f.current.value="")},[n]),O=M=>{const G=M.target.files;if(G.length===0){e&&T(t);return}F(Array.from(G))},j=M=>{F(M)},U=M=>{if(M.preventDefault(),C(!1),c)return;const G=M.dataTransfer.files,V=Array.from(G);j(V)},Q=M=>{M.preventDefault(),!c&&C(!0)},we=()=>{C(!1)},z=d.useCallback(M=>{var V;c||M.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog")||(V=f.current)==null||V.click()},[c]);return o.jsxs("div",{onDrop:U,onDragOver:Q,onDragLeave:we,onClick:z,className:pe("pkt-fileupload__drop-zone",{"pkt-fileupload__drop-zone--drag-active":$,"pkt-fileupload__drop-zone--disabled":c}),children:[o.jsx("input",{...g,id:s,type:"file",ref:f,multiple:e,onChange:O,accept:k,disabled:c,name:r==="form"&&i||void 0,"aria-label":e?"Velg filer":"Velg fil"}),r==="custom"&&o.jsx(o.Fragment,{children:t==null?void 0:t.map(M=>o.jsx("input",{type:"hidden",name:i,value:M.fileId},M.fileId))}),o.jsxs("div",{className:"pkt-fileupload__drop-zone__placeholder",children:[o.jsx(te,{name:"attachment",className:"pkt-fileupload__drop-zone__placeholder__icon","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__drop-zone__placeholder__title",children:$?`${S.dropFilesHere} ...`:o.jsxs(o.Fragment,{children:[S.selectOrDragFiles," ",o.jsx("button",{className:"pkt-fileupload__drop-zone__placeholder__title__open-file-dialog",onClick:M=>{var G;M.preventDefault(),M.stopPropagation(),(G=f.current)==null||G.click()},type:"button",children:S.chooseFiles})]})}),o.jsxs("p",{className:"pkt-fileupload__drop-zone__placeholder__formats",children:["Format: ",b]})]})]})}),sg=s=>{const e=new DataTransfer;for(const t of s)e.items.add(t.file);return e.files},na=d.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,counter:n,counterMaxLength:i,className:r,disabled:a,errorMessage:l,hasError:c,helptext:h,helptextDropdown:g,helptextDropdownButton:m,inline:f,fullwidth:k=!1,label:b,name:$,optionalTag:C=!1,optionalText:S,requiredTag:T=!1,requiredText:F,tagText:O=null,placeholder:j,rows:U,useWrapper:Q=!0,onChange:we,value:z,autoComplete:M="off",minLength:G,maxLength:V,readOnly:ee,skipForwardTestid:le=!1,...ne},me)=>{const ve=[r,"pkt-textinput","pkt-textarea"].join(" "),fe=`${s}-input`,ce=`${fe}-label`,de=t||ce,[Xe,J]=d.useState(0),A=Le=>{var Be,ae;n&&J(((ae=(Be=Le.currentTarget)==null?void 0:Be.value)==null?void 0:ae.length)||0),we&&we(Le)};return d.useEffect(()=>{z!==void 0&&J((z==null?void 0:z.length)||0)},[z]),o.jsx(ws,{ariaDescribedby:e,className:ve,disabled:a,errorMessage:l,forId:fe,hasError:c,helptext:h,helptextDropdown:g,helptextDropdownButton:m,inline:f,label:b,optionalTag:C,optionalText:S,requiredTag:T,requiredText:F,tagText:O,useWrapper:Q,counter:n,counterCurrent:Xe,counterMaxLength:i,children:o.jsx("textarea",{ref:me,className:`pkt-input ${k?"pkt-input--fullwidth":""} ${i&&Xe>i?"pkt-input--counter-error":""}`,name:`${$||s}`,id:fe,placeholder:j,disabled:a,rows:U,"aria-labelledby":de,"aria-invalid":c,"aria-errormessage":`${s}-error`,...ne,onChange:A,value:z,autoComplete:M,minLength:G,maxLength:V,readOnly:ee,"data-skip-forward-testid":le?"true":void 0})})});na.displayName="PktTextarea";const ng=Symbol("comment"),ig=s=>{const e=String(s.getDate()).padStart(2,"0"),t=String(s.getMonth()+1).padStart(2,"0"),n=s.getFullYear(),i=String(s.getHours()).padStart(2,"0"),r=String(s.getMinutes()).padStart(2,"0");return`${e}.${t}.${n} kl. ${i}:${r}`},rg=({fileItem:s,closeOperationUi:e,onAddComment:t,existingComment:n})=>{const i=d.useRef(null),r=!!n,a=()=>{var c,h;const l=(h=(c=i.current)==null?void 0:c.value)==null?void 0:h.trim();l&&t({text:l,timestamp:new Date}),e()};return d.useLayoutEffect(()=>{const l=setTimeout(()=>{var c;return(c=i.current)==null?void 0:c.focus({preventScroll:!0})},0);return()=>clearTimeout(l)},[s.fileId]),o.jsxs(o.Fragment,{children:[o.jsx(na,{autoFocus:!0,label:r?"Rediger kommentar":"Legg til kommentar",name:`comment-${s.fileId}`,className:"pkt-fileupload__queue-display__item__comment-input",placeholder:"Skriv inn kommentar",rows:2,id:`comment-${s.fileId}`,ref:i,defaultValue:n==null?void 0:n.text}),o.jsx(_t,{skin:"secondary",size:"small",onClick:a,children:r?"Lagre kommentar":"Legg til kommentar"}),o.jsx(_t,{skin:"tertiary",size:"small",onClick:e,children:"Avbryt"})]})},ag=({comments:s,onDeleteComment:e,onEditComment:t})=>s&&s.length>0?o.jsx("div",{className:"pkt-fileupload__queue-display__item__comments",children:s.map((n,i)=>o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment",children:[o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__content",children:[o.jsx("span",{className:"pkt-fileupload__queue-display__item__comment__text","aria-label":"Kommentar tekst",children:n.text}),o.jsx("time",{className:"pkt-fileupload__queue-display__item__comment__time",children:ig(n.timestamp)})]}),o.jsxs("div",{className:"pkt-fileupload__queue-display__item__comment__actions",children:[e&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>e(i),"aria-label":"Slett kommentar",children:o.jsx(te,{name:"trash-can"})}),t&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>t(i),"aria-label":"Rediger kommentar",children:o.jsx(te,{name:"edit"})})]})]},i))}):null,og=s=>{const e=d.useContext(sa);return o.jsx("input",{type:"hidden",name:`${e.name}-comments`,value:s.comments?JSON.stringify(s.comments):""})},lg=s=>{const e=s("comments"),t=(i,r)=>{e.set(i,[r])},n=(i,r)=>{const l=(e.get(i)||[]).filter((c,h)=>h!==r);e.set(i,l.length>0?l:void 0)};return{title:i=>{const r=e.get(i.fileId);return r&&r.length>0?"":"Legg til kommentar"},renderExtendedUI:(i,r)=>{const a=e.get(i.fileId),l=a==null?void 0:a[0];return o.jsx(rg,{fileItem:i,closeOperationUi:r,onAddComment:c=>t(i.fileId,c),existingComment:l})},renderContent:(i,r,a)=>{if(a)return null;const l=e.get(i.fileId);return o.jsx(ag,{comments:l,onDeleteComment:c=>n(i.fileId,c),onEditComment:r?()=>r():void 0})},renderHidden:i=>o.jsx(og,{comments:e.get(i.fileId)},`comments${i.fileId}`),symbol:ng}},cg=Symbol("deleteFile"),ug=s=>({title:"Slett",ariaLabel:"Slett fil",onClick:e=>s(e.fileId),symbol:cg}),dg=Symbol("renameFile"),hg=s=>{const e=d.useRef(null),t=d.useId(),n=()=>{var i;s.onSave(((i=e.current)==null?void 0:i.value)??"")};return o.jsxs(o.Fragment,{children:[o.jsx("label",{htmlFor:t,className:"pkt-sr-only",children:"Endre filnavn"}),o.jsx("input",{id:t,ref:e,type:"text",autoFocus:!0,defaultValue:s.value,className:"pkt-fileupload__queue-display__item__rename-input",onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),i.stopPropagation(),n()),i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),s.onCancel())}}),o.jsx(_t,{skin:"secondary",size:"small",onClick:()=>s.onSave(e.current.value),children:"Lagre"}),o.jsx(_t,{skin:"tertiary",size:"small",onClick:s.onCancel,children:"Avbryt"})]})},pg=s=>{const e=d.useContext(sa);return o.jsx("input",{type:"hidden",name:`${e.name}-targetFilename`,value:s.targetFilename})},fg=s=>{const e=s("targetFilename");return{title:"Rediger",ariaLabel:"Rediger filnavn",renderInlineUI:(t,n)=>o.jsx(hg,{value:e.get(t.fileId)||void 0,onSave:i=>{e.set(t.fileId,i),n()},onCancel:n}),renderHidden:t=>o.jsx(pg,{targetFilename:e.get(t.fileId)||t.file.name},`rename${t.fileId}`),symbol:dg}},mg=(s,e)=>{const t=d.useCallback((r,a,l)=>{const c=s.find(g=>g.fileId===r),h=c.attributes||{};c.attributes={...h,[a]:l},e(r,{attributes:c.attributes})},[e,s]),n=d.useCallback((r,a)=>(s.find(h=>h.fileId===r).attributes||{})[a],[s]);return{fileAttributes:d.useCallback(r=>({get:a=>n(a,r),set:(a,l)=>{t(a,r,l)}}),[n,t])}},gg=s=>{const[e,t]=d.useState(!1),[n,i]=d.useState(0),r=d.useRef(null),a=d.useCallback(h=>{var m;const g=s.findIndex(f=>f.fileId===h);g>=0&&(i(g),t(!0),(m=r.current)==null||m.showModal())},[s]),l=d.useCallback(()=>{var h;t(!1),(h=r.current)==null||h.close()},[]),c=d.useCallback(h=>{s.length!==0&&i(g=>h==="prev"?g<=0?s.length-1:g-1:g>=s.length-1?0:g+1)},[s.length]);return{isOpen:e,currentIndex:n,modalRef:r,open:a,close:l,navigate:c}},bg=s=>{const[e,t]=d.useState({}),n=d.useCallback(a=>{const l=e[a];if(l)return s.find(c=>c.symbol===l)},[e,s]),i=d.useCallback((a,l)=>{t(c=>({...c,[a]:l.symbol}))},[]),r=d.useCallback(a=>{t(l=>{const c={...l};return delete c[a],c})},[]);return{getActivated:n,activate:i,close:r}},ia=d.forwardRef(({children:s,className:e,open:t=!1,headingText:n="",hideCloseButton:i=!1,closeOnBackdropClick:r=!1,size:a="medium",removePadding:l=!1,closeButtonSkin:c="blue",variant:h="dialog",drawerPosition:g="right",transparentBackdrop:m=!1,onClose:f,...k},b)=>{const $=d.useRef(null),C=b||$,S=d.useCallback(()=>{var U,Q;(U=C.current)!=null&&U.open&&((Q=C.current)==null||Q.close(),f==null||f())},[C,f]);d.useEffect(()=>{const U=C.current;if(!U)return;const Q=new MutationObserver(()=>{U.open?document.body.classList.add("pkt-modal--open"):document.body.classList.remove("pkt-modal--open")});return Q.observe(U,{attributes:!0,attributeFilter:["open"]}),()=>Q.disconnect()},[C]),d.useEffect(()=>{var U,Q,we,z;t?(U=C.current)!=null&&U.open||(Q=C.current)==null||Q.showModal():(we=C.current)!=null&&we.open&&((z=C.current)==null||z.close())},[t,C]);const T=d.useCallback(U=>{r&&U.target===C.current&&S()},[r,C,S]),F=d.useCallback(()=>{f==null||f()},[f]),O=c==="blue",j=pe({"pkt-modal":!0,"pkt-modal--removePadding":l,"pkt-modal--noHeadingText":!n,"pkt-modal--noShadow":c==="yellow-filled","pkt-modal--transparentBackdrop":m,[`pkt-modal--${a}`]:a,[`pkt-modal__${h}`]:h,[`pkt-modal__drawer--${g}`]:h==="drawer"},e);return o.jsx("dialog",{...k,className:j,ref:C,"aria-labelledby":n?"pkt-modal__headingText":void 0,"aria-describedby":"pkt-modal__content",onClick:T,onClose:F,children:o.jsxs("div",{className:"pkt-modal__wrapper",children:[(n||!i)&&o.jsxs("div",{className:"pkt-modal__header",children:[o.jsx("div",{className:"pkt-modal__header-background"}),n?o.jsx("h1",{id:"pkt-modal__headingText",className:"pkt-modal__headingText pkt-txt-24",children:n}):o.jsx("div",{className:"pkt-modal__headingText"}),i?o.jsx("div",{className:"pkt-modal__noCloseButton"}):o.jsx("div",{className:pe("pkt-modal__closeButton",{[`pkt-modal__closeButton--${c}`]:!0}),children:o.jsx(_t,{onClick:S,"aria-label":"close",iconName:"close",variant:"icon-only",size:"medium",skin:O?"tertiary":"primary",children:"Lukk"})})]}),o.jsx("div",{className:"pkt-modal__container",children:o.jsx("div",{id:"pkt-modal__content",className:"pkt-modal__content pkt-txt-18-light",children:s})})]})})});ia.displayName="PktModal";const Il=2,kg=s=>{const e=window.getComputedStyle(s),t=parseFloat(e.lineHeight);if(!Number.isNaN(t)&&t>0)return t;const n=parseFloat(e.fontSize);return(!Number.isNaN(n)&&n>0?n:16)*1.2},vg=(s,e,t)=>{const n=e*t;return s.getBoundingClientRect().height>n+.5},Pl=d.createContext({tail:5}),fi=({children:s,tail:e,...t})=>{const n=s,i=d.useContext(Pl),r=e!==void 0?e:i.tail||0,a=s.length<=r+3?null:s.slice(-r),l=d.useRef(null),c=d.useRef(null),[h,g]=d.useState(!1),m=d.useCallback(()=>{const k=l.current,b=c.current;if(!k||!b)return;const $=kg(k);g(vg(b,$,Il))},[]),f=d.useMemo(()=>new ResizeObserver(k=>{k.some(b=>b.target===l.current)&&m()}),[m]);return d.useLayoutEffect(()=>(l.current&&f.observe(l.current),m(),()=>f.disconnect()),[s,f,m]),o.jsxs("span",{ref:l,...t,"data-pkt-truncate-part":"wrapper",style:{maxWidth:"100%",width:"100%",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"end",columnGap:"0.25rem",overflow:"hidden",position:"relative",...t.style},children:[o.jsx("span",{"data-pkt-truncate-part":"first",style:{minWidth:0,display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Il,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",overflowWrap:"anywhere"},children:n}),r!==0&&o.jsx("span",{"data-pkt-truncate-part":"tail",style:{whiteSpace:"nowrap",display:h?"inline":"none",paddingRight:"0.5rem"},"aria-hidden":!0,children:a}),o.jsx("span",{ref:c,"aria-hidden":!0,"data-pkt-truncate-part":"measure",style:{position:"absolute",top:0,left:0,width:"100%",visibility:"hidden",pointerEvents:"none",whiteSpace:"normal",overflowWrap:"anywhere"},children:s})]})},yg=s=>{if(typeof s=="number")return s;const e=s.trim().match(/^(\d+(?:\.\d+)?)\s*(B|KB|MB|GB)$/i);if(!e)return console.warn(`PktFileUpload: Invalid maxFileSize format "${s}". Use format like "5MB", "500KB", or a number in bytes.`),0;const t=parseFloat(e[1]);switch(e[2].toUpperCase()){case"B":return t;case"KB":return t*1024;case"MB":return t*1024*1024;case"GB":return t*1024*1024*1024;default:return t}},nr=s=>s<1024?`${s} B`:s<1024*1024?`${Math.round(s/1024)} KB`:s<1024*1024*1024?`${Math.round(s/(1024*1024))} MB`:`${Math.round(s/(1024*1024*1024))} GB`,ra=s=>o.jsx("button",{onClick:s.onClick,className:"pkt-fileupload__queue-display__item__cancel-button","aria-label":s.ariaLabel||"Avbryt opplasting",children:s.label||"Avbryt"}),_g=()=>{const[s,e]=d.useState(1);return d.useEffect(()=>{const t=setInterval(()=>{e(n=>n>=3?1:n+1)},400);return()=>clearInterval(t)},[]),o.jsxs("span",{className:"pkt-fileupload__queue-display__item__loading-text","aria-label":"Laster opp fil",children:["Laster opp",".".repeat(s)]})},wg=({cancelTransfer:s,transferItem:e})=>{const t=e.showProgress??e.progress!==0;return o.jsxs(o.Fragment,{children:[o.jsx(te,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title","aria-label":"Filnavn",children:o.jsx(fi,{children:e.attributes.targetFilename})}),o.jsx(ra,{onClick:s}),t?o.jsxs(o.Fragment,{children:[o.jsx(or,{valueCurrent:e.progress*100,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:nr(e.file.size)}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__percentage","aria-hidden":"true",children:`${Math.round(e.progress*100)}%`})]}):o.jsx(_g,{})]})},$g=({transferItem:s,onRemove:e})=>{const t=(s.lastProgress??1)*100;return o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(fi,{children:s.attributes.targetFilename})}),o.jsx(ra,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),o.jsx(or,{valueCurrent:t,statusType:"none",valueMax:100,statusPlacement:"following",className:"pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:nr(s.file.size)}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]})},xg=({transferItem:s,onRemove:e})=>o.jsxs(o.Fragment,{children:[o.jsx(te,{className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium",name:"alert-error","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(fi,{children:s.attributes.targetFilename})}),o.jsx(ra,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]}),Sg=({transferItem:s,onRemove:e})=>s.showProgress?o.jsx($g,{transferItem:s,onRemove:e}):o.jsx(xg,{transferItem:s,onRemove:e}),Cg=({operation:s,onActivate:e,transferItem:t})=>{const n=typeof s.title=="function"?s.title(t):s.title;if(!n)return null;const i=()=>{(s.renderInlineUI||s.renderExtendedUI)&&e(t.fileId,s),s.onClick&&s.onClick(t)};return o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__operation",onClick:i,"aria-label":typeof s.ariaLabel=="function"?s.ariaLabel(t):s.ariaLabel,children:n})},Ll=({transferItem:s})=>o.jsxs(o.Fragment,{children:[o.jsx(te,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__queue-display__item__title",children:o.jsx(fi,{children:s.attributes.targetFilename})}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:nr(s.file.size)})]}),Tg=({transferItem:s,onPreviewClick:e})=>{const[t,n]=d.useState(null),[i,r]=d.useState(!1),a=s.file;d.useEffect(()=>{if(r(!1),a.type.startsWith("image/")){const g=URL.createObjectURL(a);return n(g),()=>{URL.revokeObjectURL(g)}}n(null)},[a]);const l=t&&!i&&o.jsx("img",{src:t,alt:s.attributes.targetFilename,onError:()=>r(!0)})||o.jsx(te,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"}),c=!!e,h=!!t&&!i;return o.jsxs("div",{className:`pkt-fileupload__queue-display__item__thumbnail${h?"":" pkt-fileupload__queue-display__item__thumbnail--fallback"}`,children:[o.jsxs(_t,{className:"pkt-fileupload__queue-display__item__thumbnail__image-wrapper","aria-label":`Forhåndsvis bilde ${s.attributes.targetFilename}`,type:"button",skin:"secondary",onClick:e,children:[c&&o.jsx(te,{name:"expand",className:"pkt-fileupload__queue-display__item__thumbnail__expand-icon","aria-hidden":"true"}),l]}),o.jsx(fi,{className:"pkt-fileupload__queue-display__item__thumbnail__title",children:s.attributes.targetFilename})]})},Fl=d.forwardRef(({isOpen:s,images:e,currentIndex:t,onClose:n,onNavigate:i},r)=>{const[a,l]=d.useState(null),[c,h]=d.useState(!1),g=e[t],m=e.length>1;return d.useEffect(()=>{if(h(!1),g&&g.file.type.startsWith("image/")){const f=URL.createObjectURL(g.file);return l(f),()=>URL.revokeObjectURL(f)}l(null)},[g]),d.useEffect(()=>{if(!s)return;const f=k=>{switch(k.key){case"ArrowLeft":k.preventDefault(),i("prev");break;case"ArrowRight":k.preventDefault(),i("next");break;case"Escape":k.preventDefault(),n();break}};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[s,i,n]),g?o.jsx(ia,{ref:r,headingText:g.attributes.targetFilename,closeOnBackdropClick:!0,className:"pkt-fileupload__image-preview-modal",children:o.jsxs("div",{className:"pkt-fileupload__image-preview",children:[m&&o.jsx(_t,{variant:"icon-only",iconName:"chevron-thin-left",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev",onClick:()=>i("prev"),"aria-label":`Forrige bilde ${t} / ${e.length}`}),o.jsx("div",{className:"pkt-fileupload__image-preview__content",children:a&&!c?o.jsx("img",{src:a,alt:`${g.attributes.targetFilename} - ${t+1} av ${e.length}`,className:"pkt-fileupload__image-preview__image",onError:()=>h(!0)}):o.jsx(te,{name:"picture",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"})}),m&&o.jsxs("span",{className:"pkt-fileupload__image-preview__counter",children:[t+1," / ",e.length]}),m&&o.jsx(_t,{variant:"icon-only",iconName:"chevron-thin-right",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next",onClick:()=>i("next"),"aria-label":`Neste bilde ${t+2} / ${e.length}`})]})}):null});Fl.displayName="ImagePreviewModal";const Ng=s=>{var e;return(e=s.file.type)!=null&&e.startsWith("image/")?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(s.file.name||"")},aa=s=>typeof s=="number"?"in-progress":s==="error"?"error":"idle",Dg=({operations:s,activatedOperation:e,onActivate:t,transferItem:n})=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__actions",children:s.filter(i=>!e||i.symbol!==e.symbol).map(i=>o.jsx(Cg,{operation:i,onActivate:t,transferItem:n},i.symbol.toString()))}),Mg=({operations:s,activatedOperation:e,onActivate:t,transferItem:n})=>o.jsx(o.Fragment,{children:s.filter(i=>i.renderContent).map(i=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__operation-content",children:i.renderContent(n,()=>t(n.fileId,i),(e==null?void 0:e.symbol)===i.symbol)},i.symbol.toString()))}),Eg=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:n,onActivate:i,onClose:r,onPreviewClick:a})=>{const l=()=>r(s.fileId),h=(e==null?void 0:e.renderInlineUI)||(e==null?void 0:e.renderExtendedUI)?[]:t;return o.jsxs(o.Fragment,{children:[e!=null&&e.renderInlineUI?o.jsxs(o.Fragment,{children:[o.jsx(te,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon"}),o.jsx("div",{className:"pkt-fileupload__queue-display__item__inline-ui",children:e.renderInlineUI(s,l)})]}):o.jsx(n,{transferItem:s,queueItemOperations:t,onPreviewClick:a}),h.length>0&&o.jsx(Dg,{operations:h,activatedOperation:e,onActivate:i,transferItem:s}),o.jsx(Mg,{operations:t,activatedOperation:e,onActivate:i,transferItem:s}),(e==null?void 0:e.renderExtendedUI)&&o.jsx("div",{className:"pkt-fileupload__queue-display__item__expanded-operation-ui",children:e.renderExtendedUI(s,l)})]})},Og=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:n,enableImagePreview:i,onActivate:r,onClose:a,onCancelTransfer:l,onOpenPreview:c})=>{const h=aa(s.progress),g=i&&s.progress==="done"&&Ng(s);switch(h){case"in-progress":return o.jsx(wg,{"aria-live":"off",transferItem:s,cancelTransfer:()=>l(s.fileId)});case"error":return o.jsx(Sg,{transferItem:s,onRemove:()=>l(s.fileId)});case"idle":return o.jsx(Eg,{transferItem:s,activatedOperation:e,operations:t,ItemRenderer:n,onActivate:r,onClose:a,onPreviewClick:g?()=>c(s.fileId):void 0})}},Ag=s=>{var e;return(e=s.file.type)!=null&&e.startsWith("image/")?!0:/\.(jpe?g|png|gif|webp|heic|heif|bmp|svg)$/i.test(s.file.name||"")},Ig=(s,e,t)=>d.useMemo(()=>{const n=s.map(r=>{const a=e.find(l=>l.fileId===r.fileId);return{...r,progress:(a==null?void 0:a.progress)??(t==="form"?"done":"queued"),errorMessage:a==null?void 0:a.errorMessage,showProgress:a==null?void 0:a.showProgress,lastProgress:a==null?void 0:a.lastProgress}}),i={"in-progress":0,error:1,idle:2};return n.sort((r,a)=>i[aa(r.progress)]-i[aa(a.progress)])},[s,e,t]),Pg=(s,e)=>d.useMemo(()=>e?s.filter(t=>t.progress==="done"&&Ag(t)):[],[s,e]),Lg=({files:s,cancelTransfer:e,transfers:t=[],queueItemOperations:n=[],ItemRenderer:i=Ll,truncateTail:r,enableImagePreview:a=!1,uploadStrategy:l="form"})=>{const c=Ig(s,t,l),h=Pg(c,a),g=bg(n),m=gg(h);return o.jsxs(o.Fragment,{children:[o.jsx("ul",{className:"pkt-fileupload__queue-display",children:o.jsx(Pl.Provider,{value:{tail:r},children:c.map(f=>o.jsxs("li",{className:pe("pkt-fileupload__queue-display__item",{"pkt-fileupload__queue-display__item--in-progress":typeof f.progress=="number",[`pkt-fileupload__queue-display__item--${f.progress}`]:typeof f.progress=="string"}),children:[n.filter(k=>k.renderHidden).map(k=>k.renderHidden(f)),o.jsx(Og,{transferItem:f,activatedOperation:g.getActivated(f.fileId),operations:n,ItemRenderer:i,enableImagePreview:a,onActivate:g.activate,onClose:g.close,onCancelTransfer:e,onOpenPreview:m.open})]},f.fileId))})}),a&&h.length>0&&o.jsx(Fl,{ref:m.modalRef,isOpen:m.isOpen,images:h,currentIndex:m.currentIndex,onClose:m.close,onNavigate:m.navigate})]})},oa={filename:Ll,thumbnail:Tg},Bl=d.forwardRef(({value:s,defaultValue:e,id:t="fileupload-id",multiple:n=!1,uploadStrategy:i="form",addCommentsEnabled:r=!1,renameFilesEnabled:a=!1,truncateTail:l,onFilesChanged:c,onFileUploadRequested:h,extraOperations:g=[],itemRenderer:m=oa.filename,fullWidth:f=!1,allowedFormats:k,formatErrorMessage:b,maxFileSize:$,sizeErrorMessage:C,onFileValidation:S,errorMessage:T,hasError:F=!1,disabled:O=!1,label:j,helptext:U,optionalTag:Q,requiredTag:we,enableImagePreview:z=!1,...M},G)=>{const V="transfers"in M?M.transfers:void 0,[ee,le]=d.useState(null),ne=F||!!ee,me=T||ee,ve=$?yg($):void 0,fe=d.useCallback(q=>{var se;if(k&&k.length>0){const ge=((se=q.name.split(".").pop())==null?void 0:se.toLowerCase())||"",R=q.type.toLowerCase();if(!k.some(Ve=>{const v=Ve.toLowerCase().replace(/^\./,"");if(v.includes("/")){if(v.endsWith("/*")){const p=v.replace("/*","");return R.startsWith(p+"/")}return R===v}return ge===v})){const Ve=k.join(", "),v=`Ugyldig filtype. Tillatte formater: ${Ve}`;return(b==null?void 0:b.replace("{formats}",Ve))||v}}if(ve&&q.size>ve){const ge=nr(ve),R=`Filen er for stor. Maks størrelse er ${ge}.`;return(C==null?void 0:C.replace("{maxSize}",ge))||R}return S?S(q):null},[k,b,ve,C,S]);s!==void 0&&e!==void 0&&console.warn("PktFileupload: Både value og defaultValue er angitt. Komponenten kan være enten 'controlled' eller 'uncontrolled', ikke begge deler. Bruk kun én av dem. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable"),s!==void 0&&c===void 0&&console.warn("PktFileupload: value-prop er angitt uten onFilesChanged-callback. Når en komponent er 'controlled', må endringer håndteres via en callback. Vennligst legg til onFilesChanged-callback for å håndtere endringer i fil-listen. Se https://react.dev/reference/react-dom/components/input#controlling-an-input-with-a-state-variable");const de=s!==void 0?s:e||[],Xe=typeof m=="string"?oa[m]:m,J=m==="thumbnail",A=typeof M.accept=="string"?M.accept.trim():void 0,Le=d.useMemo(()=>{if(!(!k||k.length===0))return k.map(q=>q.trim()).filter(Boolean).map(q=>{const se=q.toLowerCase();return se.includes("/")||se.startsWith(".")?se:`.${se}`}).join(", ")},[k]),Be=A||Le,ae=a&&!J,Ke=r&&!J,xe=d.useCallback(q=>{for(const ge of q){const R=fe(ge.file);if(R){le(R);return}}le(null);const se=n?[...de,...q]:[q[0]];c&&c(se),i==="custom"&&h&&q.forEach(ge=>{h==null||h(ge)})},[c,de,n,i,h,fe]),ke=d.useCallback((q,se)=>{const ge=de.map(R=>R.fileId===q?{...R,...se}:R);c&&c(ge)},[c,de]),oe=d.useCallback(q=>{var ge;const se=de.filter(R=>R.fileId!==q);c&&c(se),"onTransferCancelled"in M&&M.onTransferCancelled&&((ge=M.onTransferCancelled)==null||ge.call(M,q))},[c,de,M]),{fileAttributes:ue}=mg(de,ke),Me=d.useMemo(()=>[{op:fg,enabled:ae},{op:q=>lg(q),enabled:Ke}].filter(({enabled:q})=>q).map(({op:q})=>q).concat(...g),[ae,Ke]),Ie=d.useMemo(()=>({uploaded:`${t}-uploaded`,errors:`${t}-errors`}),[t]),{totalCount:Te,uploadedCount:P,failedCount:We}=d.useMemo(()=>{const q=de.length;if(!V)return{totalCount:q,uploadedCount:0,failedCount:0};let se=0,ge=0;for(const R of de){const je=V.find(Ve=>Ve.fileId===R.fileId);(je==null?void 0:je.progress)==="done"&&se++,(je==null?void 0:je.progress)==="error"&&ge++}return{totalCount:q,uploadedCount:se,failedCount:ge}},[de,V]),Pe=Te===1?"fil":"filer",W=o.jsx("div",{className:pe("pkt-fileupload",{"pkt-fileupload--full-width":f,"pkt-fileupload--error":ne,"pkt-fileupload--disabled":O}),"aria-disabled":O,...O?{inert:""}:{},children:o.jsxs(sa.Provider,{value:{name:M.name||"",multiple:!!n,id:t},children:[o.jsx("div",{id:Ie.uploaded,className:"pkt-sr-only","aria-live":"polite","aria-atomic":"true",children:Te>0&&P>0&&`${P} av ${Te} ${Pe} lastet opp`}),o.jsx("div",{id:Ie.errors,className:"pkt-sr-only","aria-live":"assertive","aria-atomic":"true",children:Te>0&&We>0&&`Feil ved opplasting: ${We} av ${Te} ${Pe} feilet`}),o.jsx(tg,{id:t,name:M.name||"",value:de,onFilesAdded:xe,multiple:n,uploadStrategy:i,ref:G,accept:J?".jpeg, .jpg, .png, .gif, .webp, .heic":Be,isThumbnailView:J,disabled:O,srAnnouncementIds:Ie}),ne&&me&&o.jsx(Gi,{skin:"error","aria-live":"assertive",role:"alert",compact:!0,children:me}),o.jsx(Lg,{files:de,cancelTransfer:oe,truncateTail:l,transfers:V,uploadStrategy:i,ItemRenderer:Xe,enableImagePreview:J&&z,queueItemOperations:Me.map(q=>q(ue)).concat(ug(oe))})]})});return j?o.jsx(ws,{forId:t,label:j,helptext:U,disabled:O,hasError:ne,optionalTag:Q,requiredTag:we,className:pe("pkt-fileupload-wrapper",{"pkt-fileupload-wrapper--full-width":f}),children:W}):W});Bl.displayName="PktFileUpload";const Fg=({columnOne:s,columnTwo:e,socialLinks:t,className:n,openLinksInNewTab:i=!1,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:l=!1,hotjarId:c=null,googleAnalyticsId:h=null,devMode:g=!1,cookieDomain:m=null,cookieSecure:f=null,cookieExpiryDays:k=null,onToggleConsent:b=$=>{console.log($.detail)}})=>{var C,S;const $=[n,"pkt-footer"].filter(Boolean).join(" ");return o.jsx("footer",{className:$,"data-mode":"dark",children:o.jsxs("div",{className:"pkt-footer__container",children:[o.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:s.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&o.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((T,F)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${T.external?"pkt-link--external":""}`,href:T.href,target:T.openInNewTab||i?"_blank":"_self",rel:T.openInNewTab||i?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer__link-icon",name:"chevron-right"}),T.text]})},`links-${F}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:e.title}),o.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&o.jsx("li",{className:"pkt-footer__text",children:e.text}),(S=e.links)==null?void 0:S.map((T,F)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${T.external?"pkt-link--external":""}`,href:T.href,target:T.openInNewTab||i?"_blank":"_self",rel:T.openInNewTab||i?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer__link-icon",name:"chevron-right"}),T.text]})},`links-${F}`))]})]}),o.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[o.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),o.jsxs("ul",{className:"pkt-footer__list",children:[o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:r,target:i?"_blank":"_self",rel:i?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:"pkt-footer__link",href:a,target:i?"_blank":"_self",rel:i?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),l&&o.jsx("li",{className:"pkt-footer__list-item",children:o.jsx(tr,{triggerType:"footerlink",hotjarId:c,googleAnalyticsId:h,devMode:g,cookieDomain:m,cookieSecure:f,cookieExpiryDays:k,onToggleConsent:b})})]})]})]}),t&&o.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[o.jsx("div",{className:"pkt-footer__social-languages",children:t.filter(T=>T.language).map((T,F)=>o.jsx("div",{className:"pkt-footer__social-language",children:o.jsx("a",{href:T.href,"aria-label":`til ${T.language} versjon av nettsiden`,target:T.openInNewTab||i?"_blank":"_self",rel:T.openInNewTab||i?"noopener noreferrer":void 0,children:T.language})},`sociallinks-language-${F}`))}),o.jsx("div",{className:"pkt-footer__social-icons",children:t.filter(T=>T.iconName).map((T,F)=>o.jsx(d.Fragment,{children:o.jsx("a",{href:T.href,"aria-label":`til ${T.iconName}`,className:"pkt-footer__social-icon-link",target:T.openInNewTab||i?"_blank":"_self",rel:T.openInNewTab||i?"noopener noreferrer":void 0,children:o.jsx(te,{className:"pkt-footer__social-icon",name:T.iconName})})},`sociallinks-${F}`))})]})]})})},Bg=({links:s=[],openLinksInNewTab:e=!1,personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:n="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:i=!1,hotjarId:r=null,googleAnalyticsId:a=null,devMode:l=!1,cookieDomain:c=null,cookieSecure:h=null,cookieExpiryDays:g=null,onToggleConsent:m=k=>{console.log(k.detail)},className:f})=>{const k=[f,"pkt-footer-simple"].filter(Boolean).join(" ");return o.jsx("footer",{className:k,"data-mode":"dark",children:o.jsx("div",{className:"pkt-footer-simple__container",children:o.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((b,$)=>o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:`pkt-footer-simple__link ${b.external?" pkt-link--external":""}`,href:b.href,target:b.openInNewTab||e?"_blank":"_self",rel:b.openInNewTab||e?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),b.text]})},$)),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:t,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:"pkt-footer-simple__link",href:n,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(te,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),i&&o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsx(tr,{triggerType:"footerlink",hotjarId:r,googleAnalyticsId:a,devMode:l,cookieDomain:c,cookieSecure:h,cookieExpiryDays:g,onToggleConsent:m})})]})})})},Vg=(s,e)=>{const t=()=>typeof window>"u"?0:window.innerWidth,[n,i]=d.useState(t);return d.useEffect(()=>{const r=s.current;if(!r)return;if(i(r.offsetWidth),typeof ResizeObserver>"u"){const l=()=>{r&&i(r.offsetWidth)};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}const a=new ResizeObserver(l=>{for(const c of l)c.borderBoxSize&&c.borderBoxSize.length>0?i(c.borderBoxSize[0].inlineSize):i(c.contentRect.width)});return a.observe(r),()=>{a.disconnect()}},[s]),n};function Hg(s){const e=d.useRef(0);d.useEffect(()=>{const t=document.body,n=document.documentElement;if(s){e.current=window.scrollY||window.pageYOffset;const i=window.innerWidth-n.clientWidth;i>0&&(t.style.paddingRight=`${i}px`),t.style.position="fixed",t.style.top=`-${e.current}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",n.classList.add("is-scroll-locked")}else t.style.removeProperty("position"),t.style.removeProperty("top"),t.style.removeProperty("left"),t.style.removeProperty("right"),t.style.removeProperty("width"),t.style.removeProperty("overflow"),t.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current});return()=>{s&&(t.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:e.current}))}},[s])}const ir=({href:s,iconName:e,className:t,iconPosition:n,external:i,target:r,children:a,...l})=>{const c={"pkt-link":!0,"pkt-link--icon-left":!!e&&n==="left"||!!(e&&!n),"pkt-link--icon-right":!!e&&n==="right","pkt-link--external":i};return o.jsxs("a",{...l,className:pe(c,t),href:s,target:r,rel:i?"noopener noreferrer":void 0,children:[e&&o.jsx(te,{name:e,className:"pkt-link__icon"}),a]})};ir.displayName="PktLink";const Ug=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},rr=({item:s,className:e})=>"href"in s?o.jsx(ir,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:pe("pkt-user-menu__link",e),children:s.title}):o.jsxs("button",{className:pe("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",e),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&o.jsx(te,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),qg=({links:s})=>o.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((e,t)=>o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(rr,{item:e})},t))}),Vl=d.forwardRef(({user:s,formattedLastLoggedIn:e,representing:t,userMenu:n,canChangeRepresentation:i,changeRepresentation:r,logoutOnClick:a},l)=>{const c=n==null?void 0:n.map(Ug);return o.jsx("nav",{className:"pkt-user-menu",ref:l,"aria-label":"Meny for innlogget bruker",children:o.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),e&&o.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",o.jsx("time",{children:e})]})]}),c&&c.length>0&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(qg,{links:c})}),t&&o.jsxs("li",{className:"pkt-user-menu__item",children:[o.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),o.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:t.name}),t.orgNumber&&o.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",t.orgNumber]}),i&&r&&o.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(rr,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})]}),!t&&i&&r&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx("ul",{className:"pkt-user-menu__sublist",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(rr,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})}),a&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(rr,{item:{title:"Logg ut",iconName:"exit",onClick:a}})})]})})});Vl.displayName="PktHeaderUserMenu";const ar=d.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,autocomplete:n="off",counter:i,counterMaxLength:r,className:a,disabled:l=!1,errorMessage:c,hasError:h=!1,helptext:g,helptextDropdown:m,helptextDropdownButton:f,iconNameRight:k,inline:b=!1,fullwidth:$=!1,label:C,name:S,optionalTag:T=!1,optionalText:F,requiredTag:O=!1,requiredText:j,tagText:U=null,placeholder:Q,prefix:we,suffix:z,type:M="text",useWrapper:G=!0,omitSearchIcon:V=!1,value:ee,minLength:le,maxLength:ne,min:me,max:ve,step:fe,size:ce,readonly:de,required:Xe,dataTestid:J,onChange:A,skipForwardTestid:Le=!1,...Be},ae)=>{const Ke=[a,"pkt-textinput"].join(" "),xe=M==="search"&&!k&&!V,ke=M==="date"&&ee?ee.slice(0,10):ee,[oe,ue]=d.useState((ee==null?void 0:ee.length)||0),Me=`${s}`,Ie=`${Me}-label`,Te=t||Ie,P=We=>{var Pe,W;i&&ue(((W=(Pe=We.currentTarget)==null?void 0:Pe.value)==null?void 0:W.length)||0),A&&A(We)};return d.useEffect(()=>{ee!==void 0&&ue((ee==null?void 0:ee.length)||0)},[ee]),o.jsx(ws,{ariaDescribedby:e,className:Ke,disabled:l,errorMessage:c,forId:Me,hasError:h,helptext:g,helptextDropdown:m,helptextDropdownButton:f,inline:b,label:C,optionalTag:T,optionalText:F,requiredTag:O,requiredText:j,tagText:U,useWrapper:G,counter:i,counterCurrent:oe,counterMaxLength:r,children:o.jsxs("div",{className:"pkt-input__container","data-testid":J,"data-skip-forward-testid":Le?"true":void 0,children:[we&&o.jsx("div",{className:"pkt-input-prefix",children:we}),o.jsx("input",{...Be,ref:ae,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${r&&oe>r?"pkt-input--counter-error":""}`,type:M,name:`${S||s}`,value:ke,id:Me,placeholder:Q,autoComplete:n,disabled:l,"aria-invalid":h,"aria-errormessage":`${s}-error`,"aria-labelledby":Te,min:me,max:ve,onChange:P,step:fe,minLength:le,maxLength:ne,size:ce,readOnly:de,required:Xe}),z&&o.jsxs("p",{className:"pkt-input-suffix",children:[z,k&&o.jsx(te,{className:"pkt-input-suffix-icon",name:k}),xe&&o.jsx(te,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!z&&k&&o.jsx(te,{className:"pkt-input-icon",name:k}),!z&&xe&&o.jsx(te,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});ar.displayName="PktTextinput";const la=d.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:e=1280,children:t,className:n,compact:i=!1,"data-mode":r,logOutButtonPlacement:a="none",logOut:l,openedMenu:c,showSearch:h=!1,onSearch:g,onSearchChange:m,searchValue:f,searchPlaceholder:k="Søk",representing:b,serviceLink:$,serviceClick:C,serviceName:S,user:T,userMenu:F,userMenuFooter:O,userOptions:j,canChangeRepresentation:U=!1,changeRepresentation:Q,hideLogo:we=!1,logoLink:z,logoClick:M,position:G="fixed",scrollBehavior:V="hide",slotMenuVariant:ee="icon-only",slotMenuText:le="Meny"},ne)=>{const me=G==="fixed",ve=V==="hide";d.useEffect(()=>{O&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[O]),d.useEffect(()=>{j&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[j]),d.useEffect(()=>{T!=null&&T.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),b!=null&&b.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[T==null?void 0:T.shortname,b==null?void 0:b.shortname]);const fe=d.useMemo(()=>{if(T!=null&&T.lastLoggedIn)return typeof T.lastLoggedIn=="string"?T.lastLoggedIn:new Date(T.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[T==null?void 0:T.lastLoggedIn]),[ce,de]=d.useState(c||"none");d.useEffect(()=>{c!==void 0&&de(c)},[c]);const[Xe,J]=d.useState(!1),[A,Le]=d.useState(0),[Be,ae]=d.useState(!1),[Ke,xe]=d.useState(!1),ke=d.useRef(null),oe=d.useRef(null),ue=d.useRef(null),Me=d.useRef(null),Ie=d.useRef(null),Te=d.useRef(null),P=d.useRef(null),We=d.useRef(!1),Pe=Vg(ke),W=Pe<s,q=Pe<e,se=d.useCallback(p=>{ke.current=p,typeof ne=="function"?ne(p):ne&&(ne.current=p)},[ne]);Hg(me&&W&&ce!=="none");const ge=d.useCallback((p,w)=>{const N=p.relatedTarget;let Y;switch(w){case"user":Y=oe;break;case"slot":Y=ue;break;case"search":Y=Me;break;default:return}const K=Y.current;K&&(!N||!K.contains(N))&&de("none")},[]),R=d.useCallback(()=>{We.current&&P.current&&document.contains(P.current)&&P.current.focus(),P.current=null,We.current=!1},[]);d.useEffect(()=>{const p=N=>{T&&ce==="user"&&!N.target.closest(".pkt-header-service__user-container")&&de("none"),ce==="slot"&&!N.target.closest(".pkt-header-service__slot-container")&&de("none"),ce==="search"&&!N.target.closest(".pkt-header-service__search-container")&&!N.target.closest(".pkt-header-service__search-input")&&de("none")},w=N=>{N.key==="Escape"&&ce!=="none"&&(N.preventDefault(),We.current=!0,de("none"))};if(ce!=="none")return document.addEventListener("mousedown",p),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",w)};R()},[ce,T,R]),d.useEffect(()=>{const p=()=>{if(ve){const w=window.pageYOffset||document.documentElement.scrollTop;if(w<0||Math.abs(w-A)<60)return;J(w>A),Le(w)}};return document&&window.addEventListener("scroll",p),()=>{document&&window.removeEventListener("scroll",p)}},[ve,A]);const je=d.useCallback(p=>{const w=p==="slot"?ue:Me,N=p==="slot"?Ie:Te;if(!w.current||!N.current||!q||W)return;const Y=w.current.getBoundingClientRect(),K=N.current.offsetWidth,ye=Y.left+K>window.innerWidth;p==="slot"?ae(ye):xe(ye)},[q,W]),Ve=d.useCallback(p=>{ce!=="none"?de("none"):(P.current=document.activeElement,de(p))},[ce]);d.useEffect(()=>{(ce==="slot"||ce==="search")&&requestAnimationFrame(()=>{je(ce)})},[ce,je]);const v=o.jsxs("header",{className:pe("pkt-header-service",i&&"pkt-header-service--compact",W&&"pkt-header-service--mobile",q&&"pkt-header-service--tablet",me&&"pkt-header-service--fixed",ve&&"pkt-header-service--scroll-to-hide",Xe&&"pkt-header-service--hidden",n),"data-mode":r,ref:se,children:[o.jsxs("div",{className:pe("pkt-header-service__logo-area",(!S||S==="")&&"pkt-header-service__logo-area--without-service"),children:[!we&&o.jsx("span",{className:"pkt-header-service__logo",children:z?o.jsx("a",{href:z,"aria-label":"Tilbake til forside",children:o.jsx(te,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/16.7/logos/"})}):M?o.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:M,children:o.jsx(te,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/16.7/logos/"})}):o.jsx(te,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/16.7/logos/"})}),S&&o.jsx("span",{className:"pkt-header-service__service-name",children:$?o.jsx(ir,{href:$,className:"pkt-header-service__service-link ",children:S}):C?o.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:C,children:S}):o.jsx("span",{className:"pkt-header-service__service-link",children:S})})]}),t||h||q&&l&&(a==="header"||a==="both")?o.jsxs("div",{className:"pkt-header-service__content",children:[o.jsxs("div",{className:pe("pkt-header-service__slot-container",ce==="slot"&&"is-open"),onBlur:p=>ge(p,"slot"),ref:ue,children:[q&&t&&o.jsx(_t,{skin:"secondary",variant:ee,iconName:"menu",size:W?"small":"medium",state:ce==="slot"?"active":"normal",onClick:()=>Ve("slot"),"aria-expanded":ce==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:le}),o.jsx("div",{className:pe("pkt-header-service__slot-content",Be&&"align-right"),id:"mobile-slot-menu",role:q?"menu":void 0,"aria-label":q?"Meny":void 0,ref:Ie,children:o.jsx("div",{className:"pkt-contents",children:t})})]}),h&&o.jsx(o.Fragment,{children:q?o.jsxs("div",{className:pe("pkt-header-service__search-container",ce==="search"&&"is-open"),onBlur:p=>ge(p,"search"),ref:Me,children:[o.jsx(_t,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:W?"small":"medium",onClick:()=>Ve("search"),state:ce==="search"?"active":"normal","aria-expanded":ce==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),o.jsx("div",{className:pe("pkt-header-service__mobile-menu",ce==="search"&&"is-open",Ke&&"align-right"),ref:Te,children:ce==="search"&&o.jsx(ar,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:f,autoFocus:!0,fullwidth:!0,onChange:p=>m==null?void 0:m(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(g==null||g(p.target.value))}})})]}):o.jsx(ar,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:f,onChange:p=>m==null?void 0:m(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(g==null||g(p.target.value))}})}),W&&l&&(a==="header"||a==="both")&&o.jsx(_t,{skin:"secondary",size:W?"small":"medium",variant:"icon-only",iconName:"exit",onClick:l,children:"Logg ut"})]}):null,(T||!W&&l&&(a==="header"||a==="both"))&&o.jsxs("div",{className:"pkt-header-service__user",children:[T&&o.jsxs("div",{className:"pkt-header-service__user-container",onBlur:p=>ge(p,"user"),ref:oe,children:[o.jsxs(_t,{className:pe("pkt-header-service__user-button",W&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:W?"small":"medium",state:ce==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:ce==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Ve("user"),children:[o.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||T.name]}),ce==="user"&&T&&o.jsx("div",{className:pe(W?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:o.jsx(Vl,{user:T,formattedLastLoggedIn:fe,representing:b,userMenu:F,canChangeRepresentation:U,changeRepresentation:Q,logoutOnClick:a==="userMenu"||a==="both"?l:void 0})})]}),!W&&l&&(a==="header"||a==="both")&&o.jsx(_t,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:l,children:"Logg ut"})]})]});return me?o.jsxs("div",{className:"pkt-header-service-wrapper",children:[v,o.jsx("div",{className:pe("pkt-header-service-spacer",i&&"pkt-header-service-spacer--compact",T&&"pkt-header-service-spacer--has-user",W&&"pkt-header-service-spacer--mobile",q&&"pkt-header-service-spacer--tablet")})]}):v});la.displayName="PktHeaderService";const Hl=d.forwardRef((s,e)=>o.jsx(la,{...s,ref:e}));Hl.displayName="PktHeader";const Wg=Dn({tagName:"pkt-heading",elementClass:Ks,react:d,displayName:"PktHeading"}),Ul=d.forwardRef(({children:s,...e},t)=>o.jsx(Wg,{"data-testid":"pkt-heading",...e,ref:t,children:s}));Ul.displayName="PktHeading";const jg=Dn({tagName:"pkt-helptext",elementClass:Ys,react:d,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),ql=d.forwardRef(({children:s,...e},t)=>o.jsx(jg,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ql.displayName="PktHelptext";const Wl=d.forwardRef(({label:s,id:e,children:t,...n},i)=>o.jsxs("div",{className:"pkt-form-group",children:[o.jsx("label",{htmlFor:e,className:"pkt-form-label",children:s}),o.jsx("input",{className:"pkt-form-input",id:e,...n,ref:i}),t]}));Wl.displayName="PktInput";const jl=({children:s,skin:e,title:t,href:n,iconName:i,openInNewTab:r,external:a,className:l,...c})=>{const h=["pkt-linkcard",e&&`pkt-linkcard--${e}`].filter(Boolean).join(" "),g=["pkt-linkcard__title",a&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return o.jsxs("a",{...c,href:n,className:pe(h,l),target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,children:[i&&o.jsx(te,{className:"pkt-link__icon",name:i}),t&&o.jsx("div",{className:pe(g),children:t}),o.jsx("div",{className:"pkt-linkcard__text",children:s})]})};jl.displayName="PktLinkCard";const zg=Dn({tagName:"pkt-loader",elementClass:cs,react:d,displayName:"PktLoader",events:{}}),zl=d.forwardRef(({children:s,...e},t)=>o.jsx(zg,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));zl.displayName="PktLoader";const Kl=({children:s,className:e,skin:t,title:n,compact:i,closable:r,onClose:a,...l})=>{const[c,h]=d.useState(!1),g={"pkt-messagebox":!0,"pkt-messagebox--compact":i,[`pkt-messagebox--${t}`]:t,"pkt-messagebox--closable":r,"pkt-hide":c},m=d.createRef(),f=d.useCallback(()=>{h(!0),a&&a()},[h,a]);return o.jsxs("div",{...l,className:pe(g,e),ref:m,children:[r&&o.jsx("div",{className:"pkt-messagebox__close",children:o.jsx("button",{onClick:f,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:o.jsx(te,{name:"close",className:"pkt-link__icon"})})}),n&&o.jsx("div",{className:"pkt-messagebox__title",children:n}),o.jsx("div",{className:"pkt-messagebox__text",children:s})]})};Kl.displayName="PktMessagebox";const Yl=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Kg=()=>{const s=Yl(),e=Yl();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)},or=d.forwardRef(({ariaLabel:s,ariaLabelledby:e,ariaLive:t="polite",ariaValueText:n,id:i,role:r="progressbar",skin:a="dark-blue",statusPlacement:l="following",statusType:c="none",title:h,titlePosition:g="left",valueCurrent:m=0,valueMax:f=100,valueMin:k=0,className:b,...$},C)=>{const S=d.useMemo(()=>Kg(),[]),T=i||S,F=d.useRef(null),[O,j]=d.useState(0);d.useEffect(()=>{F.current&&j(F.current.getBoundingClientRect().width||0)},[m]);const U=f-k,Q=Math.round(c==="fraction"?m/U*100:(m-k)/U*100),we=`${m} av ${U}`,z=c==="fraction"&&!n?`${m} av ${f-k}`:n||void 0,M=s?void 0:e||`${T}-title`;return o.jsx("div",{ref:C,id:T,role:r,"aria-live":t,"aria-atomic":"true","aria-valuenow":m,"aria-valuemin":k,"aria-valuemax":f,"aria-valuetext":z,"aria-label":s||void 0,"aria-labelledby":M,className:pe("pkt-progressbar",b),...$,children:o.jsxs("div",{className:"pkt-progressbar__container",style:{"--pkt-progress-label-width":`${O}px`,"--pkt-progress-width":`${Q}%`},children:[h&&o.jsx("p",{id:`${T}-title`,className:pe("pkt-progressbar__title",{"pkt-progressbar__title-center":g==="center"}),children:h}),o.jsx("div",{className:"pkt-progressbar__bar-wrapper",children:o.jsx("div",{className:pe("pkt-progressbar__bar",`pkt-progressbar__bar--${a}`)})}),c!=="none"&&o.jsx("div",{className:pe("pkt-progressbar__status",{"pkt-progressbar__status--center":l==="center"}),children:o.jsx("span",{ref:F,className:pe({"pkt-progressbar__status-placement--following":l==="following","pkt-progressbar__status-placement--center":l==="center","pkt-progressbar__status-placement--left":l==="left"}),children:c==="percentage"?`${Q}%`:we})})]})})});or.displayName="PktProgressbar";const Gl=d.forwardRef(({id:s,name:e,label:t,className:n,hasTile:i=!1,disabled:r=!1,checkHelptext:a,hasError:l=!1,defaultChecked:c,checked:h,optionalTag:g,optionalText:m,requiredTag:f,requiredText:k,tagText:b,...$},C)=>{const S=[n,"pkt-input-check"].filter(Boolean).join(" "),T=["pkt-input-check__input",i?"pkt-input-check__input--tile":"",r&&i?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),F=["pkt-input-check__input-checkbox",l?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),O=["pkt-input-check__input-label",r?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),j=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),U=()=>o.jsxs(o.Fragment,{children:[b&&o.jsx("span",{className:j+" pkt-tag--gray",children:b}),g&&o.jsx("span",{className:j+" pkt-tag--blue-light",children:m}),f&&o.jsx("span",{className:j+" pkt-tag--beige",children:k})]});return o.jsx("div",{className:S,children:o.jsxs("div",{className:T,children:[o.jsx("input",{ref:C,id:s,type:"radio",name:e,disabled:r,className:F,...h!==void 0?{checked:h}:{defaultChecked:c},...$}),o.jsxs("label",{className:O,htmlFor:s,children:[t," ",U(),a&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});Gl.displayName="PktRadioButton";const Xl=d.forwardRef(({appearance:s="local",disabled:e=!1,fullwidth:t=!1,id:n,label:i,name:r,placeholder:a="Søk…",suggestions:l,value:c="",action:h,method:g,onChange:m,onSearch:f,onSuggestionClick:k,...b},$)=>{const C=(O,j)=>{O?O():k&&k(j)},S=O=>{c=O.target.value},T=`pkt-searchinput pkt-searchinput--${s} ${t?"pkt-searchinput--fullwidth":""}`;let F;return h?F=O=>o.jsx("form",{role:"search",className:T,action:h,method:g,children:O}):F=O=>o.jsx("div",{role:"search",className:T,children:O}),F(o.jsxs(o.Fragment,{children:[i&&o.jsx("label",{htmlFor:i?n:void 0,className:i?"pkt-inputwrapper__label":"",children:i}),o.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[o.jsx("input",{className:`pkt-input ${t?"pkt-input--fullwidth":""}`,type:"search",name:r||n,id:n,placeholder:a,defaultValue:c,disabled:e,autoComplete:"off","aria-autocomplete":"list",ref:$,"aria-controls":`${n}-suggestions`,onChange:m||S,onKeyUp:f&&(O=>{O.key==="Enter"&&(O.preventDefault(),f(c))}),...b}),o.jsx(_t,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:e,onClick:f&&(O=>{O.preventDefault(),f(c)}),children:i||a})]}),l&&o.jsx("ul",{id:`${n}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:l.map((O,j)=>o.jsx("li",{children:d.createElement(O.href?"a":O.onClick?"button":"div",{href:O.href,className:`pkt-searchinput__suggestion ${O.onClick?"pkt-link-button":""} ${O.href||O.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:O.onClick?"button":void 0,onClick:()=>C(O.onClick,j),onKeyUp:U=>U.key==="Enter"&&C(O.onClick,j)},o.jsxs(o.Fragment,{children:[O.title&&o.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:O.title}),O.text&&o.jsx("p",{className:"pkt-searchinput__suggestion-text",children:O.text})]}))},`search-suggestion-${j}`))})]}))});Xl.displayName="PktSearchInput";const Ql=d.forwardRef(({ariaDescribedby:s,ariaLabelledby:e,children:t,className:n,disabled:i=!1,errorMessage:r,hasError:a,helptext:l,helptextDropdown:c,helptextDropdownButton:h,id:g,inline:m=!1,fullwidth:f=!1,label:k,name:b,optionalTag:$=!1,optionalText:C,requiredTag:S=!1,requiredText:T,tagText:F,...O},j)=>{const U=[n,"pkt-select"].join(" ");return o.jsx(ws,{className:U,forId:`${g}-input`,label:k,helptext:l,helptextDropdown:c,helptextDropdownButton:h,optionalTag:$,optionalText:C,requiredTag:S,requiredText:T,tagText:F,hasError:a,errorMessage:r,disabled:i,inline:m,ariaDescribedby:s,children:o.jsx("select",{ref:j,className:`pkt-input ${f?"pkt-input--fullwidth":""}`,"aria-invalid":a,"aria-errormessage":`${g}-error`,"aria-labelledby":e||void 0,disabled:i,id:`${g}-input`,name:b||g,...O,children:t})})});Ql.displayName="PktSelect";const Yg=o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:o.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),Gg=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),o.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),Xg=o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[o.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),o.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),Qg=({children:s,className:e,status:t="incomplete",title:n})=>o.jsxs("li",{className:pe("pkt-step",e,`pkt-step--${t}`),"data-testid":"pkt-step",children:[o.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),o.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),o.jsx("span",{className:pe("pkt-step__indicator"),children:t==="current"?Gg:t==="completed"?Xg:Yg}),o.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),o.jsxs("div",{className:"pkt-step__wrapper",children:[o.jsx("div",{className:"pkt-step__title",children:n}),o.jsx("div",{className:"pkt-step__content",children:s})]})]}),Zl=d.forwardRef(({activeStep:s,className:e,children:t,hideNonActiveSteps:n=!1,hideNonActiveStepsContent:i=!0,orientation:r="vertical",...a},l)=>{const c=pe(e,"pkt-stepper",r==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),h=d.Children.map(t,(g,m)=>d.isValidElement(g)?d.cloneElement(g,{className:pe(g.props.className,{"pkt-step--hideStep":n&&m!==s,"pkt-step--hideContent":i&&m!==s})}):g);return o.jsx("ol",{"data-testid":"pkt-stepper",className:c,ref:l,...a,children:h})});Zl.displayName="PktStepper";const Zg=({className:s,compact:e=!1,skin:t="basic",responsiveView:n=!0,children:i,...r})=>o.jsx("table",{"data-testid":"pkt-table",className:pe(s,"pkt-table",{"pkt-table--responsive":n,"pkt-table--compact":e,"pkt-table--basic":t==="basic","pkt-table--zebra-blue":t==="zebra-blue"}),role:"table",...r,children:i}),Jg=({id:s,children:e,className:t,...n})=>o.jsx("tbody",{id:s,className:pe(t,"pkt-table__body",{}),...n,role:"rowgroup",children:e}),Rg=({children:s,className:e,dataLabel:t,...n})=>o.jsx("td",{className:pe(e,"pkt-table__data-cell",{}),"data-label":t,role:"cell","data-testid":"pkt-table__data-cell",...n,children:s}),eb=({className:s,children:e,...t})=>o.jsx("thead",{className:pe(s,"pkt-table__header",{}),role:"rowgroup",...t,children:e}),tb=({className:s,children:e,...t})=>o.jsx("th",{className:pe(s,"pkt-table__header-cell",{}),role:"columnheader",...t,children:e}),sb=({className:s,children:e,...t})=>o.jsx("tr",{className:pe(s,"pkt-table__row",{}),role:"row",...t,children:e}),ca=d.forwardRef(({children:s,active:e,href:t,onClick:n,icon:i,controls:r,tag:a,tagSkin:l,index:c=0},h)=>{const{arrowNav:g,registerTabRef:m,handleKeyPress:f,selectTab:k}=nb(),$={"aria-selected":g?!!e:void 0,"aria-controls":r,role:g?"tab":void 0,onKeyUp:S=>f(c,S),onClick:S=>{k(c),n==null||n(S)},tabIndex:e||!g?void 0:-1,ref:S=>{m(c,S),typeof h=="function"?h(S):h&&(h.current=S)}},C=o.jsxs(o.Fragment,{children:[i&&o.jsx(te,{name:i,className:"pkt-icon--small"}),s,a&&o.jsx(Ps,{skin:l,size:"small",children:a})]});return t?o.jsx("a",{...$,href:t,className:`pkt-tabs__link ${e?"active":""}`,children:C}):o.jsx("button",{...$,type:"button",className:`pkt-tabs__button pkt-link-button ${e?"active":""}`,children:C})});ca.displayName="PktTabItem";const Jl=d.createContext(null),nb=()=>{const s=d.useContext(Jl);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Rl=d.forwardRef(({arrowNav:s=!0,disableArrowNav:e=!1,tabs:t,onTabSelected:n,children:i},r)=>{const a=d.useRef([]),l=s&&!e,h=i&&d.Children.count(i)>0?d.Children.count(i):(t==null?void 0:t.length)||0;d.useEffect(()=>{a.current=a.current.slice(0,h)},[h]);const g=b=>{const $=t==null?void 0:t[b];$!=null&&$.action&&$.action(b),n&&n(b)},m=(b,$)=>{var C,S;l&&($.code==="ArrowLeft"&&b!==0&&((C=a.current[b-1])==null||C.focus()),$.code==="ArrowRight"&&b<h-1&&((S=a.current[b+1])==null||S.focus()),($.code==="ArrowDown"||$.code==="Space")&&g(b))},f=(b,$)=>{a.current[b]=$},k=t==null?void 0:t.map((b,$)=>{var C,S;return o.jsx(ca,{active:b.active,href:b.href,onClick:()=>g($),icon:b.icon,controls:b.controls,tag:(C=b.tag)==null?void 0:C.text,tagSkin:(S=b.tag)==null?void 0:S.skin,index:$,children:b.text},$)});return o.jsx(Jl.Provider,{value:{arrowNav:l,registerTabRef:f,handleKeyPress:m,selectTab:g},children:o.jsx("div",{className:"pkt-tabs",ref:r,children:o.jsx("div",{className:"pkt-tabs__list",role:l?"tablist":"navigation",children:i||k})})})});Rl.displayName="PktTabs";const ib={hours:"Timer",minutes:"Minutter",openPicker:"Åpne tidspunkt-velger",prevTime:"Forrige tidspunkt",nextTime:"Neste tidspunkt",selectTime:"Velg tidspunkt"},ua=s=>s?Math.max(1,Math.round(s/60)):1,rb=(s,e)=>{const t=s?parseInt(String(s).split(":")[0],10):0,n=e?parseInt(String(e).split(":")[0],10):23;return Array.from({length:n-t+1},(i,r)=>r+t)},ab=s=>{const e=ua(s);return Array.from({length:Math.floor(60/e)},(t,n)=>n*e)},ob=(s,e,t,n)=>{let a=s!==""?parseInt(s,10):t===1?0:23,l=e!==""?parseInt(e,10):t===1?0:Math.floor(59/n)*n;return l+=t*n,l>59?(l=0,a=(a+1)%24):l<0&&(l=Math.floor(59/n)*n,a=(a-1+24)%24),{hours:String(a).padStart(2,"0"),minutes:String(l).padStart(2,"0")}},ec=s=>/^\d{2}:\d{2}$/.test(s)&&parseInt(s.slice(0,2),10)<=23&&parseInt(s.slice(3),10)<=59,da=s=>{const[e,t]=s.split(":").map(Number);return e*60+t},tn={required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",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}."};function mi(s){if(s&&ec(s)){const[e,t]=s.split(":");return[e,t]}return["",""]}function tc(s,e){return`${String(parseInt(s,10)).padStart(2,"0")}:${String(parseInt(e,10)).padStart(2,"0")}`}function sc(s,e){const{required:t,min:n,max:i,step:r}=e;if(t&&!s)return{valid:!1,message:tn.required};if(!s)return{valid:!0};if(!ec(s))return{valid:!1,message:tn.invalid};const a=da(s),l=ua(r);return n&&a<da(String(n))?{valid:!1,message:tn.rangeUnderflowMin.replace("{min}",String(n))}:i&&a>da(String(i))?{valid:!1,message:tn.rangeOverflowMax.replace("{max}",String(i))}:r&&a%l!==0?{valid:!1,message:l===60?tn.timeStepMismatchHour:l===30?tn.timeStepMismatchHalfHour:tn.timeStepMismatch.replace("{step}",`${l}, ${l*2}, ${l*3}`)}:{valid:!0}}function lb(s){return s===3600||s<3600&&3600%s===0&&s%60===0}function cb(s,e){const{id:t,label:n,value:i,defaultValue:r,min:a,max:l,step:c=60,hidePicker:h=!1,stepArrows:g=!1,fullwidth:m=!1,name:f,disabled:k=!1,required:b=!1,helptext:$,helptextDropdown:C,helptextDropdownButton:S,hasError:T=!1,errorMessage:F,optionalTag:O=!1,optionalText:j,requiredTag:U=!1,requiredText:Q,tagText:we,inline:z=!1,useWrapper:M=!0,ariaDescribedby:G,strings:V,className:ee,onValueChange:le,onFocus:ne,onBlur:me}=s,ve=d.useMemo(()=>V??ib,[V]),fe=i!==void 0,ce=i!==void 0?i??"":r??"",de=d.useRef(ce),[Xe,J]=d.useState(()=>ce),A=fe?i??"":Xe,[Le,Be]=d.useState(()=>mi(i!==void 0?i:r)[0]),[ae,Ke]=d.useState(()=>mi(i!==void 0?i:r)[1]),xe=d.useRef(Le),ke=d.useRef(ae),oe=d.useCallback(E=>{xe.current=E,Be(E)},[]),ue=d.useCallback(E=>{ke.current=E,Ke(E)},[]),[Me,Ie]=d.useState(!1),[Te,P]=d.useState(!1),We=d.useRef(i);d.useEffect(()=>{if(!fe||i===We.current)return;We.current=i;const[E,H]=mi(i);oe(E),ue(H)},[i,fe,oe,ue]),d.useEffect(()=>{c!=null&&!lb(c)&&console.warn(`PktTimepicker: step="${c}" er ikke en gyldig verdi. Step må være et multiplum av 60 (hele minutter) eller nøyaktig 3600 (hel time).`)},[c]);const Pe=d.useRef(null),W=d.useRef(null),q=d.useRef(null),se=d.useRef(null),ge=d.useRef(null),R=d.useRef(null),je=d.useRef(0),Ve=d.useRef(-1),v=d.useRef(0),p=d.useRef(-1),[w,N]=d.useState(!1),Y=d.useMemo(()=>{var E;return(E=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:E.set},[]),K=d.useMemo(()=>ua(c),[c]),ye=d.useMemo(()=>rb(a,l),[a,l]),ot=d.useMemo(()=>ab(c),[c]),it=`${t}-hours`,Ye=`${t}-minutes`,Wt=`${t}-popup`,jt=`${t}-input`;d.useEffect(()=>{const E=Pe.current;if(!E)return;const H=sc(A,{required:b,min:a,max:l,step:c});E.setCustomValidity(H.valid?"":H.message??""),P(w&&!H.valid)},[A,b,a,l,c,w]);const Ee=d.useCallback(E=>{fe||J(E);const H=R.current;!H||!Y||(Y.call(H,E),H.dispatchEvent(new Event("input",{bubbles:!0})),le==null||le(E))},[fe,Y,le]),Ft=d.useCallback(()=>{const E=xe.current,H=ke.current;if(E!==""&&H!==""){const ie=tc(E,H);ie!==A&&Ee(ie)}else A!==""&&Ee("")},[A,Ee]),Qe=d.useCallback(()=>{var ie,D;const E=xe.current,H=ke.current;if(E!==""&&H!==""){const I=tc(E,H);I!==A?Ee(I):(ie=R.current)==null||ie.dispatchEvent(new Event("input",{bubbles:!0}))}else A!==""?Ee(""):(D=R.current)==null||D.dispatchEvent(new Event("input",{bubbles:!0}))},[A,Ee]),gt=d.useCallback(()=>{N(!0),Ft();const E=Pe.current,H=R.current;if(!E)return;const ie=(H==null?void 0:H.value)??"",D=sc(ie,{required:b,min:a,max:l,step:c});E.setCustomValidity(D.valid?"":D.message??"")},[Ft,b,a,l,c]);d.useEffect(()=>{const E=ge.current,H=E==null?void 0:E.closest("form");if(!H)return;const ie=I=>{const be=I;if(!be||!H.contains(be))return!1;const $e=be.closest('button, input[type="submit"], input[type="image"]');return!$e||!H.contains($e)?!1:$e instanceof HTMLButtonElement?$e.type!=="button"&&$e.type!=="reset":$e instanceof HTMLInputElement},D=I=>{ie(I.target)&&gt()};return H.addEventListener("pointerdown",D,!0),()=>H.removeEventListener("pointerdown",D,!0)},[gt]),d.useEffect(()=>{R.current&&(R.current.value=A)},[A]);const ut=d.useCallback(()=>{Ie(!1),Ft()},[Ft]);d.useLayoutEffect(()=>{var be;if(!Me)return;const E=se.current;if(!E)return;E.querySelectorAll(".pkt-timepicker-popup__col").forEach($e=>{const at=$e.querySelector(".pkt-timepicker-popup__option--selected");at&&at.scrollIntoView({block:"center"})});const ie=E.querySelectorAll(".pkt-timepicker-popup__col")[0];if(!ie)return;const D=ie.querySelector(".pkt-timepicker-popup__option--selected"),I=ie.querySelector(".pkt-timepicker-popup__option");(be=D||I)==null||be.focus()},[Me]),d.useEffect(()=>{if(!Me)return;const E=H=>{const ie=H.target;ge.current&&!ge.current.contains(ie)&&ut()};return document.addEventListener("click",E,!0),()=>document.removeEventListener("click",E,!0)},[Me,ut]);const Dt=d.useCallback(E=>{var $e;const H=se.current;if(!H)return;const ie=H.querySelectorAll(".pkt-timepicker-popup__col"),D=E==="hour"?ie[0]:ie[1];if(!D)return;const I=D.querySelector(".pkt-timepicker-popup__option--selected"),be=D.querySelector(".pkt-timepicker-popup__option");($e=I||be)==null||$e.focus()},[]),ps=d.useCallback((E,H)=>{const ie=String(E).padStart(2,"0");if(H==="hour")oe(ie),requestAnimationFrame(()=>Dt("minute"));else{ue(ie),Ie(!1);const D=xe.current;D!==""&&Ee(`${D}:${ie}`),requestAnimationFrame(()=>{var I;return(I=q.current)==null?void 0:I.focus()})}},[Ee,Dt,oe,ue]),rt=d.useCallback(E=>{const H=ob(xe.current,ke.current,E,K);oe(H.hours),ue(H.minutes),`${H.hours}:${H.minutes}`!==A&&Ee(`${H.hours}:${H.minutes}`)},[K,A,Ee,oe,ue]),sn=d.useCallback(E=>{var D,I,be,$e,at,Fe,lt;(D=Pe.current)==null||D.setCustomValidity("");const H=E.currentTarget,ie=ke.current;switch(E.key){case"ArrowUp":{E.preventDefault();const Oe=xe.current!==""?parseInt(xe.current,10):0,Rt=String((Oe+1)%24).padStart(2,"0");if(oe(Rt),ie!==""){const _=`${Rt}:${ie}`;_!==A?Ee(_):(I=R.current)==null||I.dispatchEvent(new Event("input",{bubbles:!0}))}break}case"ArrowDown":{E.preventDefault();const Oe=xe.current!==""?parseInt(xe.current,10):0,Rt=String((Oe-1+24)%24).padStart(2,"0");if(oe(Rt),ie!==""){const _=`${Rt}:${ie}`;_!==A?Ee(_):(be=R.current)==null||be.dispatchEvent(new Event("input",{bubbles:!0}))}break}case"ArrowRight":E.preventDefault(),($e=W.current)==null||$e.focus();break;case"Backspace":case"Delete":{E.preventDefault(),je.current=0,Ve.current=-1;const Oe=xe.current;Oe.length>0&&oe(Oe.slice(0,-1)),Qe();break}case"Tab":break;case"Enter":{E.preventDefault(),gt();const Oe=H.form;Oe?Oe.requestSubmit():H.blur();break}default:if(/^\d$/.test(E.key)){E.preventDefault();const Oe=parseInt(E.key,10);if(je.current===0){Ve.current=Oe;const Rt=String(Oe).padStart(2,"0");oe(Rt),je.current=1,(at=R.current)==null||at.dispatchEvent(new Event("input",{bubbles:!0})),Oe>=3&&(Ve.current=-1,je.current=0,Qe(),(Fe=W.current)==null||Fe.focus())}else{const Rt=Ve.current*10+Oe,_=Rt<=23?String(Rt).padStart(2,"0"):String(Oe).padStart(2,"0");oe(_),Ve.current=-1,je.current=0,Qe(),(lt=W.current)==null||lt.focus()}}else E.preventDefault()}},[A,Ee,oe,Qe,gt]),xs=d.useCallback(()=>{if(N(!0),xe.current!==""){const E=String(parseInt(xe.current,10)).padStart(2,"0");oe(E)}je.current=0,Ve.current=-1,Ft()},[oe,Ft]),nn=d.useCallback(E=>{var D,I,be,$e,at;(D=Pe.current)==null||D.setCustomValidity("");const H=E.currentTarget,ie=xe.current;switch(E.key){case"ArrowUp":{E.preventDefault();const Fe=ke.current!==""?parseInt(ke.current,10):0,lt=String((Fe+K)%60).padStart(2,"0");if(ue(lt),ie!==""){const Oe=`${ie}:${lt}`;Oe!==A?Ee(Oe):(I=R.current)==null||I.dispatchEvent(new Event("input",{bubbles:!0}))}break}case"ArrowDown":{E.preventDefault();const Fe=ke.current!==""?parseInt(ke.current,10):0,lt=String((Fe-K+60)%60).padStart(2,"0");if(ue(lt),ie!==""){const Oe=`${ie}:${lt}`;Oe!==A?Ee(Oe):(be=R.current)==null||be.dispatchEvent(new Event("input",{bubbles:!0}))}break}case"ArrowLeft":E.preventDefault(),($e=Pe.current)==null||$e.focus();break;case"Backspace":case"Delete":{E.preventDefault(),v.current=0,p.current=-1;const Fe=ke.current;Fe.length>0&&ue(Fe.slice(0,-1)),Qe();break}case"Tab":break;case"Enter":{E.preventDefault(),gt();const Fe=H.form;Fe?Fe.requestSubmit():H.blur();break}default:if(/^\d$/.test(E.key)){E.preventDefault();const Fe=parseInt(E.key,10);if(v.current===0){p.current=Fe;const lt=String(Fe).padStart(2,"0");ue(lt),v.current=1,(at=R.current)==null||at.dispatchEvent(new Event("input",{bubbles:!0})),Fe>=6&&(p.current=-1,v.current=0,Qe())}else{const lt=p.current*10+Fe,Oe=lt<=59?String(lt).padStart(2,"0"):String(Fe).padStart(2,"0");ue(Oe),p.current=-1,v.current=0,Qe()}}else E.preventDefault()}},[K,A,Ee,ue,Qe,gt]),Bt=d.useCallback(()=>{if(N(!0),ke.current!==""){const E=String(parseInt(ke.current,10)).padStart(2,"0");ue(E)}v.current=0,p.current=-1,Ft()},[ue,Ft]),Mt=d.useCallback(E=>{var $e;const H=document.activeElement,ie=H.closest(".pkt-timepicker-popup__col");if(!ie)return;const D=Array.from(ie.querySelectorAll(".pkt-timepicker-popup__option")),I=D.indexOf(H),be=at=>{if(!at)return;const Fe=parseInt(at.dataset.value??"0",10),lt=String(Fe).padStart(2,"0");H.dataset.type==="hour"?oe(lt):ue(lt),at.focus()};switch(E.key){case"ArrowDown":E.preventDefault(),be(D[Math.min(I+1,D.length-1)]);break;case"ArrowUp":E.preventDefault(),be(D[Math.max(I-1,0)]);break;case"Home":E.preventDefault(),be(D[0]);break;case"End":E.preventDefault(),be(D[D.length-1]);break;case"ArrowRight":if(E.preventDefault(),H.dataset.type==="hour"){const at=parseInt(H.dataset.value??"0",10);oe(String(at).padStart(2,"0")),requestAnimationFrame(()=>{var Fe;(Fe=se.current)==null||Fe.querySelectorAll(".pkt-timepicker-popup__col").forEach(lt=>{const Oe=lt.querySelector(".pkt-timepicker-popup__option--selected");Oe==null||Oe.scrollIntoView({block:"center"})}),Dt("minute")})}break;case"ArrowLeft":if(E.preventDefault(),H.dataset.type==="minute"){const at=parseInt(H.dataset.value??"0",10);ue(String(at).padStart(2,"0")),requestAnimationFrame(()=>{var Fe;(Fe=se.current)==null||Fe.querySelectorAll(".pkt-timepicker-popup__col").forEach(lt=>{const Oe=lt.querySelector(".pkt-timepicker-popup__option--selected");Oe==null||Oe.scrollIntoView({block:"center"})}),Dt("hour")})}break;case"Enter":case" ":E.preventDefault(),H.click();break;case"Escape":E.preventDefault(),ut(),($e=q.current)==null||$e.focus();break}},[ut,Dt,oe,ue]),Ls=d.useCallback(E=>{const H=se.current;if(!H)return;const ie=E.relatedTarget;(!ie||!H.contains(ie))&&ut()},[ut]),Tn=d.useCallback(E=>{const H=ge.current;if(!H)return;const ie=E.relatedTarget;ie&&H.contains(ie)||ne==null||ne(E)},[ne]),bi=d.useCallback(E=>{const H=ge.current;if(!H)return;const ie=E.relatedTarget;ie&&H.contains(ie)||me==null||me(E)},[me]),Jt=d.useCallback(()=>{k||(Me?ut():Ie(!0))},[k,Me,ut]);d.useImperativeHandle(e,()=>({get value(){var E;return((E=R.current)==null?void 0:E.value)??""},set value(E){const H=E??"";fe||J(H);const[ie,D]=mi(H);oe(ie),ue(D),R.current&&(R.current.value=H)},focus(){var E;(E=Pe.current)==null||E.focus()},blur(){var E;(E=Pe.current)==null||E.blur()}}),[fe,oe,ue]),d.useEffect(()=>{const E=ge.current,H=E==null?void 0:E.closest("form");if(!H)return;const ie=()=>{window.setTimeout(()=>{const D=de.current,[I,be]=mi(D);oe(I),ue(be),fe||J(D),R.current&&(R.current.value=D),Ie(!1),N(!1)},0)};return H.addEventListener("reset",ie),()=>H.removeEventListener("reset",ie)},[fe,oe,ue]);const ki=["pkt-timepicker",m?"pkt-timepicker--fullwidth":"",g?"pkt-timepicker--stepper":"",ee??""].filter(Boolean).join(" ");return{id:t,containerRef:ge,outerClasses:ki,strings:ve,label:n,disabled:k,required:b,helptext:$,helptextDropdown:C,helptextDropdownButton:S,hasError:T,isInvalid:Te,errorMessage:F,optionalTag:O,optionalText:j,requiredTag:U,requiredText:Q,tagText:we,inline:z,useWrapper:M,ariaDescribedby:G,hidePicker:h,stepArrows:g,min:a,max:l,step:c,hours:Le,minutes:ae,hoursId:it,minutesId:Ye,popupId:Wt,hiddenInputId:jt,name:f??t,isOpen:Me,hourOptions:ye,minuteOptions:ot,hoursInputRef:Pe,minutesInputRef:W,buttonRef:q,popupRef:se,changeInputRef:R,handleHoursKeydown:sn,handleHoursBlur:xs,handleMinutesKeydown:nn,handleMinutesBlur:Bt,handlePopupKeydown:Mt,handlePopupFocusOut:Ls,handleFocusIn:Tn,handleFocusOut:bi,handleOptionClick:ps,handleClockButtonClick:Jt,closePopup:ut,stepTimeDelta:rt,effectiveValue:A}}const nc=d.forwardRef((s,e)=>{const{onChange:t,onInput:n}=s,i=cb(s,e),r=i.strings.hours,a=i.strings.minutes,l=i.label?`${r}, ${i.label}`:r,c=i.label?`${a}, ${i.label}`:a,h=(f,k)=>{const b=String(f).padStart(2,"0"),$=k==="hour"?i.hours!==""?parseInt(i.hours,10):NaN:i.minutes!==""?parseInt(i.minutes,10):NaN,C=f===$;return o.jsx("button",{type:"button",className:["pkt-btn","pkt-btn--tertiary","pkt-btn--small","pkt-btn--label-only","pkt-timepicker-popup__option",C?"pkt-timepicker-popup__option--selected":""].filter(Boolean).join(" "),role:"option","aria-selected":C?"true":"false",tabIndex:C?0:-1,"data-type":k,"data-value":f,onClick:S=>{S.stopPropagation(),i.handleOptionClick(f,k)},children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:b})},`${k}-${f}`)},g=()=>o.jsxs("div",{ref:i.popupRef,className:"pkt-timepicker-popup",id:i.popupId,hidden:!i.isOpen,role:"group","aria-label":i.strings.selectTime,onKeyDown:i.handlePopupKeydown,onBlur:i.handlePopupFocusOut,children:[o.jsx("div",{className:"pkt-timepicker-popup__col",role:"listbox","aria-label":r,"aria-orientation":"vertical",children:i.hourOptions.map(f=>h(f,"hour"))}),o.jsx("div",{className:"pkt-timepicker-popup__col",role:"listbox","aria-label":a,"aria-orientation":"vertical",children:i.minuteOptions.map(f=>h(f,"minute"))})]}),m=()=>o.jsxs("div",{className:"pkt-input__container",onClick:f=>{var b;f.target.closest("button, input")||(b=i.hoursInputRef.current)==null||b.focus()},children:[i.stepArrows&&o.jsxs("button",{type:"button",className:"pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--prev","aria-label":i.strings.prevTime,disabled:i.disabled,onClick:()=>i.stepTimeDelta(-1),children:[o.jsx(te,{name:"chevron-thin-left"}),o.jsx("span",{className:"pkt-btn__text",children:i.strings.prevTime})]}),o.jsx("input",{ref:i.hoursInputRef,type:"text",inputMode:"numeric",maxLength:2,size:2,className:"pkt-input pkt-timepicker__input",id:i.hoursId,"data-min":"0","data-max":"23",value:i.hours,placeholder:"––","aria-label":l,role:"spinbutton","aria-invalid":i.hasError||i.isInvalid||void 0,"aria-valuemin":0,"aria-valuemax":23,"aria-valuenow":i.hours!==""?parseInt(i.hours,10):void 0,"aria-valuetext":i.hours!==""?`${i.hours} ${r.toLowerCase()}`:void 0,autoComplete:"off",disabled:i.disabled,onKeyDown:i.handleHoursKeydown,onBlur:i.handleHoursBlur,onFocus:f=>{f.currentTarget.select()},onChange:()=>{},onPaste:f=>f.preventDefault()}),o.jsx("span",{className:"pkt-timepicker__separator",children:":"}),o.jsx("input",{ref:i.minutesInputRef,type:"text",inputMode:"numeric",maxLength:2,size:2,className:"pkt-input pkt-timepicker__input",id:i.minutesId,"data-min":"0","data-max":"59",value:i.minutes,placeholder:"––","aria-label":c,role:"spinbutton","aria-invalid":i.hasError||i.isInvalid||void 0,"aria-valuemin":0,"aria-valuemax":59,"aria-valuenow":i.minutes!==""?parseInt(i.minutes,10):void 0,"aria-valuetext":i.minutes!==""?`${i.minutes} ${a.toLowerCase()}`:void 0,autoComplete:"off",disabled:i.disabled,onKeyDown:i.handleMinutesKeydown,onBlur:i.handleMinutesBlur,onFocus:f=>{f.currentTarget.select()},onChange:()=>{},onPaste:f=>f.preventDefault()}),i.hidePicker&&!i.stepArrows&&o.jsx(te,{className:"pkt-input-icon pkt-timepicker__icon",name:"clock","aria-hidden":!0}),!i.hidePicker&&!i.stepArrows&&o.jsxs("button",{ref:i.buttonRef,type:"button",className:"pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button","aria-label":i.strings.openPicker,"aria-haspopup":"listbox","aria-expanded":i.isOpen,"aria-controls":i.popupId,disabled:i.disabled,onClick:i.handleClockButtonClick,children:[o.jsx(te,{name:"clock"}),o.jsx("span",{className:"pkt-btn__text",children:i.strings.openPicker})]}),i.stepArrows&&o.jsxs("button",{type:"button",className:"pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-timepicker__button pkt-timepicker__button--next","aria-label":i.strings.nextTime,disabled:i.disabled,onClick:()=>i.stepTimeDelta(1),children:[o.jsx(te,{name:"chevron-thin-right"}),o.jsx("span",{className:"pkt-btn__text",children:i.strings.nextTime})]}),o.jsx("input",{ref:i.changeInputRef,type:"time",hidden:!0,name:i.name,id:i.hiddenInputId,disabled:i.disabled,tabIndex:-1,"aria-hidden":!0,onChange:t,onInput:n})]});return o.jsx("div",{ref:i.containerRef,className:i.outerClasses,onFocus:i.handleFocusIn,onBlur:i.handleFocusOut,children:o.jsx(ws,{forId:i.hoursId,label:i.label,disabled:i.disabled,hasError:i.hasError,inline:i.inline,optionalTag:i.optionalTag,optionalText:i.optionalText,requiredTag:i.requiredTag,requiredText:i.requiredText,useWrapper:i.useWrapper,ariaDescribedby:i.ariaDescribedby,errorMessage:i.errorMessage,helptext:i.helptext,helptextDropdown:i.helptextDropdown,helptextDropdownButton:i.helptextDropdownButton,tagText:i.tagText,children:!i.hidePicker&&!i.stepArrows?o.jsxs("div",{className:"pkt-timepicker__anchor",children:[m(),g()]}):m()})})});nc.displayName="PktTimepicker";var Sn=window.CustomEvent;(!Sn||typeof Sn=="object")&&(Sn=function(s,e){e=e||{};var t=document.createEvent("CustomEvent");return t.initCustomEvent(s,!!e.bubbles,!!e.cancelable,e.detail||null),t},Sn.prototype=window.Event.prototype);function ic(s,e){var t="on"+e.type.toLowerCase();return typeof s[t]=="function"&&s[t](e),s.dispatchEvent(e)}function ub(s){for(;s&&s!==document.body;){var e=window.getComputedStyle(s),t=function(n,i){return!(e[n]===void 0||e[n]===i)};if(e.opacity<1||t("zIndex","auto")||t("transform","none")||t("mixBlendMode","normal")||t("filter","none")||t("perspective","none")||e.isolation==="isolate"||e.position==="fixed"||e.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function gi(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function rc(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function db(s,e){for(var t=0;t<s.length;++t)if(s[t]===e)return!0;return!1}function ha(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function ac(s){var e=["button","input","keygen","select","textarea"],t=e.map(function(a){return a+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');var n=s.querySelector(t.join(", "));if(!n&&"attachShadow"in Element.prototype)for(var i=s.querySelectorAll("*"),r=0;r<i.length&&!(i[r].tagName&&i[r].shadowRoot&&(n=ac(i[r].shadowRoot),n));r++);return n}function oc(s){return s.isConnected||document.body.contains(s)}function lc(s){if(s.submitter)return s.submitter;var e=s.target;if(!(e instanceof HTMLFormElement))return null;var t=Ae.formSubmitter;if(!t){var n=s.target,i="getRootNode"in n&&n.getRootNode()||document;t=i.activeElement}return!t||t.form!==e?null:t}function hb(s){if(!s.defaultPrevented){var e=s.target,t=Ae.imagemapUseValue,n=lc(s);t===null&&n&&(t=n.value);var i=gi(e);if(i){var r=n&&n.getAttribute("formmethod")||e.getAttribute("method");r==="dialog"&&(s.preventDefault(),t!=null?i.close(t):i.close())}}}function cc(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",hb,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var e=new MutationObserver(this.maybeHideModal.bind(this));e.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var t=!1,n=(function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}).bind(this),i,r=function(a){if(a.target===s){var l="DOMNodeRemoved";t|=a.type.substr(0,l.length)===l,window.clearTimeout(i),i=window.setTimeout(n,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(a){s.addEventListener(a,r)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}cc.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&oc(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),Ae.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var e=document.createElement("div");this.dialog_.insertBefore(e,this.dialog_.firstChild),e.tabIndex=-1,e.focus(),this.dialog_.removeChild(e)}var t=document.createEvent("MouseEvents");t.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(t),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=ac(this.dialog_)),rc(document.activeElement),s&&s.focus()},updateZIndex:function(s,e){if(s<e)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=e},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!oc(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!Ae.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");ub(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,Ae.needsCentering(this.dialog_)?(Ae.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var e=new Sn("close",{bubbles:!1,cancelable:!1});ic(this.dialog_,e)}};var Ae={};if(Ae.reposition=function(s){var e=document.body.scrollTop||document.documentElement.scrollTop,t=e+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(e,t)+"px"},Ae.isInlinePositionSetByStylesheet=function(s){for(var e=0;e<document.styleSheets.length;++e){var t=document.styleSheets[e],n=null;try{n=t.cssRules}catch{}if(n)for(var i=0;i<n.length;++i){var r=n[i],a=null;try{a=document.querySelectorAll(r.selectorText)}catch{}if(!(!a||!db(a,s))){var l=r.style.getPropertyValue("top"),c=r.style.getPropertyValue("bottom");if(l&&l!=="auto"||c&&c!=="auto")return!0}}}return!1},Ae.needsCentering=function(s){var e=window.getComputedStyle(s);return e.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!Ae.isInlinePositionSetByStylesheet(s)},Ae.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new cc(s)},Ae.registerDialog=function(s){s.showModal||Ae.forceRegisterDialog(s)},Ae.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(e){this.forwardTab_=void 0,e.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(e){var t=[];e.forEach(function(n){for(var i=0,r;r=n.removedNodes[i];++i){if(r instanceof Element)r.localName==="dialog"&&t.push(r);else continue;t=t.concat(r.querySelectorAll("dialog"))}}),t.length&&s(t)}))},Ae.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},Ae.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},Ae.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,e=0,t;t=this.pendingDialogStack[e];++e)t.updateZIndex(--s,--s),e===0&&(this.overlay.style.zIndex=--s);var n=this.pendingDialogStack[0];if(n){var i=n.dialog.parentNode||document.body;i.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},Ae.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=gi(s);){for(var e=0,t;t=this.pendingDialogStack[e];++e)if(t.dialog===s)return e===0;s=s.parentElement}return!1},Ae.DialogManager.prototype.handleFocus_=function(s){var e=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(e)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),rc(e),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],n=t.dialog,i=n.compareDocumentPosition(e);return i&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e!==document.documentElement&&document.documentElement.focus()),!1}},Ae.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var e=new Sn("cancel",{bubbles:!1,cancelable:!0}),t=this.pendingDialogStack[0];t&&ic(t.dialog,e)&&t.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},Ae.DialogManager.prototype.checkDOM_=function(s){var e=this.pendingDialogStack.slice();e.forEach(function(t){s.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},Ae.DialogManager.prototype.pushDialog=function(s){var e=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=e?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},Ae.DialogManager.prototype.removeDialog=function(s){var e=this.pendingDialogStack.indexOf(s);e!==-1&&(this.pendingDialogStack.splice(e,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},Ae.dm=new Ae.DialogManager,Ae.formSubmitter=null,Ae.imagemapUseValue=null,window.HTMLDialogElement===void 0){var uc=document.createElement("form");if(uc.setAttribute("method","dialog"),uc.method!=="dialog"){var Cn=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(Cn){var pb=Cn.get;Cn.get=function(){return ha(this)?"dialog":pb.call(this)};var fb=Cn.set;Cn.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):fb.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",Cn)}}document.addEventListener("click",function(s){if(Ae.formSubmitter=null,Ae.imagemapUseValue=null,!s.defaultPrevented){var e=s.target;if("composedPath"in s){var t=s.composedPath();e=t.shift()||e}if(!(!e||!ha(e.form))){var n=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!n){if(!(e.localName==="input"&&e.type==="image"))return;Ae.imagemapUseValue=s.offsetX+","+s.offsetY}var i=gi(e);i&&(Ae.formSubmitter=e)}}},!1),document.addEventListener("submit",function(s){var e=s.target,t=gi(e);if(!t){var n=lc(s),i=n&&n.getAttribute("formmethod")||e.getAttribute("method");i==="dialog"&&s.preventDefault()}});var mb=HTMLFormElement.prototype.submit,gb=function(){if(!ha(this))return mb.call(this);var s=gi(this);s&&s.close()};HTMLFormElement.prototype.submit=gb}const bb=Object.freeze(Object.defineProperty({__proto__:null,default:Ae},Symbol.toStringTag,{value:"Module"}));X.FileItem=Al,X.ItemRenderers=oa,X.PktAccordion=ma,X.PktAccordionItem=Yo,X.PktAlert=Gi,X.PktBackLink=Xo,X.PktBreadcrumbs=Qo,X.PktButton=_t,X.PktCalendar=ea,X.PktCard=_l,X.PktCheckbox=wl,X.PktCombobox=Nl,X.PktConsent=tr,X.PktDatepicker=El,X.PktFileUpload=Bl,X.PktFooter=Fg,X.PktFooterSimple=Bg,X.PktHeader=Hl,X.PktHeaderService=la,X.PktHeading=Ul,X.PktHelptext=ql,X.PktIcon=te,X.PktInput=Wl,X.PktInputWrapper=ws,X.PktLink=ir,X.PktLinkCard=jl,X.PktLoader=zl,X.PktMessagebox=Kl,X.PktModal=ia,X.PktProgressbar=or,X.PktRadioButton=Gl,X.PktSearchInput=Xl,X.PktSelect=Ql,X.PktStep=Qg,X.PktStepper=Zl,X.PktTabItem=ca,X.PktTable=Zg,X.PktTableBody=Jg,X.PktTableDataCell=Rg,X.PktTableHeader=eb,X.PktTableHeaderCell=tb,X.PktTableRow=sb,X.PktTabs=Rl,X.PktTag=Ps,X.PktTextarea=na,X.PktTextinput=ar,X.PktTimepicker=nc,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));