@oslokommune/punkt-react 14.2.0 → 14.3.1
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 +36 -0
- package/dist/index.d.ts +15 -6
- package/dist/punkt-react.es.js +2563 -2545
- package/dist/punkt-react.umd.js +275 -273
- package/package.json +3 -3
- package/src/components/header/HeaderService.tsx +10 -6
- package/src/components/header/types.ts +25 -6
package/dist/punkt-react.umd.js
CHANGED
|
@@ -33,73 +33,73 @@
|
|
|
33
33
|
return [];
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
(function(P,l){typeof exports=="object"&&typeof module<"u"?l(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"],l):(P=typeof globalThis<"u"?globalThis:P||self,l(P["punkt-react"]={},P.ReactJsxRuntime,P.React,P.ReactRouterDOM))})(this,(function(P,l,
|
|
36
|
+
(function(P,l){typeof exports=="object"&&typeof module<"u"?l(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"],l):(P=typeof globalThis<"u"?globalThis:P||self,l(P["punkt-react"]={},P.ReactJsxRuntime,P.React,P.ReactRouterDOM))})(this,(function(P,l,w,dn){"use strict";const un=w.createContext({}),tr=()=>w.useContext(un),pn=w.forwardRef(({compact:s=!1,skin:t="borderless",ariaLabelledBy:e,children:i,name:n,className:a},r)=>{const h=["pkt-accordion",s&&"pkt-accordion--compact",t&&`pkt-accordion--${t}`,a].filter(Boolean).join(" ");return l.jsx(un.Provider,{value:{name:n},children:l.jsx("div",{ref:r,className:h,"data-testid":"pkt-accordion","aria-labelledby":e||void 0,children:i})})});pn.displayName="PktAccordion";/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2018 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/const er=new Set(["children","localName","ref","style","className"]),fn=new WeakMap,gn=(s,t,e,i,n)=>{const a=n==null?void 0:n[t];a===void 0?(s[t]=e,e==null&&t in HTMLElement.prototype&&s.removeAttribute(t)):e!==i&&((r,h,c)=>{let p=fn.get(r);p===void 0&&fn.set(r,p=new Map);let
|
|
40
|
+
*/const er=new Set(["children","localName","ref","style","className"]),fn=new WeakMap,gn=(s,t,e,i,n)=>{const a=n==null?void 0:n[t];a===void 0?(s[t]=e,e==null&&t in HTMLElement.prototype&&s.removeAttribute(t)):e!==i&&((r,h,c)=>{let p=fn.get(r);p===void 0&&fn.set(r,p=new Map);let v=p.get(h);c!==void 0?v===void 0?(p.set(h,v={handleEvent:c}),r.addEventListener(h,v)):v.handleEvent=c:v!==void 0&&(p.delete(h),r.removeEventListener(h,v))})(s,a,e)},Jt=({react:s,tagName:t,elementClass:e,events:i,displayName:n})=>{const a=new Set(Object.keys(i??{})),r=s.forwardRef(((h,c)=>{const p=s.useRef(new Map),v=s.useRef(null),m={},y={};for(const[$,b]of Object.entries(h))er.has($)?m[$==="className"?"class":$]=b:a.has($)||$ in e.prototype?y[$]=b:m[$]=b;return s.useLayoutEffect((()=>{if(v.current===null)return;const $=new Map;for(const b in y)gn(v.current,b,h[b],p.current.get(b),i),p.current.delete(b),$.set(b,h[b]);for(const[b,x]of p.current)gn(v.current,b,void 0,x,i);p.current=$})),s.useLayoutEffect((()=>{var $;($=v.current)==null||$.removeAttribute("defer-hydration")}),[]),m.suppressHydrationWarning=!0,s.createElement(t,{...m,ref:s.useCallback(($=>{v.current=$,typeof c=="function"?c($):c!==null&&(c.current=$)}),[c])})}));return r.displayName=n??e.name,r};/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/const oi=globalThis,li=oi.trustedTypes,mn=li?li.createPolicy("lit-html",{createHTML:s=>s}):void 0,vn="$lit$",
|
|
45
|
-
\f\r]`,Ms=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kn=/-->/g,yn=/>/g,
|
|
46
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),$n=/'/g,_n=/"/g,wn=/^(?:script|style|textarea|title)$/i,nr=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),
|
|
44
|
+
*/const oi=globalThis,li=oi.trustedTypes,mn=li?li.createPolicy("lit-html",{createHTML:s=>s}):void 0,vn="$lit$",Se=`lit$${Math.random().toFixed(9).slice(2)}$`,bn="?"+Se,sr=`<${bn}>`,Ie=document,Ns=()=>Ie.createComment(""),Es=s=>s===null||typeof s!="object"&&typeof s!="function",Pi=Array.isArray,ir=s=>Pi(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",Di=`[
|
|
45
|
+
\f\r]`,Ms=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kn=/-->/g,yn=/>/g,Le=RegExp(`>|${Di}(?:([^\\s"'>=/]+)(${Di}*=${Di}*(?:[^
|
|
46
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),$n=/'/g,_n=/"/g,wn=/^(?:script|style|textarea|title)$/i,nr=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),u=nr(1),Et=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),xn=new WeakMap,Be=Ie.createTreeWalker(Ie,129);function Sn(s,t){if(!Pi(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return mn!==void 0?mn.createHTML(t):t}const ar=(s,t)=>{const e=s.length-1,i=[];let n,a=t===2?"<svg>":t===3?"<math>":"",r=Ms;for(let h=0;h<e;h++){const c=s[h];let p,v,m=-1,y=0;for(;y<c.length&&(r.lastIndex=y,v=r.exec(c),v!==null);)y=r.lastIndex,r===Ms?v[1]==="!--"?r=kn:v[1]!==void 0?r=yn:v[2]!==void 0?(wn.test(v[2])&&(n=RegExp("</"+v[2],"g")),r=Le):v[3]!==void 0&&(r=Le):r===Le?v[0]===">"?(r=n??Ms,m=-1):v[1]===void 0?m=-2:(m=r.lastIndex-v[2].length,p=v[1],r=v[3]===void 0?Le:v[3]==='"'?_n:$n):r===_n||r===$n?r=Le:r===kn||r===yn?r=Ms:(r=Le,n=void 0);const $=r===Le&&s[h+1].startsWith("/>")?" ":"";a+=r===Ms?c+sr:m>=0?(i.push(p),c.slice(0,m)+vn+c.slice(m)+Se+$):c+Se+(m===-2?h:$)}return[Sn(s,a+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let Ii=class Ja{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let a=0,r=0;const h=t.length-1,c=this.parts,[p,v]=ar(t,e);if(this.el=Ja.createElement(p,i),Be.currentNode=this.el.content,e===2||e===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(n=Be.nextNode())!==null&&c.length<h;){if(n.nodeType===1){if(n.hasAttributes())for(const m of n.getAttributeNames())if(m.endsWith(vn)){const y=v[r++],$=n.getAttribute(m).split(Se),b=/([.?@])?(.*)/.exec(y);c.push({type:1,index:a,name:b[2],strings:$,ctor:b[1]==="."?or:b[1]==="?"?lr:b[1]==="@"?hr:ci}),n.removeAttribute(m)}else m.startsWith(Se)&&(c.push({type:6,index:a}),n.removeAttribute(m));if(wn.test(n.tagName)){const m=n.textContent.split(Se),y=m.length-1;if(y>0){n.textContent=li?li.emptyScript:"";for(let $=0;$<y;$++)n.append(m[$],Ns()),Be.nextNode(),c.push({type:2,index:++a});n.append(m[y],Ns())}}}else if(n.nodeType===8)if(n.data===bn)c.push({type:2,index:a});else{let m=-1;for(;(m=n.data.indexOf(Se,m+1))!==-1;)c.push({type:7,index:a}),m+=Se.length-1}a++}}static createElement(t,e){const i=Ie.createElement("template");return i.innerHTML=t,i}};function ss(s,t,e=s,i){var n,a;if(t===Et)return t;let r=i!==void 0?(n=e._$Co)==null?void 0:n[i]:e._$Cl;const h=Es(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==h&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),h===void 0?r=void 0:(r=new h(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=ss(s,r._$AS(s,t.values),r,i)),t}let rr=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,n=((t==null?void 0:t.creationScope)??Ie).importNode(e,!0);Be.currentNode=n;let a=Be.nextNode(),r=0,h=0,c=i[0];for(;c!==void 0;){if(r===c.index){let p;c.type===2?p=new hi(a,a.nextSibling,this,t):c.type===1?p=new c.ctor(a,c.name,c.strings,this,t):c.type===6&&(p=new cr(a,this,t)),this._$AV.push(p),c=i[++h]}r!==(c==null?void 0:c.index)&&(a=Be.nextNode(),r++)}return Be.currentNode=Ie,n}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},hi=class Qa{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ss(this,t,e),Es(t)?t===k||t==null||t===""?(this._$AH!==k&&this._$AR(),this._$AH=k):t!==this._$AH&&t!==Et&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ir(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==k&&Es(this._$AH)?this._$AA.nextSibling.data=t:this.T(Ie.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,a=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Ii.createElement(Sn(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)==null?void 0:e._$AD)===a)this._$AH.p(i);else{const r=new rr(a,this),h=r.u(this.options);r.p(i),this.T(h),this._$AH=r}}_$AC(t){let e=xn.get(t.strings);return e===void 0&&xn.set(t.strings,e=new Ii(t)),e}k(t){Pi(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const a of t)n===e.length?e.push(i=new Qa(this.O(Ns()),this.O(Ns()),this,this.options)):i=e[n],i._$AI(a),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},ci=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,a){this.type=1,this._$AH=k,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=k}_$AI(t,e=this,i,n){const a=this.strings;let r=!1;if(a===void 0)t=ss(this,t,e,0),r=!Es(t)||t!==this._$AH&&t!==Et,r&&(this._$AH=t);else{const h=t;let c,p;for(t=a[0],c=0;c<a.length-1;c++)p=ss(this,h[i+c],e,c),p===Et&&(p=this._$AH[c]),r||(r=!Es(p)||p!==this._$AH[c]),p===k?t=k:t!==k&&(t+=(p??"")+a[c+1]),this._$AH[c]=p}r&&!n&&this.j(t)}j(t){t===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},or=class extends ci{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===k?void 0:t}};class lr extends ci{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==k)}}let hr=class extends ci{constructor(t,e,i,n,a){super(t,e,i,n,a),this.type=5}_$AI(t,e=this){if((t=ss(this,t,e,0)??k)===Et)return;const i=this._$AH,n=t===k&&i!==k||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==k&&(i===k||n);n&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}},cr=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){ss(this,t)}};const dr={I:hi},Cn=oi.litHtmlPolyfillSupport;Cn==null||Cn(Ii,hi),(oi.litHtmlVersions??(oi.litHtmlVersions=[])).push("3.3.1");const ur=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let n=i._$litPart$;if(n===void 0){const a=(e==null?void 0:e.renderBefore)??null;i._$litPart$=n=new hi(t.insertBefore(Ns(),a),a,void 0,e??{})}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 V=s=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(s,t)})):customElements.define(s,t)};/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2019 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const di=globalThis,
|
|
54
|
+
*/const di=globalThis,Li=di.ShadowRoot&&(di.ShadyCSS===void 0||di.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Tn=Symbol(),Nn=new WeakMap;let pr=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Tn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Li&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Nn.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Nn.set(e,t))}return t}toString(){return this.cssText}};const fr=s=>new pr(typeof s=="string"?s:s+"",void 0,Tn),gr=(s,t)=>{if(Li)s.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const i=document.createElement("style"),n=di.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}},En=Li?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return fr(e)})(s):s;/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/const{is:mr,defineProperty:vr,getOwnPropertyDescriptor:br,getOwnPropertyNames:kr,getOwnPropertySymbols:yr,getPrototypeOf:$r}=Object,
|
|
58
|
+
*/const{is:mr,defineProperty:vr,getOwnPropertyDescriptor:br,getOwnPropertyNames:kr,getOwnPropertySymbols:yr,getPrototypeOf:$r}=Object,is=globalThis,Mn=is.trustedTypes,_r=Mn?Mn.emptyScript:"",An=is.reactiveElementPolyfillSupport,As=(s,t)=>s,ui={toAttribute(s,t){switch(t){case Boolean:s=s?_r:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Bi=(s,t)=>!mr(s,t),On={attribute:!0,type:String,converter:ui,reflect:!1,useDefault:!1,hasChanged:Bi};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),is.litPropertyMetadata??(is.litPropertyMetadata=new WeakMap);let ns=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=On){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);n!==void 0&&vr(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:a}=br(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:n,set(r){const h=n==null?void 0:n.call(this);a==null||a.call(this,r),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??On}static _$Ei(){if(this.hasOwnProperty(As("elementProperties")))return;const t=$r(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(As("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(As("properties"))){const e=this.properties,i=[...kr(e),...yr(e)];for(const n of i)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,n]of e)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const n=this._$Eu(e,i);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const n of i)e.unshift(En(n))}else t!==void 0&&e.push(En(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gr(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var i;const n=this.constructor.elementProperties.get(t),a=this.constructor._$Eu(t,n);if(a!==void 0&&n.reflect===!0){const r=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:ui).toAttribute(e,n.type);this._$Em=t,r==null?this.removeAttribute(a):this.setAttribute(a,r),this._$Em=null}}_$AK(t,e){var i,n;const a=this.constructor,r=a._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const h=a.getPropertyOptions(r),c=typeof h.converter=="function"?{fromAttribute:h.converter}:((i=h.converter)==null?void 0:i.fromAttribute)!==void 0?h.converter:ui;this._$Em=r;const p=c.fromAttribute(e,h.type);this[r]=p??((n=this._$Ej)==null?void 0:n.get(r))??p,this._$Em=null}}requestUpdate(t,e,i){var n;if(t!==void 0){const a=this.constructor,r=this[t];if(i??(i=a.getPropertyOptions(t)),!((i.hasChanged??Bi)(r,e)||i.useDefault&&i.reflect&&r===((n=this._$Ej)==null?void 0:n.get(t))&&!this.hasAttribute(a._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:n,wrapped:a},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),a!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),n===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,r]of this._$Ep)this[a]=r;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[a,r]of n){const{wrapped:h}=r,c=this[a];h!==!0||this._$AL.has(a)||c===void 0||this.C(a,void 0,r,c)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$EO)==null||t.forEach((n=>{var a;return(a=n.hostUpdate)==null?void 0:a.call(n)})),this.update(i)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};ns.elementStyles=[],ns.shadowRootOptions={mode:"open"},ns[As("elementProperties")]=new Map,ns[As("finalized")]=new Map,An==null||An({ReactiveElement:ns}),(is.reactiveElementVersions??(is.reactiveElementVersions=[])).push("2.1.1");/**
|
|
59
59
|
* @license
|
|
60
60
|
* Copyright 2017 Google LLC
|
|
61
61
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const wr={attribute:!0,type:String,converter:ui,reflect:!1,hasChanged:
|
|
62
|
+
*/const wr={attribute:!0,type:String,converter:ui,reflect:!1,hasChanged:Bi},xr=(s=wr,t,e)=>{const{kind:i,metadata:n}=e;let a=globalThis.litPropertyMetadata.get(n);if(a===void 0&&globalThis.litPropertyMetadata.set(n,a=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),a.set(e.name,s),i==="accessor"){const{name:r}=e;return{set(h){const c=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,c,s)},init(h){return h!==void 0&&this.C(r,void 0,s,h),h}}}if(i==="setter"){const{name:r}=e;return function(h){const c=this[r];t.call(this,h),this.requestUpdate(r,c,s)}}throw Error("Unsupported decorator location: "+i)};function o(s){return(t,e)=>typeof e=="object"?xr(s,t,e):((i,n,a)=>{const r=n.hasOwnProperty(a);return n.constructor.createProperty(a,i),r?Object.getOwnPropertyDescriptor(n,a):void 0})(s,t,e)}/**
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright 2017 Google LLC
|
|
65
65
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
-
*/const Os=globalThis;let
|
|
66
|
+
*/const Os=globalThis;let as=class extends ns{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ur(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return Et}};var Pn;as._$litElement$=!0,as.finalized=!0,(Pn=Os.litElementHydrateSupport)==null||Pn.call(Os,{LitElement:as});const Dn=Os.litElementPolyfillSupport;Dn==null||Dn({LitElement:as}),(Os.litElementVersions??(Os.litElementVersions=[])).push("4.2.1");const Sr={hi:"Hei!"},Cr={from:"Fra",to:"Til"},Tr={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Nr={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"},Er={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."}},Ct={example:Sr,generic:Cr,calendar:Tr,dates:Nr,forms:Er};var Mr=Object.defineProperty,In=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&Mr(t,e,n),n};let pi=class extends as{constructor(){super(...arguments),this.strings=Ct,this.role=null}hotReplacedCallback(){this.requestUpdate()}};In([o({type:Object})],pi.prototype,"strings"),In([o({type:String})],pi.prototype,"role");let X=class extends pi{createRenderRoot(){return this}};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/const Qt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},
|
|
70
|
+
*/const Qt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Fe=s=>(...t)=>({_$litDirective$:s,values:t});let rs=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2018 Google LLC
|
|
73
73
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
-
*/const N=
|
|
74
|
+
*/const N=Fe(class extends rs{constructor(s){var t;if(super(s),s.type!==Qt.ATTRIBUTE||s.name!=="class"||((t=s.strings)==null?void 0:t.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((t=>s[t])).join(" ")+" "}update(s,[t]){var e,i;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((a=>a!==""))));for(const a in t)t[a]&&!((e=this.nt)!=null&&e.has(a))&&this.st.add(a);return this.render(t)}const n=s.element.classList;for(const a of this.st)a in t||(n.remove(a),this.st.delete(a));for(const a in t){const r=!!t[a];r===this.st.has(a)||(i=this.nt)!=null&&i.has(a)||(r?(n.add(a),this.st.add(a)):(n.remove(a),this.st.delete(a)))}return Et}});/**
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright 2017 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
|
-
*/function
|
|
78
|
+
*/function I(s){return o({...s,state:!0,attribute:!1})}function Ln(s,t){return t.some(e=>e.value===s)}function Ps(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function os(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function Ar(s,t){return s.nodeType===Node.ELEMENT_NODE&&!Ln(s,t)}function Fi(s){var t;return s.nodeType===Node.TEXT_NODE&&((t=s.nodeValue)==null?void 0:t.trim())!==""}let ot=class{constructor(t,...e){this.nodes=[],this.filledSlots=new Set,this.skipOptions=!1,this.updatingSlots=!1,this.host=t,this.host.addController(this),this.slots=e,this.nodes=[],this.observer=new MutationObserver(i=>this.handleMutations(i)),this.contentObserver=new MutationObserver(i=>this.handleSlotMutations(i))}hostConnected(){this.updateNodes(),this.observer.observe(this.host,{childList:!0}),this.contentObserver.observe(this.host,{childList:!0,subtree:!0})}hostDisconnected(){this.observer.disconnect(),this.contentObserver.disconnect()}hostUpdated(){this.updateSlots()}updateNodes(){this.nodes=[],Array.from(this.host.childNodes).forEach(t=>{Ps(t)||os(t)&&this.skipOptions||(!Ln(t,this.slots)||Fi(t))&&this.nodes.push(t)})}updateSlots(){if(this.updatingSlots)return;this.updatingSlots=!0;const t=new Set;this.slots.forEach(e=>{if(!e.value)return;const i=e.value.getAttribute("name");Array.from(e.value.childNodes).some(a=>{var r,h;if(a.nodeType===Node.COMMENT_NODE)return!1;if(a.nodeType===Node.TEXT_NODE)return!!((r=a.textContent)!=null&&r.trim());if(a.nodeType===Node.ELEMENT_NODE){if(Ps(a))return!1;if((h=a.textContent)!=null&&h.trim())return!0}return!1})&&t.add(i);const n=this.nodes.flatMap(a=>Fi(a)||a.getAttribute&&a.getAttribute("slot")==i&&!Ps(a)?a:[]).filter(a=>e.value&&!e.value.contains(a)&&!a.contains(e.value));if(n.length>0)if(typeof e.value.replaceChildren!="function"){for(;e.value.firstChild;)e.value.removeChild(e.value.firstChild);e.value.append(...n)}else e.value.replaceChildren(...n)}),(this.filledSlots.size!==t.size||![...this.filledSlots].every(e=>t.has(e)))&&(this.filledSlots=t,typeof this.host.updateSlots=="function"&&this.host.updateSlots(this.filledSlots)),this.updatingSlots=!1}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{Ps(n)||os(n)&&this.skipOptions||(Ar(n,this.slots)||Fi(n))&&(this.nodes.push(n),e=!0)}),i.removedNodes.forEach(n=>{Ps(n)||os(n)&&this.skipOptions||(this.nodes=this.nodes.filter(a=>a!==n),e=!0)}))}),e&&this.updateSlots()}handleSlotMutations(t){let e=!1;t.forEach(i=>{const n=i.target.parentElement;if(n!=null&&n.hasAttribute("slot")){const a=n.getAttribute("slot"),r=n.hasChildNodes();r&&!this.filledSlots.has(a)?(this.filledSlots.add(a),e=!0):!r&&this.filledSlots.has(a)&&(this.filledSlots.delete(a),e=!0)}}),e&&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:Or}=dr,Bn=s=>s.strings===void 0,Fn=()=>document.createComment(""),Ds=(s,t,e)=>{var i;const n=s._$AA.parentNode,a=t===void 0?s._$AB:t._$AA;if(e===void 0){const r=n.insertBefore(Fn(),a),h=n.insertBefore(Fn(),a);e=new Or(r,h,s,s.options)}else{const r=e._$AB.nextSibling,h=e._$AM,c=h!==s;if(c){let p;(i=e._$AQ)==null||i.call(e,s),e._$AM=s,e._$AP!==void 0&&(p=s._$AU)!==h._$AU&&e._$AP(p)}if(r!==a||c){let p=e._$AA;for(;p!==r;){const
|
|
82
|
+
*/const{I:Or}=dr,Bn=s=>s.strings===void 0,Fn=()=>document.createComment(""),Ds=(s,t,e)=>{var i;const n=s._$AA.parentNode,a=t===void 0?s._$AB:t._$AA;if(e===void 0){const r=n.insertBefore(Fn(),a),h=n.insertBefore(Fn(),a);e=new Or(r,h,s,s.options)}else{const r=e._$AB.nextSibling,h=e._$AM,c=h!==s;if(c){let p;(i=e._$AQ)==null||i.call(e,s),e._$AM=s,e._$AP!==void 0&&(p=s._$AU)!==h._$AU&&e._$AP(p)}if(r!==a||c){let p=e._$AA;for(;p!==r;){const v=p.nextSibling;n.insertBefore(p,a),p=v}}}return e},Ve=(s,t,e=s)=>(s._$AI(t,e),s),Pr={},Vn=(s,t=Pr)=>s._$AH=t,Dr=s=>s._$AH,Vi=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 Is=(s,t)=>{var e;const i=s._$AN;if(i===void 0)return!1;for(const n of i)(e=n._$AO)==null||e.call(n,t,!1),Is(n,t);return!0},fi=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},
|
|
86
|
+
*/const Is=(s,t)=>{var e;const i=s._$AN;if(i===void 0)return!1;for(const n of i)(e=n._$AO)==null||e.call(n,t,!1),Is(n,t);return!0},fi=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},jn=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),Br(t)}};function Ir(s){this._$AN!==void 0?(fi(this),this._$AM=s,jn(this)):this._$AM=s}function Lr(s,t=!1,e=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(i))for(let a=e;a<i.length;a++)Is(i[a],!1),fi(i[a]);else i!=null&&(Is(i,!1),fi(i));else Is(this,s)}const Br=s=>{s.type==Qt.CHILD&&(s._$AP??(s._$AP=Lr),s._$AQ??(s._$AQ=Ir))};let Fr=class extends rs{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),jn(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,n;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),e&&(Is(this,t),fi(this))}setValue(t){if(Bn(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};/**
|
|
87
87
|
* @license
|
|
88
88
|
* Copyright 2020 Google LLC
|
|
89
89
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
90
|
-
*/const E=()=>new
|
|
90
|
+
*/const E=()=>new Vr;let Vr=class{};const ji=new WeakMap,M=Fe(class extends Fr{render(s){return k}update(s,[t]){var e;const i=t!==this.G;return i&&this.G!==void 0&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=(e=s.options)==null?void 0:e.host,this.rt(this.ct=s.element)),k}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=ji.get(t);e===void 0&&(e=new WeakMap,ji.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,s),s!==void 0&&this.G.call(this.ht,s)}else this.G.value=s}get lt(){var s,t;return typeof this.G=="function"?(s=ji.get(this.ht??globalThis))==null?void 0:s.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Hn(s,t,e){const i=s.getAttribute("class")||"",n=new Set(i.split(/\s+/).filter(Boolean));e?n.add(t):n.delete(t),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 gi=class extends
|
|
94
|
+
*/let gi=class extends rs{constructor(t){if(super(t),this.it=k,t.type!==Qt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===k||t==null)return this._t=void 0,this.it=t;if(t===Et)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};gi.directiveName="unsafeHTML",gi.resultType=1;const mi=Fe(gi);/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let
|
|
98
|
+
*/let Hi=class extends gi{};Hi.directiveName="unsafeSVG",Hi.resultType=2;const Un=Fe(Hi);var jr=Object.defineProperty,Hr=Object.getOwnPropertyDescriptor,Ls=(s,t,e,i)=>{for(var n=i>1?void 0:i?Hr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&jr(t,e,n),n};const Ui="https://punkt-cdn.oslo.kommune.no/14.3/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||Ui);const Ur=s=>new Promise(t=>setTimeout(t,s)),vi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',zi={},zr=async(s,t)=>{let e=0;for(;zi[t+s+".svg"]==="fetching"&&(e++,!(e>50));)await Ur(50);const i=typeof Storage<"u"&&typeof sessionStorage<"u";return i&&sessionStorage.getItem(t+s+".svg")?Promise.resolve(sessionStorage.getItem(t+s+".svg")):typeof window<"u"&&typeof window.pktFetch=="function"?(zi[t+s+".svg"]="fetching",Promise.resolve(window.pktFetch(t+s+".svg").then(n=>n.ok?n.text():(console.error("Missing icon: "+t+s+".svg"),vi)).then(n=>(n!==vi&&i&&sessionStorage.setItem(t+s+".svg",n),zi[t+s+".svg"]="fetched",n)))):Promise.resolve(vi)};let je=class extends X{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:Ui,this.name="",this.icon=Un(vi),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path=typeof window<"u"?window.pktIconPath:Ui),this.icon=Un(await zr(this.name||"",this.path).then(e=>e)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return u`${this.name&&this.icon}`}};Ls([o({type:String,reflect:!1})],je.prototype,"path",2),Ls([o({type:String,reflect:!0})],je.prototype,"name",2),Ls([o({type:SVGElement})],je.prototype,"icon",2),Ls([o({type:Array,noAccessor:!0})],je.prototype,"_updatedProps",2),je=Ls([V("pkt-icon")],je);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const C=s=>s??
|
|
102
|
+
*/const C=s=>s??k;var qr=Object.defineProperty,Wr=Object.getOwnPropertyDescriptor,vt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Wr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&qr(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.3/animations/";let dt=class extends X{constructor(){super(),this.defaultSlot=E(),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 ot(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",t=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(t.preventDefault(),t.stopImmediatePropagation())},!0),this.addEventListener("keydown",t=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopImmediatePropagation())},!0)}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),t==="disabled"&&i==="false"&&(this.disabled=!1),(t==="isloading"||t==="isLoading")&&i==="false"&&(this.isLoading=!1)}firstUpdated(t){super.firstUpdated(t),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const t=this.form??this.getAttribute("form")??void 0,e={"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 u`
|
|
103
103
|
<button
|
|
104
104
|
class=${N(e)}
|
|
105
105
|
type=${this.type}
|
|
@@ -108,24 +108,24 @@
|
|
|
108
108
|
aria-disabled=${C(this.disabled||this.isLoading?"true":void 0)}
|
|
109
109
|
form=${C(t)}
|
|
110
110
|
>
|
|
111
|
-
${this.isLoading?
|
|
111
|
+
${this.isLoading?u`<pkt-icon
|
|
112
112
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
113
113
|
name="spinner-blue"
|
|
114
114
|
path=${C(this.loadingAnimationPath)}
|
|
115
|
-
></pkt-icon>`:
|
|
116
|
-
${this.variant!=="label-only"?
|
|
115
|
+
></pkt-icon>`:k}
|
|
116
|
+
${this.variant!=="label-only"?u`<pkt-icon
|
|
117
117
|
class="pkt-btn__icon pkt-icon"
|
|
118
118
|
name=${this.iconName}
|
|
119
119
|
path=${C(this.iconPath)}
|
|
120
|
-
></pkt-icon>`:
|
|
120
|
+
></pkt-icon>`:k}
|
|
121
121
|
<span class="pkt-btn__text" ${M(this.defaultSlot)}></span>
|
|
122
|
-
${this.variant==="icons-right-and-left"?
|
|
122
|
+
${this.variant==="icons-right-and-left"?u`<pkt-icon
|
|
123
123
|
class="pkt-btn__icon"
|
|
124
124
|
name=${this.secondIconName}
|
|
125
125
|
path=${C(this.secondIconPath)}
|
|
126
|
-
></pkt-icon>`:
|
|
126
|
+
></pkt-icon>`:k}
|
|
127
127
|
</button>
|
|
128
|
-
`}};vt([o({type:String})],
|
|
128
|
+
`}};vt([o({type:String})],dt.prototype,"iconName",2),vt([o({type:String})],dt.prototype,"secondIconName",2),vt([o({type:String})],dt.prototype,"iconPath",2),vt([o({type:String})],dt.prototype,"secondIconPath",2),vt([o({type:String})],dt.prototype,"mode",2),vt([o({type:String})],dt.prototype,"size",2),vt([o({type:Boolean,attribute:"full-width"})],dt.prototype,"fullWidth",2),vt([o({type:Boolean,attribute:"full-width-on-mobile"})],dt.prototype,"fullWidthOnMobile",2),vt([o({type:String})],dt.prototype,"color",2),vt([o({type:String})],dt.prototype,"skin",2),vt([o({type:String})],dt.prototype,"variant",2),vt([o({type:String,reflect:!0})],dt.prototype,"state",2),vt([o({type:String,reflect:!0})],dt.prototype,"type",2),vt([o({type:String})],dt.prototype,"form",2),vt([o({type:Boolean,reflect:!0})],dt.prototype,"isLoading",2),vt([o({type:Boolean,reflect:!0})],dt.prototype,"disabled",2),vt([o({type:String})],dt.prototype,"loadingAnimationPath",2),dt=vt([V("pkt-button")],dt);const Rr={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},bi={props:Rr};var Kr=Object.defineProperty,Yr=Object.getOwnPropertyDescriptor,oe=(s,t,e,i)=>{for(var n=i>1?void 0:i?Yr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Kr(t,e,n),n};let te=class extends X{constructor(){super(),this.defaultSlot=E(),this.compact=bi.props.compact.default,this.title="",this.skin=bi.props.skin.default,this.ariaLive=bi.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=bi.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new ot(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(t,e,i){t==="ariaLive"&&(this["aria-live"]=i),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("ariaLive")&&(this["aria-live"]=this.ariaLive),t.has("_isClosed")&&Hn(this,"pkt-hide",this._isClosed)}render(){const t={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},e={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return u`
|
|
129
129
|
<div class=${N(t)} aria-live=${this["aria-live"]}>
|
|
130
130
|
<div class=${N(e)}>
|
|
131
131
|
<pkt-icon
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
|
|
135
135
|
></pkt-icon>
|
|
136
136
|
|
|
137
|
-
${this.closeAlert?
|
|
137
|
+
${this.closeAlert?u`
|
|
138
138
|
<div class="pkt-alert__close">
|
|
139
139
|
<pkt-button
|
|
140
140
|
tabindex="0"
|
|
@@ -149,15 +149,15 @@
|
|
|
149
149
|
<span class="sr-only">Lukk</span>
|
|
150
150
|
</pkt-button>
|
|
151
151
|
</div>
|
|
152
|
-
`:
|
|
153
|
-
${this.title?
|
|
152
|
+
`:k}
|
|
153
|
+
${this.title?u`<div class="pkt-alert__title">${this.title}</div>`:k}
|
|
154
154
|
|
|
155
155
|
<div class="pkt-alert__text" ${M(this.defaultSlot)}></div>
|
|
156
156
|
|
|
157
|
-
${this.date?
|
|
157
|
+
${this.date?u`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:k}
|
|
158
158
|
</div>
|
|
159
159
|
</div>
|
|
160
|
-
`}};oe([o({type:Boolean,reflect:!1})],te.prototype,"compact",2),oe([o({type:String,reflect:!0})],te.prototype,"title",2),oe([o({type:String,reflect:!0})],te.prototype,"skin",2),oe([o({type:String})],te.prototype,"ariaLive",2),oe([o({type:String,reflect:!0})],te.prototype,"aria-live",2),oe([o({type:Boolean,reflect:!0})],te.prototype,"closeAlert",2),oe([o({type:String,reflect:!0})],te.prototype,"date",2),oe([o({type:String,reflect:!0})],te.prototype,"role",2),oe([
|
|
160
|
+
`}};oe([o({type:Boolean,reflect:!1})],te.prototype,"compact",2),oe([o({type:String,reflect:!0})],te.prototype,"title",2),oe([o({type:String,reflect:!0})],te.prototype,"skin",2),oe([o({type:String})],te.prototype,"ariaLive",2),oe([o({type:String,reflect:!0})],te.prototype,"aria-live",2),oe([o({type:Boolean,reflect:!0})],te.prototype,"closeAlert",2),oe([o({type:String,reflect:!0})],te.prototype,"date",2),oe([o({type:String,reflect:!0})],te.prototype,"role",2),oe([I()],te.prototype,"_isClosed",2),te=oe([V("pkt-alert")],te);var Gr=Object.defineProperty,Zr=Object.getOwnPropertyDescriptor,Bs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Zr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Gr(t,e,n),n};let ls=class extends as{constructor(){super(...arguments),this.ariaLabelledBy="",this.compact=!1,this.skin="borderless",this.name=""}updated(t){t.has("skin")&&this.requestUpdate(),t.has("name")&&this.updateAccordionItemNames()}updateAccordionItemNames(){var t;if(this.name){const e=(t=this.renderRoot)==null?void 0:t.querySelector("slot");e&&e.assignedElements().forEach(i=>{i.tagName.toLowerCase()==="pkt-accordion-item"&&(i.hasAttribute("name")||i.setAttribute("name",this.name))})}}firstUpdated(){var t;const e=(t=this.renderRoot)==null?void 0:t.querySelector("slot");e&&e.addEventListener("slotchange",()=>{this.updateAccordionItemNames()})}render(){const t={"pkt-accordion":!0,"pkt-accordion--compact":this.compact,[`pkt-accordion--${this.skin}`]:this.skin};return u`
|
|
161
161
|
<div
|
|
162
162
|
part="container"
|
|
163
163
|
class=${N(t)}
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
>
|
|
167
167
|
<slot></slot>
|
|
168
168
|
</div>
|
|
169
|
-
`}};Bs([o({type:String,reflect:!0,attribute:"aria-labelledby"})],
|
|
169
|
+
`}};Bs([o({type:String,reflect:!0,attribute:"aria-labelledby"})],ls.prototype,"ariaLabelledBy",2),Bs([o({type:Boolean,reflect:!0,attribute:"compact"})],ls.prototype,"compact",2),Bs([o({type:String,reflect:!0,attribute:"skin"})],ls.prototype,"skin",2),Bs([o({type:String,reflect:!0,attribute:"name"})],ls.prototype,"name",2),ls=Bs([V("pkt-accordion")],ls);var Xr=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,He=(s,t,e,i)=>{for(var n=i>1?void 0:i?Jr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Xr(t,e,n),n};let Ce=class extends X{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=E(),this.defaultSlot=E(),this.slotController=new ot(this,this.defaultSlot)}firstUpdated(t){this.defaultOpen&&(this.isOpen=!0)}render(){const t={"pkt-accordion-item":!0,"pkt-accordion-item--compact":this.compact,[`pkt-accordion-item--${this.skin}`]:!!this.skin};return u`
|
|
170
170
|
<details
|
|
171
171
|
class=${N(t)}
|
|
172
172
|
id=${this.id}
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
<div class="pkt-accordion-item__content-inner" ${M(this.defaultSlot)}></div>
|
|
191
191
|
</div>
|
|
192
192
|
</details>
|
|
193
|
-
`}};
|
|
193
|
+
`}};He([o({type:Boolean})],Ce.prototype,"defaultOpen",2),He([o({type:String})],Ce.prototype,"title",2),He([o({type:String,reflect:!0})],Ce.prototype,"skin",2),He([o({type:Boolean,reflect:!0})],Ce.prototype,"compact",2),He([o({type:Boolean,reflect:!0})],Ce.prototype,"isOpen",2),He([o({type:String,reflect:!0})],Ce.prototype,"name",2),Ce=He([V("pkt-accordion-item")],Ce);var Qr=Object.defineProperty,to=Object.getOwnPropertyDescriptor,ki=(s,t,e,i)=>{for(var n=i>1?void 0:i?to(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Qr(t,e,n),n};let hs=class extends X{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,e,i){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,e,i)}render(){return u`<nav
|
|
194
194
|
class="pkt-back-link"
|
|
195
195
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
196
196
|
>
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
></pkt-icon
|
|
203
203
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
204
204
|
>
|
|
205
|
-
</nav>`}};ki([o({type:String})],ds.prototype,"href",2),ki([o({type:String})],ds.prototype,"text",2),ki([o({type:String})],ds.prototype,"ariaLabel",2),ds=ki([F("pkt-backlink")],ds);const zn=6048e5,eo=864e5,qn=Symbol.for("constructDateFrom");function le(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&qn in s?s[qn](t):s instanceof Date?new s.constructor(t):new Date(t)}function jt(s,t){return le(t||s,s)}function Wn(s,t,e){const i=jt(s,void 0);return isNaN(t)?le(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let so={};function yi(){return so}function Fs(s,t){var e,i,n,a;const r=yi(),h=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??r.weekStartsOn??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.weekStartsOn)??0,c=jt(s,t==null?void 0:t.in),p=c.getDay(),m=(p<h?7:0)+p-h;return c.setDate(c.getDate()-m),c.setHours(0,0,0,0),c}function $i(s,t){return Fs(s,{...t,weekStartsOn:1})}function Rn(s,t){const e=jt(s,void 0),i=e.getFullYear(),n=le(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=$i(n),r=le(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=$i(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Kn(s){const t=jt(s),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+s-+e}function Yn(s,...t){const e=le.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Gn(s,t){const e=jt(s,void 0);return e.setHours(0,0,0,0),e}function io(s,t,e){const[i,n]=Yn(void 0,s,t),a=Gn(i),r=Gn(n),h=+a-Kn(a),c=+r-Kn(r);return Math.round((h-c)/eo)}function no(s,t){const e=Rn(s),i=le(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),$i(i)}function ao(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function ro(s){return!(!ao(s)&&typeof s!="number"||isNaN(+jt(s)))}function oo(s,t){const[e,i]=Yn(s,t.start,t.end);return{start:e,end:i}}function Zn(s,t){const{start:e,end:i}=oo(void 0,s);let n=+e>+i;const a=n?+e:+i,r=n?i:e;r.setHours(0,0,0,0);let h=1;const c=[];for(;+r<=a;)c.push(le(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?c.reverse():c}function lo(s,t){const e=jt(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ho={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"}},co=(s,t,e)=>{let i;const n=ho[s];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Wi(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const uo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},po={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fo={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},go={date:Wi({formats:uo,defaultWidth:"full"}),time:Wi({formats:po,defaultWidth:"full"}),dateTime:Wi({formats:fo,defaultWidth:"full"})},mo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vo=(s,t,e,i)=>mo[s];function js(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;n=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;n=s.values[h]||s.values[r]}const a=s.argumentCallback?s.argumentCallback(t):t;return n[a]}}const bo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ko={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yo={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"]},$o={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"]},_o={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"}},wo={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"}},xo=(s,t)=>{const e=Number(s),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},So={ordinalNumber:xo,era:js({values:bo,defaultWidth:"wide"}),quarter:js({values:ko,defaultWidth:"wide",argumentCallback:s=>s-1}),month:js({values:yo,defaultWidth:"wide"}),day:js({values:$o,defaultWidth:"wide"}),dayPeriod:js({values:_o,defaultWidth:"wide",formattingValues:wo,defaultFormattingWidth:"wide"})};function Hs(s){return(t,e={})=>{const i=e.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],a=t.match(n);if(!a)return null;const r=a[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],c=Array.isArray(h)?To(h,v=>v.test(r)):Co(h,v=>v.test(r));let p;p=s.valueCallback?s.valueCallback(c):c,p=e.valueCallback?e.valueCallback(p):p;const m=t.slice(r.length);return{value:p,rest:m}}}function Co(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function To(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function No(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const n=i[0],a=t.match(s.parsePattern);if(!a)return null;let r=s.valueCallback?s.valueCallback(a[0]):a[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(n.length);return{value:r,rest:h}}}const Eo=/^(\d+)(th|st|nd|rd)?/i,Mo=/\d+/i,Ao={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},Oo={any:[/^b/i,/^(a|c)/i]},Po={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Do={any:[/1/i,/2/i,/3/i,/4/i]},Io={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},Lo={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]},Bo={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},Fo={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]},jo={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},Ho={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}},Vo={ordinalNumber:No({matchPattern:Eo,parsePattern:Mo,valueCallback:s=>parseInt(s,10)}),era:Hs({matchPatterns:Ao,defaultMatchWidth:"wide",parsePatterns:Oo,defaultParseWidth:"any"}),quarter:Hs({matchPatterns:Po,defaultMatchWidth:"wide",parsePatterns:Do,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Hs({matchPatterns:Io,defaultMatchWidth:"wide",parsePatterns:Lo,defaultParseWidth:"any"}),day:Hs({matchPatterns:Bo,defaultMatchWidth:"wide",parsePatterns:Fo,defaultParseWidth:"any"}),dayPeriod:Hs({matchPatterns:jo,defaultMatchWidth:"any",parsePatterns:Ho,defaultParseWidth:"any"})},Uo={code:"en-US",formatDistance:co,formatLong:go,formatRelative:vo,localize:So,match:Vo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zo(s,t){const e=jt(s,void 0);return io(e,lo(e))+1}function qo(s,t){const e=jt(s,void 0),i=+$i(e)-+no(e);return Math.round(i/zn)+1}function Xn(s,t){var e,i,n,a;const r=jt(s,t==null?void 0:t.in),h=r.getFullYear(),c=yi(),p=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??c.firstWeekContainsDate??((a=(n=c.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,m=le((t==null?void 0:t.in)||s,0);m.setFullYear(h+1,0,p),m.setHours(0,0,0,0);const v=Fs(m,t),$=le((t==null?void 0:t.in)||s,0);$.setFullYear(h,0,p),$.setHours(0,0,0,0);const b=Fs($,t);return+r>=+v?h+1:+r>=+b?h:h-1}function Wo(s,t){var e,i,n,a;const r=yi(),h=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??r.firstWeekContainsDate??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,c=Xn(s,t),p=le((t==null?void 0:t.in)||s,0);return p.setFullYear(c,0,h),p.setHours(0,0,0,0),Fs(p,t)}function Jn(s,t){const e=jt(s,t==null?void 0:t.in),i=+Fs(e,t)-+Wo(e,t);return Math.round(i/zn)+1}function K(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Ne={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return K(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):K(e+1,2)},d(s,t){return K(s.getDate(),t.length)},a(s,t){const e=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(s,t){return K(s.getHours()%12||12,t.length)},H(s,t){return K(s.getHours(),t.length)},m(s,t){return K(s.getMinutes(),t.length)},s(s,t){return K(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return K(n,t.length)}},us={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Qn={G:function(s,t,e){const i=s.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(s,t,e){if(t==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return Ne.y(s,t)},Y:function(s,t,e,i){const n=Xn(s,i),a=n>0?n:1-n;if(t==="YY"){const r=a%100;return K(r,2)}return t==="Yo"?e.ordinalNumber(a,{unit:"year"}):K(a,t.length)},R:function(s,t){const e=Rn(s);return K(e,t.length)},u:function(s,t){const e=s.getFullYear();return K(e,t.length)},Q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return K(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return K(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,t,e){const i=s.getMonth();switch(t){case"M":case"MM":return Ne.M(s,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(s,t,e){const i=s.getMonth();switch(t){case"L":return String(i+1);case"LL":return K(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(s,t,e,i){const n=Jn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):K(n,t.length)},I:function(s,t,e){const i=qo(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):K(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):Ne.d(s,t)},D:function(s,t,e){const i=zo(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):K(i,t.length)},E:function(s,t,e){const i=s.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return K(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return K(a,t.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return K(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(s,t,e){const i=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,t,e){const i=s.getHours();let n;switch(i===12?n=us.noon:i===0?n=us.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,t,e){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,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,t,e){if(t==="ho"){let i=s.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Ne.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Ne.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):K(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):K(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):Ne.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Ne.s(s,t)},S:function(s,t){return Ne.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ea(i);case"XXXX":case"XX":return qe(i);case"XXXXX":case"XXX":default:return qe(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return ea(i);case"xxxx":case"xx":return qe(i);case"xxxxx":case"xxx":default:return qe(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ta(i,":");case"OOOO":default:return"GMT"+qe(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ta(i,":");case"zzzz":default:return"GMT"+qe(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return K(i,t.length)},T:function(s,t,e){return K(+s,t.length)}};function ta(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),a=i%60;return a===0?e+String(n):e+String(n)+t+K(a,2)}function ea(s,t){return s%60===0?(s>0?"-":"+")+K(Math.abs(s)/60,2):qe(s,t)}function qe(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=K(Math.trunc(i/60),2),a=K(i%60,2);return e+n+t+a}const sa=(s,t)=>{switch(s){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ia=(s,t)=>{switch(s){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ro=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return sa(s,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",sa(i,t)).replace("{{time}}",ia(n,t))},Ko={p:ia,P:Ro},Yo=/^D+$/,Go=/^Y+$/,Zo=["D","DD","YY","YYYY"];function Xo(s){return Yo.test(s)}function Jo(s){return Go.test(s)}function Qo(s,t,e){const i=tl(s,t,e);if(console.warn(i),Zo.includes(s))throw new RangeError(i)}function tl(s,t,e){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const el=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,il=/^'([^]*?)'?$/,nl=/''/g,al=/[a-zA-Z]/;function rl(s,t,e){var i,n,a,r;const h=yi(),c=h.locale??Uo,p=h.firstWeekContainsDate??((n=(i=h.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,m=h.weekStartsOn??((r=(a=h.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??0,v=jt(s,void 0);if(!ro(v))throw new RangeError("Invalid time value");let $=t.match(sl).map(k=>{const x=k[0];if(x==="p"||x==="P"){const T=Ko[x];return T(k,c.formatLong)}return k}).join("").match(el).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const x=k[0];if(x==="'")return{isToken:!1,value:ol(k)};if(Qn[x])return{isToken:!0,value:k};if(x.match(al))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:k}});c.localize.preprocessor&&($=c.localize.preprocessor(v,$));const b={firstWeekContainsDate:p,weekStartsOn:m,locale:c};return $.map(k=>{if(!k.isToken)return k.value;const x=k.value;(Jo(x)||Xo(x))&&Qo(x,t,String(s));const T=Qn[x[0]];return T(v,x,c.localize,b)}).join("")}function ol(s){const t=s.match(il);return t?t[1].replace(nl,"'"):s}function ll(s,t){const e=jt(s,void 0).getDay();return e===0?7:e}function hl(s,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const na={},Vs={};function We(s,t){try{const e=(na[s]||(na[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Vs?Vs[e]:aa(e,e.split(":"))}catch{if(s in Vs)return Vs[s];const e=s==null?void 0:s.match(cl);return e?aa(s,e.slice(1)):NaN}}const cl=/([+-]\d\d):?(\d\d)?/;function aa(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Vs[s]=e*60+i>0?e*60+i+n:e*60-i-n}let Us=class ai extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(We(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),oa(this),Ri(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new ai(...e,t):new ai(Date.now(),t)}withTimeZone(t){return new ai(+this,t)}getTimezoneOffset(){const t=-We(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ri(this),+this}[Symbol.for("constructDateFrom")](t){return new ai(+new Date(t),this.timeZone)}};const ra=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ra.test(s))return;const t=s.replace(ra,"$1UTC");Us.prototype[t]&&(s.startsWith("get")?Us.prototype[s]=function(){return this.internal[t]()}:(Us.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),dl(this),+this},Us.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ri(this),+this}))});function Ri(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-We(s.timeZone,s)*60))}function dl(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()),oa(s)}function oa(s){const t=We(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),a=-new Date(+i).getTimezoneOffset(),r=n-a,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const c=n-e;c&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+c);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(We(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 $=We(s.timeZone,s),b=$>0?Math.floor($):Math.ceil($),k=-new Date(+s).getTimezoneOffset()-b,x=b!==e,T=k-c;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const S=We(s.timeZone,s),A=S>0?Math.floor(S):Math.ceil(S),I=b-A;I&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+I),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+I))}}let Ki=class ri extends Us{static tz(t,...e){return e.length?new ri(...e,t):new ri(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),n=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,n]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${n}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,n]=this.tzComponents();return`${t} GMT${e}${i}${n} (${hl(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",i=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),n=String(Math.abs(t)%60).padStart(2,"0");return[e,i,n]}withTimeZone(t){return new ri(+this,t)}[Symbol.for("constructDateFrom")](t){return new ri(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const ul=(s=window.pktTz)=>{const t=new Ki(new Date().toISOString(),s);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function Ee(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[t,e,i]=s.split("-").map(Number);return new Date(t,e-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[t,e]=s.split("-").map(Number);return new Date(t,e-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const bt=s=>{if(!s||isNaN(s.getTime()))return"";const t=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${t}-${e}-${i}`},Me=s=>{if(!s)return null;const t=Ee(s);return isNaN(t.getTime())?null:t},la=(s,t)=>{const e=me(s);return isNaN(e.getTime())?"":rl(e,t)},me=(s="",t)=>{const e=typeof s=="string"?Ee(s):s;return!e||isNaN(e.getTime())?new Date:e},Re=(s,t,e=1)=>{if(typeof s!="number"||typeof t!="number"||typeof e!="number"||isNaN(s)||isNaN(t)||isNaN(e))return new Date;const i=new Date(s,t,e);return isNaN(i.getTime())?new Date:i},zs=s=>{let t;return typeof s=="number"?t=new Ki(s,window.pktTz):t=new Ki(s,window.pktTz),t.setHours(12,0,0,0),t},pl=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),fl=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?me(t):null,n=e?me(e):null;return!(i&&s<i||n&&s>n)},gl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=bt(s);return t.includes(e)},ml=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ha=(s,t,e,i,n)=>!(!s||isNaN(s.getTime())||!fl(s,t,e)||i&&gl(s,i)||n&&ml(s,n)),vl=(s,t,e,i,n)=>s.filter(a=>{const r=Me(a);return r&&ha(r,t,e,i,n)}),ca=s=>s.slice().sort((t,e)=>{const i=Me(t),n=Me(e);return!i||!n?0:i.getTime()-n.getTime()}),bl=(s,t)=>{const e=Me(s),i=Me(t);return!e||!i?!1:e<=i},qs=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],kl=s=>s.join(","),da=s=>qs(s),yl=s=>s?Ee(s):null,$l=s=>{if(typeof s=="string")return s.split(",").map(t=>Ee(t));if(Array.isArray(s))return s.map(t=>Ee(t))},ps={csvToArray:da,stringToDate:yl,stringsToDate:$l},_l={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Ke={props:_l};function ua(s,t){const e=t.excludedates.map(i=>typeof i=="string"?i:bt(i));return!ha(s,t.earliest,t.latest,e,t.excludeweekdays)}function wl(s,t,e,i){return!!(ua(s,e)||!t&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function xl(s,t,e){const i=Re(s,t,0);return!(e&&me(e)>i)}function Sl(s,t,e){const i=Re(t===11?s+1:s,t===11?0:t+1,1);return!(e&&me(e)<i)}const Ws=7,Cl=6;function Tl(s,t){const e=Re(s,t,1),i=Re(s,t+1,0),n=(e.getDay()+Cl)%Ws,a=i.getDate(),r=Math.ceil((a+n)/Ws),h=Re(s,t,0).getDate(),c=Jn(e);return{firstDayOfMonth:e,lastDayOfMonth:i,startingDay:n,numDays:a,numRows:r,numDaysPrevMonth:h,initialWeek:c}}function Nl(s,t,e,i){const{startingDay:n,numDays:a}=i;return s===0&&t<n?"prev-month":e>a?"next-month":"current-month"}function El(s,t,e,i){const{startingDay:n,numDaysPrevMonth:a,numDays:r}=i;return s==="prev-month"?a-(n-t-1):s==="next-month"?e-r:e}function fs(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(t=>Ee(t))}function pa(s,t){const e=Zn({start:s,end:t}),i={};if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n++){const a=e[n],r=a>s&&a<t;i[bt(a)]=r}return i}function fa(s,t,e,i){if(t.length!==1)return!0;const n=Zn({start:t[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let a=0;a<n.length;a++){for(const r of e)if(r>t[0]&&r<s)return!1;if(i.includes(ll(n[a]).toString()))return!1}return!0}function Yi(s,t){const e=bt(s);return t.includes(e)?t:[...t,e]}function Gi(s,t){const e=bt(s),i=t.indexOf(e);if(i===-1)return t;if(t.length===1)return[];const n=[...t];return n.splice(i,1),n}function Ml(s,t,e){const i=bt(s);return t.includes(i)?Gi(s,t):e>0&&t.length>=e?t:Yi(s,t)}function Al(s,t,e){const i=bt(s),n=fs(t);if(t.includes(i))return t.indexOf(i)===0?[]:Gi(s,t);if(t.length>1)return[i];if(t.length===1){if(!fa(s,n,e.excludedates,e.excludeweekdays))return[i];if(n[0]>s)return[i]}return Yi(s,t)}const Ol={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Ws,ArrowDown:Ws};function Pl(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Dl(s,t,e){let i=Wn(s,t);if(!i)return null;let n=e(`button[data-date="${bt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Wn(i,t),n=e(`button[data-date="${bt(i)}"]`),!n)return null;return i}function Il(s){return Ol[s]??null}var Ll=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,J=(s,t,e,i)=>{for(var n=i>1?void 0:i?Bl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Ll(t,e,n),n};let Y=class extends X{constructor(){super(...arguments),this.selected=[],this.multiple=Ke.props.multiple.default,this.maxMultiple=Ke.props.maxMultiple.default,this.range=Ke.props.range.default,this.earliest=Ke.props.earliest.default,this.latest=Ke.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=Ke.props.weeknumbers.default,this.withcontrols=Ke.props.withcontrols.default,this.currentmonth=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}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.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=fs(this.selected),this.range&&this.selected.length===2&&(this.inRange=pa(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 t=Ee(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?zs(new Date):t}else this.currentmonth===null&&(this.currentmonth=zs(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=zs(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const e=Il(t.key);e!==null&&this.handleArrowKey(t,e)}handleArrowKey(t,e){const i=t.target;if(Pl(i))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?me(this.focusedDate):Re(this.year,this.month,1),a=Dl(n,e,this.querySelector.bind(this));if(a){const r=this.querySelector(`button[data-date="${bt(a)}"]`);r instanceof HTMLButtonElement&&!r.dataset.disabled&&(this.focusedDate=bt(a),r.focus())}}render(){return d`
|
|
205
|
+
</nav>`}};ki([o({type:String})],hs.prototype,"href",2),ki([o({type:String})],hs.prototype,"text",2),ki([o({type:String})],hs.prototype,"ariaLabel",2),hs=ki([V("pkt-backlink")],hs);const zn=6048e5,eo=864e5,qn=Symbol.for("constructDateFrom");function le(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&qn in s?s[qn](t):s instanceof Date?new s.constructor(t):new Date(t)}function Bt(s,t){return le(t||s,s)}function Wn(s,t,e){const i=Bt(s,void 0);return isNaN(t)?le(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let so={};function yi(){return so}function Fs(s,t){var e,i,n,a;const r=yi(),h=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??r.weekStartsOn??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.weekStartsOn)??0,c=Bt(s,t==null?void 0:t.in),p=c.getDay(),v=(p<h?7:0)+p-h;return c.setDate(c.getDate()-v),c.setHours(0,0,0,0),c}function $i(s,t){return Fs(s,{...t,weekStartsOn:1})}function Rn(s,t){const e=Bt(s,void 0),i=e.getFullYear(),n=le(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=$i(n),r=le(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=$i(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Kn(s){const t=Bt(s),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+s-+e}function Yn(s,...t){const e=le.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Gn(s,t){const e=Bt(s,void 0);return e.setHours(0,0,0,0),e}function io(s,t,e){const[i,n]=Yn(void 0,s,t),a=Gn(i),r=Gn(n),h=+a-Kn(a),c=+r-Kn(r);return Math.round((h-c)/eo)}function no(s,t){const e=Rn(s),i=le(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),$i(i)}function ao(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function ro(s){return!(!ao(s)&&typeof s!="number"||isNaN(+Bt(s)))}function oo(s,t){const[e,i]=Yn(s,t.start,t.end);return{start:e,end:i}}function Zn(s,t){const{start:e,end:i}=oo(void 0,s);let n=+e>+i;const a=n?+e:+i,r=n?i:e;r.setHours(0,0,0,0);let h=1;const c=[];for(;+r<=a;)c.push(le(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?c.reverse():c}function lo(s,t){const e=Bt(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ho={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"}},co=(s,t,e)=>{let i;const n=ho[s];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function qi(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const uo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},po={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fo={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},go={date:qi({formats:uo,defaultWidth:"full"}),time:qi({formats:po,defaultWidth:"full"}),dateTime:qi({formats:fo,defaultWidth:"full"})},mo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vo=(s,t,e,i)=>mo[s];function Vs(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;n=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;n=s.values[h]||s.values[r]}const a=s.argumentCallback?s.argumentCallback(t):t;return n[a]}}const bo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ko={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yo={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"]},$o={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"]},_o={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"}},wo={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"}},xo=(s,t)=>{const e=Number(s),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},So={ordinalNumber:xo,era:Vs({values:bo,defaultWidth:"wide"}),quarter:Vs({values:ko,defaultWidth:"wide",argumentCallback:s=>s-1}),month:Vs({values:yo,defaultWidth:"wide"}),day:Vs({values:$o,defaultWidth:"wide"}),dayPeriod:Vs({values:_o,defaultWidth:"wide",formattingValues:wo,defaultFormattingWidth:"wide"})};function js(s){return(t,e={})=>{const i=e.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],a=t.match(n);if(!a)return null;const r=a[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],c=Array.isArray(h)?To(h,m=>m.test(r)):Co(h,m=>m.test(r));let p;p=s.valueCallback?s.valueCallback(c):c,p=e.valueCallback?e.valueCallback(p):p;const v=t.slice(r.length);return{value:p,rest:v}}}function Co(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function To(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function No(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const n=i[0],a=t.match(s.parsePattern);if(!a)return null;let r=s.valueCallback?s.valueCallback(a[0]):a[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(n.length);return{value:r,rest:h}}}const Eo=/^(\d+)(th|st|nd|rd)?/i,Mo=/\d+/i,Ao={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},Oo={any:[/^b/i,/^(a|c)/i]},Po={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Do={any:[/1/i,/2/i,/3/i,/4/i]},Io={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},Lo={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]},Bo={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},Fo={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]},Vo={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},jo={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}},Ho={ordinalNumber:No({matchPattern:Eo,parsePattern:Mo,valueCallback:s=>parseInt(s,10)}),era:js({matchPatterns:Ao,defaultMatchWidth:"wide",parsePatterns:Oo,defaultParseWidth:"any"}),quarter:js({matchPatterns:Po,defaultMatchWidth:"wide",parsePatterns:Do,defaultParseWidth:"any",valueCallback:s=>s+1}),month:js({matchPatterns:Io,defaultMatchWidth:"wide",parsePatterns:Lo,defaultParseWidth:"any"}),day:js({matchPatterns:Bo,defaultMatchWidth:"wide",parsePatterns:Fo,defaultParseWidth:"any"}),dayPeriod:js({matchPatterns:Vo,defaultMatchWidth:"any",parsePatterns:jo,defaultParseWidth:"any"})},Uo={code:"en-US",formatDistance:co,formatLong:go,formatRelative:vo,localize:So,match:Ho,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zo(s,t){const e=Bt(s,void 0);return io(e,lo(e))+1}function qo(s,t){const e=Bt(s,void 0),i=+$i(e)-+no(e);return Math.round(i/zn)+1}function Xn(s,t){var e,i,n,a;const r=Bt(s,t==null?void 0:t.in),h=r.getFullYear(),c=yi(),p=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??c.firstWeekContainsDate??((a=(n=c.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,v=le((t==null?void 0:t.in)||s,0);v.setFullYear(h+1,0,p),v.setHours(0,0,0,0);const m=Fs(v,t),y=le((t==null?void 0:t.in)||s,0);y.setFullYear(h,0,p),y.setHours(0,0,0,0);const $=Fs(y,t);return+r>=+m?h+1:+r>=+$?h:h-1}function Wo(s,t){var e,i,n,a;const r=yi(),h=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??r.firstWeekContainsDate??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,c=Xn(s,t),p=le((t==null?void 0:t.in)||s,0);return p.setFullYear(c,0,h),p.setHours(0,0,0,0),Fs(p,t)}function Jn(s,t){const e=Bt(s,t==null?void 0:t.in),i=+Fs(e,t)-+Wo(e,t);return Math.round(i/zn)+1}function Y(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Te={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return Y(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):Y(e+1,2)},d(s,t){return Y(s.getDate(),t.length)},a(s,t){const e=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(s,t){return Y(s.getHours()%12||12,t.length)},H(s,t){return Y(s.getHours(),t.length)},m(s,t){return Y(s.getMinutes(),t.length)},s(s,t){return Y(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return Y(n,t.length)}},cs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Qn={G:function(s,t,e){const i=s.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(s,t,e){if(t==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return Te.y(s,t)},Y:function(s,t,e,i){const n=Xn(s,i),a=n>0?n:1-n;if(t==="YY"){const r=a%100;return Y(r,2)}return t==="Yo"?e.ordinalNumber(a,{unit:"year"}):Y(a,t.length)},R:function(s,t){const e=Rn(s);return Y(e,t.length)},u:function(s,t){const e=s.getFullYear();return Y(e,t.length)},Q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Y(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Y(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,t,e){const i=s.getMonth();switch(t){case"M":case"MM":return Te.M(s,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(s,t,e){const i=s.getMonth();switch(t){case"L":return String(i+1);case"LL":return Y(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(s,t,e,i){const n=Jn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):Y(n,t.length)},I:function(s,t,e){const i=qo(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Y(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):Te.d(s,t)},D:function(s,t,e){const i=zo(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Y(i,t.length)},E:function(s,t,e){const i=s.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Y(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Y(a,t.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return Y(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(s,t,e){const i=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,t,e){const i=s.getHours();let n;switch(i===12?n=cs.noon:i===0?n=cs.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let n;switch(i>=17?n=cs.evening:i>=12?n=cs.afternoon:i>=4?n=cs.morning:n=cs.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,t,e){if(t==="ho"){let i=s.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Te.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Te.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Y(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Y(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):Te.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Te.s(s,t)},S:function(s,t){return Te.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ea(i);case"XXXX":case"XX":return Ue(i);case"XXXXX":case"XXX":default:return Ue(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return ea(i);case"xxxx":case"xx":return Ue(i);case"xxxxx":case"xxx":default:return Ue(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ta(i,":");case"OOOO":default:return"GMT"+Ue(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ta(i,":");case"zzzz":default:return"GMT"+Ue(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return Y(i,t.length)},T:function(s,t,e){return Y(+s,t.length)}};function ta(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),a=i%60;return a===0?e+String(n):e+String(n)+t+Y(a,2)}function ea(s,t){return s%60===0?(s>0?"-":"+")+Y(Math.abs(s)/60,2):Ue(s,t)}function Ue(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=Y(Math.trunc(i/60),2),a=Y(i%60,2);return e+n+t+a}const sa=(s,t)=>{switch(s){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ia=(s,t)=>{switch(s){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ro=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return sa(s,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",sa(i,t)).replace("{{time}}",ia(n,t))},Ko={p:ia,P:Ro},Yo=/^D+$/,Go=/^Y+$/,Zo=["D","DD","YY","YYYY"];function Xo(s){return Yo.test(s)}function Jo(s){return Go.test(s)}function Qo(s,t,e){const i=tl(s,t,e);if(console.warn(i),Zo.includes(s))throw new RangeError(i)}function tl(s,t,e){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const el=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,il=/^'([^]*?)'?$/,nl=/''/g,al=/[a-zA-Z]/;function rl(s,t,e){var i,n,a,r;const h=yi(),c=h.locale??Uo,p=h.firstWeekContainsDate??((n=(i=h.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,v=h.weekStartsOn??((r=(a=h.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??0,m=Bt(s,void 0);if(!ro(m))throw new RangeError("Invalid time value");let y=t.match(sl).map(b=>{const x=b[0];if(x==="p"||x==="P"){const T=Ko[x];return T(b,c.formatLong)}return b}).join("").match(el).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const x=b[0];if(x==="'")return{isToken:!1,value:ol(b)};if(Qn[x])return{isToken:!0,value:b};if(x.match(al))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:b}});c.localize.preprocessor&&(y=c.localize.preprocessor(m,y));const $={firstWeekContainsDate:p,weekStartsOn:v,locale:c};return y.map(b=>{if(!b.isToken)return b.value;const x=b.value;(Jo(x)||Xo(x))&&Qo(x,t,String(s));const T=Qn[x[0]];return T(m,x,c.localize,$)}).join("")}function ol(s){const t=s.match(il);return t?t[1].replace(nl,"'"):s}function ll(s,t){const e=Bt(s,void 0).getDay();return e===0?7:e}function hl(s,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const na={},Hs={};function ze(s,t){try{const e=(na[s]||(na[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Hs?Hs[e]:aa(e,e.split(":"))}catch{if(s in Hs)return Hs[s];const e=s==null?void 0:s.match(cl);return e?aa(s,e.slice(1)):NaN}}const cl=/([+-]\d\d):?(\d\d)?/;function aa(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Hs[s]=e*60+i>0?e*60+i+n:e*60-i-n}let Us=class ai extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ze(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),oa(this),Wi(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new ai(...e,t):new ai(Date.now(),t)}withTimeZone(t){return new ai(+this,t)}getTimezoneOffset(){const t=-ze(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Wi(this),+this}[Symbol.for("constructDateFrom")](t){return new ai(+new Date(t),this.timeZone)}};const ra=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ra.test(s))return;const t=s.replace(ra,"$1UTC");Us.prototype[t]&&(s.startsWith("get")?Us.prototype[s]=function(){return this.internal[t]()}:(Us.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),dl(this),+this},Us.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Wi(this),+this}))});function Wi(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-ze(s.timeZone,s)*60))}function dl(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()),oa(s)}function oa(s){const t=ze(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),a=-new Date(+i).getTimezoneOffset(),r=n-a,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const c=n-e;c&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+c);const p=new Date(+s);p.setUTCSeconds(0);const v=n>0?p.getSeconds():(p.getSeconds()-60)%60,m=Math.round(-(ze(s.timeZone,s)*60))%60;(m||v)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+m+v));const y=ze(s.timeZone,s),$=y>0?Math.floor(y):Math.ceil(y),b=-new Date(+s).getTimezoneOffset()-$,x=$!==e,T=b-c;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const O=ze(s.timeZone,s),S=O>0?Math.floor(O):Math.ceil(O),B=$-S;B&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+B),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+B))}}let Ri=class ri extends Us{static tz(t,...e){return e.length?new ri(...e,t):new ri(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),n=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,n]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${n}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,n]=this.tzComponents();return`${t} GMT${e}${i}${n} (${hl(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",i=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),n=String(Math.abs(t)%60).padStart(2,"0");return[e,i,n]}withTimeZone(t){return new ri(+this,t)}[Symbol.for("constructDateFrom")](t){return new ri(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const ul=(s=window.pktTz)=>{const t=new Ri(new Date().toISOString(),s);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function Ne(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[t,e,i]=s.split("-").map(Number);return new Date(t,e-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[t,e]=s.split("-").map(Number);return new Date(t,e-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const bt=s=>{if(!s||isNaN(s.getTime()))return"";const t=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${t}-${e}-${i}`},Ee=s=>{if(!s)return null;const t=Ne(s);return isNaN(t.getTime())?null:t},la=(s,t)=>{const e=me(s);return isNaN(e.getTime())?"":rl(e,t)},me=(s="",t)=>{const e=typeof s=="string"?Ne(s):s;return!e||isNaN(e.getTime())?new Date:e},qe=(s,t,e=1)=>{if(typeof s!="number"||typeof t!="number"||typeof e!="number"||isNaN(s)||isNaN(t)||isNaN(e))return new Date;const i=new Date(s,t,e);return isNaN(i.getTime())?new Date:i},zs=s=>{let t;return typeof s=="number"?t=new Ri(s,window.pktTz):t=new Ri(s,window.pktTz),t.setHours(12,0,0,0),t},pl=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),fl=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?me(t):null,n=e?me(e):null;return!(i&&s<i||n&&s>n)},gl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=bt(s);return t.includes(e)},ml=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ha=(s,t,e,i,n)=>!(!s||isNaN(s.getTime())||!fl(s,t,e)||i&&gl(s,i)||n&&ml(s,n)),vl=(s,t,e,i,n)=>s.filter(a=>{const r=Ee(a);return r&&ha(r,t,e,i,n)}),ca=s=>s.slice().sort((t,e)=>{const i=Ee(t),n=Ee(e);return!i||!n?0:i.getTime()-n.getTime()}),bl=(s,t)=>{const e=Ee(s),i=Ee(t);return!e||!i?!1:e<=i},qs=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],kl=s=>s.join(","),da=s=>qs(s),yl=s=>s?Ne(s):null,$l=s=>{if(typeof s=="string")return s.split(",").map(t=>Ne(t));if(Array.isArray(s))return s.map(t=>Ne(t))},ds={csvToArray:da,stringToDate:yl,stringsToDate:$l},_l={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},We={props:_l};function ua(s,t){const e=t.excludedates.map(i=>typeof i=="string"?i:bt(i));return!ha(s,t.earliest,t.latest,e,t.excludeweekdays)}function wl(s,t,e,i){return!!(ua(s,e)||!t&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function xl(s,t,e){const i=qe(s,t,0);return!(e&&me(e)>i)}function Sl(s,t,e){const i=qe(t===11?s+1:s,t===11?0:t+1,1);return!(e&&me(e)<i)}const Ws=7,Cl=6;function Tl(s,t){const e=qe(s,t,1),i=qe(s,t+1,0),n=(e.getDay()+Cl)%Ws,a=i.getDate(),r=Math.ceil((a+n)/Ws),h=qe(s,t,0).getDate(),c=Jn(e);return{firstDayOfMonth:e,lastDayOfMonth:i,startingDay:n,numDays:a,numRows:r,numDaysPrevMonth:h,initialWeek:c}}function Nl(s,t,e,i){const{startingDay:n,numDays:a}=i;return s===0&&t<n?"prev-month":e>a?"next-month":"current-month"}function El(s,t,e,i){const{startingDay:n,numDaysPrevMonth:a,numDays:r}=i;return s==="prev-month"?a-(n-t-1):s==="next-month"?e-r:e}function us(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(t=>Ne(t))}function pa(s,t){const e=Zn({start:s,end:t}),i={};if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n++){const a=e[n],r=a>s&&a<t;i[bt(a)]=r}return i}function fa(s,t,e,i){if(t.length!==1)return!0;const n=Zn({start:t[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let a=0;a<n.length;a++){for(const r of e)if(r>t[0]&&r<s)return!1;if(i.includes(ll(n[a]).toString()))return!1}return!0}function Ki(s,t){const e=bt(s);return t.includes(e)?t:[...t,e]}function Yi(s,t){const e=bt(s),i=t.indexOf(e);if(i===-1)return t;if(t.length===1)return[];const n=[...t];return n.splice(i,1),n}function Ml(s,t,e){const i=bt(s);return t.includes(i)?Yi(s,t):e>0&&t.length>=e?t:Ki(s,t)}function Al(s,t,e){const i=bt(s),n=us(t);if(t.includes(i))return t.indexOf(i)===0?[]:Yi(s,t);if(t.length>1)return[i];if(t.length===1){if(!fa(s,n,e.excludedates,e.excludeweekdays))return[i];if(n[0]>s)return[i]}return Ki(s,t)}const Ol={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Ws,ArrowDown:Ws};function Pl(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Dl(s,t,e){let i=Wn(s,t);if(!i)return null;let n=e(`button[data-date="${bt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Wn(i,t),n=e(`button[data-date="${bt(i)}"]`),!n)return null;return i}function Il(s){return Ol[s]??null}var Ll=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,J=(s,t,e,i)=>{for(var n=i>1?void 0:i?Bl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Ll(t,e,n),n};let G=class extends X{constructor(){super(...arguments),this.selected=[],this.multiple=We.props.multiple.default,this.maxMultiple=We.props.maxMultiple.default,this.range=We.props.range.default,this.earliest=We.props.earliest.default,this.latest=We.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=We.props.weeknumbers.default,this.withcontrols=We.props.withcontrols.default,this.currentmonth=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}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.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=pa(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 t=Ne(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?zs(new Date):t}else this.currentmonth===null&&(this.currentmonth=zs(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=zs(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const e=Il(t.key);e!==null&&this.handleArrowKey(t,e)}handleArrowKey(t,e){const i=t.target;if(Pl(i))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?me(this.focusedDate):qe(this.year,this.month,1),a=Dl(n,e,this.querySelector.bind(this));if(a){const r=this.querySelector(`button[data-date="${bt(a)}"]`);r instanceof HTMLButtonElement&&!r.dataset.disabled&&(this.focusedDate=bt(a),r.focus())}}render(){return u`
|
|
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(t){const e=t==="prev",i=e?this.isPrevMonthAllowed():this.isNextMonthAllowed(),n=e?this.prevMonthString:this.nextMonthString,a=e?"chevron-thin-left":"chevron-thin-right",r=e?"pkt-calendar__prev-month":"pkt-calendar__next-month",h=e?()=>this.prevMonth():()=>this.nextMonth();return
|
|
229
|
+
`}renderMonthNavButton(t){const e=t==="prev",i=e?this.isPrevMonthAllowed():this.isNextMonthAllowed(),n=e?this.prevMonthString:this.nextMonthString,a=e?"chevron-thin-left":"chevron-thin-right",r=e?"pkt-calendar__prev-month":"pkt-calendar__next-month",h=e?()=>this.prevMonth():()=>this.nextMonth();return u`<div>
|
|
230
230
|
<button
|
|
231
231
|
type="button"
|
|
232
232
|
aria-label="${n}"
|
|
233
233
|
@click=${()=>i&&h()}
|
|
234
234
|
@keydown=${c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),i&&h())}}
|
|
235
235
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${r} ${i?"":"pkt-hide"}"
|
|
236
|
-
.data-disabled=${i?
|
|
236
|
+
.data-disabled=${i?k:"disabled"}
|
|
237
237
|
?aria-disabled=${!i}
|
|
238
238
|
tabindex=${i?"0":"-1"}
|
|
239
239
|
>
|
|
240
240
|
<pkt-icon class="pkt-btn__icon" name="${a}"></pkt-icon>
|
|
241
241
|
<span class="pkt-btn__text">${n}</span>
|
|
242
242
|
</button>
|
|
243
|
-
</div>`}renderDayNames(){const t=[];this.weeknumbers&&t.push(
|
|
243
|
+
</div>`}renderDayNames(){const t=[];this.weeknumbers&&t.push(u`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);for(let e=0;e<this.dayStrings.length;e++)t.push(u`<th>
|
|
244
244
|
<div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[e]}">
|
|
245
245
|
${this.dayStrings[e]}
|
|
246
246
|
</div>
|
|
247
|
-
</th>`);return
|
|
247
|
+
</th>`);return u`<tr class="pkt-cal-week-row">${t}</tr>`}renderMonthNav(){return this.withcontrols?u`<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=${t=>{t.stopImmediatePropagation();const e=t.target;this.changeMonth(this.year,parseInt(e.value))}}
|
|
254
254
|
>
|
|
255
|
-
${this.monthStrings.map((t,e)=>
|
|
255
|
+
${this.monthStrings.map((t,e)=>u`<option value=${e} ?selected=${this.month===e}>${t}</option>`)}
|
|
256
256
|
</select>
|
|
257
257
|
<label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
|
|
258
258
|
<input
|
|
@@ -265,33 +265,33 @@
|
|
|
265
265
|
@change=${t=>{t.stopImmediatePropagation();const e=t.target;this.changeMonth(parseInt(e.value),this.month)}}
|
|
266
266
|
.value=${this.year}
|
|
267
267
|
/>
|
|
268
|
-
</div>`:
|
|
268
|
+
</div>`:u`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
269
269
|
${this.monthStrings[this.month]} ${this.year}
|
|
270
|
-
</div>`}getDayViewData(t,e){const i=
|
|
270
|
+
</div>`}getDayViewData(t,e){const i=qe(this.year,this.month,t),n=bt(i),a=n===bt(e),r=this.selected.includes(n),h=this.isDayDisabled(i,r),c=this.calculateTabIndex(n,h,t);return{currentDate:i,currentDateISO:n,isToday:a,isSelected:r,isDisabled:h,ariaLabel:pl(i),tabindex:c}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(t,e){return wl(t,e,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(t,e,i){return this.focusedDate?this.focusedDate===t&&!e?"0":"-1":!e&&this.tabIndexSet===0?(this.tabIndexSet=i,"0"):this.tabIndexSet===i?"0":"-1"}getDayCellClasses(t){const{currentDateISO:e,isToday:i,isSelected:n}=t,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&e===this.selected[0],r=this.range&&this.selected.length===2&&e===this.selected[1];return{"pkt-cal-today":i,"pkt-cal-selected":n,"pkt-cal-in-range":this.inRange[e],"pkt-cal-excluded":this.isExcluded(t.currentDate),"pkt-cal-in-range-first":a,"pkt-cal-in-range-last":r,"pkt-cal-range-hover":this.rangeHovered!==null&&e===bt(this.rangeHovered)}}getDayButtonClasses(t){const{currentDateISO:e,isToday:i,isSelected:n,isDisabled:a}=t,r=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&e===this.selected[0],h=this.range&&this.selected.length===2&&e===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":i,"pkt-calendar__date--selected":n,"pkt-calendar__date--disabled":a,"pkt-calendar__date--in-range":this.inRange[e],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&e===bt(this.rangeHovered),"pkt-calendar__date--range-start":r,"pkt-calendar__date--range-end":h}}handleDayFocus(t,e){this.range&&!this.isExcluded(t)&&this.handleRangeHover(t),this.focusedDate=e}renderDayView(t,e){const i=this.getDayViewData(t,e),{currentDate:n,currentDateISO:a,isSelected:r,isDisabled:h,ariaLabel:c,tabindex:p}=i;this.selectableDates.push({currentDateISO:a,isDisabled:h,tabindex:p});const v=this.getDayCellClasses(i),m=this.getDayButtonClasses(i);return u`<td class=${N(v)}>
|
|
271
271
|
<button
|
|
272
272
|
type="button"
|
|
273
273
|
aria-pressed=${r?"true":"false"}
|
|
274
274
|
?disabled=${h}
|
|
275
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${N(
|
|
275
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${N(m)}"
|
|
276
276
|
@mouseover=${()=>this.range&&!this.isExcluded(n)&&this.handleRangeHover(n)}
|
|
277
277
|
@focus=${()=>this.handleDayFocus(n,a)}
|
|
278
278
|
aria-label="${c}"
|
|
279
279
|
tabindex=${p}
|
|
280
|
-
data-disabled=${h?"disabled":
|
|
280
|
+
data-disabled=${h?"disabled":k}
|
|
281
281
|
data-date=${a}
|
|
282
|
-
@keydown=${
|
|
283
|
-
@click=${
|
|
282
|
+
@keydown=${y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),this.handleDateSelect(n))}}
|
|
283
|
+
@click=${y=>{h||(y.preventDefault(),this.handleDateSelect(n))}}
|
|
284
284
|
>
|
|
285
285
|
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
286
286
|
</button>
|
|
287
|
-
</td>`}renderEmptyDayCell(t){return
|
|
287
|
+
</td>`}renderEmptyDayCell(t){return u`<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">${t}</span>
|
|
293
293
|
</div>
|
|
294
|
-
</td>`}renderWeekRow(t){return
|
|
294
|
+
</td>`}renderWeekRow(t){return u`<tr class="pkt-cal-week-row" role="row">${t}</tr>`}renderCalendarBody(){const t=ul(),e=Tl(this.year,this.month);let i=1;this.week=e.initialWeek;const n=[];for(let a=0;a<e.numRows;a++){const r=[];this.weeknumbers&&r.push(u`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let h=0;h<Ws;h++){const c=Nl(a,h,i,e);if(c==="current-month")r.push(this.renderDayView(i,t)),i++;else{const p=El(c,h,i,e);r.push(this.renderEmptyDayCell(p)),c==="next-month"&&i++}}n.push(this.renderWeekRow(r))}return n}isExcluded(t){return ua(t,this.getDateConstraints())}isPrevMonthAllowed(){return xl(this.year,this.month,this.earliest)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){return Sl(this.year,this.month,this.latest)}nextMonth(){const t=this.month===11?0:this.month+1,e=this.month===11?this.year+1:this.year;this.changeMonth(e,t)}changeMonth(t,e){this.year=typeof t=="string"?parseInt(t):t,this.month=typeof e=="string"?parseInt(e):e,this.currentmonth=zs(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(t){this.selected=Ki(t,this.normalizeSelected()),this._selected=us(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(t){this.selected=Yi(t,this.normalizeSelected()),this._selected=us(this.selected)}toggleSelected(t){this.selected=Ml(t,this.normalizeSelected(),this.maxMultiple),this._selected=us(this.selected)}isRangeAllowed(t){return fa(t,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(t){return this.selected=Al(t,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=us(this.selected),this.selected.length===2?this.convertSelected():this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(t){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(t)||this._selected[0]>=t){this.rangeHovered=null;return}this.rangeHovered=t,this.inRange=pa(this._selected[0],t)}handleDateSelect(t){return t&&(this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(bt(t))?this.emptySelected():(this.emptySelected(),this.addToSelected(t)),this.close()),this.dispatchEvent(new CustomEvent("date-selected",{detail:this.selected,bubbles:!0,composed:!0}))),Promise.resolve()}focusOnCurrentDate(){const t=bt(zs(new Date)),e=this.querySelector(`button[data-date="${t}"]`);if(e instanceof HTMLButtonElement){this.focusedDate=t,e.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(t){!this.contains(t.relatedTarget)&&!t.target.classList.contains("pkt-hide")&&this.close()}close(){this.dispatchEvent(new CustomEvent("close",{detail:!0,bubbles:!0,composed:!0}))}};J([o({converter:ds.csvToArray})],G.prototype,"selected",2),J([o({type:Boolean})],G.prototype,"multiple",2),J([o({type:Number})],G.prototype,"maxMultiple",2),J([o({type:Boolean})],G.prototype,"range",2),J([o({type:String})],G.prototype,"earliest",2),J([o({type:String})],G.prototype,"latest",2),J([o({converter:ds.stringsToDate})],G.prototype,"excludedates",2),J([o({converter:ds.csvToArray})],G.prototype,"excludeweekdays",2),J([o({type:Boolean})],G.prototype,"weeknumbers",2),J([o({type:Boolean})],G.prototype,"withcontrols",2),J([o({converter:ds.stringToDate})],G.prototype,"currentmonth",2),J([o({type:Array})],G.prototype,"dayStrings",2),J([o({type:Array})],G.prototype,"dayStringsLong",2),J([o({type:Array})],G.prototype,"monthStrings",2),J([o({type:String})],G.prototype,"weekString",2),J([o({type:String})],G.prototype,"prevMonthString",2),J([o({type:String})],G.prototype,"nextMonthString",2),J([o({type:Array})],G.prototype,"_selected",2),J([I()],G.prototype,"inRange",2),J([o({type:Date})],G.prototype,"rangeHovered",2),J([o({type:Number})],G.prototype,"year",2),J([o({type:Number})],G.prototype,"month",2),J([o({type:Number})],G.prototype,"week",2),J([I()],G.prototype,"currentmonthtouched",2),J([I()],G.prototype,"focusedDate",2),J([I()],G.prototype,"selectableDates",2),J([I()],G.prototype,"tabIndexSet",2),G=J([V("pkt-calendar")],G);const Fl={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},_i={props:Fl};var Vl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,he=(s,t,e,i)=>{for(var n=i>1?void 0:i?jl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Vl(t,e,n),n};let ee=class extends X{constructor(){super(),this.defaultSlot=E(),this.closeTag=_i.props.closeTag.default,this.size=_i.props.size.default,this.skin=_i.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=_i.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!1,composed:!0}))},this.slotController=new ot(this,this.defaultSlot),this._isClosed=!1}firstUpdated(t){var e,i;if(super.firstUpdated(t),this.closeTag&&!this.ariaLabel){const n=(i=(e=this.defaultSlot.value)==null?void 0:e.textContent)==null?void 0:i.trim();n&&(this._ariaDescription=`Klikk for å fjerne ${n}`)}}render(){const t={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},e={"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?u`
|
|
295
295
|
<button
|
|
296
296
|
class=${N(e)}
|
|
297
297
|
type=${this.type}
|
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
aria-label=${C(this.ariaLabel||void 0)}
|
|
300
300
|
aria-description=${C(this._ariaDescription||void 0)}
|
|
301
301
|
>
|
|
302
|
-
${this.iconName&&
|
|
302
|
+
${this.iconName&&u`<pkt-icon
|
|
303
303
|
class="pkt-tag__icon"
|
|
304
304
|
name=${this.iconName}
|
|
305
305
|
aria-hidden="true"
|
|
@@ -307,37 +307,37 @@
|
|
|
307
307
|
<span ${M(this.defaultSlot)}></span>
|
|
308
308
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
309
309
|
</button>
|
|
310
|
-
`:
|
|
310
|
+
`:u`
|
|
311
311
|
<span class=${N(t)}>
|
|
312
|
-
${this.iconName&&
|
|
312
|
+
${this.iconName&&u`<pkt-icon
|
|
313
313
|
class="pkt-tag__icon"
|
|
314
314
|
name=${this.iconName}
|
|
315
315
|
aria-hidden="true"
|
|
316
316
|
></pkt-icon>`}
|
|
317
317
|
<span ${M(this.defaultSlot)}></span>
|
|
318
318
|
</span>
|
|
319
|
-
`}};he([o({type:Boolean,reflect:!0})],ee.prototype,"closeTag",2),he([o({type:String,reflect:!0})],ee.prototype,"size",2),he([o({type:String,reflect:!0})],ee.prototype,"skin",2),he([o({type:String,reflect:!0})],ee.prototype,"textStyle",2),he([o({type:String,reflect:!0})],ee.prototype,"iconName",2),he([o({type:String})],ee.prototype,"type",2),he([o({type:String})],ee.prototype,"ariaLabel",2),he([
|
|
319
|
+
`}};he([o({type:Boolean,reflect:!0})],ee.prototype,"closeTag",2),he([o({type:String,reflect:!0})],ee.prototype,"size",2),he([o({type:String,reflect:!0})],ee.prototype,"skin",2),he([o({type:String,reflect:!0})],ee.prototype,"textStyle",2),he([o({type:String,reflect:!0})],ee.prototype,"iconName",2),he([o({type:String})],ee.prototype,"type",2),he([o({type:String})],ee.prototype,"ariaLabel",2),he([I()],ee.prototype,"_isClosed",2),he([I()],ee.prototype,"_ariaDescription",2),ee=he([V("pkt-tag")],ee);var Hl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,ps=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ul(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Hl(t,e,n),n};let Me=class extends pi{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(t,e,i){super.attributeChangedCallback(t,e,i),t==="level"&&i&&this.setLevel(Number(i)),t==="visuallyHidden"&&(this.visuallyHidden=i!==null&&i!=="false"),(t==="size"||t==="visuallyHidden"||t==="align"||t==="weight")&&this.updateHostClasses()}updated(t){super.updated(t),t.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel),this.hasAttribute("weight")||(this.weight=this.defaultWeightForLevel)),!this.hasAttribute("size")&&(t.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(t.has("size")||t.has("visuallyHidden")||t.has("align")||t.has("weight"))&&this.updateHostClasses()}setLevel(t){t>=1&&t<=6?(this.level=t,this.setAttribute("aria-level",String(t))):console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`)}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 u`<slot></slot>`}};ps([o({type:String,reflect:!0})],Me.prototype,"size",2),ps([o({type:Number,reflect:!0})],Me.prototype,"level",2),ps([o({type:String,reflect:!0})],Me.prototype,"weight",2),ps([o({type:Boolean,reflect:!0})],Me.prototype,"visuallyHidden",2),ps([o({type:String,reflect:!0})],Me.prototype,"align",2),Me=ps([V("pkt-heading")],Me);const zl={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},fs={props:zl};var ql=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,kt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Wl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ql(t,e,n),n};let ut=class extends X{constructor(){super(),this.defaultSlot=E(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=fs.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=fs.props.padding.default,this.skin=fs.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new ot(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var t,e;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=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),a=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?this.heading:"kort");return u`
|
|
320
320
|
<article
|
|
321
321
|
class=${N(i)}
|
|
322
322
|
aria-label=${C(this.clickCardLink?n:a)}
|
|
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():k}
|
|
327
327
|
${this.renderHeader()}
|
|
328
328
|
${this.renderSlot()}
|
|
329
|
-
${this.tagPosition==="bottom"?this.renderTags():
|
|
329
|
+
${this.tagPosition==="bottom"?this.renderTags():k}
|
|
330
330
|
${this.renderMetadata()}
|
|
331
331
|
</div>
|
|
332
332
|
</article>
|
|
333
|
-
`}renderImage(){const t={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return
|
|
334
|
-
${this.image.src&&
|
|
333
|
+
`}renderImage(){const t={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return u`
|
|
334
|
+
${this.image.src&&u`
|
|
335
335
|
<div class=${N(t)}>
|
|
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 u`
|
|
340
|
+
${this.heading&&!this.clickCardLink?u`
|
|
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
|
+
`:k}
|
|
351
|
+
`}renderLinkHeading(){return u`
|
|
352
|
+
${this.clickCardLink?u`
|
|
353
353
|
<pkt-heading
|
|
354
354
|
class="pkt-card__link-heading pkt-card__heading"
|
|
355
355
|
.level=${this.headinglevel||3}
|
|
@@ -364,25 +364,25 @@
|
|
|
364
364
|
>${this.heading}</a
|
|
365
365
|
>
|
|
366
366
|
</pkt-heading>
|
|
367
|
-
`:
|
|
368
|
-
`}renderSubheading(){return
|
|
369
|
-
${this.subheading?
|
|
370
|
-
`}renderHeader(){const t=!!this.heading||!!this.subheading;return
|
|
371
|
-
${t?
|
|
367
|
+
`:k}
|
|
368
|
+
`}renderSubheading(){return u`
|
|
369
|
+
${this.subheading?u` <p class="pkt-card__subheading ">${this.subheading}</p> `:k}
|
|
370
|
+
`}renderHeader(){const t=!!this.heading||!!this.subheading;return u`
|
|
371
|
+
${t?u`
|
|
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 t={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return
|
|
379
|
-
${this.tags.length>0?
|
|
377
|
+
`:k}
|
|
378
|
+
`}renderTags(){const t={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return u`
|
|
379
|
+
${this.tags.length>0?u`
|
|
380
380
|
<div
|
|
381
381
|
class=${N(t)}
|
|
382
382
|
role="list"
|
|
383
383
|
aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
|
|
384
384
|
>
|
|
385
|
-
${this.tags.map(e=>
|
|
385
|
+
${this.tags.map(e=>u`
|
|
386
386
|
<pkt-tag
|
|
387
387
|
role="listitem"
|
|
388
388
|
textStyle="normal-text"
|
|
@@ -394,21 +394,21 @@
|
|
|
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
|
+
`:k}
|
|
398
|
+
`}renderSlot(){return u`
|
|
399
|
+
${this.defaultSlot&&u`<section class="pkt-card__content" ${M(this.defaultSlot)}></section>`}
|
|
400
|
+
`}renderMetadata(){return u`
|
|
401
|
+
${this.metaLead||this.metaTrail?u`
|
|
402
402
|
<footer class="pkt-card__metadata">
|
|
403
|
-
${this.metaLead?
|
|
404
|
-
${this.metaTrail?
|
|
403
|
+
${this.metaLead?u`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`:k}
|
|
404
|
+
${this.metaTrail?u`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:k}
|
|
405
405
|
</footer>
|
|
406
|
-
`:
|
|
407
|
-
`}}
|
|
406
|
+
`:k}
|
|
407
|
+
`}};kt([o({type:String})],ut.prototype,"ariaLabel",2),kt([o({type:String})],ut.prototype,"metaLead",2),kt([o({type:Boolean})],ut.prototype,"borderOnHover",2),kt([o({type:String,reflect:!0})],ut.prototype,"clickCardLink",2),kt([o({type:String})],ut.prototype,"metaTrail",2),kt([o({type:String})],ut.prototype,"layout",2),kt([o({type:String})],ut.prototype,"heading",2),kt([o({type:Number})],ut.prototype,"headinglevel",2),kt([o({type:Object})],ut.prototype,"image",2),kt([o({type:String})],ut.prototype,"imageShape",2),kt([o({type:Boolean})],ut.prototype,"openLinkInNewTab",2),kt([o({type:String})],ut.prototype,"padding",2),kt([o({type:String,converter:{fromAttribute:s=>{const t=fs.props.skin.type;return s&&t.includes(s)?s:(s&&!t.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${fs.props.skin.default}".`),fs.props.skin.default)},toAttribute:s=>s}})],ut.prototype,"skin",2),kt([o({type:String})],ut.prototype,"subheading",2),kt([o({type:String})],ut.prototype,"tagPosition",2),kt([o({type:Array})],ut.prototype,"tags",2),ut=kt([V("pkt-card")],ut);/**
|
|
408
408
|
* @license
|
|
409
409
|
* Copyright 2017 Google LLC
|
|
410
410
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
411
|
-
*/const ga=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Zi=He(class extends ls{constructor(s){if(super(s),s.type!==Qt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const n=[],a=[];let r=0;for(const h of s)n[r]=i?i(h,r):r,a[r]=e(h,r),r++;return{values:a,keys:n}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const n=Dr(s),{values:a,keys:r}=this.dt(t,e,i);if(!Array.isArray(n))return this.ut=r,a;const h=this.ut??(this.ut=[]),c=[];let p,m,v=0,$=n.length-1,b=0,k=a.length-1;for(;v<=$&&b<=k;)if(n[v]===null)v++;else if(n[$]===null)$--;else if(h[v]===r[b])c[b]=Ve(n[v],a[b]),v++,b++;else if(h[$]===r[k])c[k]=Ve(n[$],a[k]),$--,k--;else if(h[v]===r[k])c[k]=Ve(n[v],a[k]),Ds(s,c[k+1],n[v]),v++,k--;else if(h[$]===r[b])c[b]=Ve(n[$],a[b]),Ds(s,n[v],n[$]),$--,b++;else if(p===void 0&&(p=ga(r,b,k),m=ga(h,v,$)),p.has(h[v]))if(p.has(h[$])){const x=m.get(r[b]),T=x!==void 0?n[x]:null;if(T===null){const S=Ds(s,n[v]);Ve(S,a[b]),c[b]=S}else c[b]=Ve(T,a[b]),Ds(s,n[v],T),n[x]=null;b++}else Hi(n[$]),$--;else Hi(n[v]),v++;for(;b<=k;){const x=Ds(s,c[k+1]);Ve(x,a[b]),c[b++]=x}for(;v<=$;){const x=n[v++];x!==null&&Hi(x)}return this.ut=r,jn(s,c),Dt}}),ma=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Rl=s=>new Promise(t=>setTimeout(t,s)),Oe=()=>{const s=ma(),t=ma();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},It={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Kl={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}},Ht={props:Kl};var Yl={},va;function Gl(){return va||(va=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,h=new WeakMap,c=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,$=new WeakMap,b=new WeakMap,k=new WeakMap,x=new WeakMap,T={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},S=(f,u)=>{for(let g in T){u[g]=null;let w=null;const B=T[g];Object.defineProperty(u,g,{get(){return w},set(U){w=U,f.isConnected?kt(f,B,U):m.set(f,u)}})}};function A(f){const u=n.get(f),{form:g}=u;re(f,g,u),fe(f,u.labels)}const I=(f,u=!1)=>{const g=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(U){return n.has(U)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let w=g.nextNode();const B=!u||f.disabled;for(;w;)w.formDisabledCallback&&B&&qt(w,f.disabled),w=g.nextNode()},O={attributes:!0,attributeFilter:["disabled","name"]},R=Zt()?new MutationObserver(f=>{for(const u of f){const g=u.target;if(u.attributeName==="disabled"&&(g.constructor.formAssociated?qt(g,g.hasAttribute("disabled")):g.localName==="fieldset"&&I(g)),u.attributeName==="name"&&g.constructor.formAssociated){const w=n.get(g),B=p.get(g);w.setFormValue(B)}}}):{};function et(f){f.forEach(u=>{const{addedNodes:g,removedNodes:w}=u,B=Array.from(g),U=Array.from(w);B.forEach(z=>{var Wt;if(n.has(z)&&z.constructor.formAssociated&&A(z),m.has(z)){const St=m.get(z);Object.keys(T).filter(Rt=>St[Rt]!==null).forEach(Rt=>{kt(z,T[Rt],St[Rt])}),m.delete(z)}if(x.has(z)){const St=x.get(z);kt(z,"internals-valid",St.validity.valid.toString()),kt(z,"internals-invalid",(!St.validity.valid).toString()),kt(z,"aria-invalid",(!St.validity.valid).toString()),x.delete(z)}if(z.localName==="form"){const St=c.get(z),Rt=document.createTreeWalker(z,NodeFilter.SHOW_ELEMENT,{acceptNode(cn){return n.has(cn)&&cn.constructor.formAssociated&&!(St&&St.has(cn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ni=Rt.nextNode();for(;ni;)A(ni),ni=Rt.nextNode()}z.localName==="fieldset"&&((Wt=R.observe)===null||Wt===void 0||Wt.call(R,z,O),I(z,!0))}),U.forEach(z=>{const Wt=n.get(z);Wt&&i.get(Wt)&&Et(Wt),h.has(z)&&h.get(z).disconnect()})})}function Ot(f){f.forEach(u=>{const{removedNodes:g}=u;g.forEach(w=>{const B=b.get(u.target);n.has(w)&&we(w),B.disconnect()})})}const Nt=f=>{var u,g;const w=new MutationObserver(Ot);!((u=window==null?void 0:window.ShadyDOM)===null||u===void 0)&&u.inUse&&f.mode&&f.host&&(f=f.host),(g=w.observe)===null||g===void 0||g.call(w,f,{childList:!0}),b.set(f,w)};Zt()&&new MutationObserver(et);const it={childList:!0,subtree:!0},kt=(f,u,g)=>{f.getAttribute(u)!==g&&f.setAttribute(u,g)},qt=(f,u)=>{f.toggleAttribute("internals-disabled",u),u?kt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[u])},Et=f=>{i.get(f).forEach(u=>{u.remove()}),i.set(f,[])},dt=(f,u)=>{const g=document.createElement("input");return g.type="hidden",g.name=f.getAttribute("name"),f.after(g),i.get(u).push(g),g},ae=(f,u)=>{var g;i.set(u,[]),(g=R.observe)===null||g===void 0||g.call(R,f,O)},fe=(f,u)=>{if(u.length){Array.from(u).forEach(w=>w.addEventListener("click",f.click.bind(f)));let g=u[0].id;u[0].id||(g=`${u[0].htmlFor}_Label`,u[0].id=g),kt(f,"aria-labelledby",g)}},V=f=>{const u=Array.from(f.elements).filter(U=>!U.tagName.includes("-")&&U.validity).map(U=>U.validity.valid),g=c.get(f)||[],w=Array.from(g).filter(U=>U.isConnected).map(U=>n.get(U).validity.valid),B=[...u,...w].includes(!1);f.toggleAttribute("internals-invalid",B),f.toggleAttribute("internals-valid",!B)},xt=f=>{V(Ft(f.target))},Gt=f=>{V(Ft(f.target))},$e=f=>{const u=["button[type=submit]","input[type=submit]","button:not([type])"].map(g=>`${g}:not([disabled])`).map(g=>`${g}:not([form])${f.id?`,${g}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",g=>{if(g.target.closest(u)){const w=c.get(f);if(f.noValidate)return;w.size&&Array.from(w).reverse().map(B=>n.get(B).reportValidity()).includes(!1)&&g.preventDefault()}})},ge=f=>{const u=c.get(f.target);u&&u.size&&u.forEach(g=>{g.constructor.formAssociated&&g.formResetCallback&&g.formResetCallback.apply(g)})},re=(f,u,g)=>{if(u){const w=c.get(u);if(w)w.add(f);else{const B=new Set;B.add(f),c.set(u,B),$e(u),u.addEventListener("reset",ge),u.addEventListener("input",xt),u.addEventListener("change",Gt)}r.set(u,{ref:f,internals:g}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[u])},0),V(u)}},Ft=f=>{let u=f.parentNode;return u&&u.tagName!=="FORM"&&(u=Ft(u)),u},ut=(f,u,g=DOMException)=>{if(!f.constructor.formAssociated)throw new g(u)},_e=(f,u,g)=>{const w=c.get(f);return w&&w.size&&w.forEach(B=>{n.get(B)[g]()||(u=!1)}),u},we=f=>{if(f.constructor.formAssociated){const u=n.get(f),{labels:g,form:w}=u;fe(f,g),re(f,w,u)}};function Zt(){return typeof MutationObserver<"u"}class Ss{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 Ie=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),es=(f,u,g)=>(f.valid=ss(u),Object.keys(u).forEach(w=>f[w]=u[w]),g&&V(g),f),ss=f=>{let u=!0;for(let g in f)g!=="valid"&&f[g]!==!1&&(u=!1);return u},xe=new WeakMap;function Xt(f,u){f.toggleAttribute(u,!0),f.part&&f.part.add(u)}class Se extends Set{static get isPolyfilled(){return!0}constructor(u){if(super(),!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");xe.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 g=super.add(u),w=xe.get(this),B=`state${u}`;return w.isConnected?Xt(w,B):setTimeout(()=>{Xt(w,B)}),g}clear(){for(let[u]of this.entries())this.delete(u);super.clear()}delete(u){const g=super.delete(u),w=xe.get(this);return w.isConnected?(w.toggleAttribute(`state${u}`,!1),w.part&&w.part.remove(`state${u}`)):setTimeout(()=>{w.toggleAttribute(`state${u}`,!1),w.part&&w.part.remove(`state${u}`)}),g}}function is(f,u,g,w){if(typeof u=="function"?f!==u||!w:!u.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?w:g==="a"?w.call(f):w?w.value:u.get(f)}function Mt(f,u,g,w,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,g),g}var yt;class Cs{constructor(u){yt.set(this,void 0),Mt(this,yt,u);for(let g=0;g<u.length;g++){let w=u[g];this[g]=w,w.hasAttribute("name")&&(this[w.getAttribute("name")]=w)}Object.freeze(this)}get length(){return is(this,yt,"f").length}[(yt=new WeakMap,Symbol.iterator)](){return is(this,yt,"f")[Symbol.iterator]()}item(u){return this[u]==null?null:this[u]}namedItem(u){return this[u]==null?null:this[u]}}function Le(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=g;const u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=w;function g(...U){let z=f.apply(this,U);return _e(this,z,"checkValidity")}function w(...U){let z=u.apply(this,U);return _e(this,z,"reportValidity")}const{get:B}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...U){const z=B.call(this,...U),Wt=Array.from(c.get(this)||[]);if(Wt.length===0)return z;const St=Array.from(z).concat(Wt).sort((Rt,ni)=>Rt.compareDocumentPosition?Rt.compareDocumentPosition(ni)&2?1:-1:0);return new Cs(St)}})}class si{static get isPolyfilled(){return!0}constructor(u){if(!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const g=u.getRootNode(),w=new Ss;this.states=new Se(u),t.set(this,u),e.set(this,w),n.set(u,this),S(u,this),ae(u,this),Object.seal(this),g instanceof DocumentFragment&&Nt(g)}checkValidity(){const u=t.get(this);if(ut(u,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=e.get(this);if(!g.valid){const w=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});u.dispatchEvent(w)}return g.valid}get form(){const u=t.get(this);ut(u,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let g;return u.constructor.formAssociated===!0&&(g=Ft(u)),g}get labels(){const u=t.get(this);ut(u,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const g=u.getAttribute("id"),w=u.getRootNode();return w&&g?w.querySelectorAll(`[for="${g}"]`):[]}reportValidity(){const u=t.get(this);if(ut(u,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=this.checkValidity(),w=$.get(this);if(w&&!u.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!g&&w&&(u.focus(),w.focus()),g}setFormValue(u){const g=t.get(this);if(ut(g,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Et(this),u!=null&&!(u instanceof FormData)){if(g.getAttribute("name")){const w=dt(g,this);w.value=u}}else u!=null&&u instanceof FormData&&Array.from(u).reverse().forEach(([w,B])=>{if(typeof B=="string"){const U=dt(g,this);U.name=w,U.value=B}});p.set(g,u)}setValidity(u,g,w){const B=t.get(this);if(ut(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.");$.set(this,w);const U=e.get(this),z={};for(const Rt in u)z[Rt]=u[Rt];Object.keys(z).length===0&&Ie(U);const Wt=Object.assign(Object.assign({},U),z);delete Wt.valid;const{valid:St}=es(U,Wt,this.form);if(!St&&!g)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.");a.set(this,St?"":g),B.isConnected?(B.toggleAttribute("internals-invalid",!St),B.toggleAttribute("internals-valid",St),kt(B,"aria-invalid",`${!St}`)):x.set(B,this)}get shadowRoot(){const u=t.get(this);return v.get(u)||null}get validationMessage(){const u=t.get(this);return ut(u,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const u=t.get(this);return ut(u,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const u=t.get(this);return ut(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 Pi(){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 g=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(w=>w in g.internals)}let Ts=!1,ii=!1;function j(f){ii||(ii=!0,window.CustomStateSet=Se,f&&(HTMLElement.prototype.attachInternals=function(...u){const g=f.call(this,u);return g.states=new Se(this),g}))}function Pt(f=!0){if(!Ts){if(Ts=!0,typeof window<"u"&&(window.ElementInternals=si),typeof CustomElementRegistry<"u"){const u=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(g,w,B){if(w.formAssociated){const U=w.prototype.connectedCallback;w.prototype.connectedCallback=function(){k.has(this)||(k.set(this,!0),this.hasAttribute("disabled")&&qt(this,!0)),U!=null&&U.apply(this),we(this)}}u.call(this,g,w,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 si(this)}),typeof Element<"u"){let u=function(...w){const B=g.apply(this,w);if(v.set(this,B),Zt()){const U=new MutationObserver(et);window.ShadyDOM?U.observe(this,it):U.observe(B,it),h.set(this,U)}return B};const g=Element.prototype.attachShadow;Element.prototype.attachShadow=u}Zt()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&Le(),(f||typeof window<"u"&&!window.CustomStateSet)&&j()}}return customElements.polyfillWrapFlushCallback||(Pi()?typeof window<"u"&&!window.CustomStateSet&&j(HTMLElement.prototype.attachInternals):Pt(!1)),s.forceCustomStateSetPolyfill=j,s.forceElementInternalsPolyfill=Pt,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Yl}Gl();var Zl=Object.defineProperty,H=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&Zl(t,e,n),n};let L=class extends X{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=Oe(),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=Ht.props.helptextDropdownButton.default,this.label=null,this.optionalText=At.forms.labels.optional,this.requiredText=At.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,i,n,a,r,h,c,p,m,v,$;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},At.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},At.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},At.forms.messages.invalidPattern,t):(a=t.validity)!=null&&a.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},At.forms.messages.tooShort,t):(r=t.validity)!=null&&r.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},At.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?At.forms.messages.rangeUnderflowMin.replace("{min}",(c=this.min)==null?void 0:c.toString()):At.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},At.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?At.forms.messages.rangeOverflowMax.replace("{max}",(v=this.max)==null?void 0:v.toString()):At.forms.messages.rangeOverflow,t):($=t.validity)!=null&&$.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(n=>{const a=n;a.name===this.name&&a.value!==this.value&&a.checked&&(a.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){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=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.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(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};H([o()],L.prototype,"defaultValue"),H([o({type:Boolean,reflect:!0})],L.prototype,"disabled"),H([o({type:Boolean,reflect:!0})],L.prototype,"readonly"),H([o({type:Boolean,reflect:!0})],L.prototype,"required"),H([o({type:Number,reflect:!0})],L.prototype,"max"),H([o({type:Number,reflect:!0})],L.prototype,"maxlength"),H([o({type:Number,reflect:!0})],L.prototype,"min"),H([o({type:Number,reflect:!0})],L.prototype,"minlength"),H([o({type:Number,reflect:!0})],L.prototype,"step"),H([o({type:String})],L.prototype,"ariaDescribedBy"),H([o({type:String})],L.prototype,"ariaLabelledby"),H([o({type:String,reflect:!0})],L.prototype,"name"),H([o({type:String,reflect:!0})],L.prototype,"pattern"),H([o({type:String,reflect:!0})],L.prototype,"placeholder"),H([o({type:String,reflect:!0})],L.prototype,"id"),H([o({type:Boolean})],L.prototype,"counter"),H([o({type:Boolean})],L.prototype,"hasError"),H([o({type:Boolean})],L.prototype,"inline"),H([o({type:Boolean})],L.prototype,"hasFieldset"),H([o({type:Boolean})],L.prototype,"optionalTag"),H([o({type:Boolean})],L.prototype,"requiredTag"),H([o({type:Boolean})],L.prototype,"skipForwardTestid"),H([o({type:Boolean,reflect:!0,converter:It})],L.prototype,"useWrapper"),H([o({type:Boolean,reflect:!0})],L.prototype,"fullwidth"),H([o({type:Number})],L.prototype,"counterMaxLength"),H([o({type:String})],L.prototype,"errorMessage"),H([o({type:String})],L.prototype,"helptext"),H([o({type:String})],L.prototype,"helptextDropdown"),H([o({type:String,reflect:!1})],L.prototype,"helptextDropdownButton"),H([o({type:String})],L.prototype,"label"),H([o({type:String,reflect:!1})],L.prototype,"optionalText"),H([o({type:String,reflect:!1})],L.prototype,"requiredText"),H([o({type:String,reflect:!1})],L.prototype,"tagText"),H([o({type:String,attribute:"data-testid"})],L.prototype,"dataTestid"),H([D()],L.prototype,"touched");let ba=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{hs(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{hs(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&hs(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var Xl=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,Ye=(s,t,e,i)=>{for(var n=i>1?void 0:i?Jl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Xl(t,e,n),n};let ve=class extends X{constructor(){super(),this.defaultSlot=E(),this.forId=Oe(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Ht.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new rt(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},e=N({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?d`<div class="pkt-inputwrapper__helptext-expandable">
|
|
411
|
+
*/const ga=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Gi=Fe(class extends rs{constructor(s){if(super(s),s.type!==Qt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const n=[],a=[];let r=0;for(const h of s)n[r]=i?i(h,r):r,a[r]=e(h,r),r++;return{values:a,keys:n}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const n=Dr(s),{values:a,keys:r}=this.dt(t,e,i);if(!Array.isArray(n))return this.ut=r,a;const h=this.ut??(this.ut=[]),c=[];let p,v,m=0,y=n.length-1,$=0,b=a.length-1;for(;m<=y&&$<=b;)if(n[m]===null)m++;else if(n[y]===null)y--;else if(h[m]===r[$])c[$]=Ve(n[m],a[$]),m++,$++;else if(h[y]===r[b])c[b]=Ve(n[y],a[b]),y--,b--;else if(h[m]===r[b])c[b]=Ve(n[m],a[b]),Ds(s,c[b+1],n[m]),m++,b--;else if(h[y]===r[$])c[$]=Ve(n[y],a[$]),Ds(s,n[m],n[y]),y--,$++;else if(p===void 0&&(p=ga(r,$,b),v=ga(h,m,y)),p.has(h[m]))if(p.has(h[y])){const x=v.get(r[$]),T=x!==void 0?n[x]:null;if(T===null){const O=Ds(s,n[m]);Ve(O,a[$]),c[$]=O}else c[$]=Ve(T,a[$]),Ds(s,n[m],T),n[x]=null;$++}else Vi(n[y]),y--;else Vi(n[m]),m++;for(;$<=b;){const x=Ds(s,c[b+1]);Ve(x,a[$]),c[$++]=x}for(;m<=y;){const x=n[m++];x!==null&&Vi(x)}return this.ut=r,Vn(s,c),Et}}),ma=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Rl=s=>new Promise(t=>setTimeout(t,s)),Ae=()=>{const s=ma(),t=ma();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},Mt={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Kl={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}},Ft={props:Kl};var Yl={},va;function Gl(){return va||(va=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,h=new WeakMap,c=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,y=new WeakMap,$=new WeakMap,b=new WeakMap,x=new WeakMap,T={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"},O=(g,d)=>{for(let f in T){d[f]=null;let _=null;const D=T[f];Object.defineProperty(d,f,{get(){return _},set(F){_=F,g.isConnected?gt(g,D,F):v.set(g,d)}})}};function S(g){const d=n.get(g),{form:f}=d;ae(g,f,d),Pt(g,d.labels)}const B=(g,d=!1)=>{const f=document.createTreeWalker(g,NodeFilter.SHOW_ELEMENT,{acceptNode(F){return n.has(F)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=f.nextNode();const D=!d||g.disabled;for(;_;)_.formDisabledCallback&&D&&Ut(_,g.disabled),_=f.nextNode()},A={attributes:!0,attributeFilter:["disabled","name"]},R=re()?new MutationObserver(g=>{for(const d of g){const f=d.target;if(d.attributeName==="disabled"&&(f.constructor.formAssociated?Ut(f,f.hasAttribute("disabled")):f.localName==="fieldset"&&B(f)),d.attributeName==="name"&&f.constructor.formAssociated){const _=n.get(f),D=p.get(f);_.setFormValue(D)}}}):{};function et(g){g.forEach(d=>{const{addedNodes:f,removedNodes:_}=d,D=Array.from(f),F=Array.from(_);D.forEach(j=>{var qt;if(n.has(j)&&j.constructor.formAssociated&&S(j),v.has(j)){const wt=v.get(j);Object.keys(T).filter(Wt=>wt[Wt]!==null).forEach(Wt=>{gt(j,T[Wt],wt[Wt])}),v.delete(j)}if(x.has(j)){const wt=x.get(j);gt(j,"internals-valid",wt.validity.valid.toString()),gt(j,"internals-invalid",(!wt.validity.valid).toString()),gt(j,"aria-invalid",(!wt.validity.valid).toString()),x.delete(j)}if(j.localName==="form"){const wt=c.get(j),Wt=document.createTreeWalker(j,NodeFilter.SHOW_ELEMENT,{acceptNode(cn){return n.has(cn)&&cn.constructor.formAssociated&&!(wt&&wt.has(cn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ni=Wt.nextNode();for(;ni;)S(ni),ni=Wt.nextNode()}j.localName==="fieldset"&&((qt=R.observe)===null||qt===void 0||qt.call(R,j,A),B(j,!0))}),F.forEach(j=>{const qt=n.get(j);qt&&i.get(qt)&&Yt(qt),h.has(j)&&h.get(j).disconnect()})})}function Tt(g){g.forEach(d=>{const{removedNodes:f}=d;f.forEach(_=>{const D=$.get(d.target);n.has(_)&&we(_),D.disconnect()})})}const Nt=g=>{var d,f;const _=new MutationObserver(Tt);!((d=window==null?void 0:window.ShadyDOM)===null||d===void 0)&&d.inUse&&g.mode&&g.host&&(g=g.host),(f=_.observe)===null||f===void 0||f.call(_,g,{childList:!0}),$.set(g,_)};re()&&new MutationObserver(et);const nt={childList:!0,subtree:!0},gt=(g,d,f)=>{g.getAttribute(d)!==f&&g.setAttribute(d,f)},Ut=(g,d)=>{g.toggleAttribute("internals-disabled",d),d?gt(g,"aria-disabled","true"):g.removeAttribute("aria-disabled"),g.formDisabledCallback&&g.formDisabledCallback.apply(g,[d])},Yt=g=>{i.get(g).forEach(d=>{d.remove()}),i.set(g,[])},mt=(g,d)=>{const f=document.createElement("input");return f.type="hidden",f.name=g.getAttribute("name"),g.after(f),i.get(d).push(f),f},$e=(g,d)=>{var f;i.set(d,[]),(f=R.observe)===null||f===void 0||f.call(R,g,A)},Pt=(g,d)=>{if(d.length){Array.from(d).forEach(_=>_.addEventListener("click",g.click.bind(g)));let f=d[0].id;d[0].id||(f=`${d[0].htmlFor}_Label`,d[0].id=f),gt(g,"aria-labelledby",f)}},Dt=g=>{const d=Array.from(g.elements).filter(F=>!F.tagName.includes("-")&&F.validity).map(F=>F.validity.valid),f=c.get(g)||[],_=Array.from(f).filter(F=>F.isConnected).map(F=>n.get(F).validity.valid),D=[...d,..._].includes(!1);g.toggleAttribute("internals-invalid",D),g.toggleAttribute("internals-valid",!D)},zt=g=>{Dt(Lt(g.target))},Gt=g=>{Dt(Lt(g.target))},q=g=>{const d=["button[type=submit]","input[type=submit]","button:not([type])"].map(f=>`${f}:not([disabled])`).map(f=>`${f}:not([form])${g.id?`,${f}[form='${g.id}']`:""}`).join(",");g.addEventListener("click",f=>{if(f.target.closest(d)){const _=c.get(g);if(g.noValidate)return;_.size&&Array.from(_).reverse().map(D=>n.get(D).reportValidity()).includes(!1)&&f.preventDefault()}})},It=g=>{const d=c.get(g.target);d&&d.size&&d.forEach(f=>{f.constructor.formAssociated&&f.formResetCallback&&f.formResetCallback.apply(f)})},ae=(g,d,f)=>{if(d){const _=c.get(d);if(_)_.add(g);else{const D=new Set;D.add(g),c.set(d,D),q(d),d.addEventListener("reset",It),d.addEventListener("input",zt),d.addEventListener("change",Gt)}r.set(d,{ref:g,internals:f}),g.constructor.formAssociated&&g.formAssociatedCallback&&setTimeout(()=>{g.formAssociatedCallback.apply(g,[d])},0),Dt(d)}},Lt=g=>{let d=g.parentNode;return d&&d.tagName!=="FORM"&&(d=Lt(d)),d},rt=(g,d,f=DOMException)=>{if(!g.constructor.formAssociated)throw new f(d)},_e=(g,d,f)=>{const _=c.get(g);return _&&_.size&&_.forEach(D=>{n.get(D)[f]()||(d=!1)}),d},we=g=>{if(g.constructor.formAssociated){const d=n.get(g),{labels:f,form:_}=d;Pt(g,f),ae(g,_,d)}};function re(){return typeof MutationObserver<"u"}class si{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 ws=g=>(g.badInput=!1,g.customError=!1,g.patternMismatch=!1,g.rangeOverflow=!1,g.rangeUnderflow=!1,g.stepMismatch=!1,g.tooLong=!1,g.tooShort=!1,g.typeMismatch=!1,g.valid=!0,g.valueMissing=!1,g),xs=(g,d,f)=>(g.valid=Qe(d),Object.keys(d).forEach(_=>g[_]=d[_]),f&&Dt(f),g),Qe=g=>{let d=!0;for(let f in g)f!=="valid"&&g[f]!==!1&&(d=!1);return d},fe=new WeakMap;function ge(g,d){g.toggleAttribute(d,!0),g.part&&g.part.add(d)}class De extends Set{static get isPolyfilled(){return!0}constructor(d){if(super(),!d||!d.tagName||d.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");fe.set(this,d)}add(d){if(!/^--/.test(d)||typeof d!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${d} must start with '--'.`);const f=super.add(d),_=fe.get(this),D=`state${d}`;return _.isConnected?ge(_,D):setTimeout(()=>{ge(_,D)}),f}clear(){for(let[d]of this.entries())this.delete(d);super.clear()}delete(d){const f=super.delete(d),_=fe.get(this);return _.isConnected?(_.toggleAttribute(`state${d}`,!1),_.part&&_.part.remove(`state${d}`)):setTimeout(()=>{_.toggleAttribute(`state${d}`,!1),_.part&&_.part.remove(`state${d}`)}),f}}function ts(g,d,f,_){if(typeof d=="function"?g!==d||!_:!d.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?_:f==="a"?_.call(g):_?_.value:d.get(g)}function xe(g,d,f,_,D){if(typeof d=="function"?g!==d||!0:!d.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d.set(g,f),f}var Zt;class es{constructor(d){Zt.set(this,void 0),xe(this,Zt,d);for(let f=0;f<d.length;f++){let _=d[f];this[f]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return ts(this,Zt,"f").length}[(Zt=new WeakMap,Symbol.iterator)](){return ts(this,Zt,"f")[Symbol.iterator]()}item(d){return this[d]==null?null:this[d]}namedItem(d){return this[d]==null?null:this[d]}}function _t(){const g=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=f;const d=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function f(...F){let j=g.apply(this,F);return _e(this,j,"checkValidity")}function _(...F){let j=d.apply(this,F);return _e(this,j,"reportValidity")}const{get:D}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...F){const j=D.call(this,...F),qt=Array.from(c.get(this)||[]);if(qt.length===0)return j;const wt=Array.from(j).concat(qt).sort((Wt,ni)=>Wt.compareDocumentPosition?Wt.compareDocumentPosition(ni)&2?1:-1:0);return new es(wt)}})}class Xt{static get isPolyfilled(){return!0}constructor(d){if(!d||!d.tagName||d.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const f=d.getRootNode(),_=new si;this.states=new De(d),t.set(this,d),e.set(this,_),n.set(d,this),O(d,this),$e(d,this),Object.seal(this),f instanceof DocumentFragment&&Nt(f)}checkValidity(){const d=t.get(this);if(rt(d,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const f=e.get(this);if(!f.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});d.dispatchEvent(_)}return f.valid}get form(){const d=t.get(this);rt(d,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let f;return d.constructor.formAssociated===!0&&(f=Lt(d)),f}get labels(){const d=t.get(this);rt(d,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const f=d.getAttribute("id"),_=d.getRootNode();return _&&f?_.querySelectorAll(`[for="${f}"]`):[]}reportValidity(){const d=t.get(this);if(rt(d,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const f=this.checkValidity(),_=y.get(this);if(_&&!d.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!f&&_&&(d.focus(),_.focus()),f}setFormValue(d){const f=t.get(this);if(rt(f,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Yt(this),d!=null&&!(d instanceof FormData)){if(f.getAttribute("name")){const _=mt(f,this);_.value=d}}else d!=null&&d instanceof FormData&&Array.from(d).reverse().forEach(([_,D])=>{if(typeof D=="string"){const F=mt(f,this);F.name=_,F.value=D}});p.set(f,d)}setValidity(d,f,_){const D=t.get(this);if(rt(D,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!d)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");y.set(this,_);const F=e.get(this),j={};for(const Wt in d)j[Wt]=d[Wt];Object.keys(j).length===0&&ws(F);const qt=Object.assign(Object.assign({},F),j);delete qt.valid;const{valid:wt}=xs(F,qt,this.form);if(!wt&&!f)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.");a.set(this,wt?"":f),D.isConnected?(D.toggleAttribute("internals-invalid",!wt),D.toggleAttribute("internals-valid",wt),gt(D,"aria-invalid",`${!wt}`)):x.set(D,this)}get shadowRoot(){const d=t.get(this);return m.get(d)||null}get validationMessage(){const d=t.get(this);return rt(d,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const d=t.get(this);return rt(d,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const d=t.get(this);return rt(d,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(d.disabled||d.hasAttribute("disabled")||d.hasAttribute("readonly"))}}function hn(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class g extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const d=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(d,g);const f=new g;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in f.internals)}let Ss=!1,ii=!1;function Cs(g){ii||(ii=!0,window.CustomStateSet=De,g&&(HTMLElement.prototype.attachInternals=function(...d){const f=g.call(this,d);return f.states=new De(this),f}))}function Ts(g=!0){if(!Ss){if(Ss=!0,typeof window<"u"&&(window.ElementInternals=Xt),typeof CustomElementRegistry<"u"){const d=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(f,_,D){if(_.formAssociated){const F=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){b.has(this)||(b.set(this,!0),this.hasAttribute("disabled")&&Ut(this,!0)),F!=null&&F.apply(this),we(this)}}d.call(this,f,_,D)}}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 Xt(this)}),typeof Element<"u"){let d=function(..._){const D=f.apply(this,_);if(m.set(this,D),re()){const F=new MutationObserver(et);window.ShadyDOM?F.observe(this,nt):F.observe(D,nt),h.set(this,F)}return D};const f=Element.prototype.attachShadow;Element.prototype.attachShadow=d}re()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,nt),typeof HTMLFormElement<"u"&&_t(),(g||typeof window<"u"&&!window.CustomStateSet)&&Cs()}}return customElements.polyfillWrapFlushCallback||(hn()?typeof window<"u"&&!window.CustomStateSet&&Cs(HTMLElement.prototype.attachInternals):Ts(!1)),s.forceCustomStateSetPolyfill=Cs,s.forceElementInternalsPolyfill=Ts,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Yl}Gl();var Zl=Object.defineProperty,H=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&Zl(t,e,n),n};let L=class extends X{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=Ae(),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=Ft.props.helptextDropdownButton.default,this.label=null,this.optionalText=Ct.forms.labels.optional,this.requiredText=Ct.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,i,n,a,r,h,c,p,v,m,y;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},Ct.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},Ct.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},Ct.forms.messages.invalidPattern,t):(a=t.validity)!=null&&a.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},Ct.forms.messages.tooShort,t):(r=t.validity)!=null&&r.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},Ct.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?Ct.forms.messages.rangeUnderflowMin.replace("{min}",(c=this.min)==null?void 0:c.toString()):Ct.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},Ct.forms.messages.invalid,t):(v=t.validity)!=null&&v.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?Ct.forms.messages.rangeOverflowMax.replace("{max}",(m=this.max)==null?void 0:m.toString()):Ct.forms.messages.rangeOverflow,t):(y=t.validity)!=null&&y.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(n=>{const a=n;a.name===this.name&&a.value!==this.value&&a.checked&&(a.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){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=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.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(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};H([o()],L.prototype,"defaultValue"),H([o({type:Boolean,reflect:!0})],L.prototype,"disabled"),H([o({type:Boolean,reflect:!0})],L.prototype,"readonly"),H([o({type:Boolean,reflect:!0})],L.prototype,"required"),H([o({type:Number,reflect:!0})],L.prototype,"max"),H([o({type:Number,reflect:!0})],L.prototype,"maxlength"),H([o({type:Number,reflect:!0})],L.prototype,"min"),H([o({type:Number,reflect:!0})],L.prototype,"minlength"),H([o({type:Number,reflect:!0})],L.prototype,"step"),H([o({type:String})],L.prototype,"ariaDescribedBy"),H([o({type:String})],L.prototype,"ariaLabelledby"),H([o({type:String,reflect:!0})],L.prototype,"name"),H([o({type:String,reflect:!0})],L.prototype,"pattern"),H([o({type:String,reflect:!0})],L.prototype,"placeholder"),H([o({type:String,reflect:!0})],L.prototype,"id"),H([o({type:Boolean})],L.prototype,"counter"),H([o({type:Boolean})],L.prototype,"hasError"),H([o({type:Boolean})],L.prototype,"inline"),H([o({type:Boolean})],L.prototype,"hasFieldset"),H([o({type:Boolean})],L.prototype,"optionalTag"),H([o({type:Boolean})],L.prototype,"requiredTag"),H([o({type:Boolean})],L.prototype,"skipForwardTestid"),H([o({type:Boolean,reflect:!0,converter:Mt})],L.prototype,"useWrapper"),H([o({type:Boolean,reflect:!0})],L.prototype,"fullwidth"),H([o({type:Number})],L.prototype,"counterMaxLength"),H([o({type:String})],L.prototype,"errorMessage"),H([o({type:String})],L.prototype,"helptext"),H([o({type:String})],L.prototype,"helptextDropdown"),H([o({type:String,reflect:!1})],L.prototype,"helptextDropdownButton"),H([o({type:String})],L.prototype,"label"),H([o({type:String,reflect:!1})],L.prototype,"optionalText"),H([o({type:String,reflect:!1})],L.prototype,"requiredText"),H([o({type:String,reflect:!1})],L.prototype,"tagText"),H([o({type:String,attribute:"data-testid"})],L.prototype,"dataTestid"),H([I()],L.prototype,"touched");let ba=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{os(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{os(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&os(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var Xl=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,Re=(s,t,e,i)=>{for(var n=i>1?void 0:i?Jl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Xl(t,e,n),n};let ve=class extends X{constructor(){super(),this.defaultSlot=E(),this.forId=Ae(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Ft.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new ot(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},e=N({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?u`<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"
|
|
@@ -425,51 +425,51 @@
|
|
|
425
425
|
>
|
|
426
426
|
${mi(this.helptextDropdown)}
|
|
427
427
|
</div>
|
|
428
|
-
</div>`:
|
|
428
|
+
</div>`:k;return u`${u`<div class="${e}">
|
|
429
429
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
430
430
|
<div class="pkt-contents" ${M(this.defaultSlot)} name="helptext"></div>
|
|
431
431
|
${this.helptext&&mi(this.helptext)}
|
|
432
432
|
</div>
|
|
433
433
|
${i()}
|
|
434
|
-
</div>`}`}};
|
|
435
|
-
${this.tagText?
|
|
436
|
-
${this.optionalTag?
|
|
437
|
-
${this.requiredTag?
|
|
438
|
-
`,a=()=>this.useWrapper?this.hasFieldset?
|
|
434
|
+
</div>`}`}};Re([o({type:String,reflect:!0})],ve.prototype,"forId",2),Re([o({type:String})],ve.prototype,"helptext",2),Re([o({type:String})],ve.prototype,"helptextDropdown",2),Re([o({type:String})],ve.prototype,"helptextDropdownButton",2),Re([I()],ve.prototype,"isHelpTextOpen",2),Re([I()],ve.prototype,"filledSlots",2),ve=Re([V("pkt-helptext")],ve);var Ql=Object.defineProperty,th=Object.getOwnPropertyDescriptor,st=(s,t,e,i)=>{for(var n=i>1?void 0:i?th(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Ql(t,e,n),n};let Q=class extends X{constructor(){super(),this.defaultSlot=E(),this.helptextSlot=E(),this.forId=Ae(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=Ft.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=Ft.props.optionalTag.default,this.optionalText=Ft.props.optionalText.default,this.requiredTag=Ft.props.requiredTag.default,this.requiredText=Ft.props.requiredText.default,this.tagText=null,this.hasError=Ft.props.hasError.default,this.errorMessage="",this.disabled=Ft.props.disabled.default,this.inline=Ft.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=Ft.props.hasFieldset.default,this.role="group",this.useWrapper=Ft.props.useWrapper.default,this.slotController=new ot(this,this.defaultSlot,this.helptextSlot)}updated(t){super.updated(t)}render(){const t={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},e="pkt-tag pkt-tag--small pkt-tag--thin-text",i=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:k,n=()=>u`
|
|
435
|
+
${this.tagText?u`<span class=${e+" pkt-tag--gray"}>${this.tagText}</span>`:k}
|
|
436
|
+
${this.optionalTag?u`<span class=${e+" pkt-tag--blue-light"}>${this.optionalText}</span>`:k}
|
|
437
|
+
${this.requiredTag?u`<span class=${e+" pkt-tag--beige"}>${this.requiredText}</span>`:k}
|
|
438
|
+
`,a=()=>this.useWrapper?this.hasFieldset?u`<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>`:u`<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
|
+
>`:u`<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>`,r=()=>
|
|
458
|
+
</label>`,r=()=>u`
|
|
459
459
|
<pkt-helptext
|
|
460
460
|
class="${C(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=${
|
|
464
|
+
.helptextDropdownButton=${this.helptextDropdownButton||Ft.props.helptextDropdownButton.default}
|
|
465
|
+
@toggleHelpText=${m=>{this.toggleDropdown(m)}}
|
|
466
466
|
${M(this.helptextSlot)}
|
|
467
467
|
name="helptext"
|
|
468
468
|
></pkt-helptext>
|
|
469
|
-
`,h=()=>this.counter?
|
|
470
|
-
${this.counterError?this.counterError:
|
|
471
|
-
${this.counterMaxLength?`/${this.counterMaxLength}`:
|
|
472
|
-
</div>`:
|
|
469
|
+
`,h=()=>this.counter?u`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
470
|
+
${this.counterError?this.counterError:k} ${this.counterCurrent||0}
|
|
471
|
+
${this.counterMaxLength?`/${this.counterMaxLength}`:k}
|
|
472
|
+
</div>`:k,c=()=>this.hasError&&this.errorMessage?u`<pkt-alert
|
|
473
473
|
skin="error"
|
|
474
474
|
compact
|
|
475
475
|
id=${`${this.forId}-error`}
|
|
@@ -477,16 +477,16 @@
|
|
|
477
477
|
aria-atomic="true"
|
|
478
478
|
>
|
|
479
479
|
${mi(this.errorMessage)}
|
|
480
|
-
</pkt-alert>`:
|
|
480
|
+
</pkt-alert>`:k,p=()=>u`
|
|
481
481
|
${a()}
|
|
482
482
|
${r()}
|
|
483
|
-
${this.counterPosition==="top"?h():
|
|
483
|
+
${this.counterPosition==="top"?h():k}
|
|
484
484
|
<div class="pkt-contents" ${M(this.defaultSlot)}></div>
|
|
485
|
-
${this.counterPosition==="bottom"?h():
|
|
485
|
+
${this.counterPosition==="bottom"?h():k}
|
|
486
486
|
${c()}
|
|
487
|
-
`,
|
|
487
|
+
`,v=()=>this.hasFieldset?u`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
|
|
488
488
|
${p()}
|
|
489
|
-
</fieldset>`:
|
|
489
|
+
</fieldset>`:u`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return u`<div class=${N(t)}>${v()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};st([o({type:String})],Q.prototype,"forId",2),st([o({type:String})],Q.prototype,"label",2),st([o({type:String})],Q.prototype,"helptext",2),st([o({type:String})],Q.prototype,"helptextDropdown",2),st([o({type:String})],Q.prototype,"helptextDropdownButton",2),st([o({type:Boolean})],Q.prototype,"counter",2),st([o({type:Number})],Q.prototype,"counterCurrent",2),st([o({type:Number})],Q.prototype,"counterMaxLength",2),st([o({type:String})],Q.prototype,"counterError",2),st([o({type:String,reflect:!1})],Q.prototype,"counterPosition",2),st([o({type:Boolean})],Q.prototype,"optionalTag",2),st([o({type:String})],Q.prototype,"optionalText",2),st([o({type:Boolean})],Q.prototype,"requiredTag",2),st([o({type:String})],Q.prototype,"requiredText",2),st([o({type:String})],Q.prototype,"tagText",2),st([o({type:Boolean})],Q.prototype,"hasError",2),st([o({type:String})],Q.prototype,"errorMessage",2),st([o({type:Boolean})],Q.prototype,"disabled",2),st([o({type:Boolean})],Q.prototype,"inline",2),st([o({type:String})],Q.prototype,"ariaDescribedby",2),st([o({type:Boolean})],Q.prototype,"hasFieldset",2),st([o({type:String,reflect:!0})],Q.prototype,"role",2),st([o({type:Boolean,reflect:!0,converter:Mt})],Q.prototype,"useWrapper",2),Q=st([V("pkt-input-wrapper")],Q);var eh=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,xt=(s,t,e,i)=>{for(var n=i>1?void 0:i?sh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&eh(t,e,n),n};let yt=class extends X{constructor(){super(...arguments),this.id=Ae(),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(t){(t.has("options")||t.has("searchValue"))&&this.filterOptions(),super.updated(t)}attributeChangedCallback(t,e,i){(t==="options"||t==="searchValue"||t==="search-value")&&this.filterOptions(),super.attributeChangedCallback(t,e,i)}render(){return u`
|
|
490
490
|
<div
|
|
491
491
|
class=${N({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
492
492
|
role="listbox"
|
|
@@ -500,7 +500,7 @@
|
|
|
500
500
|
${this.renderList()}
|
|
501
501
|
</ul>
|
|
502
502
|
</div>
|
|
503
|
-
`}renderCheckboxOrCheckIcon(t,e){return this.isMultiSelect?
|
|
503
|
+
`}renderCheckboxOrCheckIcon(t,e){return this.isMultiSelect?u`
|
|
504
504
|
<input
|
|
505
505
|
class="pkt-input-check__input-checkbox"
|
|
506
506
|
type="checkbox"
|
|
@@ -511,8 +511,8 @@
|
|
|
511
511
|
aria-labelledby=${this.id+"-option-label-"+e}
|
|
512
512
|
?disabled=${this.disabled||t.disabled||this.maxIsReached&&!t.selected}
|
|
513
513
|
/>
|
|
514
|
-
`:t.selected?
|
|
515
|
-
${
|
|
514
|
+
`:t.selected?u`<pkt-icon name="check-big"></pkt-icon>`:k}renderList(){return u`
|
|
515
|
+
${Gi(this._filteredOptions,t=>t.value,(t,e)=>u`
|
|
516
516
|
<li
|
|
517
517
|
@click=${()=>{this.toggleOption(t)}}
|
|
518
518
|
aria-selected=${t.selected?"true":"false"}
|
|
@@ -528,15 +528,15 @@
|
|
|
528
528
|
>
|
|
529
529
|
${this.renderCheckboxOrCheckIcon(t,e)}
|
|
530
530
|
<span class="pkt-listbox__option-label" id=${this.id+"-option-label-"+e}>
|
|
531
|
-
${t.prefix?
|
|
531
|
+
${t.prefix?u`<span class="pkt-listbox__option-prefix">${t.prefix}</span>`:k}
|
|
532
532
|
${t.label||t.value}
|
|
533
533
|
</span>
|
|
534
|
-
${t.description?
|
|
534
|
+
${t.description?u`<span class="pkt-listbox__option-description pkt-txt-14-light"
|
|
535
535
|
>${t.description}</span
|
|
536
|
-
>`:
|
|
536
|
+
>`:k}
|
|
537
537
|
</li>
|
|
538
538
|
`)}
|
|
539
|
-
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?
|
|
539
|
+
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?u`
|
|
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
|
+
`:k}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(t=>t.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?u`
|
|
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
|
+
`:k}renderUserMessage(){return this.userMessage?u`<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>`:k}renderSearch(){return this.includeSearch?u`
|
|
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||Ct.forms.search.placeholder}
|
|
574
574
|
@input=${this.handleSearchInput}
|
|
575
575
|
@keydown=${this.handleSearchKeydown}
|
|
576
576
|
.value=${this.searchValue}
|
|
@@ -580,7 +580,7 @@
|
|
|
580
580
|
role="searchbox"
|
|
581
581
|
/>
|
|
582
582
|
</div>
|
|
583
|
-
`:
|
|
583
|
+
`:k}handleSearchInput(t){this.searchValue=t.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(t){switch(t.key){case"Enter":t.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),t.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(t){const e=t.currentTarget,i=e.dataset.value,n=e.dataset.type,a=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&n!=="new-option"&&n!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":i&&(a?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():n==="searchbox"||n==="new-option"?this.focusFirstOption():this.focusNextOption(e),t.preventDefault();break;case"ArrowUp":if(t.altKey)this.focusFirstOption();else if(e.dataset.index==="0"&&this.includeSearch){const r=this.querySelector('[role="searchbox"]');r&&r.focus()}else if(e.dataset.index==="0"&&this.customUserInput){const r=this.querySelector('[data-type="new-option"]');r&&r.focus()}else this.focusPreviousOption(e);t.preventDefault();break;case"Home":this.focusFirstOption(),t.preventDefault();break;case"End":this.focusLastOption(),t.preventDefault();break;default:(t.metaKey||t.ctrlKey)&&t.key==="a"&&(this.selectAll(),t.preventDefault()),this.isLetterOrSpace(t.key)&&(this.handleTypeAhead(t.key),t.preventDefault());break}}focusAndScrollIntoView(t){t.scrollIntoView({block:"nearest"}),window.setTimeout(()=>t.focus(),0)}focusNextOption(t){const e=t.nextElementSibling;e&&this.focusAndScrollIntoView(e)}focusPreviousOption(t){const e=t.previousElementSibling;if(t.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else e&&this.focusAndScrollIntoView(e)}focusFirstOption(){const t=this.getOptionElements()[0];t&&this.focusAndScrollIntoView(t)}focusLastOption(){const t=this.getOptionElements().pop();t&&this.focusAndScrollIntoView(t)}focusFirstOrSelectedOption(){if(this.disabled)return;const t=this.getOptionElements().find(e=>e.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const e=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(e)}else if(t)this.focusAndScrollIntoView(t);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const e=this.querySelector('[role="searchbox"]');window.setTimeout(()=>e.focus(),0)}else this.focusFirstOption()}toggleOption(t){const e=t instanceof HTMLElement?t.dataset.disabled:t.disabled;if(this.disabled||e)return;const i=t instanceof HTMLElement?t.dataset.value:t.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(t=>{var e;return(t.fulltext||t.label+t.value+(t.prefix||"")).toLowerCase().includes(((e=this.searchValue)==null?void 0:e.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(t){return/^[\p{L} ]$/u.test(t)}handleTypeAhead(t){this.typeAheadString+=t.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const e=this.getOptionElements().find(i=>{var n;return(n=i.textContent)==null?void 0:n.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};xt([o({type:String})],yt.prototype,"id",2),xt([o({type:String})],yt.prototype,"label",2),xt([o({type:Array})],yt.prototype,"options",2),xt([o({type:Boolean,reflect:!0})],yt.prototype,"isOpen",2),xt([o({type:Boolean})],yt.prototype,"disabled",2),xt([o({type:Boolean})],yt.prototype,"includeSearch",2),xt([o({type:Boolean})],yt.prototype,"isMultiSelect",2),xt([o({type:Boolean})],yt.prototype,"allowUserInput",2),xt([o({type:Boolean})],yt.prototype,"maxIsReached",2),xt([o({type:String})],yt.prototype,"customUserInput",2),xt([o({type:String})],yt.prototype,"searchPlaceholder",2),xt([o({type:String})],yt.prototype,"searchValue",2),xt([o({type:Number})],yt.prototype,"maxLength",2),xt([o({type:String})],yt.prototype,"userMessage",2),xt([I()],yt.prototype,"_filteredOptions",2),yt=xt([V("pkt-listbox")],yt);const ih={displayValueAs:{default:"label"}},nh={props:ih};var ah=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,lt=(s,t,e,i)=>{for(var n=i>1?void 0:i?rh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ah(t,e,n),n};let at=class extends L{constructor(){super(),this.helptextSlot=E(),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=nh.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=E(),this.arrowRef=E(),this.listboxRef=E(),this.focusRef=E(),this.optionTagRef=E(),this.optionsController=new ba(this),this.slotController=new ot(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t;if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const e=((t=this.options)==null?void 0:t.filter(i=>i.userAdded))||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const n={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(n.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(n.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(n.description=i.getAttribute("description")||void 0),n.fulltext=n.value+n.label+(n.prefix||""),e.push(n)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.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()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const e=(t.get("options")||this._options||[]).filter(n=>n&&n.userAdded).filter(n=>!(Array.isArray(this.options)?this.options:[]).some(a=>a.value===n.value)),i=[...e,...this.options];this._options=i,e.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 a=[...this._value];this._value=[...this._value,n.value],this.valueChanged(this._value,a)}n.fulltext=n.value+n.label+(n.prefix||""),n.selected=n.selected||this._value.includes(n.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="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]])),t==="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(t,e,i)}render(){return u`
|
|
584
584
|
<pkt-input-wrapper
|
|
585
585
|
.label=${this.label}
|
|
586
586
|
.helptext=${this.helptext}
|
|
@@ -608,9 +608,9 @@
|
|
|
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?u`<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():k}
|
|
614
614
|
${this.renderInputField()}
|
|
615
615
|
<div
|
|
616
616
|
class="pkt-btn pkt-btn--tertiary pkt-combobox__arrow"
|
|
@@ -662,11 +662,11 @@
|
|
|
662
662
|
></pkt-listbox>
|
|
663
663
|
</div>
|
|
664
664
|
|
|
665
|
-
${this.tagPlacement==="outside"&&this.multiple?
|
|
665
|
+
${this.tagPlacement==="outside"&&this.multiple?u`<div class="pkt-combobox__tags-outside">
|
|
666
666
|
${this.renderSingleOrMultipleValues()}
|
|
667
|
-
</div>`:
|
|
667
|
+
</div>`:k}
|
|
668
668
|
</pkt-input-wrapper>
|
|
669
|
-
`}renderInputField(){return this.typeahead||this.allowUserInput?
|
|
669
|
+
`}renderInputField(){return this.typeahead||this.allowUserInput?u`
|
|
670
670
|
<div class="pkt-combobox__input-div combobox__input">
|
|
671
671
|
<input
|
|
672
672
|
type="text"
|
|
@@ -686,7 +686,7 @@
|
|
|
686
686
|
${M(this.inputRef)}
|
|
687
687
|
/>
|
|
688
688
|
</div>
|
|
689
|
-
`:
|
|
689
|
+
`:u`
|
|
690
690
|
<input
|
|
691
691
|
type="hidden"
|
|
692
692
|
id="${this.id}-input"
|
|
@@ -694,7 +694,7 @@
|
|
|
694
694
|
.value=${this._value.join(",")}
|
|
695
695
|
${M(this.inputRef)}
|
|
696
696
|
/>
|
|
697
|
-
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=
|
|
697
|
+
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=Gi(this._value,n=>n,n=>{var a;const r=this.findValueInOptions(n),h=(a=this.options.find(c=>c.value===n))==null?void 0:a.tagSkinColor;return u`
|
|
698
698
|
<pkt-tag
|
|
699
699
|
skin=${h||"blue-dark"}
|
|
700
700
|
?closeTag=${!this.disabled}
|
|
@@ -702,35 +702,35 @@
|
|
|
702
702
|
>
|
|
703
703
|
${this.renderValueTag(r)}
|
|
704
704
|
</pkt-tag>
|
|
705
|
-
`});return t?e:i}renderValueTag(t){if(!t)return"";switch(this.displayValueAs){case"prefixAndValue":return
|
|
705
|
+
`});return t?e:i}renderValueTag(t){if(!t)return"";switch(this.displayValueAs){case"prefixAndValue":return u`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
706
706
|
>${t.prefix||""} ${t.value}</span
|
|
707
|
-
>`;case"value":return
|
|
707
|
+
>`;case"value":return u`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
708
708
|
>${t.value}</span
|
|
709
|
-
>`;case"label":default:return
|
|
709
|
+
>`;case"label":default:return u`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
710
710
|
>${t.label||t.value}</span
|
|
711
|
-
>`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.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())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var a;return!n.selected&&((a=n.label)==null?void 0:a.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&&(e.value=n.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.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 t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,n,a,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((a=(n=t.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:a.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.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 h=this.inputRef.value.value,c=this.findValueInOptions(h);!this._value.includes(h)&&!c?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):c&&!this._value.includes(c.value)&&this.setSelected(c.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t)}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,n;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",i=e.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(h=>h.toLowerCase()===i),a=this._options.filter(h=>{var c;return((c=h.label)==null?void 0:c.toLowerCase().includes(i))??!1}),r=a.find(h=>{var c;return((c=h.label)==null?void 0:c.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((a.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(a.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 a.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,a=this._value.includes(t||n||""),r=!!n,h=((i=this._options.find(T=>T.value===t))==null?void 0:i.disabled)||!1,c=!(t!=null&&t.trim()),p=!this.multiple,m=this.multiple,v=this.isMaxItemsReached();let $=!1,b=!0,k="",x="";h||(!r&&this.allowUserInput&&!c?(this.addNewUserValue(t),k="Ny verdi lagt til",$=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),b=!1,$=!0,k="Ingen treff i søket"):a?(this.removeValue(n),$=!0):c&&p?(this.removeAllSelected(),$=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),$=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!v?(this.setSelected(n),$=!0):m&&v?(this._userInfoMessage="Maks antall valg nådd",b=!1,x=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,$=!0,x=t),this._isOptionsOpen=$,$||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=k,this._search=x||"",this.resetComboboxInput(b),m&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!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(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};lt([o({type:String,reflect:!0})],nt.prototype,"value",2),lt([o({type:Array})],nt.prototype,"options",2),lt([o({type:Array})],nt.prototype,"defaultOptions",2),lt([o({type:Boolean})],nt.prototype,"allowUserInput",2),lt([o({type:Boolean})],nt.prototype,"typeahead",2),lt([o({type:Boolean})],nt.prototype,"includeSearch",2),lt([o({type:String})],nt.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],nt.prototype,"multiple",2),lt([o({type:Number})],nt.prototype,"maxlength",2),lt([o({type:String})],nt.prototype,"displayValueAs",2),lt([o({type:String})],nt.prototype,"tagPlacement",2),lt([D()],nt.prototype,"_options",2),lt([D()],nt.prototype,"_isOptionsOpen",2),lt([D()],nt.prototype,"_value",2),lt([D()],nt.prototype,"_userInfoMessage",2),lt([D()],nt.prototype,"_addValueText",2),lt([D()],nt.prototype,"_maxIsReached",2),lt([D()],nt.prototype,"_search",2),lt([D()],nt.prototype,"_inputFocus",2),lt([D()],nt.prototype,"_editingSingleValue",2),nt=lt([F("pkt-combobox")],nt);const oh={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 lh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,ce=(s,t,e,i)=>{for(var n=i>1?void 0:i?hh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&lh(t,e,n),n};let Xi=null;function ch(){return Xi||(Xi=new Promise((s,t)=>{if(document.querySelector("#oslo-consent-script")){s();return}const e=document.createElement("script");e.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",e.id="oslo-consent-script",e.onload=()=>s(),e.onerror=t,document.head.appendChild(e);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)}),Xi)}let Kt=class extends X{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||oh.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var t;super.disconnectedCallback(),this._cookieEventHandler&&((t=window.__cookieEvents)==null||t.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(t){let e;try{e=JSON.parse(t)}catch{e=t}return e}emitCookieConsents(t){const e=this.returnJsonOrObject(t.value).items.reduce((i,n)=>(i[n.name]=n.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:e,bubbles:!0,cancelable:!1}))}async firstUpdated(t){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 ch(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(t=>{if(t){const e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(t){var e;t.preventDefault(),(e=window.cookieBanner)!=null&&e.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?d`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?d`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
711
|
+
>`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.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())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var a;return!n.selected&&((a=n.label)==null?void 0:a.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&&(e.value=n.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.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 t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,n,a,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((a=(n=t.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:a.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.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 h=this.inputRef.value.value,c=this.findValueInOptions(h);!this._value.includes(h)&&!c?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):c&&!this._value.includes(c.value)&&this.setSelected(c.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t)}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,n;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",i=e.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(h=>h.toLowerCase()===i),a=this._options.filter(h=>{var c;return((c=h.label)==null?void 0:c.toLowerCase().includes(i))??!1}),r=a.find(h=>{var c;return((c=h.label)==null?void 0:c.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((a.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(a.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 a.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,a=this._value.includes(t||n||""),r=!!n,h=((i=this._options.find(T=>T.value===t))==null?void 0:i.disabled)||!1,c=!(t!=null&&t.trim()),p=!this.multiple,v=this.multiple,m=this.isMaxItemsReached();let y=!1,$=!0,b="",x="";h||(!r&&this.allowUserInput&&!c?(this.addNewUserValue(t),b="Ny verdi lagt til",y=!v):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),$=!1,y=!0,b="Ingen treff i søket"):a?(this.removeValue(n),y=!0):c&&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&&!m?(this.setSelected(n),y=!0):v&&m?(this._userInfoMessage="Maks antall valg nådd",$=!1,x=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",$=!1,y=!0,x=t),this._isOptionsOpen=y,y||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=b,this._search=x||"",this.resetComboboxInput($),v&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!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(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};lt([o({type:String,reflect:!0})],at.prototype,"value",2),lt([o({type:Array})],at.prototype,"options",2),lt([o({type:Array})],at.prototype,"defaultOptions",2),lt([o({type:Boolean})],at.prototype,"allowUserInput",2),lt([o({type:Boolean})],at.prototype,"typeahead",2),lt([o({type:Boolean})],at.prototype,"includeSearch",2),lt([o({type:String})],at.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],at.prototype,"multiple",2),lt([o({type:Number})],at.prototype,"maxlength",2),lt([o({type:String})],at.prototype,"displayValueAs",2),lt([o({type:String})],at.prototype,"tagPlacement",2),lt([I()],at.prototype,"_options",2),lt([I()],at.prototype,"_isOptionsOpen",2),lt([I()],at.prototype,"_value",2),lt([I()],at.prototype,"_userInfoMessage",2),lt([I()],at.prototype,"_addValueText",2),lt([I()],at.prototype,"_maxIsReached",2),lt([I()],at.prototype,"_search",2),lt([I()],at.prototype,"_inputFocus",2),lt([I()],at.prototype,"_editingSingleValue",2),at=lt([V("pkt-combobox")],at);const oh={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 lh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,ce=(s,t,e,i)=>{for(var n=i>1?void 0:i?hh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&lh(t,e,n),n};let Zi=null;function ch(){return Zi||(Zi=new Promise((s,t)=>{if(document.querySelector("#oslo-consent-script")){s();return}const e=document.createElement("script");e.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",e.id="oslo-consent-script",e.onload=()=>s(),e.onerror=t,document.head.appendChild(e);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)}),Zi)}let Rt=class extends X{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||oh.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var t;super.disconnectedCallback(),this._cookieEventHandler&&((t=window.__cookieEvents)==null||t.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(t){let e;try{e=JSON.parse(t)}catch{e=t}return e}emitCookieConsents(t){const e=this.returnJsonOrObject(t.value).items.reduce((i,n)=>(i[n.name]=n.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:e,bubbles:!0,cancelable:!1}))}async firstUpdated(t){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 ch(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(t=>{if(t){const e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(t){var e;t.preventDefault(),(e=window.cookieBanner)!=null&&e.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?u`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?u`<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"?u`<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
|
-
`,r=()=>
|
|
721
|
+
>`:u`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ce([o({type:Boolean})],Rt.prototype,"devMode",2),ce([o({type:String})],Rt.prototype,"hotjarId",2),ce([o({type:String})],Rt.prototype,"googleAnalyticsId",2),ce([o({type:String})],Rt.prototype,"cookieDomain",2),ce([o({type:String})],Rt.prototype,"cookieSecure",2),ce([o({type:String})],Rt.prototype,"cookieExpiryDays",2),ce([o({type:String})],Rt.prototype,"triggerType",2),ce([o({type:String})],Rt.prototype,"triggerText",2),ce([o({type:String})],Rt.prototype,"i18nLanguage",2),Rt=ce([V("pkt-consent")],Rt);var dh=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,St=(s,t,e,i)=>{for(var n=i>1?void 0:i?uh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&dh(t,e,n),n};let $t=class extends L{constructor(){super(...arguments),this.inputRef=E(),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(t,e,i){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),t==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(t,e,i)}firstUpdated(t){t.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(t)}updated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),t.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),t.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(t)}render(){const t=N({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=N({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=N({"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",a=()=>u`
|
|
722
|
+
${this.tagText?u`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:k}
|
|
723
|
+
${this.optionalTag?u`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:k}
|
|
724
|
+
${this.requiredTag?u`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:k}
|
|
725
|
+
`,r=()=>u`
|
|
726
726
|
<label class=${i} for=${this.id+"-internal"}>
|
|
727
727
|
${this.label} ${a()}
|
|
728
|
-
${this.checkHelptext?
|
|
728
|
+
${this.checkHelptext?u`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:k}
|
|
729
729
|
</label>
|
|
730
|
-
`;return
|
|
730
|
+
`;return u`
|
|
731
731
|
<div class="pkt-input-check">
|
|
732
732
|
<div class=${t}>
|
|
733
|
-
${this.labelPosition==="left"?r():
|
|
733
|
+
${this.labelPosition==="left"?r():k}
|
|
734
734
|
<input
|
|
735
735
|
id=${this.id+"-internal"}
|
|
736
736
|
class=${e}
|
|
@@ -745,21 +745,21 @@
|
|
|
745
745
|
?checked=${this.checked}
|
|
746
746
|
role=${this.isSwitch?"switch":"checkbox"}
|
|
747
747
|
/>
|
|
748
|
-
${this.labelPosition==="right"?r():
|
|
748
|
+
${this.labelPosition==="right"?r():k}
|
|
749
749
|
</div>
|
|
750
750
|
</div>
|
|
751
|
-
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};
|
|
751
|
+
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};St([o({type:String,reflect:!0})],$t.prototype,"value",2),St([o({type:String})],$t.prototype,"checkHelptext",2),St([o({type:Boolean})],$t.prototype,"defaultChecked",2),St([o({type:Boolean})],$t.prototype,"hasTile",2),St([o({type:Boolean})],$t.prototype,"isSwitch",2),St([o({type:String})],$t.prototype,"labelPosition",2),St([o({type:Boolean})],$t.prototype,"hideLabel",2),St([o({type:Boolean,reflect:!0})],$t.prototype,"checked",2),St([o({type:Boolean,reflect:!0})],$t.prototype,"indeterminate",2),St([o({type:String,reflect:!0})],$t.prototype,"type",2),St([o({type:String})],$t.prototype,"tagText",2),St([o({type:Boolean})],$t.prototype,"optionalTag",2),St([o({type:String})],$t.prototype,"optionalText",2),St([o({type:Boolean})],$t.prototype,"requiredTag",2),St([o({type:String})],$t.prototype,"requiredText",2),$t=St([V("pkt-checkbox")],$t);var ph=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,Rs=(s,t,e,i)=>{for(var n=i>1?void 0:i?fh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ph(t,e,n),n};let gs=class extends X{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=Ae()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},u`
|
|
752
752
|
<div class=${N(this.classes)} aria-live="polite">
|
|
753
|
-
${Array.isArray(this.dates)&&this.dates[0]?
|
|
753
|
+
${Array.isArray(this.dates)&&this.dates[0]?Gi(ca((this.dates??[]).filter(Boolean)),t=>t,t=>{var e;return u` <pkt-tag
|
|
754
754
|
id=${this.idBase+t+"-tag"}
|
|
755
755
|
closeTag
|
|
756
756
|
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:t}))}}
|
|
757
757
|
.ariaLabel=${`${(e=this.strings)==null?void 0:e.calendar.deleteDate} ${la(t,this.dateformat)}`}
|
|
758
758
|
>
|
|
759
759
|
<time datetime=${t}>${la(t,this.dateformat)}</time>
|
|
760
|
-
</pkt-tag>`}):
|
|
760
|
+
</pkt-tag>`}):k}
|
|
761
761
|
</div>
|
|
762
|
-
`}};Rs([o({type:Array})],
|
|
762
|
+
`}};Rs([o({type:Array})],gs.prototype,"dates",2),Rs([o({type:String})],gs.prototype,"dateformat",2),Rs([o({type:String,attribute:"class"})],gs.prototype,"className",2),Rs([o({type:String,attribute:"id-base"})],gs.prototype,"idBase",2),gs=Rs([V("pkt-date-tags")],gs);const gh={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},Ks={props:gh},Ke=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},wi={normalizeNameForMultiple(s,t,e){return s?(t||e)&&!s.endsWith("[]")?s+"[]":s:null},validateRangeOrder(s){return!s||s.length!==2?!0:bl(s[0],s[1])},sortDates(s){return ca(s)},filterSelectableDates(s,t,e,i,n){return vl(s,t,e,i,n)}},mh={getInputType(){return Ke()?"text":"date"}},Ys={submitForm(s){var t;const e=(t=s.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(s,t){const e=s==null?void 0:s.form;e?e.requestSubmit():t()},validateDateInput(s,t,e,i,n){var a,r,h,c;const p=s.value;p&&(e&&e>p?t.setValidity({rangeUnderflow:!0},((r=(a=n==null?void 0:n.forms)==null?void 0:a.messages)==null?void 0:r.rangeUnderflow)||"Value is below minimum",s):i&&i<p&&t.setValidity({rangeOverflow:!0},((c=(h=n==null?void 0:n.forms)==null?void 0:h.messages)==null?void 0:c.rangeOverflow)||"Value is above maximum",s))}},xi={addToSelected(s,t,e,i){const n=s.target;if(!n.value)return;const a=e?me(e):null,r=i?me(i):null,h=me(n.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!a||h>=a)&&(!r||h<=r)&&t.value&&t.value.handleDateSelect(h),n.value=""},handleCalendarPosition(s,t,e=!1){var i;if(!s.value||!t.value)return;const n=((i=t.value.parentElement)==null?void 0:i.getBoundingClientRect())||t.value.getBoundingClientRect(),a=e?n.height+30:n.height,r=s.value.getBoundingClientRect().height;let h=e?"calc(100% - 30px)":"100%";n&&n.top+r>window.innerHeight&&n.top-r>0&&(h=`calc(100% - ${a}px - ${r}px)`),s.value.style.top=h}},Xi={getInputClasses(s,t,e,i,n,a){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":e,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&a==="text"}},getButtonClasses(){return{"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}},getRangeLabelClasses(s){return{"pkt-input-prefix":s,"pkt-hide":!s}}},Ji={processDateSelection(s,t,e){return!t&&!e?s[0]||"":Array.isArray(s)?s.join(","):s},updateInputValues(s,t,e,i,n,a){s.value&&(i&&t!=null&&t.value?(s.value.value=e[0]??"",t.value.value=e[1]??"",a(s.value),a(t.value)):n||(s.value.value=e.length?e[0]:"",a(s.value)))},processRangeBlur(s,t,e,i,n){var a;const r=s.target;if(r.value){n(r);const h=Ee(r.value);h&&((a=e==null?void 0:e.value)==null||a.handleDateSelect(h))}else t[0]&&i()}},Si={handleInputKeydown(s,t,e,i,n,a){const{key:r}=s;r===","&&(s.preventDefault(),a?a(s):n&&n()),(r==="Space"||r===" ")&&(s.preventDefault(),t(s)),r==="Enter"&&(s.preventDefault(),e?e():i?i():n&&n())},handleButtonKeydown(s,t){const{key:e}=s;(e==="Enter"||e===" "||e==="Space")&&(s.preventDefault(),t(s))}};var vh=Object.defineProperty,bh=Object.getOwnPropertyDescriptor,Vt=(s,t,e,i)=>{for(var n=i>1?void 0:i?bh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&vh(t,e,n),n};let At=class extends X{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.popupRef=E(),this.calendarRef=E(),this.handleDocumentClick=t=>{if(!this.open)return;const e=t.composedPath(),i=this.parentElement,n=this.popupRef.value;!e.includes(this)&&!e.includes(n)&&!(i&&e.includes(i))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var t;this.open=!0,(t=this.calendarRef.value)==null||t.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(t){var e;return!!t&&!!((e=this.popupRef.value)!=null&&e.contains(t))}focusOnCurrentDate(){const t=this.calendarRef.value;t&&typeof t.focusOnCurrentDate=="function"&&t.focusOnCurrentDate()}addToSelected(t,e,i){if(typeof xi.addToSelected=="function")return xi.addToSelected(t,this.calendarRef,e,i)}handleDateSelect(t){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(t)}render(){const t={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return u`
|
|
763
763
|
<div
|
|
764
764
|
class="${N(t)}"
|
|
765
765
|
${M(this.popupRef)}
|
|
@@ -784,9 +784,9 @@
|
|
|
784
784
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
785
785
|
></pkt-calendar>
|
|
786
786
|
</div>
|
|
787
|
-
`}};Vt([o({type:Boolean,reflect:!0})],
|
|
787
|
+
`}};Vt([o({type:Boolean,reflect:!0})],At.prototype,"open",2),Vt([o({type:Boolean})],At.prototype,"multiple",2),Vt([o({type:Boolean})],At.prototype,"range",2),Vt([o({type:Boolean})],At.prototype,"weeknumbers",2),Vt([o({type:Boolean})],At.prototype,"withcontrols",2),Vt([o({type:Number})],At.prototype,"maxMultiple",2),Vt([o({type:Array})],At.prototype,"selected",2),Vt([o({type:String})],At.prototype,"earliest",2),Vt([o({type:String})],At.prototype,"latest",2),Vt([o({type:Array})],At.prototype,"excludedates",2),Vt([o({type:Array})],At.prototype,"excludeweekdays",2),Vt([o({type:String})],At.prototype,"currentmonth",2),At=Vt([V("pkt-datepicker-popup")],At);var kh=Object.defineProperty,be=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&kh(t,e,n),n};let Kt=class extends X{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=E(),this.btnRef=E()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}renderCalendarButton(){var t;return u`
|
|
788
788
|
<button
|
|
789
|
-
class="${N(
|
|
789
|
+
class="${N(Xi.getButtonClasses())}"
|
|
790
790
|
type="button"
|
|
791
791
|
@click=${e=>this.dispatchToggleCalendar(e)}
|
|
792
792
|
@keydown=${e=>{const{key:i}=e;(i==="Enter"||i===" "||i==="Space")&&(e.preventDefault(),this.dispatchToggleCalendar(e))}}
|
|
@@ -796,7 +796,7 @@
|
|
|
796
796
|
<pkt-icon name="calendar"></pkt-icon>
|
|
797
797
|
<span class="pkt-btn__text">${((t=this.strings.calendar)==null?void 0:t.buttonAltText)||"Åpne kalender"}</span>
|
|
798
798
|
</button>
|
|
799
|
-
`}createRenderRoot(){return this}};be([o({type:String})],
|
|
799
|
+
`}createRenderRoot(){return this}};be([o({type:String})],Kt.prototype,"inputType"),be([o({type:String})],Kt.prototype,"id"),be([o({type:String})],Kt.prototype,"min"),be([o({type:String})],Kt.prototype,"max"),be([o({type:String})],Kt.prototype,"placeholder"),be([o({type:Boolean})],Kt.prototype,"readonly"),be([o({type:Boolean})],Kt.prototype,"disabled"),be([o({type:Object})],Kt.prototype,"inputClasses"),be([o({type:Object})],Kt.prototype,"internals");const ka={calendar:{buttonAltText:"Åpne kalender"}},yh={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var $h=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,Qi=(s,t,e,i)=>{for(var n=i>1?void 0:i?_h(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&$h(t,e,n),n};let Ci=class extends Kt{constructor(){super(...arguments),this.value="",this.strings=ka}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}render(){return u`
|
|
800
800
|
<div class="pkt-input__container">
|
|
801
801
|
<input
|
|
802
802
|
class="${N(this.inputClasses)}"
|
|
@@ -813,16 +813,16 @@
|
|
|
813
813
|
?disabled=${this.disabled}
|
|
814
814
|
@keydown=${t=>Si.handleInputKeydown(t,e=>this.dispatchToggleCalendar(e),()=>Ys.submitFormOrFallback(this.internals,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()}),void 0,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()})}
|
|
815
815
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
816
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
816
|
+
@focus=${()=>{this.dispatchFocus(),Ke()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
817
817
|
@blur=${t=>{this.dispatchBlur(t),this.dispatchManageValidity(t.target),this.dispatchEvent(new CustomEvent("value-change",{detail:t.target.value,bubbles:!0,composed:!0}))}}
|
|
818
818
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
819
819
|
${M(this.inputRef)}
|
|
820
820
|
/>
|
|
821
821
|
${this.renderCalendarButton()}
|
|
822
822
|
</div>
|
|
823
|
-
`}};
|
|
823
|
+
`}};Qi([o({type:String})],Ci.prototype,"value",2),Qi([o({type:Object})],Ci.prototype,"strings",2),Ci=Qi([V("pkt-datepicker-single")],Ci);var wh=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,Ti=(s,t,e,i)=>{for(var n=i>1?void 0:i?xh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&wh(t,e,n),n};let Gs=class extends Kt{constructor(){super(...arguments),this.value=[],this.showRangeLabels=!1,this.strings=yh,this.inputRefTo=E()}get inputElementTo(){return this.inputRefTo.value}render(){var t,e;const i=Xi.getRangeLabelClasses(this.showRangeLabels);return u`
|
|
824
824
|
<div class="pkt-input__container">
|
|
825
|
-
${this.showRangeLabels?
|
|
825
|
+
${this.showRangeLabels?u` <div class="pkt-input-prefix">${(t=this.strings.generic)==null?void 0:t.from}</div> `:k}
|
|
826
826
|
<input
|
|
827
827
|
class=${N(this.inputClasses)}
|
|
828
828
|
.type=${this.inputType}
|
|
@@ -837,7 +837,7 @@
|
|
|
837
837
|
@touchend=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
838
838
|
@keydown=${n=>Si.handleInputKeydown(n,a=>this.dispatchToggleCalendar(a),()=>Ys.submitFormOrFallback(this.internals,()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.focus()}),()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.focus()},()=>{var a;return(a=this.inputRef.value)==null?void 0:a.blur()})}
|
|
839
839
|
@input=${n=>{this.dispatchInput(n),n.stopImmediatePropagation()}}
|
|
840
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
840
|
+
@focus=${()=>{this.dispatchFocus(),Ke()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
841
841
|
@blur=${n=>{this.dispatchBlur(n),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:n,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
842
842
|
@change=${n=>{this.dispatchChange(n),n.stopImmediatePropagation()}}
|
|
843
843
|
${M(this.inputRef)}
|
|
@@ -845,7 +845,7 @@
|
|
|
845
845
|
<div class="${N(i)}" id="${this.id}-to-label">
|
|
846
846
|
${(e=this.strings.generic)==null?void 0:e.to}
|
|
847
847
|
</div>
|
|
848
|
-
${this.showRangeLabels?
|
|
848
|
+
${this.showRangeLabels?k:u` <div class="pkt-input-separator">–</div> `}
|
|
849
849
|
<input
|
|
850
850
|
class=${N(this.inputClasses)}
|
|
851
851
|
.type=${this.inputType}
|
|
@@ -861,14 +861,14 @@
|
|
|
861
861
|
@touchend=${n=>{n.preventDefault(),this.dispatchToggleCalendar(n)}}
|
|
862
862
|
@keydown=${n=>Si.handleInputKeydown(n,a=>this.dispatchToggleCalendar(a),()=>Ys.submitFormOrFallback(this.internals,()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.blur()}),void 0,()=>{var a;return(a=this.inputRefTo.value)==null?void 0:a.blur()})}
|
|
863
863
|
@input=${n=>{this.dispatchInput(n),n.stopImmediatePropagation()}}
|
|
864
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
864
|
+
@focus=${()=>{this.dispatchFocus(),Ke()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
865
865
|
@blur=${n=>{this.dispatchBlur(n),this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:n,values:this.value,inputType:"to"},bubbles:!0,composed:!0}))}}
|
|
866
866
|
@change=${n=>{this.dispatchChange(n),n.stopImmediatePropagation()}}
|
|
867
867
|
${M(this.inputRefTo)}
|
|
868
868
|
/>
|
|
869
869
|
${this.renderCalendarButton()}
|
|
870
870
|
</div>
|
|
871
|
-
`}};Ti([o({type:Array})],Gs.prototype,"value",2),Ti([o({type:Boolean})],Gs.prototype,"showRangeLabels",2),Ti([o({type:Object})],Gs.prototype,"strings",2),Gs=Ti([
|
|
871
|
+
`}};Ti([o({type:Array})],Gs.prototype,"value",2),Ti([o({type:Boolean})],Gs.prototype,"showRangeLabels",2),Ti([o({type:Object})],Gs.prototype,"strings",2),Gs=Ti([V("pkt-datepicker-range")],Gs);var Sh=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,Ni=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ch(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Sh(t,e,n),n};let Zs=class extends Kt{constructor(){super(...arguments),this.value=[],this.strings=ka}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(t){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:t,bubbles:!0,composed:!0}))}render(){return u`
|
|
872
872
|
<div class="pkt-input__container">
|
|
873
873
|
<input
|
|
874
874
|
class=${N(this.inputClasses)}
|
|
@@ -883,14 +883,14 @@
|
|
|
883
883
|
@touchend=${t=>{t.preventDefault(),this.dispatchToggleCalendar(t)}}
|
|
884
884
|
@blur=${t=>{this.dispatchBlur(t),this.dispatchAddToSelected(t)}}
|
|
885
885
|
@input=${t=>{this.dispatchInput(t),t.stopImmediatePropagation()}}
|
|
886
|
-
@focus=${()=>{this.dispatchFocus(),
|
|
886
|
+
@focus=${()=>{this.dispatchFocus(),Ke()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
887
887
|
@keydown=${t=>Si.handleInputKeydown(t,e=>this.dispatchToggleCalendar(e),()=>Ys.submitFormOrFallback(this.internals,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()}),void 0,void 0,e=>this.dispatchAddToSelected(e))}
|
|
888
888
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
889
889
|
${M(this.inputRef)}
|
|
890
890
|
/>
|
|
891
891
|
${this.renderCalendarButton()}
|
|
892
892
|
</div>
|
|
893
|
-
`}};Ni([o({type:Array})],Zs.prototype,"value",2),Ni([o({type:Number})],Zs.prototype,"maxlength",2),Ni([o({type:Object})],Zs.prototype,"strings",2),Zs=Ni([
|
|
893
|
+
`}};Ni([o({type:Array})],Zs.prototype,"value",2),Ni([o({type:Number})],Zs.prototype,"maxlength",2),Ni([o({type:Object})],Zs.prototype,"strings",2),Zs=Ni([V("pkt-datepicker-multiple")],Zs);var Th=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,pt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Nh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Th(t,e,n),n};let ht=class extends L{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=E(),this._value=[],this.label="Datovelger",this.dateformat=Ks.props.dateformat.default,this.multiple=Ks.props.multiple.default,this.maxlength=null,this.range=Ks.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=Ks.props.weeknumbers.default,this.withcontrols=Ks.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=E(),this.popupRef=E(),this.helptextSlot=E(),this.singleInputRef=E(),this.rangeInputRef=E(),this.multipleInputRef=E(),this.addToSelected=t=>{const e=this.datepickerPopupRef.value;return e&&typeof e.addToSelected=="function"?e.addToSelected(t,this.min,this.max):xi.addToSelected(t,this.calRef,this.min,this.max)},this.slotController=new ot(this,this.helptextSlot)}get value(){return this._valueProperty}set value(t){const e=this._valueProperty;this._valueProperty=Array.isArray(t)?t.join(","):t||"",this.valueChanged(this._valueProperty,e),this.requestUpdate("value",e)}get inputType(){return mh.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=wi.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(t,e){if(t===e)return;const i=qs(t),n=this.multiple&&i.length>1?wi.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!wi.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",e);return}this._value=n;const a=kl(n);this._valueProperty!==a&&(this._valueProperty=a),super.valueChanged(a,e)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&this.valueChanged(i,e),t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=qs(i||"")),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=qs(i||"")),super.attributeChangedCallback(t,e,i)}updated(t){if(t.has("value")){const e=Array.isArray(this.value)?this.value.join(","):this.value,i=t.get("value"),n=Array.isArray(i)?i.join(","):i;this.valueChanged(e,n)}(t.has("multiple")||t.has("range"))&&(this.name=wi.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),t.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=qs(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(t)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.inputElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.inputElement:(i=this.singleInputRef.value)==null?void 0:i.inputElement}get currentInputElementTo(){var t;if(this.range)return(t=this.rangeInputRef.value)==null?void 0:t.inputElementTo}get currentButtonElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.buttonElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.buttonElement:(i=this.singleInputRef.value)==null?void 0:i.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return u`
|
|
894
894
|
<pkt-datepicker-single
|
|
895
895
|
.value=${this._value[0]??""}
|
|
896
896
|
.inputType=${this.inputType}
|
|
@@ -912,7 +912,7 @@
|
|
|
912
912
|
@input-changed=${()=>{this.touched=!0}}
|
|
913
913
|
${M(this.singleInputRef)}
|
|
914
914
|
></pkt-datepicker-single>
|
|
915
|
-
`}renderRangeInput(){return
|
|
915
|
+
`}renderRangeInput(){return u`
|
|
916
916
|
<pkt-datepicker-range
|
|
917
917
|
.value=${this._value}
|
|
918
918
|
.inputType=${this.inputType}
|
|
@@ -930,14 +930,14 @@
|
|
|
930
930
|
@input-change=${()=>this.onInput()}
|
|
931
931
|
@input-focus=${()=>this.onFocus()}
|
|
932
932
|
@input-blur=${t=>{var e;(e=this.calRef.value)!=null&&e.contains(t.detail.relatedTarget)||this.onBlur()}}
|
|
933
|
-
@range-blur=${t=>{const e=this.currentInputElement,i=this.currentInputElementTo;if(e&&i){const n=e.value,a=i.value;if(n&&a&&n>a)i.value="",this._value=[n],this.value=n;else{const r=[n,a].filter(Boolean);r.length>0&&(r[0]!==this._value[0]||r[1]!==this._value[1])&&(this._value=r,this.value=r.join(","))}}
|
|
933
|
+
@range-blur=${t=>{const e=this.currentInputElement,i=this.currentInputElementTo;if(e&&i){const n=e.value,a=i.value;if(n&&a&&n>a)i.value="",this._value=[n],this.value=n;else{const r=[n,a].filter(Boolean);r.length>0&&(r[0]!==this._value[0]||r[1]!==this._value[1])&&(this._value=r,this.value=r.join(","))}}Ji.processRangeBlur(t.detail.event,t.detail.values,this.calRef,()=>this.clearInputValue(),n=>this.manageValidity(n))}}
|
|
934
934
|
@manage-validity=${t=>this.manageValidity(t.detail)}
|
|
935
935
|
@validate-date-input=${t=>{Ys.validateDateInput(t.detail,this.internals,this.min,this.max,this.strings)}}
|
|
936
|
-
@handle-date-select=${t=>{var e,i;const n=
|
|
936
|
+
@handle-date-select=${t=>{var e,i;const n=Ee(t.detail);if(n){const a=bt(n);this._value[0]!==a&&this._value[1]!==a&&((i=(e=this.calRef)==null?void 0:e.value)==null||i.handleDateSelect(n))}}}
|
|
937
937
|
@input-changed=${()=>{this.touched=!0}}
|
|
938
938
|
${M(this.rangeInputRef)}
|
|
939
939
|
></pkt-datepicker-range>
|
|
940
|
-
`}renderMultipleInput(){return
|
|
940
|
+
`}renderMultipleInput(){return u`
|
|
941
941
|
<pkt-datepicker-multiple
|
|
942
942
|
.value=${this._value}
|
|
943
943
|
.inputType=${this.inputType}
|
|
@@ -959,7 +959,7 @@
|
|
|
959
959
|
@input-changed=${()=>{this.touched=!0}}
|
|
960
960
|
${M(this.multipleInputRef)}
|
|
961
961
|
></pkt-datepicker-multiple>
|
|
962
|
-
`}renderCalendar(){return
|
|
962
|
+
`}renderCalendar(){return u`
|
|
963
963
|
<pkt-datepicker-popup
|
|
964
964
|
class="pkt-contents"
|
|
965
965
|
?open=${this.calendarOpen}
|
|
@@ -973,12 +973,12 @@
|
|
|
973
973
|
.latest=${this.max}
|
|
974
974
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
975
975
|
.excludeweekdays=${this.excludeweekdays}
|
|
976
|
-
.currentmonth=${this.currentmonth?
|
|
977
|
-
@date-selected=${t=>{this.value=
|
|
976
|
+
.currentmonth=${this.currentmonth?Ne(this.currentmonth):null}
|
|
977
|
+
@date-selected=${t=>{this.value=Ji.processDateSelection(t.detail,this.multiple,this.range),this._value=t.detail,Ji.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,e=>this.manageValidity(e))}}
|
|
978
978
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
979
979
|
${M(this.datepickerPopupRef)}
|
|
980
980
|
></pkt-datepicker-popup>
|
|
981
|
-
`}render(){return this.inputClasses=
|
|
981
|
+
`}render(){return this.inputClasses=Xi.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),u`
|
|
982
982
|
<pkt-input-wrapper
|
|
983
983
|
label="${this.label}"
|
|
984
984
|
forId="${this.id}-input"
|
|
@@ -1004,13 +1004,13 @@
|
|
|
1004
1004
|
class="pkt-datepicker"
|
|
1005
1005
|
>
|
|
1006
1006
|
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1007
|
-
${this.multiple?
|
|
1007
|
+
${this.multiple?u`<pkt-date-tags
|
|
1008
1008
|
.dates=${this._value}
|
|
1009
1009
|
dateformat=${this.dateformat}
|
|
1010
1010
|
strings=${this.strings}
|
|
1011
1011
|
id-base=${this.id}
|
|
1012
|
-
@date-tag-removed=${t=>{var e;const i=this.datepickerPopupRef.value,n=
|
|
1013
|
-
></pkt-date-tags>`:
|
|
1012
|
+
@date-tag-removed=${t=>{var e;const i=this.datepickerPopupRef.value,n=Ee(t.detail);i&&n&&typeof i.handleDateSelect=="function"?i.handleDateSelect(n):(e=this.calRef.value)==null||e.handleDateSelect(n)}}
|
|
1013
|
+
></pkt-date-tags>`:k}
|
|
1014
1014
|
<div
|
|
1015
1015
|
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
1016
1016
|
>
|
|
@@ -1018,13 +1018,13 @@
|
|
|
1018
1018
|
</div>
|
|
1019
1019
|
</pkt-input-wrapper>
|
|
1020
1020
|
${this.renderCalendar()}
|
|
1021
|
-
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;xi.handleCalendarPosition(this.popupRef,this.inputRef,t)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),
|
|
1021
|
+
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;xi.handleCalendarPosition(this.popupRef,this.inputRef,t)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),Ke()&&e.focusOnCurrentDate();return}await Rl(20),this.handleCalendarPosition(),Ke()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const t=this.datepickerPopupRef.value;if(this.calendarOpen=!1,t&&typeof t.hide=="function")return t.hide()}async toggleCalendar(t){t.preventDefault();const e=this.datepickerPopupRef.value;if(e&&typeof e.toggle=="function"){const i=!!e.open;e.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}))}};pt([o({type:String,reflect:!0})],ht.prototype,"value",1),pt([o({type:Array})],ht.prototype,"_value",2),pt([o({type:String,reflect:!0})],ht.prototype,"label",2),pt([o({type:String})],ht.prototype,"dateformat",2),pt([o({type:Boolean,reflect:!0})],ht.prototype,"multiple",2),pt([o({type:Number,reflect:!0})],ht.prototype,"maxlength",2),pt([o({type:Boolean,reflect:!0})],ht.prototype,"range",2),pt([o({type:Boolean})],ht.prototype,"showRangeLabels",2),pt([o({type:String,reflect:!0})],ht.prototype,"min",2),pt([o({type:String,reflect:!0})],ht.prototype,"max",2),pt([o({type:Boolean})],ht.prototype,"weeknumbers",2),pt([o({type:Boolean,reflect:!0})],ht.prototype,"withcontrols",2),pt([o({converter:ds.csvToArray})],ht.prototype,"excludedates",2),pt([o({converter:ds.csvToArray})],ht.prototype,"excludeweekdays",2),pt([o({type:String})],ht.prototype,"currentmonth",2),pt([o({type:Boolean,reflect:!0})],ht.prototype,"calendarOpen",2),pt([o({type:String})],ht.prototype,"timezone",2),pt([I()],ht.prototype,"inputClasses",2),ht=pt([V("pkt-datepicker")],ht);const Eh={href:{default:"#"},target:{default:"_self"}},ya={props:Eh};var Mh=Object.defineProperty,Ah=Object.getOwnPropertyDescriptor,ms=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ah(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Mh(t,e,n),n};let Ye=class extends X{constructor(){super(),this.defaultSlot=E(),this.href=ya.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=ya.props.target.default,this.slotController=new ot(this,this.defaultSlot)}render(){const t={"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 u`<a
|
|
1022
1022
|
class=${N(t)}
|
|
1023
1023
|
href=${this.href}
|
|
1024
1024
|
.target=${this.target}
|
|
1025
|
-
.rel=${this.external?"noopener noreferrer":
|
|
1026
|
-
>${this.iconName?
|
|
1027
|
-
>`}};
|
|
1025
|
+
.rel=${this.external?"noopener noreferrer":k}
|
|
1026
|
+
>${this.iconName?u`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${M(this.defaultSlot)}>Link</span></a
|
|
1027
|
+
>`}};ms([o({type:String,reflect:!0})],Ye.prototype,"href",2),ms([o({type:String,reflect:!0})],Ye.prototype,"iconName",2),ms([o({type:String,reflect:!0})],Ye.prototype,"iconPosition",2),ms([o({type:Boolean,reflect:!0})],Ye.prototype,"external",2),ms([o({type:String,reflect:!0})],Ye.prototype,"target",2),Ye=ms([V("pkt-link")],Ye);var Oh=Object.defineProperty,Ph=Object.getOwnPropertyDescriptor,de=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ph(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Oh(t,e,n),n};let se=class extends L{constructor(){super(),this.inputRef=E(),this.helptextSlot=E(),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 ot(this,this.helptextSlot)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}updated(t){var e;super.updated(t),t.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const t=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,e=N({"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 u`
|
|
1028
1028
|
<pkt-input-wrapper
|
|
1029
1029
|
label="${this.label}"
|
|
1030
1030
|
?counter=${this.counter}
|
|
@@ -1051,7 +1051,7 @@
|
|
|
1051
1051
|
>
|
|
1052
1052
|
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1053
1053
|
<div class="pkt-input__container">
|
|
1054
|
-
${this.prefix?
|
|
1054
|
+
${this.prefix?u`<div class="pkt-input-prefix">${this.prefix}</div>`:k}
|
|
1055
1055
|
<input
|
|
1056
1056
|
${M(this.inputRef)}
|
|
1057
1057
|
class=${e}
|
|
@@ -1067,7 +1067,7 @@
|
|
|
1067
1067
|
max=${C(this.max||void 0)}
|
|
1068
1068
|
step=${C(this.step||void 0)}
|
|
1069
1069
|
?readonly=${this.readonly}
|
|
1070
|
-
size=${this.size||
|
|
1070
|
+
size=${this.size||k}
|
|
1071
1071
|
.value=${this.value}
|
|
1072
1072
|
?disabled=${this.disabled}
|
|
1073
1073
|
aria-invalid=${this.hasError}
|
|
@@ -1078,86 +1078,86 @@
|
|
|
1078
1078
|
@blur=${n=>{this.value=n.target.value,this.onBlur(),n.stopImmediatePropagation()}}
|
|
1079
1079
|
@keydown=${n=>{var a;if(n.key==="Enter"){const r=this.internals.form;r?r.requestSubmit():(a=this.inputRef.value)==null||a.blur()}}}
|
|
1080
1080
|
/>
|
|
1081
|
-
${this.suffix?
|
|
1081
|
+
${this.suffix?u`<div class="pkt-input-suffix">
|
|
1082
1082
|
${this.suffix}
|
|
1083
|
-
${this.iconNameRight?
|
|
1083
|
+
${this.iconNameRight?u`<pkt-icon
|
|
1084
1084
|
class="pkt-input-suffix-icon"
|
|
1085
1085
|
name=${this.iconNameRight}
|
|
1086
|
-
></pkt-icon>`:
|
|
1087
|
-
${t?
|
|
1086
|
+
></pkt-icon>`:k}
|
|
1087
|
+
${t?u`<pkt-icon
|
|
1088
1088
|
class="pkt-input-suffix-icon"
|
|
1089
1089
|
name="magnifying-glass-big"
|
|
1090
|
-
></pkt-icon>`:
|
|
1091
|
-
</div>`:
|
|
1092
|
-
${!this.suffix&&this.iconNameRight?
|
|
1093
|
-
${!this.suffix&&t?
|
|
1090
|
+
></pkt-icon>`:k}
|
|
1091
|
+
</div>`:k}
|
|
1092
|
+
${!this.suffix&&this.iconNameRight?u`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:k}
|
|
1093
|
+
${!this.suffix&&t?u`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:k}
|
|
1094
1094
|
</div>
|
|
1095
1095
|
</pkt-input-wrapper>
|
|
1096
|
-
`}};de([o({type:String,reflect:!0})],se.prototype,"value",2),de([o({type:String})],se.prototype,"type",2),de([o({type:Number})],se.prototype,"size",2),de([o({type:String})],se.prototype,"autocomplete",2),de([o({type:String})],se.prototype,"iconNameRight",2),de([o({type:String})],se.prototype,"prefix",2),de([o({type:String})],se.prototype,"suffix",2),de([o({type:Boolean})],se.prototype,"omitSearchIcon",2),de([
|
|
1096
|
+
`}};de([o({type:String,reflect:!0})],se.prototype,"value",2),de([o({type:String})],se.prototype,"type",2),de([o({type:Number})],se.prototype,"size",2),de([o({type:String})],se.prototype,"autocomplete",2),de([o({type:String})],se.prototype,"iconNameRight",2),de([o({type:String})],se.prototype,"prefix",2),de([o({type:String})],se.prototype,"suffix",2),de([o({type:Boolean})],se.prototype,"omitSearchIcon",2),de([I()],se.prototype,"counterCurrent",2),se=de([V("pkt-textinput")],se);const Dh=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Ih=s=>Dh(s),Lh=s=>{if(!s)return;const t=typeof s=="string"?new Date(s):s;if(!isNaN(t.getTime()))return t.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})};var Bh=Object.defineProperty,Fh=Object.getOwnPropertyDescriptor,Ge=(s,t,e,i)=>{for(var n=i>1?void 0:i?Fh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Bh(t,e,n),n};let Oe=class extends X{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(t){"onClick"in t&&typeof t.onClick=="function"&&t.onClick()}renderLinkOrButton(t,e){const i="href"in t,n=N({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[e||""]:!!e});return i?u`
|
|
1097
1097
|
<pkt-link
|
|
1098
|
-
icon-name=${t.iconName||
|
|
1098
|
+
icon-name=${t.iconName||k}
|
|
1099
1099
|
href=${t.href}
|
|
1100
1100
|
aria-hidden="true"
|
|
1101
1101
|
class="pkt-user-menu__link ${e||""}"
|
|
1102
1102
|
>
|
|
1103
1103
|
${t.title}
|
|
1104
1104
|
</pkt-link>
|
|
1105
|
-
`:
|
|
1105
|
+
`:u`
|
|
1106
1106
|
<button class=${n} type="button" @click=${()=>this.handleMenuItemClick(t)}>
|
|
1107
|
-
${t.iconName?
|
|
1107
|
+
${t.iconName?u`<pkt-icon
|
|
1108
1108
|
name=${t.iconName}
|
|
1109
1109
|
class="pkt-link__icon"
|
|
1110
1110
|
aria-hidden="true"
|
|
1111
|
-
></pkt-icon>`:
|
|
1111
|
+
></pkt-icon>`:k}
|
|
1112
1112
|
${t.title}
|
|
1113
1113
|
</button>
|
|
1114
|
-
`}renderLinkSection(t){return
|
|
1114
|
+
`}renderLinkSection(t){return u`
|
|
1115
1115
|
<ul class="pkt-user-menu__sublist">
|
|
1116
|
-
${t.map(e=>
|
|
1116
|
+
${t.map(e=>u`
|
|
1117
1117
|
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(e)}</li>
|
|
1118
1118
|
`)}
|
|
1119
1119
|
</ul>
|
|
1120
|
-
`}render(){var t;const e=(t=this.userMenu)==null?void 0:t.map(Ih);return
|
|
1120
|
+
`}render(){var t;const e=(t=this.userMenu)==null?void 0:t.map(Ih);return u`
|
|
1121
1121
|
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
1122
1122
|
<ul class="pkt-user-menu__list">
|
|
1123
1123
|
<!-- User section -->
|
|
1124
|
-
${this.user?
|
|
1124
|
+
${this.user?u`
|
|
1125
1125
|
<li class="pkt-user-menu__item">
|
|
1126
1126
|
<div class="pkt-user-menu__label">Pålogget som</div>
|
|
1127
1127
|
<div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
|
|
1128
|
-
${this.formattedLastLoggedIn?
|
|
1128
|
+
${this.formattedLastLoggedIn?u`
|
|
1129
1129
|
<div class="pkt-user-menu__last-logged-in">
|
|
1130
1130
|
Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
|
|
1131
1131
|
</div>
|
|
1132
|
-
`:
|
|
1132
|
+
`:k}
|
|
1133
1133
|
</li>
|
|
1134
|
-
`:
|
|
1134
|
+
`:k}
|
|
1135
1135
|
|
|
1136
1136
|
<!-- User menu items -->
|
|
1137
|
-
${e&&e.length>0?
|
|
1137
|
+
${e&&e.length>0?u`
|
|
1138
1138
|
<li class="pkt-user-menu__item">${this.renderLinkSection(e)}</li>
|
|
1139
|
-
`:
|
|
1139
|
+
`:k}
|
|
1140
1140
|
|
|
1141
1141
|
<!-- Representing section -->
|
|
1142
|
-
${this.representing?
|
|
1142
|
+
${this.representing?u`
|
|
1143
1143
|
<li class="pkt-user-menu__item">
|
|
1144
1144
|
<div class="pkt-user-menu__label">Representerer</div>
|
|
1145
1145
|
<div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
|
|
1146
|
-
${this.representing.orgNumber?
|
|
1146
|
+
${this.representing.orgNumber?u`<div class="pkt-user-menu__org-number">
|
|
1147
1147
|
Org.nr. ${this.representing.orgNumber}
|
|
1148
|
-
</div>`:
|
|
1149
|
-
${this.canChangeRepresentation?
|
|
1148
|
+
</div>`:k}
|
|
1149
|
+
${this.canChangeRepresentation?u`
|
|
1150
1150
|
<ul class="pkt-user-menu__sublist mt-size-16">
|
|
1151
1151
|
<li class="pkt-user-menu__subitem">
|
|
1152
1152
|
${this.renderLinkOrButton({title:"Endre organisasjon",iconName:"cogwheel",onClick:()=>this.handleChangeRepresentation()})}
|
|
1153
1153
|
</li>
|
|
1154
1154
|
</ul>
|
|
1155
|
-
`:
|
|
1155
|
+
`:k}
|
|
1156
1156
|
</li>
|
|
1157
|
-
`:
|
|
1157
|
+
`:k}
|
|
1158
1158
|
|
|
1159
1159
|
<!-- Change representation without representing object -->
|
|
1160
|
-
${!this.representing&&this.canChangeRepresentation?
|
|
1160
|
+
${!this.representing&&this.canChangeRepresentation?u`
|
|
1161
1161
|
<li class="pkt-user-menu__item">
|
|
1162
1162
|
<ul class="pkt-user-menu__sublist">
|
|
1163
1163
|
<li class="pkt-user-menu__subitem">
|
|
@@ -1165,25 +1165,25 @@
|
|
|
1165
1165
|
</li>
|
|
1166
1166
|
</ul>
|
|
1167
1167
|
</li>
|
|
1168
|
-
`:
|
|
1168
|
+
`:k}
|
|
1169
1169
|
|
|
1170
1170
|
<!-- Logout -->
|
|
1171
|
-
${this.logoutOnClick?
|
|
1171
|
+
${this.logoutOnClick?u`
|
|
1172
1172
|
<li class="pkt-user-menu__item">
|
|
1173
1173
|
${this.renderLinkOrButton({title:"Logg ut",iconName:"exit",onClick:()=>this.handleLogout()})}
|
|
1174
1174
|
</li>
|
|
1175
|
-
`:
|
|
1175
|
+
`:k}
|
|
1176
1176
|
</ul>
|
|
1177
1177
|
</nav>
|
|
1178
|
-
`}};
|
|
1179
|
-
<pkt-icon name="oslologo" aria-hidden="true" path=${
|
|
1180
|
-
`;return this.logoLink&&typeof this.logoLink=="string"?
|
|
1178
|
+
`}};Ge([o({type:Object})],Oe.prototype,"user",2),Ge([o({type:String,attribute:"formatted-last-logged-in"})],Oe.prototype,"formattedLastLoggedIn",2),Ge([o({type:Object})],Oe.prototype,"representing",2),Ge([o({type:Array,attribute:"user-menu"})],Oe.prototype,"userMenu",2),Ge([o({type:Boolean,attribute:"can-change-representation",converter:Mt})],Oe.prototype,"canChangeRepresentation",2),Ge([o({type:Boolean,attribute:"logout-on-click",converter:Mt})],Oe.prototype,"logoutOnClick",2),Oe=Ge([V("pkt-header-user-menu")],Oe);var Vh=Object.defineProperty,jh=Object.getOwnPropertyDescriptor,K=(s,t,e,i)=>{for(var n=i>1?void 0:i?jh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Vh(t,e,n),n};const Hh="https://punkt-cdn.oslo.kommune.no/14.3/logos/";let W=class extends X{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=E(),this.headerRef=E(),this.userContainerRef=E(),this.slotContainerRef=E(),this.searchContainerRef=E(),this.slotContentRef=E(),this.searchMenuRef=E(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const t=window.pageYOffset||document.documentElement.scrollTop;t<0||Math.abs(t-this.lastScrollPosition)<60||(this.isHidden=t>this.lastScrollPosition,this.lastScrollPosition=t)},this.handleClickOutside=t=>{const e=t.target;this.user&&this.openMenu==="user"&&!e.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!e.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!e.closest(".pkt-header-service__search-container")&&!e.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(t,e)=>{const i=t.relatedTarget;let n;switch(e){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const a=n.value;a&&(!i||!a.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=t=>{t.key==="Escape"&&this.openMenu!=="none"&&(t.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new ot(this,this.defaultSlot)}updateSlots(t){this.hasSlotContent=t.has(null)||t.has(void 0)}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.resizeObserver)==null||t.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(t){if(super.updated(t),t.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(t.has("mobileBreakpoint")||t.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),t.has("openMenu")){const e=t.get("openMenu");this.openMenu!=="none"&&(e==="none"||e===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"&&e!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(t.has("openMenu")||t.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const t=this.headerRef.value;t&&(this.componentWidth=t.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(e=>{for(const i of e)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(t))}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 t=document.body,e=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const i=window.innerWidth-e.clientWidth;i>0&&(t.style.paddingRight=`${i}px`),t.style.position="fixed",t.style.top=`-${this.savedScrollY}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",e.classList.add("is-scroll-locked")}unlockScroll(){const t=document.body,e=document.documentElement;e.classList.contains("is-scroll-locked")&&(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"),e.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(t){const e=t==="slot"?this.slotContainerRef:this.searchContainerRef,i=t==="slot"?this.slotContentRef:this.searchMenuRef;if(!e.value||!i.value||!this.isTablet||this.isMobile)return;const n=e.value.getBoundingClientRect(),a=i.value.offsetWidth,r=n.left+a>window.innerWidth;t==="slot"?this.alignSlotRight=r:this.alignSearchRight=r}handleMenuToggle(t){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=t)}handleLogoClick(t){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleServiceClick(t){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(t){this.dispatchEvent(new CustomEvent("search",{detail:{query:t},bubbles:!0,composed:!0}))}handleSearchChange(t){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:t},bubbles:!0,composed:!0}))}handleSearchInputChange(t){const e=t.target.value;this.handleSearchChange(e)}handleSearchKeyDown(t){t.key==="Enter"&&this.handleSearch(t.target.value)}get formattedLastLoggedIn(){var t;return Lh((t=this.user)==null?void 0:t.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 k;const t=u`
|
|
1179
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${Hh}></pkt-icon>
|
|
1180
|
+
`;return this.logoLink&&typeof this.logoLink=="string"?u`
|
|
1181
1181
|
<span class="pkt-header-service__logo">
|
|
1182
1182
|
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
1183
1183
|
${t}
|
|
1184
1184
|
</a>
|
|
1185
1185
|
</span>
|
|
1186
|
-
`:this.hasAttribute("logo-link")?
|
|
1186
|
+
`:this.hasAttribute("logo-link")?u`
|
|
1187
1187
|
<span class="pkt-header-service__logo">
|
|
1188
1188
|
<button
|
|
1189
1189
|
aria-label="Tilbake til forside"
|
|
@@ -1193,9 +1193,9 @@
|
|
|
1193
1193
|
${t}
|
|
1194
1194
|
</button>
|
|
1195
1195
|
</span>
|
|
1196
|
-
`:
|
|
1196
|
+
`:u`
|
|
1197
1197
|
<span class="pkt-header-service__logo" @click=${this.handleLogoClick}>${t}</span>
|
|
1198
|
-
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?
|
|
1198
|
+
`}renderServiceName(){return this.serviceName?this.serviceLink&&typeof this.serviceLink=="string"?u`
|
|
1199
1199
|
<span class="pkt-header-service__service-name">
|
|
1200
1200
|
<pkt-link
|
|
1201
1201
|
href=${this.serviceLink}
|
|
@@ -1205,7 +1205,7 @@
|
|
|
1205
1205
|
${this.serviceName}
|
|
1206
1206
|
</pkt-link>
|
|
1207
1207
|
</span>
|
|
1208
|
-
`:this.hasAttribute("service-link")?
|
|
1208
|
+
`:this.hasAttribute("service-link")?u`
|
|
1209
1209
|
<span class="pkt-header-service__service-name">
|
|
1210
1210
|
<button
|
|
1211
1211
|
class="pkt-link-button pkt-link pkt-header-service__service-link"
|
|
@@ -1214,20 +1214,20 @@
|
|
|
1214
1214
|
${this.serviceName}
|
|
1215
1215
|
</button>
|
|
1216
1216
|
</span>
|
|
1217
|
-
`:
|
|
1217
|
+
`:u`
|
|
1218
1218
|
<span class="pkt-header-service__service-name" @click=${this.handleServiceClick}>
|
|
1219
1219
|
<span class="pkt-header-service__service-link">${this.serviceName}</span>
|
|
1220
1220
|
</span>
|
|
1221
|
-
`:
|
|
1221
|
+
`:k}renderSlotContainer(){const t=N({"pkt-header-service__slot-container":!0,"is-open":this.openMenu==="slot"}),e=N({"pkt-header-service__slot-content":!0,"align-right":this.alignSlotRight});return u`
|
|
1222
1222
|
<div
|
|
1223
1223
|
class=${t}
|
|
1224
1224
|
@focusout=${i=>this.handleFocusOut(i,"slot")}
|
|
1225
1225
|
${M(this.slotContainerRef)}
|
|
1226
1226
|
>
|
|
1227
|
-
${this.isTablet&&this.hasSlotContent?
|
|
1227
|
+
${this.isTablet&&this.hasSlotContent?u`
|
|
1228
1228
|
<pkt-button
|
|
1229
1229
|
skin="secondary"
|
|
1230
|
-
variant
|
|
1230
|
+
variant=${this.slotMenuVariant}
|
|
1231
1231
|
iconName="menu"
|
|
1232
1232
|
size=${this.isMobile?"small":"medium"}
|
|
1233
1233
|
state=${this.openMenu==="slot"?"active":"normal"}
|
|
@@ -1236,19 +1236,19 @@
|
|
|
1236
1236
|
aria-controls="mobile-slot-menu"
|
|
1237
1237
|
aria-label="Åpne meny"
|
|
1238
1238
|
>
|
|
1239
|
-
|
|
1239
|
+
${this.slotMenuText}
|
|
1240
1240
|
</pkt-button>
|
|
1241
|
-
`:
|
|
1241
|
+
`:k}
|
|
1242
1242
|
<div
|
|
1243
1243
|
class=${e}
|
|
1244
1244
|
id="mobile-slot-menu"
|
|
1245
|
-
role=${this.isTablet?"menu":
|
|
1246
|
-
aria-label=${this.isTablet?"Meny":
|
|
1245
|
+
role=${this.isTablet?"menu":k}
|
|
1246
|
+
aria-label=${this.isTablet?"Meny":k}
|
|
1247
1247
|
${M(this.slotContentRef)}
|
|
1248
1248
|
${M(this.defaultSlot)}
|
|
1249
1249
|
></div>
|
|
1250
1250
|
</div>
|
|
1251
|
-
`}renderSearch(){if(!this.showSearch)return
|
|
1251
|
+
`}renderSearch(){if(!this.showSearch)return k;if(this.isTablet){const t=N({"pkt-header-service__search-container":!0,"is-open":this.openMenu==="search"}),e=N({"pkt-header-service__mobile-menu":!0,"is-open":this.openMenu==="search","align-right":this.alignSearchRight});return u`
|
|
1252
1252
|
<div
|
|
1253
1253
|
class=${t}
|
|
1254
1254
|
@focusout=${i=>this.handleFocusOut(i,"search")}
|
|
@@ -1268,7 +1268,7 @@
|
|
|
1268
1268
|
Søk
|
|
1269
1269
|
</pkt-button>
|
|
1270
1270
|
<div class=${e} ${M(this.searchMenuRef)}>
|
|
1271
|
-
${this.openMenu==="search"?
|
|
1271
|
+
${this.openMenu==="search"?u`
|
|
1272
1272
|
<pkt-textinput
|
|
1273
1273
|
id="mobile-search-menu"
|
|
1274
1274
|
class="pkt-header-service__search-input"
|
|
@@ -1282,10 +1282,10 @@
|
|
|
1282
1282
|
@input=${this.handleSearchInputChange}
|
|
1283
1283
|
@keydown=${i=>{i.key==="Enter"&&this.handleSearch(i.target.value)}}
|
|
1284
1284
|
></pkt-textinput>
|
|
1285
|
-
`:
|
|
1285
|
+
`:k}
|
|
1286
1286
|
</div>
|
|
1287
1287
|
</div>
|
|
1288
|
-
`}return
|
|
1288
|
+
`}return u`
|
|
1289
1289
|
<pkt-textinput
|
|
1290
1290
|
id="header-service-search"
|
|
1291
1291
|
class="pkt-header-service__search-input"
|
|
@@ -1297,7 +1297,7 @@
|
|
|
1297
1297
|
@input=${this.handleSearchInputChange}
|
|
1298
1298
|
@keydown=${this.handleSearchKeyDown}
|
|
1299
1299
|
></pkt-textinput>
|
|
1300
|
-
`}renderUserButton(){var t;if(!this.user)return
|
|
1300
|
+
`}renderUserButton(){var t;if(!this.user)return k;const e=N({"pkt-header-service__user-menu":this.isMobile===!1,"pkt-header-service__mobile-menu":this.isMobile===!0,"is-open":this.openMenu==="user"});return u`
|
|
1301
1301
|
<div
|
|
1302
1302
|
class="pkt-header-service__user-container"
|
|
1303
1303
|
@focusout=${i=>this.handleFocusOut(i,"user")}
|
|
@@ -1316,11 +1316,11 @@
|
|
|
1316
1316
|
<span class="pkt-sr-only">Brukermeny: </span>
|
|
1317
1317
|
${((t=this.representing)==null?void 0:t.name)||this.user.name}
|
|
1318
1318
|
</pkt-button>
|
|
1319
|
-
${this.openMenu==="user"&&this.user?
|
|
1319
|
+
${this.openMenu==="user"&&this.user?u`
|
|
1320
1320
|
<div class=${e}>
|
|
1321
1321
|
<pkt-header-user-menu
|
|
1322
1322
|
.user=${this.user}
|
|
1323
|
-
formatted-last-logged-in=${this.formattedLastLoggedIn||
|
|
1323
|
+
formatted-last-logged-in=${this.formattedLastLoggedIn||k}
|
|
1324
1324
|
.representing=${this.representing}
|
|
1325
1325
|
.userMenu=${this.userMenu}
|
|
1326
1326
|
?can-change-representation=${this.canChangeRepresentation}
|
|
@@ -1329,15 +1329,15 @@
|
|
|
1329
1329
|
@log-out=${this.handleLogout}
|
|
1330
1330
|
></pkt-header-user-menu>
|
|
1331
1331
|
</div>
|
|
1332
|
-
`:
|
|
1332
|
+
`:k}
|
|
1333
1333
|
</div>
|
|
1334
|
-
`}renderHeader(){const t=N({"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}),e=N({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return
|
|
1334
|
+
`}renderHeader(){const t=N({"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}),e=N({"pkt-header-service__logo-area":!0,"pkt-header-service__logo-area--without-service":!this.serviceName});return u`
|
|
1335
1335
|
<header class=${t} ${M(this.headerRef)}>
|
|
1336
1336
|
<div class=${e}>${this.renderLogo()} ${this.renderServiceName()}</div>
|
|
1337
1337
|
|
|
1338
1338
|
<div class="pkt-header-service__content">
|
|
1339
1339
|
${this.renderSlotContainer()} ${this.renderSearch()}
|
|
1340
|
-
${this.isTablet&&this.showLogoutInHeader?
|
|
1340
|
+
${this.isTablet&&this.showLogoutInHeader?u`
|
|
1341
1341
|
<pkt-button
|
|
1342
1342
|
skin="secondary"
|
|
1343
1343
|
size=${this.isMobile?"small":"medium"}
|
|
@@ -1347,12 +1347,12 @@
|
|
|
1347
1347
|
>
|
|
1348
1348
|
Logg ut
|
|
1349
1349
|
</pkt-button>
|
|
1350
|
-
`:
|
|
1350
|
+
`:k}
|
|
1351
1351
|
</div>
|
|
1352
1352
|
|
|
1353
1353
|
<div class="pkt-header-service__user">
|
|
1354
1354
|
${this.renderUserButton()}
|
|
1355
|
-
${!this.isTablet&&this.showLogoutInHeader?
|
|
1355
|
+
${!this.isTablet&&this.showLogoutInHeader?u`
|
|
1356
1356
|
<pkt-button
|
|
1357
1357
|
skin="tertiary"
|
|
1358
1358
|
size="medium"
|
|
@@ -1362,15 +1362,15 @@
|
|
|
1362
1362
|
>
|
|
1363
1363
|
Logg ut
|
|
1364
1364
|
</pkt-button>
|
|
1365
|
-
`:
|
|
1365
|
+
`:k}
|
|
1366
1366
|
</div>
|
|
1367
1367
|
</header>
|
|
1368
|
-
`}render(){const t=this.renderHeader();if(this.isFixed){const e=N({"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
|
|
1368
|
+
`}render(){const t=this.renderHeader();if(this.isFixed){const e=N({"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 u`
|
|
1369
1369
|
<div class="pkt-header-service-wrapper">
|
|
1370
1370
|
${t}
|
|
1371
1371
|
<div class=${e}></div>
|
|
1372
1372
|
</div>
|
|
1373
|
-
`}return t}};
|
|
1373
|
+
`}return t}};K([o({type:String,attribute:"service-name"})],W.prototype,"serviceName",2),K([o({type:String,attribute:"service-link"})],W.prototype,"serviceLink",2),K([o({type:String,attribute:"logo-link"})],W.prototype,"logoLink",2),K([o({type:String,attribute:"search-placeholder"})],W.prototype,"searchPlaceholder",2),K([o({type:String,attribute:"search-value"})],W.prototype,"searchValue",2),K([o({type:Number,attribute:"mobile-breakpoint"})],W.prototype,"mobileBreakpoint",2),K([o({type:Number,attribute:"tablet-breakpoint"})],W.prototype,"tabletBreakpoint",2),K([o({type:String,attribute:"opened-menu"})],W.prototype,"openedMenu",2),K([o({type:String,attribute:"log-out-button-placement"})],W.prototype,"logOutButtonPlacement",2),K([o({type:String})],W.prototype,"position",2),K([o({type:String,attribute:"scroll-behavior"})],W.prototype,"scrollBehavior",2),K([o({type:String,attribute:"slot-menu-variant"})],W.prototype,"slotMenuVariant",2),K([o({type:String,attribute:"slot-menu-text"})],W.prototype,"slotMenuText",2),K([o({type:Boolean,attribute:"hide-logo",converter:Mt})],W.prototype,"hideLogo",2),K([o({type:Boolean,converter:Mt})],W.prototype,"compact",2),K([o({type:Boolean,attribute:"show-search",converter:Mt})],W.prototype,"showSearch",2),K([o({type:Boolean,attribute:"can-change-representation",converter:Mt})],W.prototype,"canChangeRepresentation",2),K([o({type:Boolean,attribute:"has-log-out",converter:Mt})],W.prototype,"hasLogOut",2),K([o({type:Object})],W.prototype,"user",2),K([o({type:Array,attribute:"user-menu"})],W.prototype,"userMenu",2),K([o({type:Object})],W.prototype,"representing",2),K([I()],W.prototype,"isMobile",2),K([I()],W.prototype,"isTablet",2),K([I()],W.prototype,"openMenu",2),K([I()],W.prototype,"isHidden",2),K([I()],W.prototype,"componentWidth",2),K([I()],W.prototype,"hasSlotContent",2),K([I()],W.prototype,"alignSlotRight",2),K([I()],W.prototype,"alignSearchRight",2),W=K([V("pkt-header-service")],W);var Uh=Object.defineProperty,zh=Object.getOwnPropertyDescriptor,it=(s,t,e,i)=>{for(var n=i>1?void 0:i?zh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Uh(t,e,n),n};let tt=class extends X{constructor(){super(),this.defaultSlot=E(),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 ot(this,this.defaultSlot)}firstUpdated(t){super.firstUpdated(t),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 t=this.userMenu||[],e=this.userMenuFooter||[],i=this.userOptions||[];return e.length||i.length?[...t,...i,...e]:this.userMenu}render(){return u`
|
|
1374
1374
|
<pkt-header-service
|
|
1375
1375
|
service-name=${C(this.serviceName)}
|
|
1376
1376
|
service-link=${C(this.serviceLink)}
|
|
@@ -1383,6 +1383,8 @@
|
|
|
1383
1383
|
log-out-button-placement=${this.logOutButtonPlacement}
|
|
1384
1384
|
position=${this.position}
|
|
1385
1385
|
scroll-behavior=${this.scrollBehavior}
|
|
1386
|
+
slot-menu-variant=${this.slotMenuVariant}
|
|
1387
|
+
slot-menu-text=${this.slotMenuText}
|
|
1386
1388
|
.hideLogo=${this.hideLogo}
|
|
1387
1389
|
.compact=${this.compact}
|
|
1388
1390
|
.showSearch=${this.showSearch}
|
|
@@ -1394,35 +1396,35 @@
|
|
|
1394
1396
|
>
|
|
1395
1397
|
<div class="pkt-contents" ${M(this.defaultSlot)}></div>
|
|
1396
1398
|
</pkt-header-service>
|
|
1397
|
-
`}};
|
|
1399
|
+
`}};it([o({type:String,attribute:"service-name"})],tt.prototype,"serviceName",2),it([o({type:String,attribute:"service-link"})],tt.prototype,"serviceLink",2),it([o({type:String,attribute:"logo-link"})],tt.prototype,"logoLink",2),it([o({type:String,attribute:"search-placeholder"})],tt.prototype,"searchPlaceholder",2),it([o({type:String,attribute:"search-value"})],tt.prototype,"searchValue",2),it([o({type:Number,attribute:"mobile-breakpoint"})],tt.prototype,"mobileBreakpoint",2),it([o({type:Number,attribute:"tablet-breakpoint"})],tt.prototype,"tabletBreakpoint",2),it([o({type:String,attribute:"opened-menu"})],tt.prototype,"openedMenu",2),it([o({type:String,attribute:"log-out-button-placement"})],tt.prototype,"logOutButtonPlacement",2),it([o({type:String})],tt.prototype,"position",2),it([o({type:String,attribute:"scroll-behavior"})],tt.prototype,"scrollBehavior",2),it([o({type:String,attribute:"slot-menu-variant"})],tt.prototype,"slotMenuVariant",2),it([o({type:String,attribute:"slot-menu-text"})],tt.prototype,"slotMenuText",2),it([o({type:Boolean,attribute:"hide-logo",converter:Mt})],tt.prototype,"hideLogo",2),it([o({type:Boolean,converter:Mt})],tt.prototype,"compact",2),it([o({type:Boolean,attribute:"show-search",converter:Mt})],tt.prototype,"showSearch",2),it([o({type:Boolean,attribute:"can-change-representation",converter:Mt})],tt.prototype,"canChangeRepresentation",2),it([o({type:Boolean,attribute:"has-log-out",converter:Mt})],tt.prototype,"hasLogOut",2),it([o({type:Object})],tt.prototype,"user",2),it([o({type:Array,attribute:"user-menu"})],tt.prototype,"userMenu",2),it([o({type:Object})],tt.prototype,"representing",2),it([o({type:Array,attribute:"user-menu-footer"})],tt.prototype,"userMenuFooter",2),it([o({type:Array,attribute:"user-options"})],tt.prototype,"userOptions",2),tt=it([V("pkt-header")],tt);var qh=Object.defineProperty,Wh=Object.getOwnPropertyDescriptor,Ze=(s,t,e,i)=>{for(var n=i>1?void 0:i?Wh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&qh(t,e,n),n};let Pe=class extends X{constructor(){super(),this.defaultSlot=E(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new ot(this,this.defaultSlot)}render(){const t=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),e=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return u`
|
|
1398
1400
|
<a
|
|
1399
1401
|
href=${this.href}
|
|
1400
1402
|
class=${t}
|
|
1401
1403
|
target=${this.openInNewTab?"_blank":"_self"}
|
|
1402
1404
|
rel=${C(this.openInNewTab?"noopener noreferrer":void 0)}
|
|
1403
1405
|
>
|
|
1404
|
-
${this.iconName&&
|
|
1405
|
-
${this.title&&
|
|
1406
|
+
${this.iconName&&u`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
1407
|
+
${this.title&&u`<div class=${e}>${this.title}</div>`}
|
|
1406
1408
|
|
|
1407
1409
|
<div class="pkt-linkcard__text" ${M(this.defaultSlot)}></div>
|
|
1408
1410
|
</a>
|
|
1409
|
-
`}};
|
|
1411
|
+
`}};Ze([o({type:String,reflect:!0})],Pe.prototype,"title",2),Ze([o({type:String,reflect:!0})],Pe.prototype,"href",2),Ze([o({type:String,reflect:!0})],Pe.prototype,"iconName",2),Ze([o({type:Boolean,reflect:!0})],Pe.prototype,"external",2),Ze([o({type:Boolean,reflect:!0})],Pe.prototype,"openInNewTab",2),Ze([o({type:String,reflect:!0})],Pe.prototype,"skin",2),Pe=Ze([V("pkt-linkcard")],Pe);var Rh=Object.defineProperty,Kh=Object.getOwnPropertyDescriptor,ke=(s,t,e,i)=>{for(var n=i>1?void 0:i?Kh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Rh(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.3/animations/";let ie=class extends X{constructor(){super(),this.defaultSlot=E(),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 ot(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(t){t.has("delay")&&this.setupLoader()}render(){const t=N({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),e=N({"pkt-contents":!0,"pkt-hide":this.isLoading});return u`<div
|
|
1410
1412
|
role="status"
|
|
1411
1413
|
aria-live="polite"
|
|
1412
1414
|
aria-busy=${this.isLoading?"true":"false"}
|
|
1413
1415
|
class=${t}
|
|
1414
1416
|
>
|
|
1415
|
-
${this.isLoading&&this._shouldDisplayLoader?
|
|
1417
|
+
${this.isLoading&&this._shouldDisplayLoader?u`<div class="pkt-loader__spinner">
|
|
1416
1418
|
<pkt-icon
|
|
1417
1419
|
name=${this.getVariant(this.variant)}
|
|
1418
1420
|
path=${this.loadingAnimationPath}
|
|
1419
1421
|
class="pkt-loader__svg pkt-loader__${this.variant}"
|
|
1420
1422
|
></pkt-icon>
|
|
1421
|
-
${this.message&&
|
|
1422
|
-
</div>`:
|
|
1423
|
+
${this.message&&u`<p>${this.message}</p>`}
|
|
1424
|
+
</div>`:k}
|
|
1423
1425
|
<div class=${e} ${M(this.defaultSlot)}></div>
|
|
1424
|
-
</div>`}getVariant(t){switch(t){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))}};ke([o({type:Number})],ie.prototype,"delay",2),ke([o({type:Boolean})],ie.prototype,"inline",2),ke([o({type:Boolean})],ie.prototype,"isLoading",2),ke([o({type:String})],ie.prototype,"message",2),ke([o({type:String})],ie.prototype,"size",2),ke([o({type:String})],ie.prototype,"variant",2),ke([o({type:String})],ie.prototype,"loadingAnimationPath",2),ke([
|
|
1425
|
-
${this.closable?
|
|
1426
|
+
</div>`}getVariant(t){switch(t){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))}};ke([o({type:Number})],ie.prototype,"delay",2),ke([o({type:Boolean})],ie.prototype,"inline",2),ke([o({type:Boolean})],ie.prototype,"isLoading",2),ke([o({type:String})],ie.prototype,"message",2),ke([o({type:String})],ie.prototype,"size",2),ke([o({type:String})],ie.prototype,"variant",2),ke([o({type:String})],ie.prototype,"loadingAnimationPath",2),ke([I()],ie.prototype,"_shouldDisplayLoader",2),ie=ke([V("pkt-loader")],ie);const Yh={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},tn={props:Yh};var Gh=Object.defineProperty,Zh=Object.getOwnPropertyDescriptor,vs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Zh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Gh(t,e,n),n};let Xe=class extends X{constructor(){super(),this.defaultSlot=E(),this.closable=tn.props.closable.default,this.compact=tn.props.compact.default,this.title="",this.skin=tn.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 ot(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&Hn(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 u`<div class=${N(s)}>
|
|
1427
|
+
${this.closable?u`<div class="pkt-messagebox__close">
|
|
1426
1428
|
<button
|
|
1427
1429
|
@click=${this.close}
|
|
1428
1430
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only"
|
|
@@ -1430,10 +1432,10 @@
|
|
|
1430
1432
|
>
|
|
1431
1433
|
<pkt-icon name="close" class="pkt-link__icon"></pkt-icon>
|
|
1432
1434
|
</button>
|
|
1433
|
-
</div>`:
|
|
1434
|
-
${this.title?
|
|
1435
|
+
</div>`:k}
|
|
1436
|
+
${this.title?u`<div class="pkt-messagebox__title">${this.title}</div>`:k}
|
|
1435
1437
|
<div class="pkt-messagebox__text" ${M(this.defaultSlot)}></div>
|
|
1436
|
-
</div>`}};
|
|
1438
|
+
</div>`}};vs([o({type:Boolean,reflect:!0})],Xe.prototype,"closable",2),vs([o({type:Boolean,reflect:!0})],Xe.prototype,"compact",2),vs([o({type:String,reflect:!0})],Xe.prototype,"title",2),vs([o({type:String,reflect:!0})],Xe.prototype,"skin",2),vs([I()],Xe.prototype,"_isClosed",2),Xe=vs([V("pkt-messagebox")],Xe);const Xh={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},en={props:Xh};var Jh=Object.defineProperty,Qh=Object.getOwnPropertyDescriptor,ne=(s,t,e,i)=>{for(var n=i>1?void 0:i?Qh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Jh(t,e,n),n};let jt=class extends X{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=en.props.hideCloseButton.default,this.closeOnBackdropClick=en.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=en.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=E(),this.dialogRef=E(),this._isOpen=!1,this.close=(t,e=!1)=>{var i;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const n=document.activeElement;n&&!this.isElementInViewport(n)&&n.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),e||(i=this.dialogRef.value)==null||i.close(),this.requestUpdate()},this.showModal=(t=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const i=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var n;this.dialogRef.value&&((n=this.dialogRef.value)==null||n.focus())}),i&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:t},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new ot(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(t){super.firstUpdated(t),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>hd).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(t){t.key==="Escape"&&this.close(t)}handleBackdropClick(t){var e;this.closeOnBackdropClick&&t.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(t)}isElementInViewport(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const t={"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},i={"pkt-modal__content":!0,"pkt-txt-18-light":!0},n=this.closeButtonSkin==="blue",a={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return u`
|
|
1437
1439
|
<dialog
|
|
1438
1440
|
class=${N(t)}
|
|
1439
1441
|
${M(this.dialogRef)}
|
|
@@ -1442,12 +1444,12 @@
|
|
|
1442
1444
|
@close=${r=>this.close(r,!0)}
|
|
1443
1445
|
>
|
|
1444
1446
|
<div class="pkt-modal__wrapper">
|
|
1445
|
-
${this.headingText||!this.hideCloseButton?
|
|
1447
|
+
${this.headingText||!this.hideCloseButton?u`<div class="pkt-modal__header">
|
|
1446
1448
|
<div class="pkt-modal__header-background"></div>
|
|
1447
|
-
${this.headingText?
|
|
1449
|
+
${this.headingText?u`<h1 id="pkt-modal__headingText" class=${N(e)}>
|
|
1448
1450
|
${this.headingText}
|
|
1449
|
-
</h1>`:
|
|
1450
|
-
${this.hideCloseButton?
|
|
1451
|
+
</h1>`:u`<div class="pkt-modal__headingText"></div>`}
|
|
1452
|
+
${this.hideCloseButton?u`<div class="pkt-modal__noCloseButton"></div>`:u`<div class="${N(a)}">
|
|
1451
1453
|
<pkt-button
|
|
1452
1454
|
@click=${r=>this.close(r)}
|
|
1453
1455
|
aria-label="close"
|
|
@@ -1459,7 +1461,7 @@
|
|
|
1459
1461
|
Lukk
|
|
1460
1462
|
</pkt-button>
|
|
1461
1463
|
</div>`}
|
|
1462
|
-
</div>`:
|
|
1464
|
+
</div>`:k}
|
|
1463
1465
|
<div class="pkt-modal__container">
|
|
1464
1466
|
<div
|
|
1465
1467
|
id="pkt-modal__content"
|
|
@@ -1469,36 +1471,36 @@
|
|
|
1469
1471
|
</div>
|
|
1470
1472
|
</div>
|
|
1471
1473
|
</dialog>
|
|
1472
|
-
`}};ne([o({type:String})],
|
|
1474
|
+
`}};ne([o({type:String})],jt.prototype,"headingText",2),ne([o({type:Boolean})],jt.prototype,"removePadding",2),ne([o({type:Boolean})],jt.prototype,"hideCloseButton",2),ne([o({type:Boolean})],jt.prototype,"closeOnBackdropClick",2),ne([o({type:String})],jt.prototype,"closeButtonSkin",2),ne([o({type:String})],jt.prototype,"size",2),ne([o({type:String})],jt.prototype,"variant",2),ne([o({type:String})],jt.prototype,"drawerPosition",2),ne([o({type:Boolean})],jt.prototype,"transparentBackdrop",2),ne([I()],jt.prototype,"_isOpen",2),jt=ne([V("pkt-modal")],jt);/**
|
|
1473
1475
|
* @license
|
|
1474
1476
|
* Copyright 2018 Google LLC
|
|
1475
1477
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1476
|
-
*/const $a="important",tc=" !"+$a,ec=
|
|
1478
|
+
*/const $a="important",tc=" !"+$a,ec=Fe(class extends rs{constructor(s){var t;if(super(s),s.type!==Qt.ATTRIBUTE||s.name!=="style"||((t=s.strings)==null?void 0:t.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(((t,e)=>{const i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(s,[t]){const{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(const i in t){const n=t[i];if(n!=null){this.ft.add(i);const a=typeof n=="string"&&n.endsWith(tc);i.includes("-")||a?e.setProperty(i,a?n.slice(0,-11):n,a?$a:""):e[i]=n}}return Et}});var sc=Object.defineProperty,ic=Object.getOwnPropertyDescriptor,ft=(s,t,e,i)=>{for(var n=i>1?void 0:i?ic(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&sc(t,e,n),n};let ct=class extends X{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=Ae(),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=E(),this.progressBarRef=E()}firstUpdated(s){super.firstUpdated(s),this.setComputedValues(),this.syncAttributes()}updated(s){super.updated(s),s.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),s.has("id")&&this.id&&(this.progressBarId=this.id),(s.has("statusType")||s.has("id")||s.has("ariaLabelledby"))&&(this.progressbarId=this.id||Ae(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(s.has("ariaValueText")||s.has("valueCurrent")||s.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const s=this.statusType!=="none",t=this.valueMax-this.valueMin,e=this.valueCurrent/t*100,i=this.statusType==="fraction"?Math.round(e):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),n=`${this.valueCurrent} av ${t}`,a=N({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),r=N({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),h=N({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),c=N({"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 u` <div
|
|
1477
1479
|
class="pkt-progressbar__container"
|
|
1478
1480
|
.ref=${this.progressBarRef}
|
|
1479
1481
|
style=${ec({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${i}%`})}
|
|
1480
1482
|
>
|
|
1481
|
-
${this.title?
|
|
1483
|
+
${this.title?u`<p id=${`${this.progressBarId}-title`} class=${r}>${this.title}</p>`:k}
|
|
1482
1484
|
|
|
1483
1485
|
<div class="pkt-progressbar__bar-wrapper">
|
|
1484
1486
|
<div class=${a}></div>
|
|
1485
1487
|
</div>
|
|
1486
1488
|
|
|
1487
|
-
${s?
|
|
1489
|
+
${s?u`<div class=${h}>
|
|
1488
1490
|
<span class=${c} ${M(this.labelRef)}>
|
|
1489
1491
|
${this.statusType==="percentage"?`${i}%`:n}
|
|
1490
1492
|
</span>
|
|
1491
|
-
</div>`:
|
|
1492
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||
|
|
1493
|
-
${this.tagText?
|
|
1494
|
-
${this.optionalTag?
|
|
1495
|
-
${this.requiredTag?
|
|
1496
|
-
`,a=()=>
|
|
1493
|
+
</div>`:k}
|
|
1494
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||Ae(),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(s,t){t==null||t===""?this.removeAttribute(s):this.setAttribute(s,String(t))}};ft([o({type:String})],ct.prototype,"ariaLabel",2),ft([o({type:String,reflect:!0})],ct.prototype,"ariaLabelledby",2),ft([o({type:String,reflect:!0})],ct.prototype,"ariaValueText",2),ft([o({type:String})],ct.prototype,"ariaLive",2),ft([o({type:String,reflect:!0})],ct.prototype,"id",2),ft([o({type:String})],ct.prototype,"role",2),ft([o({type:String})],ct.prototype,"skin",2),ft([o({type:String})],ct.prototype,"statusPlacement",2),ft([o({type:String})],ct.prototype,"statusType",2),ft([o({type:String,reflect:!0})],ct.prototype,"title",2),ft([o({type:String})],ct.prototype,"titlePosition",2),ft([o({type:Number,reflect:!0})],ct.prototype,"valueCurrent",2),ft([o({type:Number})],ct.prototype,"valueMax",2),ft([o({type:Number})],ct.prototype,"valueMin",2),ft([I()],ct.prototype,"labelWidth",2),ft([I()],ct.prototype,"progressbarId",2),ft([I()],ct.prototype,"computedAriaLabelledby",2),ft([I()],ct.prototype,"computedAriaValueText",2),ct=ft([V("pkt-progressbar")],ct);var nc=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,Ht=(s,t,e,i)=>{for(var n=i>1?void 0:i?ac(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&nc(t,e,n),n};let Ot=class extends L{constructor(){super(...arguments),this.inputRef=E(),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,t,e){s==="defaultChecked"&&(this._checked=this.defaultChecked),s==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(s,t,e)}render(){const s=N({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=N({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),e=N({"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=()=>u`
|
|
1495
|
+
${this.tagText?u`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:k}
|
|
1496
|
+
${this.optionalTag?u`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:k}
|
|
1497
|
+
${this.requiredTag?u`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:k}
|
|
1498
|
+
`,a=()=>u`
|
|
1497
1499
|
<label class=${e} for=${this.id+"-internal"}>
|
|
1498
1500
|
${this.label} ${n()}
|
|
1499
|
-
${this.checkHelptext?
|
|
1501
|
+
${this.checkHelptext?u`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:k}
|
|
1500
1502
|
</label>
|
|
1501
|
-
`;return
|
|
1503
|
+
`;return u`
|
|
1502
1504
|
<div class="pkt-input-check">
|
|
1503
1505
|
<div class=${s}>
|
|
1504
1506
|
<input
|
|
@@ -1519,7 +1521,7 @@
|
|
|
1519
1521
|
${a()}
|
|
1520
1522
|
</div>
|
|
1521
1523
|
</div>
|
|
1522
|
-
`}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))}};
|
|
1524
|
+
`}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))}};Ht([o({type:String,reflect:!0})],Ot.prototype,"value",2),Ht([o({type:String})],Ot.prototype,"checkHelptext",2),Ht([o({type:Boolean})],Ot.prototype,"defaultChecked",2),Ht([o({type:Boolean})],Ot.prototype,"hasTile",2),Ht([o({type:Boolean,reflect:!0})],Ot.prototype,"checked",2),Ht([o({type:String,reflect:!0})],Ot.prototype,"type",2),Ht([o({type:String})],Ot.prototype,"tagText",2),Ht([o({type:Boolean})],Ot.prototype,"optionalTag",2),Ht([o({type:String})],Ot.prototype,"optionalText",2),Ht([o({type:Boolean})],Ot.prototype,"requiredTag",2),Ht([o({type:String})],Ot.prototype,"requiredText",2),Ht([I()],Ot.prototype,"_checked",2),Ot=Ht([V("pkt-radiobutton")],Ot);/**
|
|
1523
1525
|
* @license
|
|
1524
1526
|
* Copyright 2021 Google LLC
|
|
1525
1527
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1547,15 +1549,15 @@
|
|
|
1547
1549
|
* @license
|
|
1548
1550
|
* Copyright 2022 Google LLC
|
|
1549
1551
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1550
|
-
*/function hc({context:s,subscribe:t}){return(e,i)=>{typeof i=="object"?i.addInitializer((function(){new wa(this,{context:s,callback:n=>{e.set.call(this,n)},subscribe:t})})):e.constructor.addInitializer((n=>{new wa(n,{context:s,callback:a=>{n[i]=a},subscribe:t})}))}}const Sa=Symbol("pkt-tabs-context");var cc=Object.defineProperty,dc=Object.getOwnPropertyDescriptor,
|
|
1552
|
+
*/function hc({context:s,subscribe:t}){return(e,i)=>{typeof i=="object"?i.addInitializer((function(){new wa(this,{context:s,callback:n=>{e.set.call(this,n)},subscribe:t})})):e.constructor.addInitializer((n=>{new wa(n,{context:s,callback:a=>{n[i]=a},subscribe:t})}))}}const Sa=Symbol("pkt-tabs-context");var cc=Object.defineProperty,dc=Object.getOwnPropertyDescriptor,bs=(s,t,e,i)=>{for(var n=i>1?void 0:i?dc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&cc(t,e,n),n};let Je=class extends X{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=E(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new ot(this,this.defaultSlot)}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(t){(t.has("arrowNav")||t.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(t,e){this.tabRefs[e]=t,this.tabCount=Math.max(this.tabCount,e+1)}handleClick(t){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0}))}handleKeyUp(t,e){var i,n;this.useArrowNav&&(t.code==="ArrowLeft"&&e!==0&&((i=this.tabRefs[e-1])==null||i.focus()),t.code==="ArrowRight"&&e<this.tabCount-1&&((n=this.tabRefs[e+1])==null||n.focus()),(t.code==="ArrowDown"||t.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:e},bubbles:!0,composed:!0})))}render(){const t=this.useArrowNav?"tablist":"navigation";return u`
|
|
1551
1553
|
<div class="pkt-tabs">
|
|
1552
1554
|
<div class="pkt-tabs__list" role=${t} ${M(this.defaultSlot)}></div>
|
|
1553
1555
|
</div>
|
|
1554
|
-
`}};
|
|
1555
|
-
${this.icon?
|
|
1556
|
+
`}};bs([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],Je.prototype,"arrowNav",2),bs([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],Je.prototype,"disableArrowNav",2),bs([I()],Je.prototype,"tabRefs",2),bs([I()],Je.prototype,"tabCount",2),bs([lc({context:Sa}),I()],Je.prototype,"context",2),Je=bs([V("pkt-tabs")],Je);var uc=Object.defineProperty,pc=Object.getOwnPropertyDescriptor,ye=(s,t,e,i)=>{for(var n=i>1?void 0:i?pc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&uc(t,e,n),n};let ue=class extends X{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=E(),this.defaultSlot=E(),this.slotController=new ot(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(t){this.context&&this.context.handleKeyUp(t,this.index)}render(){var t;const e=((t=this.context)==null?void 0:t.useArrowNav)??!0,i=this.active?"active":"",n=e?"tab":void 0,a=e?this.active:void 0,r=this.active||!e?void 0:-1,h=u`
|
|
1557
|
+
${this.icon?u`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
|
|
1556
1558
|
<span ${M(this.defaultSlot)}></span>
|
|
1557
|
-
${this.tag?
|
|
1558
|
-
`;return this.href?
|
|
1559
|
+
${this.tag?u`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
|
|
1560
|
+
`;return this.href?u`
|
|
1559
1561
|
<a
|
|
1560
1562
|
${M(this.elementRef)}
|
|
1561
1563
|
href=${this.href}
|
|
@@ -1569,7 +1571,7 @@
|
|
|
1569
1571
|
>
|
|
1570
1572
|
${h}
|
|
1571
1573
|
</a>
|
|
1572
|
-
`:
|
|
1574
|
+
`:u`
|
|
1573
1575
|
<button
|
|
1574
1576
|
${M(this.elementRef)}
|
|
1575
1577
|
type="button"
|
|
@@ -1583,11 +1585,11 @@
|
|
|
1583
1585
|
>
|
|
1584
1586
|
${h}
|
|
1585
1587
|
</button>
|
|
1586
|
-
`}};ye([o({type:Boolean,reflect:!0})],ue.prototype,"active",2),ye([o({type:String,reflect:!0})],ue.prototype,"href",2),ye([o({type:String,reflect:!0})],ue.prototype,"icon",2),ye([o({type:String,reflect:!0})],ue.prototype,"controls",2),ye([o({type:String,reflect:!0})],ue.prototype,"tag",2),ye([o({type:String,reflect:!0,attribute:"tag-skin"})],ue.prototype,"tagSkin",2),ye([o({type:Number,reflect:!0})],ue.prototype,"index",2),ye([hc({context:Sa,subscribe:!0}),o({attribute:!1})],ue.prototype,"context",2),ue=ye([
|
|
1588
|
+
`}};ye([o({type:Boolean,reflect:!0})],ue.prototype,"active",2),ye([o({type:String,reflect:!0})],ue.prototype,"href",2),ye([o({type:String,reflect:!0})],ue.prototype,"icon",2),ye([o({type:String,reflect:!0})],ue.prototype,"controls",2),ye([o({type:String,reflect:!0})],ue.prototype,"tag",2),ye([o({type:String,reflect:!0,attribute:"tag-skin"})],ue.prototype,"tagSkin",2),ye([o({type:Number,reflect:!0})],ue.prototype,"index",2),ye([hc({context:Sa,subscribe:!0}),o({attribute:!1})],ue.prototype,"context",2),ue=ye([V("pkt-tab-item")],ue);/**
|
|
1587
1589
|
* @license
|
|
1588
1590
|
* Copyright 2020 Google LLC
|
|
1589
1591
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1590
|
-
*/const fc=
|
|
1592
|
+
*/const fc=Fe(class extends rs{constructor(s){if(super(s),s.type!==Qt.PROPERTY&&s.type!==Qt.ATTRIBUTE&&s.type!==Qt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Bn(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[t]){if(t===Et||t===k)return t;const e=s.element,i=s.name;if(s.type===Qt.PROPERTY){if(t===e[i])return Et}else if(s.type===Qt.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return Et}else if(s.type===Qt.ATTRIBUTE&&e.getAttribute(i)===t+"")return Et;return Vn(s),t}});var gc=Object.defineProperty,mc=Object.getOwnPropertyDescriptor,Xs=(s,t,e,i)=>{for(var n=i>1?void 0:i?mc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&gc(t,e,n),n};let ks=class extends L{constructor(){super(),this.inputRef=E(),this.helptextSlot=E(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new ot(this,this.helptextSlot)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}updated(t){var e;super.updated(t),t.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const t=N({"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 u`<pkt-input-wrapper
|
|
1591
1593
|
label=${this.label}
|
|
1592
1594
|
?counter=${this.counter}
|
|
1593
1595
|
?disabled=${this.disabled}
|
|
@@ -1632,7 +1634,7 @@
|
|
|
1632
1634
|
@focus=${i=>{this.onFocus(),i.stopImmediatePropagation()}}
|
|
1633
1635
|
@blur=${i=>{this.value=i.target.value,this.onBlur(),i.stopImmediatePropagation()}}
|
|
1634
1636
|
></textarea>
|
|
1635
|
-
</pkt-input-wrapper>`}};Xs([o({type:String,reflect:!0})]
|
|
1637
|
+
</pkt-input-wrapper>`}};Xs([o({type:String,reflect:!0})],ks.prototype,"value",2),Xs([o({type:String})],ks.prototype,"autocomplete",2),Xs([o({type:Number})],ks.prototype,"rows",2),Xs([I()],ks.prototype,"counterCurrent",2),ks=Xs([V("pkt-textarea")],ks);var vc=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,Ei=(s,t,e,i)=>{for(var n=i>1?void 0:i?bc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&vc(t,e,n),n};let Js=class extends L{constructor(){super(),this.inputRef=E(),this.helptextSlot=E(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new ba(this),this.slotController=new ot(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(i=>{const n={value:i.hasAttribute("value")?i.getAttribute("value")??"":i.textContent??"",label:i.textContent||i.getAttribute("value")||"",disabled:i.hasAttribute("disabled"),selected:i.hasAttribute("selected"),hidden:i.hasAttribute("data-hidden")};i.getAttribute("selected")&&!this.value&&(this.value=n.value),this._options.push(n)}):(this._options=this._optionsProp,this._options.forEach(i=>{i.selected&&!this.value&&(this.value=i.value)}))}add(t,e){const i={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(i);else if(typeof e=="number")this._options.splice(e,0,i);else{const n=e.value||e.text,a=this._options.findIndex(r=>r.value===n);a>=0?this._options.splice(a,0,i):this._options.push(i)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(n=>n.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,i){var n,a;t==="options"&&(this._options=i?JSON.parse(i):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((n=this.inputRef.value)==null?void 0:n.selectedIndex):this._options.findIndex(r=>r.value===i),this.selectedOptions=(a=this.inputRef.value)==null?void 0:a.selectedOptions,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}update(t){var e,i;super.update(t),t.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)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(n=>n.value===this.value),this.selectedOptions=(i=this.inputRef.value)==null?void 0:i.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),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(i=>i.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return u`
|
|
1636
1638
|
<pkt-input-wrapper
|
|
1637
1639
|
?counter=${this.counter}
|
|
1638
1640
|
?disabled=${this.disabled}
|
|
@@ -1669,7 +1671,7 @@
|
|
|
1669
1671
|
@blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
|
|
1670
1672
|
${M(this.inputRef)}
|
|
1671
1673
|
>
|
|
1672
|
-
${this._options.length>0?this._options.map(e=>
|
|
1674
|
+
${this._options.length>0?this._options.map(e=>u`<option
|
|
1673
1675
|
value=${e.value}
|
|
1674
1676
|
?selected=${this.value==e.value||e.selected}
|
|
1675
1677
|
?disabled=${e.disabled}
|
|
@@ -1680,7 +1682,7 @@
|
|
|
1680
1682
|
</select>
|
|
1681
1683
|
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1682
1684
|
</pkt-input-wrapper>
|
|
1683
|
-
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};Ei([o({type:Array,attribute:"options"})],Js.prototype,"_optionsProp",2),Ei([o({type:String})],Js.prototype,"value",2),Ei([
|
|
1685
|
+
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};Ei([o({type:Array,attribute:"options"})],Js.prototype,"_optionsProp",2),Ei([o({type:String})],Js.prototype,"value",2),Ei([I()],Js.prototype,"_options",2),Js=Ei([V("pkt-select")],Js);var kc=Object.defineProperty,yc=Object.getOwnPropertyDescriptor,Qs=(s,t,e,i)=>{for(var n=i>1?void 0:i?yc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&kc(t,e,n),n};let ys=class extends X{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=E(),this.namedSlot=E(),this.slotController=new ot(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(s=>{this._list.push(s.toUpperCase())}),super.connectedCallback()}render(){const s={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return u`
|
|
1684
1686
|
<div class="${N(s)}">
|
|
1685
1687
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
1686
1688
|
|
|
@@ -1701,15 +1703,15 @@
|
|
|
1701
1703
|
|
|
1702
1704
|
<h2 class="pkt-txt-22">Knapp som emitter en event</h2>
|
|
1703
1705
|
<button type="button" @click=${()=>this.handleGreeting()}>
|
|
1704
|
-
Si ${
|
|
1706
|
+
Si ${Ct.example.hi}
|
|
1705
1707
|
</button>
|
|
1706
1708
|
</div>
|
|
1707
|
-
`}renderList(s){return
|
|
1709
|
+
`}renderList(s){return u`
|
|
1708
1710
|
<ul>
|
|
1709
|
-
${s.map(t=>
|
|
1711
|
+
${s.map(t=>u`<li>${t}</li>`)}
|
|
1710
1712
|
</ul>
|
|
1711
|
-
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Qs([o({type:String})],
|
|
1713
|
+
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Qs([o({type:String})],ys.prototype,"string",2),Qs([o({converter:da})],ys.prototype,"strings",2),Qs([o({type:Boolean})],ys.prototype,"darkmode",2),Qs([o({type:Array})],ys.prototype,"_list",2),ys=Qs([V("pkt-component")],ys);const U=Jt({tagName:"pkt-icon",elementClass:je,react:w,displayName:"PktIcon",events:{}}),Ca=w.forwardRef(({defaultOpen:s=!1,id:t,title:e,skin:i,compact:n=!1,isOpen:a,children:r,name:h,className:c,onClick:p,onToggle:v},m)=>{const[y,$]=w.useState(s),{name:b}=tr(),x=h||b,T=a!==void 0?a:y;w.useEffect(()=>{a===void 0&&$(s)},[s,a]);const O=A=>{const et=A.currentTarget.open;a===void 0&&$(et),v==null||v(A)},S=A=>{setTimeout(()=>{p==null||p(A)},0)},B=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,c].filter(Boolean).join(" ");return l.jsxs("details",{ref:m,className:B,id:t,open:T,onClick:S,name:x,onToggle:O,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(U,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),l.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${t}`,role:"region",children:l.jsx("div",{className:"pkt-accordion-item__content-inner",children:r})})]})});Ca.displayName="PktAccordionItem";function $c(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var sn={exports:{}};/*!
|
|
1712
1714
|
Copyright (c) 2018 Jed Watson.
|
|
1713
1715
|
Licensed under the MIT License (MIT), see
|
|
1714
1716
|
http://jedwatson.github.io/classnames
|
|
1715
|
-
*/var Ta;function _c(){return Ta||(Ta=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var a="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(a=n(a,i(h)))}return a}function i(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return e.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var r="";for(var h in a)t.call(a,h)&&a[h]&&(r=n(r,h));return r}function n(a,r){return r?a?a+" "+r:a+r:a}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(nn)),nn.exports}var wc=_c();const Z=$c(wc),an=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:c="info",className:p,...m})=>{const[v,$]=_.useState(!1),b={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${c}`]:c,"pkt-hide":v},k={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=_.useCallback(()=>{$(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,$]),T=a||r;return l.jsx("div",{...m,"aria-live":T,role:h,className:Z(b,p),children:l.jsxs("div",{className:Z(k),children:[l.jsx(q,{className:"pkt-alert__icon","aria-hidden":"true",name:c==="info"?"alert-information":`alert-${c}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(pe,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:x,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]})]})})};an.displayName="PktAlert";const Na=Jt({tagName:"pkt-backlink",elementClass:ds,react:_,displayName:"PktBackLink"});Na.displayName="PktBackLink";const xc=_.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},n)=>{const a=s,r=a[a.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:n,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((c,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===a.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})}):t==="router"?l.jsxs(dn.Link,{to:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]}):l.jsxs("a",{href:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(dn.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.2/animations/";const pe=_.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",iconPath:n,secondIconPath:a,size:r="medium",fullWidth:h=!1,fullWidthOnMobile:c=!1,skin:p="primary",type:m="button",variant:v="label-only",state:$,color:b,isLoading:k=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...S},A)=>{const I=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",c&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,b&&`pkt-btn--${b}`,$&&`pkt-btn--${$}`,k&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...S,"aria-busy":k||void 0,"aria-disabled":x||void 0,disabled:x,className:I,type:m,ref:A,children:[k&&l.jsx(q,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),v!=="label-only"&&l.jsx(q,{className:"pkt-btn__icon",name:e,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&l.jsx(q,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});pe.displayName="PktButton";const Sc=Jt({tagName:"pkt-card",elementClass:ft,react:_,displayName:"PktCard",events:{}}),Ea=_.forwardRef(({children:s,...t},e)=>l.jsx(Sc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ea.displayName="PktCard";const Ma=_.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:n,hasError:a=!1,className:r,isSwitch:h=!1,hideLabel:c=!1,labelPosition:p="right",defaultChecked:m,checked:v,indeterminate:$,optionalTag:b,optionalText:k="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:S,...A},I)=>{const O=_.useRef(null);_.useEffect(()=>{O.current&&$!==void 0&&(O.current.indeterminate=$)},[$]),_.useEffect(()=>{typeof I=="function"?I(O.current):I&&(I.current=O.current)},[I]);const R=[r,"pkt-input-check"].filter(Boolean).join(" "),et=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,c?"pkt-sr-only":""].filter(Boolean).join(" "),Ot=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Nt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),it=()=>l.jsxs(l.Fragment,{children:[S&&l.jsx("span",{className:Nt+" pkt-tag--gray",children:S}),b&&l.jsx("span",{className:Nt+" pkt-tag--blue-light",children:k}),x&&l.jsx("span",{className:Nt+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:R,children:l.jsxs("div",{className:Ot,children:[p==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:O,className:`pkt-input-check__input-checkbox ${a?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...v!==void 0?{checked:v}:{defaultChecked:m},...A}),p==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Ma.displayName="PktCheckbox";const Cc=Jt({tagName:"pkt-combobox",elementClass:nt,react:_,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Aa=_.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Cc,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));Aa.displayName="PktCombobox";const Mi=Jt({tagName:"pkt-consent",elementClass:Kt,react:_,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Mi.displayName="PktConsent";const Tc=Jt({tagName:"pkt-datepicker",elementClass:ht,react:_,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Oa=_.forwardRef(({helptext:s,...t},e)=>l.jsx(Tc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));Oa.displayName="PktDatepicker";const Nc=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:a="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:c=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:$=null,cookieExpiryDays:b=null,onToggleConsent:k=x=>{console.log(x.detail)}})=>{var T,S;const x=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:x,"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}),(T=s.links)==null?void 0:T.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),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:t.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&l.jsx("li",{className:"pkt-footer__text",children:t.text}),(S=t.links)==null?void 0:S.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),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:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(q,{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:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:c,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:$,cookieExpiryDays:b,onToggleConsent:k})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(A=>A.language).map((A,I)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:A.href,"aria-label":`til ${A.language} versjon av nettsiden`,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:A.language})},`sociallinks-language-${I}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(A=>A.iconName).map((A,I)=>l.jsx(_.Fragment,{children:l.jsx("a",{href:A.href,"aria-label":`til ${A.iconName}`,className:"pkt-footer__social-icon-link",target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(q,{className:"pkt-footer__social-icon",name:A.iconName})})},`sociallinks-${I}`))})]})]})})},Ec=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:a=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:c=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:v=b=>{console.log(b.detail)},className:$})=>{const b=[$,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((k,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${k.external?" pkt-link--external":""}`,href:k.href,target:k.openInNewTab||t?"_blank":"_self",rel:k.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),k.text]})},x)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:e,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{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:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:c,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},Ai=({href:s,iconName:t,className:e,iconPosition:i,external:n,target:a,children:r,...h})=>{const c={"pkt-link":!0,"pkt-link--icon-left":!!t&&i==="left"||!!(t&&!i),"pkt-link--icon-right":!!t&&i==="right","pkt-link--external":n};return l.jsxs("a",{...h,className:Z(c,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(q,{name:t,className:"pkt-link__icon"}),r]})};Ai.displayName="PktLink";const Mc=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Oi=({item:s,className:t})=>"href"in s?l.jsx(Ai,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:Z("pkt-user-menu__link",t),children:s.title}):l.jsxs("button",{className:Z("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",t),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(q,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),Ac=({links:s})=>l.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((t,e)=>l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:t})},e))}),Oc=_.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const c=i==null?void 0:i.map(Mc);return l.jsx("nav",{className:"pkt-user-menu",ref:h,"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}),t&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:t})]})]}),c&&c.length>0&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Ac,{links:c})}),e&&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:e.name}),e.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",e.orgNumber]}),n&&a&&l.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})]}),!e&&n&&a&&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(Oi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})}),r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Oi,{item:{title:"Logg ut",iconName:"exit",onClick:r}})})]})})}),ti=_.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:c=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:$=null,hasError:b=!1,errorMessage:k,disabled:x=!1,inline:T=!1,ariaDescribedby:S,useWrapper:A=!0,children:I,className:O="",hasFieldset:R=!1,role:et="group",counterPosition:Ot="bottom"},Nt)=>{const[it,kt]=_.useState(!1),qt=S||(e?`${s}-helptext`:void 0),Et=!!a,dt=Et&&Ot==="top",ae=Et&&Ot==="bottom",fe=()=>kt(ut=>!ut),V=["pkt-inputwrapper",O,b?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),xt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Gt=()=>Et?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,$e=()=>l.jsxs(l.Fragment,{children:[$&&l.jsx("span",{className:xt+" pkt-tag--gray",children:$}),c&&l.jsx("span",{className:xt+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:xt+" pkt-tag--beige",children:v})]}),ge=()=>{const ut=l.jsxs(l.Fragment,{children:[t," ",$e()]});return A?R?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ut}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":qt,id:`${s}-label`,children:ut}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":qt,id:`${s}-label`,children:t})},re=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&A&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(pe,{skin:"tertiary",size:"small",variant:"icon-right",iconName:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:fe,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${it?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Ft=l.jsxs(l.Fragment,{children:[ge(),re(),dt&&l.jsx(Gt,{}),I,ae&&l.jsx(Gt,{}),b&&k&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(an,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:k})})]});return l.jsx("div",{className:V,ref:Nt,role:et,children:R?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":qt,children:Ft}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Ft})})});ti.displayName="PktInputWrapper";const rn=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:c,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:$,iconNameRight:b,inline:k=!1,fullwidth:x=!1,label:T,name:S,optionalTag:A=!1,optionalText:I,requiredTag:O=!1,requiredText:R,tagText:et=null,placeholder:Ot,prefix:Nt,suffix:it,type:kt="text",useWrapper:qt=!0,omitSearchIcon:Et=!1,value:dt,minLength:ae,maxLength:fe,min:V,max:xt,step:Gt,size:$e,readonly:ge,required:re,dataTestid:Ft,onChange:ut,skipForwardTestid:_e=!1,...we},Zt)=>{const Ss=[r,"pkt-textinput"].join(" "),Ie=kt==="search"&&!b&&!Et,es=kt==="date"&&dt?dt.slice(0,10):dt,[ss,xe]=_.useState((dt==null?void 0:dt.length)||0),Xt=`${s}`,Se=`${Xt}-label`,is=e||Se,Mt=yt=>{var Cs,Le;n&&xe(((Le=(Cs=yt.currentTarget)==null?void 0:Cs.value)==null?void 0:Le.length)||0),ut&&ut(yt)};return _.useEffect(()=>{dt!==void 0&&xe((dt==null?void 0:dt.length)||0)},[dt]),l.jsx(ti,{ariaDescribedby:t,className:Ss,disabled:h,errorMessage:c,forId:Xt,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:$,inline:k,label:T,optionalTag:A,optionalText:I,requiredTag:O,requiredText:R,tagText:et,useWrapper:qt,counter:n,counterCurrent:ss,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Ft,"data-skip-forward-testid":_e?"true":void 0,children:[Nt&&l.jsx("div",{className:"pkt-input-prefix",children:Nt}),l.jsx("input",{...we,ref:Zt,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&ss>a?"pkt-input--counter-error":""}`,type:kt,name:`${S||s}`,value:es,id:Xt,placeholder:Ot,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":is,min:V,max:xt,onChange:Mt,step:Gt,minLength:ae,maxLength:fe,size:$e,required:re}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(q,{className:"pkt-input-suffix-icon",name:b}),Ie&&l.jsx(q,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(q,{className:"pkt-input-icon",name:b}),!it&&Ie&&l.jsx(q,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})}),Pc=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=_.useState(e);return _.useEffect(()=>{const a=s.current;if(!a)return;if(n(a.offsetWidth),typeof ResizeObserver>"u"){const h=()=>{a&&n(a.offsetWidth)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)}const r=new ResizeObserver(h=>{for(const c of h)c.borderBoxSize&&c.borderBoxSize.length>0?n(c.borderBoxSize[0].inlineSize):n(c.contentRect.width)});return r.observe(a),()=>{r.disconnect()}},[s]),i};function Dc(s){const t=_.useRef(0);_.useEffect(()=>{const e=document.body,i=document.documentElement;if(s){t.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(e.style.paddingRight=`${n}px`),e.style.position="fixed",e.style.top=`-${t.current}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",i.classList.add("is-scroll-locked")}else 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"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current});return()=>{s&&(e.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current}))}},[s])}const Pa=_.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,compact:i=!1,"data-mode":n,logOutButtonPlacement:a="none",logOut:r,openedMenu:h,showSearch:c=!1,onSearch:p,onSearchChange:m,searchValue:v,searchPlaceholder:$="Søk",representing:b,serviceLink:k,serviceClick:x,serviceName:T,user:S,userMenu:A,userMenuFooter:I,userOptions:O,canChangeRepresentation:R=!1,changeRepresentation:et,hideLogo:Ot=!1,logoLink:Nt,logoClick:it,position:kt="fixed",scrollBehavior:qt="hide"},Et)=>{const dt=kt==="fixed",ae=qt==="hide";_.useEffect(()=>{I&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[I]),_.useEffect(()=>{O&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[O]),_.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.'),b!=null&&b.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,b==null?void 0:b.shortname]);const fe=_.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]),[V,xt]=_.useState(h||"none"),[Gt,$e]=_.useState(!1),[ge,re]=_.useState(0),[Ft,ut]=_.useState(!1),[_e,we]=_.useState(!1),Zt=_.useRef(null),Ss=_.useRef(null),Ie=_.useRef(null),es=_.useRef(null),ss=_.useRef(null),xe=_.useRef(null),Xt=_.useRef(null),Se=_.useRef(!1),is=Pc(Zt),Mt=is<s,yt=is<t,Cs=_.useCallback(j=>{Zt.current=j,typeof Et=="function"?Et(j):Et&&(Et.current=j)},[Et]);Dc(dt&&Mt&&V!=="none");const Le=_.useCallback((j,Pt)=>{const f=j.relatedTarget;let u;switch(Pt){case"user":u=Ss;break;case"slot":u=Ie;break;case"search":u=es;break;default:return}const g=u.current;g&&(!f||!g.contains(f))&&xt("none")},[]),si=_.useCallback(()=>{Se.current&&Xt.current&&document.contains(Xt.current)&&Xt.current.focus(),Xt.current=null,Se.current=!1},[]);_.useEffect(()=>{const j=f=>{S&&V==="user"&&!f.target.closest(".pkt-header-service__user-container")&&xt("none"),V==="slot"&&!f.target.closest(".pkt-header-service__slot-container")&&xt("none"),V==="search"&&!f.target.closest(".pkt-header-service__search-container")&&!f.target.closest(".pkt-header-service__search-input")&&xt("none")},Pt=f=>{f.key==="Escape"&&V!=="none"&&(f.preventDefault(),Se.current=!0,xt("none"))};if(V!=="none")return document.addEventListener("mousedown",j),document.addEventListener("keydown",Pt),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",Pt)};si()},[V,S,si]),_.useEffect(()=>{const j=()=>{if(ae){const Pt=window.pageYOffset||document.documentElement.scrollTop;if(Pt<0||Math.abs(Pt-ge)<60)return;$e(Pt>ge),re(Pt)}};return document&&window.addEventListener("scroll",j),()=>{document&&window.removeEventListener("scroll",j)}},[ae,ge]);const Pi=_.useCallback(j=>{const Pt=j==="slot"?Ie:es,f=j==="slot"?ss:xe;if(!Pt.current||!f.current||!yt||Mt)return;const u=Pt.current.getBoundingClientRect(),g=f.current.offsetWidth,w=u.left+g>window.innerWidth;j==="slot"?ut(w):we(w)},[yt,Mt]),Ts=_.useCallback(j=>{V!=="none"?xt("none"):(Xt.current=document.activeElement,xt(j))},[V]);_.useEffect(()=>{(V==="slot"||V==="search")&&requestAnimationFrame(()=>{Pi(V)})},[V,Pi]);const ii=l.jsxs("header",{className:Z("pkt-header-service",i&&"pkt-header-service--compact",Mt&&"pkt-header-service--mobile",yt&&"pkt-header-service--tablet",dt&&"pkt-header-service--fixed",ae&&"pkt-header-service--scroll-to-hide",Gt&&"pkt-header-service--hidden"),"data-mode":n,ref:Cs,children:[l.jsxs("div",{className:Z("pkt-header-service__logo-area",(!T||T==="")&&"pkt-header-service__logo-area--without-service"),children:[!Ot&&l.jsx("span",{className:"pkt-header-service__logo",children:Nt?l.jsx("a",{href:Nt,"aria-label":"Tilbake til forside",children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.2/logos/"})}):it?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:it,children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.2/logos/"})}):l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.2/logos/"})}),T&&l.jsx("span",{className:"pkt-header-service__service-name",children:k?l.jsx(Ai,{href:k,className:"pkt-header-service__service-link ",children:T}):x?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:x,children:T}):l.jsx("span",{className:"pkt-header-service__service-link",children:T})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:Z("pkt-header-service__slot-container",V==="slot"&&"is-open"),onBlur:j=>Le(j,"slot"),ref:Ie,children:[yt&&e&&l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"menu",size:Mt?"small":"medium",state:V==="slot"?"active":"normal",onClick:()=>Ts("slot"),"aria-expanded":V==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:"Meny"}),l.jsx("div",{className:Z("pkt-header-service__slot-content",Ft&&"align-right"),id:"mobile-slot-menu",role:yt?"menu":void 0,"aria-label":yt?"Meny":void 0,ref:ss,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),c&&l.jsx(l.Fragment,{children:yt?l.jsxs("div",{className:Z("pkt-header-service__search-container",V==="search"&&"is-open"),onBlur:j=>Le(j,"search"),ref:es,children:[l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:Mt?"small":"medium",onClick:()=>Ts("search"),state:V==="search"?"active":"normal","aria-expanded":V==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:Z("pkt-header-service__mobile-menu",V==="search"&&"is-open",_e&&"align-right"),ref:xe,children:V==="search"&&l.jsx(rn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:v,autoFocus:!0,fullwidth:!0,onChange:j=>m==null?void 0:m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(p==null||p(j.target.value))}})})]}):l.jsx(rn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:v,onChange:j=>m==null?void 0:m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(p==null||p(j.target.value))}})}),yt&&r&&(a==="header"||a==="both")&&l.jsx(pe,{skin:"secondary",size:Mt?"small":"medium",variant:"icon-only",iconName:"exit",onClick:r,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:j=>Le(j,"user"),ref:Ss,children:[l.jsxs(pe,{className:Z("pkt-header-service__user-button",Mt&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:Mt?"small":"medium",state:V==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:V==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Ts("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),V==="user"&&S&&l.jsx("div",{className:Z(Mt?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(Oc,{user:S,formattedLastLoggedIn:fe,representing:b,userMenu:A,canChangeRepresentation:R,changeRepresentation:et,logoutOnClick:a==="userMenu"||a==="both"?r:void 0})})]}),!Mt&&r&&(a==="header"||a==="both")&&l.jsx(pe,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:r,children:"Logg ut"})]})]});return dt?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[ii,l.jsx("div",{className:Z("pkt-header-service-spacer",i&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",Mt&&"pkt-header-service-spacer--mobile",yt&&"pkt-header-service-spacer--tablet")})]}):ii}),Da=_.forwardRef((s,t)=>l.jsx(Pa,{...s,ref:t}));Da.displayName="PktHeader";const Ic=Jt({tagName:"pkt-heading",elementClass:Ae,react:_,displayName:"PktHeading"}),Ia=_.forwardRef(({children:s,...t},e)=>l.jsx(Ic,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Ia.displayName="PktHeading";const Lc=Jt({tagName:"pkt-helptext",elementClass:ve,react:_,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),La=_.forwardRef(({children:s,...t},e)=>l.jsx(Lc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));La.displayName="PktHelptext";const Ba=_.forwardRef(({label:s,id:t,children:e,...i},n)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:t,...i,ref:n}),e]}));Ba.displayName="PktInput";const Fa=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...c})=>{const p=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...c,href:i,className:Z(p,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(q,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:Z(m),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};Fa.displayName="PktLinkCard";const Bc=Jt({tagName:"pkt-loader",elementClass:ie,react:_,displayName:"PktLoader",events:{}}),ja=_.forwardRef(({children:s,...t},e)=>l.jsx(Bc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));ja.displayName="PktLoader";const Ha=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[c,p]=_.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":c},v=_.createRef(),$=_.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:Z(m,t),ref:v,children:[a&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:$,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(q,{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})]})};Ha.displayName="PktMessagebox";const Fc=Jt({tagName:"pkt-modal",elementClass:Ut,react:_,displayName:"PktModal",events:{}}),Va=_.forwardRef(({children:s,...t},e)=>l.jsx(Fc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Va.displayName="PktModal";const jc=Jt({tagName:"pkt-progressbar",elementClass:ct,react:_,displayName:"PktProgressbar",events:{}}),Ua=_.forwardRef(({children:s,...t},e)=>l.jsx(jc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ua.displayName="PktProgressbar";const za=_.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:c,checked:p,optionalTag:m,optionalText:v,requiredTag:$,requiredText:b,tagText:k,...x},T)=>{const S=[i,"pkt-input-check"].filter(Boolean).join(" "),A=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),I=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),O=["pkt-input-check__input-label",a?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),R=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),et=()=>l.jsxs(l.Fragment,{children:[k&&l.jsx("span",{className:R+" pkt-tag--gray",children:k}),m&&l.jsx("span",{className:R+" pkt-tag--blue-light",children:v}),$&&l.jsx("span",{className:R+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:S,children:l.jsxs("div",{className:A,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:I,...p!==void 0?{checked:p}:{defaultChecked:c},...x}),l.jsxs("label",{className:O,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});za.displayName="PktRadioButton";const Hc=_.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:n,name:a,placeholder:r="Søk…",suggestions:h,value:c="",action:p,method:m,onChange:v,onSearch:$,onSuggestionClick:b,...k},x)=>{const T=(O,R)=>{O?O():b&&b(R)},S=O=>{c=O.target.value},A=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let I;return p?I=O=>l.jsx("form",{role:"search",className:A,action:p,method:m,children:O}):I=O=>l.jsx("div",{role:"search",className:A,children:O}),I(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 ${e?"pkt-input--fullwidth":""}`,type:"search",name:a||i,id:i,placeholder:r,defaultValue:c,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${i}-suggestions`,onChange:v||S,onKeyUp:$&&(O=>{O.key==="Enter"&&(O.preventDefault(),$(c))}),...k}),l.jsx(pe,{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:t,onClick:$&&(O=>{O.preventDefault(),$(c)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((O,R)=>l.jsx("li",{children:_.createElement(O.href?"a":O.onClick?"button":"div",{href:O.href,className:`pkt-searchinput__suggestion ${O.onClick?"pkt-link-button":""} ${O.href||O.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:O.onClick?"button":void 0,onClick:()=>T(O.onClick,R),onKeyUp:et=>et.key==="Enter"&&T(O.onClick,R)},l.jsxs(l.Fragment,{children:[O.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:O.title}),O.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:O.text})]}))},`search-suggestion-${R}`))})]}))}),Vc=_.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:c,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:$=!1,label:b,name:k,optionalTag:x=!1,optionalText:T,requiredTag:S=!1,requiredText:A,tagText:I,...O},R)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(ti,{className:et,forId:`${m}-input`,label:b,helptext:h,helptextDropdown:c,helptextDropdownButton:p,optionalTag:x,optionalText:T,requiredTag:S,requiredText:A,tagText:I,hasError:r,errorMessage:a,disabled:n,inline:v,ariaDescribedby:s,children:l.jsx("select",{ref:R,className:`pkt-input ${$?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${m}-input`,name:k||m,...O,children:e})})}),Uc=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)"}})}),zc=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"})]}),qc=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"})]}),Wc=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:Z("pkt-step",t,`pkt-step--${e}`),"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:Z("pkt-step__indicator"),children:e==="current"?zc:e==="completed"?qc:Uc}),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})]})]}),Rc=_.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const c=Z(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=_.Children.map(e,(m,v)=>_.isValidElement(m)?_.cloneElement(m,{className:Z(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return l.jsx("ol",{"data-testid":"pkt-stepper",className:c,ref:h,...r,children:p})}),Kc=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:n,...a})=>l.jsx("table",{"data-testid":"pkt-table",className:Z(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...a,children:n}),Yc=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:Z(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Gc=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:Z(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Zc=({className:s,children:t,...e})=>l.jsx("thead",{className:Z(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),Xc=({className:s,children:t,...e})=>l.jsx("th",{className:Z(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),Jc=({className:s,children:t,...e})=>l.jsx("tr",{className:Z(s,"pkt-table__row",{}),role:"row",...e,children:t}),on=_.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:c,type:p,"aria-description":m,...v},$)=>{const[b,k]=_.useState(!1),x=_.useCallback(()=>{k(!0),c&&c()},[k]),T=_.useRef(null),[S,A]=_.useState("");_.useEffect(()=>{var et,Ot;A(((Ot=(et=T.current)==null?void 0:et.textContent)==null?void 0:Ot.trim())??"")},[s]);const I=_.useMemo(()=>{if(n&&!h)return S&&`Klikk for å fjerne ${S}`||m},[n,h,S,m]),O={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},R={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,"pkt-btn--icons-right-and-left":n&&!!r,"pkt-hide":b};return n?l.jsxs("button",{...v,className:Z(R,a),type:p,onClick:x,"aria-label":h,"aria-description":I,ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(q,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...v,className:Z(O,a),ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});on.displayName="PktTag";const ln=_.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:c=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:$,selectTab:b}=Qc(),x={"aria-selected":m?!!t:void 0,"aria-controls":a,role:m?"tab":void 0,onKeyUp:S=>$(c,S),onClick:S=>{b(c),i==null||i(S)},tabIndex:t||!m?void 0:-1,ref:S=>{v(c,S),typeof p=="function"?p(S):p&&(p.current=S)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(q,{name:n,className:"pkt-icon--small"}),s,r&&l.jsx(on,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...x,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:T}):l.jsx("button",{...x,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:T})});ln.displayName="PktTabItem";const qa=_.createContext(null),Qc=()=>{const s=_.useContext(qa);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},td=_.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=_.useRef([]),h=s&&!t,p=n&&_.Children.count(n)>0?_.Children.count(n):(e==null?void 0:e.length)||0;_.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=k=>{const x=e==null?void 0:e[k];x!=null&&x.action&&x.action(k),i&&i(k)},v=(k,x)=>{var T,S;h&&(x.code==="ArrowLeft"&&k!==0&&((T=r.current[k-1])==null||T.focus()),x.code==="ArrowRight"&&k<p-1&&((S=r.current[k+1])==null||S.focus()),(x.code==="ArrowDown"||x.code==="Space")&&m(k))},$=(k,x)=>{r.current[k]=x},b=e==null?void 0:e.map((k,x)=>{var T,S;return l.jsx(ln,{active:k.active,href:k.href,onClick:()=>m(x),icon:k.icon,controls:k.controls,tag:(T=k.tag)==null?void 0:T.text,tagSkin:(S=k.tag)==null?void 0:S.skin,index:x,children:k.text},x)});return l.jsx(qa.Provider,{value:{arrowNav:h,registerTabRef:$,handleKeyPress:v,selectTab:m},children:l.jsx("div",{className:"pkt-tabs",ref:a,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:n||b})})})}),ed=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:c,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:$,fullwidth:b=!1,label:k,name:x,optionalTag:T=!1,optionalText:S,requiredTag:A=!1,requiredText:I,tagText:O=null,placeholder:R,rows:et,useWrapper:Ot=!0,onChange:Nt,value:it,autoComplete:kt="off",minLength:qt,maxLength:Et,readOnly:dt=!1,skipForwardTestid:ae=!1,...fe},V)=>{const xt=[a,"pkt-textinput","pkt-textarea"].join(" "),Gt=`${s}-input`,$e=`${Gt}-label`,ge=e||$e,[re,Ft]=_.useState(0),ut=_e=>{var we,Zt;if(i&&Ft(((Zt=(we=_e.currentTarget)==null?void 0:we.value)==null?void 0:Zt.length)||0),Nt)return Nt(_e)};return _.useEffect(()=>{it!==void 0&&Ft((it==null?void 0:it.length)||0)},[it]),l.jsx(ti,{ariaDescribedby:t,className:xt,disabled:r,errorMessage:h,forId:Gt,hasError:c,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:$,label:k,optionalTag:T,optionalText:S,requiredTag:A,requiredText:I,tagText:O,useWrapper:Ot,counter:i,counterCurrent:re,counterMaxLength:n,children:l.jsx("textarea",{ref:V,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${n&&re>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:Gt,placeholder:R,disabled:r,rows:et,"aria-labelledby":ge,"aria-invalid":c,"aria-errormessage":`${s}-error`,...fe,onChange:ut,value:it,autoComplete:kt,minLength:qt,maxLength:Et,"data-skip-forward-testid":ae?"true":void 0})})});var ws=window.CustomEvent;(!ws||typeof ws=="object")&&(ws=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ws.prototype=window.Event.prototype);function Wa(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function sd(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,n){return!(t[i]===void 0||t[i]===n)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function ei(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 Ra(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function id(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function hn(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Ka(s){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(e.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),a=0;a<n.length&&!(n[a].tagName&&n[a].shadowRoot&&(i=Ka(n[a].shadowRoot),i));a++);return i}function Ya(s){return s.isConnected||document.body.contains(s)}function Ga(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=W.formSubmitter;if(!e){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;e=n.activeElement}return!e||e.form!==t?null:e}function nd(s){if(!s.defaultPrevented){var t=s.target,e=W.imagemapUseValue,i=Ga(s);e===null&&i&&(e=i.value);var n=ei(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function Za(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",nd,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,i=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),n,a=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,a)})}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))}Za.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Ya(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_),W.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 t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var e=document.createEvent("MouseEvents");e.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(e),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=Ka(this.dialog_)),Ra(document.activeElement),s&&s.focus()},updateZIndex:function(s,t){if(s<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=t},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(!Ya(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!W.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");sd(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,W.needsCentering(this.dialog_)?(W.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 t=new ws("close",{bubbles:!1,cancelable:!1});Wa(this.dialog_,t)}};var W={};if(W.reposition=function(s){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(t,e)+"px"},W.isInlinePositionSetByStylesheet=function(s){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],i=null;try{i=e.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var a=i[n],r=null;try{r=document.querySelectorAll(a.selectorText)}catch{}if(!(!r||!id(r,s))){var h=a.style.getPropertyValue("top"),c=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||c&&c!=="auto")return!0}}}return!1},W.needsCentering=function(s){var t=window.getComputedStyle(s);return t.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!W.isInlinePositionSetByStylesheet(s)},W.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 Za(s)},W.registerDialog=function(s){s.showModal||W.forceRegisterDialog(s)},W.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(t){this.forwardTab_=void 0,t.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(t){var e=[];t.forEach(function(i){for(var n=0,a;a=i.removedNodes[n];++n){if(a instanceof Element)a.localName==="dialog"&&e.push(a);else continue;e=e.concat(a.querySelectorAll("dialog"))}}),e.length&&s(e)}))},W.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})},W.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},W.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--s,--s),t===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)},W.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=ei(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},W.DialogManager.prototype.handleFocus_=function(s){var t=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),Ra(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,n=i.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},W.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new ws("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&Wa(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},W.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},W.DialogManager.prototype.pushDialog=function(s){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},W.DialogManager.prototype.removeDialog=function(s){var t=this.pendingDialogStack.indexOf(s);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},W.dm=new W.DialogManager,W.formSubmitter=null,W.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Xa=document.createElement("form");if(Xa.setAttribute("method","dialog"),Xa.method!=="dialog"){var xs=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(xs){var ad=xs.get;xs.get=function(){return hn(this)?"dialog":ad.call(this)};var rd=xs.set;xs.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):rd.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",xs)}}document.addEventListener("click",function(s){if(W.formSubmitter=null,W.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!hn(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;W.imagemapUseValue=s.offsetX+","+s.offsetY}var n=ei(t);n&&(W.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=ei(t);if(!e){var i=Ga(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var od=HTMLFormElement.prototype.submit,ld=function(){if(!hn(this))return od.call(this);var s=ei(this);s&&s.close()};HTMLFormElement.prototype.submit=ld}const hd=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=pn,P.PktAccordionItem=Ca,P.PktAlert=an,P.PktBackLink=Na,P.PktBreadcrumbs=xc,P.PktButton=pe,P.PktCard=Ea,P.PktCheckbox=Ma,P.PktCombobox=Aa,P.PktConsent=Mi,P.PktDatepicker=Oa,P.PktFooter=Nc,P.PktFooterSimple=Ec,P.PktHeader=Da,P.PktHeaderService=Pa,P.PktHeading=Ia,P.PktHelptext=La,P.PktIcon=q,P.PktInput=Ba,P.PktInputWrapper=ti,P.PktLink=Ai,P.PktLinkCard=Fa,P.PktLoader=ja,P.PktMessagebox=Ha,P.PktModal=Va,P.PktProgressbar=Ua,P.PktRadioButton=za,P.PktSearchInput=Hc,P.PktSelect=Vc,P.PktStep=Wc,P.PktStepper=Rc,P.PktTabItem=ln,P.PktTable=Kc,P.PktTableBody=Yc,P.PktTableDataCell=Gc,P.PktTableHeader=Zc,P.PktTableHeaderCell=Xc,P.PktTableRow=Jc,P.PktTabs=td,P.PktTag=on,P.PktTextarea=ed,P.PktTextinput=rn,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
1717
|
+
*/var Ta;function _c(){return Ta||(Ta=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var a="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(a=n(a,i(h)))}return a}function i(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return e.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var r="";for(var h in a)t.call(a,h)&&a[h]&&(r=n(r,h));return r}function n(a,r){return r?a?a+" "+r:a+r:a}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(sn)),sn.exports}var wc=_c();const Z=$c(wc),nn=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:c="info",className:p,...v})=>{const[m,y]=w.useState(!1),$={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${c}`]:c,"pkt-hide":m},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=w.useCallback(()=>{y(!0),v.onClose&&v.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[v.onClose,y]),T=a||r;return l.jsx("div",{...v,"aria-live":T,role:h,className:Z($,p),children:l.jsxs("div",{className:Z(b),children:[l.jsx(U,{className:"pkt-alert__icon","aria-hidden":"true",name:c==="info"?"alert-information":`alert-${c}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(pe,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:x,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]})]})})};nn.displayName="PktAlert";const Na=Jt({tagName:"pkt-backlink",elementClass:hs,react:w,displayName:"PktBackLink"});Na.displayName="PktBackLink";const xc=w.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},n)=>{const a=s,r=a[a.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:n,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((c,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===a.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})}):t==="router"?l.jsxs(dn.Link,{to:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(U,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]}):l.jsxs("a",{href:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(U,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(dn.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(U,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(U,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.3/animations/";const pe=w.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",iconPath:n,secondIconPath:a,size:r="medium",fullWidth:h=!1,fullWidthOnMobile:c=!1,skin:p="primary",type:v="button",variant:m="label-only",state:y,color:$,isLoading:b=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...O},S)=>{const B=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",c&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,m&&`pkt-btn--${m}`,$&&`pkt-btn--${$}`,y&&`pkt-btn--${y}`,b&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...O,"aria-busy":b||void 0,"aria-disabled":x||void 0,disabled:x,className:B,type:v,ref:S,children:[b&&l.jsx(U,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),m!=="label-only"&&l.jsx(U,{className:"pkt-btn__icon",name:e,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),m==="icons-right-and-left"&&l.jsx(U,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});pe.displayName="PktButton";const Sc=Jt({tagName:"pkt-card",elementClass:ut,react:w,displayName:"PktCard",events:{}}),Ea=w.forwardRef(({children:s,...t},e)=>l.jsx(Sc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ea.displayName="PktCard";const Ma=w.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:n,hasError:a=!1,className:r,isSwitch:h=!1,hideLabel:c=!1,labelPosition:p="right",defaultChecked:v,checked:m,indeterminate:y,optionalTag:$,optionalText:b="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:O,...S},B)=>{const A=w.useRef(null);w.useEffect(()=>{A.current&&y!==void 0&&(A.current.indeterminate=y)},[y]),w.useEffect(()=>{typeof B=="function"?B(A.current):B&&(B.current=A.current)},[B]);const R=[r,"pkt-input-check"].filter(Boolean).join(" "),et=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,c?"pkt-sr-only":""].filter(Boolean).join(" "),Tt=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Nt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),nt=()=>l.jsxs(l.Fragment,{children:[O&&l.jsx("span",{className:Nt+" pkt-tag--gray",children:O}),$&&l.jsx("span",{className:Nt+" pkt-tag--blue-light",children:b}),x&&l.jsx("span",{className:Nt+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:R,children:l.jsxs("div",{className:Tt,children:[p==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",nt(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:A,className:`pkt-input-check__input-checkbox ${a?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...m!==void 0?{checked:m}:{defaultChecked:v},...S}),p==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",nt(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Ma.displayName="PktCheckbox";const Cc=Jt({tagName:"pkt-combobox",elementClass:at,react:w,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Aa=w.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Cc,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));Aa.displayName="PktCombobox";const Mi=Jt({tagName:"pkt-consent",elementClass:Rt,react:w,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Mi.displayName="PktConsent";const Tc=Jt({tagName:"pkt-datepicker",elementClass:ht,react:w,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Oa=w.forwardRef(({helptext:s,...t},e)=>l.jsx(Tc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));Oa.displayName="PktDatepicker";const Nc=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:a="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:c=null,googleAnalyticsId:p=null,devMode:v=!1,cookieDomain:m=null,cookieSecure:y=null,cookieExpiryDays:$=null,onToggleConsent:b=x=>{console.log(x.detail)}})=>{var T,O;const x=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:x,"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}),(T=s.links)==null?void 0:T.map((S,B)=>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(U,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${B}`))]})]}),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:t.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&l.jsx("li",{className:"pkt-footer__text",children:t.text}),(O=t.links)==null?void 0:O.map((S,B)=>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(U,{className:"pkt-footer__link-icon",name:"chevron-right"}),S.text]})},`links-${B}`))]})]}),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:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(U,{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:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(U,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:c,googleAnalyticsId:p,devMode:v,cookieDomain:m,cookieSecure:y,cookieExpiryDays:$,onToggleConsent:b})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(S=>S.language).map((S,B)=>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-${B}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(S=>S.iconName).map((S,B)=>l.jsx(w.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(U,{className:"pkt-footer__social-icon",name:S.iconName})})},`sociallinks-${B}`))})]})]})})},Ec=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:a=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:c=null,cookieSecure:p=null,cookieExpiryDays:v=null,onToggleConsent:m=$=>{console.log($.detail)},className:y})=>{const $=[y,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:$,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((b,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${b.external?" pkt-link--external":""}`,href:b.href,target:b.openInNewTab||t?"_blank":"_self",rel:b.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(U,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),b.text]})},x)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:e,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(U,{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:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(U,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:c,cookieSecure:p,cookieExpiryDays:v,onToggleConsent:m})})]})})})},Ai=({href:s,iconName:t,className:e,iconPosition:i,external:n,target:a,children:r,...h})=>{const c={"pkt-link":!0,"pkt-link--icon-left":!!t&&i==="left"||!!(t&&!i),"pkt-link--icon-right":!!t&&i==="right","pkt-link--external":n};return l.jsxs("a",{...h,className:Z(c,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(U,{name:t,className:"pkt-link__icon"}),r]})};Ai.displayName="PktLink";const Mc=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Oi=({item:s,className:t})=>"href"in s?l.jsx(Ai,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:Z("pkt-user-menu__link",t),children:s.title}):l.jsxs("button",{className:Z("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",t),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(U,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),Ac=({links:s})=>l.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((t,e)=>l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:t})},e))}),Oc=w.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const c=i==null?void 0:i.map(Mc);return l.jsx("nav",{className:"pkt-user-menu",ref:h,"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}),t&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:t})]})]}),c&&c.length>0&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Ac,{links:c})}),e&&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:e.name}),e.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",e.orgNumber]}),n&&a&&l.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})]}),!e&&n&&a&&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(Oi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})}),r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Oi,{item:{title:"Logg ut",iconName:"exit",onClick:r}})})]})})}),ti=w.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:c=!1,optionalText:p="Valgfritt",requiredTag:v=!1,requiredText:m="Må fylles ut",tagText:y=null,hasError:$=!1,errorMessage:b,disabled:x=!1,inline:T=!1,ariaDescribedby:O,useWrapper:S=!0,children:B,className:A="",hasFieldset:R=!1,role:et="group",counterPosition:Tt="bottom"},Nt)=>{const[nt,gt]=w.useState(!1),Ut=O||(e?`${s}-helptext`:void 0),Yt=!!a,mt=Yt&&Tt==="top",$e=Yt&&Tt==="bottom",Pt=()=>gt(rt=>!rt),Dt=["pkt-inputwrapper",A,$?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),zt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Gt=()=>Yt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,q=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:zt+" pkt-tag--gray",children:y}),c&&l.jsx("span",{className:zt+" pkt-tag--blue-light",children:p}),v&&l.jsx("span",{className:zt+" pkt-tag--beige",children:m})]}),It=()=>{const rt=l.jsxs(l.Fragment,{children:[t," ",q()]});return S?R?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:rt}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Ut,id:`${s}-label`,children:rt}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Ut,id:`${s}-label`,children:t})},ae=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&S&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(pe,{skin:"tertiary",size:"small",variant:"icon-right",iconName:nt?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Pt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${nt?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Lt=l.jsxs(l.Fragment,{children:[It(),ae(),mt&&l.jsx(Gt,{}),B,$e&&l.jsx(Gt,{}),$&&b&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(nn,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:b})})]});return l.jsx("div",{className:Dt,ref:Nt,role:et,children:R?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Ut,children:Lt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Lt})})});ti.displayName="PktInputWrapper";const an=w.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:c,hasError:p=!1,helptext:v,helptextDropdown:m,helptextDropdownButton:y,iconNameRight:$,inline:b=!1,fullwidth:x=!1,label:T,name:O,optionalTag:S=!1,optionalText:B,requiredTag:A=!1,requiredText:R,tagText:et=null,placeholder:Tt,prefix:Nt,suffix:nt,type:gt="text",useWrapper:Ut=!0,omitSearchIcon:Yt=!1,value:mt,minLength:$e,maxLength:Pt,min:Dt,max:zt,step:Gt,size:q,readonly:It,required:ae,dataTestid:Lt,onChange:rt,skipForwardTestid:_e=!1,...we},re)=>{const si=[r,"pkt-textinput"].join(" "),ws=gt==="search"&&!$&&!Yt,xs=gt==="date"&&mt?mt.slice(0,10):mt,[Qe,fe]=w.useState((mt==null?void 0:mt.length)||0),ge=`${s}`,De=`${ge}-label`,ts=e||De,xe=Zt=>{var es,_t;n&&fe(((_t=(es=Zt.currentTarget)==null?void 0:es.value)==null?void 0:_t.length)||0),rt&&rt(Zt)};return w.useEffect(()=>{mt!==void 0&&fe((mt==null?void 0:mt.length)||0)},[mt]),l.jsx(ti,{ariaDescribedby:t,className:si,disabled:h,errorMessage:c,forId:ge,hasError:p,helptext:v,helptextDropdown:m,helptextDropdownButton:y,inline:b,label:T,optionalTag:S,optionalText:B,requiredTag:A,requiredText:R,tagText:et,useWrapper:Ut,counter:n,counterCurrent:Qe,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Lt,"data-skip-forward-testid":_e?"true":void 0,children:[Nt&&l.jsx("div",{className:"pkt-input-prefix",children:Nt}),l.jsx("input",{...we,ref:re,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&Qe>a?"pkt-input--counter-error":""}`,type:gt,name:`${O||s}`,value:xs,id:ge,placeholder:Tt,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":ts,min:Dt,max:zt,onChange:xe,step:Gt,minLength:$e,maxLength:Pt,size:q,required:ae}),nt&&l.jsxs("p",{className:"pkt-input-suffix",children:[nt,$&&l.jsx(U,{className:"pkt-input-suffix-icon",name:$}),ws&&l.jsx(U,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!nt&&$&&l.jsx(U,{className:"pkt-input-icon",name:$}),!nt&&ws&&l.jsx(U,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})}),Pc=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=w.useState(e);return w.useEffect(()=>{const a=s.current;if(!a)return;if(n(a.offsetWidth),typeof ResizeObserver>"u"){const h=()=>{a&&n(a.offsetWidth)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)}const r=new ResizeObserver(h=>{for(const c of h)c.borderBoxSize&&c.borderBoxSize.length>0?n(c.borderBoxSize[0].inlineSize):n(c.contentRect.width)});return r.observe(a),()=>{r.disconnect()}},[s]),i};function Dc(s){const t=w.useRef(0);w.useEffect(()=>{const e=document.body,i=document.documentElement;if(s){t.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(e.style.paddingRight=`${n}px`),e.style.position="fixed",e.style.top=`-${t.current}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",i.classList.add("is-scroll-locked")}else 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"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current});return()=>{s&&(e.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current}))}},[s])}const Pa=w.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,className:i,compact:n=!1,"data-mode":a,logOutButtonPlacement:r="none",logOut:h,openedMenu:c,showSearch:p=!1,onSearch:v,onSearchChange:m,searchValue:y,searchPlaceholder:$="Søk",representing:b,serviceLink:x,serviceClick:T,serviceName:O,user:S,userMenu:B,userMenuFooter:A,userOptions:R,canChangeRepresentation:et=!1,changeRepresentation:Tt,hideLogo:Nt=!1,logoLink:nt,logoClick:gt,position:Ut="fixed",scrollBehavior:Yt="hide",slotMenuVariant:mt="icon-only",slotMenuText:$e="Meny"},Pt)=>{const Dt=Ut==="fixed",zt=Yt==="hide";w.useEffect(()=>{A&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[A]),w.useEffect(()=>{R&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[R]),w.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.'),b!=null&&b.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,b==null?void 0:b.shortname]);const Gt=w.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]),[q,It]=w.useState(c||"none"),[ae,Lt]=w.useState(!1),[rt,_e]=w.useState(0),[we,re]=w.useState(!1),[si,ws]=w.useState(!1),xs=w.useRef(null),Qe=w.useRef(null),fe=w.useRef(null),ge=w.useRef(null),De=w.useRef(null),ts=w.useRef(null),xe=w.useRef(null),Zt=w.useRef(!1),es=Pc(xs),_t=es<s,Xt=es<t,hn=w.useCallback(d=>{xs.current=d,typeof Pt=="function"?Pt(d):Pt&&(Pt.current=d)},[Pt]);Dc(Dt&&_t&&q!=="none");const Ss=w.useCallback((d,f)=>{const _=d.relatedTarget;let D;switch(f){case"user":D=Qe;break;case"slot":D=fe;break;case"search":D=ge;break;default:return}const F=D.current;F&&(!_||!F.contains(_))&&It("none")},[]),ii=w.useCallback(()=>{Zt.current&&xe.current&&document.contains(xe.current)&&xe.current.focus(),xe.current=null,Zt.current=!1},[]);w.useEffect(()=>{const d=_=>{S&&q==="user"&&!_.target.closest(".pkt-header-service__user-container")&&It("none"),q==="slot"&&!_.target.closest(".pkt-header-service__slot-container")&&It("none"),q==="search"&&!_.target.closest(".pkt-header-service__search-container")&&!_.target.closest(".pkt-header-service__search-input")&&It("none")},f=_=>{_.key==="Escape"&&q!=="none"&&(_.preventDefault(),Zt.current=!0,It("none"))};if(q!=="none")return document.addEventListener("mousedown",d),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",f)};ii()},[q,S,ii]),w.useEffect(()=>{const d=()=>{if(zt){const f=window.pageYOffset||document.documentElement.scrollTop;if(f<0||Math.abs(f-rt)<60)return;Lt(f>rt),_e(f)}};return document&&window.addEventListener("scroll",d),()=>{document&&window.removeEventListener("scroll",d)}},[zt,rt]);const Cs=w.useCallback(d=>{const f=d==="slot"?fe:ge,_=d==="slot"?De:ts;if(!f.current||!_.current||!Xt||_t)return;const D=f.current.getBoundingClientRect(),F=_.current.offsetWidth,j=D.left+F>window.innerWidth;d==="slot"?re(j):ws(j)},[Xt,_t]),Ts=w.useCallback(d=>{q!=="none"?It("none"):(xe.current=document.activeElement,It(d))},[q]);w.useEffect(()=>{(q==="slot"||q==="search")&&requestAnimationFrame(()=>{Cs(q)})},[q,Cs]);const g=l.jsxs("header",{className:Z("pkt-header-service",n&&"pkt-header-service--compact",_t&&"pkt-header-service--mobile",Xt&&"pkt-header-service--tablet",Dt&&"pkt-header-service--fixed",zt&&"pkt-header-service--scroll-to-hide",ae&&"pkt-header-service--hidden",i),"data-mode":a,ref:hn,children:[l.jsxs("div",{className:Z("pkt-header-service__logo-area",(!O||O==="")&&"pkt-header-service__logo-area--without-service"),children:[!Nt&&l.jsx("span",{className:"pkt-header-service__logo",children:nt?l.jsx("a",{href:nt,"aria-label":"Tilbake til forside",children:l.jsx(U,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.3/logos/"})}):gt?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:gt,children:l.jsx(U,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.3/logos/"})}):l.jsx(U,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.3/logos/"})}),O&&l.jsx("span",{className:"pkt-header-service__service-name",children:x?l.jsx(Ai,{href:x,className:"pkt-header-service__service-link ",children:O}):T?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:T,children:O}):l.jsx("span",{className:"pkt-header-service__service-link",children:O})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:Z("pkt-header-service__slot-container",q==="slot"&&"is-open"),onBlur:d=>Ss(d,"slot"),ref:fe,children:[Xt&&e&&l.jsx(pe,{skin:"secondary",variant:mt,iconName:"menu",size:_t?"small":"medium",state:q==="slot"?"active":"normal",onClick:()=>Ts("slot"),"aria-expanded":q==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:$e}),l.jsx("div",{className:Z("pkt-header-service__slot-content",we&&"align-right"),id:"mobile-slot-menu",role:Xt?"menu":void 0,"aria-label":Xt?"Meny":void 0,ref:De,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),p&&l.jsx(l.Fragment,{children:Xt?l.jsxs("div",{className:Z("pkt-header-service__search-container",q==="search"&&"is-open"),onBlur:d=>Ss(d,"search"),ref:ge,children:[l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:_t?"small":"medium",onClick:()=>Ts("search"),state:q==="search"?"active":"normal","aria-expanded":q==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:Z("pkt-header-service__mobile-menu",q==="search"&&"is-open",si&&"align-right"),ref:ts,children:q==="search"&&l.jsx(an,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:y,autoFocus:!0,fullwidth:!0,onChange:d=>m==null?void 0:m(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(v==null||v(d.target.value))}})})]}):l.jsx(an,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:y,onChange:d=>m==null?void 0:m(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(v==null||v(d.target.value))}})}),Xt&&h&&(r==="header"||r==="both")&&l.jsx(pe,{skin:"secondary",size:_t?"small":"medium",variant:"icon-only",iconName:"exit",onClick:h,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:d=>Ss(d,"user"),ref:Qe,children:[l.jsxs(pe,{className:Z("pkt-header-service__user-button",_t&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:_t?"small":"medium",state:q==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:q==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Ts("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),q==="user"&&S&&l.jsx("div",{className:Z(_t?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(Oc,{user:S,formattedLastLoggedIn:Gt,representing:b,userMenu:B,canChangeRepresentation:et,changeRepresentation:Tt,logoutOnClick:r==="userMenu"||r==="both"?h:void 0})})]}),!_t&&h&&(r==="header"||r==="both")&&l.jsx(pe,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:h,children:"Logg ut"})]})]});return Dt?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[g,l.jsx("div",{className:Z("pkt-header-service-spacer",n&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",_t&&"pkt-header-service-spacer--mobile",Xt&&"pkt-header-service-spacer--tablet")})]}):g}),Da=w.forwardRef((s,t)=>l.jsx(Pa,{...s,ref:t}));Da.displayName="PktHeader";const Ic=Jt({tagName:"pkt-heading",elementClass:Me,react:w,displayName:"PktHeading"}),Ia=w.forwardRef(({children:s,...t},e)=>l.jsx(Ic,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Ia.displayName="PktHeading";const Lc=Jt({tagName:"pkt-helptext",elementClass:ve,react:w,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),La=w.forwardRef(({children:s,...t},e)=>l.jsx(Lc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));La.displayName="PktHelptext";const Ba=w.forwardRef(({label:s,id:t,children:e,...i},n)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:t,...i,ref:n}),e]}));Ba.displayName="PktInput";const Fa=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...c})=>{const p=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),v=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...c,href:i,className:Z(p,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(U,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:Z(v),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};Fa.displayName="PktLinkCard";const Bc=Jt({tagName:"pkt-loader",elementClass:ie,react:w,displayName:"PktLoader",events:{}}),Va=w.forwardRef(({children:s,...t},e)=>l.jsx(Bc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Va.displayName="PktLoader";const ja=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[c,p]=w.useState(!1),v={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":c},m=w.createRef(),y=w.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:Z(v,t),ref:m,children:[a&&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(U,{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})]})};ja.displayName="PktMessagebox";const Fc=Jt({tagName:"pkt-modal",elementClass:jt,react:w,displayName:"PktModal",events:{}}),Ha=w.forwardRef(({children:s,...t},e)=>l.jsx(Fc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ha.displayName="PktModal";const Vc=Jt({tagName:"pkt-progressbar",elementClass:ct,react:w,displayName:"PktProgressbar",events:{}}),Ua=w.forwardRef(({children:s,...t},e)=>l.jsx(Vc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ua.displayName="PktProgressbar";const za=w.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:c,checked:p,optionalTag:v,optionalText:m,requiredTag:y,requiredText:$,tagText:b,...x},T)=>{const O=[i,"pkt-input-check"].filter(Boolean).join(" "),S=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),B=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),A=["pkt-input-check__input-label",a?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),R=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),et=()=>l.jsxs(l.Fragment,{children:[b&&l.jsx("span",{className:R+" pkt-tag--gray",children:b}),v&&l.jsx("span",{className:R+" pkt-tag--blue-light",children:m}),y&&l.jsx("span",{className:R+" pkt-tag--beige",children:$})]});return l.jsx("div",{className:O,children:l.jsxs("div",{className:S,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:B,...p!==void 0?{checked:p}:{defaultChecked:c},...x}),l.jsxs("label",{className:A,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});za.displayName="PktRadioButton";const jc=w.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:n,name:a,placeholder:r="Søk…",suggestions:h,value:c="",action:p,method:v,onChange:m,onSearch:y,onSuggestionClick:$,...b},x)=>{const T=(A,R)=>{A?A():$&&$(R)},O=A=>{c=A.target.value},S=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let B;return p?B=A=>l.jsx("form",{role:"search",className:S,action:p,method:v,children:A}):B=A=>l.jsx("div",{role:"search",className:S,children:A}),B(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 ${e?"pkt-input--fullwidth":""}`,type:"search",name:a||i,id:i,placeholder:r,defaultValue:c,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${i}-suggestions`,onChange:m||O,onKeyUp:y&&(A=>{A.key==="Enter"&&(A.preventDefault(),y(c))}),...b}),l.jsx(pe,{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:t,onClick:y&&(A=>{A.preventDefault(),y(c)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((A,R)=>l.jsx("li",{children:w.createElement(A.href?"a":A.onClick?"button":"div",{href:A.href,className:`pkt-searchinput__suggestion ${A.onClick?"pkt-link-button":""} ${A.href||A.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:A.onClick?"button":void 0,onClick:()=>T(A.onClick,R),onKeyUp:et=>et.key==="Enter"&&T(A.onClick,R)},l.jsxs(l.Fragment,{children:[A.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:A.title}),A.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:A.text})]}))},`search-suggestion-${R}`))})]}))}),Hc=w.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:c,helptextDropdownButton:p,id:v,inline:m=!1,fullwidth:y=!1,label:$,name:b,optionalTag:x=!1,optionalText:T,requiredTag:O=!1,requiredText:S,tagText:B,...A},R)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(ti,{className:et,forId:`${v}-input`,label:$,helptext:h,helptextDropdown:c,helptextDropdownButton:p,optionalTag:x,optionalText:T,requiredTag:O,requiredText:S,tagText:B,hasError:r,errorMessage:a,disabled:n,inline:m,ariaDescribedby:s,children:l.jsx("select",{ref:R,className:`pkt-input ${y?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${v}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${v}-input`,name:b||v,...A,children:e})})}),Uc=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)"}})}),zc=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"})]}),qc=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"})]}),Wc=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:Z("pkt-step",t,`pkt-step--${e}`),"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:Z("pkt-step__indicator"),children:e==="current"?zc:e==="completed"?qc:Uc}),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})]})]}),Rc=w.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const c=Z(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=w.Children.map(e,(v,m)=>w.isValidElement(v)?w.cloneElement(v,{className:Z(v.props.className,{"pkt-step--hideStep":i&&m!==s,"pkt-step--hideContent":n&&m!==s})}):v);return l.jsx("ol",{"data-testid":"pkt-stepper",className:c,ref:h,...r,children:p})}),Kc=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:n,...a})=>l.jsx("table",{"data-testid":"pkt-table",className:Z(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...a,children:n}),Yc=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:Z(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Gc=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:Z(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Zc=({className:s,children:t,...e})=>l.jsx("thead",{className:Z(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),Xc=({className:s,children:t,...e})=>l.jsx("th",{className:Z(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),Jc=({className:s,children:t,...e})=>l.jsx("tr",{className:Z(s,"pkt-table__row",{}),role:"row",...e,children:t}),rn=w.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:c,type:p,"aria-description":v,...m},y)=>{const[$,b]=w.useState(!1),x=w.useCallback(()=>{b(!0),c&&c()},[b]),T=w.useRef(null),[O,S]=w.useState("");w.useEffect(()=>{var et,Tt;S(((Tt=(et=T.current)==null?void 0:et.textContent)==null?void 0:Tt.trim())??"")},[s]);const B=w.useMemo(()=>{if(n&&!h)return O&&`Klikk for å fjerne ${O}`||v},[n,h,O,v]),A={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},R={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,"pkt-btn--icons-right-and-left":n&&!!r,"pkt-hide":$};return n?l.jsxs("button",{...m,className:Z(R,a),type:p,onClick:x,"aria-label":h,"aria-description":B,ref:y,children:[r&&l.jsx(U,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(U,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...m,className:Z(A,a),ref:y,children:[r&&l.jsx(U,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});rn.displayName="PktTag";const on=w.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:c=0},p)=>{const{arrowNav:v,registerTabRef:m,handleKeyPress:y,selectTab:$}=Qc(),x={"aria-selected":v?!!t:void 0,"aria-controls":a,role:v?"tab":void 0,onKeyUp:O=>y(c,O),onClick:O=>{$(c),i==null||i(O)},tabIndex:t||!v?void 0:-1,ref:O=>{m(c,O),typeof p=="function"?p(O):p&&(p.current=O)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(U,{name:n,className:"pkt-icon--small"}),s,r&&l.jsx(rn,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...x,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:T}):l.jsx("button",{...x,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:T})});on.displayName="PktTabItem";const qa=w.createContext(null),Qc=()=>{const s=w.useContext(qa);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},td=w.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=w.useRef([]),h=s&&!t,p=n&&w.Children.count(n)>0?w.Children.count(n):(e==null?void 0:e.length)||0;w.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const v=b=>{const x=e==null?void 0:e[b];x!=null&&x.action&&x.action(b),i&&i(b)},m=(b,x)=>{var T,O;h&&(x.code==="ArrowLeft"&&b!==0&&((T=r.current[b-1])==null||T.focus()),x.code==="ArrowRight"&&b<p-1&&((O=r.current[b+1])==null||O.focus()),(x.code==="ArrowDown"||x.code==="Space")&&v(b))},y=(b,x)=>{r.current[b]=x},$=e==null?void 0:e.map((b,x)=>{var T,O;return l.jsx(on,{active:b.active,href:b.href,onClick:()=>v(x),icon:b.icon,controls:b.controls,tag:(T=b.tag)==null?void 0:T.text,tagSkin:(O=b.tag)==null?void 0:O.skin,index:x,children:b.text},x)});return l.jsx(qa.Provider,{value:{arrowNav:h,registerTabRef:y,handleKeyPress:m,selectTab:v},children:l.jsx("div",{className:"pkt-tabs",ref:a,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:n||$})})})}),ed=w.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:c,helptext:p,helptextDropdown:v,helptextDropdownButton:m,inline:y,fullwidth:$=!1,label:b,name:x,optionalTag:T=!1,optionalText:O,requiredTag:S=!1,requiredText:B,tagText:A=null,placeholder:R,rows:et,useWrapper:Tt=!0,onChange:Nt,value:nt,autoComplete:gt="off",minLength:Ut,maxLength:Yt,readOnly:mt=!1,skipForwardTestid:$e=!1,...Pt},Dt)=>{const zt=[a,"pkt-textinput","pkt-textarea"].join(" "),Gt=`${s}-input`,q=`${Gt}-label`,It=e||q,[ae,Lt]=w.useState(0),rt=_e=>{var we,re;if(i&&Lt(((re=(we=_e.currentTarget)==null?void 0:we.value)==null?void 0:re.length)||0),Nt)return Nt(_e)};return w.useEffect(()=>{nt!==void 0&&Lt((nt==null?void 0:nt.length)||0)},[nt]),l.jsx(ti,{ariaDescribedby:t,className:zt,disabled:r,errorMessage:h,forId:Gt,hasError:c,helptext:p,helptextDropdown:v,helptextDropdownButton:m,inline:y,label:b,optionalTag:T,optionalText:O,requiredTag:S,requiredText:B,tagText:A,useWrapper:Tt,counter:i,counterCurrent:ae,counterMaxLength:n,children:l.jsx("textarea",{ref:Dt,className:`pkt-input ${$?"pkt-input--fullwidth":""} ${n&&ae>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:Gt,placeholder:R,disabled:r,rows:et,"aria-labelledby":It,"aria-invalid":c,"aria-errormessage":`${s}-error`,...Pt,onChange:rt,value:nt,autoComplete:gt,minLength:Ut,maxLength:Yt,"data-skip-forward-testid":$e?"true":void 0})})});var $s=window.CustomEvent;(!$s||typeof $s=="object")&&($s=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},$s.prototype=window.Event.prototype);function Wa(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function sd(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,n){return!(t[i]===void 0||t[i]===n)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function ei(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 Ra(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function id(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function ln(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Ka(s){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(e.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),a=0;a<n.length&&!(n[a].tagName&&n[a].shadowRoot&&(i=Ka(n[a].shadowRoot),i));a++);return i}function Ya(s){return s.isConnected||document.body.contains(s)}function Ga(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=z.formSubmitter;if(!e){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;e=n.activeElement}return!e||e.form!==t?null:e}function nd(s){if(!s.defaultPrevented){var t=s.target,e=z.imagemapUseValue,i=Ga(s);e===null&&i&&(e=i.value);var n=ei(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function Za(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",nd,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,i=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),n,a=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,a)})}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))}Za.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Ya(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_),z.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 t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var e=document.createEvent("MouseEvents");e.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(e),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=Ka(this.dialog_)),Ra(document.activeElement),s&&s.focus()},updateZIndex:function(s,t){if(s<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=t},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(!Ya(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!z.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");sd(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,z.needsCentering(this.dialog_)?(z.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 t=new $s("close",{bubbles:!1,cancelable:!1});Wa(this.dialog_,t)}};var z={};if(z.reposition=function(s){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(t,e)+"px"},z.isInlinePositionSetByStylesheet=function(s){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],i=null;try{i=e.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var a=i[n],r=null;try{r=document.querySelectorAll(a.selectorText)}catch{}if(!(!r||!id(r,s))){var h=a.style.getPropertyValue("top"),c=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||c&&c!=="auto")return!0}}}return!1},z.needsCentering=function(s){var t=window.getComputedStyle(s);return t.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!z.isInlinePositionSetByStylesheet(s)},z.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 Za(s)},z.registerDialog=function(s){s.showModal||z.forceRegisterDialog(s)},z.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(t){this.forwardTab_=void 0,t.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(t){var e=[];t.forEach(function(i){for(var n=0,a;a=i.removedNodes[n];++n){if(a instanceof Element)a.localName==="dialog"&&e.push(a);else continue;e=e.concat(a.querySelectorAll("dialog"))}}),e.length&&s(e)}))},z.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})},z.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},z.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--s,--s),t===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)},z.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=ei(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},z.DialogManager.prototype.handleFocus_=function(s){var t=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),Ra(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,n=i.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},z.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new $s("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&Wa(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},z.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},z.DialogManager.prototype.pushDialog=function(s){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},z.DialogManager.prototype.removeDialog=function(s){var t=this.pendingDialogStack.indexOf(s);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},z.dm=new z.DialogManager,z.formSubmitter=null,z.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Xa=document.createElement("form");if(Xa.setAttribute("method","dialog"),Xa.method!=="dialog"){var _s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(_s){var ad=_s.get;_s.get=function(){return ln(this)?"dialog":ad.call(this)};var rd=_s.set;_s.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):rd.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",_s)}}document.addEventListener("click",function(s){if(z.formSubmitter=null,z.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!ln(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;z.imagemapUseValue=s.offsetX+","+s.offsetY}var n=ei(t);n&&(z.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=ei(t);if(!e){var i=Ga(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var od=HTMLFormElement.prototype.submit,ld=function(){if(!ln(this))return od.call(this);var s=ei(this);s&&s.close()};HTMLFormElement.prototype.submit=ld}const hd=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=pn,P.PktAccordionItem=Ca,P.PktAlert=nn,P.PktBackLink=Na,P.PktBreadcrumbs=xc,P.PktButton=pe,P.PktCard=Ea,P.PktCheckbox=Ma,P.PktCombobox=Aa,P.PktConsent=Mi,P.PktDatepicker=Oa,P.PktFooter=Nc,P.PktFooterSimple=Ec,P.PktHeader=Da,P.PktHeaderService=Pa,P.PktHeading=Ia,P.PktHelptext=La,P.PktIcon=U,P.PktInput=Ba,P.PktInputWrapper=ti,P.PktLink=Ai,P.PktLinkCard=Fa,P.PktLoader=Va,P.PktMessagebox=ja,P.PktModal=Ha,P.PktProgressbar=Ua,P.PktRadioButton=za,P.PktSearchInput=jc,P.PktSelect=Hc,P.PktStep=Wc,P.PktStepper=Rc,P.PktTabItem=on,P.PktTable=Kc,P.PktTableBody=Yc,P.PktTableDataCell=Gc,P.PktTableHeader=Zc,P.PktTableHeaderCell=Xc,P.PktTableRow=Jc,P.PktTabs=td,P.PktTag=rn,P.PktTextarea=ed,P.PktTextinput=an,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|