@oslokommune/punkt-react 15.0.3 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/index.d.ts +173 -0
- package/dist/punkt-react.es.js +8216 -7134
- package/dist/punkt-react.umd.js +435 -435
- package/package.json +4 -4
- package/src/components/fileupload/DropZone.tsx +236 -0
- package/src/components/fileupload/FileUpload.test.tsx +584 -0
- package/src/components/fileupload/FileUpload.tsx +425 -0
- package/src/components/fileupload/QueueDisplay.test.tsx +222 -0
- package/src/components/fileupload/QueueDisplay.tsx +155 -0
- package/src/components/fileupload/QueueItemContent.tsx +200 -0
- package/src/components/fileupload/Subcomponents.tsx +363 -0
- package/src/components/fileupload/Truncate.test.tsx +256 -0
- package/src/components/fileupload/Truncate.tsx +137 -0
- package/src/components/fileupload/extensions/Comments.tsx +188 -0
- package/src/components/fileupload/extensions/Remove.tsx +10 -0
- package/src/components/fileupload/extensions/Rename.tsx +79 -0
- package/src/components/fileupload/hooks/index.ts +3 -0
- package/src/components/fileupload/hooks/useFileAttributes.ts +46 -0
- package/src/components/fileupload/hooks/useImagePreview.ts +42 -0
- package/src/components/fileupload/hooks/useOperationState.ts +30 -0
- package/src/components/fileupload/hooks.ts +4 -0
- package/src/components/fileupload/texts.ts +20 -0
- package/src/components/fileupload/types.ts +94 -0
- package/src/components/fileupload/utils.ts +56 -0
- package/src/components/index.ts +1 -0
- package/src/components/interfaces.ts +1 -0
package/dist/punkt-react.umd.js
CHANGED
|
@@ -33,108 +33,108 @@
|
|
|
33
33
|
return [];
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
(function(
|
|
36
|
+
(function(I,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):(I=typeof globalThis<"u"?globalThis:I||self,o(I["punkt-react"]={},I.ReactJsxRuntime,I.React,I.ReactRouterDOM))})(this,(function(I,o,h,jo){"use strict";var Rm=Object.defineProperty;var eg=(I,o,h)=>o in I?Rm(I,o,{enumerable:!0,configurable:!0,writable:!0,value:h}):I[o]=h;var bn=(I,o,h)=>eg(I,typeof o!="symbol"?o+"":o,h);const dr=h.createContext({}),qo=()=>h.useContext(dr),ur=h.forwardRef(({compact:s=!1,skin:e="borderless",ariaLabelledBy:t,children:i,name:n,className:r},a)=>{const l=["pkt-accordion",s&&"pkt-accordion--compact",e&&`pkt-accordion--${e}`,r].filter(Boolean).join(" ");return o.jsx(dr.Provider,{value:{name:n},children:o.jsx("div",{ref:a,className:l,"data-testid":"pkt-accordion","aria-labelledby":t||void 0,children:i})})});ur.displayName="PktAccordion";/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2018 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/const
|
|
40
|
+
*/const Wo=new Set(["children","localName","ref","style","className"]),hr=new WeakMap,pr=(s,e,t,i,n)=>{const r=n==null?void 0:n[e];r===void 0?(s[e]=t,t==null&&e in HTMLElement.prototype&&s.removeAttribute(e)):t!==i&&((a,l,d)=>{let p=hr.get(a);p===void 0&&hr.set(a,p=new Map);let m=p.get(l);d!==void 0?m===void 0?(p.set(l,m={handleEvent:d}),a.addEventListener(l,m)):m.handleEvent=d:m!==void 0&&(p.delete(l),a.removeEventListener(l,m))})(s,r,t)},It=({react:s,tagName:e,elementClass:t,events:i,displayName:n})=>{const r=new Set(Object.keys(i??{})),a=s.forwardRef(((l,d)=>{const p=s.useRef(new Map),m=s.useRef(null),v={},y={};for(const[k,g]of Object.entries(l))Wo.has(k)?v[k==="className"?"class":k]=g:r.has(k)||k in t.prototype?y[k]=g:v[k]=g;return s.useLayoutEffect((()=>{if(m.current===null)return;const k=new Map;for(const g in y)pr(m.current,g,l[g],p.current.get(g),i),p.current.delete(g),k.set(g,l[g]);for(const[g,$]of p.current)pr(m.current,g,void 0,$,i);p.current=k})),s.useLayoutEffect((()=>{var k;(k=m.current)==null||k.removeAttribute("defer-hydration")}),[]),v.suppressHydrationWarning=!0,s.createElement(e,{...v,ref:s.useCallback((k=>{m.current=k,typeof d=="function"?d(k):d!==null&&(d.current=k)}),[d])})}));return a.displayName=n??t.name,a};/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/const
|
|
45
|
-
\f\r]`,ni=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
46
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
44
|
+
*/const Hi=globalThis,Vi=Hi.trustedTypes,fr=Vi?Vi.createPolicy("lit-html",{createHTML:s=>s}):void 0,mr="$lit$",Rt=`lit$${Math.random().toFixed(9).slice(2)}$`,gr="?"+Rt,zo=`<${gr}>`,hs=document,si=()=>hs.createComment(""),ii=s=>s===null||typeof s!="object"&&typeof s!="function",yn=Array.isArray,Yo=s=>yn(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",kn=`[
|
|
45
|
+
\f\r]`,ni=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vr=/-->/g,br=/>/g,ps=RegExp(`>|${kn}(?:([^\\s"'>=/]+)(${kn}*=${kn}*(?:[^
|
|
46
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),yr=/'/g,kr=/"/g,_r=/^(?:script|style|textarea|title)$/i,Ko=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),b=Ko(1),ft=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),$r=new WeakMap,fs=hs.createTreeWalker(hs,129);function wr(s,e){if(!yn(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return fr!==void 0?fr.createHTML(e):e}const Go=(s,e)=>{const t=s.length-1,i=[];let n,r=e===2?"<svg>":e===3?"<math>":"",a=ni;for(let l=0;l<t;l++){const d=s[l];let p,m,v=-1,y=0;for(;y<d.length&&(a.lastIndex=y,m=a.exec(d),m!==null);)y=a.lastIndex,a===ni?m[1]==="!--"?a=vr:m[1]!==void 0?a=br:m[2]!==void 0?(_r.test(m[2])&&(n=RegExp("</"+m[2],"g")),a=ps):m[3]!==void 0&&(a=ps):a===ps?m[0]===">"?(a=n??ni,v=-1):m[1]===void 0?v=-2:(v=a.lastIndex-m[2].length,p=m[1],a=m[3]===void 0?ps:m[3]==='"'?kr:yr):a===kr||a===yr?a=ps:a===vr||a===br?a=ni:(a=ps,n=void 0);const k=a===ps&&s[l+1].startsWith("/>")?" ":"";r+=a===ni?d+zo:v>=0?(i.push(p),d.slice(0,v)+mr+d.slice(v)+Rt+k):d+Rt+(v===-2?l:k)}return[wr(s,r+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};let _n=class Vo{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,a=0;const l=e.length-1,d=this.parts,[p,m]=Go(e,t);if(this.el=Vo.createElement(p,i),fs.currentNode=this.el.content,t===2||t===3){const v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(n=fs.nextNode())!==null&&d.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(const v of n.getAttributeNames())if(v.endsWith(mr)){const y=m[a++],k=n.getAttribute(v).split(Rt),g=/([.?@])?(.*)/.exec(y);d.push({type:1,index:r,name:g[2],strings:k,ctor:g[1]==="."?Qo:g[1]==="?"?Zo:g[1]==="@"?Jo:ji}),n.removeAttribute(v)}else v.startsWith(Rt)&&(d.push({type:6,index:r}),n.removeAttribute(v));if(_r.test(n.tagName)){const v=n.textContent.split(Rt),y=v.length-1;if(y>0){n.textContent=Vi?Vi.emptyScript:"";for(let k=0;k<y;k++)n.append(v[k],si()),fs.nextNode(),d.push({type:2,index:++r});n.append(v[y],si())}}}else if(n.nodeType===8)if(n.data===gr)d.push({type:2,index:r});else{let v=-1;for(;(v=n.data.indexOf(Rt,v+1))!==-1;)d.push({type:7,index:r}),v+=Rt.length-1}r++}}static createElement(e,t){const i=hs.createElement("template");return i.innerHTML=e,i}};function Ps(s,e,t=s,i){var n,r;if(e===ft)return e;let a=i!==void 0?(n=t._$Co)==null?void 0:n[i]:t._$Cl;const l=ii(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,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=a:t._$Cl=a),a!==void 0&&(e=Ps(s,a._$AS(s,e.values),a,i)),e}let Xo=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:i}=this._$AD,n=((e==null?void 0:e.creationScope)??hs).importNode(t,!0);fs.currentNode=n;let r=fs.nextNode(),a=0,l=0,d=i[0];for(;d!==void 0;){if(a===d.index){let p;d.type===2?p=new Ui(r,r.nextSibling,this,e):d.type===1?p=new d.ctor(r,d.name,d.strings,this,e):d.type===6&&(p=new Ro(r,this,e)),this._$AV.push(p),d=i[++l]}a!==(d==null?void 0:d.index)&&(r=fs.nextNode(),a++)}return fs.currentNode=hs,n}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},Ui=class Uo{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,n){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.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=Ps(this,e,t),ii(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==ft&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Yo(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!==w&&ii(this._$AH)?this._$AA.nextSibling.data=e:this.T(hs.createTextNode(e)),this._$AH=e}$(e){var t;const{values:i,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=_n.createElement(wr(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)==null?void 0:t._$AD)===r)this._$AH.p(i);else{const a=new Xo(r,this),l=a.u(this.options);a.p(i),this.T(l),this._$AH=a}}_$AC(e){let t=$r.get(e.strings);return t===void 0&&$r.set(e.strings,t=new _n(e)),t}k(e){yn(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,n=0;for(const r of e)n===t.length?t.push(i=new Uo(this.O(si()),this.O(si()),this,this.options)):i=t[n],i._$AI(r),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},ji=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,n,r){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}_$AI(e,t=this,i,n){const r=this.strings;let a=!1;if(r===void 0)e=Ps(this,e,t,0),a=!ii(e)||e!==this._$AH&&e!==ft,a&&(this._$AH=e);else{const l=e;let d,p;for(e=r[0],d=0;d<r.length-1;d++)p=Ps(this,l[i+d],t,d),p===ft&&(p=this._$AH[d]),a||(a=!ii(p)||p!==this._$AH[d]),p===w?e=w:e!==w&&(e+=(p??"")+r[d+1]),this._$AH[d]=p}a&&!n&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Qo=class extends ji{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}},Zo=class extends ji{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}},Jo=class extends ji{constructor(e,t,i,n,r){super(e,t,i,n,r),this.type=5}_$AI(e,t=this){if((e=Ps(this,e,t,0)??w)===ft)return;const i=this._$AH,n=e===w&&i!==w||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==w&&(i===w||n);n&&this.element.removeEventListener(this.name,this,i),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)}},Ro=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Ps(this,e)}};const el={I:Ui},xr=Hi.litHtmlPolyfillSupport;xr==null||xr(_n,Ui),(Hi.litHtmlVersions??(Hi.litHtmlVersions=[])).push("3.3.1");const tl=(s,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let n=i._$litPart$;if(n===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=n=new Ui(e.insertBefore(si(),r),r,void 0,t??{})}return n._$AI(s),n};/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/const
|
|
50
|
+
*/const se=s=>(e,t)=>{t!==void 0?t.addInitializer((()=>{customElements.define(s,e)})):customElements.define(s,e)};/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2019 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const
|
|
54
|
+
*/const qi=globalThis,$n=qi.ShadowRoot&&(qi.ShadyCSS===void 0||qi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Sr=Symbol(),Cr=new WeakMap;let sl=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Sr)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($n&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Cr.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Cr.set(t,e))}return e}toString(){return this.cssText}};const il=s=>new sl(typeof s=="string"?s:s+"",void 0,Sr),nl=(s,e)=>{if($n)s.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const i=document.createElement("style"),n=qi.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=t.cssText,s.appendChild(i)}},Tr=$n?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return il(t)})(s):s;/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/const{is:
|
|
58
|
+
*/const{is:rl,defineProperty:al,getOwnPropertyDescriptor:ol,getOwnPropertyNames:ll,getOwnPropertySymbols:cl,getPrototypeOf:dl}=Object,As=globalThis,Nr=As.trustedTypes,ul=Nr?Nr.emptyScript:"",Mr=As.reactiveElementPolyfillSupport,ri=(s,e)=>s,Wi={toAttribute(s,e){switch(e){case Boolean:s=s?ul: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}},wn=(s,e)=>!rl(s,e),Dr={attribute:!0,type:String,converter:Wi,reflect:!1,useDefault:!1,hasChanged:wn};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),As.litPropertyMetadata??(As.litPropertyMetadata=new WeakMap);let Is=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=Dr){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 i=Symbol(),n=this.getPropertyDescriptor(e,i,t);n!==void 0&&al(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){const{get:n,set:r}=ol(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:n,set(a){const l=n==null?void 0:n.call(this);r==null||r.call(this,a),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Dr}static _$Ei(){if(this.hasOwnProperty(ri("elementProperties")))return;const e=dl(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ri("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ri("properties"))){const t=this.properties,i=[...ll(t),...cl(t)];for(const n of i)this.createProperty(n,t[n])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,n]of t)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const n=this._$Eu(t,i);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)t.unshift(Tr(n))}else e!==void 0&&t.push(Tr(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return nl(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 i;return(i=t.hostConnected)==null?void 0:i.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach((t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var i;const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const a=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:Wi).toAttribute(t,n.type);this._$Em=e,a==null?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){var i,n;const r=this.constructor,a=r._$Eh.get(e);if(a!==void 0&&this._$Em!==a){const l=r.getPropertyOptions(a),d=typeof l.converter=="function"?{fromAttribute:l.converter}:((i=l.converter)==null?void 0:i.fromAttribute)!==void 0?l.converter:Wi;this._$Em=a;const p=d.fromAttribute(t,l.type);this[a]=p??((n=this._$Ej)==null?void 0:n.get(a))??p,this._$Em=null}}requestUpdate(e,t,i){var n;if(e!==void 0){const r=this.constructor,a=this[e];if(i??(i=r.getPropertyOptions(e)),!((i.hasChanged??wn)(a,t)||i.useDefault&&i.reflect&&a===((n=this._$Ej)==null?void 0:n.get(e))&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:n,wrapped:r},a){i&&!(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||i||(t=void 0),this._$AL.set(e,t)),n===!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 n=this.constructor.elementProperties;if(n.size>0)for(const[r,a]of n){const{wrapped:l}=a,d=this[r];l!==!0||this._$AL.has(r)||d===void 0||this.C(r,void 0,a,d)}}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$EO)==null||e.forEach((n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)})),this.update(i)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach((i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)})),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){}};Is.elementStyles=[],Is.shadowRootOptions={mode:"open"},Is[ri("elementProperties")]=new Map,Is[ri("finalized")]=new Map,Mr==null||Mr({ReactiveElement:Is}),(As.reactiveElementVersions??(As.reactiveElementVersions=[])).push("2.1.1");/**
|
|
59
59
|
* @license
|
|
60
60
|
* Copyright 2017 Google LLC
|
|
61
61
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const
|
|
62
|
+
*/const hl={attribute:!0,type:String,converter:Wi,reflect:!1,hasChanged:wn},pl=(s=hl,e,t)=>{const{kind:i,metadata:n}=t;let r=globalThis.litPropertyMetadata.get(n);if(r===void 0&&globalThis.litPropertyMetadata.set(n,r=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),r.set(t.name,s),i==="accessor"){const{name:a}=t;return{set(l){const d=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,d,s)},init(l){return l!==void 0&&this.C(a,void 0,s,l),l}}}if(i==="setter"){const{name:a}=t;return function(l){const d=this[a];e.call(this,l),this.requestUpdate(a,d,s)}}throw Error("Unsupported decorator location: "+i)};function c(s){return(e,t)=>typeof t=="object"?pl(s,e,t):((i,n,r)=>{const a=n.hasOwnProperty(r);return n.constructor.createProperty(r,i),a?Object.getOwnPropertyDescriptor(n,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 ai=globalThis;let
|
|
66
|
+
*/const ai=globalThis;let Ls=class extends Is{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=tl(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 ft}};var Or;Ls._$litElement$=!0,Ls.finalized=!0,(Or=ai.litElementHydrateSupport)==null||Or.call(ai,{LitElement:Ls});const Er=ai.litElementPolyfillSupport;Er==null||Er({LitElement:Ls}),(ai.litElementVersions??(ai.litElementVersions=[])).push("4.2.1");const fl={hi:"Hei!"},ml={from:"Fra",to:"Til"},gl={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},vl={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"},bl={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",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."}},mt={example:fl,generic:ml,calendar:gl,dates:vl,forms:bl};var yl=Object.defineProperty,Pr=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&yl(e,t,n),n};let zi=class extends Ls{constructor(){super(...arguments),this.strings=mt,this.role=null}hotReplacedCallback(){this.requestUpdate()}};Pr([c({type:Object})],zi.prototype,"strings"),Pr([c({type:String})],zi.prototype,"role");let _e=class extends zi{createRenderRoot(){return this}};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/const
|
|
70
|
+
*/const Mt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},ms=s=>(...e)=>({_$litDirective$:s,values:e});let Bs=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$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
|
|
74
|
+
*/const L=ms(class extends Bs{constructor(s){var e;if(super(s),s.type!==Mt.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,i;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 n=s.element.classList;for(const r of this.st)r in e||(n.remove(r),this.st.delete(r));for(const r in e){const a=!!e[r];a===this.st.has(r)||(i=this.nt)!=null&&i.has(r)||(a?(n.add(r),this.st.add(r)):(n.remove(r),this.st.delete(r)))}return ft}});/**
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright 2017 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
|
-
*/function
|
|
78
|
+
*/function Q(s){return c({...s,state:!0,attribute:!1})}function Ar(s,e){return e.some(t=>t.value===s)}function oi(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function Fs(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function kl(s,e){return s.nodeType===Node.ELEMENT_NODE&&!Ar(s,e)}function xn(s){var e;return s.nodeType===Node.TEXT_NODE&&((e=s.nodeValue)==null?void 0:e.trim())!==""}let Ae=class{constructor(e,...t){this.nodes=[],this.filledSlots=new Set,this.skipOptions=!1,this.updatingSlots=!1,this.needsSlotUpdate=!0,this.host=e,this.host.addController(this),this.slots=t,this.nodes=[],this.observer=new MutationObserver(i=>{this.handleMutations(i),this.handleSlotMutations(i)})}hostConnected(){this.updateNodes(),this.observer.observe(this.host,{childList:!0,subtree:!0})}hostDisconnected(){this.observer.disconnect()}hostUpdated(){this.needsSlotUpdate&&(this.needsSlotUpdate=!1,this.updateSlots())}updateNodes(){this.nodes=[],Array.from(this.host.childNodes).forEach(e=>{oi(e)||Fs(e)&&this.skipOptions||(!Ar(e,this.slots)||xn(e))&&this.nodes.push(e)})}updateSlots(){if(this.updatingSlots)return;this.updatingSlots=!0;const e=new Set;this.slots.forEach(t=>{if(!t.value)return;const i=t.value.getAttribute("name");Array.from(t.value.childNodes).some(r=>{var a,l;if(r.nodeType===Node.COMMENT_NODE)return!1;if(r.nodeType===Node.TEXT_NODE)return!!((a=r.textContent)!=null&&a.trim());if(r.nodeType===Node.ELEMENT_NODE){if(oi(r))return!1;if((l=r.textContent)!=null&&l.trim())return!0}return!1})&&e.add(i);const n=this.nodes.flatMap(r=>xn(r)||r.getAttribute&&r.getAttribute("slot")==i&&!oi(r)?r:[]).filter(r=>t.value&&!t.value.contains(r)&&!r.contains(t.value));if(n.length>0)if(typeof t.value.replaceChildren!="function"){for(;t.value.firstChild;)t.value.removeChild(t.value.firstChild);t.value.append(...n)}else t.value.replaceChildren(...n)}),(this.filledSlots.size!==e.size||![...this.filledSlots].every(t=>e.has(t)))&&(this.filledSlots=e,typeof this.host.updateSlots=="function"&&this.host.updateSlots(this.filledSlots)),this.updatingSlots=!1}handleMutations(e){let t=!1;e.forEach(i=>{i.type!=="childList"||i.target!==this.host||(i.addedNodes.forEach(n=>{oi(n)||Fs(n)&&this.skipOptions||(kl(n,this.slots)||xn(n))&&(this.nodes.push(n),t=!0)}),i.removedNodes.forEach(n=>{oi(n)||Fs(n)&&this.skipOptions||(this.nodes=this.nodes.filter(r=>r!==n),t=!0)}))}),t&&(this.needsSlotUpdate=!0,this.updateSlots())}handleSlotMutations(e){let t=!1;e.forEach(i=>{const n=i.target.parentElement;if(n!=null&&n.hasAttribute("slot")){const r=n.getAttribute("slot"),a=n.hasChildNodes();a&&!this.filledSlots.has(r)?(this.filledSlots.add(r),t=!0):!a&&this.filledSlots.has(r)&&(this.filledSlots.delete(r),t=!0)}}),t&&typeof this.host.updateSlots=="function"&&this.host.updateSlots(this.filledSlots)}};/**
|
|
79
79
|
* @license
|
|
80
80
|
* Copyright 2020 Google LLC
|
|
81
81
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
82
|
-
*/const{I:
|
|
82
|
+
*/const{I:_l}=el,Ir=s=>s.strings===void 0,Lr=()=>document.createComment(""),li=(s,e,t)=>{var i;const n=s._$AA.parentNode,r=e===void 0?s._$AB:e._$AA;if(t===void 0){const a=n.insertBefore(Lr(),r),l=n.insertBefore(Lr(),r);t=new _l(a,l,s,s.options)}else{const a=t._$AB.nextSibling,l=t._$AM,d=l!==s;if(d){let p;(i=t._$AQ)==null||i.call(t,s),t._$AM=s,t._$AP!==void 0&&(p=s._$AU)!==l._$AU&&t._$AP(p)}if(a!==r||d){let p=t._$AA;for(;p!==a;){const m=p.nextSibling;n.insertBefore(p,r),p=m}}}return t},gs=(s,e,t=s)=>(s._$AI(e,t),s),$l={},Br=(s,e=$l)=>s._$AH=e,wl=s=>s._$AH,Sn=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 ci=(s,e)=>{var t;const i=s._$AN;if(i===void 0)return!1;for(const n of i)(t=n._$AO)==null||t.call(n,e,!1),ci(n,e);return!0},
|
|
86
|
+
*/const ci=(s,e)=>{var t;const i=s._$AN;if(i===void 0)return!1;for(const n of i)(t=n._$AO)==null||t.call(n,e,!1),ci(n,e);return!0},Yi=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)},Fr=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),Cl(e)}};function xl(s){this._$AN!==void 0?(Yi(this),this._$AM=s,Fr(this)):this._$AM=s}function Sl(s,e=!1,t=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(i))for(let r=t;r<i.length;r++)ci(i[r],!1),Yi(i[r]);else i!=null&&(ci(i,!1),Yi(i));else ci(this,s)}const Cl=s=>{s.type==Mt.CHILD&&(s._$AP??(s._$AP=Sl),s._$AQ??(s._$AQ=xl))};let Tl=class extends Bs{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),Fr(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,n;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),t&&(ci(this,e),Yi(this))}setValue(e){if(Ir(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(){}};/**
|
|
87
87
|
* @license
|
|
88
88
|
* Copyright 2020 Google LLC
|
|
89
89
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
90
|
-
*/const
|
|
90
|
+
*/const F=()=>new Nl;let Nl=class{};const Cn=new WeakMap,H=ms(class extends Tl{render(s){return w}update(s,[e]){var t;const i=e!==this.G;return i&&this.G!==void 0&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=(t=s.options)==null?void 0:t.host,this.rt(this.ct=s.element)),w}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=Cn.get(e);t===void 0&&(t=new WeakMap,Cn.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=Cn.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)}});function Hr(s,e,t){const i=s.getAttribute("class")||"",n=new Set(i.split(/\s+/).filter(Boolean));t?n.add(e):n.delete(e),s.setAttribute("class",Array.from(n).join(" "))}/**
|
|
91
91
|
* @license
|
|
92
92
|
* Copyright 2017 Google LLC
|
|
93
93
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
94
|
-
*/let
|
|
94
|
+
*/let Ki=class extends Bs{constructor(e){if(super(e),this.it=w,e.type!==Mt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===w||e==null)return this._t=void 0,this.it=e;if(e===ft)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:[]}}};Ki.directiveName="unsafeHTML",Ki.resultType=1;const Gi=ms(Ki);/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let
|
|
98
|
+
*/let Tn=class extends Ki{};Tn.directiveName="unsafeSVG",Tn.resultType=2;const Nn=ms(Tn);var Ml=Object.defineProperty,Dl=Object.getOwnPropertyDescriptor,di=(s,e,t,i)=>{for(var n=i>1?void 0:i?Dl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ml(e,t,n),n};const Mn="https://punkt-cdn.oslo.kommune.no/15.1/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Mn);const ui='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',hi={},Ol=2,El=1500,Vr=typeof Storage<"u"&&typeof sessionStorage<"u",Pl=s=>window.pktFetch(s).then(e=>{if(!e.ok)throw new Error("Missing icon: "+s);return e.text()}),Ur=async(s,e=Ol)=>{try{return await Pl(s)}catch{return e>0?(await new Promise(t=>setTimeout(t,El)),Ur(s,e-1)):(console.error("Failed to fetch icon: "+s),ui)}},Al=async(s,e)=>{const t=e+s+".svg";return Vr&&sessionStorage.getItem(t)?sessionStorage.getItem(t):t in hi?hi[t]:typeof window<"u"&&typeof window.pktFetch=="function"?(hi[t]=Ur(t).then(i=>(i!==ui&&Vr&&sessionStorage.setItem(t,i),delete hi[t],i)),hi[t]):ui};let vs=class extends _e{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:Mn,this.name="",this.icon=Nn(ui),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),(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:Mn);try{this.icon=Nn(await Al(this.name||"",this.path))}catch{this.icon=Nn(ui)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return b`${this.name&&this.icon}`}};di([c({type:String,reflect:!1})],vs.prototype,"path",2),di([c({type:String,reflect:!0})],vs.prototype,"name",2),di([c({type:SVGElement})],vs.prototype,"icon",2),di([c({type:Array,noAccessor:!0})],vs.prototype,"_updatedProps",2),vs=di([se("pkt-icon")],vs);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const
|
|
102
|
+
*/const A=s=>s??w;var Il=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,Je=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ll(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Il(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.1/animations/";let qe=class extends _e{constructor(){super(),this.defaultSlot=F(),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,this.slotController=new Ae(this,this.defaultSlot)}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,i){super.attributeChangedCallback(e,t,i),e==="disabled"&&i==="false"&&(this.disabled=!1),(e==="isloading"||e==="isLoading")&&i==="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 b`
|
|
103
103
|
<button
|
|
104
|
-
class=${
|
|
104
|
+
class=${L(t)}
|
|
105
105
|
type=${this.type}
|
|
106
106
|
?disabled=${!!this.disabled}
|
|
107
|
-
aria-busy=${
|
|
108
|
-
aria-disabled=${
|
|
109
|
-
form=${
|
|
107
|
+
aria-busy=${A(this.isLoading?"true":void 0)}
|
|
108
|
+
aria-disabled=${A(this.disabled||this.isLoading?"true":void 0)}
|
|
109
|
+
form=${A(e)}
|
|
110
110
|
>
|
|
111
|
-
${this.isLoading?
|
|
111
|
+
${this.isLoading?b`<pkt-icon
|
|
112
112
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
113
113
|
name="spinner-blue"
|
|
114
|
-
path=${
|
|
115
|
-
></pkt-icon>`:
|
|
116
|
-
${this.variant!=="label-only"?
|
|
114
|
+
path=${A(this.loadingAnimationPath)}
|
|
115
|
+
></pkt-icon>`:w}
|
|
116
|
+
${this.variant!=="label-only"?b`<pkt-icon
|
|
117
117
|
class="pkt-btn__icon pkt-icon"
|
|
118
118
|
name=${this.iconName}
|
|
119
|
-
path=${
|
|
120
|
-
></pkt-icon>`:
|
|
121
|
-
<span class="pkt-btn__text" ${
|
|
122
|
-
${this.variant==="icons-right-and-left"?
|
|
119
|
+
path=${A(this.iconPath)}
|
|
120
|
+
></pkt-icon>`:w}
|
|
121
|
+
<span class="pkt-btn__text" ${H(this.defaultSlot)}></span>
|
|
122
|
+
${this.variant==="icons-right-and-left"?b`<pkt-icon
|
|
123
123
|
class="pkt-btn__icon"
|
|
124
124
|
name=${this.secondIconName}
|
|
125
|
-
path=${
|
|
126
|
-
></pkt-icon>`:
|
|
125
|
+
path=${A(this.secondIconPath)}
|
|
126
|
+
></pkt-icon>`:w}
|
|
127
127
|
</button>
|
|
128
|
-
`}};
|
|
129
|
-
<div class=${
|
|
130
|
-
<div class=${
|
|
128
|
+
`}};Je([c({type:String})],qe.prototype,"iconName",2),Je([c({type:String})],qe.prototype,"secondIconName",2),Je([c({type:String})],qe.prototype,"iconPath",2),Je([c({type:String})],qe.prototype,"secondIconPath",2),Je([c({type:String})],qe.prototype,"mode",2),Je([c({type:String})],qe.prototype,"size",2),Je([c({type:Boolean,attribute:"full-width"})],qe.prototype,"fullWidth",2),Je([c({type:Boolean,attribute:"full-width-on-mobile"})],qe.prototype,"fullWidthOnMobile",2),Je([c({type:String})],qe.prototype,"color",2),Je([c({type:String})],qe.prototype,"skin",2),Je([c({type:String})],qe.prototype,"variant",2),Je([c({type:String,reflect:!0})],qe.prototype,"state",2),Je([c({type:String,reflect:!0})],qe.prototype,"type",2),Je([c({type:String})],qe.prototype,"form",2),Je([c({type:Boolean,reflect:!0})],qe.prototype,"isLoading",2),Je([c({type:Boolean,reflect:!0})],qe.prototype,"disabled",2),Je([c({type:String})],qe.prototype,"loadingAnimationPath",2),qe=Je([se("pkt-button")],qe);const Bl={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},Xi={props:Bl};var Fl=Object.defineProperty,Hl=Object.getOwnPropertyDescriptor,Lt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Hl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Fl(e,t,n),n};let Dt=class extends _e{constructor(){super(),this.defaultSlot=F(),this.compact=Xi.props.compact.default,this.title="",this.skin=Xi.props.skin.default,this.ariaLive=Xi.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=Xi.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.slotController=new Ae(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,t,i){e==="ariaLive"&&(this["aria-live"]=i),super.attributeChangedCallback(e,t,i)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&Hr(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 b`
|
|
129
|
+
<div class=${L(e)} aria-live=${this["aria-live"]}>
|
|
130
|
+
<div class=${L(t)}>
|
|
131
131
|
<pkt-icon
|
|
132
132
|
class="pkt-alert__icon"
|
|
133
133
|
aria-hidden="true"
|
|
134
134
|
name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
|
|
135
135
|
></pkt-icon>
|
|
136
136
|
|
|
137
|
-
${this.closeAlert?
|
|
137
|
+
${this.closeAlert?b`
|
|
138
138
|
<div class="pkt-alert__close">
|
|
139
139
|
<pkt-button
|
|
140
140
|
tabindex="0"
|
|
@@ -149,30 +149,30 @@
|
|
|
149
149
|
<span class="sr-only">Lukk</span>
|
|
150
150
|
</pkt-button>
|
|
151
151
|
</div>
|
|
152
|
-
`:
|
|
153
|
-
${this.title?
|
|
152
|
+
`:w}
|
|
153
|
+
${this.title?b`<div class="pkt-alert__title">${this.title}</div>`:w}
|
|
154
154
|
|
|
155
|
-
<div class="pkt-alert__text" ${
|
|
155
|
+
<div class="pkt-alert__text" ${H(this.defaultSlot)}></div>
|
|
156
156
|
|
|
157
|
-
${this.date?
|
|
157
|
+
${this.date?b`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:w}
|
|
158
158
|
</div>
|
|
159
159
|
</div>
|
|
160
|
-
`}};
|
|
160
|
+
`}};Lt([c({type:Boolean,reflect:!1})],Dt.prototype,"compact",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"title",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"skin",2),Lt([c({type:String})],Dt.prototype,"ariaLive",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"aria-live",2),Lt([c({type:Boolean,reflect:!0})],Dt.prototype,"closeAlert",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"date",2),Lt([c({type:String,reflect:!0})],Dt.prototype,"role",2),Lt([Q()],Dt.prototype,"_isClosed",2),Dt=Lt([se("pkt-alert")],Dt);var Vl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,pi=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ul(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Vl(e,t,n),n};let Hs=class extends Ls{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(i=>{i.tagName.toLowerCase()==="pkt-accordion-item"&&(i.hasAttribute("name")||i.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 b`
|
|
161
161
|
<div
|
|
162
162
|
part="container"
|
|
163
|
-
class=${
|
|
163
|
+
class=${L(e)}
|
|
164
164
|
data-testid="pkt-accordion"
|
|
165
165
|
aria-labelledby=${this.ariaLabelledBy}
|
|
166
166
|
>
|
|
167
167
|
<slot></slot>
|
|
168
168
|
</div>
|
|
169
|
-
`}};pi([
|
|
169
|
+
`}};pi([c({type:String,reflect:!0,attribute:"aria-labelledby"})],Hs.prototype,"ariaLabelledBy",2),pi([c({type:Boolean,reflect:!0,attribute:"compact"})],Hs.prototype,"compact",2),pi([c({type:String,reflect:!0,attribute:"skin"})],Hs.prototype,"skin",2),pi([c({type:String,reflect:!0,attribute:"name"})],Hs.prototype,"name",2),Hs=pi([se("pkt-accordion")],Hs);var jl=Object.defineProperty,ql=Object.getOwnPropertyDescriptor,bs=(s,e,t,i)=>{for(var n=i>1?void 0:i?ql(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&jl(e,t,n),n};let es=class extends _e{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=F(),this.defaultSlot=F(),this.slotController=new Ae(this,this.defaultSlot)}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 b`
|
|
170
170
|
<details
|
|
171
|
-
class=${
|
|
171
|
+
class=${L(e)}
|
|
172
172
|
id=${this.id}
|
|
173
173
|
?open=${this.isOpen}
|
|
174
|
-
${
|
|
175
|
-
name=${
|
|
174
|
+
${H(this.accordionItemRef)}
|
|
175
|
+
name=${A(this.name)}
|
|
176
176
|
>
|
|
177
177
|
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
178
178
|
${this.title}
|
|
@@ -187,14 +187,14 @@
|
|
|
187
187
|
id="pkt-accordion-item__content-${this.id}"
|
|
188
188
|
role="region"
|
|
189
189
|
>
|
|
190
|
-
<div class="pkt-accordion-item__content-inner" ${
|
|
190
|
+
<div class="pkt-accordion-item__content-inner" ${H(this.defaultSlot)}></div>
|
|
191
191
|
</div>
|
|
192
192
|
</details>
|
|
193
|
-
`}};
|
|
193
|
+
`}};bs([c({type:Boolean})],es.prototype,"defaultOpen",2),bs([c({type:String})],es.prototype,"title",2),bs([c({type:String,reflect:!0})],es.prototype,"skin",2),bs([c({type:Boolean,reflect:!0})],es.prototype,"compact",2),bs([c({type:Boolean,reflect:!0})],es.prototype,"isOpen",2),bs([c({type:String,reflect:!0})],es.prototype,"name",2),es=bs([se("pkt-accordion-item")],es);var Wl=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,Qi=(s,e,t,i)=>{for(var n=i>1?void 0:i?zl(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Wl(e,t,n),n};let Vs=class extends _e{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(e,t,i){e==="arialabel"&&this.removeAttribute("arialabel"),e==="href"&&this.removeAttribute("href"),e==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(e,t,i)}render(){return b`<nav
|
|
194
194
|
class="pkt-back-link"
|
|
195
195
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
196
196
|
>
|
|
197
|
-
<a href=${
|
|
197
|
+
<a href=${A(this.href||"/")} class="pkt-link pkt-link--icon-left"
|
|
198
198
|
><pkt-icon
|
|
199
199
|
class="pkt-back-link__icon pkt-icon pkt-link__icon"
|
|
200
200
|
name="chevron-thin-left"
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
></pkt-icon
|
|
203
203
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
204
204
|
>
|
|
205
|
-
</nav>`}};Gi([o({type:String})],Hs.prototype,"href",2),Gi([o({type:String})],Hs.prototype,"text",2),Gi([o({type:String})],Hs.prototype,"ariaLabel",2),Hs=Gi([X("pkt-backlink")],Hs);const Pr=6048e5,Pl=864e5,Ar=Symbol.for("constructDateFrom");function It(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Ar in s?s[Ar](e):s instanceof Date?new s.constructor(e):new Date(e)}function vt(s,e){return It(e||s,s)}function Ir(s,e,t){const i=vt(s,void 0);return isNaN(e)?It(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Al={};function Xi(){return Al}function fi(s,e){var t,i,n,r;const a=Xi(),c=(e==null?void 0:e.weekStartsOn)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,h=vt(s,e==null?void 0:e.in),p=h.getDay(),v=(p<c?7:0)+p-c;return h.setDate(h.getDate()-v),h.setHours(0,0,0,0),h}function Qi(s,e){return fi(s,{...e,weekStartsOn:1})}function Lr(s,e){const t=vt(s,void 0),i=t.getFullYear(),n=It(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=Qi(n),a=It(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=Qi(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=c.getTime()?i:i-1}function Br(s){const e=vt(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 Fr(s,...e){const t=It.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Hr(s,e){const t=vt(s,void 0);return t.setHours(0,0,0,0),t}function Il(s,e,t){const[i,n]=Fr(void 0,s,e),r=Hr(i),a=Hr(n),c=+r-Br(r),h=+a-Br(a);return Math.round((c-h)/Pl)}function Ll(s,e){const t=Lr(s),i=It(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),Qi(i)}function Bl(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Fl(s){return!(!Bl(s)&&typeof s!="number"||isNaN(+vt(s)))}function Hl(s,e){const[t,i]=Fr(s,e.start,e.end);return{start:t,end:i}}function Vr(s,e){const{start:t,end:i}=Hl(void 0,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let c=1;const h=[];for(;+a<=r;)h.push(It(t,a)),a.setDate(a.getDate()+c),a.setHours(0,0,0,0);return n?h.reverse():h}function Vl(s,e){const t=vt(s,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const jl={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"}},Ul=(s,e,t)=>{let i;const n=jl[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Sn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Wl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ql={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zl={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yl={date:Sn({formats:Wl,defaultWidth:"full"}),time:Sn({formats:ql,defaultWidth:"full"}),dateTime:Sn({formats:zl,defaultWidth:"full"})},Kl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rl=(s,e,t,i)=>Kl[s];function gi(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,c=t!=null&&t.width?String(t.width):a;n=s.formattingValues[c]||s.formattingValues[a]}else{const a=s.defaultWidth,c=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[c]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const Gl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ql={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"]},Zl={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"]},Jl={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"}},ec={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"}},tc=(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},sc={ordinalNumber:tc,era:gi({values:Gl,defaultWidth:"wide"}),quarter:gi({values:Xl,defaultWidth:"wide",argumentCallback:s=>s-1}),month:gi({values:Ql,defaultWidth:"wide"}),day:gi({values:Zl,defaultWidth:"wide"}),dayPeriod:gi({values:Jl,defaultWidth:"wide",formattingValues:ec,defaultFormattingWidth:"wide"})};function mi(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],c=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],h=Array.isArray(c)?nc(c,b=>b.test(a)):ic(c,b=>b.test(a));let p;p=s.valueCallback?s.valueCallback(h):h,p=t.valueCallback?t.valueCallback(p):p;const v=e.slice(a.length);return{value:p,rest:v}}}function ic(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function nc(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function rc(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[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 c=e.slice(n.length);return{value:a,rest:c}}}const ac=/^(\d+)(th|st|nd|rd)?/i,oc=/\d+/i,lc={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},cc={any:[/^b/i,/^(a|c)/i]},hc={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},uc={any:[/1/i,/2/i,/3/i,/4/i]},dc={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},pc={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]},fc={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},gc={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]},mc={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},vc={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}},bc={ordinalNumber:rc({matchPattern:ac,parsePattern:oc,valueCallback:s=>parseInt(s,10)}),era:mi({matchPatterns:lc,defaultMatchWidth:"wide",parsePatterns:cc,defaultParseWidth:"any"}),quarter:mi({matchPatterns:hc,defaultMatchWidth:"wide",parsePatterns:uc,defaultParseWidth:"any",valueCallback:s=>s+1}),month:mi({matchPatterns:dc,defaultMatchWidth:"wide",parsePatterns:pc,defaultParseWidth:"any"}),day:mi({matchPatterns:fc,defaultMatchWidth:"wide",parsePatterns:gc,defaultParseWidth:"any"}),dayPeriod:mi({matchPatterns:mc,defaultMatchWidth:"any",parsePatterns:vc,defaultParseWidth:"any"})},yc={code:"en-US",formatDistance:Ul,formatLong:Yl,formatRelative:Rl,localize:sc,match:bc,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kc(s,e){const t=vt(s,void 0);return Il(t,Vl(t))+1}function $c(s,e){const t=vt(s,void 0),i=+Qi(t)-+Ll(t);return Math.round(i/Pr)+1}function jr(s,e){var t,i,n,r;const a=vt(s,e==null?void 0:e.in),c=a.getFullYear(),h=Xi(),p=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??h.firstWeekContainsDate??((r=(n=h.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,v=It((e==null?void 0:e.in)||s,0);v.setFullYear(c+1,0,p),v.setHours(0,0,0,0);const b=fi(v,e),y=It((e==null?void 0:e.in)||s,0);y.setFullYear(c,0,p),y.setHours(0,0,0,0);const k=fi(y,e);return+a>=+b?c+1:+a>=+k?c:c-1}function wc(s,e){var t,i,n,r;const a=Xi(),c=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,h=jr(s,e),p=It((e==null?void 0:e.in)||s,0);return p.setFullYear(h,0,c),p.setHours(0,0,0,0),fi(p,e)}function Ur(s,e){const t=vt(s,e==null?void 0:e.in),i=+fi(t,e)-+wc(t,e);return Math.round(i/Pr)+1}function he(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const es={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return he(e==="yy"?i%100:i,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,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return he(n,e.length)}},Vs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Wr={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return es.y(s,e)},Y:function(s,e,t,i){const n=jr(s,i),r=n>0?n:1-n;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=Lr(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 i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return he(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return he(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return es.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return he(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Ur(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):he(n,e.length)},I:function(s,e,t){const i=$c(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):he(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):es.d(s,e)},D:function(s,e,t){const i=kc(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):he(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":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"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.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(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"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.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(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return he(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{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 i=s.getHours();let n;switch(i===12?n=Vs.noon:i===0?n=Vs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Vs.evening:i>=12?n=Vs.afternoon:i>=4?n=Vs.morning:n=Vs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return es.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):es.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):he(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):he(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):es.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):es.s(s,e)},S:function(s,e){return es.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return zr(i);case"XXXX":case"XX":return bs(i);case"XXXXX":case"XXX":default:return bs(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return zr(i);case"xxxx":case"xx":return bs(i);case"xxxxx":case"xxx":default:return bs(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+qr(i,":");case"OOOO":default:return"GMT"+bs(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+qr(i,":");case"zzzz":default:return"GMT"+bs(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return he(i,e.length)},T:function(s,e,t){return he(+s,e.length)}};function qr(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+he(r,2)}function zr(s,e){return s%60===0?(s>0?"-":"+")+he(Math.abs(s)/60,2):bs(s,e)}function bs(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=he(Math.trunc(i/60),2),r=he(i%60,2);return t+n+e+r}const Yr=(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"})}},Kr=(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"})}},_c=(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return Yr(s,e);let r;switch(i){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}}",Yr(i,e)).replace("{{time}}",Kr(n,e))},xc={p:Kr,P:_c},Sc=/^D+$/,Cc=/^Y+$/,Tc=["D","DD","YY","YYYY"];function Mc(s){return Sc.test(s)}function Nc(s){return Cc.test(s)}function Dc(s,e,t){const i=Oc(s,e,t);if(console.warn(i),Tc.includes(s))throw new RangeError(i)}function Oc(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Ec=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ac=/^'([^]*?)'?$/,Ic=/''/g,Lc=/[a-zA-Z]/;function Bc(s,e,t){var i,n,r,a;const c=Xi(),h=c.locale??yc,p=c.firstWeekContainsDate??((n=(i=c.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,v=c.weekStartsOn??((a=(r=c.locale)==null?void 0:r.options)==null?void 0:a.weekStartsOn)??0,b=vt(s,void 0);if(!Fl(b))throw new RangeError("Invalid time value");let y=e.match(Pc).map(m=>{const w=m[0];if(w==="p"||w==="P"){const C=xc[w];return C(m,h.formatLong)}return m}).join("").match(Ec).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const w=m[0];if(w==="'")return{isToken:!1,value:Fc(m)};if(Wr[w])return{isToken:!0,value:m};if(w.match(Lc))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:m}});h.localize.preprocessor&&(y=h.localize.preprocessor(b,y));const k={firstWeekContainsDate:p,weekStartsOn:v,locale:h};return y.map(m=>{if(!m.isToken)return m.value;const w=m.value;(Nc(w)||Mc(w))&&Dc(w,e,String(s));const C=Wr[w[0]];return C(b,w,h.localize,k)}).join("")}function Fc(s){const e=s.match(Ac);return e?e[1].replace(Ic,"'"):s}function Hc(s,e){const t=vt(s,void 0).getDay();return t===0?7:t}function Vc(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 Rr={},vi={};function ys(s,e){try{const t=(Rr[s]||(Rr[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return t in vi?vi[t]:Gr(t,t.split(":"))}catch{if(s in vi)return vi[s];const t=s==null?void 0:s.match(jc);return t?Gr(s,t.slice(1)):NaN}}const jc=/([+-]\d\d):?(\d\d)?/;function Gr(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return vi[s]=t*60+i>0?t*60+i+n:t*60-i-n}let bi=class Li extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ys(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)),Qr(this),Cn(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Li(...t,e):new Li(Date.now(),e)}withTimeZone(e){return new Li(+this,e)}getTimezoneOffset(){const e=-ys(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Cn(this),+this}[Symbol.for("constructDateFrom")](e){return new Li(+new Date(e),this.timeZone)}};const Xr=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Xr.test(s))return;const e=s.replace(Xr,"$1UTC");bi.prototype[e]&&(s.startsWith("get")?bi.prototype[s]=function(){return this.internal[e]()}:(bi.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Uc(this),+this},bi.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Cn(this),+this}))});function Cn(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ys(s.timeZone,s)*60))}function Uc(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()),Qr(s)}function Qr(s){const e=ys(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,c=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&c&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const h=n-t;h&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+h);const p=new Date(+s);p.setUTCSeconds(0);const v=n>0?p.getSeconds():(p.getSeconds()-60)%60,b=Math.round(-(ys(s.timeZone,s)*60))%60;(b||v)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+b+v));const y=ys(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),m=-new Date(+s).getTimezoneOffset()-k,w=k!==t,C=m-h;if(w&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const M=ys(s.timeZone,s),S=M>0?Math.floor(M):Math.ceil(M),E=k-S;E&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+E),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+E))}}let Tn=class Bi extends bi{static tz(e,...t){return t.length?new Bi(...t,e):new Bi(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${Vc(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?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new Bi(+this,e)}[Symbol.for("constructDateFrom")](e){return new Bi(+new Date(e),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Wc=(s=window.pktTz)=>{const e=new Tn(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 zt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}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 Fe=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},ts=s=>{if(!s)return null;const e=zt(s);return isNaN(e.getTime())?null:e},Zr=(s,e)=>{const t=wt(s);return isNaN(t.getTime())?"":Bc(t,e)},wt=(s="",e)=>{const t=typeof s=="string"?zt(s):s;return!t||isNaN(t.getTime())?new Date:t},ks=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},yi=s=>{let e;return typeof s=="number"?e=new Tn(s,window.pktTz):e=new Tn(s,window.pktTz),e.setHours(12,0,0,0),e};let Mn=null,Jr;const qc=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Mn||Jr!==e)&&(Mn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),Jr=e),Mn.format(s)},zc=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?wt(e):null,n=t?wt(t):null;return!(i&&s<i||n&&s>n)},Yc=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=Fe(s);return e.includes(t)},Kc=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},ea=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!zc(s,e,t)||i&&Yc(s,i)||n&&Kc(s,n)),Rc=(s,e,t,i,n)=>s.filter(r=>{const a=ts(r);return a&&ea(a,e,t,i,n)}),ta=s=>s.slice().sort((e,t)=>{const i=ts(e),n=ts(t);return!i||!n?0:i.getTime()-n.getTime()}),Gc=(s,e)=>{const t=ts(s),i=ts(e);return!t||!i?!1:t<=i},ki=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[],Xc=s=>s.join(","),Qc=s=>ki(s),Zc=s=>s?zt(s):null,Jc=s=>{if(typeof s=="string")return s.split(",").map(e=>zt(e));if(Array.isArray(s))return s.map(e=>zt(e))},js={csvToArray:Qc,stringToDate:Zc,stringsToDate:Jc},eh={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},$s={props:eh};function sa(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:Fe(i));return!ea(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function th(s,e,t,i){return!!(sa(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function sh(s,e,t){const i=ks(s,e,0);return!(t&&wt(t)>i)}function ih(s,e,t){const i=ks(e===11?s+1:s,e===11?0:e+1,1);return!(t&&wt(t)<i)}const $i=7,nh=6;function rh(s,e){const t=ks(s,e,1),i=ks(s,e+1,0),n=(t.getDay()+nh)%$i,r=i.getDate(),a=Math.ceil((r+n)/$i),c=ks(s,e,0).getDate(),h=Ur(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:c,initialWeek:h}}function ah(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function oh(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}function Us(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>zt(e))}function ia(s,e){const t=Vr({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[Fe(r)]=a}return i}function na(s,e,t,i){if(e.length!==1)return!0;const n=Vr({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(Hc(n[r]).toString()))return!1}return!0}function Nn(s,e){const t=Fe(s);return e.includes(t)?e:[...e,t]}function Dn(s,e){const t=Fe(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function lh(s,e,t){const i=Fe(s);return e.includes(i)?Dn(s,e):t>0&&e.length>=t?e:Nn(s,e)}function ch(s,e,t){const i=Fe(s),n=Us(e);if(e.includes(i))return e.indexOf(i)===0?[]:Dn(s,e);if(e.length>1)return[i];if(e.length===1){if(!na(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return Nn(s,e)}const hh={ArrowLeft:-1,ArrowRight:1,ArrowUp:-$i,ArrowDown:$i};function uh(s){var e;const t=s.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((e=s.dataset)!=null&&e.date)}function dh(s,e,t){let i=Ir(s,e);if(!i)return null;let n=t(`button[data-date="${Fe(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Ir(i,e),n=t(`button[data-date="${Fe(i)}"]`),!n)return null;return i}function ph(s){return hh[s]??null}var fh=Object.defineProperty,gh=Object.getOwnPropertyDescriptor,ge=(s,e,t,i)=>{for(var n=i>1?void 0:i?gh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&fh(e,t,n),n};let de=class extends fe{constructor(){super(...arguments),this.selected=[],this.multiple=$s.props.multiple.default,this.maxMultiple=$s.props.maxMultiple.default,this.range=$s.props.range.default,this.earliest=$s.props.earliest.default,this.latest=$s.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=$s.props.weeknumbers.default,this.withcontrols=$s.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?zt(this.today):Wc()}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=Us(this.selected),this.range&&this.selected.length===2&&(this.inRange=ia(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=zt(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?yi(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=yi(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=yi(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){const t=ph(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){const i=e.target;if(uh(i))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?wt(this.focusedDate):ks(this.year,this.month,1),r=dh(n,t,this.querySelector.bind(this));if(r){const a=this.querySelector(`button[data-date="${Fe(r)}"]`);a instanceof HTMLButtonElement&&!a.dataset.disabled&&(this.focusedDate=Fe(r),a.focus())}}render(){return f`
|
|
205
|
+
</nav>`}};Qi([c({type:String})],Vs.prototype,"href",2),Qi([c({type:String})],Vs.prototype,"text",2),Qi([c({type:String})],Vs.prototype,"ariaLabel",2),Vs=Qi([se("pkt-backlink")],Vs);const jr=6048e5,Yl=864e5,qr=Symbol.for("constructDateFrom");function Bt(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&qr in s?s[qr](e):s instanceof Date?new s.constructor(e):new Date(e)}function _t(s,e){return Bt(e||s,s)}function Wr(s,e,t){const i=_t(s,void 0);return isNaN(e)?Bt(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Kl={};function Zi(){return Kl}function fi(s,e){var t,i,n,r;const a=Zi(),l=(e==null?void 0:e.weekStartsOn)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,d=_t(s,e==null?void 0:e.in),p=d.getDay(),m=(p<l?7:0)+p-l;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function Ji(s,e){return fi(s,{...e,weekStartsOn:1})}function zr(s,e){const t=_t(s,void 0),i=t.getFullYear(),n=Bt(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=Ji(n),a=Bt(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=Ji(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Yr(s){const e=_t(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 Kr(s,...e){const t=Bt.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Gr(s,e){const t=_t(s,void 0);return t.setHours(0,0,0,0),t}function Gl(s,e,t){const[i,n]=Kr(void 0,s,e),r=Gr(i),a=Gr(n),l=+r-Yr(r),d=+a-Yr(a);return Math.round((l-d)/Yl)}function Xl(s,e){const t=zr(s),i=Bt(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),Ji(i)}function Ql(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Zl(s){return!(!Ql(s)&&typeof s!="number"||isNaN(+_t(s)))}function Jl(s,e){const[t,i]=Kr(s,e.start,e.end);return{start:t,end:i}}function Xr(s,e){const{start:t,end:i}=Jl(void 0,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let l=1;const d=[];for(;+a<=r;)d.push(Bt(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return n?d.reverse():d}function Rl(s,e){const t=_t(s,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const ec={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"}},tc=(s,e,t)=>{let i;const n=ec[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Dn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const sc={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ic={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nc={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rc={date:Dn({formats:sc,defaultWidth:"full"}),time:Dn({formats:ic,defaultWidth:"full"}),dateTime:Dn({formats:nc,defaultWidth:"full"})},ac={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},oc=(s,e,t,i)=>ac[s];function mi(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;n=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const lc={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},cc={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dc={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"]},uc={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"]},hc={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"}},pc={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"}},fc=(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},mc={ordinalNumber:fc,era:mi({values:lc,defaultWidth:"wide"}),quarter:mi({values:cc,defaultWidth:"wide",argumentCallback:s=>s-1}),month:mi({values:dc,defaultWidth:"wide"}),day:mi({values:uc,defaultWidth:"wide"}),dayPeriod:mi({values:hc,defaultWidth:"wide",formattingValues:pc,defaultFormattingWidth:"wide"})};function gi(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],l=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(l)?vc(l,v=>v.test(a)):gc(l,v=>v.test(a));let p;p=s.valueCallback?s.valueCallback(d):d,p=t.valueCallback?t.valueCallback(p):p;const m=e.slice(a.length);return{value:p,rest:m}}}function gc(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function vc(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function bc(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[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(n.length);return{value:a,rest:l}}}const yc=/^(\d+)(th|st|nd|rd)?/i,kc=/\d+/i,_c={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},$c={any:[/^b/i,/^(a|c)/i]},wc={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xc={any:[/1/i,/2/i,/3/i,/4/i]},Sc={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},Cc={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]},Tc={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},Nc={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]},Mc={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},Dc={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}},Oc={ordinalNumber:bc({matchPattern:yc,parsePattern:kc,valueCallback:s=>parseInt(s,10)}),era:gi({matchPatterns:_c,defaultMatchWidth:"wide",parsePatterns:$c,defaultParseWidth:"any"}),quarter:gi({matchPatterns:wc,defaultMatchWidth:"wide",parsePatterns:xc,defaultParseWidth:"any",valueCallback:s=>s+1}),month:gi({matchPatterns:Sc,defaultMatchWidth:"wide",parsePatterns:Cc,defaultParseWidth:"any"}),day:gi({matchPatterns:Tc,defaultMatchWidth:"wide",parsePatterns:Nc,defaultParseWidth:"any"}),dayPeriod:gi({matchPatterns:Mc,defaultMatchWidth:"any",parsePatterns:Dc,defaultParseWidth:"any"})},Ec={code:"en-US",formatDistance:tc,formatLong:rc,formatRelative:oc,localize:mc,match:Oc,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pc(s,e){const t=_t(s,void 0);return Gl(t,Rl(t))+1}function Ac(s,e){const t=_t(s,void 0),i=+Ji(t)-+Xl(t);return Math.round(i/jr)+1}function Qr(s,e){var t,i,n,r;const a=_t(s,e==null?void 0:e.in),l=a.getFullYear(),d=Zi(),p=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??d.firstWeekContainsDate??((r=(n=d.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,m=Bt((e==null?void 0:e.in)||s,0);m.setFullYear(l+1,0,p),m.setHours(0,0,0,0);const v=fi(m,e),y=Bt((e==null?void 0:e.in)||s,0);y.setFullYear(l,0,p),y.setHours(0,0,0,0);const k=fi(y,e);return+a>=+v?l+1:+a>=+k?l:l-1}function Ic(s,e){var t,i,n,r;const a=Zi(),l=(e==null?void 0:e.firstWeekContainsDate)??((i=(t=e==null?void 0:e.locale)==null?void 0:t.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(n=a.locale)==null?void 0:n.options)==null?void 0:r.firstWeekContainsDate)??1,d=Qr(s,e),p=Bt((e==null?void 0:e.in)||s,0);return p.setFullYear(d,0,l),p.setHours(0,0,0,0),fi(p,e)}function Zr(s,e){const t=_t(s,e==null?void 0:e.in),i=+fi(t,e)-+Ic(t,e);return Math.round(i/jr)+1}function me(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const ts={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return me(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):me(t+1,2)},d(s,e){return me(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 me(s.getHours()%12||12,e.length)},H(s,e){return me(s.getHours(),e.length)},m(s,e){return me(s.getMinutes(),e.length)},s(s,e){return me(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return me(n,e.length)}},Us={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Jr={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return ts.y(s,e)},Y:function(s,e,t,i){const n=Qr(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return me(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):me(r,e.length)},R:function(s,e){const t=zr(s);return me(t,e.length)},u:function(s,e){const t=s.getFullYear();return me(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return me(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return me(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return ts.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return me(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Zr(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):me(n,e.length)},I:function(s,e,t){const i=Ac(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):me(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):ts.d(s,e)},D:function(s,e,t){const i=Pc(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):me(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":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"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return me(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});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"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return me(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return me(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{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 i=s.getHours();let n;switch(i===12?n=Us.noon:i===0?n=Us.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Us.evening:i>=12?n=Us.afternoon:i>=4?n=Us.morning:n=Us.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return ts.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):ts.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):me(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):me(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):ts.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):ts.s(s,e)},S:function(s,e){return ts.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return ea(i);case"XXXX":case"XX":return ys(i);case"XXXXX":case"XXX":default:return ys(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return ea(i);case"xxxx":case"xx":return ys(i);case"xxxxx":case"xxx":default:return ys(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Rr(i,":");case"OOOO":default:return"GMT"+ys(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Rr(i,":");case"zzzz":default:return"GMT"+ys(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return me(i,e.length)},T:function(s,e,t){return me(+s,e.length)}};function Rr(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+me(r,2)}function ea(s,e){return s%60===0?(s>0?"-":"+")+me(Math.abs(s)/60,2):ys(s,e)}function ys(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=me(Math.trunc(i/60),2),r=me(i%60,2);return t+n+e+r}const ta=(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"})}},sa=(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"})}},Lc=(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return ta(s,e);let r;switch(i){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}}",ta(i,e)).replace("{{time}}",sa(n,e))},Bc={p:sa,P:Lc},Fc=/^D+$/,Hc=/^Y+$/,Vc=["D","DD","YY","YYYY"];function Uc(s){return Fc.test(s)}function jc(s){return Hc.test(s)}function qc(s,e,t){const i=Wc(s,e,t);if(console.warn(i),Vc.includes(s))throw new RangeError(i)}function Wc(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const zc=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Kc=/^'([^]*?)'?$/,Gc=/''/g,Xc=/[a-zA-Z]/;function Qc(s,e,t){var i,n,r,a;const l=Zi(),d=l.locale??Ec,p=l.firstWeekContainsDate??((n=(i=l.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,m=l.weekStartsOn??((a=(r=l.locale)==null?void 0:r.options)==null?void 0:a.weekStartsOn)??0,v=_t(s,void 0);if(!Zl(v))throw new RangeError("Invalid time value");let y=e.match(Yc).map(g=>{const $=g[0];if($==="p"||$==="P"){const C=Bc[$];return C(g,d.formatLong)}return g}).join("").match(zc).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const $=g[0];if($==="'")return{isToken:!1,value:Zc(g)};if(Jr[$])return{isToken:!0,value:g};if($.match(Xc))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:g}});d.localize.preprocessor&&(y=d.localize.preprocessor(v,y));const k={firstWeekContainsDate:p,weekStartsOn:m,locale:d};return y.map(g=>{if(!g.isToken)return g.value;const $=g.value;(jc($)||Uc($))&&qc($,e,String(s));const C=Jr[$[0]];return C(v,$,d.localize,k)}).join("")}function Zc(s){const e=s.match(Kc);return e?e[1].replace(Gc,"'"):s}function Jc(s,e){const t=_t(s,void 0).getDay();return t===0?7:t}function Rc(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 ia={},vi={};function ks(s,e){try{const t=(ia[s]||(ia[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return t in vi?vi[t]:na(t,t.split(":"))}catch{if(s in vi)return vi[s];const t=s==null?void 0:s.match(ed);return t?na(s,t.slice(1)):NaN}}const ed=/([+-]\d\d):?(\d\d)?/;function na(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return vi[s]=t*60+i>0?t*60+i+n:t*60-i-n}let bi=class Bi extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(ks(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)),aa(this),On(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Bi(...t,e):new Bi(Date.now(),e)}withTimeZone(e){return new Bi(+this,e)}getTimezoneOffset(){const e=-ks(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),On(this),+this}[Symbol.for("constructDateFrom")](e){return new Bi(+new Date(e),this.timeZone)}};const ra=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ra.test(s))return;const e=s.replace(ra,"$1UTC");bi.prototype[e]&&(s.startsWith("get")?bi.prototype[s]=function(){return this.internal[e]()}:(bi.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),td(this),+this},bi.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),On(this),+this}))});function On(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ks(s.timeZone,s)*60))}function td(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()),aa(s)}function aa(s){const e=ks(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const d=n-t;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(ks(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const y=ks(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),g=-new Date(+s).getTimezoneOffset()-k,$=k!==t,C=g-d;if($&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const M=ks(s.timeZone,s),S=M>0?Math.floor(M):Math.ceil(M),E=k-S;E&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+E),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+E))}}let En=class Fi extends bi{static tz(e,...t){return t.length?new Fi(...t,e):new Fi(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${Rc(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?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new Fi(+this,e)}[Symbol.for("constructDateFrom")](e){return new Fi(+new Date(e),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const sd=(s=window.pktTz)=>{const e=new En(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 Yt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}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 We=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},ss=s=>{if(!s)return null;const e=Yt(s);return isNaN(e.getTime())?null:e},oa=(s,e)=>{const t=Ct(s);return isNaN(t.getTime())?"":Qc(t,e)},Ct=(s="",e)=>{const t=typeof s=="string"?Yt(s):s;return!t||isNaN(t.getTime())?new Date:t},_s=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},yi=s=>{let e;return typeof s=="number"?e=new En(s,window.pktTz):e=new En(s,window.pktTz),e.setHours(12,0,0,0),e};let Pn=null,la;const id=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Pn||la!==e)&&(Pn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),la=e),Pn.format(s)},nd=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Ct(e):null,n=t?Ct(t):null;return!(i&&s<i||n&&s>n)},rd=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=We(s);return e.includes(t)},ad=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},ca=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!nd(s,e,t)||i&&rd(s,i)||n&&ad(s,n)),od=(s,e,t,i,n)=>s.filter(r=>{const a=ss(r);return a&&ca(a,e,t,i,n)}),da=s=>s.slice().sort((e,t)=>{const i=ss(e),n=ss(t);return!i||!n?0:i.getTime()-n.getTime()}),ld=(s,e)=>{const t=ss(s),i=ss(e);return!t||!i?!1:t<=i},ki=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[],cd=s=>s.join(","),dd=s=>ki(s),ud=s=>s?Yt(s):null,hd=s=>{if(typeof s=="string")return s.split(",").map(e=>Yt(e));if(Array.isArray(s))return s.map(e=>Yt(e))},js={csvToArray:dd,stringToDate:ud,stringsToDate:hd},pd={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},$s={props:pd};function ua(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:We(i));return!ca(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function fd(s,e,t,i){return!!(ua(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function md(s,e,t){const i=_s(s,e,0);return!(t&&Ct(t)>i)}function gd(s,e,t){const i=_s(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Ct(t)<i)}const _i=7,vd=6;function bd(s,e){const t=_s(s,e,1),i=_s(s,e+1,0),n=(t.getDay()+vd)%_i,r=i.getDate(),a=Math.ceil((r+n)/_i),l=_s(s,e,0).getDate(),d=Zr(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:l,initialWeek:d}}function yd(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function kd(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}function qs(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>Yt(e))}function ha(s,e){const t=Xr({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[We(r)]=a}return i}function pa(s,e,t,i){if(e.length!==1)return!0;const n=Xr({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(Jc(n[r]).toString()))return!1}return!0}function An(s,e){const t=We(s);return e.includes(t)?e:[...e,t]}function In(s,e){const t=We(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function _d(s,e,t){const i=We(s);return e.includes(i)?In(s,e):t>0&&e.length>=t?e:An(s,e)}function $d(s,e,t){const i=We(s),n=qs(e);if(e.includes(i))return e.indexOf(i)===0?[]:In(s,e);if(e.length>1)return[i];if(e.length===1){if(!pa(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return An(s,e)}const wd={ArrowLeft:-1,ArrowRight:1,ArrowUp:-_i,ArrowDown:_i};function xd(s){var e;const t=s.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((e=s.dataset)!=null&&e.date)}function Sd(s,e,t){let i=Wr(s,e);if(!i)return null;let n=t(`button[data-date="${We(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Wr(i,e),n=t(`button[data-date="${We(i)}"]`),!n)return null;return i}function Cd(s){return wd[s]??null}var Td=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,$e=(s,e,t,i)=>{for(var n=i>1?void 0:i?Nd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Td(e,t,n),n};let ye=class extends _e{constructor(){super(...arguments),this.selected=[],this.multiple=$s.props.multiple.default,this.maxMultiple=$s.props.maxMultiple.default,this.range=$s.props.range.default,this.earliest=$s.props.earliest.default,this.latest=$s.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=$s.props.weeknumbers.default,this.withcontrols=$s.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?Yt(this.today):sd()}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=qs(this.selected),this.range&&this.selected.length===2&&(this.inRange=ha(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=Yt(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?yi(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=yi(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=yi(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){const t=Cd(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){const i=e.target;if(xd(i))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?Ct(this.focusedDate):_s(this.year,this.month,1),r=Sd(n,t,this.querySelector.bind(this));if(r){const a=this.querySelector(`button[data-date="${We(r)}"]`);a instanceof HTMLButtonElement&&!a.dataset.disabled&&(this.focusedDate=We(r),a.focus())}}render(){return b`
|
|
206
206
|
<div
|
|
207
207
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
208
208
|
@focusout=${this.closeEvent}
|
|
@@ -226,25 +226,25 @@
|
|
|
226
226
|
</tbody>
|
|
227
227
|
</table>
|
|
228
228
|
</div>
|
|
229
|
-
`}renderMonthNavButton(e){const t=e==="prev",i=t?this.isPrevMonthAllowed():this.isNextMonthAllowed(),n=t?this.prevMonthString:this.nextMonthString,r=t?"chevron-thin-left":"chevron-thin-right",a=t?"pkt-calendar__prev-month":"pkt-calendar__next-month",
|
|
229
|
+
`}renderMonthNavButton(e){const t=e==="prev",i=t?this.isPrevMonthAllowed():this.isNextMonthAllowed(),n=t?this.prevMonthString:this.nextMonthString,r=t?"chevron-thin-left":"chevron-thin-right",a=t?"pkt-calendar__prev-month":"pkt-calendar__next-month",l=t?()=>this.prevMonth():()=>this.nextMonth();return b`<div>
|
|
230
230
|
<button
|
|
231
231
|
type="button"
|
|
232
232
|
aria-label="${n}"
|
|
233
|
-
@click=${()=>i&&
|
|
234
|
-
@keydown=${
|
|
233
|
+
@click=${()=>i&&l()}
|
|
234
|
+
@keydown=${d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),i&&l())}}
|
|
235
235
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${a} ${i?"":"pkt-invisible"}"
|
|
236
|
-
.data-disabled=${i?
|
|
236
|
+
.data-disabled=${i?w:"disabled"}
|
|
237
237
|
?aria-disabled=${!i}
|
|
238
238
|
tabindex=${i?"0":"-1"}
|
|
239
239
|
>
|
|
240
240
|
<pkt-icon class="pkt-btn__icon" name="${r}"></pkt-icon>
|
|
241
241
|
<span class="pkt-btn__text">${n}</span>
|
|
242
242
|
</button>
|
|
243
|
-
</div>`}renderDayNames(){const e=[];this.weeknumbers&&e.push(
|
|
243
|
+
</div>`}renderDayNames(){const e=[];this.weeknumbers&&e.push(b`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);for(let t=0;t<this.dayStrings.length;t++)e.push(b`<th>
|
|
244
244
|
<div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[t]}">
|
|
245
245
|
${this.dayStrings[t]}
|
|
246
246
|
</div>
|
|
247
|
-
</th>`);return
|
|
247
|
+
</th>`);return b`<tr class="pkt-cal-week-row">${e}</tr>`}renderMonthNav(){return this.withcontrols?b`<div class="pkt-cal-month-picker">
|
|
248
248
|
<label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
|
|
249
249
|
<select
|
|
250
250
|
aria-label="${this.strings.dates.month}"
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
id="${this.id}-monthnav"
|
|
253
253
|
@change=${e=>{e.stopImmediatePropagation();const t=e.target;this.changeMonth(this.year,parseInt(t.value))}}
|
|
254
254
|
>
|
|
255
|
-
${this.monthStrings.map((e,t)=>
|
|
255
|
+
${this.monthStrings.map((e,t)=>b`<option value=${t} ?selected=${this.month===t}>${e}</option>`)}
|
|
256
256
|
</select>
|
|
257
257
|
<label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
|
|
258
258
|
<input
|
|
@@ -265,79 +265,79 @@
|
|
|
265
265
|
@change=${e=>{e.stopImmediatePropagation();const t=e.target;this.changeMonth(parseInt(t.value),this.month)}}
|
|
266
266
|
.value=${this.year}
|
|
267
267
|
/>
|
|
268
|
-
</div>`:
|
|
268
|
+
</div>`:b`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
269
269
|
${this.monthStrings[this.month]} ${this.year}
|
|
270
|
-
</div>`}getDayViewData(e,t){const i=
|
|
270
|
+
</div>`}getDayViewData(e,t){const i=_s(this.year,this.month,e),n=We(i),r=n===We(t),a=this.selected.includes(n),l=this.isDayDisabled(i,a),d=this.calculateTabIndex(n,l,e);return{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:l,ariaLabel:id(i),tabindex:d}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return fd(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,i){return this.focusedDate?this.focusedDate===e&&!t?"0":"-1":!t&&this.tabIndexSet===0?(this.tabIndexSet=i,"0"):this.tabIndexSet===i?"0":"-1"}getDayCellClasses(e){const{currentDateISO:t,isToday:i,isSelected:n}=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":i,"pkt-cal-selected":n,"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===We(this.rangeHovered)}}getDayButtonClasses(e){const{currentDateISO:t,isToday:i,isSelected:n,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":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===We(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 i=this.getDayViewData(e,t),{currentDate:n,currentDateISO:r,isSelected:a,isDisabled:l,ariaLabel:d,tabindex:p}=i;this.selectableDates.push({currentDateISO:r,isDisabled:l,tabindex:p});const m=this.getDayCellClasses(i),v=this.getDayButtonClasses(i);return b`<td class=${L(m)}>
|
|
271
271
|
<button
|
|
272
272
|
type="button"
|
|
273
273
|
aria-pressed=${a?"true":"false"}
|
|
274
|
-
?disabled=${
|
|
275
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${
|
|
274
|
+
?disabled=${l}
|
|
275
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${L(v)}"
|
|
276
276
|
@mouseover=${()=>this.range&&!this.isExcluded(n)&&this.handleRangeHover(n)}
|
|
277
277
|
@focus=${()=>this.handleDayFocus(n,r)}
|
|
278
|
-
aria-label="${
|
|
278
|
+
aria-label="${d}"
|
|
279
279
|
tabindex=${p}
|
|
280
|
-
data-disabled=${
|
|
280
|
+
data-disabled=${l?"disabled":w}
|
|
281
281
|
data-date=${r}
|
|
282
282
|
@keydown=${y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),this.handleDateSelect(n))}}
|
|
283
|
-
@click=${y=>{
|
|
283
|
+
@click=${y=>{l||(y.preventDefault(),this.handleDateSelect(n))}}
|
|
284
284
|
>
|
|
285
285
|
<span class="pkt-btn__text pkt-txt-14-light">${e}</span>
|
|
286
286
|
</button>
|
|
287
|
-
</td>`}renderEmptyDayCell(e){return
|
|
287
|
+
</td>`}renderEmptyDayCell(e){return b`<td class="pkt-cal-other">
|
|
288
288
|
<div
|
|
289
289
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
290
290
|
data-disabled="disabled"
|
|
291
291
|
>
|
|
292
292
|
<span class="pkt-btn__text pkt-txt-14-light">${e}</span>
|
|
293
293
|
</div>
|
|
294
|
-
</td>`}renderWeekRow(e){return
|
|
294
|
+
</td>`}renderWeekRow(e){return b`<tr class="pkt-cal-week-row" role="row">${e}</tr>`}renderCalendarBody(){const e=this.todayDate,t=bd(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let i=1;this.week=t.initialWeek;const n=[];for(let r=0;r<t.numRows;r++){const a=[];this.weeknumbers&&a.push(b`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let l=0;l<_i;l++){const d=yd(r,l,i,t);if(d==="current-month")a.push(this.renderDayView(i,e)),i++;else{const p=kd(d,l,i,t);a.push(this.renderEmptyDayCell(p)),d==="next-month"&&i++}}n.push(this.renderWeekRow(a))}return n}isExcluded(e){return ua(e,this.getDateConstraints())}isPrevMonthAllowed(){return md(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 gd(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=yi(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=An(e,this.normalizeSelected()),this._selected=qs(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=In(e,this.normalizeSelected()),this._selected=qs(this.selected)}toggleSelected(e){this.selected=_d(e,this.normalizeSelected(),this.maxMultiple),this._selected=qs(this.selected)}isRangeAllowed(e){return pa(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=$d(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=qs(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=ha(this._selected[0],e)}handleDateSelect(e){return e&&(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(We(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=We(yi(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}const i=this.selectableDates.find(n=>!n.isDisabled);if(i){const n=this.querySelector(`button[data-date="${i.currentDateISO}"]`);n instanceof HTMLButtonElement&&(this.focusedDate=i.currentDateISO,n.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}))}};$e([c({converter:js.csvToArray})],ye.prototype,"selected",2),$e([c({type:Boolean})],ye.prototype,"multiple",2),$e([c({type:Number,attribute:"max-multiple"})],ye.prototype,"maxMultiple",2),$e([c({type:Boolean})],ye.prototype,"range",2),$e([c({type:String})],ye.prototype,"earliest",2),$e([c({type:String})],ye.prototype,"latest",2),$e([c({converter:js.stringsToDate})],ye.prototype,"excludedates",2),$e([c({converter:js.csvToArray})],ye.prototype,"excludeweekdays",2),$e([c({type:Boolean})],ye.prototype,"weeknumbers",2),$e([c({type:Boolean})],ye.prototype,"withcontrols",2),$e([c({converter:js.stringToDate})],ye.prototype,"currentmonth",2),$e([c({type:String})],ye.prototype,"today",2),$e([c({type:Array,attribute:"day-strings"})],ye.prototype,"dayStrings",2),$e([c({type:Array,attribute:"day-strings-long"})],ye.prototype,"dayStringsLong",2),$e([c({type:Array,attribute:"month-strings"})],ye.prototype,"monthStrings",2),$e([c({type:String,attribute:"week-string"})],ye.prototype,"weekString",2),$e([c({type:String,attribute:"prev-month-string"})],ye.prototype,"prevMonthString",2),$e([c({type:String,attribute:"next-month-string"})],ye.prototype,"nextMonthString",2),$e([c({type:Array})],ye.prototype,"_selected",2),$e([Q()],ye.prototype,"inRange",2),$e([c({type:Date})],ye.prototype,"rangeHovered",2),$e([c({type:Number})],ye.prototype,"year",2),$e([c({type:Number})],ye.prototype,"month",2),$e([c({type:Number})],ye.prototype,"week",2),$e([Q()],ye.prototype,"currentmonthtouched",2),$e([Q()],ye.prototype,"focusedDate",2),ye=$e([se("pkt-calendar")],ye);const Md={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},Ri={props:Md};var Dd=Object.defineProperty,Od=Object.getOwnPropertyDescriptor,Ft=(s,e,t,i)=>{for(var n=i>1?void 0:i?Od(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Dd(e,t,n),n};let Ot=class extends _e{constructor(){super(),this.defaultSlot=F(),this.closeTag=Ri.props.closeTag.default,this.size=Ri.props.size.default,this.skin=Ri.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=Ri.props.type.default,this.ariaLabel=null,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.slotController=new Ae(this,this.defaultSlot),this._isClosed=!1}firstUpdated(e){var t,i;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const n=(i=(t=this.defaultSlot.value)==null?void 0:t.textContent)==null?void 0:i.trim();n&&(this._ariaDescription=`Klikk for å fjerne ${n}`)}}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?b`
|
|
295
295
|
<button
|
|
296
|
-
class=${
|
|
296
|
+
class=${L(t)}
|
|
297
297
|
type=${this.type}
|
|
298
298
|
@click=${this.close}
|
|
299
|
-
aria-label=${
|
|
300
|
-
aria-description=${
|
|
299
|
+
aria-label=${A(this.ariaLabel||void 0)}
|
|
300
|
+
aria-description=${A(this._ariaDescription||void 0)}
|
|
301
301
|
>
|
|
302
|
-
${this.iconName&&
|
|
302
|
+
${this.iconName&&b`<pkt-icon
|
|
303
303
|
class="pkt-tag__icon"
|
|
304
304
|
name=${this.iconName}
|
|
305
305
|
aria-hidden="true"
|
|
306
306
|
></pkt-icon>`}
|
|
307
|
-
<span ${
|
|
307
|
+
<span ${H(this.defaultSlot)}></span>
|
|
308
308
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
309
309
|
</button>
|
|
310
|
-
`:
|
|
311
|
-
<span class=${
|
|
312
|
-
${this.iconName&&
|
|
310
|
+
`:b`
|
|
311
|
+
<span class=${L(e)}>
|
|
312
|
+
${this.iconName&&b`<pkt-icon
|
|
313
313
|
class="pkt-tag__icon"
|
|
314
314
|
name=${this.iconName}
|
|
315
315
|
aria-hidden="true"
|
|
316
316
|
></pkt-icon>`}
|
|
317
|
-
<span ${
|
|
317
|
+
<span ${H(this.defaultSlot)}></span>
|
|
318
318
|
</span>
|
|
319
|
-
`}};
|
|
319
|
+
`}};Ft([c({type:Boolean,reflect:!0})],Ot.prototype,"closeTag",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"size",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"skin",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"textStyle",2),Ft([c({type:String,reflect:!0})],Ot.prototype,"iconName",2),Ft([c({type:String})],Ot.prototype,"type",2),Ft([c({type:String})],Ot.prototype,"ariaLabel",2),Ft([Q()],Ot.prototype,"_isClosed",2),Ft([Q()],Ot.prototype,"_ariaDescription",2),Ot=Ft([se("pkt-tag")],Ot);var Ed=Object.defineProperty,Pd=Object.getOwnPropertyDescriptor,Ws=(s,e,t,i)=>{for(var n=i>1?void 0:i?Pd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Ed(e,t,n),n};let is=class extends zi{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,i){super.attributeChangedCallback(e,t,i),e==="level"&&i&&this.setLevel(Number(i)),e==="visuallyHidden"&&(this.visuallyHidden=i!==null&&i!=="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 b`<slot></slot>`}};Ws([c({type:String,reflect:!0})],is.prototype,"size",2),Ws([c({type:Number,reflect:!0})],is.prototype,"level",2),Ws([c({type:String,reflect:!0})],is.prototype,"weight",2),Ws([c({type:Boolean,reflect:!0})],is.prototype,"visuallyHidden",2),Ws([c({type:String,reflect:!0})],is.prototype,"align",2),is=Ws([se("pkt-heading")],is);const Ad={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},zs={props:Ad};var Id=Object.defineProperty,Ld=Object.getOwnPropertyDescriptor,et=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ld(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Id(e,t,n),n};let ze=class extends _e{constructor(){super(),this.defaultSlot=F(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=zs.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=zs.props.padding.default,this.skin=zs.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new Ae(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var e,t;const i={"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},n=((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 b`
|
|
320
320
|
<article
|
|
321
|
-
class=${
|
|
322
|
-
aria-label=${
|
|
321
|
+
class=${L(i)}
|
|
322
|
+
aria-label=${A(this.clickCardLink?n:r)}
|
|
323
323
|
>
|
|
324
324
|
${this.renderImage()}
|
|
325
325
|
<div class="pkt-card__wrapper">
|
|
326
|
-
${this.tagPosition==="top"?this.renderTags():
|
|
326
|
+
${this.tagPosition==="top"?this.renderTags():w}
|
|
327
327
|
${this.renderHeader()}
|
|
328
328
|
${this.renderSlot()}
|
|
329
|
-
${this.tagPosition==="bottom"?this.renderTags():
|
|
329
|
+
${this.tagPosition==="bottom"?this.renderTags():w}
|
|
330
330
|
${this.renderMetadata()}
|
|
331
331
|
</div>
|
|
332
332
|
</article>
|
|
333
|
-
`}renderImage(){const e={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return
|
|
334
|
-
${this.image.src&&
|
|
335
|
-
<div class=${
|
|
333
|
+
`}renderImage(){const e={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return b`
|
|
334
|
+
${this.image.src&&b`
|
|
335
|
+
<div class=${L(e)}>
|
|
336
336
|
<img src=${this.image.src} alt=${this.image.alt||""} />
|
|
337
337
|
</div>
|
|
338
338
|
`}
|
|
339
|
-
`}renderHeading(){return
|
|
340
|
-
${this.heading&&!this.clickCardLink?
|
|
339
|
+
`}renderHeading(){return b`
|
|
340
|
+
${this.heading&&!this.clickCardLink?b`
|
|
341
341
|
<pkt-heading
|
|
342
342
|
class="pkt-card__heading"
|
|
343
343
|
.level=${this.headinglevel||3}
|
|
@@ -347,9 +347,9 @@
|
|
|
347
347
|
>
|
|
348
348
|
${this.heading}
|
|
349
349
|
</pkt-heading>
|
|
350
|
-
`:
|
|
351
|
-
`}renderLinkHeading(){return
|
|
352
|
-
${this.clickCardLink?
|
|
350
|
+
`:w}
|
|
351
|
+
`}renderLinkHeading(){return b`
|
|
352
|
+
${this.clickCardLink?b`
|
|
353
353
|
<pkt-heading
|
|
354
354
|
class="pkt-card__link-heading pkt-card__heading"
|
|
355
355
|
.level=${this.headinglevel||3}
|
|
@@ -364,51 +364,51 @@
|
|
|
364
364
|
>${this.heading}</a
|
|
365
365
|
>
|
|
366
366
|
</pkt-heading>
|
|
367
|
-
`:
|
|
368
|
-
`}renderSubheading(){return
|
|
369
|
-
${this.subheading?
|
|
370
|
-
`}renderHeader(){const e=!!this.heading||!!this.subheading;return
|
|
371
|
-
${e?
|
|
367
|
+
`:w}
|
|
368
|
+
`}renderSubheading(){return b`
|
|
369
|
+
${this.subheading?b` <p class="pkt-card__subheading ">${this.subheading}</p> `:w}
|
|
370
|
+
`}renderHeader(){const e=!!this.heading||!!this.subheading;return b`
|
|
371
|
+
${e?b`
|
|
372
372
|
<header class="pkt-card__header">
|
|
373
373
|
${this.renderHeading()}
|
|
374
374
|
${this.renderLinkHeading()}
|
|
375
375
|
${this.renderSubheading()}
|
|
376
376
|
</header>
|
|
377
|
-
`:
|
|
378
|
-
`}renderTags(){const e={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return
|
|
379
|
-
${this.tags.length>0?
|
|
377
|
+
`:w}
|
|
378
|
+
`}renderTags(){const e={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return b`
|
|
379
|
+
${this.tags.length>0?b`
|
|
380
380
|
<div
|
|
381
|
-
class=${
|
|
381
|
+
class=${L(e)}
|
|
382
382
|
role="list"
|
|
383
383
|
aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
|
|
384
384
|
>
|
|
385
|
-
${this.tags.map(t=>
|
|
385
|
+
${this.tags.map(t=>b`
|
|
386
386
|
<pkt-tag
|
|
387
387
|
role="listitem"
|
|
388
388
|
textStyle="normal-text"
|
|
389
389
|
size="medium"
|
|
390
|
-
skin=${
|
|
391
|
-
iconName=${
|
|
390
|
+
skin=${A(t.skin)}
|
|
391
|
+
iconName=${A(t.iconName)}
|
|
392
392
|
>
|
|
393
393
|
<span>${t.text}</span>
|
|
394
394
|
</pkt-tag>
|
|
395
395
|
`)}
|
|
396
396
|
</div>
|
|
397
|
-
`:
|
|
398
|
-
`}renderSlot(){return
|
|
399
|
-
${this.defaultSlot&&
|
|
400
|
-
`}renderMetadata(){return
|
|
401
|
-
${this.metaLead||this.metaTrail?
|
|
397
|
+
`:w}
|
|
398
|
+
`}renderSlot(){return b`
|
|
399
|
+
${this.defaultSlot&&b`<section class="pkt-card__content" ${H(this.defaultSlot)}></section>`}
|
|
400
|
+
`}renderMetadata(){return b`
|
|
401
|
+
${this.metaLead||this.metaTrail?b`
|
|
402
402
|
<footer class="pkt-card__metadata">
|
|
403
|
-
${this.metaLead?
|
|
404
|
-
${this.metaTrail?
|
|
403
|
+
${this.metaLead?b`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:w}
|
|
404
|
+
${this.metaTrail?b`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:w}
|
|
405
405
|
</footer>
|
|
406
|
-
`:
|
|
407
|
-
`}};
|
|
406
|
+
`:w}
|
|
407
|
+
`}};et([c({type:String})],ze.prototype,"ariaLabel",2),et([c({type:String})],ze.prototype,"metaLead",2),et([c({type:Boolean})],ze.prototype,"borderOnHover",2),et([c({type:String,reflect:!0})],ze.prototype,"clickCardLink",2),et([c({type:String})],ze.prototype,"metaTrail",2),et([c({type:String})],ze.prototype,"layout",2),et([c({type:String})],ze.prototype,"heading",2),et([c({type:Number})],ze.prototype,"headinglevel",2),et([c({type:Object})],ze.prototype,"image",2),et([c({type:String})],ze.prototype,"imageShape",2),et([c({type:Boolean})],ze.prototype,"openLinkInNewTab",2),et([c({type:String})],ze.prototype,"padding",2),et([c({type:String,converter:{fromAttribute:s=>{const e=zs.props.skin.type;return s&&e.includes(s)?s:(s&&!e.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${zs.props.skin.default}".`),zs.props.skin.default)},toAttribute:s=>s}})],ze.prototype,"skin",2),et([c({type:String})],ze.prototype,"subheading",2),et([c({type:String})],ze.prototype,"tagPosition",2),et([c({type:Array})],ze.prototype,"tags",2),ze=et([se("pkt-card")],ze);/**
|
|
408
408
|
* @license
|
|
409
409
|
* Copyright 2017 Google LLC
|
|
410
410
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
411
|
-
*/const ra=(s,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(s[n],n);return i},On=fs(class extends Ls{constructor(s){if(super(s),s.type!==Tt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const n=[],r=[];let a=0;for(const c of s)n[a]=i?i(c,a):a,r[a]=t(c,a),a++;return{values:r,keys:n}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const n=hl(s),{values:r,keys:a}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=a,r;const c=this.ut??(this.ut=[]),h=[];let p,v,b=0,y=n.length-1,k=0,m=r.length-1;for(;b<=y&&k<=m;)if(n[b]===null)b++;else if(n[y]===null)y--;else if(c[b]===a[k])h[k]=gs(n[b],r[k]),b++,k++;else if(c[y]===a[m])h[m]=gs(n[y],r[m]),y--,m--;else if(c[b]===a[m])h[m]=gs(n[b],r[m]),li(s,h[m+1],n[b]),b++,m--;else if(c[y]===a[k])h[k]=gs(n[y],r[k]),li(s,n[b],n[y]),y--,k++;else if(p===void 0&&(p=ra(a,k,m),v=ra(c,b,y)),p.has(c[b]))if(p.has(c[y])){const w=v.get(a[k]),C=w!==void 0?n[w]:null;if(C===null){const M=li(s,n[b]);gs(M,r[k]),h[k]=M}else h[k]=gs(C,r[k]),li(s,n[b],C),n[w]=null;k++}else kn(n[y]),y--;else kn(n[b]),b++;for(;k<=m;){const w=li(s,h[m+1]);gs(w,r[k]),h[k++]=w}for(;b<=y;){const w=n[b++];w!==null&&kn(w)}return this.ut=a,Mr(s,h),ct}}),aa=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),xh=s=>new Promise(e=>setTimeout(e,s)),is=()=>{const s=aa(),e=aa();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)},ut={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Sh={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}},bt={props:Sh};var Ch={},oa;function Th(){return oa||(oa=1,(function(){(function(s){const e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,a=new WeakMap,c=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,k=new WeakMap,m=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"},M=(d,u)=>{for(let $ in C){u[$]=null;let x=null;const I=C[$];Object.defineProperty(u,$,{get(){return x},set(H){x=H,d.isConnected?P(d,I,H):v.set(d,u)}})}};function S(d){const u=n.get(d),{form:$}=u;Ae(d,$,u),ie(d,u.labels)}const E=(d,u=!1)=>{const $=document.createTreeWalker(d,NodeFilter.SHOW_ELEMENT,{acceptNode(H){return n.has(H)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let x=$.nextNode();const I=!u||d.disabled;for(;x;)x.formDisabledCallback&&I&&R(x,d.disabled),x=$.nextNode()},T={attributes:!0,attributeFilter:["disabled","name"]},j=Te()?new MutationObserver(d=>{for(const u of d){const $=u.target;if(u.attributeName==="disabled"&&($.constructor.formAssociated?R($,$.hasAttribute("disabled")):$.localName==="fieldset"&&E($)),u.attributeName==="name"&&$.constructor.formAssociated){const x=n.get($),I=p.get($);x.setFormValue(I)}}}):{};function K(d){d.forEach(u=>{const{addedNodes:$,removedNodes:x}=u,I=Array.from($),H=Array.from(x);I.forEach(G=>{var ot;if(n.has(G)&&G.constructor.formAssociated&&S(G),v.has(G)){const We=v.get(G);Object.keys(C).filter(lt=>We[lt]!==null).forEach(lt=>{P(G,C[lt],We[lt])}),v.delete(G)}if(w.has(G)){const We=w.get(G);P(G,"internals-valid",We.validity.valid.toString()),P(G,"internals-invalid",(!We.validity.valid).toString()),P(G,"aria-invalid",(!We.validity.valid).toString()),w.delete(G)}if(G.localName==="form"){const We=h.get(G),lt=document.createTreeWalker(G,NodeFilter.SHOW_ELEMENT,{acceptNode(Ke){return n.has(Ke)&&Ke.constructor.formAssociated&&!(We&&We.has(Ke))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ls=lt.nextNode();for(;ls;)S(ls),ls=lt.nextNode()}G.localName==="fieldset"&&((ot=j.observe)===null||ot===void 0||ot.call(j,G,T),E(G,!0))}),H.forEach(G=>{const ot=n.get(G);ot&&i.get(ot)&&Q(ot),c.has(G)&&c.get(G).disconnect()})})}function te(d){d.forEach(u=>{const{removedNodes:$}=u;$.forEach(x=>{const I=k.get(u.target);n.has(x)&&Ye(x),I.disconnect()})})}const Ce=d=>{var u,$;const x=new MutationObserver(te);!((u=window==null?void 0:window.ShadyDOM)===null||u===void 0)&&u.inUse&&d.mode&&d.host&&(d=d.host),($=x.observe)===null||$===void 0||$.call(x,d,{childList:!0}),k.set(d,x)};Te()&&new MutationObserver(K);const U={childList:!0,subtree:!0},P=(d,u,$)=>{d.getAttribute(u)!==$&&d.setAttribute(u,$)},R=(d,u)=>{d.toggleAttribute("internals-disabled",u),u?P(d,"aria-disabled","true"):d.removeAttribute("aria-disabled"),d.formDisabledCallback&&d.formDisabledCallback.apply(d,[u])},Q=d=>{i.get(d).forEach(u=>{u.remove()}),i.set(d,[])},z=(d,u)=>{const $=document.createElement("input");return $.type="hidden",$.name=d.getAttribute("name"),d.after($),i.get(u).push($),$},Z=(d,u)=>{var $;i.set(u,[]),($=j.observe)===null||$===void 0||$.call(j,d,T)},ie=(d,u)=>{if(u.length){Array.from(u).forEach(x=>x.addEventListener("click",d.click.bind(d)));let $=u[0].id;u[0].id||($=`${u[0].htmlFor}_Label`,u[0].id=$),P(d,"aria-labelledby",$)}},pe=d=>{const u=Array.from(d.elements).filter(H=>!H.tagName.includes("-")&&H.validity).map(H=>H.validity.valid),$=h.get(d)||[],x=Array.from($).filter(H=>H.isConnected).map(H=>n.get(H).validity.valid),I=[...u,...x].includes(!1);d.toggleAttribute("internals-invalid",I),d.toggleAttribute("internals-valid",!I)},ae=d=>{pe(ce(d.target))},me=d=>{pe(ce(d.target))},W=d=>{const u=["button[type=submit]","input[type=submit]","button:not([type])"].map($=>`${$}:not([disabled])`).map($=>`${$}:not([form])${d.id?`,${$}[form='${d.id}']`:""}`).join(",");d.addEventListener("click",$=>{if($.target.closest(u)){const x=h.get(d);if(d.noValidate)return;x.size&&Array.from(x).reverse().map(I=>n.get(I).reportValidity()).includes(!1)&&$.preventDefault()}})},oe=d=>{const u=h.get(d.target);u&&u.size&&u.forEach($=>{$.constructor.formAssociated&&$.formResetCallback&&$.formResetCallback.apply($)})},Ae=(d,u,$)=>{if(u){const x=h.get(u);if(x)x.add(d);else{const I=new Set;I.add(d),h.set(u,I),W(u),u.addEventListener("reset",oe),u.addEventListener("input",ae),u.addEventListener("change",me)}a.set(u,{ref:d,internals:$}),d.constructor.formAssociated&&d.formAssociatedCallback&&setTimeout(()=>{d.formAssociatedCallback.apply(d,[u])},0),pe(u)}},ce=d=>{let u=d.parentNode;return u&&u.tagName!=="FORM"&&(u=ce(u)),u},J=(d,u,$=DOMException)=>{if(!d.constructor.formAssociated)throw new $(u)},it=(d,u,$)=>{const x=h.get(d);return x&&x.size&&x.forEach(I=>{n.get(I)[$]()||(u=!1)}),u},Ye=d=>{if(d.constructor.formAssociated){const u=n.get(d),{labels:$,form:x}=u;ie(d,$),Ae(d,x,u)}};function Te(){return typeof MutationObserver<"u"}class nt{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 at=d=>(d.badInput=!1,d.customError=!1,d.patternMismatch=!1,d.rangeOverflow=!1,d.rangeUnderflow=!1,d.stepMismatch=!1,d.tooLong=!1,d.tooShort=!1,d.typeMismatch=!1,d.valid=!0,d.valueMissing=!1,d),ke=(d,u,$)=>(d.valid=Me(u),Object.keys(u).forEach(x=>d[x]=u[x]),$&&pe($),d),Me=d=>{let u=!0;for(let $ in d)$!=="valid"&&d[$]!==!1&&(u=!1);return u},Ze=new WeakMap;function Je(d,u){d.toggleAttribute(u,!0),d.part&&d.part.add(u)}class ft extends Set{static get isPolyfilled(){return!0}constructor(u){if(super(),!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Ze.set(this,u)}add(u){if(!/^--/.test(u)||typeof u!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${u} must start with '--'.`);const $=super.add(u),x=Ze.get(this),I=`state${u}`;return x.isConnected?Je(x,I):setTimeout(()=>{Je(x,I)}),$}clear(){for(let[u]of this.entries())this.delete(u);super.clear()}delete(u){const $=super.delete(u),x=Ze.get(this);return x.isConnected?(x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)):setTimeout(()=>{x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)}),$}}function ve(d,u,$,x){if(typeof u=="function"?d!==u||!x:!u.has(d))throw new TypeError("Cannot read private member from an object whose class did not declare it");return $==="m"?x:$==="a"?x.call(d):x?x.value:u.get(d)}function $e(d,u,$,x,I){if(typeof u=="function"?d!==u||!0:!u.has(d))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u.set(d,$),$}var Ue;class Ne{constructor(u){Ue.set(this,void 0),$e(this,Ue,u);for(let $=0;$<u.length;$++){let x=u[$];this[$]=x,x.hasAttribute("name")&&(this[x.getAttribute("name")]=x)}Object.freeze(this)}get length(){return ve(this,Ue,"f").length}[(Ue=new WeakMap,Symbol.iterator)](){return ve(this,Ue,"f")[Symbol.iterator]()}item(u){return this[u]==null?null:this[u]}namedItem(u){return this[u]==null?null:this[u]}}function xe(){const d=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=$;const u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=x;function $(...H){let G=d.apply(this,H);return it(this,G,"checkValidity")}function x(...H){let G=u.apply(this,H);return it(this,G,"reportValidity")}const{get:I}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...H){const G=I.call(this,...H),ot=Array.from(h.get(this)||[]);if(ot.length===0)return G;const We=Array.from(G).concat(ot).sort((lt,ls)=>lt.compareDocumentPosition?lt.compareDocumentPosition(ls)&2?1:-1:0);return new Ne(We)}})}class De{static get isPolyfilled(){return!0}constructor(u){if(!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const $=u.getRootNode(),x=new nt;this.states=new ft(u),e.set(this,u),t.set(this,x),n.set(u,this),M(u,this),Z(u,this),Object.seal(this),$ instanceof DocumentFragment&&Ce($)}checkValidity(){const u=e.get(this);if(J(u,"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 x=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});u.dispatchEvent(x)}return $.valid}get form(){const u=e.get(this);J(u,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let $;return u.constructor.formAssociated===!0&&($=ce(u)),$}get labels(){const u=e.get(this);J(u,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const $=u.getAttribute("id"),x=u.getRootNode();return x&&$?x.querySelectorAll(`[for="${$}"]`):[]}reportValidity(){const u=e.get(this);if(J(u,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const $=this.checkValidity(),x=y.get(this);if(x&&!u.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!$&&x&&(u.focus(),x.focus()),$}setFormValue(u){const $=e.get(this);if(J($,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Q(this),u!=null&&!(u instanceof FormData)){if($.getAttribute("name")){const x=z($,this);x.value=u}}else u!=null&&u instanceof FormData&&Array.from(u).reverse().forEach(([x,I])=>{if(typeof I=="string"){const H=z($,this);H.name=x,H.value=I}});p.set($,u)}setValidity(u,$,x){const I=e.get(this);if(J(I,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!u)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");y.set(this,x);const H=t.get(this),G={};for(const lt in u)G[lt]=u[lt];Object.keys(G).length===0&&at(H);const ot=Object.assign(Object.assign({},H),G);delete ot.valid;const{valid:We}=ke(H,ot,this.form);if(!We&&!$)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,We?"":$),I.isConnected?(I.toggleAttribute("internals-invalid",!We),I.toggleAttribute("internals-valid",We),P(I,"aria-invalid",`${!We}`)):w.set(I,this)}get shadowRoot(){const u=e.get(this);return b.get(u)||null}get validationMessage(){const u=e.get(this);return J(u,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),r.get(this)}get validity(){const u=e.get(this);return J(u,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),t.get(this)}get willValidate(){const u=e.get(this);return J(u,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(u.disabled||u.hasAttribute("disabled")||u.hasAttribute("readonly"))}}function Os(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class d extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const u=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(u,d);const $=new d;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(x=>x in $.internals)}let gt=!1,St=!1;function Ct(d){St||(St=!0,window.CustomStateSet=ft,d&&(HTMLElement.prototype.attachInternals=function(...u){const $=d.call(this,u);return $.states=new ft(this),$}))}function qt(d=!0){if(!gt){if(gt=!0,typeof window<"u"&&(window.ElementInternals=De),typeof CustomElementRegistry<"u"){const u=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function($,x,I){if(x.formAssociated){const H=x.prototype.connectedCallback;x.prototype.connectedCallback=function(){m.has(this)||(m.set(this,!0),this.hasAttribute("disabled")&&R(this,!0)),H!=null&&H.apply(this),Ye(this)}}u.call(this,$,x,I)}}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(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new De(this)}),typeof Element<"u"){let u=function(...x){const I=$.apply(this,x);if(b.set(this,I),Te()){const H=new MutationObserver(K);window.ShadyDOM?H.observe(this,U):H.observe(I,U),c.set(this,H)}return I};const $=Element.prototype.attachShadow;Element.prototype.attachShadow=u}Te()&&typeof document<"u"&&new MutationObserver(K).observe(document.documentElement,U),typeof HTMLFormElement<"u"&&xe(),(d||typeof window<"u"&&!window.CustomStateSet)&&Ct()}}return customElements.polyfillWrapFlushCallback||(Os()?typeof window<"u"&&!window.CustomStateSet&&Ct(HTMLElement.prototype.attachInternals):qt(!1)),s.forceCustomStateSetPolyfill=Ct,s.forceElementInternalsPolyfill=qt,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Ch}Th();var Mh=Object.defineProperty,Y=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&Mh(e,t,n),n};const la="on",En="--checked",Ji=",";let V=class extends fe{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=is(),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=bt.props.helptextDropdownButton.default,this.label=null,this.optionalText=ht.forms.labels.optional,this.requiredText=ht.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(e){var t,i,n,r,a,c,h,p,v,b,y;if(!e){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},ht.forms.messages.required,e):(t=e.validity)!=null&&t.typeMismatch||(i=e.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},ht.forms.messages.invalid,e):(n=e.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},ht.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},ht.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},ht.forms.messages.tooLong,e):(c=e.validity)!=null&&c.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?ht.forms.messages.rangeUnderflowMin.replace("{min}",(h=this.min)==null?void 0:h.toString()):ht.forms.messages.rangeUnderflow,e):(p=e.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},ht.forms.messages.invalid,e):(v=e.validity)!=null&&v.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?ht.forms.messages.rangeOverflowMax.replace("{max}",(b=this.max)==null?void 0:b.toString()):ht.forms.messages.rangeOverflow,e):(y=e.validity)!=null&&y.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(i=>{t.append(this.name,i)}),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 i;if(t!==this&&t.getAttribute("name")===this.name&&t.getAttribute("value")!==this.value){const n=t;n.checked&&(n.checked=!1,n.internals&&(n.internals.setFormValue(null),(i=n.internals.states)==null||i.delete(En)))}})}valueChecked(e){if(!this.touched)return;const t=this.internals.form||this.closest("form"),i=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 n=(typeof this.value=="string"?this.value:"")||la;this.internals.setFormValue(n),i&&i.append(this.name,n),this.internals.states.add(En)}else this.internals.setFormValue(null),i&&i.delete(this.name),this.internals.states.delete(En);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(Ji)&&(e=e.split(Ji)),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(Ji)?e.split(Ji):!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);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 i=t?(typeof this.value=="string"?this.value:"")||la:null;this.internals.setFormValue(i)}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))}};Y([o({type:Boolean,reflect:!0})],V.prototype,"checked"),Y([o({type:Boolean})],V.prototype,"defaultChecked"),Y([o({type:Boolean})],V.prototype,"multiple"),Y([o({type:Boolean})],V.prototype,"range"),Y([o({type:String,reflect:!0})],V.prototype,"type"),Y([o()],V.prototype,"defaultValue"),Y([o({type:Boolean,reflect:!0})],V.prototype,"disabled"),Y([o({type:Boolean,reflect:!0})],V.prototype,"readonly"),Y([o({type:Boolean,reflect:!0})],V.prototype,"required"),Y([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],V.prototype,"max"),Y([o({type:Number,reflect:!0})],V.prototype,"maxlength"),Y([o({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],V.prototype,"min"),Y([o({type:Number,reflect:!0})],V.prototype,"minlength"),Y([o({type:Number,reflect:!0})],V.prototype,"step"),Y([o({type:String})],V.prototype,"ariaDescribedBy"),Y([o({type:String})],V.prototype,"ariaLabelledby"),Y([o({type:String,reflect:!0})],V.prototype,"name"),Y([o({type:String,reflect:!0})],V.prototype,"pattern"),Y([o({type:String,reflect:!0})],V.prototype,"placeholder"),Y([o({type:String,reflect:!0})],V.prototype,"id"),Y([o({type:Boolean})],V.prototype,"counter"),Y([o({type:Boolean})],V.prototype,"hasError"),Y([o({type:Boolean})],V.prototype,"inline"),Y([o({type:Boolean})],V.prototype,"hasFieldset"),Y([o({type:Boolean})],V.prototype,"optionalTag"),Y([o({type:Boolean})],V.prototype,"requiredTag"),Y([o({type:Boolean})],V.prototype,"skipForwardTestid"),Y([o({type:Boolean,reflect:!0,converter:ut})],V.prototype,"useWrapper"),Y([o({type:Boolean,reflect:!0})],V.prototype,"fullwidth"),Y([o({type:Number})],V.prototype,"counterMaxLength"),Y([o({type:String})],V.prototype,"errorMessage"),Y([o({type:String})],V.prototype,"helptext"),Y([o({type:String})],V.prototype,"helptextDropdown"),Y([o({type:String,reflect:!1})],V.prototype,"helptextDropdownButton"),Y([o({type:String})],V.prototype,"label"),Y([o({type:String,reflect:!1})],V.prototype,"optionalText"),Y([o({type:String,reflect:!1})],V.prototype,"requiredText"),Y([o({type:String,reflect:!1})],V.prototype,"tagText"),Y([o({type:String,attribute:"data-testid"})],V.prototype,"dataTestid");let ca=class{constructor(e){this.nodes=[],this.options=[],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.host.requestUpdate()}handleMutations(e){let t=!1;e.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{Bs(n)&&(this.addNode(n),t=!0)}),i.removedNodes.forEach(n=>{Bs(n)&&(this.nodes=this.nodes.filter(r=>r!==n),t=!0)})),i.type==="attributes"&&Bs(i.target)&&(this.addNode(i.target),t=!0)}),t&&this.createOptions()}};var Nh=Object.defineProperty,Dh=Object.getOwnPropertyDescriptor,ws=(s,e,t,i)=>{for(var n=i>1?void 0:i?Dh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Nh(e,t,n),n};let Yt=class extends fe{constructor(){super(),this.defaultSlot=L(),this.forId=is(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=bt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new Oe(this,this.defaultSlot)}updateSlots(e){this.filledSlots=new Set(e)}render(){const e=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},t=A({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?f`<div class="pkt-inputwrapper__helptext-expandable">
|
|
411
|
+
*/const fa=(s,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(s[n],n);return i},Ln=ms(class extends Bs{constructor(s){if(super(s),s.type!==Mt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const n=[],r=[];let a=0;for(const l of s)n[a]=i?i(l,a):a,r[a]=t(l,a),a++;return{values:r,keys:n}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const n=wl(s),{values:r,keys:a}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=a,r;const l=this.ut??(this.ut=[]),d=[];let p,m,v=0,y=n.length-1,k=0,g=r.length-1;for(;v<=y&&k<=g;)if(n[v]===null)v++;else if(n[y]===null)y--;else if(l[v]===a[k])d[k]=gs(n[v],r[k]),v++,k++;else if(l[y]===a[g])d[g]=gs(n[y],r[g]),y--,g--;else if(l[v]===a[g])d[g]=gs(n[v],r[g]),li(s,d[g+1],n[v]),v++,g--;else if(l[y]===a[k])d[k]=gs(n[y],r[k]),li(s,n[v],n[y]),y--,k++;else if(p===void 0&&(p=fa(a,k,g),m=fa(l,v,y)),p.has(l[v]))if(p.has(l[y])){const $=m.get(a[k]),C=$!==void 0?n[$]:null;if(C===null){const M=li(s,n[v]);gs(M,r[k]),d[k]=M}else d[k]=gs(C,r[k]),li(s,n[v],C),n[$]=null;k++}else Sn(n[y]),y--;else Sn(n[v]),v++;for(;k<=g;){const $=li(s,d[g+1]);gs($,r[k]),d[k++]=$}for(;v<=y;){const $=n[v++];$!==null&&Sn($)}return this.ut=a,Br(s,d),ft}}),ma=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Bd=s=>new Promise(e=>setTimeout(e,s)),ns=()=>{const s=ma(),e=ma();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)},gt={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Fd={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}},$t={props:Fd};var Hd={},ga;function Vd(){return ga||(ga=1,(function(){(function(s){const e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,a=new WeakMap,l=new WeakMap,d=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,k=new WeakMap,g=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"},M=(f,u)=>{for(let _ in C){u[_]=null;let x=null;const B=C[_];Object.defineProperty(u,_,{get(){return x},set(U){x=U,f.isConnected?N(f,B,U):m.set(f,u)}})}};function S(f){const u=n.get(f),{form:_}=u;Ee(f,_,u),ae(f,u.labels)}const E=(f,u=!1)=>{const _=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(U){return n.has(U)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let x=_.nextNode();const B=!u||f.disabled;for(;x;)x.formDisabledCallback&&B&&j(x,f.disabled),x=_.nextNode()},T={attributes:!0,attributeFilter:["disabled","name"]},V=Ne()?new MutationObserver(f=>{for(const u of f){const _=u.target;if(u.attributeName==="disabled"&&(_.constructor.formAssociated?j(_,_.hasAttribute("disabled")):_.localName==="fieldset"&&E(_)),u.attributeName==="name"&&_.constructor.formAssociated){const x=n.get(_),B=p.get(_);x.setFormValue(B)}}}):{};function G(f){f.forEach(u=>{const{addedNodes:_,removedNodes:x}=u,B=Array.from(_),U=Array.from(x);B.forEach(ee=>{var ht;if(n.has(ee)&&ee.constructor.formAssociated&&S(ee),m.has(ee)){const Qe=m.get(ee);Object.keys(C).filter(pt=>Qe[pt]!==null).forEach(pt=>{N(ee,C[pt],Qe[pt])}),m.delete(ee)}if($.has(ee)){const Qe=$.get(ee);N(ee,"internals-valid",Qe.validity.valid.toString()),N(ee,"internals-invalid",(!Qe.validity.valid).toString()),N(ee,"aria-invalid",(!Qe.validity.valid).toString()),$.delete(ee)}if(ee.localName==="form"){const Qe=d.get(ee),pt=document.createTreeWalker(ee,NodeFilter.SHOW_ELEMENT,{acceptNode(Re){return n.has(Re)&&Re.constructor.formAssociated&&!(Qe&&Qe.has(Re))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let cs=pt.nextNode();for(;cs;)S(cs),cs=pt.nextNode()}ee.localName==="fieldset"&&((ht=V.observe)===null||ht===void 0||ht.call(V,ee,T),E(ee,!0))}),U.forEach(ee=>{const ht=n.get(ee);ht&&i.get(ht)&&J(ht),l.has(ee)&&l.get(ee).disconnect()})})}function ie(f){f.forEach(u=>{const{removedNodes:_}=u;_.forEach(x=>{const B=k.get(u.target);n.has(x)&&Ve(x),B.disconnect()})})}const we=f=>{var u,_;const x=new MutationObserver(ie);!((u=window==null?void 0:window.ShadyDOM)===null||u===void 0)&&u.inUse&&f.mode&&f.host&&(f=f.host),(_=x.observe)===null||_===void 0||_.call(x,f,{childList:!0}),k.set(f,x)};Ne()&&new MutationObserver(G);const D={childList:!0,subtree:!0},N=(f,u,_)=>{f.getAttribute(u)!==_&&f.setAttribute(u,_)},j=(f,u)=>{f.toggleAttribute("internals-disabled",u),u?N(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[u])},J=f=>{i.get(f).forEach(u=>{u.remove()}),i.set(f,[])},X=(f,u)=>{const _=document.createElement("input");return _.type="hidden",_.name=f.getAttribute("name"),f.after(_),i.get(u).push(_),_},ne=(f,u)=>{var _;i.set(u,[]),(_=V.observe)===null||_===void 0||_.call(V,f,T)},ae=(f,u)=>{if(u.length){Array.from(u).forEach(x=>x.addEventListener("click",f.click.bind(f)));let _=u[0].id;u[0].id||(_=`${u[0].htmlFor}_Label`,u[0].id=_),N(f,"aria-labelledby",_)}},pe=f=>{const u=Array.from(f.elements).filter(U=>!U.tagName.includes("-")&&U.validity).map(U=>U.validity.valid),_=d.get(f)||[],x=Array.from(_).filter(U=>U.isConnected).map(U=>n.get(U).validity.valid),B=[...u,...x].includes(!1);f.toggleAttribute("internals-invalid",B),f.toggleAttribute("internals-valid",!B)},oe=f=>{pe(le(f.target))},ve=f=>{pe(le(f.target))},z=f=>{const u=["button[type=submit]","input[type=submit]","button:not([type])"].map(_=>`${_}:not([disabled])`).map(_=>`${_}:not([form])${f.id?`,${_}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",_=>{if(_.target.closest(u)){const x=d.get(f);if(f.noValidate)return;x.size&&Array.from(x).reverse().map(B=>n.get(B).reportValidity()).includes(!1)&&_.preventDefault()}})},Y=f=>{const u=d.get(f.target);u&&u.size&&u.forEach(_=>{_.constructor.formAssociated&&_.formResetCallback&&_.formResetCallback.apply(_)})},Ee=(f,u,_)=>{if(u){const x=d.get(u);if(x)x.add(f);else{const B=new Set;B.add(f),d.set(u,B),z(u),u.addEventListener("reset",Y),u.addEventListener("input",oe),u.addEventListener("change",ve)}a.set(u,{ref:f,internals:_}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[u])},0),pe(u)}},le=f=>{let u=f.parentNode;return u&&u.tagName!=="FORM"&&(u=le(u)),u},re=(f,u,_=DOMException)=>{if(!f.constructor.formAssociated)throw new _(u)},Ge=(f,u,_)=>{const x=d.get(f);return x&&x.size&&x.forEach(B=>{n.get(B)[_]()||(u=!1)}),u},Ve=f=>{if(f.constructor.formAssociated){const u=n.get(f),{labels:_,form:x}=u;ae(f,_),Ee(f,x,u)}};function Ne(){return typeof MutationObserver<"u"}class Xe{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 rt=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),xe=(f,u,_)=>(f.valid=Se(u),Object.keys(u).forEach(x=>f[x]=u[x]),_&&pe(_),f),Se=f=>{let u=!0;for(let _ in f)_!=="valid"&&f[_]!==!1&&(u=!1);return u},Pe=new WeakMap;function Ue(f,u){f.toggleAttribute(u,!0),f.part&&f.part.add(u)}class at extends Set{static get isPolyfilled(){return!0}constructor(u){if(super(),!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");Pe.set(this,u)}add(u){if(!/^--/.test(u)||typeof u!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${u} must start with '--'.`);const _=super.add(u),x=Pe.get(this),B=`state${u}`;return x.isConnected?Ue(x,B):setTimeout(()=>{Ue(x,B)}),_}clear(){for(let[u]of this.entries())this.delete(u);super.clear()}delete(u){const _=super.delete(u),x=Pe.get(this);return x.isConnected?(x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)):setTimeout(()=>{x.toggleAttribute(`state${u}`,!1),x.part&&x.part.remove(`state${u}`)}),_}}function be(f,u,_,x){if(typeof u=="function"?f!==u||!x:!u.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return _==="m"?x:_==="a"?x.call(f):x?x.value:u.get(f)}function ke(f,u,_,x,B){if(typeof u=="function"?f!==u||!0:!u.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u.set(f,_),_}var W;class de{constructor(u){W.set(this,void 0),ke(this,W,u);for(let _=0;_<u.length;_++){let x=u[_];this[_]=x,x.hasAttribute("name")&&(this[x.getAttribute("name")]=x)}Object.freeze(this)}get length(){return be(this,W,"f").length}[(W=new WeakMap,Symbol.iterator)](){return be(this,W,"f")[Symbol.iterator]()}item(u){return this[u]==null?null:this[u]}namedItem(u){return this[u]==null?null:this[u]}}function Z(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=_;const u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=x;function _(...U){let ee=f.apply(this,U);return Ge(this,ee,"checkValidity")}function x(...U){let ee=u.apply(this,U);return Ge(this,ee,"reportValidity")}const{get:B}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...U){const ee=B.call(this,...U),ht=Array.from(d.get(this)||[]);if(ht.length===0)return ee;const Qe=Array.from(ee).concat(ht).sort((pt,cs)=>pt.compareDocumentPosition?pt.compareDocumentPosition(cs)&2?1:-1:0);return new de(Qe)}})}class te{static get isPolyfilled(){return!0}constructor(u){if(!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const _=u.getRootNode(),x=new Xe;this.states=new at(u),e.set(this,u),t.set(this,x),n.set(u,this),M(u,this),ne(u,this),Object.seal(this),_ instanceof DocumentFragment&&we(_)}checkValidity(){const u=e.get(this);if(re(u,"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 x=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});u.dispatchEvent(x)}return _.valid}get form(){const u=e.get(this);re(u,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let _;return u.constructor.formAssociated===!0&&(_=le(u)),_}get labels(){const u=e.get(this);re(u,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const _=u.getAttribute("id"),x=u.getRootNode();return x&&_?x.querySelectorAll(`[for="${_}"]`):[]}reportValidity(){const u=e.get(this);if(re(u,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const _=this.checkValidity(),x=y.get(this);if(x&&!u.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!_&&x&&(u.focus(),x.focus()),_}setFormValue(u){const _=e.get(this);if(re(_,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),J(this),u!=null&&!(u instanceof FormData)){if(_.getAttribute("name")){const x=X(_,this);x.value=u}}else u!=null&&u instanceof FormData&&Array.from(u).reverse().forEach(([x,B])=>{if(typeof B=="string"){const U=X(_,this);U.name=x,U.value=B}});p.set(_,u)}setValidity(u,_,x){const B=e.get(this);if(re(B,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!u)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");y.set(this,x);const U=t.get(this),ee={};for(const pt in u)ee[pt]=u[pt];Object.keys(ee).length===0&&rt(U);const ht=Object.assign(Object.assign({},U),ee);delete ht.valid;const{valid:Qe}=xe(U,ht,this.form);if(!Qe&&!_)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,Qe?"":_),B.isConnected?(B.toggleAttribute("internals-invalid",!Qe),B.toggleAttribute("internals-valid",Qe),N(B,"aria-invalid",`${!Qe}`)):$.set(B,this)}get shadowRoot(){const u=e.get(this);return v.get(u)||null}get validationMessage(){const u=e.get(this);return re(u,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),r.get(this)}get validity(){const u=e.get(this);return re(u,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),t.get(this)}get willValidate(){const u=e.get(this);return re(u,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(u.disabled||u.hasAttribute("disabled")||u.hasAttribute("readonly"))}}function ut(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const u=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(u,f);const _=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(x=>x in _.internals)}let Be=!1,je=!1;function yt(f){je||(je=!0,window.CustomStateSet=at,f&&(HTMLElement.prototype.attachInternals=function(...u){const _=f.call(this,u);return _.states=new at(this),_}))}function zt(f=!0){if(!Be){if(Be=!0,typeof window<"u"&&(window.ElementInternals=te),typeof CustomElementRegistry<"u"){const u=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(_,x,B){if(x.formAssociated){const U=x.prototype.connectedCallback;x.prototype.connectedCallback=function(){g.has(this)||(g.set(this,!0),this.hasAttribute("disabled")&&j(this,!0)),U!=null&&U.apply(this),Ve(this)}}u.call(this,_,x,B)}}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(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new te(this)}),typeof Element<"u"){let u=function(...x){const B=_.apply(this,x);if(v.set(this,B),Ne()){const U=new MutationObserver(G);window.ShadyDOM?U.observe(this,D):U.observe(B,D),l.set(this,U)}return B};const _=Element.prototype.attachShadow;Element.prototype.attachShadow=u}Ne()&&typeof document<"u"&&new MutationObserver(G).observe(document.documentElement,D),typeof HTMLFormElement<"u"&&Z(),(f||typeof window<"u"&&!window.CustomStateSet)&&yt()}}return customElements.polyfillWrapFlushCallback||(ut()?typeof window<"u"&&!window.CustomStateSet&&yt(HTMLElement.prototype.attachInternals):zt(!1)),s.forceCustomStateSetPolyfill=yt,s.forceElementInternalsPolyfill=zt,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Hd}Vd();var Ud=Object.defineProperty,R=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&Ud(e,t,n),n};const va="on",Bn="--checked",en=",";let q=class extends _e{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=ns(),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=$t.props.helptextDropdownButton.default,this.label=null,this.optionalText=mt.forms.labels.optional,this.requiredText=mt.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(e){var t,i,n,r,a,l,d,p,m,v,y;if(!e){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},mt.forms.messages.required,e):(t=e.validity)!=null&&t.typeMismatch||(i=e.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},mt.forms.messages.invalid,e):(n=e.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},mt.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},mt.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},mt.forms.messages.tooLong,e):(l=e.validity)!=null&&l.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?mt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):mt.forms.messages.rangeUnderflow,e):(p=e.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},mt.forms.messages.invalid,e):(m=e.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?mt.forms.messages.rangeOverflowMax.replace("{max}",(v=this.max)==null?void 0:v.toString()):mt.forms.messages.rangeOverflow,e):(y=e.validity)!=null&&y.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(i=>{t.append(this.name,i)}),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 i;if(t!==this&&t.getAttribute("name")===this.name&&t.getAttribute("value")!==this.value){const n=t;n.checked&&(n.checked=!1,n.internals&&(n.internals.setFormValue(null),(i=n.internals.states)==null||i.delete(Bn)))}})}valueChecked(e){if(!this.touched)return;const t=this.internals.form||this.closest("form"),i=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 n=(typeof this.value=="string"?this.value:"")||va;this.internals.setFormValue(n),i&&i.append(this.name,n),this.internals.states.add(Bn)}else this.internals.setFormValue(null),i&&i.delete(this.name),this.internals.states.delete(Bn);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(en)&&(e=e.split(en)),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(en)?e.split(en):!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);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 i=t?(typeof this.value=="string"?this.value:"")||va:null;this.internals.setFormValue(i)}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))}};R([c({type:Boolean,reflect:!0})],q.prototype,"checked"),R([c({type:Boolean})],q.prototype,"defaultChecked"),R([c({type:Boolean})],q.prototype,"multiple"),R([c({type:Boolean})],q.prototype,"range"),R([c({type:String,reflect:!0})],q.prototype,"type"),R([c()],q.prototype,"defaultValue"),R([c({type:Boolean,reflect:!0})],q.prototype,"disabled"),R([c({type:Boolean,reflect:!0})],q.prototype,"readonly"),R([c({type:Boolean,reflect:!0})],q.prototype,"required"),R([c({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],q.prototype,"max"),R([c({type:Number,reflect:!0})],q.prototype,"maxlength"),R([c({reflect:!0,converter:{fromAttribute:s=>s,toAttribute:s=>(s==null?void 0:s.toString())??null}})],q.prototype,"min"),R([c({type:Number,reflect:!0})],q.prototype,"minlength"),R([c({type:Number,reflect:!0})],q.prototype,"step"),R([c({type:String})],q.prototype,"ariaDescribedBy"),R([c({type:String})],q.prototype,"ariaLabelledby"),R([c({type:String,reflect:!0})],q.prototype,"name"),R([c({type:String,reflect:!0})],q.prototype,"pattern"),R([c({type:String,reflect:!0})],q.prototype,"placeholder"),R([c({type:String,reflect:!0})],q.prototype,"id"),R([c({type:Boolean})],q.prototype,"counter"),R([c({type:Boolean})],q.prototype,"hasError"),R([c({type:Boolean})],q.prototype,"inline"),R([c({type:Boolean})],q.prototype,"hasFieldset"),R([c({type:Boolean})],q.prototype,"optionalTag"),R([c({type:Boolean})],q.prototype,"requiredTag"),R([c({type:Boolean})],q.prototype,"skipForwardTestid"),R([c({type:Boolean,reflect:!0,converter:gt})],q.prototype,"useWrapper"),R([c({type:Boolean,reflect:!0})],q.prototype,"fullwidth"),R([c({type:Number})],q.prototype,"counterMaxLength"),R([c({type:String})],q.prototype,"errorMessage"),R([c({type:String})],q.prototype,"helptext"),R([c({type:String})],q.prototype,"helptextDropdown"),R([c({type:String,reflect:!1})],q.prototype,"helptextDropdownButton"),R([c({type:String})],q.prototype,"label"),R([c({type:String,reflect:!1})],q.prototype,"optionalText"),R([c({type:String,reflect:!1})],q.prototype,"requiredText"),R([c({type:String,reflect:!1})],q.prototype,"tagText"),R([c({type:String,attribute:"data-testid"})],q.prototype,"dataTestid");let ba=class{constructor(e){this.nodes=[],this.options=[],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.host.requestUpdate()}handleMutations(e){let t=!1;e.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{Fs(n)&&(this.addNode(n),t=!0)}),i.removedNodes.forEach(n=>{Fs(n)&&(this.nodes=this.nodes.filter(r=>r!==n),t=!0)})),i.type==="attributes"&&Fs(i.target)&&(this.addNode(i.target),t=!0)}),t&&this.createOptions()}};var jd=Object.defineProperty,qd=Object.getOwnPropertyDescriptor,ws=(s,e,t,i)=>{for(var n=i>1?void 0:i?qd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&jd(e,t,n),n};let Kt=class extends _e{constructor(){super(),this.defaultSlot=F(),this.forId=ns(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=$t.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new Ae(this,this.defaultSlot)}updateSlots(e){this.filledSlots=new Set(e)}render(){const e=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},t=L({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?b`<div class="pkt-inputwrapper__helptext-expandable">
|
|
412
412
|
<button
|
|
413
413
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
414
414
|
type="button"
|
|
@@ -418,79 +418,79 @@
|
|
|
418
418
|
class="pkt-btn__icon"
|
|
419
419
|
name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
|
|
420
420
|
></pkt-icon>
|
|
421
|
-
<span class="pkt-btn__text">${
|
|
421
|
+
<span class="pkt-btn__text">${Gi(this.helptextDropdownButton)}</span>
|
|
422
422
|
</button>
|
|
423
423
|
<div
|
|
424
|
-
class="${
|
|
424
|
+
class="${L({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
|
|
425
425
|
>
|
|
426
|
-
${
|
|
426
|
+
${Gi(this.helptextDropdown)}
|
|
427
427
|
</div>
|
|
428
|
-
</div>`:
|
|
428
|
+
</div>`:w;return b`${b`<div class="${t}">
|
|
429
429
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
430
|
-
<div class="pkt-contents" ${
|
|
431
|
-
${this.helptext&&
|
|
430
|
+
<div class="pkt-contents" ${H(this.defaultSlot)} name="helptext"></div>
|
|
431
|
+
${this.helptext&&Gi(this.helptext)}
|
|
432
432
|
</div>
|
|
433
433
|
${i()}
|
|
434
|
-
</div>`}`}};ws([
|
|
435
|
-
${this.tagText?
|
|
436
|
-
${this.optionalTag?
|
|
437
|
-
${this.requiredTag?
|
|
438
|
-
`,r=()=>this.useWrapper?this.hasFieldset?
|
|
434
|
+
</div>`}`}};ws([c({type:String,reflect:!0})],Kt.prototype,"forId",2),ws([c({type:String})],Kt.prototype,"helptext",2),ws([c({type:String})],Kt.prototype,"helptextDropdown",2),ws([c({type:String})],Kt.prototype,"helptextDropdownButton",2),ws([Q()],Kt.prototype,"isHelpTextOpen",2),ws([Q()],Kt.prototype,"filledSlots",2),Kt=ws([se("pkt-helptext")],Kt);var Wd=Object.defineProperty,zd=Object.getOwnPropertyDescriptor,Me=(s,e,t,i)=>{for(var n=i>1?void 0:i?zd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Wd(e,t,n),n};let Ce=class extends _e{constructor(){super(),this.defaultSlot=F(),this.helptextSlot=F(),this.forId=ns(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=$t.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=$t.props.optionalTag.default,this.optionalText=$t.props.optionalText.default,this.requiredTag=$t.props.requiredTag.default,this.requiredText=$t.props.requiredText.default,this.tagText=null,this.hasError=$t.props.hasError.default,this.errorMessage="",this.disabled=$t.props.disabled.default,this.inline=$t.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=$t.props.hasFieldset.default,this.role="group",this.useWrapper=$t.props.useWrapper.default,this.slotController=new Ae(this,this.defaultSlot,this.helptextSlot)}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",i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:w,n=()=>b`
|
|
435
|
+
${this.tagText?b`<span class=${t+" pkt-tag--gray"}>${this.tagText}</span>`:w}
|
|
436
|
+
${this.optionalTag?b`<span class=${t+" pkt-tag--blue-light"}>${this.optionalText}</span>`:w}
|
|
437
|
+
${this.requiredTag?b`<span class=${t+" pkt-tag--beige"}>${this.requiredText}</span>`:w}
|
|
438
|
+
`,r=()=>this.useWrapper?this.hasFieldset?b`<legend
|
|
439
439
|
class="pkt-inputwrapper__legend"
|
|
440
440
|
id="${this.forId}-label"
|
|
441
441
|
@click=${this.handleLabelClick}
|
|
442
442
|
>
|
|
443
443
|
${this.label} ${n()}
|
|
444
|
-
</legend>`:
|
|
444
|
+
</legend>`:b`<label
|
|
445
445
|
class="pkt-inputwrapper__label"
|
|
446
446
|
for="${this.forId}"
|
|
447
447
|
aria-describedby="${i}"
|
|
448
448
|
id="${this.forId}-label"
|
|
449
449
|
@click=${this.handleLabelClick}
|
|
450
450
|
>${this.label}${n()}</label
|
|
451
|
-
>`:
|
|
451
|
+
>`:b`<label
|
|
452
452
|
for="${this.forId}"
|
|
453
453
|
class="pkt-sr-only"
|
|
454
454
|
aria-describedby="${i}"
|
|
455
455
|
id="${this.forId}-label"
|
|
456
456
|
>
|
|
457
457
|
${this.label}
|
|
458
|
-
</label>`,a=()=>
|
|
458
|
+
</label>`,a=()=>b`
|
|
459
459
|
<pkt-helptext
|
|
460
|
-
class="${
|
|
460
|
+
class="${A(this.useWrapper?void 0:"pkt-hide")}"
|
|
461
461
|
.forId=${this.forId}
|
|
462
462
|
.helptext=${this.helptext}
|
|
463
463
|
.helptextDropdown=${this.helptextDropdown}
|
|
464
|
-
.helptextDropdownButton=${this.helptextDropdownButton
|
|
465
|
-
@toggleHelpText=${
|
|
466
|
-
${
|
|
464
|
+
.helptextDropdownButton=${this.helptextDropdownButton||$t.props.helptextDropdownButton.default}
|
|
465
|
+
@toggleHelpText=${v=>{this.toggleDropdown(v)}}
|
|
466
|
+
${H(this.helptextSlot)}
|
|
467
467
|
name="helptext"
|
|
468
468
|
></pkt-helptext>
|
|
469
|
-
`,
|
|
470
|
-
${this.counterError?this.counterError:
|
|
471
|
-
${this.counterMaxLength?`/${this.counterMaxLength}`:
|
|
472
|
-
</div>`:
|
|
469
|
+
`,l=()=>this.counter?b`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
470
|
+
${this.counterError?this.counterError:w} ${this.counterCurrent||0}
|
|
471
|
+
${this.counterMaxLength?`/${this.counterMaxLength}`:w}
|
|
472
|
+
</div>`:w,d=()=>this.hasError&&this.errorMessage?b`<pkt-alert
|
|
473
473
|
skin="error"
|
|
474
474
|
compact
|
|
475
475
|
id=${`${this.forId}-error`}
|
|
476
476
|
aria-live="assertive"
|
|
477
477
|
aria-atomic="true"
|
|
478
478
|
>
|
|
479
|
-
${
|
|
480
|
-
</pkt-alert>`:
|
|
479
|
+
${Gi(this.errorMessage)}
|
|
480
|
+
</pkt-alert>`:w,p=()=>b`
|
|
481
481
|
${r()}
|
|
482
482
|
${a()}
|
|
483
|
-
${this.counterPosition==="top"?
|
|
484
|
-
<div class="pkt-contents" ${
|
|
485
|
-
${this.counterPosition==="bottom"?
|
|
486
|
-
${
|
|
487
|
-
`,
|
|
483
|
+
${this.counterPosition==="top"?l():w}
|
|
484
|
+
<div class="pkt-contents" ${H(this.defaultSlot)}></div>
|
|
485
|
+
${this.counterPosition==="bottom"?l():w}
|
|
486
|
+
${d()}
|
|
487
|
+
`,m=()=>this.hasFieldset?b`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
|
|
488
488
|
${p()}
|
|
489
|
-
</fieldset>`:
|
|
489
|
+
</fieldset>`:b`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return b`<div class=${L(e)}>${m()}</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"}))}};Me([c({type:String})],Ce.prototype,"forId",2),Me([c({type:String})],Ce.prototype,"label",2),Me([c({type:String})],Ce.prototype,"helptext",2),Me([c({type:String})],Ce.prototype,"helptextDropdown",2),Me([c({type:String})],Ce.prototype,"helptextDropdownButton",2),Me([c({type:Boolean})],Ce.prototype,"counter",2),Me([c({type:Number})],Ce.prototype,"counterCurrent",2),Me([c({type:Number})],Ce.prototype,"counterMaxLength",2),Me([c({type:String})],Ce.prototype,"counterError",2),Me([c({type:String,reflect:!1})],Ce.prototype,"counterPosition",2),Me([c({type:Boolean})],Ce.prototype,"optionalTag",2),Me([c({type:String})],Ce.prototype,"optionalText",2),Me([c({type:Boolean})],Ce.prototype,"requiredTag",2),Me([c({type:String})],Ce.prototype,"requiredText",2),Me([c({type:String})],Ce.prototype,"tagText",2),Me([c({type:Boolean})],Ce.prototype,"hasError",2),Me([c({type:String})],Ce.prototype,"errorMessage",2),Me([c({type:Boolean})],Ce.prototype,"disabled",2),Me([c({type:Boolean})],Ce.prototype,"inline",2),Me([c({type:String})],Ce.prototype,"ariaDescribedby",2),Me([c({type:Boolean})],Ce.prototype,"hasFieldset",2),Me([c({type:String,reflect:!0})],Ce.prototype,"role",2),Me([c({type:Boolean,reflect:!0,converter:gt})],Ce.prototype,"useWrapper",2),Ce=Me([se("pkt-input-wrapper")],Ce);var Yd=Object.defineProperty,Kd=Object.getOwnPropertyDescriptor,ot=(s,e,t,i)=>{for(var n=i>1?void 0:i?Kd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Yd(e,t,n),n};let tt=class extends _e{constructor(){super(...arguments),this.id=ns(),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._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)}updated(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,i){(e==="options"||e==="searchValue"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,i)}render(){return b`
|
|
490
490
|
<div
|
|
491
|
-
class=${
|
|
491
|
+
class=${L({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
492
492
|
role="listbox"
|
|
493
|
-
aria-label=${
|
|
493
|
+
aria-label=${A(this.label)}
|
|
494
494
|
>
|
|
495
495
|
<div class="pkt-listbox__banners">
|
|
496
496
|
${this.renderMaximumReachedBanner()} ${this.renderUserMessage()}
|
|
@@ -500,7 +500,7 @@
|
|
|
500
500
|
${this.renderList()}
|
|
501
501
|
</ul>
|
|
502
502
|
</div>
|
|
503
|
-
`}renderCheckboxOrCheckIcon(e,t){return this.isMultiSelect?
|
|
503
|
+
`}renderCheckboxOrCheckIcon(e,t){return this.isMultiSelect?b`
|
|
504
504
|
<input
|
|
505
505
|
class="pkt-input-check__input-checkbox"
|
|
506
506
|
type="checkbox"
|
|
@@ -511,13 +511,13 @@
|
|
|
511
511
|
aria-labelledby=${this.id+"-option-label-"+t}
|
|
512
512
|
?disabled=${this.disabled||e.disabled||this.maxIsReached&&!e.selected}
|
|
513
513
|
/>
|
|
514
|
-
`:e.selected?
|
|
515
|
-
${
|
|
514
|
+
`:e.selected?b`<pkt-icon name="check-big"></pkt-icon>`:w}renderList(){return b`
|
|
515
|
+
${Ln(this._filteredOptions,e=>e.value,(e,t)=>b`
|
|
516
516
|
<li
|
|
517
517
|
@click=${()=>{this.toggleOption(e)}}
|
|
518
518
|
aria-selected=${e.selected?"true":"false"}
|
|
519
519
|
@keydown=${this.handleOptionKeydown}
|
|
520
|
-
class=${
|
|
520
|
+
class=${L({"pkt-listbox__option":!0,"pkt-listbox__option--selected":!!(!this.isMultiSelect&&e.selected),"pkt-listbox__option--checkBox":this.isMultiSelect})}
|
|
521
521
|
tabindex="${this.disabled||e.disabled?"-1":"0"}"
|
|
522
522
|
data-index=${t}
|
|
523
523
|
data-value=${e.value}
|
|
@@ -528,15 +528,15 @@
|
|
|
528
528
|
>
|
|
529
529
|
${this.renderCheckboxOrCheckIcon(e,t)}
|
|
530
530
|
<span class="pkt-listbox__option-label" id=${this.id+"-option-label-"+t}>
|
|
531
|
-
${e.prefix?
|
|
531
|
+
${e.prefix?b`<span class="pkt-listbox__option-prefix">${e.prefix}</span>`:w}
|
|
532
532
|
${e.label||e.value}
|
|
533
533
|
</span>
|
|
534
|
-
${e.description?
|
|
534
|
+
${e.description?b`<span class="pkt-listbox__option-description pkt-txt-14-light"
|
|
535
535
|
>${e.description}</span
|
|
536
|
-
>`:
|
|
536
|
+
>`:w}
|
|
537
537
|
</li>
|
|
538
538
|
`)}
|
|
539
|
-
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?
|
|
539
|
+
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?b`
|
|
540
540
|
<div
|
|
541
541
|
class="pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option"
|
|
542
542
|
data-type="new-option"
|
|
@@ -549,18 +549,18 @@
|
|
|
549
549
|
<pkt-icon class="pkt-listbox__banner-icon" name="plus-sign" size="large"></pkt-icon>
|
|
550
550
|
Legg til “${this.customUserInput}”
|
|
551
551
|
</div>
|
|
552
|
-
`:
|
|
552
|
+
`:w}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(e=>e.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?b`
|
|
553
553
|
<div class="pkt-listbox__banner pkt-listbox__banner--maximum-reached">
|
|
554
554
|
${this._selectedOptions} av maks ${this.maxLength} mulige er valgt.
|
|
555
555
|
</div>
|
|
556
|
-
`:
|
|
556
|
+
`:w}renderUserMessage(){return this.userMessage?b`<div class="pkt-listbox__banner pkt-listbox__banner--user-message">
|
|
557
557
|
<pkt-icon
|
|
558
558
|
class="pkt-listbox__banner-icon"
|
|
559
559
|
name="exclamation-mark-circle"
|
|
560
560
|
size="large"
|
|
561
561
|
></pkt-icon>
|
|
562
562
|
${this.userMessage}
|
|
563
|
-
</div>`:
|
|
563
|
+
</div>`:w}renderSearch(){return this.includeSearch?b`
|
|
564
564
|
<div class="pkt-listbox__search">
|
|
565
565
|
<span class="pkt-listbox__search-icon">
|
|
566
566
|
<pkt-icon name="magnifying-glass-small" size="large"></pkt-icon>
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
type="text"
|
|
571
571
|
aria-label="Søk i listen"
|
|
572
572
|
form=""
|
|
573
|
-
placeholder=${this.searchPlaceholder||
|
|
573
|
+
placeholder=${this.searchPlaceholder||mt.forms.search.placeholder}
|
|
574
574
|
@input=${this.handleSearchInput}
|
|
575
575
|
@keydown=${this.handleSearchKeydown}
|
|
576
576
|
.value=${this.searchValue}
|
|
@@ -580,12 +580,12 @@
|
|
|
580
580
|
role="searchbox"
|
|
581
581
|
/>
|
|
582
582
|
</div>
|
|
583
|
-
`:
|
|
583
|
+
`:w}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":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(e){const t=e.currentTarget,i=t.dataset.value,n=t.dataset.type,r=t.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&n!=="new-option"&&n!=="searchbox"))switch(e.key){case" ":case"Enter":this.toggleOption(t),e.preventDefault();break;case"Backspace":i&&(r?this.toggleOption(t):this.closeOptions()),e.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":e.altKey?this.focusLastOption():n==="searchbox"||n==="new-option"?this.focusFirstOption():this.focusNextOption(t),e.preventDefault();break;case"ArrowUp":if(e.altKey)this.focusFirstOption();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 this.focusPreviousOption(t);e.preventDefault();break;case"Home":this.focusFirstOption(),e.preventDefault();break;case"End":this.focusLastOption(),e.preventDefault();break;default:(e.metaKey||e.ctrlKey)&&e.key==="a"&&(this.selectAll(),e.preventDefault()),this.isLetterOrSpace(e.key)&&(this.handleTypeAhead(e.key),e.preventDefault());break}}focusAndScrollIntoView(e){e.scrollIntoView({block:"nearest"}),window.setTimeout(()=>e.focus(),0)}focusNextOption(e){const t=e.nextElementSibling;t&&this.focusAndScrollIntoView(t)}focusPreviousOption(e){const t=e.previousElementSibling;if(e.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else t&&this.focusAndScrollIntoView(t)}focusFirstOption(){const e=this.getOptionElements()[0];e&&this.focusAndScrollIntoView(e)}focusLastOption(){const e=this.getOptionElements().pop();e&&this.focusAndScrollIntoView(e)}focusFirstOrSelectedOption(){if(this.disabled)return;const e=this.getOptionElements().find(t=>t.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const t=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(t)}else if(e)this.focusAndScrollIntoView(e);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const t=this.querySelector('[role="searchbox"]');window.setTimeout(()=>t.focus(),0)}else this.focusFirstOption()}toggleOption(e){const t=e instanceof HTMLElement?e.dataset.disabled:e.disabled;if(this.disabled||t)return;const i=e instanceof HTMLElement?e.dataset.value:e.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(e=>{var t;return(e.fulltext||e.label+e.value+(e.prefix||"")).toLowerCase().includes(((t=this.searchValue)==null?void 0:t.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(e){return/^[\p{L} ]$/u.test(e)}handleTypeAhead(e){this.typeAheadString+=e.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const t=this.getOptionElements().find(i=>{var n;return(n=i.textContent)==null?void 0:n.trim().toLowerCase().startsWith(this.typeAheadString)});t&&this.focusAndScrollIntoView(t)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};ot([c({type:String})],tt.prototype,"id",2),ot([c({type:String})],tt.prototype,"label",2),ot([c({type:Array})],tt.prototype,"options",2),ot([c({type:Boolean,reflect:!0})],tt.prototype,"isOpen",2),ot([c({type:Boolean})],tt.prototype,"disabled",2),ot([c({type:Boolean})],tt.prototype,"includeSearch",2),ot([c({type:Boolean})],tt.prototype,"isMultiSelect",2),ot([c({type:Boolean})],tt.prototype,"allowUserInput",2),ot([c({type:Boolean})],tt.prototype,"maxIsReached",2),ot([c({type:String})],tt.prototype,"customUserInput",2),ot([c({type:String})],tt.prototype,"searchPlaceholder",2),ot([c({type:String})],tt.prototype,"searchValue",2),ot([c({type:Number})],tt.prototype,"maxLength",2),ot([c({type:String})],tt.prototype,"userMessage",2),ot([Q()],tt.prototype,"_filteredOptions",2),tt=ot([se("pkt-listbox")],tt);const Gd={displayValueAs:{default:"label"}},Xd={props:Gd};var Qd=Object.defineProperty,Zd=Object.getOwnPropertyDescriptor,Ie=(s,e,t,i)=>{for(var n=i>1?void 0:i?Zd(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Qd(e,t,n),n};let Oe=class extends q{constructor(){super(),this.helptextSlot=F(),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=Xd.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=F(),this.arrowRef=F(),this.listboxRef=F(),this.focusRef=F(),this.optionTagRef=F(),this.optionsController=new ba(this),this.slotController=new Ae(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e,t;if(super.connectedCallback(),document&&document.body.addEventListener("click",i=>{this._isOptionsOpen&&!this.contains(i.target)&&this.handleFocusOut(i)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const i=((e=this.options)==null?void 0:e.filter(n=>n.userAdded))||[];this.options=[...i,...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 i=[];this.optionsController.nodes.forEach(n=>{if(!n.textContent&&!n.getAttribute("value"))return null;const r={value:n.getAttribute("value")||n.textContent||"",label:n.textContent||n.getAttribute("value")||""};n.getAttribute("data-prefix")&&(r.prefix=n.getAttribute("data-prefix")||void 0),n.getAttribute("tagskincolor")&&(r.tagSkinColor=n.getAttribute("tagskincolor")),n.getAttribute("description")&&(r.description=n.getAttribute("description")||void 0),r.fulltext=r.value+r.label+(r.prefix||""),i.push(r)}),i.length&&(this.options=[...i],this._options=[...i])}}updated(e){if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("defaultOptions")&&this.defaultOptions.length){const t=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const t=(e.get("options")||this._options||[]).filter(n=>n&&n.userAdded).filter(n=>!(Array.isArray(this.options)?this.options:[]).some(r=>r.value===n.value)),i=[...t,...this.options];this._options=i,t.length>0&&(this.options=i),this._options.forEach(n=>{if(n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)){const r=[...this._value];this._value=[...this._value,n.value],this.valueChanged(this._value,r)}n.fulltext=n.value+n.label+(n.prefix||""),n.selected=n.selected||this._value.includes(n.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(n=>{n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)&&(this._value=[...this._value,n.value]),n.fulltext=n.value+n.label+(n.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return b`
|
|
584
584
|
<pkt-input-wrapper
|
|
585
585
|
.label=${this.label}
|
|
586
586
|
.helptext=${this.helptext}
|
|
587
|
-
.helptextDropdown=${
|
|
588
|
-
.helptextDropdownButton=${
|
|
587
|
+
.helptextDropdown=${A(this.helptextDropdown)}
|
|
588
|
+
.helptextDropdownButton=${A(this.helptextDropdownButton)}
|
|
589
589
|
?fullwidth=${this.fullwidth}
|
|
590
590
|
?hasError=${this.hasError}
|
|
591
591
|
?inline=${this.inline}
|
|
@@ -601,23 +601,23 @@
|
|
|
601
601
|
class="pkt-combobox__wrapper"
|
|
602
602
|
@labelClick=${this.handleInputClick}
|
|
603
603
|
>
|
|
604
|
-
<div class="pkt-contents" ${
|
|
604
|
+
<div class="pkt-contents" ${H(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
605
605
|
<div class="pkt-combobox" @focusout=${this.handleFocusOut}>
|
|
606
606
|
<div
|
|
607
|
-
class=${
|
|
607
|
+
class=${L({"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})}
|
|
608
608
|
tabindex="-1"
|
|
609
609
|
@click=${this.handleInputClick}
|
|
610
610
|
>
|
|
611
|
-
${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?
|
|
611
|
+
${this.placeholder&&(!this._value.length||this.multiple&&this.tagPlacement=="outside")&&!this._inputFocus?b`<span class="pkt-combobox__placeholder" @click=${this.handlePlaceholderClick}
|
|
612
612
|
>${this.placeholder}</span
|
|
613
|
-
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():
|
|
613
|
+
>`:this.tagPlacement!=="outside"?this.renderSingleOrMultipleValues():w}
|
|
614
614
|
${this.renderInputField()}
|
|
615
615
|
<div
|
|
616
616
|
class="pkt-btn pkt-btn--tertiary pkt-combobox__arrow"
|
|
617
617
|
@click=${this.handleArrowClick}
|
|
618
618
|
@keydown=${this.handleArrowClick}
|
|
619
619
|
id="${this.id}-arrow"
|
|
620
|
-
${
|
|
620
|
+
${H(this.arrowRef)}
|
|
621
621
|
aria-expanded=${this._isOptionsOpen}
|
|
622
622
|
aria-controls="${this.id}-listbox"
|
|
623
623
|
aria-haspopup="listbox"
|
|
@@ -628,12 +628,12 @@
|
|
|
628
628
|
tabindex="${this.disabled?"-1":"0"}"
|
|
629
629
|
>
|
|
630
630
|
<pkt-icon
|
|
631
|
-
class=${
|
|
631
|
+
class=${L({"pkt-combobox__arrow-icon":!0,"pkt-combobox__arrow-icon--open":this._isOptionsOpen})}
|
|
632
632
|
name="chevron-thin-down"
|
|
633
633
|
></pkt-icon>
|
|
634
634
|
</div>
|
|
635
635
|
<div
|
|
636
|
-
${
|
|
636
|
+
${H(this.focusRef)}
|
|
637
637
|
tabindex="-1"
|
|
638
638
|
@keydown=${this.handleArrowClick}
|
|
639
639
|
class="pkt-contents"
|
|
@@ -650,7 +650,7 @@
|
|
|
650
650
|
?isMultiSelect=${this.multiple}
|
|
651
651
|
?allowUserInput=${this.allowUserInput&&!this._maxIsReached}
|
|
652
652
|
?maxIsReached=${this._maxIsReached}
|
|
653
|
-
.customUserInput=${
|
|
653
|
+
.customUserInput=${A(this._addValueText)}
|
|
654
654
|
.userMessage=${this._userInfoMessage}
|
|
655
655
|
@search=${this.handleSearch}
|
|
656
656
|
@option-toggle=${this.handleOptionToggled}
|
|
@@ -658,15 +658,15 @@
|
|
|
658
658
|
@close-options=${()=>this._isOptionsOpen=!1}
|
|
659
659
|
.searchValue=${this._search||null}
|
|
660
660
|
.maxLength=${this.maxlength||0}
|
|
661
|
-
${
|
|
661
|
+
${H(this.listboxRef)}
|
|
662
662
|
></pkt-listbox>
|
|
663
663
|
</div>
|
|
664
664
|
|
|
665
|
-
${this.tagPlacement==="outside"&&this.multiple?
|
|
665
|
+
${this.tagPlacement==="outside"&&this.multiple?b`<div class="pkt-combobox__tags-outside">
|
|
666
666
|
${this.renderSingleOrMultipleValues()}
|
|
667
|
-
</div>`:
|
|
667
|
+
</div>`:w}
|
|
668
668
|
</pkt-input-wrapper>
|
|
669
|
-
`}renderInputField(){return this.typeahead||this.allowUserInput?
|
|
669
|
+
`}renderInputField(){return this.typeahead||this.allowUserInput?b`
|
|
670
670
|
<div class="pkt-combobox__input-div combobox__input">
|
|
671
671
|
<input
|
|
672
672
|
type="text"
|
|
@@ -678,66 +678,66 @@
|
|
|
678
678
|
@blur=${this.handleBlur}
|
|
679
679
|
autocomplete="off"
|
|
680
680
|
role="combobox"
|
|
681
|
-
aria-label=${
|
|
681
|
+
aria-label=${A(this.label)}
|
|
682
682
|
aria-autocomplete=${this.typeahead?"both":"list"}
|
|
683
683
|
aria-controls="${this.id}-listbox"
|
|
684
|
-
aria-multiselectable=${
|
|
685
|
-
aria-activedescendant=${
|
|
686
|
-
${
|
|
684
|
+
aria-multiselectable=${A(this.multiple?"true":void 0)}
|
|
685
|
+
aria-activedescendant=${A(this._value[0]&&this.findValueInOptions(this._value[0])?`${this.id}-listbox-${this.findIndexInOptions(this._value[0])}`:void 0)}
|
|
686
|
+
${H(this.inputRef)}
|
|
687
687
|
/>
|
|
688
688
|
</div>
|
|
689
|
-
`:
|
|
689
|
+
`:b`
|
|
690
690
|
<input
|
|
691
691
|
type="hidden"
|
|
692
692
|
id="${this.id}-input"
|
|
693
693
|
name=${(this.name||this.id)+"-input"}
|
|
694
694
|
.value=${this._value.join(",")}
|
|
695
|
-
${
|
|
695
|
+
${H(this.inputRef)}
|
|
696
696
|
/>
|
|
697
|
-
`}renderSingleOrMultipleValues(){const e=!this.multiple,t=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=
|
|
697
|
+
`}renderSingleOrMultipleValues(){const e=!this.multiple,t=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=Ln(this._value,n=>n,n=>{var r;const a=this.findValueInOptions(n),l=(r=this.options.find(d=>d.value===n))==null?void 0:r.tagSkinColor;return b`
|
|
698
698
|
<pkt-tag
|
|
699
|
-
skin=${
|
|
699
|
+
skin=${l||"blue-dark"}
|
|
700
700
|
?closeTag=${!this.disabled}
|
|
701
701
|
@close=${()=>this.handleTagRemove(n)}
|
|
702
702
|
>
|
|
703
703
|
${this.renderValueTag(a)}
|
|
704
704
|
</pkt-tag>
|
|
705
|
-
`});return e?t:i}renderValueTag(e){if(!e)return"";switch(this.displayValueAs){case"prefixAndValue":return
|
|
705
|
+
`});return e?t:i}renderValueTag(e){if(!e)return"";switch(this.displayValueAs){case"prefixAndValue":return b`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
706
706
|
>${e.prefix||""} ${e.value}</span
|
|
707
|
-
>`;case"value":return
|
|
707
|
+
>`;case"value":return b`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
708
708
|
>${e.value}</span
|
|
709
|
-
>`;case"label":default:return
|
|
709
|
+
>`;case"label":default:return b`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
710
710
|
>${e.label||e.value}</span
|
|
711
|
-
>`}}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){if(this._options=this.options.filter(i=>{var n;return(n=i.fulltext)==null?void 0:n.toLowerCase().includes(this._search.toLowerCase())}),e.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var r;return!n.selected&&((r=n.label)==null?void 0:r.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=i[0];n!=null&&n.label&&(t.value=n.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.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const e=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){var t,i,n,r,a;if(!this.disabled&&((i=(t=e.relatedTarget)==null?void 0:t.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((r=(n=e.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:r.id)!==this.id&&((a=e.target)==null?void 0:a.getAttribute("data-focusfix"))!==this.id&&e.relatedTarget!==this.focusRef.value&&e.relatedTarget!==this.inputRef.value&&e.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const c=this.inputRef.value.value,h=this.findValueInOptions(c);!this._value.includes(c)&&!h?this.allowUserInput?this.addNewUserValue(c):this.multiple||this.removeValue(this._value[0]):h&&!this._value.includes(h.value)&&this.setSelected(h.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(e){var t,i;if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.currentTarget&&e.currentTarget!==this.arrowRef.value&&((t=this.inputRef.value)==null?void 0:t.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(e)}handlePlaceholderClick(e){this.disabled||(e.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(e){var t,i;this.disabled||e instanceof KeyboardEvent&&e.key&&e.key!=="Enter"&&e.key!==" "&&e.key!=="ArrowDown"||(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(t=this.listboxRef.value)==null||t.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase()}handleInputKeydown(e){var t,i,n;switch(e.key){case",":this.multiple&&(e.preventDefault(),this.addValue());break;case"Enter":e.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((t=this.inputRef.value)==null?void 0:t.type)==="hidden"&&this.removeLastValue(e);break;case"Tab":case"ArrowDown":e.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),e.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),e.preventDefault();break}}handleTagRemove(e){this.removeSelected(e)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value)||this._search||"",i=t.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(c=>c.toLowerCase()===i),r=this._options.filter(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase().includes(i))??!1}),a=r.find(c=>{var h;return((h=c.label)==null?void 0:h.toLowerCase())===i||c.value.toLowerCase()===i});switch(!0){case((r.length===0||!a)&&this.allowUserInput):this._addValueText=t,this._userInfoMessage="";break;case(r.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!n:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case r.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(e){return this.options.find(t=>t.value===e||t.label===e)||null}findIndexInOptions(e){return this._options.findIndex(t=>t.value===e||t.label===e)}isMaxItemsReached(){const e=this.maxlength!==null&&this._value.length>=this.maxlength;return e?this._maxIsReached=!0:this._maxIsReached=!1,e}toggleValue(e){var t,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((t=this.findValueInOptions(e))==null?void 0:t.value)||null,r=this._value.includes(e||n||""),a=!!n,c=((i=this._options.find(C=>C.value===e))==null?void 0:i.disabled)||!1,h=!(e!=null&&e.trim()),p=!this.multiple,v=this.multiple,b=this.isMaxItemsReached();let y=!1,k=!0,m="",w="";c||(!a&&this.allowUserInput&&!h?(this.addNewUserValue(e),m="Ny verdi lagt til",y=!v):!a&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),k=!1,y=!0,m="Ingen treff i søket"):r?(this.removeValue(n),y=!0):h&&p?(this.removeAllSelected(),y=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),y=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):v&&!b?(this.setSelected(n),y=!0):v&&b?(this._userInfoMessage="Maks antall valg nådd",k=!1,w=e):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",k=!1,y=!0,w=e),this._isOptionsOpen=y,y||window.setTimeout(()=>{var C;(C=this.focusRef.value)==null||C.focus()},0),this._userInfoMessage=m,this._search=w||"",this.resetComboboxInput(k),v&&this.isMaxItemsReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,this._options=this._options.map(t=>(t.value===e&&(t.selected=!0),t)),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(i=>i!==e);const t=this.findValueInOptions(e);t?(t.selected=!1,t.userAdded?(this._options=[...this._options.filter(i=>i.value!==e)],this.options=[...this.options.filter(i=>i.value!==e)]):this._options=[...this._options,t]):!e&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}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),this._options=this._options.map(e=>(e.selected=!0,e)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(e=>(e.selected=!1,e)),this._options=this._options.filter(e=>!e.userAdded),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";this._search=t,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],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(e)){if(this.isMaxItemsReached())return;this._value=[...this._value,e]}const t={value:e,label:e,userAdded:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.setSelected(e),this.requestUpdate()}resetComboboxInput(e=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&e)if(this._search="",this.multiple)this.inputRef.value.value="";else{const t=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]||"")},0),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.isMaxItemsReached()}};Ee([o({type:String,reflect:!0})],Se.prototype,"value",2),Ee([o({type:Array})],Se.prototype,"options",2),Ee([o({type:Array})],Se.prototype,"defaultOptions",2),Ee([o({type:Boolean})],Se.prototype,"allowUserInput",2),Ee([o({type:Boolean})],Se.prototype,"typeahead",2),Ee([o({type:Boolean})],Se.prototype,"includeSearch",2),Ee([o({type:String})],Se.prototype,"searchPlaceholder",2),Ee([o({type:Boolean})],Se.prototype,"multiple",2),Ee([o({type:Number})],Se.prototype,"maxlength",2),Ee([o({type:String})],Se.prototype,"displayValueAs",2),Ee([o({type:String})],Se.prototype,"tagPlacement",2),Ee([q()],Se.prototype,"_options",2),Ee([q()],Se.prototype,"_value",2),Ee([q()],Se.prototype,"_isOptionsOpen",2),Ee([q()],Se.prototype,"_userInfoMessage",2),Ee([q()],Se.prototype,"_addValueText",2),Ee([q()],Se.prototype,"_maxIsReached",2),Ee([q()],Se.prototype,"_search",2),Ee([q()],Se.prototype,"_inputFocus",2),Ee([q()],Se.prototype,"_editingSingleValue",2),Se=Ee([X("pkt-combobox")],Se);const Hh={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 Vh=Object.defineProperty,jh=Object.getOwnPropertyDescriptor,Bt=(s,e,t,i)=>{for(var n=i>1?void 0:i?jh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Vh(e,t,n),n};let Pn=null;function Uh(){return Pn||(Pn=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 i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Pn)}let _t=class extends fe{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||Hh.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((i,n)=>(i[n.name]=n.consent,i),{});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 Uh(),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=i=>{this.emitCookieConsents(i)},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"?f`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?f`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
711
|
+
>`}}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){if(this._options=this.options.filter(i=>{var n;return(n=i.fulltext)==null?void 0:n.toLowerCase().includes(this._search.toLowerCase())}),e.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var r;return!n.selected&&((r=n.label)==null?void 0:r.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=i[0];n!=null&&n.label&&(t.value=n.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.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const e=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(e){var t,i,n,r,a;if(!this.disabled&&((i=(t=e.relatedTarget)==null?void 0:t.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((r=(n=e.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:r.id)!==this.id&&((a=e.target)==null?void 0:a.getAttribute("data-focusfix"))!==this.id&&e.relatedTarget!==this.focusRef.value&&e.relatedTarget!==this.inputRef.value&&e.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const l=this.inputRef.value.value,d=this.findValueInOptions(l);!this._value.includes(l)&&!d?this.allowUserInput?this.addNewUserValue(l):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(e){var t,i;if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.currentTarget&&e.currentTarget!==this.arrowRef.value&&((t=this.inputRef.value)==null?void 0:t.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(e)}handlePlaceholderClick(e){this.disabled||(e.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(e){var t,i;this.disabled||e instanceof KeyboardEvent&&e.key&&e.key!=="Enter"&&e.key!==" "&&e.key!=="ArrowDown"||(e.stopImmediatePropagation(),e.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(t=this.listboxRef.value)==null||t.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(e){this.toggleValue(e.detail)}handleSearch(e){e.stopPropagation(),this._search=e.detail.toLowerCase()}handleInputKeydown(e){var t,i,n;switch(e.key){case",":this.multiple&&(e.preventDefault(),this.addValue());break;case"Enter":e.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((t=this.inputRef.value)==null?void 0:t.type)==="hidden"&&this.removeLastValue(e);break;case"Tab":case"ArrowDown":e.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),e.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),e.preventDefault();break}}handleTagRemove(e){this.removeSelected(e)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value)||this._search||"",i=t.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(l=>l.toLowerCase()===i),r=this._options.filter(l=>{var d;return((d=l.label)==null?void 0:d.toLowerCase().includes(i))??!1}),a=r.find(l=>{var d;return((d=l.label)==null?void 0:d.toLowerCase())===i||l.value.toLowerCase()===i});switch(!0){case((r.length===0||!a)&&this.allowUserInput):this._addValueText=t,this._userInfoMessage="";break;case(r.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!n:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case r.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(e){return this.options.find(t=>t.value===e||t.label===e)||null}findIndexInOptions(e){return this._options.findIndex(t=>t.value===e||t.label===e)}isMaxItemsReached(){const e=this.maxlength!==null&&this._value.length>=this.maxlength;return e?this._maxIsReached=!0:this._maxIsReached=!1,e}toggleValue(e){var t,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((t=this.findValueInOptions(e))==null?void 0:t.value)||null,r=this._value.includes(e||n||""),a=!!n,l=((i=this._options.find(C=>C.value===e))==null?void 0:i.disabled)||!1,d=!(e!=null&&e.trim()),p=!this.multiple,m=this.multiple,v=this.isMaxItemsReached();let y=!1,k=!0,g="",$="";l||(!a&&this.allowUserInput&&!d?(this.addNewUserValue(e),g="Ny verdi lagt til",y=!m):!a&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),k=!1,y=!0,g="Ingen treff i søket"):r?(this.removeValue(n),y=!0):d&&p?(this.removeAllSelected(),y=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),y=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!v?(this.setSelected(n),y=!0):m&&v?(this._userInfoMessage="Maks antall valg nådd",k=!1,$=e):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",k=!1,y=!0,$=e),this._isOptionsOpen=y,y||window.setTimeout(()=>{var C;(C=this.focusRef.value)==null||C.focus()},0),this._userInfoMessage=g,this._search=$||"",this.resetComboboxInput(k),m&&this.isMaxItemsReached())}setSelected(e){if(!this._value.includes(e)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=e?[...this._value,e]:this._value,this._options=this._options.map(t=>(t.value===e&&(t.selected=!0),t)),this.resetComboboxInput(!0)}}removeSelected(e){if(!e)return;this._value=this._value.filter(i=>i!==e);const t=this.findValueInOptions(e);t?(t.selected=!1,t.userAdded?(this._options=[...this._options.filter(i=>i.value!==e)],this.options=[...this.options.filter(i=>i.value!==e)]):this._options=[...this._options,t]):!e&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}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),this._options=this._options.map(e=>(e.selected=!0,e)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(e=>(e.selected=!1,e)),this._options=this._options.filter(e=>!e.userAdded),this.requestUpdate()}addValue(){var e;const t=((e=this.inputRef.value)==null?void 0:e.value.trim())||"";this._search=t,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],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(e)){if(this.isMaxItemsReached())return;this._value=[...this._value,e]}const t={value:e,label:e,userAdded:!0};this.options=[t,...this.options],this._options=[t,...this._options],this.setSelected(e),this.requestUpdate()}resetComboboxInput(e=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&e)if(this._search="",this.multiple)this.inputRef.value.value="";else{const t=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]||"")},0),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.isMaxItemsReached()}};Ie([c({type:String,reflect:!0})],Oe.prototype,"value",2),Ie([c({type:Array})],Oe.prototype,"options",2),Ie([c({type:Array})],Oe.prototype,"defaultOptions",2),Ie([c({type:Boolean})],Oe.prototype,"allowUserInput",2),Ie([c({type:Boolean})],Oe.prototype,"typeahead",2),Ie([c({type:Boolean})],Oe.prototype,"includeSearch",2),Ie([c({type:String})],Oe.prototype,"searchPlaceholder",2),Ie([c({type:Boolean})],Oe.prototype,"multiple",2),Ie([c({type:Number})],Oe.prototype,"maxlength",2),Ie([c({type:String})],Oe.prototype,"displayValueAs",2),Ie([c({type:String})],Oe.prototype,"tagPlacement",2),Ie([Q()],Oe.prototype,"_options",2),Ie([Q()],Oe.prototype,"_value",2),Ie([Q()],Oe.prototype,"_isOptionsOpen",2),Ie([Q()],Oe.prototype,"_userInfoMessage",2),Ie([Q()],Oe.prototype,"_addValueText",2),Ie([Q()],Oe.prototype,"_maxIsReached",2),Ie([Q()],Oe.prototype,"_search",2),Ie([Q()],Oe.prototype,"_inputFocus",2),Ie([Q()],Oe.prototype,"_editingSingleValue",2),Oe=Ie([se("pkt-combobox")],Oe);const Jd={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 Rd=Object.defineProperty,eu=Object.getOwnPropertyDescriptor,Ht=(s,e,t,i)=>{for(var n=i>1?void 0:i?eu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Rd(e,t,n),n};let Fn=null;function tu(){return Fn||(Fn=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 i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Fn)}let Tt=class extends _e{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||Jd.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((i,n)=>(i[n.name]=n.consent,i),{});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 tu(),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=i=>{this.emitCookieConsents(i)},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"?b`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?b`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
712
712
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
713
713
|
${this.triggerText}
|
|
714
|
-
</a>`:this.triggerType==="icon"?
|
|
714
|
+
</a>`:this.triggerType==="icon"?b`<pkt-button
|
|
715
715
|
skin="tertiary"
|
|
716
716
|
variant="icon-only"
|
|
717
717
|
iconName="cookie"
|
|
718
718
|
@click=${this.openModal}
|
|
719
719
|
>
|
|
720
720
|
>${this.triggerText}</pkt-button
|
|
721
|
-
>`:
|
|
722
|
-
${this.tagText?
|
|
723
|
-
${this.optionalTag?
|
|
724
|
-
${this.requiredTag?
|
|
725
|
-
`,a=()=>
|
|
721
|
+
>`:b`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};Ht([c({type:Boolean})],Tt.prototype,"devMode",2),Ht([c({type:String})],Tt.prototype,"hotjarId",2),Ht([c({type:String})],Tt.prototype,"googleAnalyticsId",2),Ht([c({type:String})],Tt.prototype,"cookieDomain",2),Ht([c({type:String})],Tt.prototype,"cookieSecure",2),Ht([c({type:String})],Tt.prototype,"cookieExpiryDays",2),Ht([c({type:String})],Tt.prototype,"triggerType",2),Ht([c({type:String})],Tt.prototype,"triggerText",2),Ht([c({type:String})],Tt.prototype,"i18nLanguage",2),Tt=Ht([se("pkt-consent")],Tt);var su=Object.defineProperty,iu=Object.getOwnPropertyDescriptor,lt=(s,e,t,i)=>{for(var n=i>1?void 0:i?iu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&su(e,t,n),n};let st=class extends q{constructor(){super(...arguments),this.inputRef=F(),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,i){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,i)}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=L({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=L({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=L({"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}),n="pkt-tag pkt-tag--small pkt-tag--thin-text",r=()=>b`
|
|
722
|
+
${this.tagText?b`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:w}
|
|
723
|
+
${this.optionalTag?b`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:w}
|
|
724
|
+
${this.requiredTag?b`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:w}
|
|
725
|
+
`,a=()=>b`
|
|
726
726
|
<label class=${i} for=${this.id+"-internal"}>
|
|
727
727
|
${this.label} ${r()}
|
|
728
|
-
${this.checkHelptext?
|
|
728
|
+
${this.checkHelptext?b`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:w}
|
|
729
729
|
</label>
|
|
730
|
-
`;return
|
|
730
|
+
`;return b`
|
|
731
731
|
<div class="pkt-input-check">
|
|
732
732
|
<div class=${e}>
|
|
733
|
-
${this.labelPosition==="left"?a():
|
|
733
|
+
${this.labelPosition==="left"?a():w}
|
|
734
734
|
<input
|
|
735
735
|
id=${this.id+"-internal"}
|
|
736
736
|
class=${t}
|
|
737
737
|
type="checkbox"
|
|
738
738
|
?disabled=${this.disabled}
|
|
739
739
|
name=${this.name+"-internal"}
|
|
740
|
-
${
|
|
740
|
+
${H(this.inputRef)}
|
|
741
741
|
@change=${this.handleChange}
|
|
742
742
|
@click=${this.handleClick}
|
|
743
743
|
@blur=${this.onBlur}
|
|
@@ -745,30 +745,30 @@
|
|
|
745
745
|
?checked=${this.checked}
|
|
746
746
|
role=${this.isSwitch?"switch":"checkbox"}
|
|
747
747
|
/>
|
|
748
|
-
${this.labelPosition==="right"?a():
|
|
748
|
+
${this.labelPosition==="right"?a():w}
|
|
749
749
|
</div>
|
|
750
750
|
</div>
|
|
751
|
-
`}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))}};
|
|
752
|
-
<div class=${
|
|
753
|
-
${Array.isArray(this.dates)&&this.dates[0]?
|
|
751
|
+
`}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))}};lt([c({type:String,reflect:!0})],st.prototype,"value",2),lt([c({type:String})],st.prototype,"checkHelptext",2),lt([c({type:Boolean})],st.prototype,"defaultChecked",2),lt([c({type:Boolean})],st.prototype,"hasTile",2),lt([c({type:Boolean})],st.prototype,"isSwitch",2),lt([c({type:String})],st.prototype,"labelPosition",2),lt([c({type:Boolean})],st.prototype,"hideLabel",2),lt([c({type:Boolean,reflect:!0})],st.prototype,"checked",2),lt([c({type:Boolean,reflect:!0})],st.prototype,"indeterminate",2),lt([c({type:String,reflect:!0})],st.prototype,"type",2),lt([c({type:String})],st.prototype,"tagText",2),lt([c({type:Boolean})],st.prototype,"optionalTag",2),lt([c({type:String})],st.prototype,"optionalText",2),lt([c({type:Boolean})],st.prototype,"requiredTag",2),lt([c({type:String})],st.prototype,"requiredText",2),st=lt([se("pkt-checkbox")],st);const ya={calendar:{buttonAltText:"Åpne kalender"}},nu={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var ru=Object.defineProperty,au=Object.getOwnPropertyDescriptor,$i=(s,e,t,i)=>{for(var n=i>1?void 0:i?au(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ru(e,t,n),n};let Ys=class extends _e{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=ns()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},b`
|
|
752
|
+
<div class=${L(this.classes)} aria-live="polite">
|
|
753
|
+
${Array.isArray(this.dates)&&this.dates[0]?Ln(da((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return b` <pkt-tag
|
|
754
754
|
id=${this.idBase+e+"-tag"}
|
|
755
755
|
closeTag
|
|
756
756
|
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:e}))}}
|
|
757
|
-
.ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${
|
|
757
|
+
.ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${oa(e,this.dateformat)}`}
|
|
758
758
|
>
|
|
759
|
-
<time datetime=${e}>${
|
|
760
|
-
</pkt-tag>`}):
|
|
759
|
+
<time datetime=${e}>${oa(e,this.dateformat)}</time>
|
|
760
|
+
</pkt-tag>`}):w}
|
|
761
761
|
</div>
|
|
762
|
-
`}}
|
|
762
|
+
`}};$i([c({type:Array})],Ys.prototype,"dates",2),$i([c({type:String})],Ys.prototype,"dateformat",2),$i([c({type:String,attribute:"class"})],Ys.prototype,"className",2),$i([c({type:String,attribute:"id-base"})],Ys.prototype,"idBase",2),Ys=$i([se("pkt-date-tags")],Ys);const ou={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},wi={props:ou},xs=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},lu=()=>xs()?"text":"date",cu=s=>!s||s.length!==2?!0:ld(s[0],s[1]),du=s=>da(s),uu=(s,e,t,i,n)=>od(s,e,t,i,n),hu=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),pu=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),fu=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),mu=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,gu=(s,e,t=!1)=>{var i;if(!s||!e)return;const n=((i=e.parentElement)==null?void 0:i.getBoundingClientRect())||e.getBoundingClientRect(),r=t?n.height+30:n.height,a=s.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";n&&n.top+a>window.innerHeight&&n.top-a>0&&(l=`calc(100% - ${r}px - ${a}px)`),s.style.top=l},vu=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},bu=(s,e)=>{const{key:t}=s;(t==="Enter"||t===" "||t==="Space")&&(s.preventDefault(),e(s))},ka={validateRangeOrder:cu,sortDates:du,filterSelectableDates:uu},yu={getInputType:lu},xi={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,i,n){var r,a,l,d;const p=s.value;p&&(t&&t>p?e.setValidity({rangeUnderflow:!0},((a=(r=n==null?void 0:n.forms)==null?void 0:r.messages)==null?void 0:a.rangeUnderflow)||"Value is below minimum",s):i&&i<p&&e.setValidity({rangeOverflow:!0},((d=(l=n==null?void 0:n.forms)==null?void 0:l.messages)==null?void 0:d.rangeOverflow)||"Value is above maximum",s))}},tn={addToSelected(s,e,t,i){const n=s.target;if(!n.value)return;const r=t?Ct(t):null,a=i?Ct(i):null,l=Ct(n.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&e.value&&e.value.handleDateSelect(l),n.value=""},handleCalendarPosition(s,e,t=!1){gu(s.value??null,e.value??null,t)}},Hn={getInputClasses:hu,getButtonClasses:pu,getRangeLabelClasses:fu},Vn={processDateSelection:mu,updateInputValues(s,e,t,i,n,r){s.value&&(i&&e!=null&&e.value?(s.value.value=t[0]??"",e.value.value=t[1]??"",r(s.value),r(e.value)):n||(s.value.value=t.length?t[0]:"",r(s.value)))},processRangeBlur(s,e,t,i,n){var r;const a=s.target;if(a.value){n(a);const l=ss(a.value);l&&((r=t==null?void 0:t.value)==null||r.handleDateSelect(l))}else e[0]&&i()}},sn={handleInputKeydown:vu,handleButtonKeydown:bu};var ku=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,dt=(s,e,t,i)=>{for(var n=i>1?void 0:i?_u(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ku(e,t,n),n};let ct=class extends _e{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=F(),this.calendarRef=F(),this.handleDocumentClick=e=>{if(!this.open)return;const t=e.composedPath(),i=this.parentElement,n=this.popupRef.value;!t.includes(this)&&!t.includes(n)&&!(i&&t.includes(i))&&(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,i){if(this.calendarRef.value&&typeof tn.addToSelected=="function")return tn.addToSelected(e,this.calendarRef,t,i);const n=e.target;if(!n.value)return;const r=t?Ct(t):null,a=i?Ct(i):null,l=Ct(n.value.split(",")[0]);l&&!isNaN(l.getTime())&&(!r||l>=r)&&(!a||l<=a)&&this.handleDateSelect(l),n.value=""}handleDateSelect(e){const t=this.calendarRef.value;if(t&&typeof t.handleDateSelect=="function")return t.handleDateSelect(e);const i=We(e),n=this.selected.indexOf(i)>=0?this.selected.filter(r=>r!==i):[...this.selected,i];this.selected=n,this.dispatchEvent(new CustomEvent("date-selected",{detail:n,bubbles:!0,composed:!0}))}render(){const e={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return b`
|
|
763
763
|
<div
|
|
764
|
-
class="${
|
|
765
|
-
${
|
|
764
|
+
class="${L(e)}"
|
|
765
|
+
${H(this.popupRef)}
|
|
766
766
|
id="date-popup"
|
|
767
767
|
?hidden=${!this.open}
|
|
768
768
|
aria-hidden="${!this.open}"
|
|
769
769
|
>
|
|
770
|
-
${this.open||this._hasBeenOpened?
|
|
771
|
-
${
|
|
770
|
+
${this.open||this._hasBeenOpened?b`<pkt-calendar
|
|
771
|
+
${H(this.calendarRef)}
|
|
772
772
|
?multiple=${this.multiple}
|
|
773
773
|
?range=${this.range}
|
|
774
774
|
?weeknumbers=${this.weeknumbers}
|
|
@@ -783,11 +783,11 @@
|
|
|
783
783
|
.today=${this.today}
|
|
784
784
|
@date-selected=${t=>{this.selected=t.detail,this.dispatchEvent(new CustomEvent("date-selected",{detail:t.detail,bubbles:!0,composed:!0}))}}
|
|
785
785
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
786
|
-
></pkt-calendar>`:
|
|
786
|
+
></pkt-calendar>`:w}
|
|
787
787
|
</div>
|
|
788
|
-
`}};
|
|
788
|
+
`}};dt([c({type:Boolean,reflect:!0})],ct.prototype,"open",2),dt([c({type:Boolean})],ct.prototype,"multiple",2),dt([c({type:Boolean})],ct.prototype,"range",2),dt([c({type:Boolean})],ct.prototype,"weeknumbers",2),dt([c({type:Boolean})],ct.prototype,"withcontrols",2),dt([c({type:Number})],ct.prototype,"maxMultiple",2),dt([c({type:Array})],ct.prototype,"selected",2),dt([c({type:String})],ct.prototype,"earliest",2),dt([c({type:String})],ct.prototype,"latest",2),dt([c({type:Array})],ct.prototype,"excludedates",2),dt([c({type:Array})],ct.prototype,"excludeweekdays",2),dt([c({type:String})],ct.prototype,"currentmonth",2),dt([c({type:String})],ct.prototype,"today",2),dt([Q()],ct.prototype,"_hasBeenOpened",2),ct=dt([se("pkt-datepicker-popup")],ct);var $u=Object.defineProperty,Gt=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&$u(e,t,n),n};let Nt=class extends _e{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=F(),this.btnRef=F()}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 b`
|
|
789
789
|
<button
|
|
790
|
-
class="${
|
|
790
|
+
class="${L(Hn.getButtonClasses())}"
|
|
791
791
|
type="button"
|
|
792
792
|
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
793
793
|
@keydown=${t=>{const{key:i}=t;(i==="Enter"||i===" "||i==="Space")&&(t.preventDefault(),this.dispatchToggleCalendar(t))}}
|
|
@@ -797,102 +797,102 @@
|
|
|
797
797
|
<pkt-icon name="calendar"></pkt-icon>
|
|
798
798
|
<span class="pkt-btn__text">${((e=this.strings.calendar)==null?void 0:e.buttonAltText)||"Åpne kalender"}</span>
|
|
799
799
|
</button>
|
|
800
|
-
`}createRenderRoot(){return this}};
|
|
800
|
+
`}createRenderRoot(){return this}};Gt([c({type:String})],Nt.prototype,"inputType"),Gt([c({type:String})],Nt.prototype,"id"),Gt([c({type:String})],Nt.prototype,"min"),Gt([c({type:String})],Nt.prototype,"max"),Gt([c({type:String})],Nt.prototype,"placeholder"),Gt([c({type:Boolean})],Nt.prototype,"readonly"),Gt([c({type:Boolean})],Nt.prototype,"disabled"),Gt([c({type:Object})],Nt.prototype,"inputClasses"),Gt([c({type:Object})],Nt.prototype,"internals");var wu=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,Un=(s,e,t,i)=>{for(var n=i>1?void 0:i?xu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&wu(e,t,n),n};let nn=class extends Nt{constructor(){super(...arguments),this.value="",this.strings=ya}dispatchManageValidity(e){this.dispatchEvent(new CustomEvent("manage-validity",{detail:e,bubbles:!0,composed:!0}))}render(){return b`
|
|
801
801
|
<div class="pkt-input__container">
|
|
802
802
|
<input
|
|
803
|
-
class="${
|
|
803
|
+
class="${L(this.inputClasses)}"
|
|
804
804
|
.type=${this.inputType}
|
|
805
805
|
id="${this.id}-input"
|
|
806
806
|
.value=${this.value}
|
|
807
|
-
min=${
|
|
808
|
-
max=${
|
|
809
|
-
placeholder=${
|
|
807
|
+
min=${A(this.min)}
|
|
808
|
+
max=${A(this.max)}
|
|
809
|
+
placeholder=${A(this.placeholder)}
|
|
810
810
|
?readonly=${this.isInputReadonly}
|
|
811
811
|
aria-describedby="${this.id}-helptext"
|
|
812
812
|
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
813
813
|
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
814
814
|
?disabled=${this.disabled}
|
|
815
|
-
@keydown=${e=>
|
|
815
|
+
@keydown=${e=>sn.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>xi.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()})}
|
|
816
816
|
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
817
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
817
|
+
@focus=${()=>{this.dispatchFocus(),xs()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
818
818
|
@blur=${e=>{this.dispatchBlur(e),this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent("value-change",{detail:e.target.value,bubbles:!0,composed:!0}))}}
|
|
819
819
|
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
820
|
-
${
|
|
820
|
+
${H(this.inputRef)}
|
|
821
821
|
/>
|
|
822
822
|
${this.renderCalendarButton()}
|
|
823
823
|
</div>
|
|
824
|
-
`}};
|
|
824
|
+
`}};Un([c({type:String})],nn.prototype,"value",2),Un([c({type:Object})],nn.prototype,"strings",2),nn=Un([se("pkt-datepicker-single")],nn);var Su=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,Si=(s,e,t,i)=>{for(var n=i>1?void 0:i?Cu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Su(e,t,n),n};let Ks=class extends Nt{constructor(){super(...arguments),this.value=[],this.label="",this.showRangeLabels=!1,this.strings=nu,this.inputRefTo=F()}get inputElementTo(){return this.inputRefTo.value}render(){var e,t,i,n;const r=Hn.getRangeLabelClasses(this.showRangeLabels);return b`
|
|
825
825
|
<div class="pkt-input__container">
|
|
826
|
-
${this.showRangeLabels?
|
|
826
|
+
${this.showRangeLabels?b` <div class="pkt-input-prefix">${(e=this.strings.generic)==null?void 0:e.from}</div> `:w}
|
|
827
827
|
<input
|
|
828
|
-
class=${
|
|
828
|
+
class=${L(this.inputClasses)}
|
|
829
829
|
.type=${this.inputType}
|
|
830
830
|
id="${this.id}-input"
|
|
831
831
|
aria-label="${this.label} ${((t=this.strings.generic)==null?void 0:t.from)??"Fra"}"
|
|
832
832
|
.value=${this.value[0]??""}
|
|
833
|
-
min=${
|
|
834
|
-
max=${
|
|
835
|
-
placeholder=${
|
|
833
|
+
min=${A(this.min)}
|
|
834
|
+
max=${A(this.max)}
|
|
835
|
+
placeholder=${A(this.placeholder)}
|
|
836
836
|
?readonly=${this.isInputReadonly}
|
|
837
837
|
?disabled=${this.disabled}
|
|
838
838
|
@click=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
|
|
839
839
|
@touchend=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
|
|
840
|
-
@keydown=${a=>
|
|
840
|
+
@keydown=${a=>sn.handleInputKeydown(a,l=>this.dispatchToggleCalendar(l),()=>xi.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()})}
|
|
841
841
|
@input=${a=>{this.dispatchInput(a),a.stopImmediatePropagation()}}
|
|
842
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
842
|
+
@focus=${()=>{this.dispatchFocus(),xs()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
843
843
|
@blur=${a=>{this.dispatchBlur(a),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:a,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
844
844
|
@change=${a=>{this.dispatchChange(a),a.stopImmediatePropagation()}}
|
|
845
|
-
${
|
|
845
|
+
${H(this.inputRef)}
|
|
846
846
|
/>
|
|
847
|
-
<div class="${
|
|
847
|
+
<div class="${L(r)}" id="${this.id}-to-label">
|
|
848
848
|
${(i=this.strings.generic)==null?void 0:i.to}
|
|
849
849
|
</div>
|
|
850
|
-
${this.showRangeLabels?
|
|
850
|
+
${this.showRangeLabels?w:b` <div class="pkt-input-separator">–</div> `}
|
|
851
851
|
<input
|
|
852
|
-
class=${
|
|
852
|
+
class=${L(this.inputClasses)}
|
|
853
853
|
.type=${this.inputType}
|
|
854
854
|
id="${this.id}-to"
|
|
855
855
|
aria-label="${this.label} ${((n=this.strings.generic)==null?void 0:n.to)??"Til"}"
|
|
856
856
|
.value=${this.value[1]??""}
|
|
857
|
-
min=${
|
|
858
|
-
max=${
|
|
859
|
-
placeholder=${
|
|
857
|
+
min=${A(this.min)}
|
|
858
|
+
max=${A(this.max)}
|
|
859
|
+
placeholder=${A(this.placeholder)}
|
|
860
860
|
?readonly=${this.isInputReadonly}
|
|
861
861
|
?disabled=${this.disabled}
|
|
862
862
|
@click=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
|
|
863
863
|
@touchend=${a=>{a.preventDefault(),this.dispatchToggleCalendar(a)}}
|
|
864
|
-
@keydown=${a=>
|
|
864
|
+
@keydown=${a=>sn.handleInputKeydown(a,l=>this.dispatchToggleCalendar(l),()=>xi.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()})}
|
|
865
865
|
@input=${a=>{this.dispatchInput(a),a.stopImmediatePropagation()}}
|
|
866
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
866
|
+
@focus=${()=>{this.dispatchFocus(),xs()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
867
867
|
@blur=${a=>{this.dispatchBlur(a),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:a,values:this.value,inputType:"to"},bubbles:!0,composed:!0}))}}
|
|
868
868
|
@change=${a=>{this.dispatchChange(a),a.stopImmediatePropagation()}}
|
|
869
|
-
${
|
|
869
|
+
${H(this.inputRefTo)}
|
|
870
870
|
/>
|
|
871
871
|
${this.renderCalendarButton()}
|
|
872
872
|
</div>
|
|
873
|
-
`}};Si([
|
|
873
|
+
`}};Si([c({type:Array})],Ks.prototype,"value",2),Si([c({type:String})],Ks.prototype,"label",2),Si([c({type:Boolean})],Ks.prototype,"showRangeLabels",2),Si([c({type:Object})],Ks.prototype,"strings",2),Ks=Si([se("pkt-datepicker-range")],Ks);var Tu=Object.defineProperty,Nu=Object.getOwnPropertyDescriptor,rn=(s,e,t,i)=>{for(var n=i>1?void 0:i?Nu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Tu(e,t,n),n};let Ci=class extends Nt{constructor(){super(...arguments),this.value=[],this.strings=ya}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 b`
|
|
874
874
|
<div class="pkt-input__container">
|
|
875
875
|
<input
|
|
876
|
-
class=${
|
|
876
|
+
class=${L(this.inputClasses)}
|
|
877
877
|
.type=${this.inputType}
|
|
878
878
|
id="${this.id}-input"
|
|
879
|
-
min=${
|
|
880
|
-
max=${
|
|
881
|
-
placeholder=${
|
|
879
|
+
min=${A(this.min)}
|
|
880
|
+
max=${A(this.max)}
|
|
881
|
+
placeholder=${A(this.placeholder)}
|
|
882
882
|
?readonly=${this.isInputReadonly}
|
|
883
883
|
?disabled=${this.isInputDisabled}
|
|
884
884
|
@click=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
885
885
|
@touchend=${e=>{e.preventDefault(),this.dispatchToggleCalendar(e)}}
|
|
886
886
|
@blur=${e=>{this.dispatchBlur(e),this.dispatchAddToSelected(e)}}
|
|
887
887
|
@input=${e=>{this.dispatchInput(e),e.stopImmediatePropagation()}}
|
|
888
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
889
|
-
@keydown=${e=>
|
|
888
|
+
@focus=${()=>{this.dispatchFocus(),xs()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
889
|
+
@keydown=${e=>sn.handleInputKeydown(e,t=>this.dispatchToggleCalendar(t),()=>xi.submitFormOrFallback(this.internals,()=>{var t;return(t=this.inputRef.value)==null?void 0:t.blur()}),void 0,void 0,t=>this.dispatchAddToSelected(t))}
|
|
890
890
|
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
891
|
-
${
|
|
891
|
+
${H(this.inputRef)}
|
|
892
892
|
/>
|
|
893
893
|
${this.renderCalendarButton()}
|
|
894
894
|
</div>
|
|
895
|
-
`}};
|
|
895
|
+
`}};rn([c({type:Array})],Ci.prototype,"value",2),rn([c({type:Number})],Ci.prototype,"maxlength",2),rn([c({type:Object})],Ci.prototype,"strings",2),Ci=rn([se("pkt-datepicker-multiple")],Ci);var Mu=Object.defineProperty,Du=Object.getOwnPropertyDescriptor,Ye=(s,e,t,i)=>{for(var n=i>1?void 0:i?Du(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Mu(e,t,n),n};let He=class extends q{constructor(){super(),this._valueProperty="",this._valueProcessing=!1,this.datepickerPopupRef=F(),this._value=[],this.label="Datovelger",this.dateformat=wi.props.dateformat.default,this.multiple=wi.props.multiple.default,this.maxlength=null,this.range=wi.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=wi.props.weeknumbers.default,this.withcontrols=wi.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.today=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=F(),this.popupRef=F(),this.helptextSlot=F(),this.singleInputRef=F(),this.rangeInputRef=F(),this.multipleInputRef=F(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):tn.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new Ae(this,this.helptextSlot)}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 yu.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 i=ki(e),n=this.multiple&&i.length>1?ka.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!ka.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=n;const r=cd(n);if(this._valueProperty!==r&&(this._valueProperty=r),this.range&&n.length<2)return;super.valueChanged(r,t)}finally{this._valueProcessing=!1}}}attributeChangedCallback(e,t,i){e==="value"&&this.value!==t&&this.valueChanged(i,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=ki(i||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=ki(i||"")),super.attributeChangedCallback(e,t,i)}updated(e){if(e.has("value")&&(e.has("multiple")||e.has("range"))){const t=Array.isArray(this.value)?this.value.join(","):this.value,i=e.get("value"),n=Array.isArray(i)?i.join(","):i;this.valueChanged(t,n)}e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=ki(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,i;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(i=this.singleInputRef.value)==null?void 0:i.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,i;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(i=this.singleInputRef.value)==null?void 0:i.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return b`
|
|
896
896
|
<pkt-datepicker-single
|
|
897
897
|
.value=${this._value[0]??""}
|
|
898
898
|
.inputType=${this.inputType}
|
|
@@ -912,9 +912,9 @@
|
|
|
912
912
|
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
913
913
|
@value-change=${e=>{this.value=e.detail}}
|
|
914
914
|
@input-changed=${()=>{this.touched=!0}}
|
|
915
|
-
${
|
|
915
|
+
${H(this.singleInputRef)}
|
|
916
916
|
></pkt-datepicker-single>
|
|
917
|
-
`}renderRangeInput(){return
|
|
917
|
+
`}renderRangeInput(){return b`
|
|
918
918
|
<pkt-datepicker-range
|
|
919
919
|
.value=${this._value}
|
|
920
920
|
.inputType=${this.inputType}
|
|
@@ -933,14 +933,14 @@
|
|
|
933
933
|
@input-change=${()=>this.onInput()}
|
|
934
934
|
@input-focus=${()=>this.onFocus()}
|
|
935
935
|
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
936
|
-
@range-blur=${e=>{const t=this.currentInputElement,i=this.currentInputElementTo;if(t&&i){const n=t.value,r=i.value;if(n&&r&&n>r)i.value="",this._value=[n],this.value=n;else{const a=[n,r].filter(Boolean);a.length>0&&(a[0]!==this._value[0]||a[1]!==this._value[1])&&(this._value=a,this.value=a.join(","))}}
|
|
936
|
+
@range-blur=${e=>{const t=this.currentInputElement,i=this.currentInputElementTo;if(t&&i){const n=t.value,r=i.value;if(n&&r&&n>r)i.value="",this._value=[n],this.value=n;else{const a=[n,r].filter(Boolean);a.length>0&&(a[0]!==this._value[0]||a[1]!==this._value[1])&&(this._value=a,this.value=a.join(","))}}Vn.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),n=>this.manageValidity(n))}}
|
|
937
937
|
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
938
938
|
@validate-date-input=${e=>{xi.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
|
|
939
|
-
@handle-date-select=${e=>{var t,i;const n=
|
|
939
|
+
@handle-date-select=${e=>{var t,i;const n=ss(e.detail);if(n){const r=We(n);this._value[0]!==r&&this._value[1]!==r&&((i=(t=this.calRef)==null?void 0:t.value)==null||i.handleDateSelect(n))}}}
|
|
940
940
|
@input-changed=${()=>{this.touched=!0}}
|
|
941
|
-
${
|
|
941
|
+
${H(this.rangeInputRef)}
|
|
942
942
|
></pkt-datepicker-range>
|
|
943
|
-
`}renderMultipleInput(){return
|
|
943
|
+
`}renderMultipleInput(){return b`
|
|
944
944
|
<pkt-datepicker-multiple
|
|
945
945
|
.value=${this._value}
|
|
946
946
|
.inputType=${this.inputType}
|
|
@@ -960,9 +960,9 @@
|
|
|
960
960
|
@input-blur=${e=>{var t;(t=this.calRef.value)!=null&&t.contains(e.detail.relatedTarget)||this.onBlur()}}
|
|
961
961
|
@add-to-selected=${e=>this.addToSelected(e.detail)}
|
|
962
962
|
@input-changed=${()=>{this.touched=!0}}
|
|
963
|
-
${
|
|
963
|
+
${H(this.multipleInputRef)}
|
|
964
964
|
></pkt-datepicker-multiple>
|
|
965
|
-
`}renderCalendar(){return
|
|
965
|
+
`}renderCalendar(){return b`
|
|
966
966
|
<pkt-datepicker-popup
|
|
967
967
|
class="pkt-contents"
|
|
968
968
|
?open=${this.calendarOpen}
|
|
@@ -976,13 +976,13 @@
|
|
|
976
976
|
.latest=${this.max}
|
|
977
977
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
978
978
|
.excludeweekdays=${this.excludeweekdays}
|
|
979
|
-
.currentmonth=${this.currentmonth?
|
|
979
|
+
.currentmonth=${this.currentmonth?Yt(this.currentmonth):null}
|
|
980
980
|
.today=${this.today}
|
|
981
|
-
@date-selected=${e=>{this.value=
|
|
981
|
+
@date-selected=${e=>{this.value=Vn.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,Vn.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
|
|
982
982
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
983
|
-
${
|
|
983
|
+
${H(this.datepickerPopupRef)}
|
|
984
984
|
></pkt-datepicker-popup>
|
|
985
|
-
`}render(){return this.inputClasses=
|
|
985
|
+
`}render(){return this.inputClasses=Hn.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),b`
|
|
986
986
|
<pkt-input-wrapper
|
|
987
987
|
label="${this.label}"
|
|
988
988
|
forId="${this.id}-input"
|
|
@@ -1007,14 +1007,14 @@
|
|
|
1007
1007
|
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
1008
1008
|
class="pkt-datepicker"
|
|
1009
1009
|
>
|
|
1010
|
-
<div class="pkt-contents" ${
|
|
1011
|
-
${this.multiple?
|
|
1010
|
+
<div class="pkt-contents" ${H(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1011
|
+
${this.multiple?b`<pkt-date-tags
|
|
1012
1012
|
.dates=${this._value}
|
|
1013
1013
|
dateformat=${this.dateformat}
|
|
1014
1014
|
strings=${this.strings}
|
|
1015
1015
|
id-base=${this.id}
|
|
1016
|
-
@date-tag-removed=${e=>{var t;const i=this.datepickerPopupRef.value,n=
|
|
1017
|
-
></pkt-date-tags>`:
|
|
1016
|
+
@date-tag-removed=${e=>{var t;const i=this.datepickerPopupRef.value,n=ss(e.detail);i&&n&&typeof i.handleDateSelect=="function"?i.handleDateSelect(n):(t=this.calRef.value)==null||t.handleDateSelect(n)}}
|
|
1017
|
+
></pkt-date-tags>`:w}
|
|
1018
1018
|
<div
|
|
1019
1019
|
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
1020
1020
|
>
|
|
@@ -1022,13 +1022,13 @@
|
|
|
1022
1022
|
</div>
|
|
1023
1023
|
</pkt-input-wrapper>
|
|
1024
1024
|
${this.renderCalendar()}
|
|
1025
|
-
`}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;
|
|
1026
|
-
class=${
|
|
1025
|
+
`}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;tn.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(),xs()&&t.focusOnCurrentDate();return}await Bd(20),this.handleCalendarPosition(),xs()&&((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 i=!!t.open;t.toggle(),this.calendarOpen=!i;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}))}};Ye([c({type:String,reflect:!0})],He.prototype,"value",1),Ye([c({type:String,reflect:!0})],He.prototype,"label",2),Ye([c({type:String})],He.prototype,"dateformat",2),Ye([c({type:Boolean,reflect:!0})],He.prototype,"multiple",2),Ye([c({type:Number,reflect:!0})],He.prototype,"maxlength",2),Ye([c({type:Boolean,reflect:!0})],He.prototype,"range",2),Ye([c({type:Boolean,attribute:"show-range-labels"})],He.prototype,"showRangeLabels",2),Ye([c({type:String,reflect:!0})],He.prototype,"min",2),Ye([c({type:String,reflect:!0})],He.prototype,"max",2),Ye([c({type:Boolean})],He.prototype,"weeknumbers",2),Ye([c({type:Boolean,reflect:!0})],He.prototype,"withcontrols",2),Ye([c({converter:js.csvToArray})],He.prototype,"excludedates",2),Ye([c({converter:js.csvToArray})],He.prototype,"excludeweekdays",2),Ye([c({type:String})],He.prototype,"currentmonth",2),Ye([c({type:String})],He.prototype,"today",2),Ye([c({type:Boolean,reflect:!0,attribute:"calendar-open"})],He.prototype,"calendarOpen",2),Ye([c({type:String})],He.prototype,"timezone",2),Ye([Q()],He.prototype,"inputClasses",2),He=Ye([se("pkt-datepicker")],He);const Ou={href:{default:"#"},target:{default:"_self"}},_a={props:Ou};var Eu=Object.defineProperty,Pu=Object.getOwnPropertyDescriptor,Gs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Pu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Eu(e,t,n),n};let Ss=class extends _e{constructor(){super(),this.defaultSlot=F(),this.href=_a.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=_a.props.target.default,this.slotController=new Ae(this,this.defaultSlot)}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 b`<a
|
|
1026
|
+
class=${L(e)}
|
|
1027
1027
|
href=${this.href}
|
|
1028
1028
|
.target=${this.target}
|
|
1029
|
-
.rel=${this.external?"noopener noreferrer":
|
|
1030
|
-
>${this.iconName?
|
|
1031
|
-
>`}};
|
|
1029
|
+
.rel=${this.external?"noopener noreferrer":w}
|
|
1030
|
+
>${this.iconName?b`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${H(this.defaultSlot)}>Link</span></a
|
|
1031
|
+
>`}};Gs([c({type:String,reflect:!0})],Ss.prototype,"href",2),Gs([c({type:String,reflect:!0})],Ss.prototype,"iconName",2),Gs([c({type:String,reflect:!0})],Ss.prototype,"iconPosition",2),Gs([c({type:Boolean,reflect:!0})],Ss.prototype,"external",2),Gs([c({type:String,reflect:!0})],Ss.prototype,"target",2),Ss=Gs([se("pkt-link")],Ss);var Au=Object.defineProperty,Iu=Object.getOwnPropertyDescriptor,Vt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Iu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Au(e,t,n),n};let Et=class extends q{constructor(){super(),this.inputRef=F(),this.helptextSlot=F(),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,this.slotController=new Ae(this,this.helptextSlot)}attributeChangedCallback(e,t,i){e==="value"&&this.value!==t&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,t)),super.attributeChangedCallback(e,t,i)}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=L({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),i=this.ariaLabelledby||`${this.id}-input-label`;return b`
|
|
1032
1032
|
<pkt-input-wrapper
|
|
1033
1033
|
label="${this.label}"
|
|
1034
1034
|
?counter=${this.counter}
|
|
@@ -1053,25 +1053,25 @@
|
|
|
1053
1053
|
.tagText=${this.tagText}
|
|
1054
1054
|
class="pkt-textinput"
|
|
1055
1055
|
>
|
|
1056
|
-
<div class="pkt-contents" ${
|
|
1056
|
+
<div class="pkt-contents" ${H(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1057
1057
|
<div class="pkt-input__container">
|
|
1058
|
-
${this.prefix?
|
|
1058
|
+
${this.prefix?b`<div class="pkt-input-prefix">${this.prefix}</div>`:w}
|
|
1059
1059
|
<input
|
|
1060
|
-
${
|
|
1060
|
+
${H(this.inputRef)}
|
|
1061
1061
|
class=${t}
|
|
1062
1062
|
type=${this.type}
|
|
1063
1063
|
name=${(this.name||this.id)+"-input"}
|
|
1064
1064
|
id=${this.id+"-input"}
|
|
1065
|
-
placeholder=${
|
|
1065
|
+
placeholder=${A(this.placeholder)}
|
|
1066
1066
|
aria-labelledby=${i}
|
|
1067
1067
|
autocomplete=${this.autocomplete||"off"}
|
|
1068
|
-
minlength=${
|
|
1069
|
-
maxlength=${
|
|
1070
|
-
min=${
|
|
1071
|
-
max=${
|
|
1072
|
-
step=${
|
|
1068
|
+
minlength=${A(this.minlength||void 0)}
|
|
1069
|
+
maxlength=${A(this.maxlength||void 0)}
|
|
1070
|
+
min=${A(this.min||void 0)}
|
|
1071
|
+
max=${A(this.max||void 0)}
|
|
1072
|
+
step=${A(this.step||void 0)}
|
|
1073
1073
|
?readonly=${this.readonly}
|
|
1074
|
-
size=${this.size||
|
|
1074
|
+
size=${this.size||w}
|
|
1075
1075
|
.value=${this.value}
|
|
1076
1076
|
?disabled=${this.disabled}
|
|
1077
1077
|
aria-invalid=${this.hasError}
|
|
@@ -1082,86 +1082,86 @@
|
|
|
1082
1082
|
@blur=${n=>{this.value=n.target.value,this.onBlur(),n.stopImmediatePropagation()}}
|
|
1083
1083
|
@keydown=${n=>{var r;if(n.key==="Enter"){const a=this.internals.form;a?a.requestSubmit():(r=this.inputRef.value)==null||r.blur()}}}
|
|
1084
1084
|
/>
|
|
1085
|
-
${this.suffix?
|
|
1085
|
+
${this.suffix?b`<div class="pkt-input-suffix">
|
|
1086
1086
|
${this.suffix}
|
|
1087
|
-
${this.iconNameRight?
|
|
1087
|
+
${this.iconNameRight?b`<pkt-icon
|
|
1088
1088
|
class="pkt-input-suffix-icon"
|
|
1089
1089
|
name=${this.iconNameRight}
|
|
1090
|
-
></pkt-icon>`:
|
|
1091
|
-
${e?
|
|
1090
|
+
></pkt-icon>`:w}
|
|
1091
|
+
${e?b`<pkt-icon
|
|
1092
1092
|
class="pkt-input-suffix-icon"
|
|
1093
1093
|
name="magnifying-glass-big"
|
|
1094
|
-
></pkt-icon>`:
|
|
1095
|
-
</div>`:
|
|
1096
|
-
${!this.suffix&&this.iconNameRight?
|
|
1097
|
-
${!this.suffix&&e?
|
|
1094
|
+
></pkt-icon>`:w}
|
|
1095
|
+
</div>`:w}
|
|
1096
|
+
${!this.suffix&&this.iconNameRight?b`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:w}
|
|
1097
|
+
${!this.suffix&&e?b`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:w}
|
|
1098
1098
|
</div>
|
|
1099
1099
|
</pkt-input-wrapper>
|
|
1100
|
-
`}};
|
|
1100
|
+
`}};Vt([c({type:String,reflect:!0})],Et.prototype,"value",2),Vt([c({type:String})],Et.prototype,"type",2),Vt([c({type:Number})],Et.prototype,"size",2),Vt([c({type:String})],Et.prototype,"autocomplete",2),Vt([c({type:String})],Et.prototype,"iconNameRight",2),Vt([c({type:String})],Et.prototype,"prefix",2),Vt([c({type:String})],Et.prototype,"suffix",2),Vt([c({type:Boolean})],Et.prototype,"omitSearchIcon",2),Vt([Q()],Et.prototype,"counterCurrent",2),Et=Vt([se("pkt-textinput")],Et);const Lu=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Bu=s=>Lu(s),Fu=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 Hu=Object.defineProperty,Vu=Object.getOwnPropertyDescriptor,Cs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Vu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Hu(e,t,n),n};let rs=class extends _e{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 i="href"in e,n=L({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[t||""]:!!t});return i?b`
|
|
1101
1101
|
<pkt-link
|
|
1102
|
-
icon-name=${e.iconName||
|
|
1102
|
+
icon-name=${e.iconName||w}
|
|
1103
1103
|
href=${e.href}
|
|
1104
1104
|
aria-hidden="true"
|
|
1105
1105
|
class="pkt-user-menu__link ${t||""}"
|
|
1106
1106
|
>
|
|
1107
1107
|
${e.title}
|
|
1108
1108
|
</pkt-link>
|
|
1109
|
-
`:
|
|
1109
|
+
`:b`
|
|
1110
1110
|
<button class=${n} type="button" @click=${()=>this.handleMenuItemClick(e)}>
|
|
1111
|
-
${e.iconName?
|
|
1111
|
+
${e.iconName?b`<pkt-icon
|
|
1112
1112
|
name=${e.iconName}
|
|
1113
1113
|
class="pkt-link__icon"
|
|
1114
1114
|
aria-hidden="true"
|
|
1115
|
-
></pkt-icon>`:
|
|
1115
|
+
></pkt-icon>`:w}
|
|
1116
1116
|
${e.title}
|
|
1117
1117
|
</button>
|
|
1118
|
-
`}renderLinkSection(e){return
|
|
1118
|
+
`}renderLinkSection(e){return b`
|
|
1119
1119
|
<ul class="pkt-user-menu__sublist">
|
|
1120
|
-
${e.map(t=>
|
|
1120
|
+
${e.map(t=>b`
|
|
1121
1121
|
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(t)}</li>
|
|
1122
1122
|
`)}
|
|
1123
1123
|
</ul>
|
|
1124
|
-
`}render(){var e;const t=(e=this.userMenu)==null?void 0:e.map(
|
|
1124
|
+
`}render(){var e;const t=(e=this.userMenu)==null?void 0:e.map(Bu);return b`
|
|
1125
1125
|
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
1126
1126
|
<ul class="pkt-user-menu__list">
|
|
1127
1127
|
<!-- User section -->
|
|
1128
|
-
${this.user?
|
|
1128
|
+
${this.user?b`
|
|
1129
1129
|
<li class="pkt-user-menu__item">
|
|
1130
1130
|
<div class="pkt-user-menu__label">Pålogget som</div>
|
|
1131
1131
|
<div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
|
|
1132
|
-
${this.formattedLastLoggedIn?
|
|
1132
|
+
${this.formattedLastLoggedIn?b`
|
|
1133
1133
|
<div class="pkt-user-menu__last-logged-in">
|
|
1134
1134
|
Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
|
|
1135
1135
|
</div>
|
|
1136
|
-
`:
|
|
1136
|
+
`:w}
|
|
1137
1137
|
</li>
|
|
1138
|
-
`:
|
|
1138
|
+
`:w}
|
|
1139
1139
|
|
|
1140
1140
|
<!-- User menu items -->
|
|
1141
|
-
${t&&t.length>0?
|
|
1141
|
+
${t&&t.length>0?b`
|
|
1142
1142
|
<li class="pkt-user-menu__item">${this.renderLinkSection(t)}</li>
|
|
1143
|
-
`:
|
|
1143
|
+
`:w}
|
|
1144
1144
|
|
|
1145
1145
|
<!-- Representing section -->
|
|
1146
|
-
${this.representing?
|
|
1146
|
+
${this.representing?b`
|
|
1147
1147
|
<li class="pkt-user-menu__item">
|
|
1148
1148
|
<div class="pkt-user-menu__label">Representerer</div>
|
|
1149
1149
|
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
1150
|
-
${this.representing.orgNumber?
|
|
1150
|
+
${this.representing.orgNumber?b`<div class="pkt-user-menu__org-number">
|
|
1151
1151
|
Org.nr. ${this.representing.orgNumber}
|
|
1152
|
-
</div>`:
|
|
1153
|
-
${this.canChangeRepresentation?
|
|
1152
|
+
</div>`:w}
|
|
1153
|
+
${this.canChangeRepresentation?b`
|
|
1154
1154
|
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
1155
1155
|
<li class="pkt-user-menu__subitem">
|
|
1156
1156
|
${this.renderLinkOrButton({title:"Endre organisasjon",iconName:"cogwheel",onClick:()=>this.handleChangeRepresentation()})}
|
|
1157
1157
|
</li>
|
|
1158
1158
|
</ul>
|
|
1159
|
-
`:
|
|
1159
|
+
`:w}
|
|
1160
1160
|
</li>
|
|
1161
|
-
`:
|
|
1161
|
+
`:w}
|
|
1162
1162
|
|
|
1163
1163
|
<!-- Change representation without representing object -->
|
|
1164
|
-
${!this.representing&&this.canChangeRepresentation?
|
|
1164
|
+
${!this.representing&&this.canChangeRepresentation?b`
|
|
1165
1165
|
<li class="pkt-user-menu__item">
|
|
1166
1166
|
<ul class="pkt-user-menu__sublist">
|
|
1167
1167
|
<li class="pkt-user-menu__subitem">
|
|
@@ -1169,25 +1169,25 @@
|
|
|
1169
1169
|
</li>
|
|
1170
1170
|
</ul>
|
|
1171
1171
|
</li>
|
|
1172
|
-
`:
|
|
1172
|
+
`:w}
|
|
1173
1173
|
|
|
1174
1174
|
<!-- Logout -->
|
|
1175
|
-
${this.logoutOnClick?
|
|
1175
|
+
${this.logoutOnClick?b`
|
|
1176
1176
|
<li class="pkt-user-menu__item">
|
|
1177
1177
|
${this.renderLinkOrButton({title:"Logg ut",iconName:"exit",onClick:()=>this.handleLogout()})}
|
|
1178
1178
|
</li>
|
|
1179
|
-
`:
|
|
1179
|
+
`:w}
|
|
1180
1180
|
</ul>
|
|
1181
1181
|
</nav>
|
|
1182
|
-
`}};
|
|
1183
|
-
<pkt-icon name="oslologo" aria-hidden="true" path=${
|
|
1184
|
-
`;return this.logoLink&&typeof this.logoLink=="string"?
|
|
1182
|
+
`}};Cs([c({type:Object})],rs.prototype,"user",2),Cs([c({type:String,attribute:"formatted-last-logged-in"})],rs.prototype,"formattedLastLoggedIn",2),Cs([c({type:Object})],rs.prototype,"representing",2),Cs([c({type:Array,attribute:"user-menu"})],rs.prototype,"userMenu",2),Cs([c({type:Boolean,attribute:"can-change-representation",converter:gt})],rs.prototype,"canChangeRepresentation",2),Cs([c({type:Boolean,attribute:"logout-on-click",converter:gt})],rs.prototype,"logoutOnClick",2),rs=Cs([se("pkt-header-user-menu")],rs);var Uu=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,fe=(s,e,t,i)=>{for(var n=i>1?void 0:i?ju(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Uu(e,t,n),n};const qu="https://punkt-cdn.oslo.kommune.no/15.1/logos/";let he=class extends _e{constructor(){super(),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.hasSlotContent=!1,this.alignSlotRight=!1,this.alignSearchRight=!1,this.defaultSlot=F(),this.headerRef=F(),this.userContainerRef=F(),this.slotContainerRef=F(),this.searchContainerRef=F(),this.slotContentRef=F(),this.searchMenuRef=F(),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 i=e.relatedTarget;let n;switch(t){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const r=n.value;r&&(!i||!r.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=e=>{e.key==="Escape"&&this.openMenu!=="none"&&(e.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new Ae(this,this.defaultSlot)}updateSlots(e){this.hasSlotContent=e.has(null)||e.has(void 0)}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 i of t)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.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 i=window.innerWidth-t.clientWidth;i>0&&(e.style.paddingRight=`${i}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,i=e==="slot"?this.slotContentRef:this.searchMenuRef;if(!t.value||!i.value||!this.isTablet||this.isMobile)return;const n=t.value.getBoundingClientRect(),r=i.value.offsetWidth,a=n.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 Fu((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 w;const e=b`
|
|
1183
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${qu}></pkt-icon>
|
|
1184
|
+
`;return this.logoLink&&typeof this.logoLink=="string"?b`
|
|
1185
1185
|
<span class="pkt-header-service__logo">
|
|
1186
1186
|
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
1187
1187
|
${e}
|
|
1188
1188
|
</a>
|
|
1189
1189
|
</span>
|
|
1190
|
-
`:this.hasAttribute("logo-link")?
|
|
1190
|
+
`:this.hasAttribute("logo-link")?b`
|
|
1191
1191
|
<span class="pkt-header-service__logo">
|
|
1192
1192
|
<button
|
|
1193
1193
|
aria-label="Tilbake til forside"
|
|
@@ -1197,9 +1197,9 @@
|
|
|
1197
1197
|
${e}
|
|
1198
1198
|
</button>
|
|
1199
1199
|
</span>
|
|
1200
|
-
`:
|
|
1200
|
+
`:b`
|
|
1201
1201
|
<span class="pkt-header-service__logo" @click=${this.handleLogoClick}>${e}</span>
|
|
1202
|
-
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?
|
|
1202
|
+
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?b`
|
|
1203
1203
|
<span class="pkt-header-service__service-name">
|
|
1204
1204
|
<pkt-link
|
|
1205
1205
|
href=${this.serviceLink}
|
|
@@ -1209,7 +1209,7 @@
|
|
|
1209
1209
|
${this.serviceName}
|
|
1210
1210
|
</pkt-link>
|
|
1211
1211
|
</span>
|
|
1212
|
-
`:this.hasAttribute("service-link")?
|
|
1212
|
+
`:this.hasAttribute("service-link")?b`
|
|
1213
1213
|
<span class="pkt-header-service__service-name">
|
|
1214
1214
|
<button
|
|
1215
1215
|
class="pkt-link-button pkt-link pkt-header-service__service-link"
|
|
@@ -1218,17 +1218,17 @@
|
|
|
1218
1218
|
${this.serviceName}
|
|
1219
1219
|
</button>
|
|
1220
1220
|
</span>
|
|
1221
|
-
`:
|
|
1221
|
+
`:b`
|
|
1222
1222
|
<span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
|
|
1223
1223
|
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
1224
1224
|
</span>
|
|
1225
|
-
`:
|
|
1225
|
+
`:w}renderSlotContainer(){const e=L({"pkt-header-service__slot-container":!0,"is-open":this.openMenu==="slot"}),t=L({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return b`
|
|
1226
1226
|
<div
|
|
1227
1227
|
class=${e}
|
|
1228
1228
|
@focusout=${i=>this.handleFocusOut(i,"slot")}
|
|
1229
|
-
${
|
|
1229
|
+
${H(this.slotContainerRef)}
|
|
1230
1230
|
>
|
|
1231
|
-
${this.isTablet&&this.hasSlotContent?
|
|
1231
|
+
${this.isTablet&&this.hasSlotContent?b`
|
|
1232
1232
|
<pkt-button
|
|
1233
1233
|
skin="secondary"
|
|
1234
1234
|
variant=${this.slotMenuVariant}
|
|
@@ -1242,21 +1242,21 @@
|
|
|
1242
1242
|
>
|
|
1243
1243
|
${this.slotMenuText}
|
|
1244
1244
|
</pkt-button>
|
|
1245
|
-
`:
|
|
1245
|
+
`:w}
|
|
1246
1246
|
<div
|
|
1247
1247
|
class=${t}
|
|
1248
1248
|
id="mobile-slot-menu"
|
|
1249
|
-
role=${this.isTablet?"menu":
|
|
1250
|
-
aria-label=${this.isTablet?"Meny":
|
|
1251
|
-
${
|
|
1252
|
-
${
|
|
1249
|
+
role=${this.isTablet?"menu":w}
|
|
1250
|
+
aria-label=${this.isTablet?"Meny":w}
|
|
1251
|
+
${H(this.slotContentRef)}
|
|
1252
|
+
${H(this.defaultSlot)}
|
|
1253
1253
|
></div>
|
|
1254
1254
|
</div>
|
|
1255
|
-
`}renderSearch(){if(!this.showSearch)return
|
|
1255
|
+
`}renderSearch(){if(!this.showSearch)return w;if(this.isTablet){const e=L({"pkt-header-service__search-container":!0,"is-open":this.openMenu==="search"}),t=L({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu==="search","align-right":this.alignSearchRight});return b`
|
|
1256
1256
|
<div
|
|
1257
1257
|
class=${e}
|
|
1258
1258
|
@focusout=${i=>this.handleFocusOut(i,"search")}
|
|
1259
|
-
${
|
|
1259
|
+
${H(this.searchContainerRef)}
|
|
1260
1260
|
>
|
|
1261
1261
|
<pkt-button
|
|
1262
1262
|
skin="secondary"
|
|
@@ -1271,8 +1271,8 @@
|
|
|
1271
1271
|
>
|
|
1272
1272
|
Søk
|
|
1273
1273
|
</pkt-button>
|
|
1274
|
-
<div class=${t} ${
|
|
1275
|
-
${this.openMenu==="search"?
|
|
1274
|
+
<div class=${t} ${H(this.searchMenuRef)}>
|
|
1275
|
+
${this.openMenu==="search"?b`
|
|
1276
1276
|
<pkt-textinput
|
|
1277
1277
|
id="mobile-search-menu"
|
|
1278
1278
|
class="pkt-header-service__search-input"
|
|
@@ -1286,10 +1286,10 @@
|
|
|
1286
1286
|
@input=${this.handleSearchInputChange}
|
|
1287
1287
|
@keydown=${i=>{i.key==="Enter"&&this.handleSearch(i.target.value)}}
|
|
1288
1288
|
></pkt-textinput>
|
|
1289
|
-
`:
|
|
1289
|
+
`:w}
|
|
1290
1290
|
</div>
|
|
1291
1291
|
</div>
|
|
1292
|
-
`}return
|
|
1292
|
+
`}return b`
|
|
1293
1293
|
<pkt-textinput
|
|
1294
1294
|
id="header-service-search"
|
|
1295
1295
|
class="pkt-header-service__search-input"
|
|
@@ -1301,14 +1301,14 @@
|
|
|
1301
1301
|
@input=${this.handleSearchInputChange}
|
|
1302
1302
|
@keydown=${this.handleSearchKeyDown}
|
|
1303
1303
|
></pkt-textinput>
|
|
1304
|
-
`}renderUserButton(){var e;if(!this.user)return
|
|
1304
|
+
`}renderUserButton(){var e;if(!this.user)return w;const t=L({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu==="user"});return b`
|
|
1305
1305
|
<div
|
|
1306
1306
|
class="pkt-header-service__user-container"
|
|
1307
1307
|
@focusout=${i=>this.handleFocusOut(i,"user")}
|
|
1308
|
-
${
|
|
1308
|
+
${H(this.userContainerRef)}
|
|
1309
1309
|
>
|
|
1310
1310
|
<pkt-button
|
|
1311
|
-
class=${
|
|
1311
|
+
class=${L({"pkt-header-service__user-button":!0,"pkt-header-service__user-button--mobile":this.isMobile})}
|
|
1312
1312
|
skin="secondary"
|
|
1313
1313
|
size=${this.isMobile?"small":"medium"}
|
|
1314
1314
|
state=${this.openMenu==="user"?"active":"normal"}
|
|
@@ -1320,11 +1320,11 @@
|
|
|
1320
1320
|
<span class="pkt-sr-only">Brukermeny: </span>
|
|
1321
1321
|
${((e=this.representing)==null?void 0:e.name)||this.user.name}
|
|
1322
1322
|
</pkt-button>
|
|
1323
|
-
${this.openMenu==="user"&&this.user?
|
|
1323
|
+
${this.openMenu==="user"&&this.user?b`
|
|
1324
1324
|
<div class=${t}>
|
|
1325
1325
|
<pkt-header-user-menu
|
|
1326
1326
|
.user=${this.user}
|
|
1327
|
-
formatted-last-logged-in=${this.formattedLastLoggedIn||
|
|
1327
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn||w}
|
|
1328
1328
|
.representing=${this.representing}
|
|
1329
1329
|
.userMenu=${this.userMenu}
|
|
1330
1330
|
?can-change-representation=${this.canChangeRepresentation}
|
|
@@ -1333,15 +1333,15 @@
|
|
|
1333
1333
|
@log-out=${this.handleLogout}
|
|
1334
1334
|
></pkt-header-user-menu>
|
|
1335
1335
|
</div>
|
|
1336
|
-
`:
|
|
1336
|
+
`:w}
|
|
1337
1337
|
</div>
|
|
1338
|
-
`}renderHeader(){const e=
|
|
1339
|
-
<header class=${e} ${
|
|
1338
|
+
`}renderHeader(){const e=L({"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=L({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return b`
|
|
1339
|
+
<header class=${e} ${H(this.headerRef)}>
|
|
1340
1340
|
<div class=${t}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
1341
1341
|
|
|
1342
1342
|
<div class="pkt-header-service__content">
|
|
1343
1343
|
${this.renderSlotContainer()} ${this.renderSearch()}
|
|
1344
|
-
${this.isTablet&&this.showLogoutInHeader?
|
|
1344
|
+
${this.isTablet&&this.showLogoutInHeader?b`
|
|
1345
1345
|
<pkt-button
|
|
1346
1346
|
skin="secondary"
|
|
1347
1347
|
size=${this.isMobile?"small":"medium"}
|
|
@@ -1351,12 +1351,12 @@
|
|
|
1351
1351
|
>
|
|
1352
1352
|
Logg ut
|
|
1353
1353
|
</pkt-button>
|
|
1354
|
-
`:
|
|
1354
|
+
`:w}
|
|
1355
1355
|
</div>
|
|
1356
1356
|
|
|
1357
1357
|
<div class="pkt-header-service__user">
|
|
1358
1358
|
${this.renderUserButton()}
|
|
1359
|
-
${!this.isTablet&&this.showLogoutInHeader?
|
|
1359
|
+
${!this.isTablet&&this.showLogoutInHeader?b`
|
|
1360
1360
|
<pkt-button
|
|
1361
1361
|
skin="tertiary"
|
|
1362
1362
|
size="medium"
|
|
@@ -1366,19 +1366,19 @@
|
|
|
1366
1366
|
>
|
|
1367
1367
|
Logg ut
|
|
1368
1368
|
</pkt-button>
|
|
1369
|
-
`:
|
|
1369
|
+
`:w}
|
|
1370
1370
|
</div>
|
|
1371
1371
|
</header>
|
|
1372
|
-
`}render(){const e=this.renderHeader();if(this.isFixed){const t=
|
|
1372
|
+
`}render(){const e=this.renderHeader();if(this.isFixed){const t=L({"pkt-header-service-spacer":!0,"pkt-header-service-spacer--compact":this.compact,"pkt-header-service-spacer--has-user":!!this.user,"pkt-header-service-spacer--mobile":this.isMobile});return b`
|
|
1373
1373
|
<div class="pkt-header-service-wrapper">
|
|
1374
1374
|
${e}
|
|
1375
1375
|
<div class=${t}></div>
|
|
1376
1376
|
</div>
|
|
1377
|
-
`}return e}};
|
|
1377
|
+
`}return e}};fe([c({type:String,attribute:"service-name"})],he.prototype,"serviceName",2),fe([c({type:String,attribute:"service-link"})],he.prototype,"serviceLink",2),fe([c({type:String,attribute:"logo-link"})],he.prototype,"logoLink",2),fe([c({type:String,attribute:"search-placeholder"})],he.prototype,"searchPlaceholder",2),fe([c({type:String,attribute:"search-value"})],he.prototype,"searchValue",2),fe([c({type:Number,attribute:"mobile-breakpoint"})],he.prototype,"mobileBreakpoint",2),fe([c({type:Number,attribute:"tablet-breakpoint"})],he.prototype,"tabletBreakpoint",2),fe([c({type:String,attribute:"opened-menu"})],he.prototype,"openedMenu",2),fe([c({type:String,attribute:"log-out-button-placement"})],he.prototype,"logOutButtonPlacement",2),fe([c({type:String})],he.prototype,"position",2),fe([c({type:String,attribute:"scroll-behavior"})],he.prototype,"scrollBehavior",2),fe([c({type:String,attribute:"slot-menu-variant"})],he.prototype,"slotMenuVariant",2),fe([c({type:String,attribute:"slot-menu-text"})],he.prototype,"slotMenuText",2),fe([c({type:Boolean,attribute:"hide-logo",converter:gt})],he.prototype,"hideLogo",2),fe([c({type:Boolean,converter:gt})],he.prototype,"compact",2),fe([c({type:Boolean,attribute:"show-search",converter:gt})],he.prototype,"showSearch",2),fe([c({type:Boolean,attribute:"can-change-representation",converter:gt})],he.prototype,"canChangeRepresentation",2),fe([c({type:Boolean,attribute:"has-log-out",converter:gt})],he.prototype,"hasLogOut",2),fe([c({type:Object})],he.prototype,"user",2),fe([c({type:Array,attribute:"user-menu"})],he.prototype,"userMenu",2),fe([c({type:Object})],he.prototype,"representing",2),fe([Q()],he.prototype,"isMobile",2),fe([Q()],he.prototype,"isTablet",2),fe([Q()],he.prototype,"openMenu",2),fe([Q()],he.prototype,"isHidden",2),fe([Q()],he.prototype,"componentWidth",2),fe([Q()],he.prototype,"hasSlotContent",2),fe([Q()],he.prototype,"alignSlotRight",2),fe([Q()],he.prototype,"alignSearchRight",2),he=fe([se("pkt-header-service")],he);var Wu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,De=(s,e,t,i)=>{for(var n=i>1?void 0:i?zu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Wu(e,t,n),n};let Te=class extends _e{constructor(){super(),this.defaultSlot=F(),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.slotController=new Ae(this,this.defaultSlot)}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||[],i=this.userOptions||[];return t.length||i.length?[...e,...i,...t]:this.userMenu}render(){return b`
|
|
1378
1378
|
<pkt-header-service
|
|
1379
|
-
service-name=${
|
|
1380
|
-
service-link=${
|
|
1381
|
-
logo-link=${
|
|
1379
|
+
service-name=${A(this.serviceName)}
|
|
1380
|
+
service-link=${A(this.serviceLink)}
|
|
1381
|
+
logo-link=${A(this.logoLink)}
|
|
1382
1382
|
search-placeholder=${this.searchPlaceholder}
|
|
1383
1383
|
search-value=${this.searchValue}
|
|
1384
1384
|
mobile-breakpoint=${this.mobileBreakpoint}
|
|
@@ -1398,37 +1398,37 @@
|
|
|
1398
1398
|
.userMenu=${this.effectiveUserMenu}
|
|
1399
1399
|
.representing=${this.representing}
|
|
1400
1400
|
>
|
|
1401
|
-
<div class="pkt-contents" ${
|
|
1401
|
+
<div class="pkt-contents" ${H(this.defaultSlot)}></div>
|
|
1402
1402
|
</pkt-header-service>
|
|
1403
|
-
`}};
|
|
1403
|
+
`}};De([c({type:String,attribute:"service-name"})],Te.prototype,"serviceName",2),De([c({type:String,attribute:"service-link"})],Te.prototype,"serviceLink",2),De([c({type:String,attribute:"logo-link"})],Te.prototype,"logoLink",2),De([c({type:String,attribute:"search-placeholder"})],Te.prototype,"searchPlaceholder",2),De([c({type:String,attribute:"search-value"})],Te.prototype,"searchValue",2),De([c({type:Number,attribute:"mobile-breakpoint"})],Te.prototype,"mobileBreakpoint",2),De([c({type:Number,attribute:"tablet-breakpoint"})],Te.prototype,"tabletBreakpoint",2),De([c({type:String,attribute:"opened-menu"})],Te.prototype,"openedMenu",2),De([c({type:String,attribute:"log-out-button-placement"})],Te.prototype,"logOutButtonPlacement",2),De([c({type:String})],Te.prototype,"position",2),De([c({type:String,attribute:"scroll-behavior"})],Te.prototype,"scrollBehavior",2),De([c({type:String,attribute:"slot-menu-variant"})],Te.prototype,"slotMenuVariant",2),De([c({type:String,attribute:"slot-menu-text"})],Te.prototype,"slotMenuText",2),De([c({type:Boolean,attribute:"hide-logo",converter:gt})],Te.prototype,"hideLogo",2),De([c({type:Boolean,converter:gt})],Te.prototype,"compact",2),De([c({type:Boolean,attribute:"show-search",converter:gt})],Te.prototype,"showSearch",2),De([c({type:Boolean,attribute:"can-change-representation",converter:gt})],Te.prototype,"canChangeRepresentation",2),De([c({type:Boolean,attribute:"has-log-out",converter:gt})],Te.prototype,"hasLogOut",2),De([c({type:Object})],Te.prototype,"user",2),De([c({type:Array,attribute:"user-menu"})],Te.prototype,"userMenu",2),De([c({type:Object})],Te.prototype,"representing",2),De([c({type:Array,attribute:"user-menu-footer"})],Te.prototype,"userMenuFooter",2),De([c({type:Array,attribute:"user-options"})],Te.prototype,"userOptions",2),Te=De([se("pkt-header")],Te);var Yu=Object.defineProperty,Ku=Object.getOwnPropertyDescriptor,Ts=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ku(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Yu(e,t,n),n};let as=class extends _e{constructor(){super(),this.defaultSlot=F(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new Ae(this,this.defaultSlot)}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 b`
|
|
1404
1404
|
<a
|
|
1405
1405
|
href=${this.href}
|
|
1406
1406
|
class=${e}
|
|
1407
1407
|
target=${this.openInNewTab?"_blank":"_self"}
|
|
1408
|
-
rel=${
|
|
1408
|
+
rel=${A(this.openInNewTab?"noopener noreferrer":void 0)}
|
|
1409
1409
|
>
|
|
1410
|
-
${this.iconName&&
|
|
1411
|
-
${this.title&&
|
|
1410
|
+
${this.iconName&&b`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
1411
|
+
${this.title&&b`<div class=${t}>${this.title}</div>`}
|
|
1412
1412
|
|
|
1413
|
-
<div class="pkt-linkcard__text" ${
|
|
1413
|
+
<div class="pkt-linkcard__text" ${H(this.defaultSlot)}></div>
|
|
1414
1414
|
</a>
|
|
1415
|
-
`}};
|
|
1415
|
+
`}};Ts([c({type:String,reflect:!0})],as.prototype,"title",2),Ts([c({type:String,reflect:!0})],as.prototype,"href",2),Ts([c({type:String,reflect:!0})],as.prototype,"iconName",2),Ts([c({type:Boolean,reflect:!0})],as.prototype,"external",2),Ts([c({type:Boolean,reflect:!0})],as.prototype,"openInNewTab",2),Ts([c({type:String,reflect:!0})],as.prototype,"skin",2),as=Ts([se("pkt-linkcard")],as);var Gu=Object.defineProperty,Xu=Object.getOwnPropertyDescriptor,Xt=(s,e,t,i)=>{for(var n=i>1?void 0:i?Xu(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Gu(e,t,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.1/animations/";let Pt=class extends _e{constructor(){super(),this.defaultSlot=F(),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,this.slotController=new Ae(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(e){e.has("delay")&&this.setupLoader()}render(){const e=L({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),t=L({"pkt-contents":!0,"pkt-hide":this.isLoading});return b`<div
|
|
1416
1416
|
role="status"
|
|
1417
1417
|
aria-live="polite"
|
|
1418
1418
|
aria-busy=${this.isLoading?"true":"false"}
|
|
1419
1419
|
class=${e}
|
|
1420
1420
|
>
|
|
1421
|
-
${this.isLoading&&this._shouldDisplayLoader?
|
|
1421
|
+
${this.isLoading&&this._shouldDisplayLoader?b`<div class="pkt-loader__spinner">
|
|
1422
1422
|
<pkt-icon
|
|
1423
1423
|
name=${this.getVariant(this.variant)}
|
|
1424
1424
|
path=${this.loadingAnimationPath}
|
|
1425
1425
|
class="pkt-loader__svg pkt-loader__${this.variant}"
|
|
1426
1426
|
></pkt-icon>
|
|
1427
|
-
${this.message&&
|
|
1428
|
-
</div>`:
|
|
1429
|
-
<div class=${t} ${
|
|
1430
|
-
</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))}};
|
|
1431
|
-
${this.closable?
|
|
1427
|
+
${this.message&&b`<p>${this.message}</p>`}
|
|
1428
|
+
</div>`:w}
|
|
1429
|
+
<div class=${t} ${H(this.defaultSlot)}></div>
|
|
1430
|
+
</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))}};Xt([c({type:Number})],Pt.prototype,"delay",2),Xt([c({type:Boolean})],Pt.prototype,"inline",2),Xt([c({type:Boolean})],Pt.prototype,"isLoading",2),Xt([c({type:String})],Pt.prototype,"message",2),Xt([c({type:String})],Pt.prototype,"size",2),Xt([c({type:String})],Pt.prototype,"variant",2),Xt([c({type:String})],Pt.prototype,"loadingAnimationPath",2),Xt([Q()],Pt.prototype,"_shouldDisplayLoader",2),Pt=Xt([se("pkt-loader")],Pt);const Qu={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},jn={props:Qu};var Zu=Object.defineProperty,Ju=Object.getOwnPropertyDescriptor,Xs=(s,e,t,i)=>{for(var n=i>1?void 0:i?Ju(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&Zu(e,t,n),n};let Ns=class extends _e{constructor(){super(),this.defaultSlot=F(),this.closable=jn.props.closable.default,this.compact=jn.props.compact.default,this.title="",this.skin=jn.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.slotController=new Ae(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&Hr(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 b`<div class=${L(s)}>
|
|
1431
|
+
${this.closable?b`<div class="pkt-messagebox__close">
|
|
1432
1432
|
<button
|
|
1433
1433
|
@click=${this.close}
|
|
1434
1434
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
@@ -1436,24 +1436,24 @@
|
|
|
1436
1436
|
>
|
|
1437
1437
|
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
1438
1438
|
</button>
|
|
1439
|
-
</div>`:
|
|
1440
|
-
${this.title?
|
|
1441
|
-
<div class="pkt-messagebox__text" ${
|
|
1442
|
-
</div>`}};
|
|
1439
|
+
</div>`:w}
|
|
1440
|
+
${this.title?b`<div class="pkt-messagebox__title">${this.title}</div>`:w}
|
|
1441
|
+
<div class="pkt-messagebox__text" ${H(this.defaultSlot)}></div>
|
|
1442
|
+
</div>`}};Xs([c({type:Boolean,reflect:!0})],Ns.prototype,"closable",2),Xs([c({type:Boolean,reflect:!0})],Ns.prototype,"compact",2),Xs([c({type:String,reflect:!0})],Ns.prototype,"title",2),Xs([c({type:String,reflect:!0})],Ns.prototype,"skin",2),Xs([Q()],Ns.prototype,"_isClosed",2),Ns=Xs([se("pkt-messagebox")],Ns);const Ru={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},qn={props:Ru};var eh=Object.defineProperty,th=Object.getOwnPropertyDescriptor,At=(s,e,t,i)=>{for(var n=i>1?void 0:i?th(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&eh(e,t,n),n};let wt=class extends _e{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=qn.props.hideCloseButton.default,this.closeOnBackdropClick=qn.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=qn.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=F(),this.dialogRef=F(),this._isOpen=!1,this.close=(s,e=!1)=>{var t;if(!this._isOpen)return;this._isOpen=!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:s},bubbles:!0,composed:!0})),e||(t=this.dialogRef.value)==null||t.close(),this.requestUpdate()},this.showModal=(s=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const t=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var i;this.dialogRef.value&&((i=this.dialogRef.value)==null||i.focus())}),t&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:s},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new Ae(this,this.defaultSlot),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)}async firstUpdated(s){super.firstUpdated(s),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>Hm).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(s){s.key==="Escape"&&this.close(s)}handleBackdropClick(s){var e;this.closeOnBackdropClick&&s.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(s)}isElementInViewport(s){const e=s.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const s={"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"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},t={"pkt-modal__content":!0,"pkt-txt-18-light":!0},i=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return b`
|
|
1443
1443
|
<dialog
|
|
1444
|
-
class=${
|
|
1445
|
-
${
|
|
1444
|
+
class=${L(s)}
|
|
1445
|
+
${H(this.dialogRef)}
|
|
1446
1446
|
aria-labelledby="pkt-modal__headingText"
|
|
1447
1447
|
aria-describedby="pkt-modal__content"
|
|
1448
1448
|
@close=${r=>this.close(r,!0)}
|
|
1449
1449
|
>
|
|
1450
1450
|
<div class="pkt-modal__wrapper">
|
|
1451
|
-
${this.headingText||!this.hideCloseButton?
|
|
1451
|
+
${this.headingText||!this.hideCloseButton?b`<div class="pkt-modal__header">
|
|
1452
1452
|
<div class="pkt-modal__header-background"></div>
|
|
1453
|
-
${this.headingText?
|
|
1453
|
+
${this.headingText?b`<h1 id="pkt-modal__headingText" class=${L(e)}>
|
|
1454
1454
|
${this.headingText}
|
|
1455
|
-
</h1>`:
|
|
1456
|
-
${this.hideCloseButton?
|
|
1455
|
+
</h1>`:b`<div class="pkt-modal__headingText"></div>`}
|
|
1456
|
+
${this.hideCloseButton?b`<div class="pkt-modal__noCloseButton"></div>`:b`<div class="${L(n)}">
|
|
1457
1457
|
<pkt-button
|
|
1458
1458
|
@click=${r=>this.close(r)}
|
|
1459
1459
|
aria-label="close"
|
|
@@ -1465,46 +1465,46 @@
|
|
|
1465
1465
|
Lukk
|
|
1466
1466
|
</pkt-button>
|
|
1467
1467
|
</div>`}
|
|
1468
|
-
</div>`:
|
|
1468
|
+
</div>`:w}
|
|
1469
1469
|
<div class="pkt-modal__container">
|
|
1470
1470
|
<div
|
|
1471
1471
|
id="pkt-modal__content"
|
|
1472
|
-
class=${
|
|
1473
|
-
${
|
|
1472
|
+
class=${L(t)}
|
|
1473
|
+
${H(this.defaultSlot)}
|
|
1474
1474
|
></div>
|
|
1475
1475
|
</div>
|
|
1476
1476
|
</div>
|
|
1477
1477
|
</dialog>
|
|
1478
|
-
`}};
|
|
1478
|
+
`}};At([c({type:String})],wt.prototype,"headingText",2),At([c({type:Boolean})],wt.prototype,"removePadding",2),At([c({type:Boolean})],wt.prototype,"hideCloseButton",2),At([c({type:Boolean})],wt.prototype,"closeOnBackdropClick",2),At([c({type:String})],wt.prototype,"closeButtonSkin",2),At([c({type:String})],wt.prototype,"size",2),At([c({type:String})],wt.prototype,"variant",2),At([c({type:String})],wt.prototype,"drawerPosition",2),At([c({type:Boolean})],wt.prototype,"transparentBackdrop",2),At([Q()],wt.prototype,"_isOpen",2),wt=At([se("pkt-modal")],wt);/**
|
|
1479
1479
|
* @license
|
|
1480
1480
|
* Copyright 2018 Google LLC
|
|
1481
1481
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1482
|
-
*/const
|
|
1482
|
+
*/const $a="important",sh=" !"+$a,ih=ms(class extends Bs{constructor(s){var e;if(super(s),s.type!==Mt.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 i=s[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}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 i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const n=e[i];if(n!=null){this.ft.add(i);const r=typeof n=="string"&&n.endsWith(sh);i.includes("-")||r?t.setProperty(i,r?n.slice(0,-11):n,r?$a:""):t[i]=n}}return ft}});var nh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,Ke=(s,e,t,i)=>{for(var n=i>1?void 0:i?rh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&nh(e,t,n),n};let Le=class extends _e{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=ns(),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=F(),this.progressBarRef=F()}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||ns(),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,i=this.valueCurrent/t*100,n=this.statusType==="fraction"?Math.round(i):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),r=`${this.valueCurrent} av ${t}`,a=L({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),l=L({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),d=L({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),p=L({"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 b` <div
|
|
1483
1483
|
class="pkt-progressbar__container"
|
|
1484
1484
|
.ref=${this.progressBarRef}
|
|
1485
|
-
style=${
|
|
1485
|
+
style=${ih({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${n}%`})}
|
|
1486
1486
|
>
|
|
1487
|
-
${this.title?
|
|
1487
|
+
${this.title?b`<p id=${`${this.progressBarId}-title`} class=${l}>${this.title}</p>`:w}
|
|
1488
1488
|
|
|
1489
1489
|
<div class="pkt-progressbar__bar-wrapper">
|
|
1490
1490
|
<div class=${a}></div>
|
|
1491
1491
|
</div>
|
|
1492
1492
|
|
|
1493
|
-
${e?
|
|
1494
|
-
<span class=${p} ${
|
|
1493
|
+
${e?b`<div class=${d}>
|
|
1494
|
+
<span class=${p} ${H(this.labelRef)}>
|
|
1495
1495
|
${this.statusType==="percentage"?`${n}%`:r}
|
|
1496
1496
|
</span>
|
|
1497
|
-
</div>`:
|
|
1498
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||
|
|
1499
|
-
${this.tagText?
|
|
1500
|
-
${this.optionalTag?
|
|
1501
|
-
${this.requiredTag?
|
|
1502
|
-
`,r=()=>
|
|
1497
|
+
</div>`:w}
|
|
1498
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||ns(),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))}};Ke([c({type:String})],Le.prototype,"ariaLabel",2),Ke([c({type:String,reflect:!0})],Le.prototype,"ariaLabelledby",2),Ke([c({type:String,reflect:!0})],Le.prototype,"ariaValueText",2),Ke([c({type:String})],Le.prototype,"ariaLive",2),Ke([c({type:String,reflect:!0})],Le.prototype,"id",2),Ke([c({type:String})],Le.prototype,"role",2),Ke([c({type:String})],Le.prototype,"skin",2),Ke([c({type:String})],Le.prototype,"statusPlacement",2),Ke([c({type:String})],Le.prototype,"statusType",2),Ke([c({type:String,reflect:!0})],Le.prototype,"title",2),Ke([c({type:String})],Le.prototype,"titlePosition",2),Ke([c({type:Number,reflect:!0})],Le.prototype,"valueCurrent",2),Ke([c({type:Number})],Le.prototype,"valueMax",2),Ke([c({type:Number})],Le.prototype,"valueMin",2),Ke([Q()],Le.prototype,"labelWidth",2),Ke([Q()],Le.prototype,"progressbarId",2),Ke([Q()],Le.prototype,"computedAriaLabelledby",2),Ke([Q()],Le.prototype,"computedAriaValueText",2),Le=Ke([se("pkt-progressbar")],Le);var ah=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,xt=(s,e,t,i)=>{for(var n=i>1?void 0:i?oh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&ah(e,t,n),n};let vt=class extends q{constructor(){super(...arguments),this.inputRef=F(),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=L({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=L({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),t=L({"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",n=()=>b`
|
|
1499
|
+
${this.tagText?b`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:w}
|
|
1500
|
+
${this.optionalTag?b`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:w}
|
|
1501
|
+
${this.requiredTag?b`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:w}
|
|
1502
|
+
`,r=()=>b`
|
|
1503
1503
|
<label class=${t} for=${this.id+"-internal"}>
|
|
1504
1504
|
${this.label} ${n()}
|
|
1505
|
-
${this.checkHelptext?
|
|
1505
|
+
${this.checkHelptext?b`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:w}
|
|
1506
1506
|
</label>
|
|
1507
|
-
`;return
|
|
1507
|
+
`;return b`
|
|
1508
1508
|
<div class="pkt-input-check">
|
|
1509
1509
|
<div class=${s}>
|
|
1510
1510
|
<input
|
|
@@ -1515,7 +1515,7 @@
|
|
|
1515
1515
|
?disabled=${this.disabled}
|
|
1516
1516
|
form=""
|
|
1517
1517
|
name=${this.name+"-internal"}
|
|
1518
|
-
${
|
|
1518
|
+
${H(this.inputRef)}
|
|
1519
1519
|
@change=${this.toggleChecked}
|
|
1520
1520
|
@input=${this.onInput}
|
|
1521
1521
|
@blur=${this.onBlur}
|
|
@@ -1525,11 +1525,11 @@
|
|
|
1525
1525
|
${r()}
|
|
1526
1526
|
</div>
|
|
1527
1527
|
</div>
|
|
1528
|
-
`}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))}};
|
|
1528
|
+
`}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))}};xt([c({type:String,reflect:!0})],vt.prototype,"value",2),xt([c({type:String})],vt.prototype,"checkHelptext",2),xt([c({type:Boolean})],vt.prototype,"defaultChecked",2),xt([c({type:Boolean})],vt.prototype,"hasTile",2),xt([c({type:Boolean,reflect:!0})],vt.prototype,"checked",2),xt([c({type:String,reflect:!0})],vt.prototype,"type",2),xt([c({type:String})],vt.prototype,"tagText",2),xt([c({type:Boolean})],vt.prototype,"optionalTag",2),xt([c({type:String})],vt.prototype,"optionalText",2),xt([c({type:Boolean})],vt.prototype,"requiredTag",2),xt([c({type:String})],vt.prototype,"requiredText",2),xt([Q()],vt.prototype,"_checked",2),vt=xt([se("pkt-radiobutton")],vt);/**
|
|
1529
1529
|
* @license
|
|
1530
1530
|
* Copyright 2021 Google LLC
|
|
1531
1531
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1532
|
-
*/let
|
|
1532
|
+
*/let wa=class extends Event{constructor(e,t,i,n){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=i,this.subscribe=n??!1}};/**
|
|
1533
1533
|
* @license
|
|
1534
1534
|
* Copyright 2021 Google LLC
|
|
1535
1535
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1537,63 +1537,63 @@
|
|
|
1537
1537
|
* @license
|
|
1538
1538
|
* Copyright 2021 Google LLC
|
|
1539
1539
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1540
|
-
*/let
|
|
1540
|
+
*/let xa=class{constructor(e,t,i,n){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=i,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new wa(this.context,this.host,this.t,this.subscribe))}};/**
|
|
1541
1541
|
* @license
|
|
1542
1542
|
* Copyright 2021 Google LLC
|
|
1543
1543
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1544
|
-
*/class
|
|
1544
|
+
*/class lh{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){const i=t||!Object.is(e,this.o);this.o=e,i&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:i}]of this.subscriptions)t(this.o,i)},e!==void 0&&(this.value=e)}addCallback(e,t,i){if(!i)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});const{disposer:n}=this.subscriptions.get(e);e(this.value,n)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
1545
1545
|
* @license
|
|
1546
1546
|
* Copyright 2021 Google LLC
|
|
1547
1547
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1548
|
-
*/let
|
|
1548
|
+
*/let ch=class extends Event{constructor(e,t){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},Sa=class extends lh{constructor(e,t,i){var n,r;super(t.context!==void 0?t.initialValue:i),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[d,{consumerHost:p}]of this.subscriptions)l.has(d)||(l.add(d),p.dispatchEvent(new wa(this.context,p,d,!0)));a.stopPropagation()},this.host=e,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),(r=(n=this.host).addController)==null||r.call(n,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new ch(this.context,this.host))}};/**
|
|
1549
1549
|
* @license
|
|
1550
1550
|
* Copyright 2017 Google LLC
|
|
1551
1551
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1552
|
-
*/function
|
|
1552
|
+
*/function dh({context:s}){return(e,t)=>{const i=new WeakMap;if(typeof t=="object")return{get(){return e.get.call(this)},set(n){return i.get(this).setValue(n),e.set.call(this,n)},init(n){return i.set(this,new Sa(this,{context:s,initialValue:n})),n}};{e.constructor.addInitializer((a=>{i.set(a,new Sa(a,{context:s}))}));const n=Object.getOwnPropertyDescriptor(e,t);let r;if(n===void 0){const a=new WeakMap;r={get(){return a.get(this)},set(l){i.get(this).setValue(l),a.set(this,l)},configurable:!0,enumerable:!0}}else{const a=n.set;r={...n,set(l){i.get(this).setValue(l),a==null||a.call(this,l)}}}return void Object.defineProperty(e,t,r)}}}/**
|
|
1553
1553
|
* @license
|
|
1554
1554
|
* Copyright 2022 Google LLC
|
|
1555
1555
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1556
|
-
*/function
|
|
1556
|
+
*/function uh({context:s,subscribe:e}){return(t,i)=>{typeof i=="object"?i.addInitializer((function(){new xa(this,{context:s,callback:n=>{t.set.call(this,n)},subscribe:e})})):t.constructor.addInitializer((n=>{new xa(n,{context:s,callback:r=>{n[i]=r},subscribe:e})}))}}const Ca=Symbol("pkt-tabs-context");var hh=Object.defineProperty,ph=Object.getOwnPropertyDescriptor,Qs=(s,e,t,i)=>{for(var n=i>1?void 0:i?ph(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&hh(e,t,n),n};let Ms=class extends _e{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=F(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new Ae(this,this.defaultSlot)}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 i,n;this.useArrowNav&&(e.code==="ArrowLeft"&&t!==0&&((i=this.tabRefs[t-1])==null||i.focus()),e.code==="ArrowRight"&&t<this.tabCount-1&&((n=this.tabRefs[t+1])==null||n.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 b`
|
|
1557
1557
|
<div class="pkt-tabs">
|
|
1558
|
-
<div class="pkt-tabs__list" role=${e} ${
|
|
1558
|
+
<div class="pkt-tabs__list" role=${e} ${H(this.defaultSlot)}></div>
|
|
1559
1559
|
</div>
|
|
1560
|
-
`}};
|
|
1561
|
-
${this.icon?
|
|
1562
|
-
<span ${
|
|
1563
|
-
${this.tag?
|
|
1564
|
-
`;return this.href?
|
|
1560
|
+
`}};Qs([c({type:Boolean,reflect:!0,attribute:"arrow-nav"})],Ms.prototype,"arrowNav",2),Qs([c({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],Ms.prototype,"disableArrowNav",2),Qs([Q()],Ms.prototype,"tabRefs",2),Qs([Q()],Ms.prototype,"tabCount",2),Qs([dh({context:Ca}),Q()],Ms.prototype,"context",2),Ms=Qs([se("pkt-tabs")],Ms);var fh=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,Qt=(s,e,t,i)=>{for(var n=i>1?void 0:i?mh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&fh(e,t,n),n};let Ut=class extends _e{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=F(),this.defaultSlot=F(),this.slotController=new Ae(this,this.defaultSlot)}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,i=this.active?"active":"",n=t?"tab":void 0,r=t?this.active:void 0,a=this.active||!t?void 0:-1,l=b`
|
|
1561
|
+
${this.icon?b`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
|
|
1562
|
+
<span ${H(this.defaultSlot)}></span>
|
|
1563
|
+
${this.tag?b`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
|
|
1564
|
+
`;return this.href?b`
|
|
1565
1565
|
<a
|
|
1566
|
-
${
|
|
1566
|
+
${H(this.elementRef)}
|
|
1567
1567
|
href=${this.href}
|
|
1568
1568
|
class="pkt-tabs__link ${i}"
|
|
1569
|
-
role=${
|
|
1570
|
-
aria-selected=${
|
|
1571
|
-
aria-controls=${
|
|
1572
|
-
tabindex=${
|
|
1569
|
+
role=${A(n)}
|
|
1570
|
+
aria-selected=${A(r)}
|
|
1571
|
+
aria-controls=${A(this.controls||void 0)}
|
|
1572
|
+
tabindex=${A(a)}
|
|
1573
1573
|
@click=${this.handleClick}
|
|
1574
1574
|
@keyup=${this.handleKeyUp}
|
|
1575
1575
|
>
|
|
1576
|
-
${
|
|
1576
|
+
${l}
|
|
1577
1577
|
</a>
|
|
1578
|
-
`:
|
|
1578
|
+
`:b`
|
|
1579
1579
|
<button
|
|
1580
|
-
${
|
|
1580
|
+
${H(this.elementRef)}
|
|
1581
1581
|
type="button"
|
|
1582
1582
|
class="pkt-tabs__button pkt-link-button ${i}"
|
|
1583
|
-
role=${
|
|
1584
|
-
aria-selected=${
|
|
1585
|
-
aria-controls=${
|
|
1586
|
-
tabindex=${
|
|
1583
|
+
role=${A(n)}
|
|
1584
|
+
aria-selected=${A(r)}
|
|
1585
|
+
aria-controls=${A(this.controls||void 0)}
|
|
1586
|
+
tabindex=${A(a)}
|
|
1587
1587
|
@click=${this.handleClick}
|
|
1588
1588
|
@keyup=${this.handleKeyUp}
|
|
1589
1589
|
>
|
|
1590
|
-
${
|
|
1590
|
+
${l}
|
|
1591
1591
|
</button>
|
|
1592
|
-
`}};
|
|
1592
|
+
`}};Qt([c({type:Boolean,reflect:!0})],Ut.prototype,"active",2),Qt([c({type:String,reflect:!0})],Ut.prototype,"href",2),Qt([c({type:String,reflect:!0})],Ut.prototype,"icon",2),Qt([c({type:String,reflect:!0})],Ut.prototype,"controls",2),Qt([c({type:String,reflect:!0})],Ut.prototype,"tag",2),Qt([c({type:String,reflect:!0,attribute:"tag-skin"})],Ut.prototype,"tagSkin",2),Qt([c({type:Number,reflect:!0})],Ut.prototype,"index",2),Qt([uh({context:Ca,subscribe:!0}),c({attribute:!1})],Ut.prototype,"context",2),Ut=Qt([se("pkt-tab-item")],Ut);/**
|
|
1593
1593
|
* @license
|
|
1594
1594
|
* Copyright 2020 Google LLC
|
|
1595
1595
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1596
|
-
*/const
|
|
1596
|
+
*/const gh=ms(class extends Bs{constructor(s){if(super(s),s.type!==Mt.PROPERTY&&s.type!==Mt.ATTRIBUTE&&s.type!==Mt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ir(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[e]){if(e===ft||e===w)return e;const t=s.element,i=s.name;if(s.type===Mt.PROPERTY){if(e===t[i])return ft}else if(s.type===Mt.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(i))return ft}else if(s.type===Mt.ATTRIBUTE&&t.getAttribute(i)===e+"")return ft;return Br(s),e}});var vh=Object.defineProperty,bh=Object.getOwnPropertyDescriptor,Ti=(s,e,t,i)=>{for(var n=i>1?void 0:i?bh(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&vh(e,t,n),n};let Zs=class extends q{constructor(){super(),this.inputRef=F(),this.helptextSlot=F(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new Ae(this,this.helptextSlot)}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=L({"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 b`<pkt-input-wrapper
|
|
1597
1597
|
label=${this.label}
|
|
1598
1598
|
?counter=${this.counter}
|
|
1599
1599
|
?disabled=${this.disabled}
|
|
@@ -1616,16 +1616,16 @@
|
|
|
1616
1616
|
.tagText=${this.tagText}
|
|
1617
1617
|
class="pkt-textarea"
|
|
1618
1618
|
>
|
|
1619
|
-
<div class="pkt-contents" ${
|
|
1619
|
+
<div class="pkt-contents" ${H(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1620
1620
|
<textarea
|
|
1621
|
-
${
|
|
1621
|
+
${H(this.inputRef)}
|
|
1622
1622
|
class=${s}
|
|
1623
1623
|
id=${this.id+"-input"}
|
|
1624
1624
|
name=${(this.name||this.id)+"-input"}
|
|
1625
|
-
placeholder=${
|
|
1626
|
-
.value=${
|
|
1627
|
-
minlength=${
|
|
1628
|
-
maxlength=${
|
|
1625
|
+
placeholder=${A(this.placeholder)}
|
|
1626
|
+
.value=${gh(this.value)}
|
|
1627
|
+
minlength=${A(this.minlength)}
|
|
1628
|
+
maxlength=${A(this.maxlength)}
|
|
1629
1629
|
?readonly=${this.readonly}
|
|
1630
1630
|
autocomplete=${this.autocomplete}
|
|
1631
1631
|
aria-labelledby=${e}
|
|
@@ -1638,7 +1638,7 @@
|
|
|
1638
1638
|
@focus=${t=>{this.onFocus(),t.stopImmediatePropagation()}}
|
|
1639
1639
|
@blur=${t=>{this.value=t.target.value,this.onBlur(),t.stopImmediatePropagation()}}
|
|
1640
1640
|
></textarea>
|
|
1641
|
-
</pkt-input-wrapper>`}};Ti([
|
|
1641
|
+
</pkt-input-wrapper>`}};Ti([c({type:String,reflect:!0})],Zs.prototype,"value",2),Ti([c({type:String})],Zs.prototype,"autocomplete",2),Ti([c({type:Number})],Zs.prototype,"rows",2),Ti([Q()],Zs.prototype,"counterCurrent",2),Zs=Ti([se("pkt-textarea")],Zs);var yh=Object.defineProperty,Ta=(s,e,t,i)=>{for(var n=void 0,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=a(e,t,n)||n);return n&&yh(e,t,n),n};let Wn=class extends q{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 i=this._optionsProp.length>0,n=((t=(e=this.optionsController)==null?void 0:e.nodes)==null?void 0:t.length)&&this.optionsController.nodes.length>0;i?this._options=this._optionsProp:n&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};Ta([c({type:Array,attribute:"options"})],Wn.prototype,"_optionsProp"),Ta([Q()],Wn.prototype,"_options");var kh=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,Na=(s,e,t,i)=>{for(var n=i>1?void 0:i?_h(e,t):e,r=s.length-1,a;r>=0;r--)(a=s[r])&&(n=(i?a(e,t,n):a(n))||n);return i&&n&&kh(e,t,n),n};let zn=class extends Wn{constructor(){super(),this.inputRef=F(),this.helptextSlot=F(),this.value="",this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new ba(this),this.slotController=new Ae(this,this.helptextSlot),this.slotController.skipOptions=!0}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 i=e.value||e.text,n=this._options.findIndex(r=>r.value===i);n>=0?this._options.splice(n,0,t):this._options.push(t)}s.selected&&(this.value=s.value||s.text,this.selectedIndex=this._options.findIndex(i=>i.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 i,n;s==="options"&&(this._options=t?JSON.parse(t):[]),s==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this._options.findIndex(r=>r.value===t),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.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(i=>i.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 b`
|
|
1642
1642
|
<pkt-input-wrapper
|
|
1643
1643
|
?counter=${this.counter}
|
|
1644
1644
|
?disabled=${this.disabled}
|
|
@@ -1648,23 +1648,23 @@
|
|
|
1648
1648
|
?optionalTag=${this.optionalTag}
|
|
1649
1649
|
?requiredTag=${this.requiredTag}
|
|
1650
1650
|
useWrapper=${this.useWrapper}
|
|
1651
|
-
ariaDescribedBy=${
|
|
1651
|
+
ariaDescribedBy=${A(this.ariaDescribedBy)}
|
|
1652
1652
|
class="pkt-select"
|
|
1653
|
-
errorMessage=${
|
|
1653
|
+
errorMessage=${A(this.errorMessage)}
|
|
1654
1654
|
forId=${this.id+"-input"}
|
|
1655
|
-
helptext=${
|
|
1656
|
-
helptextDropdown=${
|
|
1657
|
-
helptextDropdownButton=${
|
|
1658
|
-
label=${
|
|
1659
|
-
optionalText=${
|
|
1660
|
-
requiredText=${
|
|
1661
|
-
tagText=${
|
|
1655
|
+
helptext=${A(this.helptext)}
|
|
1656
|
+
helptextDropdown=${A(this.helptextDropdown)}
|
|
1657
|
+
helptextDropdownButton=${A(this.helptextDropdownButton)}
|
|
1658
|
+
label=${A(this.label)}
|
|
1659
|
+
optionalText=${A(this.optionalText)}
|
|
1660
|
+
requiredText=${A(this.requiredText)}
|
|
1661
|
+
tagText=${A(this.tagText)}
|
|
1662
1662
|
>
|
|
1663
1663
|
<select
|
|
1664
1664
|
class=${s}
|
|
1665
1665
|
aria-invalid=${this.hasError}
|
|
1666
1666
|
aria-errormessage=${`${this.id}-error`}
|
|
1667
|
-
aria-labelledby=${
|
|
1667
|
+
aria-labelledby=${A(this.ariaLabelledby)}
|
|
1668
1668
|
?disabled=${this.disabled}
|
|
1669
1669
|
id=${this.id+"-input"}
|
|
1670
1670
|
name=${(this.name||this.id)+"-input"}
|
|
@@ -1673,9 +1673,9 @@
|
|
|
1673
1673
|
@input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
|
|
1674
1674
|
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
1675
1675
|
@blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
|
|
1676
|
-
${
|
|
1676
|
+
${H(this.inputRef)}
|
|
1677
1677
|
>
|
|
1678
|
-
${this._options.length>0?this._options.map(e=>
|
|
1678
|
+
${this._options.length>0?this._options.map(e=>b`<option
|
|
1679
1679
|
value=${e.value}
|
|
1680
1680
|
?selected=${this.value==e.value||e.selected}
|
|
1681
1681
|
?disabled=${e.disabled}
|
|
@@ -1684,10 +1684,10 @@
|
|
|
1684
1684
|
${e.label}
|
|
1685
1685
|
</option>`):""}
|
|
1686
1686
|
</select>
|
|
1687
|
-
<div class="pkt-contents" ${
|
|
1687
|
+
<div class="pkt-contents" ${H(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1688
1688
|
</pkt-input-wrapper>
|
|
1689
|
-
`}returnNumberOrNull(s){return s==null||isNaN(s)?null:s}};
|
|
1689
|
+
`}returnNumberOrNull(s){return s==null||isNaN(s)?null:s}};Na([c({type:String})],zn.prototype,"value",2),zn=Na([se("pkt-select")],zn);const K=It({tagName:"pkt-icon",elementClass:vs,react:h,displayName:"PktIcon",events:{}}),Ma=h.forwardRef(({defaultOpen:s=!1,id:e,title:t,skin:i,compact:n=!1,isOpen:r,children:a,name:l,className:d,onClick:p,onToggle:m},v)=>{const[y,k]=h.useState(s),{name:g}=qo(),$=l||g,C=r!==void 0?r:y;h.useEffect(()=>{r===void 0&&k(s)},[s,r]);const M=T=>{const G=T.currentTarget.open;r===void 0&&k(G),m==null||m(T)},S=T=>{setTimeout(()=>{p==null||p(T)},0)},E=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,d].filter(Boolean).join(" ");return o.jsxs("details",{ref:v,className:E,id:e,open:C,onClick:S,name:$,onToggle:M,children:[o.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${e}`,children:[t,o.jsx(K,{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})})]})});Ma.displayName="PktAccordionItem";function $h(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Yn={exports:{}};/*!
|
|
1690
1690
|
Copyright (c) 2018 Jed Watson.
|
|
1691
1691
|
Licensed under the MIT License (MIT), see
|
|
1692
1692
|
http://jedwatson.github.io/classnames
|
|
1693
|
-
*/var $a;function hd(){return $a||($a=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(r=n(r,i(c)))}return r}function i(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 c in r)e.call(r,c)&&r[c]&&(a=n(a,c));return a}function n(r,a){return a?r?r+" "+a:r+a:r}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(jn)),jn.exports}var ud=hd();const re=cd(ud),Un=({children:s,closeAlert:e,compact:t,title:i,date:n,ariaLive:r,"aria-live":a="polite",role:c="status",skin:h="info",className:p,...v})=>{const[b,y]=g.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":t,[`pkt-alert--${h}`]:h,"pkt-hide":b},m={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},w=g.useCallback(()=>{y(!0),v.onClose&&v.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[v.onClose,y]),C=r||a;return l.jsx("div",{...v,"aria-live":C,role:c,className:re(k,p),children:l.jsxs("div",{className:re(m),children:[l.jsx(ee,{className:"pkt-alert__icon","aria-hidden":"true",name:h==="info"?"alert-information":`alert-${h}`}),e&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(Vt,{tabIndex:0,"aria-label":"close",size:t?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:w,children:l.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&l.jsx("div",{className:"pkt-alert__title",children:i}),l.jsx("div",{className:"pkt-alert__text",children:s}),n&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};Un.displayName="PktAlert";const wa=Pt({tagName:"pkt-backlink",elementClass:Hs,react:g,displayName:"PktBackLink"});wa.displayName="PktBackLink";const _a=g.forwardRef(({breadcrumbs:s,navigationType:e,renderLink:t,className:i,...n},r)=>{const a=s,c=a[a.length-2],h=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=t||(e==="router"?({href:v,className:b,children:y,props:k})=>l.jsx(No.Link,{to:v,className:b,...k,children:y}):({href:v,className:b,children:y,props:k})=>l.jsx("a",{href:v,className:b,...k,children:y}));return l.jsxs("nav",{ref:r,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((v,b)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:b===a.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:v.text})}):p({href:v.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:l.jsxs(l.Fragment,{children:[l.jsx(ee,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:v.text})]}),props:n})},`breadcrumb-${b}`))}),p({href:c.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:l.jsxs(l.Fragment,{children:[l.jsx(ee,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]}),props:n})]})});_a.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.0/animations/";const Vt=g.forwardRef(({children:s,className:e,iconName:t="user",secondIconName:i="user",iconPath:n,secondIconPath:r,size:a="medium",fullWidth:c=!1,fullWidthOnMobile:h=!1,skin:p="primary",type:v="button",variant:b="label-only",state:y,color:k,isLoading:m=void 0,disabled:w=void 0,loadingAnimationPath:C=window.pktAnimationPath,...M},S)=>{const E=[e,"pkt-btn",a&&`pkt-btn--${a}`,c&&"pkt-btn--full",h&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,b&&`pkt-btn--${b}`,k&&`pkt-btn--${k}`,y&&`pkt-btn--${y}`,m&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...M,"aria-busy":m||void 0,"aria-disabled":w||void 0,disabled:w,className:E,type:v,ref:S,children:[m&&l.jsx(ee,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:C}),b!=="label-only"&&l.jsx(ee,{className:"pkt-btn__icon",name:t,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),b==="icons-right-and-left"&&l.jsx(ee,{className:"pkt-btn__icon",name:i,...r&&{path:r}})]})});Vt.displayName="PktButton";const xa=6048e5,dd=864e5,Sa=Symbol.for("constructDateFrom");function jt(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Sa in s?s[Sa](e):s instanceof Date?new s.constructor(e):new Date(e)}function pt(s,e){return jt(e||s,s)}function Ca(s,e,t){const i=pt(s,t==null?void 0:t.in);return isNaN(e)?jt(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let pd={};function rn(){return pd}function Mi(s,e){var c,h,p,v;const t=rn(),i=(e==null?void 0:e.weekStartsOn)??((h=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((v=(p=t.locale)==null?void 0:p.options)==null?void 0:v.weekStartsOn)??0,n=pt(s,e==null?void 0:e.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function an(s,e){return Mi(s,{...e,weekStartsOn:1})}function Ta(s,e){const t=pt(s,e==null?void 0:e.in),i=t.getFullYear(),n=jt(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=an(n),a=jt(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const c=an(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=c.getTime()?i:i-1}function Ma(s){const e=pt(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 Na(s,...e){const t=jt.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Wn(s,e){const t=pt(s,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function fd(s,e,t){const[i,n]=Na(t==null?void 0:t.in,s,e),r=Wn(i),a=Wn(n),c=+r-Ma(r),h=+a-Ma(a);return Math.round((c-h)/dd)}function gd(s,e){const t=Ta(s,e),i=jt(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),an(i)}function md(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function vd(s){return!(!md(s)&&typeof s!="number"||isNaN(+pt(s)))}function bd(s,e){const t=pt(s,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function yd(s,e){const[t,i]=Na(s,e.start,e.end);return{start:t,end:i}}function Da(s,e){const{start:t,end:i}=yd(e==null?void 0:e.in,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let c=1;const h=[];for(;+a<=r;)h.push(jt(t,a)),a.setDate(a.getDate()+c),a.setHours(0,0,0,0);return n?h.reverse():h}function kd(s,e){const t=pt(s,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const $d={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"}},wd=(s,e,t)=>{let i;const n=$d[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function qn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const _d={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xd={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Sd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cd={date:qn({formats:_d,defaultWidth:"full"}),time:qn({formats:xd,defaultWidth:"full"}),dateTime:qn({formats:Sd,defaultWidth:"full"})},Td={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Md=(s,e,t,i)=>Td[s];function Ni(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,c=t!=null&&t.width?String(t.width):a;n=s.formattingValues[c]||s.formattingValues[a]}else{const a=s.defaultWidth,c=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[c]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const Nd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Dd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Od={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"]},Ed={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"]},Pd={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"}},Ad={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"}},Id={ordinalNumber:(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Ni({values:Nd,defaultWidth:"wide"}),quarter:Ni({values:Dd,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Ni({values:Od,defaultWidth:"wide"}),day:Ni({values:Ed,defaultWidth:"wide"}),dayPeriod:Ni({values:Pd,defaultWidth:"wide",formattingValues:Ad,defaultFormattingWidth:"wide"})};function Di(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],c=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],h=Array.isArray(c)?Bd(c,b=>b.test(a)):Ld(c,b=>b.test(a));let p;p=s.valueCallback?s.valueCallback(h):h,p=t.valueCallback?t.valueCallback(p):p;const v=e.slice(a.length);return{value:p,rest:v}}}function Ld(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Bd(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function Fd(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[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 c=e.slice(n.length);return{value:a,rest:c}}}const Hd=/^(\d+)(th|st|nd|rd)?/i,Vd=/\d+/i,jd={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},Ud={any:[/^b/i,/^(a|c)/i]},Wd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qd={any:[/1/i,/2/i,/3/i,/4/i]},zd={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},Yd={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]},Kd={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},Rd={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]},Gd={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},Xd={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}},Qd={ordinalNumber:Fd({matchPattern:Hd,parsePattern:Vd,valueCallback:s=>parseInt(s,10)}),era:Di({matchPatterns:jd,defaultMatchWidth:"wide",parsePatterns:Ud,defaultParseWidth:"any"}),quarter:Di({matchPatterns:Wd,defaultMatchWidth:"wide",parsePatterns:qd,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Di({matchPatterns:zd,defaultMatchWidth:"wide",parsePatterns:Yd,defaultParseWidth:"any"}),day:Di({matchPatterns:Kd,defaultMatchWidth:"wide",parsePatterns:Rd,defaultParseWidth:"any"}),dayPeriod:Di({matchPatterns:Gd,defaultMatchWidth:"any",parsePatterns:Xd,defaultParseWidth:"any"})},Zd={code:"en-US",formatDistance:wd,formatLong:Cd,formatRelative:Md,localize:Id,match:Qd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Jd(s,e){const t=pt(s,e==null?void 0:e.in);return fd(t,kd(t))+1}function ep(s,e){const t=pt(s,e==null?void 0:e.in),i=+an(t)-+gd(t);return Math.round(i/xa)+1}function Oa(s,e){var v,b,y,k;const t=pt(s,e==null?void 0:e.in),i=t.getFullYear(),n=rn(),r=(e==null?void 0:e.firstWeekContainsDate)??((b=(v=e==null?void 0:e.locale)==null?void 0:v.options)==null?void 0:b.firstWeekContainsDate)??n.firstWeekContainsDate??((k=(y=n.locale)==null?void 0:y.options)==null?void 0:k.firstWeekContainsDate)??1,a=jt((e==null?void 0:e.in)||s,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const c=Mi(a,e),h=jt((e==null?void 0:e.in)||s,0);h.setFullYear(i,0,r),h.setHours(0,0,0,0);const p=Mi(h,e);return+t>=+c?i+1:+t>=+p?i:i-1}function tp(s,e){var c,h,p,v;const t=rn(),i=(e==null?void 0:e.firstWeekContainsDate)??((h=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??t.firstWeekContainsDate??((v=(p=t.locale)==null?void 0:p.options)==null?void 0:v.firstWeekContainsDate)??1,n=Oa(s,e),r=jt((e==null?void 0:e.in)||s,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),Mi(r,e)}function Ea(s,e){const t=pt(s,e==null?void 0:e.in),i=+Mi(t,e)-+tp(t,e);return Math.round(i/xa)+1}function ue(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const as={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return ue(e==="yy"?i%100:i,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,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return ue(n,e.length)}},Qs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Pa={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return as.y(s,e)},Y:function(s,e,t,i){const n=Oa(s,i),r=n>0?n:1-n;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=Ta(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 i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return ue(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return ue(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return as.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return ue(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Ea(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):ue(n,e.length)},I:function(s,e,t){const i=ep(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):ue(i,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 i=Jd(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):ue(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":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"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.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(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"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.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(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return ue(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{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 i=s.getHours();let n;switch(i===12?n=Qs.noon:i===0?n=Qs.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Qs.evening:i>=12?n=Qs.afternoon:i>=4?n=Qs.morning:n=Qs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{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 i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):ue(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):ue(i,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 i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Ia(i);case"XXXX":case"XX":return Ns(i);case"XXXXX":case"XXX":default:return Ns(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return Ia(i);case"xxxx":case"xx":return Ns(i);case"xxxxx":case"xxx":default:return Ns(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Aa(i,":");case"OOOO":default:return"GMT"+Ns(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Aa(i,":");case"zzzz":default:return"GMT"+Ns(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return ue(i,e.length)},T:function(s,e,t){return ue(+s,e.length)}};function Aa(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+ue(r,2)}function Ia(s,e){return s%60===0?(s>0?"-":"+")+ue(Math.abs(s)/60,2):Ns(s,e)}function Ns(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=ue(Math.trunc(i/60),2),r=ue(i%60,2);return t+n+e+r}const La=(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"})}},Ba=(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"})}},sp={p:Ba,P:(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return La(s,e);let r;switch(i){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}}",La(i,e)).replace("{{time}}",Ba(n,e))}},ip=/^D+$/,np=/^Y+$/,rp=["D","DD","YY","YYYY"];function ap(s){return ip.test(s)}function op(s){return np.test(s)}function lp(s,e,t){const i=cp(s,e,t);if(console.warn(i),rp.includes(s))throw new RangeError(i)}function cp(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const hp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,up=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dp=/^'([^]*?)'?$/,pp=/''/g,fp=/[a-zA-Z]/;function gp(s,e,t){var v,b,y,k;const i=rn(),n=i.locale??Zd,r=i.firstWeekContainsDate??((b=(v=i.locale)==null?void 0:v.options)==null?void 0:b.firstWeekContainsDate)??1,a=i.weekStartsOn??((k=(y=i.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,c=pt(s,t==null?void 0:t.in);if(!vd(c))throw new RangeError("Invalid time value");let h=e.match(up).map(m=>{const w=m[0];if(w==="p"||w==="P"){const C=sp[w];return C(m,n.formatLong)}return m}).join("").match(hp).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const w=m[0];if(w==="'")return{isToken:!1,value:mp(m)};if(Pa[w])return{isToken:!0,value:m};if(w.match(fp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:m}});n.localize.preprocessor&&(h=n.localize.preprocessor(c,h));const p={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return h.map(m=>{if(!m.isToken)return m.value;const w=m.value;(op(w)||ap(w))&&lp(w,e,String(s));const C=Pa[w[0]];return C(c,w,n.localize,p)}).join("")}function mp(s){const e=s.match(dp);return e?e[1].replace(pp,"'"):s}function vp(s,e){const t=pt(s,e==null?void 0:e.in).getDay();return t===0?7:t}function bp(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 zn={},Oi={};function Ds(s,e){try{const i=(zn[s]||(zn[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return i in Oi?Oi[i]:Fa(i,i.split(":"))}catch{if(s in Oi)return Oi[s];const t=s==null?void 0:s.match(yp);return t?Fa(s,t.slice(1)):NaN}}const yp=/([+-]\d\d):?(\d\d)?/;function Fa(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return Oi[s]=t*60+i>0?t*60+i+n:t*60-i-n}class Ut extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ds(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)),Va(this),Yn(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ut(...t,e):new Ut(Date.now(),e)}withTimeZone(e){return new Ut(+this,e)}getTimezoneOffset(){const e=-Ds(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Yn(this),+this}[Symbol.for("constructDateFrom")](e){return new Ut(+new Date(e),this.timeZone)}}const Ha=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Ha.test(s))return;const e=s.replace(Ha,"$1UTC");Ut.prototype[e]&&(s.startsWith("get")?Ut.prototype[s]=function(){return this.internal[e]()}:(Ut.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),kp(this),+this},Ut.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Yn(this),+this}))});function Yn(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Ds(s.timeZone,s)*60))}function kp(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()),Va(s)}function Va(s){const e=Ds(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,c=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&c&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const h=n-t;h&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+h);const p=new Date(+s);p.setUTCSeconds(0);const v=n>0?p.getSeconds():(p.getSeconds()-60)%60,b=Math.round(-(Ds(s.timeZone,s)*60))%60;(b||v)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+b+v));const y=Ds(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),w=-new Date(+s).getTimezoneOffset()-k,C=k!==t,M=w-h;if(C&&M){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+M);const S=Ds(s.timeZone,s),E=S>0?Math.floor(S):Math.ceil(S),T=k-E;T&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T))}}class os extends Ut{static tz(e,...t){return t.length?new os(...t,e):new os(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${bp(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?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new os(+this,e)}[Symbol.for("constructDateFrom")](e){return new os(+new Date(e),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const $p=(s=window.pktTz)=>{const e=new os(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 Wt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}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 Qe=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},Ei=s=>{if(!s)return null;const e=Wt(s);return isNaN(e.getTime())?null:e},wp=(s,e)=>{const t=Xt(s);return isNaN(t.getTime())?"":gp(t,e)},Xt=(s="",e)=>{const t=typeof s=="string"?Wt(s):s;return!t||isNaN(t.getTime())?new Date:e?e==="end"?bd(t):Wn(t):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 i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},Pi=s=>{let e;return typeof s=="number"?e=new os(s,window.pktTz):e=new os(s,window.pktTz),e.setHours(12,0,0,0),e};let Kn=null,ja;const _p=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Kn||ja!==e)&&(Kn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),ja=e),Kn.format(s)},xp=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Xt(e):null,n=t?Xt(t):null;return!(i&&s<i||n&&s>n)},Sp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=Qe(s);return e.includes(t)},Cp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},Ua=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!xp(s,e,t)||i&&Sp(s,i)||n&&Cp(s,n)),Tp=(s,e,t,i,n)=>s.filter(r=>{const a=Ei(r);return a&&Ua(a,e,t,i,n)}),Mp=s=>s.slice().sort((e,t)=>{const i=Ei(e),n=Ei(t);return!i||!n?0:i.getTime()-n.getTime()}),Np=(s,e)=>{const t=Ei(s),i=Ei(e);return!t||!i?!1:t<=i};function Wa(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:Qe(i));return!Ua(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function Dp(s,e,t,i){return!!(Wa(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function Op(s,e,t){const i=Zs(s,e,0);return!(t&&Xt(t)>i)}function Ep(s,e,t){const i=Zs(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Xt(t)<i)}function qa(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>Wt(e))}function za(s,e){const t=Da({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[Qe(r)]=a}return i}function Ya(s,e,t,i){if(e.length!==1)return!0;const n=Da({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(vp(n[r]).toString()))return!1}return!0}function Rn(s,e){const t=Qe(s);return e.includes(t)?e:[...e,t]}function Gn(s,e){const t=Qe(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function Ka(s,e,t){const i=Qe(s);return e.includes(i)?Gn(s,e):t>0&&e.length>=t?e:Rn(s,e)}function Pp(s,e,t){const i=Qe(s),n=qa(e);if(e.includes(i))return e.indexOf(i)===0?[]:Gn(s,e);if(e.length>1)return[i];if(e.length===1){if(!Ya(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return Rn(s,e)}const Ai=7,Ap=6;function Ip(s,e){const t=Zs(s,e,1),i=Zs(s,e+1,0),n=(t.getDay()+Ap)%Ai,r=i.getDate(),a=Math.ceil((r+n)/Ai),h=Zs(s,e,0).getDate(),p=Ea(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:h,initialWeek:p}}function Lp(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function Bp(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}const Fp={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Ai,ArrowDown:Ai};function Hp(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Vp(s,e,t){let i=Ca(s,e);if(!i)return null;let n=t(`button[data-date="${Qe(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Ca(i,e),n=t(`button[data-date="${Qe(i)}"]`),!n)return null;return i}function jp(s){return Fp[s]??null}const Up={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 Wp(s){const{selected:e,multiple:t=!1,maxMultiple:i=0,range:n=!1,earliest:r=null,latest:a=null,excludedates:c,excludeweekdays:h=[],weeknumbers:p=!1,withcontrols:v=!1,currentmonth:b,today:y,strings:k,onDateSelected:m,onClose:w,id:C,className:M}=s,S=g.useId(),E=C??S,T=g.useMemo(()=>({...Up,...k}),[k]),j=g.useMemo(()=>y?Wt(y):$p(),[y]),K=g.useMemo(()=>c?c.map(d=>typeof d=="string"?Wt(d):d):[],[c]),te=e!==void 0,[Ce,U]=g.useState([]),P=te?e:Ce,R=g.useMemo(()=>qa(P),[P]),[Q,z]=g.useState(0),[Z,ie]=g.useState(0),[pe,ae]=g.useState({}),[me,W]=g.useState(null),[oe,Ae]=g.useState(null),ce=g.useRef(null),J=g.useRef([]),it=g.useRef(0),Ye=g.useRef(!1),Te=g.useRef(!1),nt=g.useMemo(()=>({earliest:r,latest:a,excludedates:K,excludeweekdays:h}),[r,a,K,h]);g.useEffect(()=>{let d=null;if(b!=null&&(b instanceof Date?d=Pi(b):typeof b=="string"&&(d=Wt(b))),!d||isNaN(d.getTime()))if(P.length>0&&P[0]!==""){const u=Wt(P[P.length-1]);d=isNaN(u.getTime())?Pi(j):u}else d=Pi(j);if((!d||isNaN(d.getTime()))&&(d=Pi(j)),a){const u=typeof a=="string"?Wt(a):a;!isNaN(u.getTime())&&d>u&&(d=u)}if(r){const u=typeof r=="string"?Wt(r):r;!isNaN(u.getTime())&&d<u&&(d=u)}z(d.getFullYear()),ie(d.getMonth()),Te.current=!0},[]),g.useEffect(()=>{if(Te.current&&!Ye.current&&P.length>0&&P[0]!==""){const d=Wt(P[P.length-1]);isNaN(d.getTime())||(z(d.getFullYear()),ie(d.getMonth()))}},[P]),g.useEffect(()=>{n&&R.length===2?ae(za(R[0],R[1])):(!n||R.length<2)&&ae({})},[n,R]);const at=g.useCallback(d=>{te||U(d),m==null||m(d)},[te,m]),ke=g.useCallback(()=>{w==null||w()},[w]),Me=g.useCallback((d,u)=>{z(typeof d=="string"?parseInt(d):d),ie(typeof u=="string"?parseInt(u):u),it.current=0,Ae(null),J.current=[],Ye.current=!0},[]),Ze=g.useCallback(()=>{const d=Z===0?11:Z-1,u=Z===0?Q-1:Q;Me(u,d)},[Q,Z,Me]),Je=g.useCallback(()=>{const d=Z===11?0:Z+1,u=Z===11?Q+1:Q;Me(u,d)},[Q,Z,Me]),ft=g.useCallback(d=>Wa(d,nt),[nt]),ve=g.useCallback((d,u)=>Dp(d,u,nt,{multiple:t,maxMultiple:i,selectedCount:P.length}),[nt,t,i,P.length]),$e=g.useCallback(()=>typeof P=="string"?P.split(","):P,[P]),Ue=g.useCallback(d=>{if(!n||R.length!==1||!Ya(d,R,K,h)||R[0]>=d){W(null);return}W(d),ae(za(R[0],d))},[n,R,K,h]),Ne=g.useCallback(d=>{if(!d)return;let u;if(n)u=Pp(d,$e(),{excludedates:K,excludeweekdays:h}),te||U(u),u.length===2?(m==null||m(u),ke()):(u.length===1&&ae({}),m==null||m(u));else if(t)u=Ka(d,$e(),i),at(u);else{const $=Qe(d);P.includes($)?u=[]:u=[$],at(u),ke()}},[n,t,i,$e,P,K,h,te,at,ke,m]),xe=g.useCallback(d=>{const u=Rn(d,$e());te||U(u),n&&u.length===2&&(m==null||m(u),ke())},[$e,te,n,m,ke]),De=g.useCallback(d=>{const u=Gn(d,$e());te||U(u)},[$e,te]),Os=g.useCallback(d=>{const u=Ka(d,$e(),i);te||U(u)},[$e,i,te]),gt=g.useCallback(()=>{var x,I;const d=Qe(Pi(j)),u=(x=ce.current)==null?void 0:x.querySelector(`button[data-date="${d}"]`);if(u instanceof HTMLButtonElement){Ae(d),u.focus();return}const $=J.current.find(H=>!H.isDisabled);if($){const H=(I=ce.current)==null?void 0:I.querySelector(`button[data-date="${$.currentDateISO}"]`);H instanceof HTMLButtonElement&&(Ae($.currentDateISO),H.focus())}},[]),St=g.useCallback((d,u)=>{const $=d.target;if(Hp($))return;if(d.preventDefault(),!oe){gt();return}const x=Xt(oe),I=Vp(x,u,ce.current.querySelector.bind(ce.current));if(I){const H=ce.current.querySelector(`button[data-date="${Qe(I)}"]`);H instanceof HTMLButtonElement&&!H.dataset.disabled&&(Ae(Qe(I)),H.focus())}},[oe,gt]),Ct=g.useCallback(d=>{if(d.key==="Escape"){d.preventDefault(),ke();return}const u=jp(d.key);u!==null&&St(d.nativeEvent,u)},[ke,St]),qt=g.useCallback(d=>{ce.current&&!ce.current.contains(d.relatedTarget)&&!d.target.classList.contains("pkt-hide")&&ke()},[ke]);return{componentId:E,strings:T,todayDate:j,year:Q,month:Z,activeSelected:P,_selected:R,inRange:pe,rangeHovered:me,focusedDate:oe,range:n,multiple:t,weeknumbers:p,withcontrols:v,earliest:r,latest:a,excludedates:K,excludeweekdays:h,className:M,dateConstraints:nt,calendarRef:ce,selectableDatesRef:J,tabIndexSetRef:it,prevMonth:Ze,nextMonth:Je,changeMonth:Me,handleDateSelect:Ne,addToSelected:xe,removeFromSelected:De,toggleSelectedDate:Os,handleRangeHover:Ue,isExcluded:ft,isDayDisabled:ve,focusOnCurrentDate:gt,handleKeydown:Ct,handleFocusOut:qt,close:ke,setFocusedDate:Ae}}const qp=({componentId:s,strings:e,year:t,month:i,earliest:n,latest:r,withcontrols:a,prevMonth:c,nextMonth:h,changeMonth:p})=>{const v=y=>{const k=y==="prev",m=k?Op(t,i,n):Ep(t,i,r),w=k?e.prevMonth:e.nextMonth,C=k?"chevron-thin-left":"chevron-thin-right",M=k?"pkt-calendar__prev-month":"pkt-calendar__next-month",S=k?c:h;return l.jsx("div",{children:l.jsxs("button",{type:"button","aria-label":w,onClick:()=>m&&S(),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),m&&S())},className:["pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",M,!m&&"pkt-invisible"].filter(Boolean).join(" "),"data-disabled":m?void 0:"disabled","aria-disabled":!m||void 0,tabIndex:m?0:-1,children:[l.jsx(ee,{className:"pkt-btn__icon",name:C}),l.jsx("span",{className:"pkt-btn__text",children:w})]})})},b=()=>a?l.jsxs("div",{className:"pkt-cal-month-picker",children:[l.jsx("label",{htmlFor:`${s}-monthnav`,className:"pkt-hide",children:e.month}),l.jsx("select",{"aria-label":e.month,className:"pkt-input pkt-input-compact",id:`${s}-monthnav`,value:i,onChange:y=>{y.stopPropagation(),p(t,parseInt(y.target.value))},children:e.months.map((y,k)=>l.jsx("option",{value:k,children:y},k))}),l.jsx("label",{htmlFor:`${s}-yearnav`,className:"pkt-hide",children:e.year}),l.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:y=>{y.stopPropagation(),p(parseInt(y.target.value),i)}})]}):l.jsxs("div",{className:"pkt-txt-16-medium pkt-calendar__month-title","aria-live":"polite",children:[e.months[i]," ",t]});return l.jsxs("nav",{className:"pkt-cal-month-nav",children:[v("prev"),b(),v("next")]})};function zp(s,e,t){const i=Zs(t.year,t.month,s),n=Qe(i),r=n===Qe(e),a=t.activeSelected.includes(n),c=t.isDayDisabled(i,a);let h;return t.focusedDate?h=t.focusedDate===n&&!c?"0":"-1":!c&&t.tabIndexSetRef.current===0?(t.tabIndexSetRef.current=s,h="0"):h=t.tabIndexSetRef.current===s?"0":"-1",{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:c,ariaLabel:_p(i),tabindex:h}}function Yp(s,e){const{currentDateISO:t,isToday:i,isSelected:n}=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 re({"pkt-cal-today":i,"pkt-cal-selected":n,"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===Qe(e.rangeHovered)})}function Kp(s,e){const{currentDateISO:t,isToday:i,isSelected:n,isDisabled:r}=s,a=e.range&&(e.activeSelected.length===2||e.rangeHovered!==null)&&t===e.activeSelected[0],c=e.range&&e.activeSelected.length===2&&t===e.activeSelected[1];return re({"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":e.inRange[t],"pkt-calendar__date--in-range-hover":e.rangeHovered!==null&&t===Qe(e.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":c})}const Rp=({state:s})=>{const{strings:e,year:t,month:i,activeSelected:n,focusedDate:r,inRange:a,rangeHovered:c,range:h,multiple:p,weeknumbers:v,selectableDatesRef:b,tabIndexSetRef:y,handleDateSelect:k,handleRangeHover:m,isExcluded:w,isDayDisabled:C,setFocusedDate:M,todayDate:S}=s,E={year:t,month:i,activeSelected:n,focusedDate:r,tabIndexSetRef:y,isDayDisabled:C},T={range:h,activeSelected:n,rangeHovered:c,inRange:a,isExcluded:w},j=()=>{const U=[];v&&U.push(l.jsx("th",{children:l.jsx("div",{className:"pkt-calendar__week-number",children:e.week})},"week-header"));for(let P=0;P<e.daysShort.length;P++)U.push(l.jsx("th",{children:l.jsx("div",{className:"pkt-calendar__day-name","aria-label":e.days[P],children:e.daysShort[P]})},`day-${P}`));return l.jsx("tr",{className:"pkt-cal-week-row",children:U})},K=(U,P)=>{const R=zp(U,P,E),{currentDate:Q,currentDateISO:z,isSelected:Z,isDisabled:ie,ariaLabel:pe,tabindex:ae}=R;b.current.push({currentDateISO:z,isDisabled:ie,tabindex:ae});const me=Yp(R,T),W=Kp(R,T);return l.jsx("td",{className:me,children:l.jsx("button",{type:"button","aria-pressed":Z?"true":"false",disabled:ie,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${W}`,onMouseOver:()=>h&&!w(Q)&&m(Q),onFocus:()=>{h&&!w(Q)&&m(Q),M(z)},"aria-label":pe,tabIndex:parseInt(ae),"data-disabled":ie?"disabled":void 0,"data-date":z,onKeyDown:oe=>{(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),k(Q))},onClick:oe=>{ie||(oe.preventDefault(),k(Q))},children:l.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:U})})},z)},te=(U,P)=>l.jsx("td",{className:"pkt-cal-other",children:l.jsx("div",{className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only","data-disabled":"disabled",children:l.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:U})})},P),Ce=()=>{const U=S,P=Ip(t,i);b.current=[],y.current=0;let R=1,Q=P.initialWeek;const z=[];for(let Z=0;Z<P.numRows;Z++){const ie=[];v&&ie.push(l.jsx("td",{className:"pkt-cal-week",children:Q},`week-${Q}`)),Q++;for(let pe=0;pe<Ai;pe++){const ae=Lp(Z,pe,R,P);if(ae==="current-month")ie.push(K(R,U)),R++;else{const me=Bp(ae,pe,R,P);ie.push(te(me,`${ae}-${Z}-${pe}`)),ae==="next-month"&&R++}}z.push(l.jsx("tr",{className:"pkt-cal-week-row",role:"row",children:ie},`row-${Z}`))}return z};return l.jsxs("table",{className:"pkt-cal-days pkt-txt-12-medium pkt-calendar__body",role:"grid","aria-multiselectable":h||p||void 0,children:[l.jsx("thead",{children:j()}),l.jsx("tbody",{children:Ce()})]})},Xn=g.forwardRef((s,e)=>{const t=Wp(s);return g.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]),l.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:[l.jsx(qp,{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}),l.jsx(Rp,{state:t})]})});Xn.displayName="PktCalendar";const Gp=Pt({tagName:"pkt-card",elementClass:He,react:g,displayName:"PktCard",events:{}}),Ra=g.forwardRef(({children:s,...e},t)=>l.jsx(Gp,{...e,ref:t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ra.displayName="PktCard";const Ga=g.forwardRef(({id:s,hasTile:e=!1,disabled:t=!1,label:i,checkHelptext:n,hasError:r=!1,className:a,isSwitch:c=!1,hideLabel:h=!1,labelPosition:p="right",defaultChecked:v,checked:b,indeterminate:y,optionalTag:k,optionalText:m="Valgfritt",requiredTag:w,requiredText:C="Må fylles ut",tagText:M,...S},E)=>{const T=g.useRef(null);g.useEffect(()=>{T.current&&y!==void 0&&(T.current.indeterminate=y)},[y]),g.useEffect(()=>{typeof E=="function"?E(T.current):E&&(E.current=T.current)},[E]);const j=[a,"pkt-input-check"].filter(Boolean).join(" "),K=["pkt-input-check__input-label",t?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,h?"pkt-sr-only":""].filter(Boolean).join(" "),te=["pkt-input-check__input",e?"pkt-input-check__input--tile":"",t&&e?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Ce=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),U=()=>l.jsxs(l.Fragment,{children:[M&&l.jsx("span",{className:Ce+" pkt-tag--gray",children:M}),k&&l.jsx("span",{className:Ce+" pkt-tag--blue-light",children:m}),w&&l.jsx("span",{className:Ce+" pkt-tag--beige",children:C})]});return l.jsx("div",{className:j,children:l.jsxs("div",{className:te,children:[p==="left"&&l.jsxs("label",{className:K,htmlFor:s,children:[i," ",U(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:c?"switch":"checkbox",ref:T,className:`pkt-input-check__input-checkbox ${r?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:t,...b!==void 0?{checked:b}:{defaultChecked:v},...S}),p==="right"&&l.jsxs("label",{className:K,htmlFor:s,children:[i," ",U(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Ga.displayName="PktCheckbox";const Xp=Pt({tagName:"pkt-combobox",elementClass:Se,react:g,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Xa=g.forwardRef(({children:s,helptext:e,...t},i)=>l.jsxs(Xp,{...t,ref:i,children:[e&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:e}),s]}));Xa.displayName="PktCombobox";const on=Pt({tagName:"pkt-consent",elementClass:_t,react:g,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});on.displayName="PktConsent";const Js=g.forwardRef(({forId:s,label:e,helptext:t,helptextDropdown:i,helptextDropdownButton:n,counter:r,counterCurrent:a=0,counterMaxLength:c,optionalTag:h=!1,optionalText:p="Valgfritt",requiredTag:v=!1,requiredText:b="Må fylles ut",tagText:y=null,hasError:k=!1,errorMessage:m,disabled:w=!1,inline:C=!1,ariaDescribedby:M,useWrapper:S=!0,children:E,className:T="",hasFieldset:j=!1,role:K="group",counterPosition:te="bottom"},Ce)=>{const[U,P]=g.useState(!1),R=M||(t?`${s}-helptext`:void 0),Q=!!r,z=Q&&te==="top",Z=Q&&te==="bottom",ie=()=>P(J=>!J),pe=["pkt-inputwrapper",T,k?"pkt-inputwrapper--error":"",w?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),ae=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),me=()=>Q?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[a,c?`/${c}`:""]}):null,W=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:ae+" pkt-tag--gray",children:y}),h&&l.jsx("span",{className:ae+" pkt-tag--blue-light",children:p}),v&&l.jsx("span",{className:ae+" pkt-tag--beige",children:b})]}),oe=()=>{const J=l.jsxs(l.Fragment,{children:[e," ",W()]});return S?j?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:J}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":R,id:`${s}-label`,children:J}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":R,id:`${s}-label`,children:e})},Ae=()=>!t&&!i?null:l.jsxs(l.Fragment,{children:[t&&S&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:t}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(Vt,{skin:"tertiary",size:"small",variant:"icon-right",iconName:U?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ie,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${U?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),ce=l.jsxs(l.Fragment,{children:[oe(),Ae(),z&&l.jsx(me,{}),E,Z&&l.jsx(me,{}),k&&m&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(Un,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:m})})]});return l.jsx("div",{className:pe,ref:Ce,role:K,children:j?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":R,children:ce}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:ce})})});Js.displayName="PktInputWrapper";const Qa=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},Qp=()=>Qa()?"text":"date",Zp=s=>!s||s.length!==2?!0:Np(s[0],s[1]),Jp=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),ef=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),tf=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),sf=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,nf=(s,e,t=!1)=>{var c;if(!s||!e)return;const i=((c=e.parentElement)==null?void 0:c.getBoundingClientRect())||e.getBoundingClientRect(),n=t?i.height+30:i.height,r=s.getBoundingClientRect().height;let a=t?"calc(100% - 30px)":"100%";i&&i.top+r>window.innerHeight&&i.top-r>0&&(a=`calc(100% - ${n}px - ${r}px)`),s.style.top=a},ln=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},rf=({open:s,multiple:e=!1,range:t=!1,weeknumbers:i=!1,withcontrols:n=!1,selected:r=[],earliest:a,latest:c,excludedates:h,excludeweekdays:p,maxMultiple:v,currentmonth:b,today:y,inputRef:k,hasCounter:m=!1,onDateSelected:w,onClose:C})=>{const M=g.useRef(null),S=g.useRef(!1);s&&(S.current=!0),g.useEffect(()=>{s&&nf(M.current,(k==null?void 0:k.current)??null,m)},[s,k,m]);const E=["pkt-calendar-popup",s?"show":"hide"].join(" "),T=s||S.current;return l.jsx("div",{ref:M,className:E,hidden:!s,"aria-hidden":!s,children:T&&l.jsx(Xn,{multiple:e,range:t,weeknumbers:i,withcontrols:n,selected:r,earliest:a,latest:c,excludedates:h,excludeweekdays:p,maxMultiple:v,currentmonth:b,today:y,onDateSelected:w,onClose:C})})},cn=g.forwardRef(({children:s,skin:e,textStyle:t,size:i,closeTag:n,className:r,iconName:a,ariaLabel:c,onClose:h,type:p,"aria-description":v,...b},y)=>{const[k,m]=g.useState(!1),w=g.useCallback(()=>{m(!0),h&&h()},[h]),C=g.useRef(null),[M,S]=g.useState("");g.useEffect(()=>{var K,te;S(((te=(K=C.current)==null?void 0:K.textContent)==null?void 0:te.trim())??"")},[s]);const E=g.useMemo(()=>{if(n&&!c)return M&&`Klikk for å fjerne ${M}`||v},[n,c,M,v]),T={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`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--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,"pkt-btn--icons-right-and-left":n&&!!a,"pkt-hide":k};return n?l.jsxs("button",{...b,className:re(j,r),type:p,onClick:w,"aria-label":c,"aria-description":E,ref:y,children:[a&&l.jsx(ee,{className:"pkt-tag__icon",name:a}),l.jsx("span",{ref:C,children:s}),l.jsx(ee,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...b,className:re(T,r),ref:y,children:[a&&l.jsx(ee,{className:"pkt-tag__icon",name:a,"aria-hidden":"true"}),l.jsx("span",{ref:C,children:s})]})});cn.displayName="PktTag";const af=({dates:s,dateformat:e,idBase:t,strings:i,onDateRemoved:n})=>{var c;const r=Mp(s),a=((c=i==null?void 0:i.calendar)==null?void 0:c.buttonAltText)??"Slett dato";return l.jsx("div",{className:"pkt-date-tags pkt-datepicker__tags","aria-live":"polite",children:r.map(h=>{const p=wp(h,e);return l.jsx(cn,{id:`${t}${h}-tag`,closeTag:!0,ariaLabel:`${a} ${p}`,onClose:()=>n(h),children:l.jsx("time",{dateTime:h,children:p})},h)})})},of=({state:s})=>{var nt,at,ke,Me;const{id:e,inputId:t,values:i,dateformat:n,multiple:r,range:a,showRangeLabels:c,disabled:h,readOnly:p,required:v,label:b,name:y,placeholder:k,hasError:m,helptext:w,minStr:C,maxStr:M,inputType:S,isIOSDevice:E,strings:T,inputClasses:j,buttonClasses:K,rangeLabelClasses:te,datepickerInputsClasses:Ce,isInputDisabled:U,inputRef:P,inputRefTo:R,btnRef:Q,toggleCalendar:z,handleFocus:Z,handleSingleInputChange:ie,handleRangeFromChange:pe,handleRangeToChange:ae,handleRangeBlur:me,handleMultipleBlur:W,handleTagRemoved:oe,handleSingleKeydown:Ae,handleRangeFromKeydown:ce,handleRangeToKeydown:J,handleMultipleKeydown:it,restProps:Ye}=s,Te=()=>{var Ze,Je;return l.jsxs("button",{ref:Q,className:K,type:"button",onClick:z,disabled:h,"aria-label":((Ze=T.calendar)==null?void 0:Ze.buttonAltText)??"Åpne kalender",children:[l.jsx(ee,{name:"calendar"}),l.jsx("span",{className:"pkt-btn__text",children:((Je=T.calendar)==null?void 0:Je.buttonAltText)??"Åpne kalender"})]})};return r?l.jsxs(l.Fragment,{children:[l.jsx(af,{dates:i,dateformat:n,idBase:e,strings:T,onDateRemoved:oe}),l.jsx("div",{className:"pkt-datepicker__inputs",children:l.jsxs("div",{className:"pkt-input__container",children:[l.jsx("input",{...Ye,ref:P,className:j,type:S,id:t,name:y??e,placeholder:k,readOnly:p||E&&!p,disabled:U,"aria-describedby":w?`${e}-helptext`:void 0,"aria-invalid":m,"aria-errormessage":m?`${e}-error`:void 0,onClick:z,onKeyDown:it,onFocus:Z,onBlur:W}),Te()]})})]}):a?l.jsx("div",{className:Ce,children:l.jsxs("div",{className:"pkt-input__container",children:[c&&l.jsx("div",{className:"pkt-input-prefix",children:((nt=T.generic)==null?void 0:nt.from)??"Fra"}),l.jsx("input",{...Ye,ref:P,className:j,type:S,id:t,name:y?`${y}-from`:`${e}-from`,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||E&&!p,disabled:h,required:v,"aria-label":`${b} ${((at=T.generic)==null?void 0:at.from)??"Fra"}`,"aria-describedby":w?`${e}-helptext`:void 0,"aria-invalid":m,"aria-errormessage":m?`${e}-error`:void 0,onClick:z,onKeyDown:ce,onFocus:Z,onBlur:me,onChange:pe}),l.jsx("div",{className:te,id:`${e}-to-label`,children:((ke=T.generic)==null?void 0:ke.to)??"Til"}),!c&&l.jsx("div",{className:"pkt-input-separator",children:"–"}),l.jsx("input",{ref:R,className:j,type:S,id:`${e}-to`,name:y?`${y}-to`:`${e}-to`,value:i[1]??"",min:C,max:M,readOnly:p||E&&!p,disabled:h,"aria-label":`${b} ${((Me=T.generic)==null?void 0:Me.to)??"Til"}`,"aria-invalid":m,onClick:z,onKeyDown:J,onFocus:Z,onBlur:me,onChange:ae}),Te()]})}):l.jsx("div",{className:"pkt-datepicker__inputs",children:l.jsxs("div",{className:"pkt-input__container",children:[l.jsx("input",{...Ye,ref:P,className:j,type:S,id:t,name:y??e,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||E&&!p,disabled:h,required:v,"aria-describedby":w?`${e}-helptext`:void 0,"aria-invalid":m,"aria-errormessage":m?`${e}-error`:void 0,onClick:z,onKeyDown:Ae,onFocus:Z,onBlur:void 0,onChange:ie}),Te()]})})},lf={calendar:{buttonAltText:"Åpne kalender"}},cf={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}},Za=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[];function hf(s,e){const{id:t,label:i,value:n,defaultValue:r,dateformat:a="dd.MM.yyyy",multiple:c=!1,maxlength:h,range:p=!1,showRangeLabels:v=!1,weeknumbers:b=!1,withcontrols:y=!1,excludedates:k,excludeweekdays:m,currentmonth:w,today:C,calendarOpen:M,timezone:S,fullwidth:E=!1,hasFieldset:T=!1,inline:j=!1,helptext:K,helptextDropdown:te,helptextDropdownButton:Ce,hasError:U=!1,errorMessage:P,optionalTag:R=!1,optionalText:Q,requiredTag:z=!1,requiredText:Z,tagText:ie,useWrapper:pe=!0,strings:ae,disabled:me=!1,readOnly:W=!1,required:oe=!1,name:Ae,min:ce,max:J,placeholder:it,onChange:Ye,onValueChange:Te,className:nt,...at}=s,ke=g.useCallback(N=>N===void 0?[]:Za(N),[]),Me=n!==void 0,Ze=typeof r=="number"?void 0:r,[Je,ft]=g.useState(()=>ke(n??Ze)),ve=Me?ke(n):Je;g.useEffect(()=>{Me&&ft(ke(n))},[n,Me,ke]);const[$e,Ue]=g.useState(M??!1);g.useEffect(()=>{M!==void 0&&Ue(M)},[M]);const Ne=g.useRef(null),xe=g.useRef(null),De=g.useRef(null),Os=g.useRef(null),gt=g.useRef(null),St=g.useMemo(()=>Qp(),[]),Ct=g.useMemo(()=>Qa(),[]),qt=g.useMemo(()=>ae??(p?cf:lf),[ae,p]),d=typeof ce=="string"?ce:ce!==void 0?String(ce):void 0,u=typeof J=="string"?J:J!==void 0?String(J):void 0,$=g.useMemo(()=>{const N=Jp(E,v,c,p,W,St);return Object.entries(N).filter(([,D])=>D).map(([D])=>D).join(" ")},[E,v,c,p,W,St]),x=g.useMemo(()=>{const N=ef();return Object.entries(N).filter(([,D])=>D).map(([D])=>D).join(" ")},[]),I=g.useMemo(()=>{const N=tf(v);return Object.entries(N).filter(([,D])=>D).map(([D])=>D).join(" ")},[v]),H=g.useMemo(()=>["pkt-datepicker__inputs",p&&v&&"pkt-input__range-inputs"].filter(Boolean).join(" "),[p,v]),G=g.useMemo(()=>{if(w)return w;if(u)return u.slice(0,7)},[w,u]),ot=me||c&&h!=null&&ve.length>=h,We=c&&h!=null,lt=`${t}-input`,ls=ve.join(",");g.useEffect(()=>{De.current&&(De.current.value=ls)},[ls]),g.useEffect(()=>{S&&typeof window<"u"&&S!==window.pktTz&&(window.pktTz=S)},[S]);const Ke=g.useCallback((N,D=!0)=>{Me||ft(N),D&&(Te==null||Te(N))},[Me,Te]),er=g.useMemo(()=>{var N;return(N=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:N.set},[]),mt=g.useCallback(N=>{const D=De.current;!D||!er||(er.call(D,N.join(",")),D.dispatchEvent(new Event("input",{bubbles:!0})))},[er]),Qt=g.useCallback(()=>{me||Ue(N=>!N)},[me]),cs=g.useCallback(()=>{Ue(!1)},[]);g.useEffect(()=>{if(!$e)return;const N=qe=>{var $t;const Ie=qe.target;gt.current&&!gt.current.contains(Ie)&&!(($t=Ie.closest)!=null&&$t.call(Ie,".pkt-calendar-popup"))&&cs()},D=qe=>{var Ie;qe.key==="Escape"&&(cs(),(Ie=Ne.current)==null||Ie.focus())};return document.addEventListener("click",N,!0),document.addEventListener("keydown",D),()=>{document.removeEventListener("click",N,!0),document.removeEventListener("keydown",D)}},[$e,cs]);const jf=g.useCallback(()=>{Ct&&!$e&&Ue(!0)},[Ct,$e]),Uf=g.useCallback(N=>{var $t;const D=sf(N,c,p),qe=Za(D),Ie=!p||qe.length===2;Ke(qe,Ie),Ie&&mt(qe),!c&&!p&&(cs(),($t=Ne.current)==null||$t.focus())},[c,p,Ke,mt,cs]),Wf=g.useCallback(()=>{var N;cs(),(N=Ne.current)==null||N.focus()},[cs]),qf=g.useCallback(N=>{const D=N.target.value,qe=D?[D]:[];Ke(qe),mt(qe)},[Ke,mt]),zf=g.useCallback(N=>{const D=N.target.value,qe=ve[1]??"",Ie=[D,qe].filter(Boolean),$t=Ie.length===2;Ke(Ie,$t),$t&&mt(Ie)},[ve,Ke,mt]),Yf=g.useCallback(N=>{const D=ve[0]??"",qe=N.target.value,Ie=[D,qe].filter(Boolean),$t=Ie.length===2;Ke(Ie,$t),$t&&mt(Ie)},[ve,Ke,mt]),Kf=g.useCallback(()=>{ve.length===2&&!Zp(ve)&&(Ke([ve[0]]),mt([ve[0]]))},[ve,Ke,mt]),pn=g.useCallback(N=>{const D=Xt(N),qe=d?Xt(d):null,Ie=u?Xt(u):null;if(D&&!isNaN(D.getTime())&&(!qe||D>=qe)&&(!Ie||D<=Ie)){const $t=Tp([...ve,N],d,u,k,m),Co=[...new Set($t)];Ke(Co),mt(Co)}},[ve,d,u,k,m,Ke,mt]),Rf=g.useCallback(N=>{const D=N.target;D.value&&(pn(D.value.split(",")[0]),D.value="")},[pn]),So=g.useCallback(N=>{const D=N.target;D.value&&(pn(D.value.split(",")[0]),D.value="")},[pn]),Gf=g.useCallback(N=>{const D=ve.filter(qe=>qe!==N);Ke(D),mt(D)},[ve,Ke,mt]),hs=g.useCallback(N=>{const D=N==null?void 0:N.closest("form");D?D.requestSubmit():N==null||N.blur()},[]),Xf=g.useCallback(N=>{ln(N.nativeEvent,()=>Qt(),()=>hs(Ne.current),void 0,()=>{var D;return(D=Ne.current)==null?void 0:D.blur()})},[Qt,hs]),Qf=g.useCallback(N=>{ln(N.nativeEvent,()=>Qt(),()=>hs(Ne.current),()=>{var D;return(D=xe.current)==null?void 0:D.focus()},()=>{var D;return(D=Ne.current)==null?void 0:D.blur()})},[Qt,hs]),Zf=g.useCallback(N=>{ln(N.nativeEvent,()=>Qt(),()=>hs(xe.current),void 0,()=>{var D;return(D=xe.current)==null?void 0:D.blur()})},[Qt,hs]),Jf=g.useCallback(N=>{ln(N.nativeEvent,()=>Qt(),()=>hs(Ne.current),void 0,()=>{var D;return(D=Ne.current)==null?void 0:D.blur()},So)},[Qt,hs,So]);return g.useImperativeHandle(e,()=>({get value(){var N;return((N=De.current)==null?void 0:N.value)??""},set value(N){const D=N?N.split(",").filter(Boolean):[];ft(D),De.current&&(De.current.value=N??"")},focus(){var N;(N=Ne.current)==null||N.focus()},blur(){var N;(N=Ne.current)==null||N.blur()}}),[]),{id:t,inputId:lt,label:i,values:ve,calendarOpen:$e,dateformat:a,multiple:c,maxlength:h,range:p,showRangeLabels:v,weeknumbers:b,withcontrols:y,excludedates:k,excludeweekdays:m,disabled:me,readOnly:W,required:oe,name:Ae,placeholder:it,fullwidth:E,hasFieldset:T,inline:j,helptext:K,helptextDropdown:te,helptextDropdownButton:Ce,hasError:U,errorMessage:P,optionalTag:R,optionalText:Q,requiredTag:z,requiredText:Z,tagText:ie,useWrapper:pe,className:nt,minStr:d,maxStr:u,effectiveCurrentMonth:G,today:C,inputType:St,isIOSDevice:Ct,strings:qt,inputClasses:$,buttonClasses:x,rangeLabelClasses:I,datepickerInputsClasses:H,isInputDisabled:ot,hasCounter:We,inputRef:Ne,inputRefTo:xe,changeInputRef:De,btnRef:Os,wrapperRef:gt,onChange:Ye,toggleCalendar:Qt,hideCalendar:cs,handleDateSelected:Uf,handleCalendarClose:Wf,handleFocus:jf,handleSingleInputChange:qf,handleRangeFromChange:zf,handleRangeToChange:Yf,handleRangeBlur:Kf,handleMultipleBlur:Rf,handleTagRemoved:Gf,handleSingleKeydown:Xf,handleRangeFromKeydown:Qf,handleRangeToKeydown:Zf,handleMultipleKeydown:Jf,restProps:at}}const Ja=g.forwardRef((s,e)=>{const t=hf(s,e),i=["pkt-datepicker",t.className].filter(Boolean).join(" ");return l.jsxs("div",{className:i,children:[l.jsx(Js,{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:l.jsx(of,{state:t})}),l.jsx(rf,{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}),l.jsx("input",{ref:t.changeInputRef,type:"text",name:t.name,onChange:t.onChange,tabIndex:-1,"aria-hidden":"true",className:"pkt-visually-hidden"})]})});Ja.displayName="PktDatepicker";const uf=({columnOne:s,columnTwo:e,socialLinks:t,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:c=!1,hotjarId:h=null,googleAnalyticsId:p=null,devMode:v=!1,cookieDomain:b=null,cookieSecure:y=null,cookieExpiryDays:k=null,onToggleConsent:m=w=>{console.log(w.detail)}})=>{var C,M;const w=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:w,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:s.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&l.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((S,E)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${E}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:e.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[e.text&&l.jsx("li",{className:"pkt-footer__text",children:e.text}),(M=e.links)==null?void 0:M.map((S,E)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${E}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),l.jsxs("ul",{className:"pkt-footer__list",children:[l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),c&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(on,{triggerType:"footerlink",hotjarId:h,googleAnalyticsId:p,devMode:v,cookieDomain:b,cookieSecure:y,cookieExpiryDays:k,onToggleConsent:m})})]})]})]}),t&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:t.filter(S=>S.language).map((S,E)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${E}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:t.filter(S=>S.iconName).map((S,E)=>l.jsx(g.Fragment,{children:l.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(ee,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${E}`))})]})]})})},df=({links:s=[],openLinksInNewTab:e=!1,personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:r=null,googleAnalyticsId:a=null,devMode:c=!1,cookieDomain:h=null,cookieSecure:p=null,cookieExpiryDays:v=null,onToggleConsent:b=k=>{console.log(k.detail)},className:y})=>{const k=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:k,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((m,w)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${m.external?" pkt-link--external":""}`,href:m.href,target:m.openInNewTab||e?"_blank":"_self",rel:m.openInNewTab||e?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),m.text]})},w)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:t,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[l.jsx(ee,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(on,{triggerType:"footerlink",hotjarId:r,googleAnalyticsId:a,devMode:c,cookieDomain:h,cookieSecure:p,cookieExpiryDays:v,onToggleConsent:b})})]})})})},pf=(s,e)=>{const t=()=>typeof window>"u"?0:window.innerWidth,[i,n]=g.useState(t);return g.useEffect(()=>{const r=s.current;if(!r)return;if(n(r.offsetWidth),typeof ResizeObserver>"u"){const c=()=>{r&&n(r.offsetWidth)};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)}const a=new ResizeObserver(c=>{for(const h of c)h.borderBoxSize&&h.borderBoxSize.length>0?n(h.borderBoxSize[0].inlineSize):n(h.contentRect.width)});return a.observe(r),()=>{a.disconnect()}},[s]),i};function ff(s){const e=g.useRef(0);g.useEffect(()=>{const t=document.body,i=document.documentElement;if(s){e.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(t.style.paddingRight=`${n}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",i.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 hn=({href:s,iconName:e,className:t,iconPosition:i,external:n,target:r,children:a,...c})=>{const h={"pkt-link":!0,"pkt-link--icon-left":!!e&&i==="left"||!!(e&&!i),"pkt-link--icon-right":!!e&&i==="right","pkt-link--external":n};return l.jsxs("a",{...c,className:re(h,t),href:s,target:r,rel:n?"noopener noreferrer":void 0,children:[e&&l.jsx(ee,{name:e,className:"pkt-link__icon"}),a]})};hn.displayName="PktLink";const gf=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},un=({item:s,className:e})=>"href"in s?l.jsx(hn,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:re("pkt-user-menu__link",e),children:s.title}):l.jsxs("button",{className:re("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&&l.jsx(ee,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),mf=({links:s})=>l.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((e,t)=>l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(un,{item:e})},t))}),eo=g.forwardRef(({user:s,formattedLastLoggedIn:e,representing:t,userMenu:i,canChangeRepresentation:n,changeRepresentation:r,logoutOnClick:a},c)=>{const h=i==null?void 0:i.map(gf);return l.jsx("nav",{className:"pkt-user-menu",ref:c,"aria-label":"Meny for innlogget bruker",children:l.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),e&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:e})]})]}),h&&h.length>0&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(mf,{links:h})}),t&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:t.name}),t.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",t.orgNumber]}),n&&r&&l.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(un,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})]}),!t&&n&&r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx("ul",{className:"pkt-user-menu__sublist",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(un,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})}),a&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(un,{item:{title:"Logg ut",iconName:"exit",onClick:a}})})]})})});eo.displayName="PktHeaderUserMenu";const dn=g.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,autocomplete:i="off",counter:n,counterMaxLength:r,className:a,disabled:c=!1,errorMessage:h,hasError:p=!1,helptext:v,helptextDropdown:b,helptextDropdownButton:y,iconNameRight:k,inline:m=!1,fullwidth:w=!1,label:C,name:M,optionalTag:S=!1,optionalText:E,requiredTag:T=!1,requiredText:j,tagText:K=null,placeholder:te,prefix:Ce,suffix:U,type:P="text",useWrapper:R=!0,omitSearchIcon:Q=!1,value:z,minLength:Z,maxLength:ie,min:pe,max:ae,step:me,size:W,readonly:oe,required:Ae,dataTestid:ce,onChange:J,skipForwardTestid:it=!1,...Ye},Te)=>{const nt=[a,"pkt-textinput"].join(" "),at=P==="search"&&!k&&!Q,ke=P==="date"&&z?z.slice(0,10):z,[Me,Ze]=g.useState((z==null?void 0:z.length)||0),Je=`${s}`,ft=`${Je}-label`,ve=t||ft,$e=Ue=>{var Ne,xe;n&&Ze(((xe=(Ne=Ue.currentTarget)==null?void 0:Ne.value)==null?void 0:xe.length)||0),J&&J(Ue)};return g.useEffect(()=>{z!==void 0&&Ze((z==null?void 0:z.length)||0)},[z]),l.jsx(Js,{ariaDescribedby:e,className:nt,disabled:c,errorMessage:h,forId:Je,hasError:p,helptext:v,helptextDropdown:b,helptextDropdownButton:y,inline:m,label:C,optionalTag:S,optionalText:E,requiredTag:T,requiredText:j,tagText:K,useWrapper:R,counter:n,counterCurrent:Me,counterMaxLength:r,children:l.jsxs("div",{className:"pkt-input__container","data-testid":ce,"data-skip-forward-testid":it?"true":void 0,children:[Ce&&l.jsx("div",{className:"pkt-input-prefix",children:Ce}),l.jsx("input",{...Ye,ref:Te,className:`pkt-input ${w?"pkt-input--fullwidth":""} ${r&&Me>r?"pkt-input--counter-error":""}`,type:P,name:`${M||s}`,value:ke,id:Je,placeholder:te,autoComplete:i,disabled:c,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":ve,min:pe,max:ae,onChange:$e,step:me,minLength:Z,maxLength:ie,size:W,readOnly:oe,required:Ae}),U&&l.jsxs("p",{className:"pkt-input-suffix",children:[U,k&&l.jsx(ee,{className:"pkt-input-suffix-icon",name:k}),at&&l.jsx(ee,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!U&&k&&l.jsx(ee,{className:"pkt-input-icon",name:k}),!U&&at&&l.jsx(ee,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});dn.displayName="PktTextinput";const Qn=g.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:e=1280,children:t,className:i,compact:n=!1,"data-mode":r,logOutButtonPlacement:a="none",logOut:c,openedMenu:h,showSearch:p=!1,onSearch:v,onSearchChange:b,searchValue:y,searchPlaceholder:k="Søk",representing:m,serviceLink:w,serviceClick:C,serviceName:M,user:S,userMenu:E,userMenuFooter:T,userOptions:j,canChangeRepresentation:K=!1,changeRepresentation:te,hideLogo:Ce=!1,logoLink:U,logoClick:P,position:R="fixed",scrollBehavior:Q="hide",slotMenuVariant:z="icon-only",slotMenuText:Z="Meny"},ie)=>{const pe=R==="fixed",ae=Q==="hide";g.useEffect(()=>{T&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[T]),g.useEffect(()=>{j&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[j]),g.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),m!=null&&m.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,m==null?void 0:m.shortname]);const me=g.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[W,oe]=g.useState(h||"none");g.useEffect(()=>{h!==void 0&&oe(h)},[h]);const[Ae,ce]=g.useState(!1),[J,it]=g.useState(0),[Ye,Te]=g.useState(!1),[nt,at]=g.useState(!1),ke=g.useRef(null),Me=g.useRef(null),Ze=g.useRef(null),Je=g.useRef(null),ft=g.useRef(null),ve=g.useRef(null),$e=g.useRef(null),Ue=g.useRef(!1),Ne=pf(ke),xe=Ne<s,De=Ne<e,Os=g.useCallback(u=>{ke.current=u,typeof ie=="function"?ie(u):ie&&(ie.current=u)},[ie]);ff(pe&&xe&&W!=="none");const gt=g.useCallback((u,$)=>{const x=u.relatedTarget;let I;switch($){case"user":I=Me;break;case"slot":I=Ze;break;case"search":I=Je;break;default:return}const H=I.current;H&&(!x||!H.contains(x))&&oe("none")},[]),St=g.useCallback(()=>{Ue.current&&$e.current&&document.contains($e.current)&&$e.current.focus(),$e.current=null,Ue.current=!1},[]);g.useEffect(()=>{const u=x=>{S&&W==="user"&&!x.target.closest(".pkt-header-service__user-container")&&oe("none"),W==="slot"&&!x.target.closest(".pkt-header-service__slot-container")&&oe("none"),W==="search"&&!x.target.closest(".pkt-header-service__search-container")&&!x.target.closest(".pkt-header-service__search-input")&&oe("none")},$=x=>{x.key==="Escape"&&W!=="none"&&(x.preventDefault(),Ue.current=!0,oe("none"))};if(W!=="none")return document.addEventListener("mousedown",u),document.addEventListener("keydown",$),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",$)};St()},[W,S,St]),g.useEffect(()=>{const u=()=>{if(ae){const $=window.pageYOffset||document.documentElement.scrollTop;if($<0||Math.abs($-J)<60)return;ce($>J),it($)}};return document&&window.addEventListener("scroll",u),()=>{document&&window.removeEventListener("scroll",u)}},[ae,J]);const Ct=g.useCallback(u=>{const $=u==="slot"?Ze:Je,x=u==="slot"?ft:ve;if(!$.current||!x.current||!De||xe)return;const I=$.current.getBoundingClientRect(),H=x.current.offsetWidth,G=I.left+H>window.innerWidth;u==="slot"?Te(G):at(G)},[De,xe]),qt=g.useCallback(u=>{W!=="none"?oe("none"):($e.current=document.activeElement,oe(u))},[W]);g.useEffect(()=>{(W==="slot"||W==="search")&&requestAnimationFrame(()=>{Ct(W)})},[W,Ct]);const d=l.jsxs("header",{className:re("pkt-header-service",n&&"pkt-header-service--compact",xe&&"pkt-header-service--mobile",De&&"pkt-header-service--tablet",pe&&"pkt-header-service--fixed",ae&&"pkt-header-service--scroll-to-hide",Ae&&"pkt-header-service--hidden",i),"data-mode":r,ref:Os,children:[l.jsxs("div",{className:re("pkt-header-service__logo-area",(!M||M==="")&&"pkt-header-service__logo-area--without-service"),children:[!Ce&&l.jsx("span",{className:"pkt-header-service__logo",children:U?l.jsx("a",{href:U,"aria-label":"Tilbake til forside",children:l.jsx(ee,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.0/logos/"})}):P?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:P,children:l.jsx(ee,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.0/logos/"})}):l.jsx(ee,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.0/logos/"})}),M&&l.jsx("span",{className:"pkt-header-service__service-name",children:w?l.jsx(hn,{href:w,className:"pkt-header-service__service-link ",children:M}):C?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:C,children:M}):l.jsx("span",{className:"pkt-header-service__service-link",children:M})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:re("pkt-header-service__slot-container",W==="slot"&&"is-open"),onBlur:u=>gt(u,"slot"),ref:Ze,children:[De&&t&&l.jsx(Vt,{skin:"secondary",variant:z,iconName:"menu",size:xe?"small":"medium",state:W==="slot"?"active":"normal",onClick:()=>qt("slot"),"aria-expanded":W==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:Z}),l.jsx("div",{className:re("pkt-header-service__slot-content",Ye&&"align-right"),id:"mobile-slot-menu",role:De?"menu":void 0,"aria-label":De?"Meny":void 0,ref:ft,children:l.jsx("div",{className:"pkt-contents",children:t})})]}),p&&l.jsx(l.Fragment,{children:De?l.jsxs("div",{className:re("pkt-header-service__search-container",W==="search"&&"is-open"),onBlur:u=>gt(u,"search"),ref:Je,children:[l.jsx(Vt,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:xe?"small":"medium",onClick:()=>qt("search"),state:W==="search"?"active":"normal","aria-expanded":W==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:re("pkt-header-service__mobile-menu",W==="search"&&"is-open",nt&&"align-right"),ref:ve,children:W==="search"&&l.jsx(dn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,autoFocus:!0,fullwidth:!0,onChange:u=>b==null?void 0:b(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(v==null||v(u.target.value))}})})]}):l.jsx(dn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,onChange:u=>b==null?void 0:b(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(v==null||v(u.target.value))}})}),De&&c&&(a==="header"||a==="both")&&l.jsx(Vt,{skin:"secondary",size:xe?"small":"medium",variant:"icon-only",iconName:"exit",onClick:c,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:u=>gt(u,"user"),ref:Me,children:[l.jsxs(Vt,{className:re("pkt-header-service__user-button",xe&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:xe?"small":"medium",state:W==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:W==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>qt("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(m==null?void 0:m.name)||S.name]}),W==="user"&&S&&l.jsx("div",{className:re(xe?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(eo,{user:S,formattedLastLoggedIn:me,representing:m,userMenu:E,canChangeRepresentation:K,changeRepresentation:te,logoutOnClick:a==="userMenu"||a==="both"?c:void 0})})]}),!xe&&c&&(a==="header"||a==="both")&&l.jsx(Vt,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:c,children:"Logg ut"})]})]});return pe?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[d,l.jsx("div",{className:re("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",xe&&"pkt-header-service-spacer--mobile",De&&"pkt-header-service-spacer--tablet")})]}):d});Qn.displayName="PktHeaderService";const to=g.forwardRef((s,e)=>l.jsx(Qn,{...s,ref:e}));to.displayName="PktHeader";const vf=Pt({tagName:"pkt-heading",elementClass:ss,react:g,displayName:"PktHeading"}),so=g.forwardRef(({children:s,...e},t)=>l.jsx(vf,{"data-testid":"pkt-heading",...e,ref:t,children:s}));so.displayName="PktHeading";const bf=Pt({tagName:"pkt-helptext",elementClass:Yt,react:g,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),io=g.forwardRef(({children:s,...e},t)=>l.jsx(bf,{...e,ref:t,children:l.jsx("div",{className:"pkt-contents",children:s})}));io.displayName="PktHelptext";const no=g.forwardRef(({label:s,id:e,children:t,...i},n)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:e,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:e,...i,ref:n}),t]}));no.displayName="PktInput";const ro=({children:s,skin:e,title:t,href:i,iconName:n,openInNewTab:r,external:a,className:c,...h})=>{const p=["pkt-linkcard",e&&`pkt-linkcard--${e}`].filter(Boolean).join(" "),v=["pkt-linkcard__title",a&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...h,href:i,className:re(p,c),target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,children:[n&&l.jsx(ee,{className:"pkt-link__icon",name:n}),t&&l.jsx("div",{className:re(v),children:t}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};ro.displayName="PktLinkCard";const yf=Pt({tagName:"pkt-loader",elementClass:Ot,react:g,displayName:"PktLoader",events:{}}),ao=g.forwardRef(({children:s,...e},t)=>l.jsx(yf,{...e,ref:t,children:l.jsx("div",{className:"pkt-contents",children:s})}));ao.displayName="PktLoader";const oo=({children:s,className:e,skin:t,title:i,compact:n,closable:r,onClose:a,...c})=>{const[h,p]=g.useState(!1),v={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${t}`]:t,"pkt-messagebox--closable":r,"pkt-hide":h},b=g.createRef(),y=g.useCallback(()=>{p(!0),a&&a()},[p,a]);return l.jsxs("div",{...c,className:re(v,e),ref:b,children:[r&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(ee,{name:"close",className:"pkt-link__icon"})})}),i&&l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};oo.displayName="PktMessagebox";const kf=Pt({tagName:"pkt-modal",elementClass:yt,react:g,displayName:"PktModal",events:{}}),lo=g.forwardRef(({children:s,...e},t)=>l.jsx(kf,{...e,ref:t,children:l.jsx("div",{className:"pkt-contents",children:s})}));lo.displayName="PktModal";const $f=Pt({tagName:"pkt-progressbar",elementClass:Pe,react:g,displayName:"PktProgressbar",events:{}}),co=g.forwardRef(({children:s,...e},t)=>l.jsx($f,{ref:t,...e,children:l.jsx("div",{className:"pkt-contents",children:s})}));co.displayName="PktProgressbar";const ho=g.forwardRef(({id:s,name:e,label:t,className:i,hasTile:n=!1,disabled:r=!1,checkHelptext:a,hasError:c=!1,defaultChecked:h,checked:p,optionalTag:v,optionalText:b,requiredTag:y,requiredText:k,tagText:m,...w},C)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",r&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),E=["pkt-input-check__input-checkbox",c?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),T=["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(" "),K=()=>l.jsxs(l.Fragment,{children:[m&&l.jsx("span",{className:j+" pkt-tag--gray",children:m}),v&&l.jsx("span",{className:j+" pkt-tag--blue-light",children:b}),y&&l.jsx("span",{className:j+" pkt-tag--beige",children:k})]});return l.jsx("div",{className:M,children:l.jsxs("div",{className:S,children:[l.jsx("input",{ref:C,id:s,type:"radio",name:e,disabled:r,className:E,...p!==void 0?{checked:p}:{defaultChecked:h},...w}),l.jsxs("label",{className:T,htmlFor:s,children:[t," ",K(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});ho.displayName="PktRadioButton";const uo=g.forwardRef(({appearance:s="local",disabled:e=!1,fullwidth:t=!1,id:i,label:n,name:r,placeholder:a="Søk…",suggestions:c,value:h="",action:p,method:v,onChange:b,onSearch:y,onSuggestionClick:k,...m},w)=>{const C=(T,j)=>{T?T():k&&k(j)},M=T=>{h=T.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${t?"pkt-searchinput--fullwidth":""}`;let E;return p?E=T=>l.jsx("form",{role:"search",className:S,action:p,method:v,children:T}):E=T=>l.jsx("div",{role:"search",className:S,children:T}),E(l.jsxs(l.Fragment,{children:[n&&l.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),l.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${t?"pkt-input--fullwidth":""}`,type:"search",name:r||i,id:i,placeholder:a,defaultValue:h,disabled:e,autoComplete:"off","aria-autocomplete":"list",ref:w,"aria-controls":`${i}-suggestions`,onChange:b||M,onKeyUp:y&&(T=>{T.key==="Enter"&&(T.preventDefault(),y(h))}),...m}),l.jsx(Vt,{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:y&&(T=>{T.preventDefault(),y(h)}),children:n||a})]}),c&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:c.map((T,j)=>l.jsx("li",{children:g.createElement(T.href?"a":T.onClick?"button":"div",{href:T.href,className:`pkt-searchinput__suggestion ${T.onClick?"pkt-link-button":""} ${T.href||T.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:T.onClick?"button":void 0,onClick:()=>C(T.onClick,j),onKeyUp:K=>K.key==="Enter"&&C(T.onClick,j)},l.jsxs(l.Fragment,{children:[T.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:T.title}),T.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:T.text})]}))},`search-suggestion-${j}`))})]}))});uo.displayName="PktSearchInput";const po=g.forwardRef(({ariaDescribedby:s,ariaLabelledby:e,children:t,className:i,disabled:n=!1,errorMessage:r,hasError:a,helptext:c,helptextDropdown:h,helptextDropdownButton:p,id:v,inline:b=!1,fullwidth:y=!1,label:k,name:m,optionalTag:w=!1,optionalText:C,requiredTag:M=!1,requiredText:S,tagText:E,...T},j)=>{const K=[i,"pkt-select"].join(" ");return l.jsx(Js,{className:K,forId:`${v}-input`,label:k,helptext:c,helptextDropdown:h,helptextDropdownButton:p,optionalTag:w,optionalText:C,requiredTag:M,requiredText:S,tagText:E,hasError:a,errorMessage:r,disabled:n,inline:b,ariaDescribedby:s,children:l.jsx("select",{ref:j,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":a,"aria-errormessage":`${v}-error`,"aria-labelledby":e||void 0,disabled:n,id:`${v}-input`,name:m||v,...T,children:t})})});po.displayName="PktSelect";const wf=l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:l.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),_f=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),l.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),xf=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),l.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"})]}),Sf=({children:s,className:e,status:t="incomplete",title:i})=>l.jsxs("li",{className:re("pkt-step",e,`pkt-step--${t}`),"data-testid":"pkt-step",children:[l.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),l.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),l.jsx("span",{className:re("pkt-step__indicator"),children:t==="current"?_f:t==="completed"?xf:wf}),l.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),l.jsxs("div",{className:"pkt-step__wrapper",children:[l.jsx("div",{className:"pkt-step__title",children:i}),l.jsx("div",{className:"pkt-step__content",children:s})]})]}),fo=g.forwardRef(({activeStep:s,className:e,children:t,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:r="vertical",...a},c)=>{const h=re(e,"pkt-stepper",r==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=g.Children.map(t,(v,b)=>g.isValidElement(v)?g.cloneElement(v,{className:re(v.props.className,{"pkt-step--hideStep":i&&b!==s,"pkt-step--hideContent":n&&b!==s})}):v);return l.jsx("ol",{"data-testid":"pkt-stepper",className:h,ref:c,...a,children:p})});fo.displayName="PktStepper";const Cf=({className:s,compact:e=!1,skin:t="basic",responsiveView:i=!0,children:n,...r})=>l.jsx("table",{"data-testid":"pkt-table",className:re(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":e,"pkt-table--basic":t==="basic","pkt-table--zebra-blue":t==="zebra-blue"}),role:"table",...r,children:n}),Tf=({id:s,children:e,className:t,...i})=>l.jsx("tbody",{id:s,className:re(t,"pkt-table__body",{}),...i,role:"rowgroup",children:e}),Mf=({children:s,className:e,dataLabel:t,...i})=>l.jsx("td",{className:re(e,"pkt-table__data-cell",{}),"data-label":t,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Nf=({className:s,children:e,...t})=>l.jsx("thead",{className:re(s,"pkt-table__header",{}),role:"rowgroup",...t,children:e}),Df=({className:s,children:e,...t})=>l.jsx("th",{className:re(s,"pkt-table__header-cell",{}),role:"columnheader",...t,children:e}),Of=({className:s,children:e,...t})=>l.jsx("tr",{className:re(s,"pkt-table__row",{}),role:"row",...t,children:e}),Zn=g.forwardRef(({children:s,active:e,href:t,onClick:i,icon:n,controls:r,tag:a,tagSkin:c,index:h=0},p)=>{const{arrowNav:v,registerTabRef:b,handleKeyPress:y,selectTab:k}=Ef(),w={"aria-selected":v?!!e:void 0,"aria-controls":r,role:v?"tab":void 0,onKeyUp:M=>y(h,M),onClick:M=>{k(h),i==null||i(M)},tabIndex:e||!v?void 0:-1,ref:M=>{b(h,M),typeof p=="function"?p(M):p&&(p.current=M)}},C=l.jsxs(l.Fragment,{children:[n&&l.jsx(ee,{name:n,className:"pkt-icon--small"}),s,a&&l.jsx(cn,{skin:c,size:"small",children:a})]});return t?l.jsx("a",{...w,href:t,className:`pkt-tabs__link ${e?"active":""}`,children:C}):l.jsx("button",{...w,type:"button",className:`pkt-tabs__button pkt-link-button ${e?"active":""}`,children:C})});Zn.displayName="PktTabItem";const go=g.createContext(null),Ef=()=>{const s=g.useContext(go);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},mo=g.forwardRef(({arrowNav:s=!0,disableArrowNav:e=!1,tabs:t,onTabSelected:i,children:n},r)=>{const a=g.useRef([]),c=s&&!e,p=n&&g.Children.count(n)>0?g.Children.count(n):(t==null?void 0:t.length)||0;g.useEffect(()=>{a.current=a.current.slice(0,p)},[p]);const v=m=>{const w=t==null?void 0:t[m];w!=null&&w.action&&w.action(m),i&&i(m)},b=(m,w)=>{var C,M;c&&(w.code==="ArrowLeft"&&m!==0&&((C=a.current[m-1])==null||C.focus()),w.code==="ArrowRight"&&m<p-1&&((M=a.current[m+1])==null||M.focus()),(w.code==="ArrowDown"||w.code==="Space")&&v(m))},y=(m,w)=>{a.current[m]=w},k=t==null?void 0:t.map((m,w)=>{var C,M;return l.jsx(Zn,{active:m.active,href:m.href,onClick:()=>v(w),icon:m.icon,controls:m.controls,tag:(C=m.tag)==null?void 0:C.text,tagSkin:(M=m.tag)==null?void 0:M.skin,index:w,children:m.text},w)});return l.jsx(go.Provider,{value:{arrowNav:c,registerTabRef:y,handleKeyPress:b,selectTab:v},children:l.jsx("div",{className:"pkt-tabs",ref:r,children:l.jsx("div",{className:"pkt-tabs__list",role:c?"tablist":"navigation",children:n||k})})})});mo.displayName="PktTabs";const vo=g.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,counter:i,counterMaxLength:n,className:r,disabled:a,errorMessage:c,hasError:h,helptext:p,helptextDropdown:v,helptextDropdownButton:b,inline:y,fullwidth:k=!1,label:m,name:w,optionalTag:C=!1,optionalText:M,requiredTag:S=!1,requiredText:E,tagText:T=null,placeholder:j,rows:K,useWrapper:te=!0,onChange:Ce,value:U,autoComplete:P="off",minLength:R,maxLength:Q,readOnly:z,skipForwardTestid:Z=!1,...ie},pe)=>{const ae=[r,"pkt-textinput","pkt-textarea"].join(" "),me=`${s}-input`,W=`${me}-label`,oe=t||W,[Ae,ce]=g.useState(0),J=it=>{var Ye,Te;i&&ce(((Te=(Ye=it.currentTarget)==null?void 0:Ye.value)==null?void 0:Te.length)||0),Ce&&Ce(it)};return g.useEffect(()=>{U!==void 0&&ce((U==null?void 0:U.length)||0)},[U]),l.jsx(Js,{ariaDescribedby:e,className:ae,disabled:a,errorMessage:c,forId:me,hasError:h,helptext:p,helptextDropdown:v,helptextDropdownButton:b,inline:y,label:m,optionalTag:C,optionalText:M,requiredTag:S,requiredText:E,tagText:T,useWrapper:te,counter:i,counterCurrent:Ae,counterMaxLength:n,children:l.jsx("textarea",{ref:pe,className:`pkt-input ${k?"pkt-input--fullwidth":""} ${n&&Ae>n?"pkt-input--counter-error":""}`,name:`${w||s}`,id:me,placeholder:j,disabled:a,rows:K,"aria-labelledby":oe,"aria-invalid":h,"aria-errormessage":`${s}-error`,...ie,onChange:J,value:U,autoComplete:P,minLength:R,maxLength:Q,readOnly:z,"data-skip-forward-testid":Z?"true":void 0})})});vo.displayName="PktTextarea";var ei=window.CustomEvent;(!ei||typeof ei=="object")&&(ei=function(s,e){e=e||{};var t=document.createEvent("CustomEvent");return t.initCustomEvent(s,!!e.bubbles,!!e.cancelable,e.detail||null),t},ei.prototype=window.Event.prototype);function bo(s,e){var t="on"+e.type.toLowerCase();return typeof s[t]=="function"&&s[t](e),s.dispatchEvent(e)}function Pf(s){for(;s&&s!==document.body;){var e=window.getComputedStyle(s),t=function(i,n){return!(e[i]===void 0||e[i]===n)};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 Ii(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 yo(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Af(s,e){for(var t=0;t<s.length;++t)if(s[t]===e)return!0;return!1}function Jn(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function ko(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 i=s.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),r=0;r<n.length&&!(n[r].tagName&&n[r].shadowRoot&&(i=ko(n[r].shadowRoot),i));r++);return i}function $o(s){return s.isConnected||document.body.contains(s)}function wo(s){if(s.submitter)return s.submitter;var e=s.target;if(!(e instanceof HTMLFormElement))return null;var t=se.formSubmitter;if(!t){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;t=n.activeElement}return!t||t.form!==e?null:t}function If(s){if(!s.defaultPrevented){var e=s.target,t=se.imagemapUseValue,i=wo(s);t===null&&i&&(t=i.value);var n=Ii(e);if(n){var r=i&&i.getAttribute("formmethod")||e.getAttribute("method");r==="dialog"&&(s.preventDefault(),t!=null?n.close(t):n.close())}}}function _o(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",If,!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,i=(function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}).bind(this),n,r=function(a){if(a.target===s){var c="DOMNodeRemoved";t|=a.type.substr(0,c.length)===c,window.clearTimeout(n),n=window.setTimeout(i,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))}_o.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&$o(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_),se.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=ko(this.dialog_)),yo(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(!$o(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!se.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Pf(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,se.needsCentering(this.dialog_)?(se.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 ei("close",{bubbles:!1,cancelable:!1});bo(this.dialog_,e)}};var se={};if(se.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"},se.isInlinePositionSetByStylesheet=function(s){for(var e=0;e<document.styleSheets.length;++e){var t=document.styleSheets[e],i=null;try{i=t.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var r=i[n],a=null;try{a=document.querySelectorAll(r.selectorText)}catch{}if(!(!a||!Af(a,s))){var c=r.style.getPropertyValue("top"),h=r.style.getPropertyValue("bottom");if(c&&c!=="auto"||h&&h!=="auto")return!0}}}return!1},se.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:!se.isInlinePositionSetByStylesheet(s)},se.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 _o(s)},se.registerDialog=function(s){s.showModal||se.forceRegisterDialog(s)},se.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(i){for(var n=0,r;r=i.removedNodes[n];++n){if(r instanceof Element)r.localName==="dialog"&&t.push(r);else continue;t=t.concat(r.querySelectorAll("dialog"))}}),t.length&&s(t)}))},se.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})},se.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},se.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 i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},se.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Ii(s);){for(var e=0,t;t=this.pendingDialogStack[e];++e)if(t.dialog===s)return e===0;s=s.parentElement}return!1},se.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(),yo(e),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],i=t.dialog,n=i.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e!==document.documentElement&&document.documentElement.focus()),!1}},se.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var e=new ei("cancel",{bubbles:!1,cancelable:!0}),t=this.pendingDialogStack[0];t&&bo(t.dialog,e)&&t.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},se.DialogManager.prototype.checkDOM_=function(s){var e=this.pendingDialogStack.slice();e.forEach(function(t){s.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},se.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)},se.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())},se.dm=new se.DialogManager,se.formSubmitter=null,se.imagemapUseValue=null,window.HTMLDialogElement===void 0){var xo=document.createElement("form");if(xo.setAttribute("method","dialog"),xo.method!=="dialog"){var ti=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(ti){var Lf=ti.get;ti.get=function(){return Jn(this)?"dialog":Lf.call(this)};var Bf=ti.set;ti.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Bf.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",ti)}}document.addEventListener("click",function(s){if(se.formSubmitter=null,se.imagemapUseValue=null,!s.defaultPrevented){var e=s.target;if("composedPath"in s){var t=s.composedPath();e=t.shift()||e}if(!(!e||!Jn(e.form))){var i=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!i){if(!(e.localName==="input"&&e.type==="image"))return;se.imagemapUseValue=s.offsetX+","+s.offsetY}var n=Ii(e);n&&(se.formSubmitter=e)}}},!1),document.addEventListener("submit",function(s){var e=s.target,t=Ii(e);if(!t){var i=wo(s),n=i&&i.getAttribute("formmethod")||e.getAttribute("method");n==="dialog"&&s.preventDefault()}});var Ff=HTMLFormElement.prototype.submit,Hf=function(){if(!Jn(this))return Ff.call(this);var s=Ii(this);s&&s.close()};HTMLFormElement.prototype.submit=Hf}const Vf=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));F.PktAccordion=sr,F.PktAccordionItem=ka,F.PktAlert=Un,F.PktBackLink=wa,F.PktBreadcrumbs=_a,F.PktButton=Vt,F.PktCalendar=Xn,F.PktCard=Ra,F.PktCheckbox=Ga,F.PktCombobox=Xa,F.PktConsent=on,F.PktDatepicker=Ja,F.PktFooter=uf,F.PktFooterSimple=df,F.PktHeader=to,F.PktHeaderService=Qn,F.PktHeading=so,F.PktHelptext=io,F.PktIcon=ee,F.PktInput=no,F.PktInputWrapper=Js,F.PktLink=hn,F.PktLinkCard=ro,F.PktLoader=ao,F.PktMessagebox=oo,F.PktModal=lo,F.PktProgressbar=co,F.PktRadioButton=ho,F.PktSearchInput=uo,F.PktSelect=po,F.PktStep=Sf,F.PktStepper=fo,F.PktTabItem=Zn,F.PktTable=Cf,F.PktTableBody=Tf,F.PktTableDataCell=Mf,F.PktTableHeader=Nf,F.PktTableHeaderCell=Df,F.PktTableRow=Of,F.PktTabs=mo,F.PktTag=cn,F.PktTextarea=vo,F.PktTextinput=dn,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})}));
|
|
1693
|
+
*/var Da;function wh(){return Da||(Da=1,(function(s){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(r=n(r,i(l)))}return r}function i(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=n(a,l));return a}function n(r,a){return a?r?r+" "+a:r+a:r}s.exports?(t.default=t,s.exports=t):window.classNames=t})()})(Yn)),Yn.exports}var xh=wh();const ce=$h(xh),an=({children:s,closeAlert:e,compact:t,title:i,date:n,ariaLive:r,"aria-live":a="polite",role:l="status",skin:d="info",className:p,...m})=>{const[v,y]=h.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":t,[`pkt-alert--${d}`]:d,"pkt-hide":v},g={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},$=h.useCallback(()=>{y(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,y]),C=r||a;return o.jsx("div",{...m,"aria-live":C,role:l,className:ce(k,p),children:o.jsxs("div",{className:ce(g),children:[o.jsx(K,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),e&&o.jsx("div",{className:"pkt-alert__close",children:o.jsx(it,{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"})})}),i&&o.jsx("div",{className:"pkt-alert__title",children:i}),o.jsx("div",{className:"pkt-alert__text",children:s}),n&&o.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};an.displayName="PktAlert";const Oa=It({tagName:"pkt-backlink",elementClass:Vs,react:h,displayName:"PktBackLink"});Oa.displayName="PktBackLink";const Ea=h.forwardRef(({breadcrumbs:s,navigationType:e,renderLink:t,className:i,...n},r)=>{const a=s,l=a[a.length-2],d=[i,"pkt-breadcrumbs"].filter(Boolean).join(" "),p=t||(e==="router"?({href:m,className:v,children:y,props:k})=>o.jsx(jo.Link,{to:m,className:v,...k,children:y}):({href:m,className:v,children:y,props:k})=>o.jsx("a",{href:m,className:v,...k,children:y}));return o.jsxs("nav",{ref:r,"aria-label":"brødsmulemeny",className:d,children:[o.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((m,v)=>o.jsx("li",{className:"pkt-breadcrumbs__item",children:v===a.length-1?o.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})}):p({href:m.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",children:o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),o.jsx("span",{className:"pkt-breadcrumbs__text",children:m.text})]}),props:n})},`breadcrumb-${v}`))}),p({href:l.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",children:o.jsxs(o.Fragment,{children:[o.jsx(K,{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:n})]})});Ea.displayName="PktBreadcrumbs",window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/15.1/animations/";const it=h.forwardRef(({children:s,className:e,iconName:t="user",secondIconName:i="user",iconPath:n,secondIconPath:r,size:a="medium",fullWidth:l=!1,fullWidthOnMobile:d=!1,skin:p="primary",type:m="button",variant:v="label-only",state:y,color:k,isLoading:g=void 0,disabled:$=void 0,loadingAnimationPath:C=window.pktAnimationPath,...M},S)=>{const E=[e,"pkt-btn",a&&`pkt-btn--${a}`,l&&"pkt-btn--full",d&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,k&&`pkt-btn--${k}`,y&&`pkt-btn--${y}`,g&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return o.jsxs("button",{...M,"aria-busy":g||void 0,"aria-disabled":$||void 0,disabled:$,className:E,type:m,ref:S,children:[g&&o.jsx(K,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:C}),v!=="label-only"&&o.jsx(K,{className:"pkt-btn__icon",name:t,...n&&{path:n}}),o.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&o.jsx(K,{className:"pkt-btn__icon",name:i,...r&&{path:r}})]})});it.displayName="PktButton";const Pa=6048e5,Sh=864e5,Aa=Symbol.for("constructDateFrom");function jt(s,e){return typeof s=="function"?s(e):s&&typeof s=="object"&&Aa in s?s[Aa](e):s instanceof Date?new s.constructor(e):new Date(e)}function bt(s,e){return jt(e||s,s)}function Ia(s,e,t){const i=bt(s,t==null?void 0:t.in);return isNaN(e)?jt(s,NaN):(e&&i.setDate(i.getDate()+e),i)}let Ch={};function on(){return Ch}function Ni(s,e){var l,d,p,m;const t=on(),i=(e==null?void 0:e.weekStartsOn)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??t.weekStartsOn??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,n=bt(s,e==null?void 0:e.in),r=n.getDay(),a=(r<i?7:0)+r-i;return n.setDate(n.getDate()-a),n.setHours(0,0,0,0),n}function ln(s,e){return Ni(s,{...e,weekStartsOn:1})}function La(s,e){const t=bt(s,e==null?void 0:e.in),i=t.getFullYear(),n=jt(t,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const r=ln(n),a=jt(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=ln(a);return t.getTime()>=r.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function Ba(s){const e=bt(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 Fa(s,...e){const t=jt.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function Kn(s,e){const t=bt(s,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function Th(s,e,t){const[i,n]=Fa(t==null?void 0:t.in,s,e),r=Kn(i),a=Kn(n),l=+r-Ba(r),d=+a-Ba(a);return Math.round((l-d)/Sh)}function Nh(s,e){const t=La(s,e),i=jt(s,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),ln(i)}function Mh(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Dh(s){return!(!Mh(s)&&typeof s!="number"||isNaN(+bt(s)))}function Oh(s,e){const t=bt(s,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function Eh(s,e){const[t,i]=Fa(s,e.start,e.end);return{start:t,end:i}}function Ha(s,e){const{start:t,end:i}=Eh(e==null?void 0:e.in,s);let n=+t>+i;const r=n?+t:+i,a=n?i:t;a.setHours(0,0,0,0);let l=1;const d=[];for(;+a<=r;)d.push(jt(t,a)),a.setDate(a.getDate()+l),a.setHours(0,0,0,0);return n?d.reverse():d}function Ph(s,e){const t=bt(s,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const Ah={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"}},Ih=(s,e,t)=>{let i;const n=Ah[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Gn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const Lh={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Bh={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Fh={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Hh={date:Gn({formats:Lh,defaultWidth:"full"}),time:Gn({formats:Bh,defaultWidth:"full"}),dateTime:Gn({formats:Fh,defaultWidth:"full"})},Vh={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Uh=(s,e,t,i)=>Vh[s];function Mi(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const a=s.defaultFormattingWidth||s.defaultWidth,l=t!=null&&t.width?String(t.width):a;n=s.formattingValues[l]||s.formattingValues[a]}else{const a=s.defaultWidth,l=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[l]||s.values[a]}const r=s.argumentCallback?s.argumentCallback(e):e;return n[r]}}const jh={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qh={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wh={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"]},zh={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"]},Yh={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"}},Kh={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"}},Gh={ordinalNumber:(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Mi({values:jh,defaultWidth:"wide"}),quarter:Mi({values:qh,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Mi({values:Wh,defaultWidth:"wide"}),day:Mi({values:zh,defaultWidth:"wide"}),dayPeriod:Mi({values:Yh,defaultWidth:"wide",formattingValues:Kh,defaultFormattingWidth:"wide"})};function Di(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],r=e.match(n);if(!r)return null;const a=r[0],l=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(l)?Qh(l,v=>v.test(a)):Xh(l,v=>v.test(a));let p;p=s.valueCallback?s.valueCallback(d):d,p=t.valueCallback?t.valueCallback(p):p;const m=e.slice(a.length);return{value:p,rest:m}}}function Xh(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function Qh(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function Zh(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[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(n.length);return{value:a,rest:l}}}const Jh=/^(\d+)(th|st|nd|rd)?/i,Rh=/\d+/i,ep={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},tp={any:[/^b/i,/^(a|c)/i]},sp={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ip={any:[/1/i,/2/i,/3/i,/4/i]},np={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},rp={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]},ap={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},op={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]},lp={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},cp={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}},dp={ordinalNumber:Zh({matchPattern:Jh,parsePattern:Rh,valueCallback:s=>parseInt(s,10)}),era:Di({matchPatterns:ep,defaultMatchWidth:"wide",parsePatterns:tp,defaultParseWidth:"any"}),quarter:Di({matchPatterns:sp,defaultMatchWidth:"wide",parsePatterns:ip,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Di({matchPatterns:np,defaultMatchWidth:"wide",parsePatterns:rp,defaultParseWidth:"any"}),day:Di({matchPatterns:ap,defaultMatchWidth:"wide",parsePatterns:op,defaultParseWidth:"any"}),dayPeriod:Di({matchPatterns:lp,defaultMatchWidth:"any",parsePatterns:cp,defaultParseWidth:"any"})},up={code:"en-US",formatDistance:Ih,formatLong:Hh,formatRelative:Uh,localize:Gh,match:dp,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hp(s,e){const t=bt(s,e==null?void 0:e.in);return Th(t,Ph(t))+1}function pp(s,e){const t=bt(s,e==null?void 0:e.in),i=+ln(t)-+Nh(t);return Math.round(i/Pa)+1}function Va(s,e){var m,v,y,k;const t=bt(s,e==null?void 0:e.in),i=t.getFullYear(),n=on(),r=(e==null?void 0:e.firstWeekContainsDate)??((v=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??n.firstWeekContainsDate??((k=(y=n.locale)==null?void 0:y.options)==null?void 0:k.firstWeekContainsDate)??1,a=jt((e==null?void 0:e.in)||s,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const l=Ni(a,e),d=jt((e==null?void 0:e.in)||s,0);d.setFullYear(i,0,r),d.setHours(0,0,0,0);const p=Ni(d,e);return+t>=+l?i+1:+t>=+p?i:i-1}function fp(s,e){var l,d,p,m;const t=on(),i=(e==null?void 0:e.firstWeekContainsDate)??((d=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??t.firstWeekContainsDate??((m=(p=t.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,n=Va(s,e),r=jt((e==null?void 0:e.in)||s,0);return r.setFullYear(n,0,i),r.setHours(0,0,0,0),Ni(r,e)}function Ua(s,e){const t=bt(s,e==null?void 0:e.in),i=+Ni(t,e)-+fp(t,e);return Math.round(i/Pa)+1}function ge(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const os={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return ge(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):ge(t+1,2)},d(s,e){return ge(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 ge(s.getHours()%12||12,e.length)},H(s,e){return ge(s.getHours(),e.length)},m(s,e){return ge(s.getMinutes(),e.length)},s(s,e){return ge(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return ge(n,e.length)}},Js={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ja={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return os.y(s,e)},Y:function(s,e,t,i){const n=Va(s,i),r=n>0?n:1-n;if(e==="YY"){const a=r%100;return ge(a,2)}return e==="Yo"?t.ordinalNumber(r,{unit:"year"}):ge(r,e.length)},R:function(s,e){const t=La(s);return ge(t,e.length)},u:function(s,e){const t=s.getFullYear();return ge(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return ge(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return ge(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return os.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return ge(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=Ua(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):ge(n,e.length)},I:function(s,e,t){const i=pp(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):ge(i,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 i=hp(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):ge(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":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"})}},e:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return ge(r,2);case"eo":return t.ordinalNumber(r,{unit:"day"});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"})}},c:function(s,e,t,i){const n=s.getDay(),r=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return ge(r,e.length);case"co":return t.ordinalNumber(r,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return ge(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{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 i=s.getHours();let n;switch(i===12?n=Js.noon:i===0?n=Js.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=Js.evening:i>=12?n=Js.afternoon:i>=4?n=Js.morning:n=Js.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{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 i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):ge(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):ge(i,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 i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Wa(i);case"XXXX":case"XX":return Ds(i);case"XXXXX":case"XXX":default:return Ds(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return Wa(i);case"xxxx":case"xx":return Ds(i);case"xxxxx":case"xxx":default:return Ds(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+qa(i,":");case"OOOO":default:return"GMT"+Ds(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+qa(i,":");case"zzzz":default:return"GMT"+Ds(i,":")}},t:function(s,e,t){const i=Math.trunc(+s/1e3);return ge(i,e.length)},T:function(s,e,t){return ge(+s,e.length)}};function qa(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),r=i%60;return r===0?t+String(n):t+String(n)+e+ge(r,2)}function Wa(s,e){return s%60===0?(s>0?"-":"+")+ge(Math.abs(s)/60,2):Ds(s,e)}function Ds(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=ge(Math.trunc(i/60),2),r=ge(i%60,2);return t+n+e+r}const za=(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"})}},Ya=(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"})}},mp={p:Ya,P:(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return za(s,e);let r;switch(i){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}}",za(i,e)).replace("{{time}}",Ya(n,e))}},gp=/^D+$/,vp=/^Y+$/,bp=["D","DD","YY","YYYY"];function yp(s){return gp.test(s)}function kp(s){return vp.test(s)}function _p(s,e,t){const i=$p(s,e,t);if(console.warn(i),bp.includes(s))throw new RangeError(i)}function $p(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const wp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sp=/^'([^]*?)'?$/,Cp=/''/g,Tp=/[a-zA-Z]/;function Np(s,e,t){var m,v,y,k;const i=on(),n=i.locale??up,r=i.firstWeekContainsDate??((v=(m=i.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??1,a=i.weekStartsOn??((k=(y=i.locale)==null?void 0:y.options)==null?void 0:k.weekStartsOn)??0,l=bt(s,t==null?void 0:t.in);if(!Dh(l))throw new RangeError("Invalid time value");let d=e.match(xp).map(g=>{const $=g[0];if($==="p"||$==="P"){const C=mp[$];return C(g,n.formatLong)}return g}).join("").match(wp).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const $=g[0];if($==="'")return{isToken:!1,value:Mp(g)};if(ja[$])return{isToken:!0,value:g};if($.match(Tp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+$+"`");return{isToken:!1,value:g}});n.localize.preprocessor&&(d=n.localize.preprocessor(l,d));const p={firstWeekContainsDate:r,weekStartsOn:a,locale:n};return d.map(g=>{if(!g.isToken)return g.value;const $=g.value;(kp($)||yp($))&&_p($,e,String(s));const C=ja[$[0]];return C(l,$,n.localize,p)}).join("")}function Mp(s){const e=s.match(Sp);return e?e[1].replace(Cp,"'"):s}function Dp(s,e){const t=bt(s,e==null?void 0:e.in).getDay();return t===0?7:t}function Op(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 Xn={},Oi={};function Os(s,e){try{const i=(Xn[s]||(Xn[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(e).split("GMT")[1];return i in Oi?Oi[i]:Ka(i,i.split(":"))}catch{if(s in Oi)return Oi[s];const t=s==null?void 0:s.match(Ep);return t?Ka(s,t.slice(1)):NaN}}const Ep=/([+-]\d\d):?(\d\d)?/;function Ka(s,e){const t=+(e[0]||0),i=+(e[1]||0),n=+(e[2]||0)/60;return Oi[s]=t*60+i>0?t*60+i+n:t*60-i-n}class qt extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Os(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)),Xa(this),Qn(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new qt(...t,e):new qt(Date.now(),e)}withTimeZone(e){return new qt(+this,e)}getTimezoneOffset(){const e=-Os(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Qn(this),+this}[Symbol.for("constructDateFrom")](e){return new qt(+new Date(e),this.timeZone)}}const Ga=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Ga.test(s))return;const e=s.replace(Ga,"$1UTC");qt.prototype[e]&&(s.startsWith("get")?qt.prototype[s]=function(){return this.internal[e]()}:(qt.prototype[s]=function(){return Date.prototype[e].apply(this.internal,arguments),Pp(this),+this},qt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Qn(this),+this}))});function Qn(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Os(s.timeZone,s)*60))}function Pp(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()),Xa(s)}function Xa(s){const e=Os(s.timeZone,s),t=e>0?Math.floor(e):Math.ceil(e),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),r=-new Date(+i).getTimezoneOffset(),a=n-r,l=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();a&&l&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+a);const d=n-t;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(Os(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const y=Os(s.timeZone,s),k=y>0?Math.floor(y):Math.ceil(y),$=-new Date(+s).getTimezoneOffset()-k,C=k!==t,M=$-d;if(C&&M){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+M);const S=Os(s.timeZone,s),E=S>0?Math.floor(S):Math.ceil(S),T=k-E;T&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T))}}class ls extends qt{static tz(e,...t){return t.length?new ls(...t,e):new ls(Date.now(),e)}toISOString(){const[e,t,i]=this.tzComponents(),n=`${e}${t}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,i,n]=this.internal.toUTCString().split(" ");return`${e==null?void 0:e.slice(0,-1)} ${i} ${t} ${n}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,i,n]=this.tzComponents();return`${e} GMT${t}${i}${n} (${Op(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?"-":"+",i=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[t,i,n]}withTimeZone(e){return new ls(+this,e)}[Symbol.for("constructDateFrom")](e){return new ls(+new Date(e),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Ap=(s=window.pktTz)=>{const e=new ls(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 Wt(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[e,t,i]=s.split("-").map(Number);return new Date(e,t-1,i)}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 nt=s=>{if(!s||isNaN(s.getTime()))return"";const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${i}`},Ei=s=>{if(!s)return null;const e=Wt(s);return isNaN(e.getTime())?null:e},Ip=(s,e)=>{const t=Zt(s);return isNaN(t.getTime())?"":Np(t,e)},Zt=(s="",e)=>{const t=typeof s=="string"?Wt(s):s;return!t||isNaN(t.getTime())?new Date:e?e==="end"?Oh(t):Kn(t):t},Rs=(s,e,t=1)=>{if(typeof s!="number"||typeof e!="number"||typeof t!="number"||isNaN(s)||isNaN(e)||isNaN(t))return new Date;const i=new Date(s,e,t);return isNaN(i.getTime())?new Date:i},Pi=s=>{let e;return typeof s=="number"?e=new ls(s,window.pktTz):e=new ls(s,window.pktTz),e.setHours(12,0,0,0),e};let Zn=null,Qa;const Lp=s=>{if(!s||isNaN(s.getTime()))return"";const e=typeof window<"u"?window.pktTz:void 0;return(!Zn||Qa!==e)&&(Zn=new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:e}),Qa=e),Zn.format(s)},Bp=(s,e,t)=>{if(!s||isNaN(s.getTime()))return!1;const i=e?Zt(e):null,n=t?Zt(t):null;return!(i&&s<i||n&&s>n)},Fp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=nt(s);return e.includes(t)},Hp=(s,e)=>{if(!s||isNaN(s.getTime())||!Array.isArray(e))return!1;const t=s.getDay().toString();return e.includes(t)},Za=(s,e,t,i,n)=>!(!s||isNaN(s.getTime())||!Bp(s,e,t)||i&&Fp(s,i)||n&&Hp(s,n)),Vp=(s,e,t,i,n)=>s.filter(r=>{const a=Ei(r);return a&&Za(a,e,t,i,n)}),Up=s=>s.slice().sort((e,t)=>{const i=Ei(e),n=Ei(t);return!i||!n?0:i.getTime()-n.getTime()}),jp=(s,e)=>{const t=Ei(s),i=Ei(e);return!t||!i?!1:t<=i};function Ja(s,e){const t=(e.excludedates??[]).map(i=>typeof i=="string"?i:nt(i));return!Za(s,e.earliest,e.latest,t,e.excludeweekdays??[])}function qp(s,e,t,i){return!!(Ja(s,t)||!e&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function Wp(s,e,t){const i=Rs(s,e,0);return!(t&&Zt(t)>i)}function zp(s,e,t){const i=Rs(e===11?s+1:s,e===11?0:e+1,1);return!(t&&Zt(t)<i)}function Ra(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(e=>Wt(e))}function eo(s,e){const t=Ha({start:s,end:e}),i={};if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const r=t[n],a=r>s&&r<e;i[nt(r)]=a}return i}function to(s,e,t,i){if(e.length!==1)return!0;const n=Ha({start:e[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let r=0;r<n.length;r++){for(const a of t??[])if(a>e[0]&&a<s)return!1;if((i??[]).includes(Dp(n[r]).toString()))return!1}return!0}function Jn(s,e){const t=nt(s);return e.includes(t)?e:[...e,t]}function Rn(s,e){const t=nt(s),i=e.indexOf(t);if(i===-1)return e;if(e.length===1)return[];const n=[...e];return n.splice(i,1),n}function so(s,e,t){const i=nt(s);return e.includes(i)?Rn(s,e):t>0&&e.length>=t?e:Jn(s,e)}function Yp(s,e,t){const i=nt(s),n=Ra(e);if(e.includes(i))return e.indexOf(i)===0?[]:Rn(s,e);if(e.length>1)return[i];if(e.length===1){if(!to(s,n,t.excludedates,t.excludeweekdays))return[i];if(n[0]>s)return[i]}return Jn(s,e)}const Ai=7,Kp=6;function Gp(s,e){const t=Rs(s,e,1),i=Rs(s,e+1,0),n=(t.getDay()+Kp)%Ai,r=i.getDate(),a=Math.ceil((r+n)/Ai),d=Rs(s,e,0).getDate(),p=Ua(t);return{firstDayOfMonth:t,lastDayOfMonth:i,startingDay:n,numDays:r,numRows:a,numDaysPrevMonth:d,initialWeek:p}}function Xp(s,e,t,i){const{startingDay:n,numDays:r}=i;return s===0&&e<n?"prev-month":t>r?"next-month":"current-month"}function Qp(s,e,t,i){const{startingDay:n,numDaysPrevMonth:r,numDays:a}=i;return s==="prev-month"?r-(n-e-1):s==="next-month"?t-a:t}const Zp={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Ai,ArrowDown:Ai};function Jp(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Rp(s,e,t){let i=Ia(s,e);if(!i)return null;let n=t(`button[data-date="${nt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Ia(i,e),n=t(`button[data-date="${nt(i)}"]`),!n)return null;return i}function ef(s){return Zp[s]??null}const tf={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 sf(s){const{selected:e,multiple:t=!1,maxMultiple:i=0,range:n=!1,earliest:r=null,latest:a=null,excludedates:l,excludeweekdays:d=[],weeknumbers:p=!1,withcontrols:m=!1,currentmonth:v,today:y,strings:k,onDateSelected:g,onClose:$,id:C,className:M}=s,S=h.useId(),E=C??S,T=h.useMemo(()=>({...tf,...k}),[k]),V=h.useMemo(()=>y?Wt(y):Ap(),[y]),G=h.useMemo(()=>l?l.map(f=>typeof f=="string"?Wt(f):f):[],[l]),ie=e!==void 0,[we,D]=h.useState([]),N=ie?e:we,j=h.useMemo(()=>Ra(N),[N]),[J,X]=h.useState(0),[ne,ae]=h.useState(0),[pe,oe]=h.useState({}),[ve,z]=h.useState(null),[Y,Ee]=h.useState(null),le=h.useRef(null),re=h.useRef([]),Ge=h.useRef(0),Ve=h.useRef(!1),Ne=h.useRef(!1),Xe=h.useMemo(()=>({earliest:r,latest:a,excludedates:G,excludeweekdays:d}),[r,a,G,d]);h.useEffect(()=>{let f=null;if(v!=null&&(v instanceof Date?f=Pi(v):typeof v=="string"&&(f=Wt(v))),!f||isNaN(f.getTime()))if(N.length>0&&N[0]!==""){const u=Wt(N[N.length-1]);f=isNaN(u.getTime())?Pi(V):u}else f=Pi(V);if((!f||isNaN(f.getTime()))&&(f=Pi(V)),a){const u=typeof a=="string"?Wt(a):a;!isNaN(u.getTime())&&f>u&&(f=u)}if(r){const u=typeof r=="string"?Wt(r):r;!isNaN(u.getTime())&&f<u&&(f=u)}X(f.getFullYear()),ae(f.getMonth()),Ne.current=!0},[]),h.useEffect(()=>{if(Ne.current&&!Ve.current&&N.length>0&&N[0]!==""){const f=Wt(N[N.length-1]);isNaN(f.getTime())||(X(f.getFullYear()),ae(f.getMonth()))}},[N]),h.useEffect(()=>{n&&j.length===2?oe(eo(j[0],j[1])):(!n||j.length<2)&&oe({})},[n,j]);const rt=h.useCallback(f=>{ie||D(f),g==null||g(f)},[ie,g]),xe=h.useCallback(()=>{$==null||$()},[$]),Se=h.useCallback((f,u)=>{X(typeof f=="string"?parseInt(f):f),ae(typeof u=="string"?parseInt(u):u),Ge.current=0,Ee(null),re.current=[],Ve.current=!0},[]),Pe=h.useCallback(()=>{const f=ne===0?11:ne-1,u=ne===0?J-1:J;Se(u,f)},[J,ne,Se]),Ue=h.useCallback(()=>{const f=ne===11?0:ne+1,u=ne===11?J+1:J;Se(u,f)},[J,ne,Se]),at=h.useCallback(f=>Ja(f,Xe),[Xe]),be=h.useCallback((f,u)=>qp(f,u,Xe,{multiple:t,maxMultiple:i,selectedCount:N.length}),[Xe,t,i,N.length]),ke=h.useCallback(()=>typeof N=="string"?N.split(","):N,[N]),W=h.useCallback(f=>{if(!n||j.length!==1||!to(f,j,G,d)||j[0]>=f){z(null);return}z(f),oe(eo(j[0],f))},[n,j,G,d]),de=h.useCallback(f=>{if(!f)return;let u;if(n)u=Yp(f,ke(),{excludedates:G,excludeweekdays:d}),ie||D(u),u.length===2?(g==null||g(u),xe()):(u.length===1&&oe({}),g==null||g(u));else if(t)u=so(f,ke(),i),rt(u);else{const _=nt(f);N.includes(_)?u=[]:u=[_],rt(u),xe()}},[n,t,i,ke,N,G,d,ie,rt,xe,g]),Z=h.useCallback(f=>{const u=Jn(f,ke());ie||D(u),n&&u.length===2&&(g==null||g(u),xe())},[ke,ie,n,g,xe]),te=h.useCallback(f=>{const u=Rn(f,ke());ie||D(u)},[ke,ie]),ut=h.useCallback(f=>{const u=so(f,ke(),i);ie||D(u)},[ke,i,ie]),Be=h.useCallback(()=>{var x,B;const f=nt(Pi(V)),u=(x=le.current)==null?void 0:x.querySelector(`button[data-date="${f}"]`);if(u instanceof HTMLButtonElement){Ee(f),u.focus();return}const _=re.current.find(U=>!U.isDisabled);if(_){const U=(B=le.current)==null?void 0:B.querySelector(`button[data-date="${_.currentDateISO}"]`);U instanceof HTMLButtonElement&&(Ee(_.currentDateISO),U.focus())}},[]),je=h.useCallback((f,u)=>{const _=f.target;if(Jp(_))return;if(f.preventDefault(),!Y){Be();return}const x=Zt(Y),B=Rp(x,u,le.current.querySelector.bind(le.current));if(B){const U=le.current.querySelector(`button[data-date="${nt(B)}"]`);U instanceof HTMLButtonElement&&!U.dataset.disabled&&(Ee(nt(B)),U.focus())}},[Y,Be]),yt=h.useCallback(f=>{if(f.key==="Escape"){f.preventDefault(),xe();return}const u=ef(f.key);u!==null&&je(f.nativeEvent,u)},[xe,je]),zt=h.useCallback(f=>{le.current&&!le.current.contains(f.relatedTarget)&&!f.target.classList.contains("pkt-hide")&&xe()},[xe]);return{componentId:E,strings:T,todayDate:V,year:J,month:ne,activeSelected:N,_selected:j,inRange:pe,rangeHovered:ve,focusedDate:Y,range:n,multiple:t,weeknumbers:p,withcontrols:m,earliest:r,latest:a,excludedates:G,excludeweekdays:d,className:M,dateConstraints:Xe,calendarRef:le,selectableDatesRef:re,tabIndexSetRef:Ge,prevMonth:Pe,nextMonth:Ue,changeMonth:Se,handleDateSelect:de,addToSelected:Z,removeFromSelected:te,toggleSelectedDate:ut,handleRangeHover:W,isExcluded:at,isDayDisabled:be,focusOnCurrentDate:Be,handleKeydown:yt,handleFocusOut:zt,close:xe,setFocusedDate:Ee}}const nf=({componentId:s,strings:e,year:t,month:i,earliest:n,latest:r,withcontrols:a,prevMonth:l,nextMonth:d,changeMonth:p})=>{const m=y=>{const k=y==="prev",g=k?Wp(t,i,n):zp(t,i,r),$=k?e.prevMonth:e.nextMonth,C=k?"chevron-thin-left":"chevron-thin-right",M=k?"pkt-calendar__prev-month":"pkt-calendar__next-month",S=k?l:d;return o.jsx("div",{children:o.jsxs("button",{type:"button","aria-label":$,onClick:()=>g&&S(),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g&&S())},className:["pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only",M,!g&&"pkt-invisible"].filter(Boolean).join(" "),"data-disabled":g?void 0:"disabled","aria-disabled":!g||void 0,tabIndex:g?0:-1,children:[o.jsx(K,{className:"pkt-btn__icon",name:C}),o.jsx("span",{className:"pkt-btn__text",children:$})]})})},v=()=>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:i,onChange:y=>{y.stopPropagation(),p(t,parseInt(y.target.value))},children:e.months.map((y,k)=>o.jsx("option",{value:k,children:y},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:y=>{y.stopPropagation(),p(parseInt(y.target.value),i)}})]}):o.jsxs("div",{className:"pkt-txt-16-medium pkt-calendar__month-title","aria-live":"polite",children:[e.months[i]," ",t]});return o.jsxs("nav",{className:"pkt-cal-month-nav",children:[m("prev"),v(),m("next")]})};function rf(s,e,t){const i=Rs(t.year,t.month,s),n=nt(i),r=n===nt(e),a=t.activeSelected.includes(n),l=t.isDayDisabled(i,a);let d;return t.focusedDate?d=t.focusedDate===n&&!l?"0":"-1":!l&&t.tabIndexSetRef.current===0?(t.tabIndexSetRef.current=s,d="0"):d=t.tabIndexSetRef.current===s?"0":"-1",{currentDate:i,currentDateISO:n,isToday:r,isSelected:a,isDisabled:l,ariaLabel:Lp(i),tabindex:d}}function af(s,e){const{currentDateISO:t,isToday:i,isSelected:n}=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 ce({"pkt-cal-today":i,"pkt-cal-selected":n,"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===nt(e.rangeHovered)})}function of(s,e){const{currentDateISO:t,isToday:i,isSelected:n,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 ce({"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":r,"pkt-calendar__date--in-range":e.inRange[t],"pkt-calendar__date--in-range-hover":e.rangeHovered!==null&&t===nt(e.rangeHovered),"pkt-calendar__date--range-start":a,"pkt-calendar__date--range-end":l})}const lf=({state:s})=>{const{strings:e,year:t,month:i,activeSelected:n,focusedDate:r,inRange:a,rangeHovered:l,range:d,multiple:p,weeknumbers:m,selectableDatesRef:v,tabIndexSetRef:y,handleDateSelect:k,handleRangeHover:g,isExcluded:$,isDayDisabled:C,setFocusedDate:M,todayDate:S}=s,E={year:t,month:i,activeSelected:n,focusedDate:r,tabIndexSetRef:y,isDayDisabled:C},T={range:d,activeSelected:n,rangeHovered:l,inRange:a,isExcluded:$},V=()=>{const D=[];m&&D.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__week-number",children:e.week})},"week-header"));for(let N=0;N<e.daysShort.length;N++)D.push(o.jsx("th",{children:o.jsx("div",{className:"pkt-calendar__day-name","aria-label":e.days[N],children:e.daysShort[N]})},`day-${N}`));return o.jsx("tr",{className:"pkt-cal-week-row",children:D})},G=(D,N)=>{const j=rf(D,N,E),{currentDate:J,currentDateISO:X,isSelected:ne,isDisabled:ae,ariaLabel:pe,tabindex:oe}=j;v.current.push({currentDateISO:X,isDisabled:ae,tabindex:oe});const ve=af(j,T),z=of(j,T);return o.jsx("td",{className:ve,children:o.jsx("button",{type:"button","aria-pressed":ne?"true":"false",disabled:ae,className:`pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${z}`,onMouseOver:()=>d&&!$(J)&&g(J),onFocus:()=>{d&&!$(J)&&g(J),M(X)},"aria-label":pe,tabIndex:parseInt(oe),"data-disabled":ae?"disabled":void 0,"data-date":X,onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),k(J))},onClick:Y=>{ae||(Y.preventDefault(),k(J))},children:o.jsx("span",{className:"pkt-btn__text pkt-txt-14-light",children:D})})},X)},ie=(D,N)=>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:D})})},N),we=()=>{const D=S,N=Gp(t,i);v.current=[],y.current=0;let j=1,J=N.initialWeek;const X=[];for(let ne=0;ne<N.numRows;ne++){const ae=[];m&&ae.push(o.jsx("td",{className:"pkt-cal-week",children:J},`week-${J}`)),J++;for(let pe=0;pe<Ai;pe++){const oe=Xp(ne,pe,j,N);if(oe==="current-month")ae.push(G(j,D)),j++;else{const ve=Qp(oe,pe,j,N);ae.push(ie(ve,`${oe}-${ne}-${pe}`)),oe==="next-month"&&j++}}X.push(o.jsx("tr",{className:"pkt-cal-week-row",role:"row",children:ae},`row-${ne}`))}return X};return o.jsxs("table",{className:"pkt-cal-days pkt-txt-12-medium pkt-calendar__body",role:"grid","aria-multiselectable":d||p||void 0,children:[o.jsx("thead",{children:V()}),o.jsx("tbody",{children:we()})]})},er=h.forwardRef((s,e)=>{const t=sf(s);return h.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(nf,{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(lf,{state:t})]})});er.displayName="PktCalendar";const cf=It({tagName:"pkt-card",elementClass:ze,react:h,displayName:"PktCard",events:{}}),io=h.forwardRef(({children:s,...e},t)=>o.jsx(cf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));io.displayName="PktCard";const no=h.forwardRef(({id:s,hasTile:e=!1,disabled:t=!1,label:i,checkHelptext:n,hasError:r=!1,className:a,isSwitch:l=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:m,checked:v,indeterminate:y,optionalTag:k,optionalText:g="Valgfritt",requiredTag:$,requiredText:C="Må fylles ut",tagText:M,...S},E)=>{const T=h.useRef(null);h.useEffect(()=>{T.current&&y!==void 0&&(T.current.indeterminate=y)},[y]),h.useEffect(()=>{typeof E=="function"?E(T.current):E&&(E.current=T.current)},[E]);const V=[a,"pkt-input-check"].filter(Boolean).join(" "),G=["pkt-input-check__input-label",t?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),ie=["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(" "),D=()=>o.jsxs(o.Fragment,{children:[M&&o.jsx("span",{className:we+" pkt-tag--gray",children:M}),k&&o.jsx("span",{className:we+" pkt-tag--blue-light",children:g}),$&&o.jsx("span",{className:we+" pkt-tag--beige",children:C})]});return o.jsx("div",{className:V,children:o.jsxs("div",{className:ie,children:[p==="left"&&o.jsxs("label",{className:G,htmlFor:s,children:[i," ",D(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),o.jsx("input",{role:l?"switch":"checkbox",ref:T,className:`pkt-input-check__input-checkbox ${r?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:t,...v!==void 0?{checked:v}:{defaultChecked:m},...S}),p==="right"&&o.jsxs("label",{className:G,htmlFor:s,children:[i," ",D(),n&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});no.displayName="PktCheckbox";const df=It({tagName:"pkt-combobox",elementClass:Oe,react:h,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),ro=h.forwardRef(({children:s,helptext:e,...t},i)=>o.jsxs(df,{...t,ref:i,children:[e&&o.jsx("div",{slot:"helptext",className:"pkt-contents",children:e}),s]}));ro.displayName="PktCombobox";const cn=It({tagName:"pkt-consent",elementClass:Tt,react:h,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});cn.displayName="PktConsent";const Es=h.forwardRef(({forId:s,label:e,helptext:t,helptextDropdown:i,helptextDropdownButton:n,counter:r,counterCurrent:a=0,counterMaxLength:l,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:y=null,hasError:k=!1,errorMessage:g,disabled:$=!1,inline:C=!1,ariaDescribedby:M,useWrapper:S=!0,children:E,className:T="",hasFieldset:V=!1,role:G="group",counterPosition:ie="bottom"},we)=>{const[D,N]=h.useState(!1),j=M||(t?`${s}-helptext`:void 0),J=!!r,X=J&&ie==="top",ne=J&&ie==="bottom",ae=()=>N(re=>!re),pe=["pkt-inputwrapper",T,k?"pkt-inputwrapper--error":"",$?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),oe=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),ve=()=>J?o.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[a,l?`/${l}`:""]}):null,z=()=>o.jsxs(o.Fragment,{children:[y&&o.jsx("span",{className:oe+" pkt-tag--gray",children:y}),d&&o.jsx("span",{className:oe+" pkt-tag--blue-light",children:p}),m&&o.jsx("span",{className:oe+" pkt-tag--beige",children:v})]}),Y=()=>{const re=o.jsxs(o.Fragment,{children:[e," ",z()]});return S?V?o.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:re}):o.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":j,id:`${s}-label`,children:re}):o.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":j,id:`${s}-label`,children:e})},Ee=()=>!t&&!i?null:o.jsxs(o.Fragment,{children:[t&&S&&o.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:t}),i&&o.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[o.jsx(it,{skin:"tertiary",size:"small",variant:"icon-right",iconName:D?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:ae,children:o.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),o.jsx("div",{className:`pkt-inputwrapper__helptext ${D?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),le=o.jsxs(o.Fragment,{children:[Y(),Ee(),X&&o.jsx(ve,{}),E,ne&&o.jsx(ve,{}),k&&g&&o.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:o.jsx(an,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:g})})]});return o.jsx("div",{className:pe,ref:we,role:G,children:V?o.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":j,children:le}):o.jsx("div",{className:"pkt-inputwrapper__fieldset",children:le})})});Es.displayName="PktInputWrapper";const ao=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},uf=()=>ao()?"text":"date",hf=s=>!s||s.length!==2?!0:jp(s[0],s[1]),pf=(s,e,t,i,n,r)=>({"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&r==="text"}),ff=()=>({"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}),mf=s=>({"pkt-input-prefix":s,"pkt-hide":!s}),gf=(s,e,t)=>!e&&!t?Array.isArray(s)?s[0]||"":s:Array.isArray(s)?s.join(","):s,vf=(s,e,t=!1)=>{var l;if(!s||!e)return;const i=((l=e.parentElement)==null?void 0:l.getBoundingClientRect())||e.getBoundingClientRect(),n=t?i.height+30:i.height,r=s.getBoundingClientRect().height;let a=t?"calc(100% - 30px)":"100%";i&&i.top+r>window.innerHeight&&i.top-r>0&&(a=`calc(100% - ${n}px - ${r}px)`),s.style.top=a},dn=(s,e,t,i,n,r)=>{const{key:a}=s;a===","&&(s.preventDefault(),r?r(s):n&&n()),(a==="Space"||a===" ")&&(s.preventDefault(),e(s)),a==="Enter"&&(s.preventDefault(),t?t():i?i():n&&n())},bf=({open:s,multiple:e=!1,range:t=!1,weeknumbers:i=!1,withcontrols:n=!1,selected:r=[],earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:v,today:y,inputRef:k,hasCounter:g=!1,onDateSelected:$,onClose:C})=>{const M=h.useRef(null),S=h.useRef(!1);s&&(S.current=!0),h.useEffect(()=>{s&&vf(M.current,(k==null?void 0:k.current)??null,g)},[s,k,g]);const E=["pkt-calendar-popup",s?"show":"hide"].join(" "),T=s||S.current;return o.jsx("div",{ref:M,className:E,hidden:!s,"aria-hidden":!s,children:T&&o.jsx(er,{multiple:e,range:t,weeknumbers:i,withcontrols:n,selected:r,earliest:a,latest:l,excludedates:d,excludeweekdays:p,maxMultiple:m,currentmonth:v,today:y,onDateSelected:$,onClose:C})})},un=h.forwardRef(({children:s,skin:e,textStyle:t,size:i,closeTag:n,className:r,iconName:a,ariaLabel:l,onClose:d,type:p,"aria-description":m,...v},y)=>{const[k,g]=h.useState(!1),$=h.useCallback(()=>{g(!0),d&&d()},[d]),C=h.useRef(null),[M,S]=h.useState("");h.useEffect(()=>{var G,ie;S(((ie=(G=C.current)==null?void 0:G.textContent)==null?void 0:ie.trim())??"")},[s]);const E=h.useMemo(()=>{if(n&&!l)return M&&`Klikk for å fjerne ${M}`||m},[n,l,M,m]),T={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${t}`]:!!t},V={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${e}`]:!!e,"pkt-btn--icons-right-and-left":n&&!!a,"pkt-hide":k};return n?o.jsxs("button",{...v,className:ce(V,r),type:p,onClick:$,"aria-label":l,"aria-description":E,ref:y,children:[a&&o.jsx(K,{className:"pkt-tag__icon",name:a}),o.jsx("span",{ref:C,children:s}),o.jsx(K,{className:"pkt-tag__close-btn",name:"close"})]}):o.jsxs("span",{...v,className:ce(T,r),ref:y,children:[a&&o.jsx(K,{className:"pkt-tag__icon",name:a,"aria-hidden":"true"}),o.jsx("span",{ref:C,children:s})]})});un.displayName="PktTag";const yf=({dates:s,dateformat:e,idBase:t,strings:i,onDateRemoved:n})=>{var l;const r=Up(s),a=((l=i==null?void 0:i.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(d=>{const p=Ip(d,e);return o.jsx(un,{id:`${t}${d}-tag`,closeTag:!0,ariaLabel:`${a} ${p}`,onClose:()=>n(d),children:o.jsx("time",{dateTime:d,children:p})},d)})})},kf=({state:s})=>{var Xe,rt,xe,Se;const{id:e,inputId:t,values:i,dateformat:n,multiple:r,range:a,showRangeLabels:l,disabled:d,readOnly:p,required:m,label:v,name:y,placeholder:k,hasError:g,helptext:$,minStr:C,maxStr:M,inputType:S,isIOSDevice:E,strings:T,inputClasses:V,buttonClasses:G,rangeLabelClasses:ie,datepickerInputsClasses:we,isInputDisabled:D,inputRef:N,inputRefTo:j,btnRef:J,toggleCalendar:X,handleFocus:ne,handleSingleInputChange:ae,handleRangeFromChange:pe,handleRangeToChange:oe,handleRangeBlur:ve,handleMultipleBlur:z,handleTagRemoved:Y,handleSingleKeydown:Ee,handleRangeFromKeydown:le,handleRangeToKeydown:re,handleMultipleKeydown:Ge,restProps:Ve}=s,Ne=()=>{var Pe,Ue;return o.jsxs("button",{ref:J,className:G,type:"button",onClick:X,disabled:d,"aria-label":((Pe=T.calendar)==null?void 0:Pe.buttonAltText)??"Åpne kalender",children:[o.jsx(K,{name:"calendar"}),o.jsx("span",{className:"pkt-btn__text",children:((Ue=T.calendar)==null?void 0:Ue.buttonAltText)??"Åpne kalender"})]})};return r?o.jsxs(o.Fragment,{children:[o.jsx(yf,{dates:i,dateformat:n,idBase:e,strings:T,onDateRemoved:Y}),o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Ve,ref:N,className:V,type:S,id:t,name:y??e,placeholder:k,readOnly:p||E&&!p,disabled:D,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:X,onKeyDown:Ge,onFocus:ne,onBlur:z}),Ne()]})})]}):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=T.generic)==null?void 0:Xe.from)??"Fra"}),o.jsx("input",{...Ve,ref:N,className:V,type:S,id:t,name:y?`${y}-from`:`${e}-from`,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||E&&!p,disabled:d,required:m,"aria-label":`${v} ${((rt=T.generic)==null?void 0:rt.from)??"Fra"}`,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:X,onKeyDown:le,onFocus:ne,onBlur:ve,onChange:pe}),o.jsx("div",{className:ie,id:`${e}-to-label`,children:((xe=T.generic)==null?void 0:xe.to)??"Til"}),!l&&o.jsx("div",{className:"pkt-input-separator",children:"–"}),o.jsx("input",{ref:j,className:V,type:S,id:`${e}-to`,name:y?`${y}-to`:`${e}-to`,value:i[1]??"",min:C,max:M,readOnly:p||E&&!p,disabled:d,"aria-label":`${v} ${((Se=T.generic)==null?void 0:Se.to)??"Til"}`,"aria-invalid":g,onClick:X,onKeyDown:re,onFocus:ne,onBlur:ve,onChange:oe}),Ne()]})}):o.jsx("div",{className:"pkt-datepicker__inputs",children:o.jsxs("div",{className:"pkt-input__container",children:[o.jsx("input",{...Ve,ref:N,className:V,type:S,id:t,name:y??e,value:i[0]??"",min:C,max:M,placeholder:k,readOnly:p||E&&!p,disabled:d,required:m,"aria-describedby":$?`${e}-helptext`:void 0,"aria-invalid":g,"aria-errormessage":g?`${e}-error`:void 0,onClick:X,onKeyDown:Ee,onFocus:ne,onBlur:void 0,onChange:ae}),Ne()]})})},_f={calendar:{buttonAltText:"Åpne kalender"}},$f={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}},oo=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(e=>e.trim()).filter(Boolean):[];function wf(s,e){const{id:t,label:i,value:n,defaultValue:r,dateformat:a="dd.MM.yyyy",multiple:l=!1,maxlength:d,range:p=!1,showRangeLabels:m=!1,weeknumbers:v=!1,withcontrols:y=!1,excludedates:k,excludeweekdays:g,currentmonth:$,today:C,calendarOpen:M,timezone:S,fullwidth:E=!1,hasFieldset:T=!1,inline:V=!1,helptext:G,helptextDropdown:ie,helptextDropdownButton:we,hasError:D=!1,errorMessage:N,optionalTag:j=!1,optionalText:J,requiredTag:X=!1,requiredText:ne,tagText:ae,useWrapper:pe=!0,strings:oe,disabled:ve=!1,readOnly:z=!1,required:Y=!1,name:Ee,min:le,max:re,placeholder:Ge,onChange:Ve,onValueChange:Ne,className:Xe,...rt}=s,xe=h.useCallback(O=>O===void 0?[]:oo(O),[]),Se=n!==void 0,Pe=typeof r=="number"?void 0:r,[Ue,at]=h.useState(()=>xe(n??Pe)),be=Se?xe(n):Ue;h.useEffect(()=>{Se&&at(xe(n))},[n,Se,xe]);const[ke,W]=h.useState(M??!1);h.useEffect(()=>{M!==void 0&&W(M)},[M]);const de=h.useRef(null),Z=h.useRef(null),te=h.useRef(null),ut=h.useRef(null),Be=h.useRef(null),je=h.useMemo(()=>uf(),[]),yt=h.useMemo(()=>ao(),[]),zt=h.useMemo(()=>oe??(p?$f:_f),[oe,p]),f=typeof le=="string"?le:le!==void 0?String(le):void 0,u=typeof re=="string"?re:re!==void 0?String(re):void 0,_=h.useMemo(()=>{const O=pf(E,m,l,p,z,je);return Object.entries(O).filter(([,P])=>P).map(([P])=>P).join(" ")},[E,m,l,p,z,je]),x=h.useMemo(()=>{const O=ff();return Object.entries(O).filter(([,P])=>P).map(([P])=>P).join(" ")},[]),B=h.useMemo(()=>{const O=mf(m);return Object.entries(O).filter(([,P])=>P).map(([P])=>P).join(" ")},[m]),U=h.useMemo(()=>["pkt-datepicker__inputs",p&&m&&"pkt-input__range-inputs"].filter(Boolean).join(" "),[p,m]),ee=h.useMemo(()=>{if($)return $;if(u)return u.slice(0,7)},[$,u]),ht=ve||l&&d!=null&&be.length>=d,Qe=l&&d!=null,pt=`${t}-input`,cs=be.join(",");h.useEffect(()=>{te.current&&(te.current.value=cs)},[cs]),h.useEffect(()=>{S&&typeof window<"u"&&S!==window.pktTz&&(window.pktTz=S)},[S]);const Re=h.useCallback((O,P=!0)=>{Se||at(O),P&&(Ne==null||Ne(O))},[Se,Ne]),cr=h.useMemo(()=>{var O;return(O=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:O.set},[]),kt=h.useCallback(O=>{const P=te.current;!P||!cr||(cr.call(P,O.join(",")),P.dispatchEvent(new Event("input",{bubbles:!0})))},[cr]),Jt=h.useCallback(()=>{ve||W(O=>!O)},[ve]),ds=h.useCallback(()=>{W(!1)},[]);h.useEffect(()=>{if(!ke)return;const O=Ze=>{var St;const Fe=Ze.target;Be.current&&!Be.current.contains(Fe)&&!((St=Fe.closest)!=null&&St.call(Fe,".pkt-calendar-popup"))&&ds()},P=Ze=>{var Fe;Ze.key==="Escape"&&(ds(),(Fe=de.current)==null||Fe.focus())};return document.addEventListener("click",O,!0),document.addEventListener("keydown",P),()=>{document.removeEventListener("click",O,!0),document.removeEventListener("keydown",P)}},[ke,ds]);const Vm=h.useCallback(()=>{yt&&!ke&&W(!0)},[yt,ke]),Um=h.useCallback(O=>{var St;const P=gf(O,l,p),Ze=oo(P),Fe=!p||Ze.length===2;Re(Ze,Fe),Fe&&kt(Ze),!l&&!p&&(ds(),(St=de.current)==null||St.focus())},[l,p,Re,kt,ds]),jm=h.useCallback(()=>{var O;ds(),(O=de.current)==null||O.focus()},[ds]),qm=h.useCallback(O=>{const P=O.target.value,Ze=P?[P]:[];Re(Ze),kt(Ze)},[Re,kt]),Wm=h.useCallback(O=>{const P=O.target.value,Ze=be[1]??"",Fe=[P,Ze].filter(Boolean),St=Fe.length===2;Re(Fe,St),St&&kt(Fe)},[be,Re,kt]),zm=h.useCallback(O=>{const P=be[0]??"",Ze=O.target.value,Fe=[P,Ze].filter(Boolean),St=Fe.length===2;Re(Fe,St),St&&kt(Fe)},[be,Re,kt]),Ym=h.useCallback(()=>{be.length===2&&!hf(be)&&(Re([be[0]]),kt([be[0]]))},[be,Re,kt]),vn=h.useCallback(O=>{const P=Zt(O),Ze=f?Zt(f):null,Fe=u?Zt(u):null;if(P&&!isNaN(P.getTime())&&(!Ze||P>=Ze)&&(!Fe||P<=Fe)){const St=Vp([...be,O],f,u,k,g),Ho=[...new Set(St)];Re(Ho),kt(Ho)}},[be,f,u,k,g,Re,kt]),Km=h.useCallback(O=>{const P=O.target;P.value&&(vn(P.value.split(",")[0]),P.value="")},[vn]),Fo=h.useCallback(O=>{const P=O.target;P.value&&(vn(P.value.split(",")[0]),P.value="")},[vn]),Gm=h.useCallback(O=>{const P=be.filter(Ze=>Ze!==O);Re(P),kt(P)},[be,Re,kt]),us=h.useCallback(O=>{const P=O==null?void 0:O.closest("form");P?P.requestSubmit():O==null||O.blur()},[]),Xm=h.useCallback(O=>{dn(O.nativeEvent,()=>Jt(),()=>us(de.current),void 0,()=>{var P;return(P=de.current)==null?void 0:P.blur()})},[Jt,us]),Qm=h.useCallback(O=>{dn(O.nativeEvent,()=>Jt(),()=>us(de.current),()=>{var P;return(P=Z.current)==null?void 0:P.focus()},()=>{var P;return(P=de.current)==null?void 0:P.blur()})},[Jt,us]),Zm=h.useCallback(O=>{dn(O.nativeEvent,()=>Jt(),()=>us(Z.current),void 0,()=>{var P;return(P=Z.current)==null?void 0:P.blur()})},[Jt,us]),Jm=h.useCallback(O=>{dn(O.nativeEvent,()=>Jt(),()=>us(de.current),void 0,()=>{var P;return(P=de.current)==null?void 0:P.blur()},Fo)},[Jt,us,Fo]);return h.useImperativeHandle(e,()=>({get value(){var O;return((O=te.current)==null?void 0:O.value)??""},set value(O){const P=O?O.split(",").filter(Boolean):[];at(P),te.current&&(te.current.value=O??"")},focus(){var O;(O=de.current)==null||O.focus()},blur(){var O;(O=de.current)==null||O.blur()}}),[]),{id:t,inputId:pt,label:i,values:be,calendarOpen:ke,dateformat:a,multiple:l,maxlength:d,range:p,showRangeLabels:m,weeknumbers:v,withcontrols:y,excludedates:k,excludeweekdays:g,disabled:ve,readOnly:z,required:Y,name:Ee,placeholder:Ge,fullwidth:E,hasFieldset:T,inline:V,helptext:G,helptextDropdown:ie,helptextDropdownButton:we,hasError:D,errorMessage:N,optionalTag:j,optionalText:J,requiredTag:X,requiredText:ne,tagText:ae,useWrapper:pe,className:Xe,minStr:f,maxStr:u,effectiveCurrentMonth:ee,today:C,inputType:je,isIOSDevice:yt,strings:zt,inputClasses:_,buttonClasses:x,rangeLabelClasses:B,datepickerInputsClasses:U,isInputDisabled:ht,hasCounter:Qe,inputRef:de,inputRefTo:Z,changeInputRef:te,btnRef:ut,wrapperRef:Be,onChange:Ve,toggleCalendar:Jt,hideCalendar:ds,handleDateSelected:Um,handleCalendarClose:jm,handleFocus:Vm,handleSingleInputChange:qm,handleRangeFromChange:Wm,handleRangeToChange:zm,handleRangeBlur:Ym,handleMultipleBlur:Km,handleTagRemoved:Gm,handleSingleKeydown:Xm,handleRangeFromKeydown:Qm,handleRangeToKeydown:Zm,handleMultipleKeydown:Jm,restProps:rt}}const lo=h.forwardRef((s,e)=>{const t=wf(s,e),i=["pkt-datepicker",t.className].filter(Boolean).join(" ");return o.jsxs("div",{className:i,children:[o.jsx(Es,{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(kf,{state:t})}),o.jsx(bf,{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"})]})});lo.displayName="PktDatepicker";const xf={dropFilesHere:"Slipp filene her ...",selectOrDragFiles:"Dra filer hit for å laste dem opp eller ",chooseFiles:"velg filer"},Sf={dropFilesHere:"Slipp filen her ...",selectOrDragFiles:"Dra en fil for å laste den opp eller ",chooseFiles:"velg en fil"},Cf={dropFilesHere:"Slipp bildene her ...",selectOrDragFiles:"Dra bilder hit for å laste dem opp eller ",chooseFiles:"velg fra kamerarull"},Tf={dropFilesHere:"Slipp bildet her ...",selectOrDragFiles:"Dra et bilde for å laste det opp eller ",chooseFiles:"velg fra kamerarull"},co=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Nf=()=>{const s=co(),e=co();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+e.slice(1,4)+"-"+e.slice(4)};class Mf{constructor(e,t){bn(this,"fileId");bn(this,"file");bn(this,"attributes",{});this.fileId=t||Nf(),this.file=e,this.attributes={targetFilename:e.name}}}const tr=h.createContext({}),Df=h.forwardRef(({id:s,multiple:e,value:t,onFilesAdded:i=()=>{},name:n,uploadStrategy:r,accept:a=".pdf, .jpeg, .jpg, .png, .heic, .doc, .docx, .odt",isThumbnailView:l=!1,disabled:d=!1,srAnnouncementIds:p,...m},v)=>{const y=h.useRef(null),k=h.useMemo(()=>((a==null?void 0:a.split(/\s*,\s*/).map(D=>D.trim()))||[]).join(", ").toUpperCase(),[a]);h.useImperativeHandle(v,()=>y.current);const[g,$]=h.useState(!1),C=h.useMemo(()=>l?e?Cf:Tf:e?xf:Sf,[e,l]),M=h.useCallback(D=>{if(y.current)try{y.current.files=Of(D)}catch{}},[y.current,t]);h.useEffect(()=>{M(t)},[y,t]);const S=h.useCallback(D=>{const N=D.map(j=>new Mf(j));i(N),y.current&&(y.current.value="")},[i]),E=D=>{const N=D.target.files;if(N.length===0){e&&M(t);return}S(Array.from(N))},T=D=>{S(D)},V=D=>{if(D.preventDefault(),$(!1),d)return;const N=D.dataTransfer.files,j=Array.from(N);T(j)},G=D=>{D.preventDefault(),!d&&$(!0)},ie=()=>{$(!1)},we=h.useCallback(D=>{var j;d||D.target.closest(".pkt-fileupload__drop-zone__placeholder__title__open-file-dialog")||(j=y.current)==null||j.click()},[d]);return o.jsxs("div",{onDrop:V,onDragOver:G,onDragLeave:ie,onClick:we,className:ce("pkt-fileupload__drop-zone",{"pkt-fileupload__drop-zone--drag-active":g,"pkt-fileupload__drop-zone--disabled":d}),children:[o.jsx("input",{...m,id:s,type:"file",ref:y,multiple:e,onChange:E,accept:a,disabled:d,name:r==="form"&&n||void 0,"aria-label":e?"Velg filer":"Velg fil"}),r==="custom"&&o.jsx(o.Fragment,{children:t==null?void 0:t.map(D=>o.jsx("input",{type:"hidden",name:n,value:D.fileId},D.fileId))}),o.jsxs("div",{className:"pkt-fileupload__drop-zone__placeholder",children:[o.jsx(K,{name:"attachment",className:"pkt-fileupload__drop-zone__placeholder__icon","aria-hidden":"true"}),o.jsx("p",{className:"pkt-fileupload__drop-zone__placeholder__title",children:g?`${C.dropFilesHere} ...`:o.jsxs(o.Fragment,{children:[C.selectOrDragFiles," ",o.jsx("button",{className:"pkt-fileupload__drop-zone__placeholder__title__open-file-dialog",onClick:D=>{var N;D.preventDefault(),D.stopPropagation(),(N=y.current)==null||N.click()},type:"button",children:C.chooseFiles})]})}),o.jsxs("p",{className:"pkt-fileupload__drop-zone__placeholder__formats",children:["Format: ",k]})]})]})}),Of=s=>{const e=new DataTransfer;for(const t of s)e.items.add(t.file);return e.files},sr=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,counter:i,counterMaxLength:n,className:r,disabled:a,errorMessage:l,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,fullwidth:k=!1,label:g,name:$,optionalTag:C=!1,optionalText:M,requiredTag:S=!1,requiredText:E,tagText:T=null,placeholder:V,rows:G,useWrapper:ie=!0,onChange:we,value:D,autoComplete:N="off",minLength:j,maxLength:J,readOnly:X,skipForwardTestid:ne=!1,...ae},pe)=>{const oe=[r,"pkt-textinput","pkt-textarea"].join(" "),ve=`${s}-input`,z=`${ve}-label`,Y=t||z,[Ee,le]=h.useState(0),re=Ge=>{var Ve,Ne;i&&le(((Ne=(Ve=Ge.currentTarget)==null?void 0:Ve.value)==null?void 0:Ne.length)||0),we&&we(Ge)};return h.useEffect(()=>{D!==void 0&&le((D==null?void 0:D.length)||0)},[D]),o.jsx(Es,{ariaDescribedby:e,className:oe,disabled:a,errorMessage:l,forId:ve,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:y,label:g,optionalTag:C,optionalText:M,requiredTag:S,requiredText:E,tagText:T,useWrapper:ie,counter:i,counterCurrent:Ee,counterMaxLength:n,children:o.jsx("textarea",{ref:pe,className:`pkt-input ${k?"pkt-input--fullwidth":""} ${n&&Ee>n?"pkt-input--counter-error":""}`,name:`${$||s}`,id:ve,placeholder:V,disabled:a,rows:G,"aria-labelledby":Y,"aria-invalid":d,"aria-errormessage":`${s}-error`,...ae,onChange:re,value:D,autoComplete:N,minLength:j,maxLength:J,readOnly:X,"data-skip-forward-testid":ne?"true":void 0})})});sr.displayName="PktTextarea";const Ef=Symbol("comment"),Pf=s=>{const e=String(s.getDate()).padStart(2,"0"),t=String(s.getMonth()+1).padStart(2,"0"),i=s.getFullYear(),n=String(s.getHours()).padStart(2,"0"),r=String(s.getMinutes()).padStart(2,"0");return`${e}.${t}.${i} kl. ${n}:${r}`},Af=({fileItem:s,closeOperationUi:e,onAddComment:t,existingComment:i})=>{const n=h.useRef(null),r=!!i,a=()=>{var d,p;const l=(p=(d=n.current)==null?void 0:d.value)==null?void 0:p.trim();l&&t({text:l,timestamp:new Date}),e()};return h.useLayoutEffect(()=>{const l=setTimeout(()=>{var d;return(d=n.current)==null?void 0:d.focus({preventScroll:!0})},0);return()=>clearTimeout(l)},[s.fileId]),o.jsxs(o.Fragment,{children:[o.jsx(sr,{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:n,defaultValue:i==null?void 0:i.text}),o.jsx(it,{skin:"secondary",size:"small",onClick:a,children:r?"Lagre kommentar":"Legg til kommentar"}),o.jsx(it,{skin:"tertiary",size:"small",onClick:e,children:"Avbryt"})]})},If=({comments:s,onDeleteComment:e,onEditComment:t})=>s&&s.length>0?o.jsx("div",{className:"pkt-fileupload__queue-display__item__comments",children:s.map((i,n)=>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:i.text}),o.jsx("time",{className:"pkt-fileupload__queue-display__item__comment__time",children:Pf(i.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(n),"aria-label":"Slett kommentar",children:o.jsx(K,{name:"trash-can"})}),t&&o.jsx("button",{type:"button",className:"pkt-fileupload__queue-display__item__comment__action",onClick:()=>t(n),"aria-label":"Rediger kommentar",children:o.jsx(K,{name:"edit"})})]})]},n))}):null,Lf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-comments`,value:s.comments?JSON.stringify(s.comments):""})},Bf=s=>{const e=s("comments"),t=(n,r)=>{e.set(n,[r])},i=(n,r)=>{const l=(e.get(n)||[]).filter((d,p)=>p!==r);e.set(n,l.length>0?l:void 0)};return{title:n=>{const r=e.get(n.fileId);return r&&r.length>0?"":"Legg til kommentar"},renderExtendedUI:(n,r)=>{const a=e.get(n.fileId),l=a==null?void 0:a[0];return o.jsx(Af,{fileItem:n,closeOperationUi:r,onAddComment:d=>t(n.fileId,d),existingComment:l})},renderContent:(n,r,a)=>{if(a)return null;const l=e.get(n.fileId);return o.jsx(If,{comments:l,onDeleteComment:d=>i(n.fileId,d),onEditComment:r?()=>r():void 0})},renderHidden:n=>o.jsx(Lf,{comments:e.get(n.fileId)},`comments${n.fileId}`),symbol:Ef}},Ff=Symbol("deleteFile"),Hf=s=>({title:"Slett",ariaLabel:"Slett fil",onClick:e=>s(e.fileId),symbol:Ff}),Vf=Symbol("renameFile"),Uf=s=>{const e=h.useRef(null),t=h.useId(),i=()=>{var n;s.onSave(((n=e.current)==null?void 0:n.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:n=>{n.key==="Enter"&&(n.preventDefault(),n.stopPropagation(),i()),n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),s.onCancel())}}),o.jsx(it,{skin:"secondary",size:"small",onClick:()=>s.onSave(e.current.value),children:"Lagre"}),o.jsx(it,{skin:"tertiary",size:"small",onClick:s.onCancel,children:"Avbryt"})]})},jf=s=>{const e=h.useContext(tr);return o.jsx("input",{type:"hidden",name:`${e.name}-targetFilename`,value:s.targetFilename})},qf=s=>{const e=s("targetFilename");return{title:"Rediger",ariaLabel:"Rediger filnavn",renderInlineUI:(t,i)=>o.jsx(Uf,{value:e.get(t.fileId)||void 0,onSave:n=>{e.set(t.fileId,n),i()},onCancel:i}),renderHidden:t=>o.jsx(jf,{targetFilename:e.get(t.fileId)||t.file.name},`rename${t.fileId}`),symbol:Vf}},Wf=(s,e)=>{const t=h.useCallback((r,a,l)=>{const d=s.find(m=>m.fileId===r),p=d.attributes||{};d.attributes={...p,[a]:l},e(r,{attributes:d.attributes})},[e,s]),i=h.useCallback((r,a)=>(s.find(p=>p.fileId===r).attributes||{})[a],[s]);return{fileAttributes:h.useCallback(r=>({get:a=>i(a,r),set:(a,l)=>{t(a,r,l)}}),[i,t])}},zf=s=>{const[e,t]=h.useState(!1),[i,n]=h.useState(0),r=h.useRef(null),a=h.useCallback(p=>{var v;const m=s.findIndex(y=>y.fileId===p);m>=0&&(n(m),t(!0),(v=r.current)==null||v.showModal())},[s]),l=h.useCallback(()=>{var p;t(!1),(p=r.current)==null||p.close()},[]),d=h.useCallback(p=>{s.length!==0&&n(m=>p==="prev"?m<=0?s.length-1:m-1:m>=s.length-1?0:m+1)},[s.length]);return{isOpen:e,currentIndex:i,modalRef:r,open:a,close:l,navigate:d}},Yf=s=>{const[e,t]=h.useState({}),i=h.useCallback(a=>{const l=e[a];if(l)return s.find(d=>d.symbol===l)},[e,s]),n=h.useCallback((a,l)=>{t(d=>({...d,[a]:l.symbol}))},[]),r=h.useCallback(a=>{t(l=>{const d={...l};return delete d[a],d})},[]);return{getActivated:i,activate:n,close:r}},Kf=It({tagName:"pkt-modal",elementClass:wt,react:h,displayName:"PktModal",events:{}}),ir=h.forwardRef(({children:s,...e},t)=>o.jsx(Kf,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ir.displayName="PktModal";const uo=2,Gf=s=>{const e=window.getComputedStyle(s),t=parseFloat(e.lineHeight);if(!Number.isNaN(t)&&t>0)return t;const i=parseFloat(e.fontSize);return(!Number.isNaN(i)&&i>0?i:16)*1.2},Xf=(s,e,t)=>{const i=e*t;return s.getBoundingClientRect().height>i+.5},ho=h.createContext({tail:5}),Ii=({children:s,tail:e,...t})=>{const i=s,n=h.useContext(ho),r=e!==void 0?e:n.tail||0,a=s.length<=r+3?null:s.slice(-r),l=h.useRef(null),d=h.useRef(null),[p,m]=h.useState(!1),v=h.useCallback(()=>{const k=l.current,g=d.current;if(!k||!g)return;const $=Gf(k);m(Xf(g,$,uo))},[]),y=h.useMemo(()=>new ResizeObserver(k=>{k.some(g=>g.target===l.current)&&v()}),[v]);return h.useLayoutEffect(()=>(l.current&&y.observe(l.current),v(),()=>y.disconnect()),[s,y,v]),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:uo,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",overflowWrap:"anywhere"},children:i}),r!==0&&o.jsx("span",{"data-pkt-truncate-part":"tail",style:{whiteSpace:"nowrap",display:p?"inline":"none",paddingRight:"0.5rem"},"aria-hidden":!0,children:a}),o.jsx("span",{ref:d,"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})]})},Qf=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}},hn=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`,nr=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"}),Zf=()=>{const[s,e]=h.useState(1);return h.useEffect(()=>{const t=setInterval(()=>{e(i=>i>=3?1:i+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)]})},Jf=({cancelTransfer:s,transferItem:e})=>{const t=e.showProgress??e.progress!==0;return o.jsxs(o.Fragment,{children:[o.jsx(K,{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(Ii,{children:e.attributes.targetFilename})}),o.jsx(nr,{onClick:s}),t?o.jsxs(o.Fragment,{children:[o.jsx(gn,{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:hn(e.file.size)}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__percentage","aria-hidden":"true",children:`${Math.round(e.progress*100)}%`})]}):o.jsx(Zf,{})]})},Rf=({transferItem:s,onRemove:e})=>{const t=(s.lastProgress??1)*100;return o.jsxs(o.Fragment,{children:[o.jsx(K,{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(Ii,{children:s.attributes.targetFilename})}),o.jsx(nr,{onClick:e,label:"Fjern",ariaLabel:"Fjern fil som feilet under opplasting"}),o.jsx(gn,{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:hn(s.file.size)}),s.errorMessage&&o.jsx("span",{className:"pkt-fileupload__queue-display__item__error-message",children:s.errorMessage})]})},em=({transferItem:s,onRemove:e})=>o.jsxs(o.Fragment,{children:[o.jsx(K,{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(Ii,{children:s.attributes.targetFilename})}),o.jsx(nr,{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})]}),tm=({transferItem:s,onRemove:e})=>s.showProgress?o.jsx(Rf,{transferItem:s,onRemove:e}):o.jsx(em,{transferItem:s,onRemove:e}),sm=({operation:s,onActivate:e,transferItem:t})=>{const i=typeof s.title=="function"?s.title(t):s.title;if(!i)return null;const n=()=>{(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:n,"aria-label":typeof s.ariaLabel=="function"?s.ariaLabel(t):s.ariaLabel,children:i})},po=({transferItem:s})=>o.jsxs(o.Fragment,{children:[o.jsx(K,{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(Ii,{children:s.attributes.targetFilename})}),o.jsx("span",{className:"pkt-fileupload__queue-display__item__filesize",children:hn(s.file.size)})]}),im=({transferItem:s,onPreviewClick:e})=>{const[t,i]=h.useState(null),n=s.file;h.useEffect(()=>{if(n.type.startsWith("image/")){const l=URL.createObjectURL(n);return i(l),()=>{URL.revokeObjectURL(l)}}},[n]);const r=t&&o.jsx("img",{src:t,alt:s.attributes.targetFilename})||o.jsx(K,{name:"document-text",className:"pkt-fileupload__queue-display__item__icon pkt-icon--medium"}),a=!!e;return o.jsxs("div",{className:"pkt-fileupload__queue-display__item__thumbnail",children:[o.jsxs(it,{className:"pkt-fileupload__queue-display__item__thumbnail__image-wrapper","aria-label":`Forhåndsvis bilde ${s.attributes.targetFilename}`,type:"button",skin:"secondary",onClick:e,children:[a&&o.jsx(K,{name:"expand",className:"pkt-fileupload__queue-display__item__thumbnail__expand-icon","aria-hidden":"true"}),r]}),o.jsx(Ii,{className:"pkt-fileupload__queue-display__item__thumbnail__title",children:s.attributes.targetFilename})]})},fo=h.forwardRef(({isOpen:s,images:e,currentIndex:t,onClose:i,onNavigate:n},r)=>{const[a,l]=h.useState(null),d=e[t],p=e.length>1;return h.useEffect(()=>{if(d&&d.file.type.startsWith("image/")){const m=URL.createObjectURL(d.file);return l(m),()=>URL.revokeObjectURL(m)}l(null)},[d]),h.useEffect(()=>{if(!s)return;const m=v=>{switch(v.key){case"ArrowLeft":v.preventDefault(),n("prev");break;case"ArrowRight":v.preventDefault(),n("next");break;case"Escape":v.preventDefault(),i();break}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[s,n,i]),d?o.jsx(ir,{ref:r,headingText:d.attributes.targetFilename,closeOnBackdropClick:!0,className:"pkt-fileupload__image-preview-modal",children:o.jsxs("div",{className:"pkt-fileupload__image-preview",children:[p&&o.jsx(it,{variant:"icon-only",iconName:"chevron-thin-left",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev",onClick:()=>n("prev"),"aria-label":`Forrige bilde ${t} / ${e.length}`}),o.jsx("div",{className:"pkt-fileupload__image-preview__content",children:a&&o.jsx("img",{src:a,alt:`${d.attributes.targetFilename} - ${t+1} av ${e.length}`,className:"pkt-fileupload__image-preview__image"})}),p&&o.jsxs("span",{className:"pkt-fileupload__image-preview__counter",children:[t+1," / ",e.length]}),p&&o.jsx(it,{variant:"icon-only",iconName:"chevron-thin-right",skin:"secondary",size:"small",className:"pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next",onClick:()=>n("next"),"aria-label":`Neste bilde ${t+2} / ${e.length}`})]})}):null});fo.displayName="ImagePreviewModal";const rr=s=>typeof s=="number"?"in-progress":s==="error"?"error":"idle",nm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__actions",children:s.filter(n=>!e||n.symbol!==e.symbol).map(n=>o.jsx(sm,{operation:n,onActivate:t,transferItem:i},n.symbol.toString()))}),rm=({operations:s,activatedOperation:e,onActivate:t,transferItem:i})=>o.jsx(o.Fragment,{children:s.filter(n=>n.renderContent).map(n=>o.jsx("div",{className:"pkt-fileupload__queue-display__item__operation-content",children:n.renderContent(i,()=>t(i.fileId,n),(e==null?void 0:e.symbol)===n.symbol)},n.symbol.toString()))}),am=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:n,onClose:r,onPreviewClick:a})=>{const l=()=>r(s.fileId),p=(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(K,{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(i,{transferItem:s,queueItemOperations:t,onPreviewClick:a}),p.length>0&&o.jsx(nm,{operations:p,activatedOperation:e,onActivate:n,transferItem:s}),o.jsx(rm,{operations:t,activatedOperation:e,onActivate:n,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)})]})},om=({transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,enableImagePreview:n,onActivate:r,onClose:a,onCancelTransfer:l,onOpenPreview:d})=>{const p=rr(s.progress),m=n&&s.progress==="done"&&s.file.type.startsWith("image/");switch(p){case"in-progress":return o.jsx(Jf,{"aria-live":"off",transferItem:s,cancelTransfer:()=>l(s.fileId)});case"error":return o.jsx(tm,{transferItem:s,onRemove:()=>l(s.fileId)});case"idle":return o.jsx(am,{transferItem:s,activatedOperation:e,operations:t,ItemRenderer:i,onActivate:r,onClose:a,onPreviewClick:m?()=>d(s.fileId):void 0})}},lm=(s,e)=>h.useMemo(()=>{const t=s.map(n=>{const r=e.find(a=>a.fileId===n.fileId);return{...n,progress:(r==null?void 0:r.progress)??"queued",errorMessage:r==null?void 0:r.errorMessage,showProgress:r==null?void 0:r.showProgress,lastProgress:r==null?void 0:r.lastProgress}}),i={"in-progress":0,error:1,idle:2};return t.sort((n,r)=>i[rr(n.progress)]-i[rr(r.progress)])},[s,e]),cm=(s,e)=>h.useMemo(()=>e?s.filter(t=>t.progress==="done"&&t.file.type.startsWith("image/")):[],[s,e]),dm=({files:s,cancelTransfer:e,transfers:t=[],queueItemOperations:i=[],ItemRenderer:n=po,truncateTail:r,enableImagePreview:a=!1})=>{const l=lm(s,t),d=cm(l,a),p=Yf(i),m=zf(d);return o.jsxs(o.Fragment,{children:[o.jsx("ul",{className:"pkt-fileupload__queue-display",children:o.jsx(ho.Provider,{value:{tail:r},children:l.map(v=>o.jsxs("li",{className:ce("pkt-fileupload__queue-display__item",{"pkt-fileupload__queue-display__item--in-progress":typeof v.progress=="number",[`pkt-fileupload__queue-display__item--${v.progress}`]:typeof v.progress=="string"}),children:[i.filter(y=>y.renderHidden).map(y=>y.renderHidden(v)),o.jsx(om,{transferItem:v,activatedOperation:p.getActivated(v.fileId),operations:i,ItemRenderer:n,enableImagePreview:a,onActivate:p.activate,onClose:p.close,onCancelTransfer:e,onOpenPreview:m.open})]},v.fileId))})}),a&&d.length>0&&o.jsx(fo,{ref:m.modalRef,isOpen:m.isOpen,images:d,currentIndex:m.currentIndex,onClose:m.close,onNavigate:m.navigate})]})},mo={filename:po,thumbnail:im},go=h.forwardRef(({value:s,defaultValue:e,id:t="fileupload-id",multiple:i=!1,uploadStrategy:n="form",addCommentsEnabled:r=!1,renameFilesEnabled:a=!1,truncateTail:l,onFilesChanged:d,onFileUploadRequested:p,extraOperations:m=[],itemRenderer:v=mo.filename,fullWidth:y=!1,allowedFormats:k,formatErrorMessage:g,maxFileSize:$,sizeErrorMessage:C,onFileValidation:M,errorMessage:S,hasError:E=!1,disabled:T=!1,label:V,helptext:G,optionalTag:ie,requiredTag:we,enableImagePreview:D=!1,...N},j)=>{const J="transfers"in N?N.transfers:void 0,[X,ne]=h.useState(null),ae=E||!!X,pe=S||X,oe=$?Qf($):void 0,ve=h.useCallback(W=>{var de;if(k&&k.length>0){const Z=((de=W.name.split(".").pop())==null?void 0:de.toLowerCase())||"",te=W.type.toLowerCase();if(!k.some(Be=>{const je=Be.toLowerCase().replace(/^\./,"");if(je.includes("/")){if(je.endsWith("/*")){const yt=je.replace("/*","");return te.startsWith(yt+"/")}return te===je}return Z===je})){const Be=k.join(", "),je=`Ugyldig filtype. Tillatte formater: ${Be}`;return(g==null?void 0:g.replace("{formats}",Be))||je}}if(oe&&W.size>oe){const Z=hn(oe),te=`Filen er for stor. Maks størrelse er ${Z}.`;return(C==null?void 0:C.replace("{maxSize}",Z))||te}return M?M(W):null},[k,g,oe,C,M]);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&&d===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 Y=s!==void 0?s:e||[],Ee=typeof v=="string"?mo[v]:v,le=v==="thumbnail",re=a&&!le,Ge=r&&!le,Ve=h.useCallback(W=>{for(const Z of W){const te=ve(Z.file);if(te){ne(te);return}}ne(null);const de=i?[...Y,...W]:[W[0]];d&&d(de),n==="custom"&&p&&W.forEach(Z=>{p==null||p(Z)})},[d,Y,i,n,p,ve]),Ne=h.useCallback((W,de)=>{const Z=Y.map(te=>te.fileId===W?{...te,...de}:te);d&&d(Z)},[d,Y]),Xe=h.useCallback(W=>{var Z;const de=Y.filter(te=>te.fileId!==W);d&&d(de),"onTransferCancelled"in N&&N.onTransferCancelled&&((Z=N.onTransferCancelled)==null||Z.call(N,W))},[d,Y,N]),{fileAttributes:rt}=Wf(Y,Ne),xe=h.useMemo(()=>[{op:qf,enabled:re},{op:W=>Bf(W),enabled:Ge}].filter(({enabled:W})=>W).map(({op:W})=>W).concat(...m),[re,Ge]),Se=h.useMemo(()=>({uploaded:`${t}-uploaded`,errors:`${t}-errors`}),[t]),{totalCount:Pe,uploadedCount:Ue,failedCount:at}=h.useMemo(()=>{const W=Y.length;if(!J)return{totalCount:W,uploadedCount:0,failedCount:0};let de=0,Z=0;for(const te of Y){const ut=J.find(Be=>Be.fileId===te.fileId);(ut==null?void 0:ut.progress)==="done"&&de++,(ut==null?void 0:ut.progress)==="error"&&Z++}return{totalCount:W,uploadedCount:de,failedCount:Z}},[Y,J]),be=Pe===1?"fil":"filer",ke=o.jsx("div",{className:ce("pkt-fileupload",{"pkt-fileupload--full-width":y,"pkt-fileupload--error":ae,"pkt-fileupload--disabled":T}),"aria-disabled":T,...T?{inert:""}:{},children:o.jsxs(tr.Provider,{value:{name:N.name||"",multiple:!!i,id:t},children:[o.jsx("div",{id:Se.uploaded,className:"pkt-sr-only","aria-live":"polite","aria-atomic":"true",children:Pe>0&&Ue>0&&`${Ue} av ${Pe} ${be} lastet opp`}),o.jsx("div",{id:Se.errors,className:"pkt-sr-only","aria-live":"assertive","aria-atomic":"true",children:Pe>0&&at>0&&`Feil ved opplasting: ${at} av ${Pe} ${be} feilet`}),o.jsx(Df,{id:t,name:N.name||"",value:Y,onFilesAdded:Ve,multiple:i,uploadStrategy:n,ref:j,accept:le?".jpeg, .jpg, .png, .gif, .webp, .heic":N.accept,isThumbnailView:le,disabled:T,srAnnouncementIds:Se}),ae&&pe&&o.jsx(an,{skin:"error","aria-live":"assertive",role:"alert",compact:!0,className:"pkt-fileupload__error-alert",children:pe}),o.jsx(dm,{files:Y,cancelTransfer:Xe,truncateTail:l,transfers:J,ItemRenderer:Ee,enableImagePreview:le&&D,queueItemOperations:xe.map(W=>W(rt)).concat(Hf(Xe))})]})});return V?o.jsx(Es,{forId:t,label:V,helptext:G,disabled:T,hasError:ae,optionalTag:ie,requiredTag:we,className:"pkt-fileupload-wrapper",children:ke}):ke});go.displayName="PktFileUpload";const um=({columnOne:s,columnTwo:e,socialLinks:t,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:r="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:a="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:l=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:y=null,cookieExpiryDays:k=null,onToggleConsent:g=$=>{console.log($.detail)}})=>{var C,M;const $=[i,"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((S,E)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${E}`))]})]}),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}),(M=e.links)==null?void 0:M.map((S,E)=>o.jsx("li",{className:"pkt-footer__list-item",children:o.jsxs("a",{className:`pkt-footer__link ${S.external?"pkt-link--external":""}`,href:S.href,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${E}`))]})]}),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:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(K,{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:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),l&&o.jsx("li",{className:"pkt-footer__list-item",children:o.jsx(cn,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:y,cookieExpiryDays:k,onToggleConsent:g})})]})]})]}),t&&o.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[o.jsx("div",{className:"pkt-footer__social-languages",children:t.filter(S=>S.language).map((S,E)=>o.jsx("div",{className:"pkt-footer__social-language",children:o.jsx("a",{href:S.href,"aria-label":`til ${S.language} versjon av nettsiden`,target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:S.language})},`sociallinks-language-${E}`))}),o.jsx("div",{className:"pkt-footer__social-icons",children:t.filter(S=>S.iconName).map((S,E)=>o.jsx(h.Fragment,{children:o.jsx("a",{href:S.href,"aria-label":`til ${S.iconName}`,className:"pkt-footer__social-icon-link",target:S.openInNewTab||n?"_blank":"_self",rel:S.openInNewTab||n?"noopener noreferrer":void 0,children:o.jsx(K,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${E}`))})]})]})})},hm=({links:s=[],openLinksInNewTab:e=!1,personvernOgInfoLink:t="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:r=null,googleAnalyticsId:a=null,devMode:l=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:v=k=>{console.log(k.detail)},className:y})=>{const k=[y,"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((g,$)=>o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsxs("a",{className:`pkt-footer-simple__link ${g.external?" pkt-link--external":""}`,href:g.href,target:g.openInNewTab||e?"_blank":"_self",rel:g.openInNewTab||e?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),g.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(K,{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:i,target:e?"_blank":"_self",rel:e?"noopener noreferrer":void 0,children:[o.jsx(K,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&o.jsx("li",{className:"pkt-footer-simple__list-item",children:o.jsx(cn,{triggerType:"footerlink",hotjarId:r,googleAnalyticsId:a,devMode:l,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},pm=(s,e)=>{const t=()=>typeof window>"u"?0:window.innerWidth,[i,n]=h.useState(t);return h.useEffect(()=>{const r=s.current;if(!r)return;if(n(r.offsetWidth),typeof ResizeObserver>"u"){const l=()=>{r&&n(r.offsetWidth)};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)}const a=new ResizeObserver(l=>{for(const d of l)d.borderBoxSize&&d.borderBoxSize.length>0?n(d.borderBoxSize[0].inlineSize):n(d.contentRect.width)});return a.observe(r),()=>{a.disconnect()}},[s]),i};function fm(s){const e=h.useRef(0);h.useEffect(()=>{const t=document.body,i=document.documentElement;if(s){e.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(t.style.paddingRight=`${n}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",i.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 pn=({href:s,iconName:e,className:t,iconPosition:i,external:n,target:r,children:a,...l})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!e&&i==="left"||!!(e&&!i),"pkt-link--icon-right":!!e&&i==="right","pkt-link--external":n};return o.jsxs("a",{...l,className:ce(d,t),href:s,target:r,rel:n?"noopener noreferrer":void 0,children:[e&&o.jsx(K,{name:e,className:"pkt-link__icon"}),a]})};pn.displayName="PktLink";const mm=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},fn=({item:s,className:e})=>"href"in s?o.jsx(pn,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:ce("pkt-user-menu__link",e),children:s.title}):o.jsxs("button",{className:ce("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(K,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),gm=({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(fn,{item:e})},t))}),vo=h.forwardRef(({user:s,formattedLastLoggedIn:e,representing:t,userMenu:i,canChangeRepresentation:n,changeRepresentation:r,logoutOnClick:a},l)=>{const d=i==null?void 0:i.map(mm);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})]})]}),d&&d.length>0&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(gm,{links:d})}),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]}),n&&r&&o.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:o.jsx("li",{className:"pkt-user-menu__subitem",children:o.jsx(fn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})]}),!t&&n&&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(fn,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:r}})})})}),a&&o.jsx("li",{className:"pkt-user-menu__item",children:o.jsx(fn,{item:{title:"Logg ut",iconName:"exit",onClick:a}})})]})})});vo.displayName="PktHeaderUserMenu";const mn=h.forwardRef(({id:s,ariaDescribedby:e,ariaLabelledby:t,autocomplete:i="off",counter:n,counterMaxLength:r,className:a,disabled:l=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:y,iconNameRight:k,inline:g=!1,fullwidth:$=!1,label:C,name:M,optionalTag:S=!1,optionalText:E,requiredTag:T=!1,requiredText:V,tagText:G=null,placeholder:ie,prefix:we,suffix:D,type:N="text",useWrapper:j=!0,omitSearchIcon:J=!1,value:X,minLength:ne,maxLength:ae,min:pe,max:oe,step:ve,size:z,readonly:Y,required:Ee,dataTestid:le,onChange:re,skipForwardTestid:Ge=!1,...Ve},Ne)=>{const Xe=[a,"pkt-textinput"].join(" "),rt=N==="search"&&!k&&!J,xe=N==="date"&&X?X.slice(0,10):X,[Se,Pe]=h.useState((X==null?void 0:X.length)||0),Ue=`${s}`,at=`${Ue}-label`,be=t||at,ke=W=>{var de,Z;n&&Pe(((Z=(de=W.currentTarget)==null?void 0:de.value)==null?void 0:Z.length)||0),re&&re(W)};return h.useEffect(()=>{X!==void 0&&Pe((X==null?void 0:X.length)||0)},[X]),o.jsx(Es,{ariaDescribedby:e,className:Xe,disabled:l,errorMessage:d,forId:Ue,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:y,inline:g,label:C,optionalTag:S,optionalText:E,requiredTag:T,requiredText:V,tagText:G,useWrapper:j,counter:n,counterCurrent:Se,counterMaxLength:r,children:o.jsxs("div",{className:"pkt-input__container","data-testid":le,"data-skip-forward-testid":Ge?"true":void 0,children:[we&&o.jsx("div",{className:"pkt-input-prefix",children:we}),o.jsx("input",{...Ve,ref:Ne,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${r&&Se>r?"pkt-input--counter-error":""}`,type:N,name:`${M||s}`,value:xe,id:Ue,placeholder:ie,autoComplete:i,disabled:l,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":be,min:pe,max:oe,onChange:ke,step:ve,minLength:ne,maxLength:ae,size:z,readOnly:Y,required:Ee}),D&&o.jsxs("p",{className:"pkt-input-suffix",children:[D,k&&o.jsx(K,{className:"pkt-input-suffix-icon",name:k}),rt&&o.jsx(K,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!D&&k&&o.jsx(K,{className:"pkt-input-icon",name:k}),!D&&rt&&o.jsx(K,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});mn.displayName="PktTextinput";const ar=h.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:e=1280,children:t,className:i,compact:n=!1,"data-mode":r,logOutButtonPlacement:a="none",logOut:l,openedMenu:d,showSearch:p=!1,onSearch:m,onSearchChange:v,searchValue:y,searchPlaceholder:k="Søk",representing:g,serviceLink:$,serviceClick:C,serviceName:M,user:S,userMenu:E,userMenuFooter:T,userOptions:V,canChangeRepresentation:G=!1,changeRepresentation:ie,hideLogo:we=!1,logoLink:D,logoClick:N,position:j="fixed",scrollBehavior:J="hide",slotMenuVariant:X="icon-only",slotMenuText:ne="Meny"},ae)=>{const pe=j==="fixed",oe=J==="hide";h.useEffect(()=>{T&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[T]),h.useEffect(()=>{V&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[V]),h.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),g!=null&&g.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,g==null?void 0:g.shortname]);const ve=h.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[z,Y]=h.useState(d||"none");h.useEffect(()=>{d!==void 0&&Y(d)},[d]);const[Ee,le]=h.useState(!1),[re,Ge]=h.useState(0),[Ve,Ne]=h.useState(!1),[Xe,rt]=h.useState(!1),xe=h.useRef(null),Se=h.useRef(null),Pe=h.useRef(null),Ue=h.useRef(null),at=h.useRef(null),be=h.useRef(null),ke=h.useRef(null),W=h.useRef(!1),de=pm(xe),Z=de<s,te=de<e,ut=h.useCallback(u=>{xe.current=u,typeof ae=="function"?ae(u):ae&&(ae.current=u)},[ae]);fm(pe&&Z&&z!=="none");const Be=h.useCallback((u,_)=>{const x=u.relatedTarget;let B;switch(_){case"user":B=Se;break;case"slot":B=Pe;break;case"search":B=Ue;break;default:return}const U=B.current;U&&(!x||!U.contains(x))&&Y("none")},[]),je=h.useCallback(()=>{W.current&&ke.current&&document.contains(ke.current)&&ke.current.focus(),ke.current=null,W.current=!1},[]);h.useEffect(()=>{const u=x=>{S&&z==="user"&&!x.target.closest(".pkt-header-service__user-container")&&Y("none"),z==="slot"&&!x.target.closest(".pkt-header-service__slot-container")&&Y("none"),z==="search"&&!x.target.closest(".pkt-header-service__search-container")&&!x.target.closest(".pkt-header-service__search-input")&&Y("none")},_=x=>{x.key==="Escape"&&z!=="none"&&(x.preventDefault(),W.current=!0,Y("none"))};if(z!=="none")return document.addEventListener("mousedown",u),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",_)};je()},[z,S,je]),h.useEffect(()=>{const u=()=>{if(oe){const _=window.pageYOffset||document.documentElement.scrollTop;if(_<0||Math.abs(_-re)<60)return;le(_>re),Ge(_)}};return document&&window.addEventListener("scroll",u),()=>{document&&window.removeEventListener("scroll",u)}},[oe,re]);const yt=h.useCallback(u=>{const _=u==="slot"?Pe:Ue,x=u==="slot"?at:be;if(!_.current||!x.current||!te||Z)return;const B=_.current.getBoundingClientRect(),U=x.current.offsetWidth,ee=B.left+U>window.innerWidth;u==="slot"?Ne(ee):rt(ee)},[te,Z]),zt=h.useCallback(u=>{z!=="none"?Y("none"):(ke.current=document.activeElement,Y(u))},[z]);h.useEffect(()=>{(z==="slot"||z==="search")&&requestAnimationFrame(()=>{yt(z)})},[z,yt]);const f=o.jsxs("header",{className:ce("pkt-header-service",n&&"pkt-header-service--compact",Z&&"pkt-header-service--mobile",te&&"pkt-header-service--tablet",pe&&"pkt-header-service--fixed",oe&&"pkt-header-service--scroll-to-hide",Ee&&"pkt-header-service--hidden",i),"data-mode":r,ref:ut,children:[o.jsxs("div",{className:ce("pkt-header-service__logo-area",(!M||M==="")&&"pkt-header-service__logo-area--without-service"),children:[!we&&o.jsx("span",{className:"pkt-header-service__logo",children:D?o.jsx("a",{href:D,"aria-label":"Tilbake til forside",children:o.jsx(K,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.1/logos/"})}):N?o.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:N,children:o.jsx(K,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.1/logos/"})}):o.jsx(K,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/15.1/logos/"})}),M&&o.jsx("span",{className:"pkt-header-service__service-name",children:$?o.jsx(pn,{href:$,className:"pkt-header-service__service-link ",children:M}):C?o.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:C,children:M}):o.jsx("span",{className:"pkt-header-service__service-link",children:M})})]}),o.jsxs("div",{className:"pkt-header-service__content",children:[o.jsxs("div",{className:ce("pkt-header-service__slot-container",z==="slot"&&"is-open"),onBlur:u=>Be(u,"slot"),ref:Pe,children:[te&&t&&o.jsx(it,{skin:"secondary",variant:X,iconName:"menu",size:Z?"small":"medium",state:z==="slot"?"active":"normal",onClick:()=>zt("slot"),"aria-expanded":z==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:ne}),o.jsx("div",{className:ce("pkt-header-service__slot-content",Ve&&"align-right"),id:"mobile-slot-menu",role:te?"menu":void 0,"aria-label":te?"Meny":void 0,ref:at,children:o.jsx("div",{className:"pkt-contents",children:t})})]}),p&&o.jsx(o.Fragment,{children:te?o.jsxs("div",{className:ce("pkt-header-service__search-container",z==="search"&&"is-open"),onBlur:u=>Be(u,"search"),ref:Ue,children:[o.jsx(it,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:Z?"small":"medium",onClick:()=>zt("search"),state:z==="search"?"active":"normal","aria-expanded":z==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),o.jsx("div",{className:ce("pkt-header-service__mobile-menu",z==="search"&&"is-open",Xe&&"align-right"),ref:be,children:z==="search"&&o.jsx(mn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,autoFocus:!0,fullwidth:!0,onChange:u=>v==null?void 0:v(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})})]}):o.jsx(mn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:k,value:y,onChange:u=>v==null?void 0:v(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(m==null||m(u.target.value))}})}),te&&l&&(a==="header"||a==="both")&&o.jsx(it,{skin:"secondary",size:Z?"small":"medium",variant:"icon-only",iconName:"exit",onClick:l,children:"Logg ut"})]}),o.jsxs("div",{className:"pkt-header-service__user",children:[S&&o.jsxs("div",{className:"pkt-header-service__user-container",onBlur:u=>Be(u,"user"),ref:Se,children:[o.jsxs(it,{className:ce("pkt-header-service__user-button",Z&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:Z?"small":"medium",state:z==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:z==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>zt("user"),children:[o.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(g==null?void 0:g.name)||S.name]}),z==="user"&&S&&o.jsx("div",{className:ce(Z?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:o.jsx(vo,{user:S,formattedLastLoggedIn:ve,representing:g,userMenu:E,canChangeRepresentation:G,changeRepresentation:ie,logoutOnClick:a==="userMenu"||a==="both"?l:void 0})})]}),!Z&&l&&(a==="header"||a==="both")&&o.jsx(it,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:l,children:"Logg ut"})]})]});return pe?o.jsxs("div",{className:"pkt-header-service-wrapper",children:[f,o.jsx("div",{className:ce("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",Z&&"pkt-header-service-spacer--mobile",te&&"pkt-header-service-spacer--tablet")})]}):f});ar.displayName="PktHeaderService";const bo=h.forwardRef((s,e)=>o.jsx(ar,{...s,ref:e}));bo.displayName="PktHeader";const vm=It({tagName:"pkt-heading",elementClass:is,react:h,displayName:"PktHeading"}),yo=h.forwardRef(({children:s,...e},t)=>o.jsx(vm,{"data-testid":"pkt-heading",...e,ref:t,children:s}));yo.displayName="PktHeading";const bm=It({tagName:"pkt-helptext",elementClass:Kt,react:h,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),ko=h.forwardRef(({children:s,...e},t)=>o.jsx(bm,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));ko.displayName="PktHelptext";const _o=h.forwardRef(({label:s,id:e,children:t,...i},n)=>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,...i,ref:n}),t]}));_o.displayName="PktInput";const $o=({children:s,skin:e,title:t,href:i,iconName:n,openInNewTab:r,external:a,className:l,...d})=>{const p=["pkt-linkcard",e&&`pkt-linkcard--${e}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",a&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return o.jsxs("a",{...d,href:i,className:ce(p,l),target:r?"_blank":"_self",rel:r?"noopener noreferrer":void 0,children:[n&&o.jsx(K,{className:"pkt-link__icon",name:n}),t&&o.jsx("div",{className:ce(m),children:t}),o.jsx("div",{className:"pkt-linkcard__text",children:s})]})};$o.displayName="PktLinkCard";const ym=It({tagName:"pkt-loader",elementClass:Pt,react:h,displayName:"PktLoader",events:{}}),wo=h.forwardRef(({children:s,...e},t)=>o.jsx(ym,{...e,ref:t,children:o.jsx("div",{className:"pkt-contents",children:s})}));wo.displayName="PktLoader";const xo=({children:s,className:e,skin:t,title:i,compact:n,closable:r,onClose:a,...l})=>{const[d,p]=h.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${t}`]:t,"pkt-messagebox--closable":r,"pkt-hide":d},v=h.createRef(),y=h.useCallback(()=>{p(!0),a&&a()},[p,a]);return o.jsxs("div",{...l,className:ce(m,e),ref:v,children:[r&&o.jsx("div",{className:"pkt-messagebox__close",children:o.jsx("button",{onClick:y,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:o.jsx(K,{name:"close",className:"pkt-link__icon"})})}),i&&o.jsx("div",{className:"pkt-messagebox__title",children:i}),o.jsx("div",{className:"pkt-messagebox__text",children:s})]})};xo.displayName="PktMessagebox";const km=It({tagName:"pkt-progressbar",elementClass:Le,react:h,displayName:"PktProgressbar",events:{}}),gn=h.forwardRef(({children:s,...e},t)=>o.jsx(km,{ref:t,...e,children:o.jsx("div",{className:"pkt-contents",children:s})}));gn.displayName="PktProgressbar";const So=h.forwardRef(({id:s,name:e,label:t,className:i,hasTile:n=!1,disabled:r=!1,checkHelptext:a,hasError:l=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:v,requiredTag:y,requiredText:k,tagText:g,...$},C)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",r&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),E=["pkt-input-check__input-checkbox",l?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),T=["pkt-input-check__input-label",r?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),V=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),G=()=>o.jsxs(o.Fragment,{children:[g&&o.jsx("span",{className:V+" pkt-tag--gray",children:g}),m&&o.jsx("span",{className:V+" pkt-tag--blue-light",children:v}),y&&o.jsx("span",{className:V+" pkt-tag--beige",children:k})]});return o.jsx("div",{className:M,children:o.jsxs("div",{className:S,children:[o.jsx("input",{ref:C,id:s,type:"radio",name:e,disabled:r,className:E,...p!==void 0?{checked:p}:{defaultChecked:d},...$}),o.jsxs("label",{className:T,htmlFor:s,children:[t," ",G(),a&&o.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});So.displayName="PktRadioButton";const Co=h.forwardRef(({appearance:s="local",disabled:e=!1,fullwidth:t=!1,id:i,label:n,name:r,placeholder:a="Søk…",suggestions:l,value:d="",action:p,method:m,onChange:v,onSearch:y,onSuggestionClick:k,...g},$)=>{const C=(T,V)=>{T?T():k&&k(V)},M=T=>{d=T.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${t?"pkt-searchinput--fullwidth":""}`;let E;return p?E=T=>o.jsx("form",{role:"search",className:S,action:p,method:m,children:T}):E=T=>o.jsx("div",{role:"search",className:S,children:T}),E(o.jsxs(o.Fragment,{children:[n&&o.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),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||i,id:i,placeholder:a,defaultValue:d,disabled:e,autoComplete:"off","aria-autocomplete":"list",ref:$,"aria-controls":`${i}-suggestions`,onChange:v||M,onKeyUp:y&&(T=>{T.key==="Enter"&&(T.preventDefault(),y(d))}),...g}),o.jsx(it,{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:y&&(T=>{T.preventDefault(),y(d)}),children:n||a})]}),l&&o.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:l.map((T,V)=>o.jsx("li",{children:h.createElement(T.href?"a":T.onClick?"button":"div",{href:T.href,className:`pkt-searchinput__suggestion ${T.onClick?"pkt-link-button":""} ${T.href||T.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:T.onClick?"button":void 0,onClick:()=>C(T.onClick,V),onKeyUp:G=>G.key==="Enter"&&C(T.onClick,V)},o.jsxs(o.Fragment,{children:[T.title&&o.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:T.title}),T.text&&o.jsx("p",{className:"pkt-searchinput__suggestion-text",children:T.text})]}))},`search-suggestion-${V}`))})]}))});Co.displayName="PktSearchInput";const To=h.forwardRef(({ariaDescribedby:s,ariaLabelledby:e,children:t,className:i,disabled:n=!1,errorMessage:r,hasError:a,helptext:l,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:y=!1,label:k,name:g,optionalTag:$=!1,optionalText:C,requiredTag:M=!1,requiredText:S,tagText:E,...T},V)=>{const G=[i,"pkt-select"].join(" ");return o.jsx(Es,{className:G,forId:`${m}-input`,label:k,helptext:l,helptextDropdown:d,helptextDropdownButton:p,optionalTag:$,optionalText:C,requiredTag:M,requiredText:S,tagText:E,hasError:a,errorMessage:r,disabled:n,inline:v,ariaDescribedby:s,children:o.jsx("select",{ref:V,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":a,"aria-errormessage":`${m}-error`,"aria-labelledby":e||void 0,disabled:n,id:`${m}-input`,name:g||m,...T,children:t})})});To.displayName="PktSelect";const _m=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)"}})}),$m=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"})]}),wm=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"})]}),xm=({children:s,className:e,status:t="incomplete",title:i})=>o.jsxs("li",{className:ce("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:ce("pkt-step__indicator"),children:t==="current"?$m:t==="completed"?wm:_m}),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:i}),o.jsx("div",{className:"pkt-step__content",children:s})]})]}),No=h.forwardRef(({activeStep:s,className:e,children:t,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:r="vertical",...a},l)=>{const d=ce(e,"pkt-stepper",r==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=h.Children.map(t,(m,v)=>h.isValidElement(m)?h.cloneElement(m,{className:ce(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return o.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:l,...a,children:p})});No.displayName="PktStepper";const Sm=({className:s,compact:e=!1,skin:t="basic",responsiveView:i=!0,children:n,...r})=>o.jsx("table",{"data-testid":"pkt-table",className:ce(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":e,"pkt-table--basic":t==="basic","pkt-table--zebra-blue":t==="zebra-blue"}),role:"table",...r,children:n}),Cm=({id:s,children:e,className:t,...i})=>o.jsx("tbody",{id:s,className:ce(t,"pkt-table__body",{}),...i,role:"rowgroup",children:e}),Tm=({children:s,className:e,dataLabel:t,...i})=>o.jsx("td",{className:ce(e,"pkt-table__data-cell",{}),"data-label":t,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Nm=({className:s,children:e,...t})=>o.jsx("thead",{className:ce(s,"pkt-table__header",{}),role:"rowgroup",...t,children:e}),Mm=({className:s,children:e,...t})=>o.jsx("th",{className:ce(s,"pkt-table__header-cell",{}),role:"columnheader",...t,children:e}),Dm=({className:s,children:e,...t})=>o.jsx("tr",{className:ce(s,"pkt-table__row",{}),role:"row",...t,children:e}),or=h.forwardRef(({children:s,active:e,href:t,onClick:i,icon:n,controls:r,tag:a,tagSkin:l,index:d=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:y,selectTab:k}=Om(),$={"aria-selected":m?!!e:void 0,"aria-controls":r,role:m?"tab":void 0,onKeyUp:M=>y(d,M),onClick:M=>{k(d),i==null||i(M)},tabIndex:e||!m?void 0:-1,ref:M=>{v(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},C=o.jsxs(o.Fragment,{children:[n&&o.jsx(K,{name:n,className:"pkt-icon--small"}),s,a&&o.jsx(un,{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})});or.displayName="PktTabItem";const Mo=h.createContext(null),Om=()=>{const s=h.useContext(Mo);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},Do=h.forwardRef(({arrowNav:s=!0,disableArrowNav:e=!1,tabs:t,onTabSelected:i,children:n},r)=>{const a=h.useRef([]),l=s&&!e,p=n&&h.Children.count(n)>0?h.Children.count(n):(t==null?void 0:t.length)||0;h.useEffect(()=>{a.current=a.current.slice(0,p)},[p]);const m=g=>{const $=t==null?void 0:t[g];$!=null&&$.action&&$.action(g),i&&i(g)},v=(g,$)=>{var C,M;l&&($.code==="ArrowLeft"&&g!==0&&((C=a.current[g-1])==null||C.focus()),$.code==="ArrowRight"&&g<p-1&&((M=a.current[g+1])==null||M.focus()),($.code==="ArrowDown"||$.code==="Space")&&m(g))},y=(g,$)=>{a.current[g]=$},k=t==null?void 0:t.map((g,$)=>{var C,M;return o.jsx(or,{active:g.active,href:g.href,onClick:()=>m($),icon:g.icon,controls:g.controls,tag:(C=g.tag)==null?void 0:C.text,tagSkin:(M=g.tag)==null?void 0:M.skin,index:$,children:g.text},$)});return o.jsx(Mo.Provider,{value:{arrowNav:l,registerTabRef:y,handleKeyPress:v,selectTab:m},children:o.jsx("div",{className:"pkt-tabs",ref:r,children:o.jsx("div",{className:"pkt-tabs__list",role:l?"tablist":"navigation",children:n||k})})})});Do.displayName="PktTabs";var ei=window.CustomEvent;(!ei||typeof ei=="object")&&(ei=function(s,e){e=e||{};var t=document.createEvent("CustomEvent");return t.initCustomEvent(s,!!e.bubbles,!!e.cancelable,e.detail||null),t},ei.prototype=window.Event.prototype);function Oo(s,e){var t="on"+e.type.toLowerCase();return typeof s[t]=="function"&&s[t](e),s.dispatchEvent(e)}function Em(s){for(;s&&s!==document.body;){var e=window.getComputedStyle(s),t=function(i,n){return!(e[i]===void 0||e[i]===n)};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 Li(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 Eo(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function Pm(s,e){for(var t=0;t<s.length;++t)if(s[t]===e)return!0;return!1}function lr(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Po(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 i=s.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),r=0;r<n.length&&!(n[r].tagName&&n[r].shadowRoot&&(i=Po(n[r].shadowRoot),i));r++);return i}function Ao(s){return s.isConnected||document.body.contains(s)}function Io(s){if(s.submitter)return s.submitter;var e=s.target;if(!(e instanceof HTMLFormElement))return null;var t=ue.formSubmitter;if(!t){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;t=n.activeElement}return!t||t.form!==e?null:t}function Am(s){if(!s.defaultPrevented){var e=s.target,t=ue.imagemapUseValue,i=Io(s);t===null&&i&&(t=i.value);var n=Li(e);if(n){var r=i&&i.getAttribute("formmethod")||e.getAttribute("method");r==="dialog"&&(s.preventDefault(),t!=null?n.close(t):n.close())}}}function Lo(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",Am,!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,i=(function(){t?this.downgradeModal():this.maybeHideModal(),t=!1}).bind(this),n,r=function(a){if(a.target===s){var l="DOMNodeRemoved";t|=a.type.substr(0,l.length)===l,window.clearTimeout(n),n=window.setTimeout(i,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))}Lo.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Ao(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_),ue.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=Po(this.dialog_)),Eo(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(!Ao(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!ue.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Em(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,ue.needsCentering(this.dialog_)?(ue.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 ei("close",{bubbles:!1,cancelable:!1});Oo(this.dialog_,e)}};var ue={};if(ue.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"},ue.isInlinePositionSetByStylesheet=function(s){for(var e=0;e<document.styleSheets.length;++e){var t=document.styleSheets[e],i=null;try{i=t.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var r=i[n],a=null;try{a=document.querySelectorAll(r.selectorText)}catch{}if(!(!a||!Pm(a,s))){var l=r.style.getPropertyValue("top"),d=r.style.getPropertyValue("bottom");if(l&&l!=="auto"||d&&d!=="auto")return!0}}}return!1},ue.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:!ue.isInlinePositionSetByStylesheet(s)},ue.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 Lo(s)},ue.registerDialog=function(s){s.showModal||ue.forceRegisterDialog(s)},ue.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(i){for(var n=0,r;r=i.removedNodes[n];++n){if(r instanceof Element)r.localName==="dialog"&&t.push(r);else continue;t=t.concat(r.querySelectorAll("dialog"))}}),t.length&&s(t)}))},ue.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})},ue.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},ue.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 i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},ue.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Li(s);){for(var e=0,t;t=this.pendingDialogStack[e];++e)if(t.dialog===s)return e===0;s=s.parentElement}return!1},ue.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(),Eo(e),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],i=t.dialog,n=i.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e!==document.documentElement&&document.documentElement.focus()),!1}},ue.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var e=new ei("cancel",{bubbles:!1,cancelable:!0}),t=this.pendingDialogStack[0];t&&Oo(t.dialog,e)&&t.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},ue.DialogManager.prototype.checkDOM_=function(s){var e=this.pendingDialogStack.slice();e.forEach(function(t){s.indexOf(t.dialog)!==-1?t.downgradeModal():t.maybeHideModal()})},ue.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)},ue.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())},ue.dm=new ue.DialogManager,ue.formSubmitter=null,ue.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Bo=document.createElement("form");if(Bo.setAttribute("method","dialog"),Bo.method!=="dialog"){var ti=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(ti){var Im=ti.get;ti.get=function(){return lr(this)?"dialog":Im.call(this)};var Lm=ti.set;ti.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):Lm.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",ti)}}document.addEventListener("click",function(s){if(ue.formSubmitter=null,ue.imagemapUseValue=null,!s.defaultPrevented){var e=s.target;if("composedPath"in s){var t=s.composedPath();e=t.shift()||e}if(!(!e||!lr(e.form))){var i=e.type==="submit"&&["button","input"].indexOf(e.localName)>-1;if(!i){if(!(e.localName==="input"&&e.type==="image"))return;ue.imagemapUseValue=s.offsetX+","+s.offsetY}var n=Li(e);n&&(ue.formSubmitter=e)}}},!1),document.addEventListener("submit",function(s){var e=s.target,t=Li(e);if(!t){var i=Io(s),n=i&&i.getAttribute("formmethod")||e.getAttribute("method");n==="dialog"&&s.preventDefault()}});var Bm=HTMLFormElement.prototype.submit,Fm=function(){if(!lr(this))return Bm.call(this);var s=Li(this);s&&s.close()};HTMLFormElement.prototype.submit=Fm}const Hm=Object.freeze(Object.defineProperty({__proto__:null,default:ue},Symbol.toStringTag,{value:"Module"}));I.PktAccordion=ur,I.PktAccordionItem=Ma,I.PktAlert=an,I.PktBackLink=Oa,I.PktBreadcrumbs=Ea,I.PktButton=it,I.PktCalendar=er,I.PktCard=io,I.PktCheckbox=no,I.PktCombobox=ro,I.PktConsent=cn,I.PktDatepicker=lo,I.PktFileUpload=go,I.PktFooter=um,I.PktFooterSimple=hm,I.PktHeader=bo,I.PktHeaderService=ar,I.PktHeading=yo,I.PktHelptext=ko,I.PktIcon=K,I.PktInput=_o,I.PktInputWrapper=Es,I.PktLink=pn,I.PktLinkCard=$o,I.PktLoader=wo,I.PktMessagebox=xo,I.PktModal=ir,I.PktProgressbar=gn,I.PktRadioButton=So,I.PktSearchInput=Co,I.PktSelect=To,I.PktStep=xm,I.PktStepper=No,I.PktTabItem=or,I.PktTable=Sm,I.PktTableBody=Cm,I.PktTableDataCell=Tm,I.PktTableHeader=Nm,I.PktTableHeaderCell=Mm,I.PktTableRow=Dm,I.PktTabs=Do,I.PktTag=un,I.PktTextarea=sr,I.PktTextinput=mn,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
|