@oslokommune/punkt-react 13.14.0 → 13.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/index.d.ts +24 -10
- package/dist/punkt-react.es.js +1388 -1340
- package/dist/punkt-react.umd.js +118 -118
- package/package.json +2 -2
- package/src/components/tag/Tag.test.tsx +31 -17
- package/src/components/tag/Tag.tsx +108 -24
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,x,zi){"use strict";
|
|
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,x,zi){"use strict";const Wi=x.createContext({}),En=()=>x.useContext(Wi),Ri=x.forwardRef(({compact:s=!1,skin:t="borderless",ariaLabelledBy:e,children:i,name:a,className:n},r)=>{const h=["pkt-accordion",s&&"pkt-accordion--compact",t&&`pkt-accordion--${t}`,n].filter(Boolean).join(" ");return l.jsx(Wi.Provider,{value:{name:a},children:l.jsx("div",{ref:r,className:h,"data-testid":"pkt-accordion","aria-labelledby":e||void 0,children:i})})});Ri.displayName="PktAccordion";/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2018 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/const
|
|
40
|
+
*/const On=new Set(["children","localName","ref","style","className"]),Ki=new WeakMap,Gi=(s,t,e,i,a)=>{const n=a==null?void 0:a[t];n===void 0?(s[t]=e,e==null&&t in HTMLElement.prototype&&s.removeAttribute(t)):e!==i&&((r,h,d)=>{let p=Ki.get(r);p===void 0&&Ki.set(r,p=new Map);let m=p.get(h);d!==void 0?m===void 0?(p.set(h,m={handleEvent:d}),r.addEventListener(h,m)):m.handleEvent=d:m!==void 0&&(p.delete(h),r.removeEventListener(h,m))})(s,n,e)},Wt=({react:s,tagName:t,elementClass:e,events:i,displayName:a})=>{const n=new Set(Object.keys(i??{})),r=s.forwardRef(((h,d)=>{const p=s.useRef(new Map),m=s.useRef(null),f={},k={};for(const[b,y]of Object.entries(h))On.has(b)?f[b==="className"?"class":b]=y:n.has(b)||b in e.prototype?k[b]=y:f[b]=y;return s.useLayoutEffect((()=>{if(m.current===null)return;const b=new Map;for(const y in k)Gi(m.current,y,h[y],p.current.get(y),i),p.current.delete(y),b.set(y,h[y]);for(const[y,w]of p.current)Gi(m.current,y,void 0,w,i);p.current=b})),s.useLayoutEffect((()=>{var b;(b=m.current)==null||b.removeAttribute("defer-hydration")}),[]),f.suppressHydrationWarning=!0,s.createElement(t,{...f,ref:s.useCallback((b=>{m.current=b,typeof d=="function"?d(b):d!==null&&(d.current=b)}),[d])})}));return r.displayName=a??e.name,r};/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/const qs=globalThis,zs=qs.trustedTypes,Yi=zs?zs.createPolicy("lit-html",{createHTML:s=>s}):void 0,Zi="$lit$",fe=`lit$${Math.random().toFixed(9).slice(2)}$`,Xi="?"+fe,
|
|
44
|
+
*/const qs=globalThis,zs=qs.trustedTypes,Yi=zs?zs.createPolicy("lit-html",{createHTML:s=>s}):void 0,Zi="$lit$",fe=`lit$${Math.random().toFixed(9).slice(2)}$`,Xi="?"+fe,Pn=`<${Xi}>`,we=document,us=()=>we.createComment(""),fs=s=>s===null||typeof s!="object"&&typeof s!="function",ui=Array.isArray,Mn=s=>ui(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",fi=`[
|
|
45
45
|
\f\r]`,gs=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ji=/-->/g,Qi=/>/g,xe=RegExp(`>|${fi}(?:([^\\s"'>=/]+)(${fi}*=${fi}*(?:[^
|
|
46
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ta=/'/g,ea=/"/g,sa=/^(?:script|style|textarea|title)$/i,
|
|
46
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ta=/'/g,ea=/"/g,sa=/^(?:script|style|textarea|title)$/i,Dn=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),u=Dn(1),_t=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),ia=new WeakMap,Se=we.createTreeWalker(we,129);function aa(s,t){if(!ui(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yi!==void 0?Yi.createHTML(t):t}const In=(s,t)=>{const e=s.length-1,i=[];let a,n=t===2?"<svg>":t===3?"<math>":"",r=gs;for(let h=0;h<e;h++){const d=s[h];let p,m,f=-1,k=0;for(;k<d.length&&(r.lastIndex=k,m=r.exec(d),m!==null);)k=r.lastIndex,r===gs?m[1]==="!--"?r=Ji:m[1]!==void 0?r=Qi:m[2]!==void 0?(sa.test(m[2])&&(a=RegExp("</"+m[2],"g")),r=xe):m[3]!==void 0&&(r=xe):r===xe?m[0]===">"?(r=a??gs,f=-1):m[1]===void 0?f=-2:(f=r.lastIndex-m[2].length,p=m[1],r=m[3]===void 0?xe:m[3]==='"'?ea:ta):r===ea||r===ta?r=xe:r===Ji||r===Qi?r=gs:(r=xe,a=void 0);const b=r===xe&&s[h+1].startsWith("/>")?" ":"";n+=r===gs?d+Pn:f>=0?(i.push(p),d.slice(0,f)+Zi+d.slice(f)+fe+b):d+fe+(f===-2?h:b)}return[aa(s,n+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};let gi=class Nn{constructor({strings:t,_$litType$:e},i){let a;this.parts=[];let n=0,r=0;const h=t.length-1,d=this.parts,[p,m]=In(t,e);if(this.el=Nn.createElement(p,i),Se.currentNode=this.el.content,e===2||e===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(a=Se.nextNode())!==null&&d.length<h;){if(a.nodeType===1){if(a.hasAttributes())for(const f of a.getAttributeNames())if(f.endsWith(Zi)){const k=m[r++],b=a.getAttribute(f).split(fe),y=/([.?@])?(.*)/.exec(k);d.push({type:1,index:n,name:y[2],strings:b,ctor:y[1]==="."?Bn:y[1]==="?"?Fn:y[1]==="@"?Vn:Rs}),a.removeAttribute(f)}else f.startsWith(fe)&&(d.push({type:6,index:n}),a.removeAttribute(f));if(sa.test(a.tagName)){const f=a.textContent.split(fe),k=f.length-1;if(k>0){a.textContent=zs?zs.emptyScript:"";for(let b=0;b<k;b++)a.append(f[b],us()),Se.nextNode(),d.push({type:2,index:++n});a.append(f[k],us())}}}else if(a.nodeType===8)if(a.data===Xi)d.push({type:2,index:n});else{let f=-1;for(;(f=a.data.indexOf(fe,f+1))!==-1;)d.push({type:7,index:n}),f+=fe.length-1}n++}}static createElement(t,e){const i=we.createElement("template");return i.innerHTML=t,i}};function We(s,t,e=s,i){var a,n;if(t===_t)return t;let r=i!==void 0?(a=e._$Co)==null?void 0:a[i]:e._$Cl;const h=fs(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==h&&((n=r==null?void 0:r._$AO)==null||n.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=We(s,r._$AS(s,t.values),r,i)),t}let Ln=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,a=((t==null?void 0:t.creationScope)??we).importNode(e,!0);Se.currentNode=a;let n=Se.nextNode(),r=0,h=0,d=i[0];for(;d!==void 0;){if(r===d.index){let p;d.type===2?p=new Ws(n,n.nextSibling,this,t):d.type===1?p=new d.ctor(n,d.name,d.strings,this,t):d.type===6&&(p=new jn(n,this,t)),this._$AV.push(p),d=i[++h]}r!==(d==null?void 0:d.index)&&(n=Se.nextNode(),r++)}return Se.currentNode=we,a}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++}},Ws=class An{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,a){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=a,this._$Cv=(a==null?void 0:a.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=We(this,t,e),fs(t)?t===$||t==null||t===""?(this._$AH!==$&&this._$AR(),this._$AH=$):t!==this._$AH&&t!==_t&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Mn(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!==$&&fs(this._$AH)?this._$AA.nextSibling.data=t:this.T(we.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:a}=t,n=typeof a=="number"?this._$AC(t):(a.el===void 0&&(a.el=gi.createElement(aa(a.h,a.h[0]),this.options)),a);if(((e=this._$AH)==null?void 0:e._$AD)===n)this._$AH.p(i);else{const r=new Ln(n,this),h=r.u(this.options);r.p(i),this.T(h),this._$AH=r}}_$AC(t){let e=ia.get(t.strings);return e===void 0&&ia.set(t.strings,e=new gi(t)),e}k(t){ui(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,a=0;for(const n of t)a===e.length?e.push(i=new An(this.O(us()),this.O(us()),this,this.options)):i=e[a],i._$AI(n),a++;a<e.length&&(this._$AR(i&&i._$AB.nextSibling,a),e.length=a)}_$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 a=t.nextSibling;t.remove(),t=a}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},Rs=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,a,n){this.type=1,this._$AH=$,this._$AN=void 0,this.element=t,this.name=e,this._$AM=a,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$}_$AI(t,e=this,i,a){const n=this.strings;let r=!1;if(n===void 0)t=We(this,t,e,0),r=!fs(t)||t!==this._$AH&&t!==_t,r&&(this._$AH=t);else{const h=t;let d,p;for(t=n[0],d=0;d<n.length-1;d++)p=We(this,h[i+d],e,d),p===_t&&(p=this._$AH[d]),r||(r=!fs(p)||p!==this._$AH[d]),p===$?t=$:t!==$&&(t+=(p??"")+n[d+1]),this._$AH[d]=p}r&&!a&&this.j(t)}j(t){t===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Bn=class extends Rs{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$?void 0:t}},Fn=class extends Rs{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==$)}},Vn=class extends Rs{constructor(t,e,i,a,n){super(t,e,i,a,n),this.type=5}_$AI(t,e=this){if((t=We(this,t,e,0)??$)===_t)return;const i=this._$AH,a=t===$&&i!==$||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==$&&(i===$||a);a&&this.element.removeEventListener(this.name,this,i),n&&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)}},jn=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){We(this,t)}};const Hn={I:Ws},na=qs.litHtmlPolyfillSupport;na==null||na(gi,Ws),(qs.litHtmlVersions??(qs.litHtmlVersions=[])).push("3.3.1");const Un=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let a=i._$litPart$;if(a===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=a=new Ws(t.insertBefore(us(),n),n,void 0,e??{})}return a._$AI(s),a};/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/const
|
|
50
|
+
*/const j=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 Ks=globalThis,mi=Ks.ShadowRoot&&(Ks.ShadyCSS===void 0||Ks.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ra=Symbol(),oa=new WeakMap;let
|
|
54
|
+
*/const Ks=globalThis,mi=Ks.ShadowRoot&&(Ks.ShadyCSS===void 0||Ks.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ra=Symbol(),oa=new WeakMap;let qn=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==ra)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(mi&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=oa.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&oa.set(e,t))}return t}toString(){return this.cssText}};const zn=s=>new qn(typeof s=="string"?s:s+"",void 0,ra),Wn=(s,t)=>{if(mi)s.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const i=document.createElement("style"),a=Ks.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=e.cssText,s.appendChild(i)}},la=mi?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return zn(e)})(s):s;/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/const{is:
|
|
58
|
+
*/const{is:Rn,defineProperty:Kn,getOwnPropertyDescriptor:Gn,getOwnPropertyNames:Yn,getOwnPropertySymbols:Zn,getPrototypeOf:Xn}=Object,Re=globalThis,ha=Re.trustedTypes,Jn=ha?ha.emptyScript:"",da=Re.reactiveElementPolyfillSupport,ms=(s,t)=>s,Gs={toAttribute(s,t){switch(t){case Boolean:s=s?Jn: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}},vi=(s,t)=>!Rn(s,t),ca={attribute:!0,type:String,converter:Gs,reflect:!1,useDefault:!1,hasChanged:vi};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Re.litPropertyMetadata??(Re.litPropertyMetadata=new WeakMap);let Ke=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=ca){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(),a=this.getPropertyDescriptor(t,i,e);a!==void 0&&Kn(this.prototype,t,a)}}static getPropertyDescriptor(t,e,i){const{get:a,set:n}=Gn(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:a,set(r){const h=a==null?void 0:a.call(this);n==null||n.call(this,r),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ca}static _$Ei(){if(this.hasOwnProperty(ms("elementProperties")))return;const t=Xn(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ms("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ms("properties"))){const e=this.properties,i=[...Yn(e),...Zn(e)];for(const a of i)this.createProperty(a,e[a])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,a]of e)this.elementProperties.set(i,a)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const a=this._$Eu(e,i);a!==void 0&&this._$Eh.set(a,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 a of i)e.unshift(la(a))}else t!==void 0&&e.push(la(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 Wn(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 a=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,a);if(n!==void 0&&a.reflect===!0){const r=(((i=a.converter)==null?void 0:i.toAttribute)!==void 0?a.converter:Gs).toAttribute(e,a.type);this._$Em=t,r==null?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){var i,a;const n=this.constructor,r=n._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const h=n.getPropertyOptions(r),d=typeof h.converter=="function"?{fromAttribute:h.converter}:((i=h.converter)==null?void 0:i.fromAttribute)!==void 0?h.converter:Gs;this._$Em=r;const p=d.fromAttribute(e,h.type);this[r]=p??((a=this._$Ej)==null?void 0:a.get(r))??p,this._$Em=null}}requestUpdate(t,e,i){var a;if(t!==void 0){const n=this.constructor,r=this[t];if(i??(i=n.getPropertyOptions(t)),!((i.hasChanged??vi)(r,e)||i.useDefault&&i.reflect&&r===((a=this._$Ej)==null?void 0:a.get(t))&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:a,wrapped:n},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),a===!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[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[n,r]of a){const{wrapped:h}=r,d=this[n];h!==!0||this._$AL.has(n)||d===void 0||this.C(n,void 0,r,d)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$EO)==null||t.forEach((a=>{var n;return(n=a.hostUpdate)==null?void 0:n.call(a)})),this.update(i)):this._$EM()}catch(a){throw e=!1,this._$EM(),a}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((i=>{var a;return(a=i.hostUpdated)==null?void 0:a.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){}};Ke.elementStyles=[],Ke.shadowRootOptions={mode:"open"},Ke[ms("elementProperties")]=new Map,Ke[ms("finalized")]=new Map,da==null||da({ReactiveElement:Ke}),(Re.reactiveElementVersions??(Re.reactiveElementVersions=[])).push("2.1.1");/**
|
|
59
59
|
* @license
|
|
60
60
|
* Copyright 2017 Google LLC
|
|
61
61
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const
|
|
62
|
+
*/const Qn={attribute:!0,type:String,converter:Gs,reflect:!1,hasChanged:vi},tr=(s=Qn,t,e)=>{const{kind:i,metadata:a}=e;let n=globalThis.litPropertyMetadata.get(a);if(n===void 0&&globalThis.litPropertyMetadata.set(a,n=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),n.set(e.name,s),i==="accessor"){const{name:r}=e;return{set(h){const d=t.get.call(this);t.set.call(this,h),this.requestUpdate(r,d,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 d=this[r];t.call(this,h),this.requestUpdate(r,d,s)}}throw Error("Unsupported decorator location: "+i)};function o(s){return(t,e)=>typeof e=="object"?tr(s,t,e):((i,a,n)=>{const r=a.hasOwnProperty(n);return a.constructor.createProperty(n,i),r?Object.getOwnPropertyDescriptor(a,n):void 0})(s,t,e)}/**
|
|
63
63
|
* @license
|
|
64
64
|
* Copyright 2017 Google LLC
|
|
65
65
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
-
*/const vs=globalThis;let Ge=class extends Ke{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=
|
|
66
|
+
*/const vs=globalThis;let Ge=class extends Ke{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=Un(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 _t}};var pa;Ge._$litElement$=!0,Ge.finalized=!0,(pa=vs.litElementHydrateSupport)==null||pa.call(vs,{LitElement:Ge});const ua=vs.litElementPolyfillSupport;ua==null||ua({LitElement:Ge}),(vs.litElementVersions??(vs.litElementVersions=[])).push("4.2.1");const er={hi:"Hei!"},sr={from:"Fra",to:"Til"},ir={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},ar={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"},nr={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."}},kt={example:er,generic:sr,calendar:ir,dates:ar,forms:nr};var rr=Object.defineProperty,fa=(s,t,e,i)=>{for(var a=void 0,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=r(t,e,a)||a);return a&&rr(t,e,a),a};let Ys=class extends Ge{constructor(){super(...arguments),this.strings=kt,this.role=null}hotReplacedCallback(){this.requestUpdate()}};fa([o({type:Object})],Ys.prototype,"strings"),fa([o({type:String})],Ys.prototype,"role");let Y=class extends Ys{createRenderRoot(){return this}};/**
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/const
|
|
70
|
+
*/const Rt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Ce=s=>(...t)=>({_$litDirective$:s,values:t});let Ye=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 O=Ce(class extends Ye{constructor(s){var t;if(super(s),s.type!==
|
|
74
|
+
*/const O=Ce(class extends Ye{constructor(s){var t;if(super(s),s.type!==Rt.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((n=>n!==""))));for(const n in t)t[n]&&!((e=this.nt)!=null&&e.has(n))&&this.st.add(n);return this.render(t)}const a=s.element.classList;for(const n of this.st)n in t||(a.remove(n),this.st.delete(n));for(const n in t){const r=!!t[n];r===this.st.has(n)||(i=this.nt)!=null&&i.has(n)||(r?(a.add(n),this.st.add(n)):(a.remove(n),this.st.delete(n)))}return _t}});/**
|
|
75
75
|
* @license
|
|
76
76
|
* Copyright 2017 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
|
-
*/function F(s){return o({...s,state:!0,attribute:!1})}function ga(s,t){return t.some(e=>e.value===s)}function bs(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function Ze(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function
|
|
78
|
+
*/function F(s){return o({...s,state:!0,attribute:!1})}function ga(s,t){return t.some(e=>e.value===s)}function bs(s){return s.classList&&(s.classList.contains("_dialog_overlay")||s.classList.contains("backdrop"))?!0:typeof s.hasAttribute=="function"&&s.hasAttribute("data-skip")}function Ze(s){return s.nodeName==="OPTION"||s.nodeName==="DATA"}function or(s,t){return s.nodeType===Node.ELEMENT_NODE&&!ga(s,t)}function bi(s){var t;return s.nodeType===Node.TEXT_NODE&&((t=s.nodeValue)==null?void 0:t.trim())!==""}let at=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=>{bs(t)||Ze(t)&&this.skipOptions||(!ga(t,this.slots)||bi(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(n=>{var r,h;if(n.nodeType===Node.COMMENT_NODE)return!1;if(n.nodeType===Node.TEXT_NODE)return!!((r=n.textContent)!=null&&r.trim());if(n.nodeType===Node.ELEMENT_NODE){if(bs(n))return!1;if((h=n.textContent)!=null&&h.trim())return!0}return!1})&&t.add(i);const a=this.nodes.flatMap(n=>bi(n)||n.getAttribute&&n.getAttribute("slot")==i&&!bs(n)?n:[]).filter(n=>e.value&&!e.value.contains(n)&&!n.contains(e.value));if(a.length>0)if(typeof e.value.replaceChildren!="function"){for(;e.value.firstChild;)e.value.removeChild(e.value.firstChild);e.value.append(...a)}else e.value.replaceChildren(...a)}),(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(a=>{bs(a)||Ze(a)&&this.skipOptions||(or(a,this.slots)||bi(a))&&(this.nodes.push(a),e=!0)}),i.removedNodes.forEach(a=>{bs(a)||Ze(a)&&this.skipOptions||(this.nodes=this.nodes.filter(n=>n!==a),e=!0)}))}),e&&this.updateSlots()}handleSlotMutations(t){let e=!1;t.forEach(i=>{const a=i.target.parentElement;if(a!=null&&a.hasAttribute("slot")){const n=a.getAttribute("slot"),r=a.hasChildNodes();r&&!this.filledSlots.has(n)?(this.filledSlots.add(n),e=!0):!r&&this.filledSlots.has(n)&&(this.filledSlots.delete(n),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:
|
|
82
|
+
*/const{I:lr}=Hn,ma=s=>s.strings===void 0,va=()=>document.createComment(""),ys=(s,t,e)=>{var i;const a=s._$AA.parentNode,n=t===void 0?s._$AB:t._$AA;if(e===void 0){const r=a.insertBefore(va(),n),h=a.insertBefore(va(),n);e=new lr(r,h,s,s.options)}else{const r=e._$AB.nextSibling,h=e._$AM,d=h!==s;if(d){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!==n||d){let p=e._$AA;for(;p!==r;){const m=p.nextSibling;a.insertBefore(p,n),p=m}}}return e},Te=(s,t,e=s)=>(s._$AI(t,e),s),hr={},ba=(s,t=hr)=>s._$AH=t,dr=s=>s._$AH,yi=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 ks=(s,t)=>{var e;const i=s._$AN;if(i===void 0)return!1;for(const a of i)(e=a._$AO)==null||e.call(a,t,!1),ks(a,t);return!0},Zs=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)},ya=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),
|
|
86
|
+
*/const ks=(s,t)=>{var e;const i=s._$AN;if(i===void 0)return!1;for(const a of i)(e=a._$AO)==null||e.call(a,t,!1),ks(a,t);return!0},Zs=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)},ya=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),ur(t)}};function cr(s){this._$AN!==void 0?(Zs(this),this._$AM=s,ya(this)):this._$AM=s}function pr(s,t=!1,e=0){const i=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(t)if(Array.isArray(i))for(let n=e;n<i.length;n++)ks(i[n],!1),Zs(i[n]);else i!=null&&(ks(i,!1),Zs(i));else ks(this,s)}const ur=s=>{s.type==Rt.CHILD&&(s._$AP??(s._$AP=pr),s._$AQ??(s._$AQ=cr))};let fr=class extends Ye{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),ya(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,a;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(a=this.disconnected)==null||a.call(this)),e&&(ks(this,t),Zs(this))}setValue(t){if(ma(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
|
|
90
|
+
*/const A=()=>new gr;let gr=class{};const ki=new WeakMap,E=Ce(class extends fr{render(s){return $}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)),$}rt(s){if(this.isConnected||(s=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=ki.get(t);e===void 0&&(e=new WeakMap,ki.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=ki.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 ka(s,t,e){const i=s.getAttribute("class")||"",a=new Set(i.split(/\s+/).filter(Boolean));e?a.add(t):a.delete(t),s.setAttribute("class",Array.from(a).join(" "))}/**
|
|
91
91
|
* @license
|
|
92
92
|
* Copyright 2017 Google LLC
|
|
93
93
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
94
|
-
*/let Xs=class extends Ye{constructor(t){if(super(t),this.it=$,t.type!==
|
|
94
|
+
*/let Xs=class extends Ye{constructor(t){if(super(t),this.it=$,t.type!==Rt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===$||t==null)return this._t=void 0,this.it=t;if(t===_t)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};Xs.directiveName="unsafeHTML",Xs.resultType=1;const Js=Ce(Xs);/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let $i=class extends Xs{};$i.directiveName="unsafeSVG",$i.resultType=2;const $a=Ce($i);var
|
|
98
|
+
*/let $i=class extends Xs{};$i.directiveName="unsafeSVG",$i.resultType=2;const $a=Ce($i);var mr=Object.defineProperty,vr=Object.getOwnPropertyDescriptor,$s=(s,t,e,i)=>{for(var a=i>1?void 0:i?vr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&mr(t,e,a),a};const _i="https://punkt-cdn.oslo.kommune.no/13.15/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||_i);const br=s=>new Promise(t=>setTimeout(t,s)),Qs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',wi={},yr=async(s,t)=>{let e=0;for(;wi[t+s+".svg"]==="fetching"&&(e++,!(e>50));)await br(50);const i=typeof Storage<"u"&&typeof localStorage<"u";return i&&localStorage.getItem(t+s+".svg")?Promise.resolve(localStorage.getItem(t+s+".svg")):typeof window<"u"&&typeof window.pktFetch=="function"?(wi[t+s+".svg"]="fetching",Promise.resolve(window.pktFetch(t+s+".svg").then(a=>a.ok?a.text():(console.error("Missing icon: "+t+s+".svg"),Qs)).then(a=>(a!==Qs&&i&&localStorage.setItem(t+s+".svg",a),wi[t+s+".svg"]="fetched",a)))):Promise.resolve(Qs)};let Ne=class extends Y{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:_i,this.name="",this.icon=$a(Qs),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:_i),this.icon=$a(await yr(this.name||"",this.path).then(e=>e)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return u`${this.name&&this.icon}`}};$s([o({type:String,reflect:!1})],Ne.prototype,"path",2),$s([o({type:String,reflect:!0})],Ne.prototype,"name",2),$s([o({type:SVGElement})],Ne.prototype,"icon",2),$s([o({type:Array,noAccessor:!0})],Ne.prototype,"_updatedProps",2),Ne=$s([j("pkt-icon")],Ne);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const S=s=>s??$;var
|
|
102
|
+
*/const S=s=>s??$;var kr=Object.defineProperty,$r=Object.getOwnPropertyDescriptor,vt=(s,t,e,i)=>{for(var a=i>1?void 0:i?$r(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&kr(t,e,a),a};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.15/animations/";let ut=class extends Y{constructor(){super(),this.defaultSlot=A(),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 at(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=${O(e)}
|
|
105
105
|
type=${this.type}
|
|
@@ -114,10 +114,10 @@
|
|
|
114
114
|
path=${S(this.loadingAnimationPath)}
|
|
115
115
|
></pkt-icon>`:$}
|
|
116
116
|
${this.variant!=="label-only"?u`<pkt-icon class="pkt-btn__icon pkt-icon" name=${this.iconName}></pkt-icon>`:$}
|
|
117
|
-
<span class="pkt-btn__text" ${
|
|
117
|
+
<span class="pkt-btn__text" ${E(this.defaultSlot)}></span>
|
|
118
118
|
${this.variant==="icons-right-and-left"?u`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:$}
|
|
119
119
|
</button>
|
|
120
|
-
`}};vt([o({type:String})],
|
|
120
|
+
`}};vt([o({type:String})],ut.prototype,"iconName",2),vt([o({type:String})],ut.prototype,"secondIconName",2),vt([o({type:String})],ut.prototype,"mode",2),vt([o({type:String})],ut.prototype,"size",2),vt([o({type:Boolean,attribute:"full-width"})],ut.prototype,"fullWidth",2),vt([o({type:Boolean,attribute:"full-width-on-mobile"})],ut.prototype,"fullWidthOnMobile",2),vt([o({type:String})],ut.prototype,"color",2),vt([o({type:String})],ut.prototype,"skin",2),vt([o({type:String})],ut.prototype,"variant",2),vt([o({type:String,reflect:!0})],ut.prototype,"state",2),vt([o({type:String,reflect:!0})],ut.prototype,"type",2),vt([o({type:String})],ut.prototype,"form",2),vt([o({type:Boolean,reflect:!0})],ut.prototype,"isLoading",2),vt([o({type:Boolean,reflect:!0})],ut.prototype,"disabled",2),vt([o({type:String})],ut.prototype,"loadingAnimationPath",2),ut=vt([j("pkt-button")],ut);const _r={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},ti={props:_r};var wr=Object.defineProperty,xr=Object.getOwnPropertyDescriptor,Jt=(s,t,e,i)=>{for(var a=i>1?void 0:i?xr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&wr(t,e,a),a};let Kt=class extends Y{constructor(){super(),this.defaultSlot=A(),this.compact=ti.props.compact.default,this.title="",this.skin=ti.props.skin.default,this.ariaLive=ti.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=ti.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 at(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")&&ka(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`
|
|
121
121
|
<div class=${O(t)} aria-live=${this["aria-live"]}>
|
|
122
122
|
<div class=${O(e)}>
|
|
123
123
|
<pkt-icon
|
|
@@ -144,12 +144,12 @@
|
|
|
144
144
|
`:$}
|
|
145
145
|
${this.title?u`<div class="pkt-alert__title">${this.title}</div>`:$}
|
|
146
146
|
|
|
147
|
-
<div class="pkt-alert__text" ${
|
|
147
|
+
<div class="pkt-alert__text" ${E(this.defaultSlot)}></div>
|
|
148
148
|
|
|
149
149
|
${this.date?u`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:$}
|
|
150
150
|
</div>
|
|
151
151
|
</div>
|
|
152
|
-
`}};Jt([o({type:Boolean,reflect:!1})],
|
|
152
|
+
`}};Jt([o({type:Boolean,reflect:!1})],Kt.prototype,"compact",2),Jt([o({type:String,reflect:!0})],Kt.prototype,"title",2),Jt([o({type:String,reflect:!0})],Kt.prototype,"skin",2),Jt([o({type:String})],Kt.prototype,"ariaLive",2),Jt([o({type:String,reflect:!0})],Kt.prototype,"aria-live",2),Jt([o({type:Boolean,reflect:!0})],Kt.prototype,"closeAlert",2),Jt([o({type:String,reflect:!0})],Kt.prototype,"date",2),Jt([o({type:String,reflect:!0})],Kt.prototype,"role",2),Jt([F()],Kt.prototype,"_isClosed",2),Kt=Jt([j("pkt-alert")],Kt);var Sr=Object.defineProperty,Cr=Object.getOwnPropertyDescriptor,_s=(s,t,e,i)=>{for(var a=i>1?void 0:i?Cr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Sr(t,e,a),a};let Xe=class extends Ge{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`
|
|
153
153
|
<div
|
|
154
154
|
part="container"
|
|
155
155
|
class=${O(t)}
|
|
@@ -158,12 +158,12 @@
|
|
|
158
158
|
>
|
|
159
159
|
<slot></slot>
|
|
160
160
|
</div>
|
|
161
|
-
`}};_s([o({type:String,reflect:!0,attribute:"aria-labelledby"})],Xe.prototype,"ariaLabelledBy",2),_s([o({type:Boolean,reflect:!0,attribute:"compact"})],Xe.prototype,"compact",2),_s([o({type:String,reflect:!0,attribute:"skin"})],Xe.prototype,"skin",2),_s([o({type:String,reflect:!0,attribute:"name"})],Xe.prototype,"name",2),Xe=_s([
|
|
161
|
+
`}};_s([o({type:String,reflect:!0,attribute:"aria-labelledby"})],Xe.prototype,"ariaLabelledBy",2),_s([o({type:Boolean,reflect:!0,attribute:"compact"})],Xe.prototype,"compact",2),_s([o({type:String,reflect:!0,attribute:"skin"})],Xe.prototype,"skin",2),_s([o({type:String,reflect:!0,attribute:"name"})],Xe.prototype,"name",2),Xe=_s([j("pkt-accordion")],Xe);var Tr=Object.defineProperty,Nr=Object.getOwnPropertyDescriptor,Ae=(s,t,e,i)=>{for(var a=i>1?void 0:i?Nr(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Tr(t,e,a),a};let ge=class extends Y{constructor(){super(),this.defaultOpen=!1,this.title="",this.skin=void 0,this.compact=!1,this.isOpen=!1,this.name=void 0,this.accordionItemRef=A(),this.defaultSlot=A(),this.slotController=new at(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`
|
|
162
162
|
<details
|
|
163
163
|
class=${O(t)}
|
|
164
164
|
id=${this.id}
|
|
165
165
|
?open=${this.isOpen}
|
|
166
|
-
${
|
|
166
|
+
${E(this.accordionItemRef)}
|
|
167
167
|
name=${S(this.name)}
|
|
168
168
|
>
|
|
169
169
|
<summary class="pkt-accordion-item__title" id=${`pkt-accordion-item-summary-${this.id}`}>
|
|
@@ -179,10 +179,10 @@
|
|
|
179
179
|
id="pkt-accordion-item__content-${this.id}"
|
|
180
180
|
role="region"
|
|
181
181
|
>
|
|
182
|
-
<div class="pkt-accordion-item__content-inner" ${
|
|
182
|
+
<div class="pkt-accordion-item__content-inner" ${E(this.defaultSlot)}></div>
|
|
183
183
|
</div>
|
|
184
184
|
</details>
|
|
185
|
-
`}};Ae([o({type:Boolean})],ge.prototype,"defaultOpen",2),Ae([o({type:String})],ge.prototype,"title",2),Ae([o({type:String,reflect:!0})],ge.prototype,"skin",2),Ae([o({type:Boolean,reflect:!0})],ge.prototype,"compact",2),Ae([o({type:Boolean,reflect:!0})],ge.prototype,"isOpen",2),Ae([o({type:String,reflect:!0})],ge.prototype,"name",2),ge=Ae([
|
|
185
|
+
`}};Ae([o({type:Boolean})],ge.prototype,"defaultOpen",2),Ae([o({type:String})],ge.prototype,"title",2),Ae([o({type:String,reflect:!0})],ge.prototype,"skin",2),Ae([o({type:Boolean,reflect:!0})],ge.prototype,"compact",2),Ae([o({type:Boolean,reflect:!0})],ge.prototype,"isOpen",2),Ae([o({type:String,reflect:!0})],ge.prototype,"name",2),ge=Ae([j("pkt-accordion-item")],ge);var Ar=Object.defineProperty,Er=Object.getOwnPropertyDescriptor,ei=(s,t,e,i)=>{for(var a=i>1?void 0:i?Er(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Ar(t,e,a),a};let Je=class extends Y{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
|
|
186
186
|
class="pkt-back-link"
|
|
187
187
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
188
188
|
>
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
></pkt-icon
|
|
195
195
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
196
196
|
>
|
|
197
|
-
</nav>`}};ei([o({type:String})],Je.prototype,"href",2),ei([o({type:String})],Je.prototype,"text",2),ei([o({type:String})],Je.prototype,"ariaLabel",2),Je=ei([V("pkt-backlink")],Je);const _a=6048e5,Mr=864e5,wa=Symbol.for("constructDateFrom");function Qt(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&wa in s?s[wa](t):s instanceof Date?new s.constructor(t):new Date(t)}function Nt(s,t){return Qt(t||s,s)}function xi(s,t,e){const i=Nt(s,void 0);return isNaN(t)?Qt(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let Dr={};function si(){return Dr}function ws(s,t){var e,i,a,n;const r=si(),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??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.weekStartsOn)??0,d=Nt(s,t==null?void 0:t.in),p=d.getDay(),m=(p<h?7:0)+p-h;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function ii(s,t){return ws(s,{...t,weekStartsOn:1})}function xa(s,t){const e=Nt(s,void 0),i=e.getFullYear(),a=Qt(e,0);a.setFullYear(i+1,0,4),a.setHours(0,0,0,0);const n=ii(a),r=Qt(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=ii(r);return e.getTime()>=n.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Sa(s){const t=Nt(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 Ca(s,...t){const e=Qt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ta(s,t){const e=Nt(s,void 0);return e.setHours(0,0,0,0),e}function Ir(s,t,e){const[i,a]=Ca(void 0,s,t),n=Ta(i),r=Ta(a),h=+n-Sa(n),d=+r-Sa(r);return Math.round((h-d)/Mr)}function Lr(s,t){const e=xa(s),i=Qt(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ii(i)}function Br(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Fr(s){return!(!Br(s)&&typeof s!="number"||isNaN(+Nt(s)))}function Vr(s,t){const[e,i]=Ca(s,t.start,t.end);return{start:e,end:i}}function Si(s,t){const{start:e,end:i}=Vr(void 0,s);let a=+e>+i;const n=a?+e:+i,r=a?i:e;r.setHours(0,0,0,0);let h=1;const d=[];for(;+r<=n;)d.push(Qt(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return a?d.reverse():d}function jr(s,t){const e=Nt(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Hr={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"}},Ur=(s,t,e)=>{let i;const a=Hr[s];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ci(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const qr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zr={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rr={date:Ci({formats:qr,defaultWidth:"full"}),time:Ci({formats:zr,defaultWidth:"full"}),dateTime:Ci({formats:Wr,defaultWidth:"full"})},Kr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Gr=(s,t,e,i)=>Kr[s];function xs(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let a;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;a=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;a=s.values[h]||s.values[r]}const n=s.argumentCallback?s.argumentCallback(t):t;return a[n]}}const Yr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zr={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xr={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"]},Jr={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"]},Qr={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"}},to={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"}},eo=(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:eo,era:xs({values:Yr,defaultWidth:"wide"}),quarter:xs({values:Zr,defaultWidth:"wide",argumentCallback:s=>s-1}),month:xs({values:Xr,defaultWidth:"wide"}),day:xs({values:Jr,defaultWidth:"wide"}),dayPeriod:xs({values:Qr,defaultWidth:"wide",formattingValues:to,defaultFormattingWidth:"wide"})};function Ss(s){return(t,e={})=>{const i=e.width,a=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],n=t.match(a);if(!n)return null;const r=n[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(h)?ao(h,g=>g.test(r)):io(h,g=>g.test(r));let p;p=s.valueCallback?s.valueCallback(d):d,p=e.valueCallback?e.valueCallback(p):p;const m=t.slice(r.length);return{value:p,rest:m}}}function io(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function ao(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 a=i[0],n=t.match(s.parsePattern);if(!n)return null;let r=s.valueCallback?s.valueCallback(n[0]):n[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(a.length);return{value:r,rest:h}}}const ro=/^(\d+)(th|st|nd|rd)?/i,oo=/\d+/i,lo={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},ho={any:[/^b/i,/^(a|c)/i]},co={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},po={any:[/1/i,/2/i,/3/i,/4/i]},uo={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},fo={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]},go={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},mo={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},bo={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}},yo={ordinalNumber:no({matchPattern:ro,parsePattern:oo,valueCallback:s=>parseInt(s,10)}),era:Ss({matchPatterns:lo,defaultMatchWidth:"wide",parsePatterns:ho,defaultParseWidth:"any"}),quarter:Ss({matchPatterns:co,defaultMatchWidth:"wide",parsePatterns:po,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Ss({matchPatterns:uo,defaultMatchWidth:"wide",parsePatterns:fo,defaultParseWidth:"any"}),day:Ss({matchPatterns:go,defaultMatchWidth:"wide",parsePatterns:mo,defaultParseWidth:"any"}),dayPeriod:Ss({matchPatterns:vo,defaultMatchWidth:"any",parsePatterns:bo,defaultParseWidth:"any"})},ko={code:"en-US",formatDistance:Ur,formatLong:Rr,formatRelative:Gr,localize:so,match:yo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $o(s,t){const e=Nt(s,void 0);return Ir(e,jr(e))+1}function _o(s,t){const e=Nt(s,void 0),i=+ii(e)-+Lr(e);return Math.round(i/_a)+1}function Na(s,t){var e,i,a,n;const r=Nt(s,t==null?void 0:t.in),h=r.getFullYear(),d=si(),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)??d.firstWeekContainsDate??((n=(a=d.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,m=Qt((t==null?void 0:t.in)||s,0);m.setFullYear(h+1,0,p),m.setHours(0,0,0,0);const g=ws(m,t),k=Qt((t==null?void 0:t.in)||s,0);k.setFullYear(h,0,p),k.setHours(0,0,0,0);const b=ws(k,t);return+r>=+g?h+1:+r>=+b?h:h-1}function wo(s,t){var e,i,a,n;const r=si(),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??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,d=Na(s,t),p=Qt((t==null?void 0:t.in)||s,0);return p.setFullYear(d,0,h),p.setHours(0,0,0,0),ws(p,t)}function Aa(s,t){const e=Nt(s,t==null?void 0:t.in),i=+ws(e,t)-+wo(e,t);return Math.round(i/_a)+1}function W(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const me={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return W(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):W(e+1,2)},d(s,t){return W(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 W(s.getHours()%12||12,t.length)},H(s,t){return W(s.getHours(),t.length)},m(s,t){return W(s.getMinutes(),t.length)},s(s,t){return W(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),a=Math.trunc(i*Math.pow(10,e-3));return W(a,t.length)}},Qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ea={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(),a=i>0?i:1-i;return e.ordinalNumber(a,{unit:"year"})}return me.y(s,t)},Y:function(s,t,e,i){const a=Na(s,i),n=a>0?a:1-a;if(t==="YY"){const r=n%100;return W(r,2)}return t==="Yo"?e.ordinalNumber(n,{unit:"year"}):W(n,t.length)},R:function(s,t){const e=xa(s);return W(e,t.length)},u:function(s,t){const e=s.getFullYear();return W(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 W(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 W(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 me.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 W(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 a=Aa(s,i);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):W(a,t.length)},I:function(s,t,e){const i=_o(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):W(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):me.d(s,t)},D:function(s,t,e){const i=$o(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):W(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 a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(n);case"ee":return W(n,2);case"eo":return e.ordinalNumber(n,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(n);case"cc":return W(n,t.length);case"co":return e.ordinalNumber(n,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return W(a,t.length);case"io":return e.ordinalNumber(a,{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 a;switch(i===12?a=Qe.noon:i===0?a=Qe.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let a;switch(i>=17?a=Qe.evening:i>=12?a=Qe.afternoon:i>=4?a=Qe.morning:a=Qe.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{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 me.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):me.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):W(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):W(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):me.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):me.s(s,t)},S:function(s,t){return me.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Pa(i);case"XXXX":case"XX":return Ee(i);case"XXXXX":case"XXX":default:return Ee(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return Pa(i);case"xxxx":case"xx":return Ee(i);case"xxxxx":case"xxx":default:return Ee(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Oa(i,":");case"OOOO":default:return"GMT"+Ee(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Oa(i,":");case"zzzz":default:return"GMT"+Ee(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return W(i,t.length)},T:function(s,t,e){return W(+s,t.length)}};function Oa(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=Math.trunc(i/60),n=i%60;return n===0?e+String(a):e+String(a)+t+W(n,2)}function Pa(s,t){return s%60===0?(s>0?"-":"+")+W(Math.abs(s)/60,2):Ee(s,t)}function Ee(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=W(Math.trunc(i/60),2),n=W(i%60,2);return e+a+t+n}const Ma=(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"})}},Da=(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"})}},xo=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],a=e[2];if(!a)return Ma(s,t);let n;switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"});break}return n.replace("{{date}}",Ma(i,t)).replace("{{time}}",Da(a,t))},So={p:Da,P:xo},Co=/^D+$/,To=/^Y+$/,No=["D","DD","YY","YYYY"];function Ao(s){return Co.test(s)}function Eo(s){return To.test(s)}function Oo(s,t,e){const i=Po(s,t,e);if(console.warn(i),No.includes(s))throw new RangeError(i)}function Po(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 Mo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Do=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Io=/^'([^]*?)'?$/,Lo=/''/g,Bo=/[a-zA-Z]/;function Fo(s,t,e){var i,a,n,r;const h=si(),d=h.locale??ko,p=h.firstWeekContainsDate??((a=(i=h.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,m=h.weekStartsOn??((r=(n=h.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,g=Nt(s,void 0);if(!Fr(g))throw new RangeError("Invalid time value");let k=t.match(Do).map(y=>{const w=y[0];if(w==="p"||w==="P"){const C=So[w];return C(y,d.formatLong)}return y}).join("").match(Mo).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:Vo(y)};if(Ea[w])return{isToken:!0,value:y};if(w.match(Bo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});d.localize.preprocessor&&(k=d.localize.preprocessor(g,k));const b={firstWeekContainsDate:p,weekStartsOn:m,locale:d};return k.map(y=>{if(!y.isToken)return y.value;const w=y.value;(Eo(w)||Ao(w))&&Oo(w,t,String(s));const C=Ea[w[0]];return C(g,w,d.localize,b)}).join("")}function Vo(s){const t=s.match(Io);return t?t[1].replace(Lo,"'"):s}function jo(s,t){const e=Nt(s,void 0).getDay();return e===0?7:e}function Ho(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 Ia={},Cs={};function Oe(s,t){try{const e=(Ia[s]||(Ia[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Cs?Cs[e]:La(e,e.split(":"))}catch{if(s in Cs)return Cs[s];const e=s==null?void 0:s.match(Uo);return e?La(s,e.slice(1)):NaN}}const Uo=/([+-]\d\d):?(\d\d)?/;function La(s,t){const e=+(t[0]||0),i=+(t[1]||0),a=+(t[2]||0)/60;return Cs[s]=e*60+i>0?e*60+i+a:e*60-i-a}let Ts=class Hs extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Oe(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)),Fa(this),Ti(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Hs(...e,t):new Hs(Date.now(),t)}withTimeZone(t){return new Hs(+this,t)}getTimezoneOffset(){const t=-Oe(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ti(this),+this}[Symbol.for("constructDateFrom")](t){return new Hs(+new Date(t),this.timeZone)}};const Ba=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Ba.test(s))return;const t=s.replace(Ba,"$1UTC");Ts.prototype[t]&&(s.startsWith("get")?Ts.prototype[s]=function(){return this.internal[t]()}:(Ts.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),qo(this),+this},Ts.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ti(this),+this}))});function Ti(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Oe(s.timeZone,s)*60))}function qo(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()),Fa(s)}function Fa(s){const t=Oe(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const a=-new Date(+s).getTimezoneOffset(),n=-new Date(+i).getTimezoneOffset(),r=a-n,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const d=a-e;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=a>0?p.getSeconds():(p.getSeconds()-60)%60,g=Math.round(-(Oe(s.timeZone,s)*60))%60;(g||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+g),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+g+m));const k=Oe(s.timeZone,s),b=k>0?Math.floor(k):Math.ceil(k),y=-new Date(+s).getTimezoneOffset()-b,w=b!==e,C=y-d;if(w&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const M=Oe(s.timeZone,s),N=M>0?Math.floor(M):Math.ceil(M),U=b-N;U&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+U),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+U))}}let Ni=class Us extends Ts{static tz(t,...e){return e.length?new Us(...e,t):new Us(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),a=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,a]=this.tzComponents();return`${t} GMT${e}${i}${a} (${Ho(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"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,i,a]}withTimeZone(t){return new Us(+this,t)}[Symbol.for("constructDateFrom")](t){return new Us(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const zo=(s=window.pktTz)=>{const t=new Ni(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 ve(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 nt=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}`},be=s=>{if(!s)return null;const t=ve(s);return isNaN(t.getTime())?null:t},Va=(s,t)=>{const e=oe(s);return isNaN(e.getTime())?"":Fo(e,t)},oe=(s="",t)=>{const e=typeof s=="string"?ve(s):s;return!e||isNaN(e.getTime())?new Date:e},ye=(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},Ns=s=>{let t;return typeof s=="number"?t=new Ni(s,window.pktTz):t=new Ni(s,window.pktTz),t.setHours(12,0,0,0),t},Wo=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),Ro=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?oe(t):null,a=e?oe(e):null;return!(i&&s<i||a&&s>a)},Ko=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=nt(s);return t.includes(e)},Go=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ja=(s,t,e,i,a)=>!(!s||isNaN(s.getTime())||!Ro(s,t,e)||i&&Ko(s,i)||a&&Go(s,a)),Yo=(s,t,e,i,a)=>s.filter(n=>{const r=be(n);return r&&ja(r,t,e,i,a)}),Zo=s=>s.slice().sort((t,e)=>{const i=be(t),a=be(e);return!i||!a?0:i.getTime()-a.getTime()}),Xo=(s,t)=>{const e=be(s),i=be(t);return!e||!i?!1:e<=i},Ha=s=>{if(Array.isArray(s))return s;if(typeof s=="string")return s.split(",")},Jo=s=>s?ve(s):null,Qo=s=>{if(typeof s=="string")return s.split(",").map(t=>ve(t));if(Array.isArray(s))return s.map(t=>ve(t))},ts={csvToArray:Ha,stringToDate:Jo,stringsToDate:Qo},tl={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Pe={props:tl};var el=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,K=(s,t,e,i)=>{for(var a=i>1?void 0:i?sl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&el(t,e,a),a};let R=class extends Y{constructor(){super(...arguments),this.multiple=Pe.props.multiple.default,this.maxMultiple=Pe.props.maxMultiple.default,this.range=Pe.props.range.default,this.weeknumbers=Pe.props.weeknumbers.default,this.withcontrols=Pe.props.withcontrols.default,this.selected=[],this.earliest=Pe.props.earliest.default,this.latest=Pe.props.latest.default,this.excludedates=[],this.excludeweekdays=[],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.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,i){t==="selected"&&i&&this.convertSelected(),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>ve(t)),this.range&&this.selected.length===2){const t=Si({start:this._selected[0],end:this._selected[1]});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let i=0;i<t.length;i++){const a=t[i],n=a>this._selected[0]&&a<this._selected[1];e[nt(a)]=n}this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=ve(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?Ns(new Date):t}else this.currentmonth===null&&(this.currentmonth=Ns(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Ns(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var i,a,n,r,h;if(((i=t.target)==null?void 0:i.nodeName)==="INPUT"||((a=t.target)==null?void 0:a.nodeName)==="SELECT"||((n=t.target)==null?void 0:n.nodeName)==="BUTTON"&&!((h=(r=t.target)==null?void 0:r.dataset)!=null&&h.date))return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const d=this.focusedDate?oe(this.focusedDate):ye(this.year,this.month,1);let p=xi(d,e);if(p){let m=this.querySelector(`button[data-date="${nt(p)}"]`);if(m instanceof HTMLButtonElement){if(m.dataset.disabled){p=xi(p,e);let g=this.querySelector(`button[data-date="${nt(p)}"]`);for(;g&&g instanceof HTMLButtonElement&&g.dataset.disabled;)p=xi(p,e),g=this.querySelector(`button[data-date="${nt(p)}"]`);m=g}m instanceof HTMLButtonElement&&!m.dataset.disabled&&(this.focusedDate=nt(p),m.focus())}}}render(){return u`
|
|
197
|
+
</nav>`}};ei([o({type:String})],Je.prototype,"href",2),ei([o({type:String})],Je.prototype,"text",2),ei([o({type:String})],Je.prototype,"ariaLabel",2),Je=ei([j("pkt-backlink")],Je);const _a=6048e5,Or=864e5,wa=Symbol.for("constructDateFrom");function Qt(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&wa in s?s[wa](t):s instanceof Date?new s.constructor(t):new Date(t)}function Nt(s,t){return Qt(t||s,s)}function xi(s,t,e){const i=Nt(s,void 0);return isNaN(t)?Qt(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let Pr={};function si(){return Pr}function ws(s,t){var e,i,a,n;const r=si(),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??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.weekStartsOn)??0,d=Nt(s,t==null?void 0:t.in),p=d.getDay(),m=(p<h?7:0)+p-h;return d.setDate(d.getDate()-m),d.setHours(0,0,0,0),d}function ii(s,t){return ws(s,{...t,weekStartsOn:1})}function xa(s,t){const e=Nt(s,void 0),i=e.getFullYear(),a=Qt(e,0);a.setFullYear(i+1,0,4),a.setHours(0,0,0,0);const n=ii(a),r=Qt(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=ii(r);return e.getTime()>=n.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Sa(s){const t=Nt(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 Ca(s,...t){const e=Qt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ta(s,t){const e=Nt(s,void 0);return e.setHours(0,0,0,0),e}function Mr(s,t,e){const[i,a]=Ca(void 0,s,t),n=Ta(i),r=Ta(a),h=+n-Sa(n),d=+r-Sa(r);return Math.round((h-d)/Or)}function Dr(s,t){const e=xa(s),i=Qt(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ii(i)}function Ir(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Lr(s){return!(!Ir(s)&&typeof s!="number"||isNaN(+Nt(s)))}function Br(s,t){const[e,i]=Ca(s,t.start,t.end);return{start:e,end:i}}function Si(s,t){const{start:e,end:i}=Br(void 0,s);let a=+e>+i;const n=a?+e:+i,r=a?i:e;r.setHours(0,0,0,0);let h=1;const d=[];for(;+r<=n;)d.push(Qt(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return a?d.reverse():d}function Fr(s,t){const e=Nt(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Vr={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"}},jr=(s,t,e)=>{let i;const a=Vr[s];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ci(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const Hr={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ur={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qr={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zr={date:Ci({formats:Hr,defaultWidth:"full"}),time:Ci({formats:Ur,defaultWidth:"full"}),dateTime:Ci({formats:qr,defaultWidth:"full"})},Wr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rr=(s,t,e,i)=>Wr[s];function xs(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let a;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;a=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;a=s.values[h]||s.values[r]}const n=s.argumentCallback?s.argumentCallback(t):t;return a[n]}}const Kr={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Gr={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Yr={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"]},Zr={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"]},Xr={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"}},Jr={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"}},Qr=(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"},to={ordinalNumber:Qr,era:xs({values:Kr,defaultWidth:"wide"}),quarter:xs({values:Gr,defaultWidth:"wide",argumentCallback:s=>s-1}),month:xs({values:Yr,defaultWidth:"wide"}),day:xs({values:Zr,defaultWidth:"wide"}),dayPeriod:xs({values:Xr,defaultWidth:"wide",formattingValues:Jr,defaultFormattingWidth:"wide"})};function Ss(s){return(t,e={})=>{const i=e.width,a=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],n=t.match(a);if(!n)return null;const r=n[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],d=Array.isArray(h)?so(h,f=>f.test(r)):eo(h,f=>f.test(r));let p;p=s.valueCallback?s.valueCallback(d):d,p=e.valueCallback?e.valueCallback(p):p;const m=t.slice(r.length);return{value:p,rest:m}}}function eo(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function so(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function io(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const a=i[0],n=t.match(s.parsePattern);if(!n)return null;let r=s.valueCallback?s.valueCallback(n[0]):n[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(a.length);return{value:r,rest:h}}}const ao=/^(\d+)(th|st|nd|rd)?/i,no=/\d+/i,ro={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]},lo={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ho={any:[/1/i,/2/i,/3/i,/4/i]},co={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},po={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]},uo={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]},go={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},mo={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:io({matchPattern:ao,parsePattern:no,valueCallback:s=>parseInt(s,10)}),era:Ss({matchPatterns:ro,defaultMatchWidth:"wide",parsePatterns:oo,defaultParseWidth:"any"}),quarter:Ss({matchPatterns:lo,defaultMatchWidth:"wide",parsePatterns:ho,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Ss({matchPatterns:co,defaultMatchWidth:"wide",parsePatterns:po,defaultParseWidth:"any"}),day:Ss({matchPatterns:uo,defaultMatchWidth:"wide",parsePatterns:fo,defaultParseWidth:"any"}),dayPeriod:Ss({matchPatterns:go,defaultMatchWidth:"any",parsePatterns:mo,defaultParseWidth:"any"})},bo={code:"en-US",formatDistance:jr,formatLong:zr,formatRelative:Rr,localize:to,match:vo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yo(s,t){const e=Nt(s,void 0);return Mr(e,Fr(e))+1}function ko(s,t){const e=Nt(s,void 0),i=+ii(e)-+Dr(e);return Math.round(i/_a)+1}function Na(s,t){var e,i,a,n;const r=Nt(s,t==null?void 0:t.in),h=r.getFullYear(),d=si(),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)??d.firstWeekContainsDate??((n=(a=d.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,m=Qt((t==null?void 0:t.in)||s,0);m.setFullYear(h+1,0,p),m.setHours(0,0,0,0);const f=ws(m,t),k=Qt((t==null?void 0:t.in)||s,0);k.setFullYear(h,0,p),k.setHours(0,0,0,0);const b=ws(k,t);return+r>=+f?h+1:+r>=+b?h:h-1}function $o(s,t){var e,i,a,n;const r=si(),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??((n=(a=r.locale)==null?void 0:a.options)==null?void 0:n.firstWeekContainsDate)??1,d=Na(s,t),p=Qt((t==null?void 0:t.in)||s,0);return p.setFullYear(d,0,h),p.setHours(0,0,0,0),ws(p,t)}function Aa(s,t){const e=Nt(s,t==null?void 0:t.in),i=+ws(e,t)-+$o(e,t);return Math.round(i/_a)+1}function R(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const me={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return R(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):R(e+1,2)},d(s,t){return R(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 R(s.getHours()%12||12,t.length)},H(s,t){return R(s.getHours(),t.length)},m(s,t){return R(s.getMinutes(),t.length)},s(s,t){return R(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),a=Math.trunc(i*Math.pow(10,e-3));return R(a,t.length)}},Qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ea={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(),a=i>0?i:1-i;return e.ordinalNumber(a,{unit:"year"})}return me.y(s,t)},Y:function(s,t,e,i){const a=Na(s,i),n=a>0?a:1-a;if(t==="YY"){const r=n%100;return R(r,2)}return t==="Yo"?e.ordinalNumber(n,{unit:"year"}):R(n,t.length)},R:function(s,t){const e=xa(s);return R(e,t.length)},u:function(s,t){const e=s.getFullYear();return R(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 R(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 R(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 me.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 R(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 a=Aa(s,i);return t==="wo"?e.ordinalNumber(a,{unit:"week"}):R(a,t.length)},I:function(s,t,e){const i=ko(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):R(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):me.d(s,t)},D:function(s,t,e){const i=yo(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):R(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 a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(n);case"ee":return R(n,2);case"eo":return e.ordinalNumber(n,{unit:"day"});case"eee":return e.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(a,{width:"short",context:"formatting"});case"eeee":default:return e.day(a,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const a=s.getDay(),n=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(n);case"cc":return R(n,t.length);case"co":return e.ordinalNumber(n,{unit:"day"});case"ccc":return e.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(a,{width:"narrow",context:"standalone"});case"cccccc":return e.day(a,{width:"short",context:"standalone"});case"cccc":default:return e.day(a,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return R(a,t.length);case"io":return e.ordinalNumber(a,{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 a;switch(i===12?a=Qe.noon:i===0?a=Qe.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let a;switch(i>=17?a=Qe.evening:i>=12?a=Qe.afternoon:i>=4?a=Qe.morning:a=Qe.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(a,{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 me.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):me.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):R(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):R(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):me.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):me.s(s,t)},S:function(s,t){return me.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Pa(i);case"XXXX":case"XX":return Ee(i);case"XXXXX":case"XXX":default:return Ee(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return Pa(i);case"xxxx":case"xx":return Ee(i);case"xxxxx":case"xxx":default:return Ee(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Oa(i,":");case"OOOO":default:return"GMT"+Ee(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Oa(i,":");case"zzzz":default:return"GMT"+Ee(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return R(i,t.length)},T:function(s,t,e){return R(+s,t.length)}};function Oa(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=Math.trunc(i/60),n=i%60;return n===0?e+String(a):e+String(a)+t+R(n,2)}function Pa(s,t){return s%60===0?(s>0?"-":"+")+R(Math.abs(s)/60,2):Ee(s,t)}function Ee(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),a=R(Math.trunc(i/60),2),n=R(i%60,2);return e+a+t+n}const Ma=(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"})}},Da=(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"})}},_o=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],a=e[2];if(!a)return Ma(s,t);let n;switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"});break}return n.replace("{{date}}",Ma(i,t)).replace("{{time}}",Da(a,t))},wo={p:Da,P:_o},xo=/^D+$/,So=/^Y+$/,Co=["D","DD","YY","YYYY"];function To(s){return xo.test(s)}function No(s){return So.test(s)}function Ao(s,t,e){const i=Eo(s,t,e);if(console.warn(i),Co.includes(s))throw new RangeError(i)}function Eo(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 Oo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Po=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mo=/^'([^]*?)'?$/,Do=/''/g,Io=/[a-zA-Z]/;function Lo(s,t,e){var i,a,n,r;const h=si(),d=h.locale??bo,p=h.firstWeekContainsDate??((a=(i=h.locale)==null?void 0:i.options)==null?void 0:a.firstWeekContainsDate)??1,m=h.weekStartsOn??((r=(n=h.locale)==null?void 0:n.options)==null?void 0:r.weekStartsOn)??0,f=Nt(s,void 0);if(!Lr(f))throw new RangeError("Invalid time value");let k=t.match(Po).map(y=>{const w=y[0];if(w==="p"||w==="P"){const C=wo[w];return C(y,d.formatLong)}return y}).join("").match(Oo).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:Bo(y)};if(Ea[w])return{isToken:!0,value:y};if(w.match(Io))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});d.localize.preprocessor&&(k=d.localize.preprocessor(f,k));const b={firstWeekContainsDate:p,weekStartsOn:m,locale:d};return k.map(y=>{if(!y.isToken)return y.value;const w=y.value;(No(w)||To(w))&&Ao(w,t,String(s));const C=Ea[w[0]];return C(f,w,d.localize,b)}).join("")}function Bo(s){const t=s.match(Mo);return t?t[1].replace(Do,"'"):s}function Fo(s,t){const e=Nt(s,void 0).getDay();return e===0?7:e}function Vo(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 Ia={},Cs={};function Oe(s,t){try{const e=(Ia[s]||(Ia[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Cs?Cs[e]:La(e,e.split(":"))}catch{if(s in Cs)return Cs[s];const e=s==null?void 0:s.match(jo);return e?La(s,e.slice(1)):NaN}}const jo=/([+-]\d\d):?(\d\d)?/;function La(s,t){const e=+(t[0]||0),i=+(t[1]||0),a=+(t[2]||0)/60;return Cs[s]=e*60+i>0?e*60+i+a:e*60-i-a}let Ts=class Hs extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Oe(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)),Fa(this),Ti(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Hs(...e,t):new Hs(Date.now(),t)}withTimeZone(t){return new Hs(+this,t)}getTimezoneOffset(){const t=-Oe(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ti(this),+this}[Symbol.for("constructDateFrom")](t){return new Hs(+new Date(t),this.timeZone)}};const Ba=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!Ba.test(s))return;const t=s.replace(Ba,"$1UTC");Ts.prototype[t]&&(s.startsWith("get")?Ts.prototype[s]=function(){return this.internal[t]()}:(Ts.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),Ho(this),+this},Ts.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ti(this),+this}))});function Ti(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-Oe(s.timeZone,s)*60))}function Ho(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()),Fa(s)}function Fa(s){const t=Oe(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const a=-new Date(+s).getTimezoneOffset(),n=-new Date(+i).getTimezoneOffset(),r=a-n,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const d=a-e;d&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+d);const p=new Date(+s);p.setUTCSeconds(0);const m=a>0?p.getSeconds():(p.getSeconds()-60)%60,f=Math.round(-(Oe(s.timeZone,s)*60))%60;(f||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+f),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+f+m));const k=Oe(s.timeZone,s),b=k>0?Math.floor(k):Math.ceil(k),y=-new Date(+s).getTimezoneOffset()-b,w=b!==e,C=y-d;if(w&&C){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+C);const M=Oe(s.timeZone,s),T=M>0?Math.floor(M):Math.ceil(M),V=b-T;V&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+V),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+V))}}let Ni=class Us extends Ts{static tz(t,...e){return e.length?new Us(...e,t):new Us(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),a=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,a]=this.tzComponents();return`${t} GMT${e}${i}${a} (${Vo(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"),a=String(Math.abs(t)%60).padStart(2,"0");return[e,i,a]}withTimeZone(t){return new Us(+this,t)}[Symbol.for("constructDateFrom")](t){return new Us(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Uo=(s=window.pktTz)=>{const t=new Ni(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 ve(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 nt=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}`},be=s=>{if(!s)return null;const t=ve(s);return isNaN(t.getTime())?null:t},Va=(s,t)=>{const e=oe(s);return isNaN(e.getTime())?"":Lo(e,t)},oe=(s="",t)=>{const e=typeof s=="string"?ve(s):s;return!e||isNaN(e.getTime())?new Date:e},ye=(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},Ns=s=>{let t;return typeof s=="number"?t=new Ni(s,window.pktTz):t=new Ni(s,window.pktTz),t.setHours(12,0,0,0),t},qo=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),zo=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?oe(t):null,a=e?oe(e):null;return!(i&&s<i||a&&s>a)},Wo=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=nt(s);return t.includes(e)},Ro=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ja=(s,t,e,i,a)=>!(!s||isNaN(s.getTime())||!zo(s,t,e)||i&&Wo(s,i)||a&&Ro(s,a)),Ko=(s,t,e,i,a)=>s.filter(n=>{const r=be(n);return r&&ja(r,t,e,i,a)}),Go=s=>s.slice().sort((t,e)=>{const i=be(t),a=be(e);return!i||!a?0:i.getTime()-a.getTime()}),Yo=(s,t)=>{const e=be(s),i=be(t);return!e||!i?!1:e<=i},Ha=s=>{if(Array.isArray(s))return s;if(typeof s=="string")return s.split(",")},Zo=s=>s?ve(s):null,Xo=s=>{if(typeof s=="string")return s.split(",").map(t=>ve(t));if(Array.isArray(s))return s.map(t=>ve(t))},ts={csvToArray:Ha,stringToDate:Zo,stringsToDate:Xo},Jo={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Pe={props:Jo};var Qo=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,G=(s,t,e,i)=>{for(var a=i>1?void 0:i?tl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Qo(t,e,a),a};let K=class extends Y{constructor(){super(...arguments),this.multiple=Pe.props.multiple.default,this.maxMultiple=Pe.props.maxMultiple.default,this.range=Pe.props.range.default,this.weeknumbers=Pe.props.weeknumbers.default,this.withcontrols=Pe.props.withcontrols.default,this.selected=[],this.earliest=Pe.props.earliest.default,this.latest=Pe.props.latest.default,this.excludedates=[],this.excludeweekdays=[],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.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(t,e,i){t==="selected"&&i&&this.convertSelected(),super.attributeChangedCallback(t,e,i)}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(t=>ve(t)),this.range&&this.selected.length===2){const t=Si({start:this._selected[0],end:this._selected[1]});if(this.inRange={},Array.isArray(t)&&t.length){const e={};for(let i=0;i<t.length;i++){const a=t[i],n=a>this._selected[0]&&a<this._selected[1];e[nt(a)]=n}this.inRange=e}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=ve(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?Ns(new Date):t}else this.currentmonth===null&&(this.currentmonth=Ns(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=Ns(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){switch(t.key){case"ArrowLeft":this.handleArrowKey(t,-1);break;case"ArrowRight":this.handleArrowKey(t,1);break;case"ArrowUp":this.handleArrowKey(t,-7);break;case"ArrowDown":this.handleArrowKey(t,7);break}}handleArrowKey(t,e){var i,a,n,r,h;if(((i=t.target)==null?void 0:i.nodeName)==="INPUT"||((a=t.target)==null?void 0:a.nodeName)==="SELECT"||((n=t.target)==null?void 0:n.nodeName)==="BUTTON"&&!((h=(r=t.target)==null?void 0:r.dataset)!=null&&h.date))return;t.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const d=this.focusedDate?oe(this.focusedDate):ye(this.year,this.month,1);let p=xi(d,e);if(p){let m=this.querySelector(`button[data-date="${nt(p)}"]`);if(m instanceof HTMLButtonElement){if(m.dataset.disabled){p=xi(p,e);let f=this.querySelector(`button[data-date="${nt(p)}"]`);for(;f&&f instanceof HTMLButtonElement&&f.dataset.disabled;)p=xi(p,e),f=this.querySelector(`button[data-date="${nt(p)}"]`);m=f}m instanceof HTMLButtonElement&&!m.dataset.disabled&&(this.focusedDate=nt(p),m.focus())}}}render(){return u`
|
|
198
198
|
<div
|
|
199
199
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
200
200
|
@focusout=${this.closeEvent}
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
/>
|
|
276
276
|
</div> `):t.push(u`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
277
277
|
${this.monthStrings[this.month]} ${this.year}
|
|
278
|
-
</div>`),t}renderDayView(t,e){var i;const a=ye(this.year,this.month,t),n=nt(a),r=n===nt(e),h=this.selected.includes(n),d=
|
|
278
|
+
</div>`),t}renderDayView(t,e){var i;const a=ye(this.year,this.month,t),n=nt(a),r=n===nt(e),h=this.selected.includes(n),d=qo(a),p=this.isExcluded(a)||!h&&this.multiple&&this.maxMultiple>0&&this.selected.length>=this.maxMultiple,m=this.focusedDate?this.focusedDate===n&&!p?"0":"-1":!p&&this.tabIndexSet===0||this.tabIndexSet===t?"0":"-1";m==="0"&&(this.tabIndexSet=t),this.selectableDates.push({currentDateISO:n,isDisabled:p,tabindex:m});const f={"pkt-cal-today":r,"pkt-cal-selected":h,"pkt-cal-in-range":this.inRange[n],"pkt-cal-excluded":this.isExcluded(a),"pkt-cal-in-range-first":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&n===this.selected[0],"pkt-cal-in-range-last":this.range&&this.selected.length===2&&n===this.selected[1],"pkt-cal-range-hover":this.rangeHovered!==null&&n===nt(this.rangeHovered)},k={"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":h,"pkt-calendar__date--disabled":p,"pkt-calendar__date--in-range":this.inRange[n],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&n===nt(this.rangeHovered),"pkt-calendar__date--range-start":this.range&&(this.selected.length===2||this.rangeHovered!==null)&&n===this.selected[0],"pkt-calendar__date--range-end":this.range&&this.selected.length===2&&n===this.selected[1]};return u`<td class=${O(f)}>
|
|
279
279
|
<button
|
|
280
280
|
type="button"
|
|
281
281
|
aria-pressed=${h?"true":"false"}
|
|
@@ -292,23 +292,23 @@
|
|
|
292
292
|
>
|
|
293
293
|
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
294
294
|
</button>
|
|
295
|
-
</td>`}renderCalendarBody(){const t=
|
|
295
|
+
</td>`}renderCalendarBody(){const t=Uo(),e=ye(this.year,this.month,1),i=ye(this.year,this.month+1,0),a=(e.getDay()+6)%7,n=i.getDate(),r=Math.ceil((n+a)/7),h=ye(this.year,this.month,0).getDate();let d=1;this.week=Aa(ye(this.year,this.month,1));const p=[];for(let m=0;m<r;m++){const f=[];this.weeknumbers&&f.push(u`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let k=1;k<8;k++)if(m===0&&k<a+1){const b=h-(a-k);f.push(u`<td class="pkt-cal-other">
|
|
296
296
|
<div
|
|
297
297
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
298
298
|
data-disabled="disabled"
|
|
299
299
|
>
|
|
300
300
|
<span class="pkt-btn__text pkt-txt-14-light">${b}</span>
|
|
301
301
|
</div>
|
|
302
|
-
</td>`)}else d>n?(
|
|
302
|
+
</td>`)}else d>n?(f.push(u`<td class="pkt-cal-other">
|
|
303
303
|
<div
|
|
304
304
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
305
305
|
data-disabled="disabled"
|
|
306
306
|
>
|
|
307
307
|
<span class="pkt-btn__text pkt-txt-14-light">${d-n}</span>
|
|
308
308
|
</div>
|
|
309
|
-
</td>`),d++):(
|
|
310
|
-
${
|
|
311
|
-
</tr>`)}return p}isExcluded(t){const e=this.excludedates.map(i=>typeof i=="string"?i:nt(i));return!ja(t,this.earliest,this.latest,e,this.excludeweekdays)}isPrevMonthAllowed(){const t=ye(this.year,this.month,0);return!(this.earliest&&oe(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){const t=ye(this.month===11?this.year+1:this.year,this.month===11?0:this.month+1,1);return!(this.latest&&oe(this.latest)<t)}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=Ns(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}isRangeAllowed(t){let e=!0;if(this._selected.length===1){const i=Si({start:this._selected[0],end:t});if(Array.isArray(i)&&i.length)for(let a=0;a<i.length;a++)this.excludedates.forEach(n=>{n>this._selected[0]&&n<t&&(e=!1)}),this.excludeweekdays.includes(
|
|
309
|
+
</td>`),d++):(f.push(this.renderDayView(d,t)),d++);p.push(u`<tr class="pkt-cal-week-row" role="row">
|
|
310
|
+
${f}
|
|
311
|
+
</tr>`)}return p}isExcluded(t){const e=this.excludedates.map(i=>typeof i=="string"?i:nt(i));return!ja(t,this.earliest,this.latest,e,this.excludeweekdays)}isPrevMonthAllowed(){const t=ye(this.year,this.month,0);return!(this.earliest&&oe(this.earliest)>t)}prevMonth(){const t=this.month===0?11:this.month-1,e=this.month===0?this.year-1:this.year;this.changeMonth(e,t)}isNextMonthAllowed(){const t=ye(this.month===11?this.year+1:this.year,this.month===11?0:this.month+1,1);return!(this.latest&&oe(this.latest)<t)}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=Ns(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}isRangeAllowed(t){let e=!0;if(this._selected.length===1){const i=Si({start:this._selected[0],end:t});if(Array.isArray(i)&&i.length)for(let a=0;a<i.length;a++)this.excludedates.forEach(n=>{n>this._selected[0]&&n<t&&(e=!1)}),this.excludeweekdays.includes(Fo(i[a]).toString())&&(e=!1)}return e}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}addToSelected(t){this.selected.includes(nt(t))||(this.selected=[...this.selected,nt(t)],this._selected=[...this._selected,t],this.range&&this.selected.length===2&&(this.convertSelected(),this.close()))}removeFromSelected(t){if(this.selected.length===1)this.emptySelected();else{const e=this.selected.indexOf(nt(t)),i=[...this.selected],a=[...this._selected];i.splice(e,1),a.splice(e,1),this.selected=i,this._selected=a}}toggleSelected(t){const e=nt(t);this.selected.includes(e)?this.removeFromSelected(t):this.maxMultiple&&this.selected.length>=this.maxMultiple||this.addToSelected(t)}handleRangeSelect(t){const e=nt(t);return this.selected.includes(e)?this.selected.indexOf(e)===0?this.emptySelected():this.removeFromSelected(t):this.selected.length>1?(this.emptySelected(),this.addToSelected(t)):(this.selected.length===1&&!this.isRangeAllowed(t)&&this.emptySelected(),this.selected.length===1&&this._selected[0]>t&&this.emptySelected(),this.addToSelected(t)),Promise.resolve()}handleRangeHover(t){if(this.range&&this._selected.length===1&&this.isRangeAllowed(t)&&this._selected[0]<t){this.rangeHovered=t,this.inRange={};const e=Si({start:this._selected[0],end:t});if(Array.isArray(e)&&e.length)for(let i=0;i<e.length;i++){const a=e[i],n=a>this._selected[0]&&a<t;this.inRange[nt(a)]=n}}else this.rangeHovered=null}handleDateSelect(t){if(t)return this.range?this.handleRangeSelect(t):this.multiple?this.toggleSelected(t):(this.selected.includes(nt(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=nt(Ns(new Date)),e=this.querySelector(`button[data-date="${t}"]`);if(e instanceof HTMLButtonElement)this.focusedDate=t,e.focus();else{const i=this.selectableDates.find(a=>!a.isDisabled);if(i){const a=this.querySelector(`button[data-date="${i.currentDateISO}"]`);a instanceof HTMLButtonElement&&(this.focusedDate=i.currentDateISO,a.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}))}};G([o({type:Boolean})],K.prototype,"multiple",2),G([o({type:Number})],K.prototype,"maxMultiple",2),G([o({type:Boolean})],K.prototype,"range",2),G([o({type:Boolean})],K.prototype,"weeknumbers",2),G([o({type:Boolean})],K.prototype,"withcontrols",2),G([o({converter:ts.csvToArray})],K.prototype,"selected",2),G([o({type:String})],K.prototype,"earliest",2),G([o({type:String})],K.prototype,"latest",2),G([o({converter:ts.stringsToDate})],K.prototype,"excludedates",2),G([o({converter:ts.csvToArray})],K.prototype,"excludeweekdays",2),G([o({converter:ts.stringToDate})],K.prototype,"currentmonth",2),G([o({type:Array})],K.prototype,"dayStrings",2),G([o({type:Array})],K.prototype,"dayStringsLong",2),G([o({type:Array})],K.prototype,"monthStrings",2),G([o({type:String})],K.prototype,"weekString",2),G([o({type:String})],K.prototype,"prevMonthString",2),G([o({type:String})],K.prototype,"nextMonthString",2),G([o({type:Array})],K.prototype,"_selected",2),G([o({type:Number})],K.prototype,"year",2),G([o({type:Number})],K.prototype,"month",2),G([o({type:Number})],K.prototype,"week",2),G([o({type:Date})],K.prototype,"rangeHovered",2),G([F()],K.prototype,"inRange",2),G([F()],K.prototype,"focusedDate",2),G([F()],K.prototype,"selectableDates",2),G([F()],K.prototype,"currentmonthtouched",2),G([F()],K.prototype,"tabIndexSet",2),K=G([j("pkt-calendar")],K);const el={size:{default:"medium"},skin:{default:"blue"},closeTag:{default:!1},type:{default:"button"}},ai={props:el};var sl=Object.defineProperty,il=Object.getOwnPropertyDescriptor,te=(s,t,e,i)=>{for(var a=i>1?void 0:i?il(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&sl(t,e,a),a};let Gt=class extends Y{constructor(){super(),this.defaultSlot=A(),this.closeTag=ai.props.closeTag.default,this.size=ai.props.size.default,this.skin=ai.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=ai.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:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0,composed:!0}))},this.slotController=new at(this,this.defaultSlot),this._isClosed=!1}firstUpdated(t){var e,i;if(super.firstUpdated(t),this.closeTag&&!this.ariaLabel){const a=(i=(e=this.defaultSlot.value)==null?void 0:e.textContent)==null?void 0:i.trim();a&&(this._ariaDescription=`Klikk for å fjerne ${a}`)}}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`
|
|
312
312
|
<button
|
|
313
313
|
class=${O(e)}
|
|
314
314
|
type=${this.type}
|
|
@@ -317,15 +317,15 @@
|
|
|
317
317
|
aria-description=${S(this._ariaDescription||void 0)}
|
|
318
318
|
>
|
|
319
319
|
${this.iconName&&u`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
320
|
-
<span ${
|
|
320
|
+
<span ${E(this.defaultSlot)}></span>
|
|
321
321
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
322
322
|
</button>
|
|
323
323
|
`:u`
|
|
324
324
|
<span class=${O(t)}>
|
|
325
325
|
${this.iconName&&u`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
|
|
326
|
-
<span ${
|
|
326
|
+
<span ${E(this.defaultSlot)}></span>
|
|
327
327
|
</span>
|
|
328
|
-
`}};te([o({type:Boolean,reflect:!0})],
|
|
328
|
+
`}};te([o({type:Boolean,reflect:!0})],Gt.prototype,"closeTag",2),te([o({type:String,reflect:!0})],Gt.prototype,"size",2),te([o({type:String,reflect:!0})],Gt.prototype,"skin",2),te([o({type:String,reflect:!0})],Gt.prototype,"textStyle",2),te([o({type:String,reflect:!0})],Gt.prototype,"iconName",2),te([o({type:String})],Gt.prototype,"type",2),te([o({type:String})],Gt.prototype,"ariaLabel",2),te([F()],Gt.prototype,"_isClosed",2),te([F()],Gt.prototype,"_ariaDescription",2),Gt=te([j("pkt-tag")],Gt);var al=Object.defineProperty,nl=Object.getOwnPropertyDescriptor,As=(s,t,e,i)=>{for(var a=i>1?void 0:i?nl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&al(t,e,a),a};let Me=class extends Ys{constructor(){super(...arguments),this.size=void 0,this.level=2,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")&&this.updateHostClasses()}updated(t){super.updated(t),t.has("level")&&(this.setLevel(this.level),this.hasAttribute("size")||(this.size=this.defaultSizeForLevel)),!this.hasAttribute("size")&&(t.has("level")||this.size===void 0)&&(this.size=this.defaultSizeForLevel),(t.has("size")||t.has("visuallyHidden")||t.has("align"))&&this.updateHostClasses()}setLevel(t){t>=1&&t<=6?(this.level=t,this.setAttribute("aria-level",String(t))):console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`)}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"}}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return u`<slot></slot>`}};As([o({type:String,reflect:!0})],Me.prototype,"size",2),As([o({type:Number,reflect:!0})],Me.prototype,"level",2),As([o({type:Boolean,reflect:!0})],Me.prototype,"visuallyHidden",2),As([o({type:String,reflect:!0})],Me.prototype,"align",2),Me=As([j("pkt-heading")],Me);const rl={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},es={props:rl};var ol=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,ft=(s,t,e,i)=>{for(var a=i>1?void 0:i?ll(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&ol(t,e,a),a};let lt=class extends Y{constructor(){super(),this.defaultSlot=A(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=es.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=es.props.padding.default,this.skin=es.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new at(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},a=((t=this.ariaLabel)==null?void 0:t.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),n=((e=this.ariaLabel)==null?void 0:e.trim())||(this.heading?this.heading:"kort");return u`
|
|
329
329
|
<article
|
|
330
330
|
class=${O(i)}
|
|
331
331
|
aria-label=${S(this.clickCardLink?a:n)}
|
|
@@ -403,7 +403,7 @@
|
|
|
403
403
|
</div>
|
|
404
404
|
`:$}
|
|
405
405
|
`}renderSlot(){return u`
|
|
406
|
-
${this.defaultSlot&&u`<section class="pkt-card__content" ${
|
|
406
|
+
${this.defaultSlot&&u`<section class="pkt-card__content" ${E(this.defaultSlot)}></section>`}
|
|
407
407
|
`}renderMetadata(){return u`
|
|
408
408
|
${this.metaLead||this.metaTrail?u`
|
|
409
409
|
<footer class="pkt-card__metadata">
|
|
@@ -411,11 +411,11 @@
|
|
|
411
411
|
${this.metaTrail?u`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`:$}
|
|
412
412
|
</footer>
|
|
413
413
|
`:$}
|
|
414
|
-
`}};
|
|
414
|
+
`}};ft([o({type:String})],lt.prototype,"ariaLabel",2),ft([o({type:String})],lt.prototype,"metaLead",2),ft([o({type:Boolean})],lt.prototype,"borderOnHover",2),ft([o({type:String,reflect:!0})],lt.prototype,"clickCardLink",2),ft([o({type:String})],lt.prototype,"metaTrail",2),ft([o({type:String})],lt.prototype,"layout",2),ft([o({type:String})],lt.prototype,"heading",2),ft([o({type:Number})],lt.prototype,"headinglevel",2),ft([o({type:Object})],lt.prototype,"image",2),ft([o({type:String})],lt.prototype,"imageShape",2),ft([o({type:Boolean})],lt.prototype,"openLinkInNewTab",2),ft([o({type:String})],lt.prototype,"padding",2),ft([o({type:String,converter:{fromAttribute:s=>{const t=es.props.skin.type;return s&&t.includes(s)?s:(s&&!t.includes(s)&&console.warn(`Invalid skin value "${s}". Using default skin "${es.props.skin.default}".`),es.props.skin.default)},toAttribute:s=>s}})],lt.prototype,"skin",2),ft([o({type:String})],lt.prototype,"subheading",2),ft([o({type:String})],lt.prototype,"tagPosition",2),ft([o({type:Array})],lt.prototype,"tags",2),lt=ft([j("pkt-card")],lt);/**
|
|
415
415
|
* @license
|
|
416
416
|
* Copyright 2017 Google LLC
|
|
417
417
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
418
|
-
*/const Ua=(s,t,e)=>{const i=new Map;for(let a=t;a<=e;a++)i.set(s[a],a);return i},Ai=Ce(class extends Ye{constructor(s){if(super(s),s.type!==Kt.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 a=[],n=[];let r=0;for(const h of s)a[r]=i?i(h,r):r,n[r]=e(h,r),r++;return{values:n,keys:a}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const a=pr(s),{values:n,keys:r}=this.dt(t,e,i);if(!Array.isArray(a))return this.ut=r,n;const h=this.ut??(this.ut=[]),d=[];let p,m,g=0,k=a.length-1,b=0,y=n.length-1;for(;g<=k&&b<=y;)if(a[g]===null)g++;else if(a[k]===null)k--;else if(h[g]===r[b])d[b]=Te(a[g],n[b]),g++,b++;else if(h[k]===r[y])d[y]=Te(a[k],n[y]),k--,y--;else if(h[g]===r[y])d[y]=Te(a[g],n[y]),ys(s,d[y+1],a[g]),g++,y--;else if(h[k]===r[b])d[b]=Te(a[k],n[b]),ys(s,a[g],a[k]),k--,b++;else if(p===void 0&&(p=Ua(r,b,y),m=Ua(h,g,k)),p.has(h[g]))if(p.has(h[k])){const w=m.get(r[b]),C=w!==void 0?a[w]:null;if(C===null){const M=ys(s,a[g]);Te(M,n[b]),d[b]=M}else d[b]=Te(C,n[b]),ys(s,a[g],C),a[w]=null;b++}else yi(a[k]),k--;else yi(a[g]),g++;for(;b<=y;){const w=ys(s,d[y+1]);Te(w,n[b]),d[b++]=w}for(;g<=k;){const w=a[g++];w!==null&&yi(w)}return this.ut=r,ba(s,d),_t}}),qa=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),ke=()=>{const s=qa(),t=qa();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},cl={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}},At={props:cl};var pl={},za;function ul(){return za||(za=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,a=new WeakMap,n=new WeakMap,r=new WeakMap,h=new WeakMap,d=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,k=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,C={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},M=(f,c)=>{for(let v in C){c[v]=null;let _=null;const I=C[v];Object.defineProperty(c,v,{get(){return _},set(H){_=H,f.isConnected?rt(f,I,H):m.set(f,c)}})}};function N(f){const c=a.get(f),{form:v}=c;pe(f,v,c),Tt(f,c.labels)}const U=(f,c=!1)=>{const v=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(H){return a.has(H)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=v.nextNode();const I=!c||f.disabled;for(;_;)_.formDisabledCallback&&I&&Ft(_,f.disabled),_=v.nextNode()},E={attributes:!0,attributeFilter:["disabled","name"]},G=ue()?new MutationObserver(f=>{for(const c of f){const v=c.target;if(c.attributeName==="disabled"&&(v.constructor.formAssociated?Ft(v,v.hasAttribute("disabled")):v.localName==="fieldset"&&U(v)),c.attributeName==="name"&&v.constructor.formAssociated){const _=a.get(v),I=p.get(v);_.setFormValue(I)}}}):{};function J(f){f.forEach(c=>{const{addedNodes:v,removedNodes:_}=c,I=Array.from(v),H=Array.from(_);I.forEach(q=>{var jt;if(a.has(q)&&q.constructor.formAssociated&&N(q),m.has(q)){const mt=m.get(q);Object.keys(C).filter(Ht=>mt[Ht]!==null).forEach(Ht=>{rt(q,C[Ht],mt[Ht])}),m.delete(q)}if(w.has(q)){const mt=w.get(q);rt(q,"internals-valid",mt.validity.valid.toString()),rt(q,"internals-invalid",(!mt.validity.valid).toString()),rt(q,"aria-invalid",(!mt.validity.valid).toString()),w.delete(q)}if(q.localName==="form"){const mt=d.get(q),Ht=document.createTreeWalker(q,NodeFilter.SHOW_ELEMENT,{acceptNode(qi){return a.has(qi)&&qi.constructor.formAssociated&&!(mt&&mt.has(qi))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let js=Ht.nextNode();for(;js;)N(js),js=Ht.nextNode()}q.localName==="fieldset"&&((jt=G.observe)===null||jt===void 0||jt.call(G,q,E),U(q,!0))}),H.forEach(q=>{const jt=a.get(q);jt&&i.get(jt)&&Vt(jt),h.has(q)&&h.get(q).disconnect()})})}function Lt(f){f.forEach(c=>{const{removedNodes:v}=c;v.forEach(_=>{const I=b.get(c.target);a.has(_)&&ze(_),I.disconnect()})})}const Bt=f=>{var c,v;const _=new MutationObserver(Lt);!((c=window==null?void 0:window.ShadyDOM)===null||c===void 0)&&c.inUse&&f.mode&&f.host&&(f=f.host),(v=_.observe)===null||v===void 0||v.call(_,f,{childList:!0}),b.set(f,_)};ue()&&new MutationObserver(J);const it={childList:!0,subtree:!0},rt=(f,c,v)=>{f.getAttribute(c)!==v&&f.setAttribute(c,v)},Ft=(f,c)=>{f.toggleAttribute("internals-disabled",c),c?rt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[c])},Vt=f=>{i.get(f).forEach(c=>{c.remove()}),i.set(f,[])},ot=(f,c)=>{const v=document.createElement("input");return v.type="hidden",v.name=f.getAttribute("name"),f.after(v),i.get(c).push(v),v},L=(f,c)=>{var v;i.set(c,[]),(v=G.observe)===null||v===void 0||v.call(G,f,E)},Tt=(f,c)=>{if(c.length){Array.from(c).forEach(_=>_.addEventListener("click",f.click.bind(f)));let v=c[0].id;c[0].id||(v=`${c[0].htmlFor}_Label`,c[0].id=v),rt(f,"aria-labelledby",v)}},ne=f=>{const c=Array.from(f.elements).filter(H=>!H.tagName.includes("-")&&H.validity).map(H=>H.validity.valid),v=d.get(f)||[],_=Array.from(v).filter(H=>H.isConnected).map(H=>a.get(H).validity.valid),I=[...c,..._].includes(!1);f.toggleAttribute("internals-invalid",I),f.toggleAttribute("internals-valid",!I)},ce=f=>{ne(Rt(f.target))},re=f=>{ne(Rt(f.target))},Ue=f=>{const c=["button[type=submit]","input[type=submit]","button:not([type])"].map(v=>`${v}:not([disabled])`).map(v=>`${v}:not([form])${f.id?`,${v}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",v=>{if(v.target.closest(c)){const _=d.get(f);if(f.noValidate)return;_.size&&Array.from(_).reverse().map(I=>a.get(I).reportValidity()).includes(!1)&&v.preventDefault()}})},ds=f=>{const c=d.get(f.target);c&&c.size&&c.forEach(v=>{v.constructor.formAssociated&&v.formResetCallback&&v.formResetCallback.apply(v)})},pe=(f,c,v)=>{if(c){const _=d.get(c);if(_)_.add(f);else{const I=new Set;I.add(f),d.set(c,I),Ue(c),c.addEventListener("reset",ds),c.addEventListener("input",ce),c.addEventListener("change",re)}r.set(c,{ref:f,internals:v}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[c])},0),ne(c)}},Rt=f=>{let c=f.parentNode;return c&&c.tagName!=="FORM"&&(c=Rt(c)),c},ct=(f,c,v=DOMException)=>{if(!f.constructor.formAssociated)throw new v(c)},qe=(f,c,v)=>{const _=d.get(f);return _&&_.size&&_.forEach(I=>{a.get(I)[v]()||(c=!1)}),c},ze=f=>{if(f.constructor.formAssociated){const c=a.get(f),{labels:v,form:_}=c;Tt(f,v),pe(f,_,c)}};function ue(){return typeof MutationObserver<"u"}class Vi{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 li=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),ji=(f,c,v)=>(f.valid=hi(c),Object.keys(c).forEach(_=>f[_]=c[_]),v&&ne(v),f),hi=f=>{let c=!0;for(let v in f)v!=="valid"&&f[v]!==!1&&(c=!1);return c},cs=new WeakMap;function ps(f,c){f.toggleAttribute(c,!0),f.part&&f.part.add(c)}class Vs extends Set{static get isPolyfilled(){return!0}constructor(c){if(super(),!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");cs.set(this,c)}add(c){if(!/^--/.test(c)||typeof c!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${c} must start with '--'.`);const v=super.add(c),_=cs.get(this),I=`state${c}`;return _.isConnected?ps(_,I):setTimeout(()=>{ps(_,I)}),v}clear(){for(let[c]of this.entries())this.delete(c);super.clear()}delete(c){const v=super.delete(c),_=cs.get(this);return _.isConnected?(_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)):setTimeout(()=>{_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)}),v}}function di(f,c,v,_){if(typeof c=="function"?f!==c||!_:!c.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return v==="m"?_:v==="a"?_.call(f):_?_.value:c.get(f)}function Hi(f,c,v,_,I){if(typeof c=="function"?f!==c||!0:!c.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c.set(f,v),v}var _e;class ci{constructor(c){_e.set(this,void 0),Hi(this,_e,c);for(let v=0;v<c.length;v++){let _=c[v];this[v]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return di(this,_e,"f").length}[(_e=new WeakMap,Symbol.iterator)](){return di(this,_e,"f")[Symbol.iterator]()}item(c){return this[c]==null?null:this[c]}namedItem(c){return this[c]==null?null:this[c]}}function pi(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=v;const c=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function v(...H){let q=f.apply(this,H);return qe(this,q,"checkValidity")}function _(...H){let q=c.apply(this,H);return qe(this,q,"reportValidity")}const{get:I}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...H){const q=I.call(this,...H),jt=Array.from(d.get(this)||[]);if(jt.length===0)return q;const mt=Array.from(q).concat(jt).sort((Ht,js)=>Ht.compareDocumentPosition?Ht.compareDocumentPosition(js)&2?1:-1:0);return new ci(mt)}})}class xn{static get isPolyfilled(){return!0}constructor(c){if(!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const v=c.getRootNode(),_=new Vi;this.states=new Vs(c),t.set(this,c),e.set(this,_),a.set(c,this),M(c,this),L(c,this),Object.seal(this),v instanceof DocumentFragment&&Bt(v)}checkValidity(){const c=t.get(this);if(ct(c,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=e.get(this);if(!v.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});c.dispatchEvent(_)}return v.valid}get form(){const c=t.get(this);ct(c,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let v;return c.constructor.formAssociated===!0&&(v=Rt(c)),v}get labels(){const c=t.get(this);ct(c,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const v=c.getAttribute("id"),_=c.getRootNode();return _&&v?_.querySelectorAll(`[for="${v}"]`):[]}reportValidity(){const c=t.get(this);if(ct(c,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=this.checkValidity(),_=k.get(this);if(_&&!c.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!v&&_&&(c.focus(),_.focus()),v}setFormValue(c){const v=t.get(this);if(ct(v,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Vt(this),c!=null&&!(c instanceof FormData)){if(v.getAttribute("name")){const _=ot(v,this);_.value=c}}else c!=null&&c instanceof FormData&&Array.from(c).reverse().forEach(([_,I])=>{if(typeof I=="string"){const H=ot(v,this);H.name=_,H.value=I}});p.set(v,c)}setValidity(c,v,_){const I=t.get(this);if(ct(I,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!c)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");k.set(this,_);const H=e.get(this),q={};for(const Ht in c)q[Ht]=c[Ht];Object.keys(q).length===0&&li(H);const jt=Object.assign(Object.assign({},H),q);delete jt.valid;const{valid:mt}=ji(H,jt,this.form);if(!mt&&!v)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.");n.set(this,mt?"":v),I.isConnected?(I.toggleAttribute("internals-invalid",!mt),I.toggleAttribute("internals-valid",mt),rt(I,"aria-invalid",`${!mt}`)):w.set(I,this)}get shadowRoot(){const c=t.get(this);return g.get(c)||null}get validationMessage(){const c=t.get(this);return ct(c,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get validity(){const c=t.get(this);return ct(c,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const c=t.get(this);return ct(c,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(c.disabled||c.hasAttribute("disabled")||c.hasAttribute("readonly"))}}function md(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const c=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(c,f);const v=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in v.internals)}let Sn=!1,Cn=!1;function Ui(f){Cn||(Cn=!0,window.CustomStateSet=Vs,f&&(HTMLElement.prototype.attachInternals=function(...c){const v=f.call(this,c);return v.states=new Vs(this),v}))}function Tn(f=!0){if(!Sn){if(Sn=!0,typeof window<"u"&&(window.ElementInternals=xn),typeof CustomElementRegistry<"u"){const c=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(v,_,I){if(_.formAssociated){const H=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){y.has(this)||(y.set(this,!0),this.hasAttribute("disabled")&&Ft(this,!0)),H!=null&&H.apply(this),ze(this)}}c.call(this,v,_,I)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(a.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new xn(this)}),typeof Element<"u"){let c=function(..._){const I=v.apply(this,_);if(g.set(this,I),ue()){const H=new MutationObserver(J);window.ShadyDOM?H.observe(this,it):H.observe(I,it),h.set(this,H)}return I};const v=Element.prototype.attachShadow;Element.prototype.attachShadow=c}ue()&&typeof document<"u"&&new MutationObserver(J).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&pi(),(f||typeof window<"u"&&!window.CustomStateSet)&&Ui()}}return customElements.polyfillWrapFlushCallback||(md()?typeof window<"u"&&!window.CustomStateSet&&Ui(HTMLElement.prototype.attachInternals):Tn(!1)),s.forceCustomStateSetPolyfill=Ui,s.forceElementInternalsPolyfill=Tn,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),pl}ul();var fl=Object.defineProperty,j=(s,t,e,i)=>{for(var a=void 0,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=r(t,e,a)||a);return a&&fl(t,e,a),a};let D=class extends Y{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=ke(),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=At.props.helptextDropdownButton.default,this.label=null,this.optionalText=kt.forms.labels.optional,this.requiredText=kt.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,a,n,r,h,d,p,m,g,k;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},kt.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},kt.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},kt.forms.messages.invalidPattern,t):(n=t.validity)!=null&&n.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},kt.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},kt.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?kt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):kt.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},kt.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?kt.forms.messages.rangeOverflowMax.replace("{max}",(g=this.max)==null?void 0:g.toString()):kt.forms.messages.rangeOverflow,t):(k=t.validity)!=null&&k.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(a=>{const n=a;n.name===this.name&&n.value!==this.value&&n.checked&&(n.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))}};j([o()],D.prototype,"defaultValue"),j([o({type:Boolean,reflect:!0})],D.prototype,"disabled"),j([o({type:Boolean,reflect:!0})],D.prototype,"readonly"),j([o({type:Boolean,reflect:!0})],D.prototype,"required"),j([o({type:Number,reflect:!0})],D.prototype,"max"),j([o({type:Number,reflect:!0})],D.prototype,"maxlength"),j([o({type:Number,reflect:!0})],D.prototype,"min"),j([o({type:Number,reflect:!0})],D.prototype,"minlength"),j([o({type:Number,reflect:!0})],D.prototype,"step"),j([o({type:String})],D.prototype,"ariaDescribedBy"),j([o({type:String})],D.prototype,"ariaLabelledby"),j([o({type:String,reflect:!0})],D.prototype,"name"),j([o({type:String,reflect:!0})],D.prototype,"pattern"),j([o({type:String,reflect:!0})],D.prototype,"placeholder"),j([o({type:String,reflect:!0})],D.prototype,"id"),j([o({type:Boolean})],D.prototype,"counter"),j([o({type:Boolean})],D.prototype,"hasError"),j([o({type:Boolean})],D.prototype,"inline"),j([o({type:Boolean})],D.prototype,"hasFieldset"),j([o({type:Boolean})],D.prototype,"optionalTag"),j([o({type:Boolean})],D.prototype,"requiredTag"),j([o({type:Boolean})],D.prototype,"skipForwardTestid"),j([o({type:Boolean,reflect:!1})],D.prototype,"useWrapper"),j([o({type:Boolean,reflect:!0})],D.prototype,"fullwidth"),j([o({type:Number})],D.prototype,"counterMaxLength"),j([o({type:String})],D.prototype,"errorMessage"),j([o({type:String})],D.prototype,"helptext"),j([o({type:String})],D.prototype,"helptextDropdown"),j([o({type:String,reflect:!1})],D.prototype,"helptextDropdownButton"),j([o({type:String})],D.prototype,"label"),j([o({type:String,reflect:!1})],D.prototype,"optionalText"),j([o({type:String,reflect:!1})],D.prototype,"requiredText"),j([o({type:String,reflect:!1})],D.prototype,"tagText"),j([o({type:String,attribute:"data-testid"})],D.prototype,"dataTestid"),j([F()],D.prototype,"touched");let Wa=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(a=>{Ze(a)&&(this.addNode(a),e=!0)}),i.removedNodes.forEach(a=>{Ze(a)&&(this.nodes=this.nodes.filter(n=>n!==a),e=!0)})),i.type==="attributes"&&Ze(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var gl=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,De=(s,t,e,i)=>{for(var a=i>1?void 0:i?ml(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&gl(t,e,a),a};let le=class extends Y{constructor(){super(),this.defaultSlot=T(),this.forId=ke(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=At.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new at(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const a=!this.isHelpTextOpen;this.isHelpTextOpen=a,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:a}}))},e=O({"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">
|
|
418
|
+
*/const Ua=(s,t,e)=>{const i=new Map;for(let a=t;a<=e;a++)i.set(s[a],a);return i},Ai=Ce(class extends Ye{constructor(s){if(super(s),s.type!==Rt.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 a=[],n=[];let r=0;for(const h of s)a[r]=i?i(h,r):r,n[r]=e(h,r),r++;return{values:n,keys:a}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const a=dr(s),{values:n,keys:r}=this.dt(t,e,i);if(!Array.isArray(a))return this.ut=r,n;const h=this.ut??(this.ut=[]),d=[];let p,m,f=0,k=a.length-1,b=0,y=n.length-1;for(;f<=k&&b<=y;)if(a[f]===null)f++;else if(a[k]===null)k--;else if(h[f]===r[b])d[b]=Te(a[f],n[b]),f++,b++;else if(h[k]===r[y])d[y]=Te(a[k],n[y]),k--,y--;else if(h[f]===r[y])d[y]=Te(a[f],n[y]),ys(s,d[y+1],a[f]),f++,y--;else if(h[k]===r[b])d[b]=Te(a[k],n[b]),ys(s,a[f],a[k]),k--,b++;else if(p===void 0&&(p=Ua(r,b,y),m=Ua(h,f,k)),p.has(h[f]))if(p.has(h[k])){const w=m.get(r[b]),C=w!==void 0?a[w]:null;if(C===null){const M=ys(s,a[f]);Te(M,n[b]),d[b]=M}else d[b]=Te(C,n[b]),ys(s,a[f],C),a[w]=null;b++}else yi(a[k]),k--;else yi(a[f]),f++;for(;b<=y;){const w=ys(s,d[y+1]);Te(w,n[b]),d[b++]=w}for(;f<=k;){const w=a[f++];w!==null&&yi(w)}return this.ut=r,ba(s,d),_t}}),qa=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),ke=()=>{const s=qa(),t=qa();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},hl={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}},At={props:hl};var dl={},za;function cl(){return za||(za=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,a=new WeakMap,n=new WeakMap,r=new WeakMap,h=new WeakMap,d=new WeakMap,p=new WeakMap,m=new WeakMap,f=new WeakMap,k=new WeakMap,b=new WeakMap,y=new WeakMap,w=new WeakMap,C={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},M=(g,c)=>{for(let v in C){c[v]=null;let _=null;const I=C[v];Object.defineProperty(c,v,{get(){return _},set(U){_=U,g.isConnected?rt(g,I,U):m.set(g,c)}})}};function T(g){const c=a.get(g),{form:v}=c;pe(g,v,c),Tt(g,c.labels)}const V=(g,c=!1)=>{const v=document.createTreeWalker(g,NodeFilter.SHOW_ELEMENT,{acceptNode(U){return a.has(U)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let _=v.nextNode();const I=!c||g.disabled;for(;_;)_.formDisabledCallback&&I&&Ft(_,g.disabled),_=v.nextNode()},N={attributes:!0,attributeFilter:["disabled","name"]},W=ue()?new MutationObserver(g=>{for(const c of g){const v=c.target;if(c.attributeName==="disabled"&&(v.constructor.formAssociated?Ft(v,v.hasAttribute("disabled")):v.localName==="fieldset"&&V(v)),c.attributeName==="name"&&v.constructor.formAssociated){const _=a.get(v),I=p.get(v);_.setFormValue(I)}}}):{};function Z(g){g.forEach(c=>{const{addedNodes:v,removedNodes:_}=c,I=Array.from(v),U=Array.from(_);I.forEach(q=>{var jt;if(a.has(q)&&q.constructor.formAssociated&&T(q),m.has(q)){const mt=m.get(q);Object.keys(C).filter(Ht=>mt[Ht]!==null).forEach(Ht=>{rt(q,C[Ht],mt[Ht])}),m.delete(q)}if(w.has(q)){const mt=w.get(q);rt(q,"internals-valid",mt.validity.valid.toString()),rt(q,"internals-invalid",(!mt.validity.valid).toString()),rt(q,"aria-invalid",(!mt.validity.valid).toString()),w.delete(q)}if(q.localName==="form"){const mt=d.get(q),Ht=document.createTreeWalker(q,NodeFilter.SHOW_ELEMENT,{acceptNode(qi){return a.has(qi)&&qi.constructor.formAssociated&&!(mt&&mt.has(qi))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let js=Ht.nextNode();for(;js;)T(js),js=Ht.nextNode()}q.localName==="fieldset"&&((jt=W.observe)===null||jt===void 0||jt.call(W,q,N),V(q,!0))}),U.forEach(q=>{const jt=a.get(q);jt&&i.get(jt)&&Vt(jt),h.has(q)&&h.get(q).disconnect()})})}function Lt(g){g.forEach(c=>{const{removedNodes:v}=c;v.forEach(_=>{const I=b.get(c.target);a.has(_)&&ze(_),I.disconnect()})})}const Bt=g=>{var c,v;const _=new MutationObserver(Lt);!((c=window==null?void 0:window.ShadyDOM)===null||c===void 0)&&c.inUse&&g.mode&&g.host&&(g=g.host),(v=_.observe)===null||v===void 0||v.call(_,g,{childList:!0}),b.set(g,_)};ue()&&new MutationObserver(Z);const it={childList:!0,subtree:!0},rt=(g,c,v)=>{g.getAttribute(c)!==v&&g.setAttribute(c,v)},Ft=(g,c)=>{g.toggleAttribute("internals-disabled",c),c?rt(g,"aria-disabled","true"):g.removeAttribute("aria-disabled"),g.formDisabledCallback&&g.formDisabledCallback.apply(g,[c])},Vt=g=>{i.get(g).forEach(c=>{c.remove()}),i.set(g,[])},ot=(g,c)=>{const v=document.createElement("input");return v.type="hidden",v.name=g.getAttribute("name"),g.after(v),i.get(c).push(v),v},B=(g,c)=>{var v;i.set(c,[]),(v=W.observe)===null||v===void 0||v.call(W,g,N)},Tt=(g,c)=>{if(c.length){Array.from(c).forEach(_=>_.addEventListener("click",g.click.bind(g)));let v=c[0].id;c[0].id||(v=`${c[0].htmlFor}_Label`,c[0].id=v),rt(g,"aria-labelledby",v)}},ne=g=>{const c=Array.from(g.elements).filter(U=>!U.tagName.includes("-")&&U.validity).map(U=>U.validity.valid),v=d.get(g)||[],_=Array.from(v).filter(U=>U.isConnected).map(U=>a.get(U).validity.valid),I=[...c,..._].includes(!1);g.toggleAttribute("internals-invalid",I),g.toggleAttribute("internals-valid",!I)},ce=g=>{ne(zt(g.target))},re=g=>{ne(zt(g.target))},Ue=g=>{const c=["button[type=submit]","input[type=submit]","button:not([type])"].map(v=>`${v}:not([disabled])`).map(v=>`${v}:not([form])${g.id?`,${v}[form='${g.id}']`:""}`).join(",");g.addEventListener("click",v=>{if(v.target.closest(c)){const _=d.get(g);if(g.noValidate)return;_.size&&Array.from(_).reverse().map(I=>a.get(I).reportValidity()).includes(!1)&&v.preventDefault()}})},ds=g=>{const c=d.get(g.target);c&&c.size&&c.forEach(v=>{v.constructor.formAssociated&&v.formResetCallback&&v.formResetCallback.apply(v)})},pe=(g,c,v)=>{if(c){const _=d.get(c);if(_)_.add(g);else{const I=new Set;I.add(g),d.set(c,I),Ue(c),c.addEventListener("reset",ds),c.addEventListener("input",ce),c.addEventListener("change",re)}r.set(c,{ref:g,internals:v}),g.constructor.formAssociated&&g.formAssociatedCallback&&setTimeout(()=>{g.formAssociatedCallback.apply(g,[c])},0),ne(c)}},zt=g=>{let c=g.parentNode;return c&&c.tagName!=="FORM"&&(c=zt(c)),c},pt=(g,c,v=DOMException)=>{if(!g.constructor.formAssociated)throw new v(c)},qe=(g,c,v)=>{const _=d.get(g);return _&&_.size&&_.forEach(I=>{a.get(I)[v]()||(c=!1)}),c},ze=g=>{if(g.constructor.formAssociated){const c=a.get(g),{labels:v,form:_}=c;Tt(g,v),pe(g,_,c)}};function ue(){return typeof MutationObserver<"u"}class Vi{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 li=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),ji=(g,c,v)=>(g.valid=hi(c),Object.keys(c).forEach(_=>g[_]=c[_]),v&&ne(v),g),hi=g=>{let c=!0;for(let v in g)v!=="valid"&&g[v]!==!1&&(c=!1);return c},cs=new WeakMap;function ps(g,c){g.toggleAttribute(c,!0),g.part&&g.part.add(c)}class Vs extends Set{static get isPolyfilled(){return!0}constructor(c){if(super(),!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");cs.set(this,c)}add(c){if(!/^--/.test(c)||typeof c!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${c} must start with '--'.`);const v=super.add(c),_=cs.get(this),I=`state${c}`;return _.isConnected?ps(_,I):setTimeout(()=>{ps(_,I)}),v}clear(){for(let[c]of this.entries())this.delete(c);super.clear()}delete(c){const v=super.delete(c),_=cs.get(this);return _.isConnected?(_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)):setTimeout(()=>{_.toggleAttribute(`state${c}`,!1),_.part&&_.part.remove(`state${c}`)}),v}}function di(g,c,v,_){if(typeof c=="function"?g!==c||!_:!c.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return v==="m"?_:v==="a"?_.call(g):_?_.value:c.get(g)}function Hi(g,c,v,_,I){if(typeof c=="function"?g!==c||!0:!c.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c.set(g,v),v}var _e;class ci{constructor(c){_e.set(this,void 0),Hi(this,_e,c);for(let v=0;v<c.length;v++){let _=c[v];this[v]=_,_.hasAttribute("name")&&(this[_.getAttribute("name")]=_)}Object.freeze(this)}get length(){return di(this,_e,"f").length}[(_e=new WeakMap,Symbol.iterator)](){return di(this,_e,"f")[Symbol.iterator]()}item(c){return this[c]==null?null:this[c]}namedItem(c){return this[c]==null?null:this[c]}}function pi(){const g=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=v;const c=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=_;function v(...U){let q=g.apply(this,U);return qe(this,q,"checkValidity")}function _(...U){let q=c.apply(this,U);return qe(this,q,"reportValidity")}const{get:I}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...U){const q=I.call(this,...U),jt=Array.from(d.get(this)||[]);if(jt.length===0)return q;const mt=Array.from(q).concat(jt).sort((Ht,js)=>Ht.compareDocumentPosition?Ht.compareDocumentPosition(js)&2?1:-1:0);return new ci(mt)}})}class xn{static get isPolyfilled(){return!0}constructor(c){if(!c||!c.tagName||c.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const v=c.getRootNode(),_=new Vi;this.states=new Vs(c),t.set(this,c),e.set(this,_),a.set(c,this),M(c,this),B(c,this),Object.seal(this),v instanceof DocumentFragment&&Bt(v)}checkValidity(){const c=t.get(this);if(pt(c,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=e.get(this);if(!v.valid){const _=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});c.dispatchEvent(_)}return v.valid}get form(){const c=t.get(this);pt(c,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let v;return c.constructor.formAssociated===!0&&(v=zt(c)),v}get labels(){const c=t.get(this);pt(c,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const v=c.getAttribute("id"),_=c.getRootNode();return _&&v?_.querySelectorAll(`[for="${v}"]`):[]}reportValidity(){const c=t.get(this);if(pt(c,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const v=this.checkValidity(),_=k.get(this);if(_&&!c.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!v&&_&&(c.focus(),_.focus()),v}setFormValue(c){const v=t.get(this);if(pt(v,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Vt(this),c!=null&&!(c instanceof FormData)){if(v.getAttribute("name")){const _=ot(v,this);_.value=c}}else c!=null&&c instanceof FormData&&Array.from(c).reverse().forEach(([_,I])=>{if(typeof I=="string"){const U=ot(v,this);U.name=_,U.value=I}});p.set(v,c)}setValidity(c,v,_){const I=t.get(this);if(pt(I,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!c)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");k.set(this,_);const U=e.get(this),q={};for(const Ht in c)q[Ht]=c[Ht];Object.keys(q).length===0&&li(U);const jt=Object.assign(Object.assign({},U),q);delete jt.valid;const{valid:mt}=ji(U,jt,this.form);if(!mt&&!v)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.");n.set(this,mt?"":v),I.isConnected?(I.toggleAttribute("internals-invalid",!mt),I.toggleAttribute("internals-valid",mt),rt(I,"aria-invalid",`${!mt}`)):w.set(I,this)}get shadowRoot(){const c=t.get(this);return f.get(c)||null}get validationMessage(){const c=t.get(this);return pt(c,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get validity(){const c=t.get(this);return pt(c,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const c=t.get(this);return pt(c,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(c.disabled||c.hasAttribute("disabled")||c.hasAttribute("readonly"))}}function ud(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class g extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const c=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(c,g);const v=new g;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(_=>_ in v.internals)}let Sn=!1,Cn=!1;function Ui(g){Cn||(Cn=!0,window.CustomStateSet=Vs,g&&(HTMLElement.prototype.attachInternals=function(...c){const v=g.call(this,c);return v.states=new Vs(this),v}))}function Tn(g=!0){if(!Sn){if(Sn=!0,typeof window<"u"&&(window.ElementInternals=xn),typeof CustomElementRegistry<"u"){const c=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(v,_,I){if(_.formAssociated){const U=_.prototype.connectedCallback;_.prototype.connectedCallback=function(){y.has(this)||(y.set(this,!0),this.hasAttribute("disabled")&&Ft(this,!0)),U!=null&&U.apply(this),ze(this)}}c.call(this,v,_,I)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(a.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new xn(this)}),typeof Element<"u"){let c=function(..._){const I=v.apply(this,_);if(f.set(this,I),ue()){const U=new MutationObserver(Z);window.ShadyDOM?U.observe(this,it):U.observe(I,it),h.set(this,U)}return I};const v=Element.prototype.attachShadow;Element.prototype.attachShadow=c}ue()&&typeof document<"u"&&new MutationObserver(Z).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&pi(),(g||typeof window<"u"&&!window.CustomStateSet)&&Ui()}}return customElements.polyfillWrapFlushCallback||(ud()?typeof window<"u"&&!window.CustomStateSet&&Ui(HTMLElement.prototype.attachInternals):Tn(!1)),s.forceCustomStateSetPolyfill=Ui,s.forceElementInternalsPolyfill=Tn,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),dl}cl();var pl=Object.defineProperty,H=(s,t,e,i)=>{for(var a=void 0,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=r(t,e,a)||a);return a&&pl(t,e,a),a};let D=class extends Y{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=ke(),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=At.props.helptextDropdownButton.default,this.label=null,this.optionalText=kt.forms.labels.optional,this.requiredText=kt.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,a,n,r,h,d,p,m,f,k;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},kt.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},kt.forms.messages.invalid,t):(a=t.validity)!=null&&a.patternMismatch?this.internals.setValidity({patternMismatch:!0},kt.forms.messages.invalidPattern,t):(n=t.validity)!=null&&n.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},kt.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},kt.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?kt.forms.messages.rangeUnderflowMin.replace("{min}",(d=this.min)==null?void 0:d.toString()):kt.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},kt.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?kt.forms.messages.rangeOverflowMax.replace("{max}",(f=this.max)==null?void 0:f.toString()):kt.forms.messages.rangeOverflow,t):(k=t.validity)!=null&&k.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(a=>{const n=a;n.name===this.name&&n.value!==this.value&&n.checked&&(n.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()],D.prototype,"defaultValue"),H([o({type:Boolean,reflect:!0})],D.prototype,"disabled"),H([o({type:Boolean,reflect:!0})],D.prototype,"readonly"),H([o({type:Boolean,reflect:!0})],D.prototype,"required"),H([o({type:Number,reflect:!0})],D.prototype,"max"),H([o({type:Number,reflect:!0})],D.prototype,"maxlength"),H([o({type:Number,reflect:!0})],D.prototype,"min"),H([o({type:Number,reflect:!0})],D.prototype,"minlength"),H([o({type:Number,reflect:!0})],D.prototype,"step"),H([o({type:String})],D.prototype,"ariaDescribedBy"),H([o({type:String})],D.prototype,"ariaLabelledby"),H([o({type:String,reflect:!0})],D.prototype,"name"),H([o({type:String,reflect:!0})],D.prototype,"pattern"),H([o({type:String,reflect:!0})],D.prototype,"placeholder"),H([o({type:String,reflect:!0})],D.prototype,"id"),H([o({type:Boolean})],D.prototype,"counter"),H([o({type:Boolean})],D.prototype,"hasError"),H([o({type:Boolean})],D.prototype,"inline"),H([o({type:Boolean})],D.prototype,"hasFieldset"),H([o({type:Boolean})],D.prototype,"optionalTag"),H([o({type:Boolean})],D.prototype,"requiredTag"),H([o({type:Boolean})],D.prototype,"skipForwardTestid"),H([o({type:Boolean,reflect:!1})],D.prototype,"useWrapper"),H([o({type:Boolean,reflect:!0})],D.prototype,"fullwidth"),H([o({type:Number})],D.prototype,"counterMaxLength"),H([o({type:String})],D.prototype,"errorMessage"),H([o({type:String})],D.prototype,"helptext"),H([o({type:String})],D.prototype,"helptextDropdown"),H([o({type:String,reflect:!1})],D.prototype,"helptextDropdownButton"),H([o({type:String})],D.prototype,"label"),H([o({type:String,reflect:!1})],D.prototype,"optionalText"),H([o({type:String,reflect:!1})],D.prototype,"requiredText"),H([o({type:String,reflect:!1})],D.prototype,"tagText"),H([o({type:String,attribute:"data-testid"})],D.prototype,"dataTestid"),H([F()],D.prototype,"touched");let Wa=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(a=>{Ze(a)&&(this.addNode(a),e=!0)}),i.removedNodes.forEach(a=>{Ze(a)&&(this.nodes=this.nodes.filter(n=>n!==a),e=!0)})),i.type==="attributes"&&Ze(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var ul=Object.defineProperty,fl=Object.getOwnPropertyDescriptor,De=(s,t,e,i)=>{for(var a=i>1?void 0:i?fl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&ul(t,e,a),a};let le=class extends Y{constructor(){super(),this.defaultSlot=A(),this.forId=ke(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=At.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new at(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const a=!this.isHelpTextOpen;this.isHelpTextOpen=a,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:a}}))},e=O({"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">
|
|
419
419
|
<button
|
|
420
420
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
421
421
|
type="button"
|
|
@@ -434,11 +434,11 @@
|
|
|
434
434
|
</div>
|
|
435
435
|
</div>`:$;return u`${u`<div class="${e}">
|
|
436
436
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
437
|
-
<div class="pkt-contents" ${
|
|
437
|
+
<div class="pkt-contents" ${E(this.defaultSlot)} name="helptext"></div>
|
|
438
438
|
${this.helptext&&Js(this.helptext)}
|
|
439
439
|
</div>
|
|
440
440
|
${i()}
|
|
441
|
-
</div>`}`}};De([o({type:String,reflect:!0})],le.prototype,"forId",2),De([o({type:String})],le.prototype,"helptext",2),De([o({type:String})],le.prototype,"helptextDropdown",2),De([o({type:String})],le.prototype,"helptextDropdownButton",2),De([F()],le.prototype,"isHelpTextOpen",2),De([F()],le.prototype,"filledSlots",2),le=De([
|
|
441
|
+
</div>`}`}};De([o({type:String,reflect:!0})],le.prototype,"forId",2),De([o({type:String})],le.prototype,"helptext",2),De([o({type:String})],le.prototype,"helptextDropdown",2),De([o({type:String})],le.prototype,"helptextDropdownButton",2),De([F()],le.prototype,"isHelpTextOpen",2),De([F()],le.prototype,"filledSlots",2),le=De([j("pkt-helptext")],le);var gl=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,J=(s,t,e,i)=>{for(var a=i>1?void 0:i?ml(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&gl(t,e,a),a};const vl={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}};let X=class extends Y{constructor(){super(),this.defaultSlot=A(),this.helptextSlot=A(),this.forId=ke(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=At.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=At.props.optionalTag.default,this.optionalText=At.props.optionalText.default,this.requiredTag=At.props.requiredTag.default,this.requiredText=At.props.requiredText.default,this.tagText=null,this.hasError=At.props.hasError.default,this.errorMessage="",this.disabled=At.props.disabled.default,this.inline=At.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=At.props.hasFieldset.default,this.role="group",this.useWrapper=At.props.useWrapper.default,this.slotController=new at(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`:$,a=()=>u`
|
|
442
442
|
${this.tagText?u`<span class=${e+" pkt-tag--gray"}>${this.tagText}</span>`:$}
|
|
443
443
|
${this.optionalTag?u`<span class=${e+" pkt-tag--blue-light"}>${this.optionalText}</span>`:$}
|
|
444
444
|
${this.requiredTag?u`<span class=${e+" pkt-tag--beige"}>${this.requiredText}</span>`:$}
|
|
@@ -469,8 +469,8 @@
|
|
|
469
469
|
.helptext=${this.helptext}
|
|
470
470
|
.helptextDropdown=${this.helptextDropdown}
|
|
471
471
|
.helptextDropdownButton=${this.helptextDropdownButton||At.props.helptextDropdownButton.default}
|
|
472
|
-
@toggleHelpText=${
|
|
473
|
-
${
|
|
472
|
+
@toggleHelpText=${f=>{this.toggleDropdown(f)}}
|
|
473
|
+
${E(this.helptextSlot)}
|
|
474
474
|
name="helptext"
|
|
475
475
|
></pkt-helptext>
|
|
476
476
|
`,h=()=>this.counter?u`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
@@ -488,12 +488,12 @@
|
|
|
488
488
|
${n()}
|
|
489
489
|
${r()}
|
|
490
490
|
${this.counterPosition==="top"?h():$}
|
|
491
|
-
<div class="pkt-contents" ${
|
|
491
|
+
<div class="pkt-contents" ${E(this.defaultSlot)}></div>
|
|
492
492
|
${this.counterPosition==="bottom"?h():$}
|
|
493
493
|
${d()}
|
|
494
494
|
`,m=()=>this.hasFieldset?u`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
|
|
495
495
|
${p()}
|
|
496
|
-
</fieldset>`:u`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return u`<div class=${O(t)}>${m()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(t){this.disabled&&(t.preventDefault(),t.stopImmediatePropagation()),this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};
|
|
496
|
+
</fieldset>`:u`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return u`<div class=${O(t)}>${m()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(t){this.disabled&&(t.preventDefault(),t.stopImmediatePropagation()),this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};J([o({type:String})],X.prototype,"forId",2),J([o({type:String})],X.prototype,"label",2),J([o({type:String})],X.prototype,"helptext",2),J([o({type:String})],X.prototype,"helptextDropdown",2),J([o({type:String})],X.prototype,"helptextDropdownButton",2),J([o({type:Boolean})],X.prototype,"counter",2),J([o({type:Number})],X.prototype,"counterCurrent",2),J([o({type:Number})],X.prototype,"counterMaxLength",2),J([o({type:String})],X.prototype,"counterError",2),J([o({type:String,reflect:!1})],X.prototype,"counterPosition",2),J([o({type:Boolean})],X.prototype,"optionalTag",2),J([o({type:String})],X.prototype,"optionalText",2),J([o({type:Boolean})],X.prototype,"requiredTag",2),J([o({type:String})],X.prototype,"requiredText",2),J([o({type:String})],X.prototype,"tagText",2),J([o({type:Boolean})],X.prototype,"hasError",2),J([o({type:String})],X.prototype,"errorMessage",2),J([o({type:Boolean})],X.prototype,"disabled",2),J([o({type:Boolean})],X.prototype,"inline",2),J([o({type:String})],X.prototype,"ariaDescribedby",2),J([o({type:Boolean})],X.prototype,"hasFieldset",2),J([o({type:String,reflect:!0})],X.prototype,"role",2),J([o({type:Boolean,reflect:!0,converter:vl})],X.prototype,"useWrapper",2),X=J([j("pkt-input-wrapper")],X);var bl=Object.defineProperty,yl=Object.getOwnPropertyDescriptor,bt=(s,t,e,i)=>{for(var a=i>1?void 0:i?yl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&bl(t,e,a),a};let gt=class extends Y{constructor(){super(...arguments),this.id=ke(),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`
|
|
497
497
|
<div
|
|
498
498
|
class=${O({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
499
499
|
role="listbox"
|
|
@@ -587,7 +587,7 @@
|
|
|
587
587
|
role="searchbox"
|
|
588
588
|
/>
|
|
589
589
|
</div>
|
|
590
|
-
`:$}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,a=e.dataset.type,n=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&a!=="new-option"&&a!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":i&&(n?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():a==="searchbox"||a==="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 a;return(a=i.textContent)==null?void 0:a.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};bt([o({type:String})],
|
|
590
|
+
`:$}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,a=e.dataset.type,n=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&a!=="new-option"&&a!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":i&&(n?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():a==="searchbox"||a==="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 a;return(a=i.textContent)==null?void 0:a.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};bt([o({type:String})],gt.prototype,"id",2),bt([o({type:String})],gt.prototype,"label",2),bt([o({type:Array})],gt.prototype,"options",2),bt([o({type:Boolean,reflect:!0})],gt.prototype,"isOpen",2),bt([o({type:Boolean})],gt.prototype,"disabled",2),bt([o({type:Boolean})],gt.prototype,"includeSearch",2),bt([o({type:Boolean})],gt.prototype,"isMultiSelect",2),bt([o({type:Boolean})],gt.prototype,"allowUserInput",2),bt([o({type:Boolean})],gt.prototype,"maxIsReached",2),bt([o({type:String})],gt.prototype,"customUserInput",2),bt([o({type:String})],gt.prototype,"searchPlaceholder",2),bt([o({type:String})],gt.prototype,"searchValue",2),bt([o({type:Number})],gt.prototype,"maxLength",2),bt([o({type:String})],gt.prototype,"userMessage",2),bt([F()],gt.prototype,"_filteredOptions",2),gt=bt([j("pkt-listbox")],gt);const kl={displayValueAs:{default:"label"}},$l={props:kl};var _l=Object.defineProperty,wl=Object.getOwnPropertyDescriptor,tt=(s,t,e,i)=>{for(var a=i>1?void 0:i?wl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&_l(t,e,a),a};let Q=class extends D{constructor(){super(),this.helptextSlot=A(),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=$l.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=A(),this.arrowRef=A(),this.listboxRef=A(),this.focusRef=A(),this.optionTagRef=A(),this.optionsController=new Wa(this),this.slotController=new at(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 a={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(a.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(a.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(a.description=i.getAttribute("description")||void 0),a.fulltext=a.value+a.label+(a.prefix||""),e.push(a)}),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(a=>a&&a.userAdded).filter(a=>!(Array.isArray(this.options)?this.options:[]).some(n=>n.value===a.value)),i=[...e,...this.options];this._options=i,e.length>0&&(this.options=i),this._options.forEach(a=>{if(a.value&&!a.label&&(a.label=a.value),a.selected&&!this._value.includes(a.value)){const n=[...this._value];this._value=[...this._value,a.value],this.valueChanged(this._value,n)}a.fulltext=a.value+a.label+(a.prefix||""),a.selected=a.selected||this._value.includes(a.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(a=>{a.value&&!a.label&&(a.label=a.value),a.selected&&!this._value.includes(a.value)&&(this._value=[...this._value,a.value]),a.fulltext=a.value+a.label+(a.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,i)}render(){return u`
|
|
591
591
|
<pkt-input-wrapper
|
|
592
592
|
.label=${this.label}
|
|
593
593
|
.helptext=${this.helptext}
|
|
@@ -608,7 +608,7 @@
|
|
|
608
608
|
class="pkt-combobox__wrapper"
|
|
609
609
|
@labelClick=${this.handleInputClick}
|
|
610
610
|
>
|
|
611
|
-
<div class="pkt-contents" ${
|
|
611
|
+
<div class="pkt-contents" ${E(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
612
612
|
<div class="pkt-combobox" @focusout=${this.handleFocusOut}>
|
|
613
613
|
<div
|
|
614
614
|
class=${O({"pkt-combobox__input":!0,"pkt-combobox__input--fullwidth":this.fullwidth,"pkt-combobox__input--open":this._isOptionsOpen,"pkt-combobox__input--error":this.hasError,"pkt-combobox__input--disabled":this.disabled})}
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
@click=${this.handleArrowClick}
|
|
625
625
|
@keydown=${this.handleArrowClick}
|
|
626
626
|
id="${this.id}-arrow"
|
|
627
|
-
${
|
|
627
|
+
${E(this.arrowRef)}
|
|
628
628
|
aria-expanded=${this._isOptionsOpen}
|
|
629
629
|
aria-controls="${this.id}-listbox"
|
|
630
630
|
aria-haspopup="listbox"
|
|
@@ -640,7 +640,7 @@
|
|
|
640
640
|
></pkt-icon>
|
|
641
641
|
</div>
|
|
642
642
|
<div
|
|
643
|
-
${
|
|
643
|
+
${E(this.focusRef)}
|
|
644
644
|
tabindex="-1"
|
|
645
645
|
@keydown=${this.handleArrowClick}
|
|
646
646
|
class="pkt-contents"
|
|
@@ -665,7 +665,7 @@
|
|
|
665
665
|
@close-options=${()=>this._isOptionsOpen=!1}
|
|
666
666
|
.searchValue=${this._search||null}
|
|
667
667
|
.maxLength=${this.maxlength||0}
|
|
668
|
-
${
|
|
668
|
+
${E(this.listboxRef)}
|
|
669
669
|
></pkt-listbox>
|
|
670
670
|
</div>
|
|
671
671
|
|
|
@@ -690,7 +690,7 @@
|
|
|
690
690
|
aria-controls="${this.id}-listbox"
|
|
691
691
|
aria-multiselectable=${S(this.multiple?"true":void 0)}
|
|
692
692
|
aria-activedescendant=${S(this._value[0]&&this.findValueInOptions(this._value[0])?`${this.id}-listbox-${this.findIndexInOptions(this._value[0])}`:void 0)}
|
|
693
|
-
${
|
|
693
|
+
${E(this.inputRef)}
|
|
694
694
|
/>
|
|
695
695
|
</div>
|
|
696
696
|
`:u`
|
|
@@ -699,7 +699,7 @@
|
|
|
699
699
|
id="${this.id}-input"
|
|
700
700
|
name=${(this.name||this.id)+"-input"}
|
|
701
701
|
.value=${this._value.join(",")}
|
|
702
|
-
${
|
|
702
|
+
${E(this.inputRef)}
|
|
703
703
|
/>
|
|
704
704
|
`}renderSingleOrMultipleValues(){const t=!this.multiple,e=this._editingSingleValue?null:this.renderValueTag(this.findValueInOptions(this._value[0])),i=Ai(this._value,a=>a,a=>{var n;const r=this.findValueInOptions(a),h=(n=this.options.find(d=>d.value===a))==null?void 0:n.tagSkinColor;return u`
|
|
705
705
|
<pkt-tag
|
|
@@ -715,7 +715,7 @@
|
|
|
715
715
|
>${t.value}</span
|
|
716
716
|
>`;case"label":default:return u`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
717
717
|
>${t.label||t.value}</span
|
|
718
|
-
>`}}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 a;return(a=i.fulltext)==null?void 0:a.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(a=>{var n;return!a.selected&&((n=a.label)==null?void 0:n.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const a=i[0];a!=null&&a.label&&(e.value=a.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,a,n,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((n=(a=t.relatedTarget)==null?void 0:a.closest("pkt-combobox"))==null?void 0:n.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,d=this.findValueInOptions(h);!this._value.includes(h)&&!d?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;this.disabled||(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,a;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,(a=this.arrowRef.value)==null||a.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 a=this._value.find(h=>h.toLowerCase()===i),n=this._options.filter(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase().includes(i))??!1}),r=n.find(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((n.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(n.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!a:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case n.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 a=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,n=this._value.includes(t||a||""),r=!!a,h=((i=this._options.find(C=>C.value===t))==null?void 0:i.disabled)||!1,d=!(t!=null&&t.trim()),p=!this.multiple,m=this.multiple,g=this.isMaxItemsReached();let k=!1,b=!0,y="",w="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),y="Ny verdi lagt til",k=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),b=!1,k=!0,y="Ingen treff i søket"):n?(this.removeValue(a),k=!0):d&&p?(this.removeAllSelected(),k=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(a),k=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!g?(this.setSelected(a),k=!0):m&&g?(this._userInfoMessage="Maks antall valg nådd",b=!1,w=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,k=!0,w=t),this._isOptionsOpen=k,k||window.setTimeout(()=>{var C;(C=this.focusRef.value)==null||C.focus()},0),this._userInfoMessage=y,this._search=w||"",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()}};tt([o({type:String,reflect:!0})],Q.prototype,"value",2),tt([o({type:Array})],Q.prototype,"options",2),tt([o({type:Array})],Q.prototype,"defaultOptions",2),tt([o({type:Boolean})],Q.prototype,"allowUserInput",2),tt([o({type:Boolean})],Q.prototype,"typeahead",2),tt([o({type:Boolean})],Q.prototype,"includeSearch",2),tt([o({type:String})],Q.prototype,"searchPlaceholder",2),tt([o({type:Boolean})],Q.prototype,"multiple",2),tt([o({type:Number})],Q.prototype,"maxlength",2),tt([o({type:String})],Q.prototype,"displayValueAs",2),tt([o({type:String})],Q.prototype,"tagPlacement",2),tt([F()],Q.prototype,"_options",2),tt([F()],Q.prototype,"_isOptionsOpen",2),tt([F()],Q.prototype,"_value",2),tt([F()],Q.prototype,"_userInfoMessage",2),tt([F()],Q.prototype,"_addValueText",2),tt([F()],Q.prototype,"_maxIsReached",2),tt([F()],Q.prototype,"_search",2),tt([F()],Q.prototype,"_inputFocus",2),tt([F()],Q.prototype,"_editingSingleValue",2),Q=tt([V("pkt-combobox")],Q);const Cl={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 Tl=Object.defineProperty,Nl=Object.getOwnPropertyDescriptor,ee=(s,t,e,i)=>{for(var a=i>1?void 0:i?Nl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Tl(t,e,a),a};let Ei=null;function Al(){return Ei||(Ei=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)}),Ei)}let zt=class extends Y{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||Cl.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,a)=>(i[a.name]=a.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 Al(),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}>
|
|
718
|
+
>`}}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 a;return(a=i.fulltext)==null?void 0:a.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(a=>{var n;return!a.selected&&((n=a.label)==null?void 0:n.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const a=i[0];a!=null&&a.label&&(e.value=a.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,a,n,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((n=(a=t.relatedTarget)==null?void 0:a.closest("pkt-combobox"))==null?void 0:n.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,d=this.findValueInOptions(h);!this._value.includes(h)&&!d?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):d&&!this._value.includes(d.value)&&this.setSelected(d.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;this.disabled||(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,a;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,(a=this.arrowRef.value)==null||a.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 a=this._value.find(h=>h.toLowerCase()===i),n=this._options.filter(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase().includes(i))??!1}),r=n.find(h=>{var d;return((d=h.label)==null?void 0:d.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((n.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(n.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!a:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case n.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 a=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,n=this._value.includes(t||a||""),r=!!a,h=((i=this._options.find(C=>C.value===t))==null?void 0:i.disabled)||!1,d=!(t!=null&&t.trim()),p=!this.multiple,m=this.multiple,f=this.isMaxItemsReached();let k=!1,b=!0,y="",w="";h||(!r&&this.allowUserInput&&!d?(this.addNewUserValue(t),y="Ny verdi lagt til",k=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),b=!1,k=!0,y="Ingen treff i søket"):n?(this.removeValue(a),k=!0):d&&p?(this.removeAllSelected(),k=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(a),k=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!f?(this.setSelected(a),k=!0):m&&f?(this._userInfoMessage="Maks antall valg nådd",b=!1,w=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,k=!0,w=t),this._isOptionsOpen=k,k||window.setTimeout(()=>{var C;(C=this.focusRef.value)==null||C.focus()},0),this._userInfoMessage=y,this._search=w||"",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()}};tt([o({type:String,reflect:!0})],Q.prototype,"value",2),tt([o({type:Array})],Q.prototype,"options",2),tt([o({type:Array})],Q.prototype,"defaultOptions",2),tt([o({type:Boolean})],Q.prototype,"allowUserInput",2),tt([o({type:Boolean})],Q.prototype,"typeahead",2),tt([o({type:Boolean})],Q.prototype,"includeSearch",2),tt([o({type:String})],Q.prototype,"searchPlaceholder",2),tt([o({type:Boolean})],Q.prototype,"multiple",2),tt([o({type:Number})],Q.prototype,"maxlength",2),tt([o({type:String})],Q.prototype,"displayValueAs",2),tt([o({type:String})],Q.prototype,"tagPlacement",2),tt([F()],Q.prototype,"_options",2),tt([F()],Q.prototype,"_isOptionsOpen",2),tt([F()],Q.prototype,"_value",2),tt([F()],Q.prototype,"_userInfoMessage",2),tt([F()],Q.prototype,"_addValueText",2),tt([F()],Q.prototype,"_maxIsReached",2),tt([F()],Q.prototype,"_search",2),tt([F()],Q.prototype,"_inputFocus",2),tt([F()],Q.prototype,"_editingSingleValue",2),Q=tt([j("pkt-combobox")],Q);const xl={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 Sl=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,ee=(s,t,e,i)=>{for(var a=i>1?void 0:i?Cl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Sl(t,e,a),a};let Ei=null;function Tl(){return Ei||(Ei=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)}),Ei)}let Ut=class extends Y{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||xl.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,a)=>(i[a.name]=a.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 Tl(),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}>
|
|
719
719
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
720
720
|
${this.triggerText}
|
|
721
721
|
</a>`:this.triggerType==="icon"?u`<pkt-button
|
|
@@ -725,7 +725,7 @@
|
|
|
725
725
|
@click=${this.openModal}
|
|
726
726
|
>
|
|
727
727
|
>${this.triggerText}</pkt-button
|
|
728
|
-
>`:u`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ee([o({type:Boolean})],
|
|
728
|
+
>`:u`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ee([o({type:Boolean})],Ut.prototype,"devMode",2),ee([o({type:String})],Ut.prototype,"hotjarId",2),ee([o({type:String})],Ut.prototype,"googleAnalyticsId",2),ee([o({type:String})],Ut.prototype,"cookieDomain",2),ee([o({type:String})],Ut.prototype,"cookieSecure",2),ee([o({type:String})],Ut.prototype,"cookieExpiryDays",2),ee([o({type:String})],Ut.prototype,"triggerType",2),ee([o({type:String})],Ut.prototype,"triggerText",2),ee([o({type:String})],Ut.prototype,"i18nLanguage",2),Ut=ee([j("pkt-consent")],Ut);var Nl=Object.defineProperty,Al=Object.getOwnPropertyDescriptor,$t=(s,t,e,i)=>{for(var a=i>1?void 0:i?Al(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Nl(t,e,a),a};let yt=class extends D{constructor(){super(...arguments),this.inputRef=A(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,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),super.attributeChangedCallback(t,e,i)}firstUpdated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(t)}updated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.updated(t)}render(){const t=O({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=O({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=O({"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}),a="pkt-tag pkt-tag--small pkt-tag--thin-text",n=()=>u`
|
|
729
729
|
${this.tagText?u`<span class=${a+" pkt-tag--gray"}>${this.tagText}</span>`:$}
|
|
730
730
|
${this.optionalTag?u`<span class=${a+" pkt-tag--blue-light"}>${this.optionalText}</span>`:$}
|
|
731
731
|
${this.requiredTag?u`<span class=${a+" pkt-tag--beige"}>${this.requiredText}</span>`:$}
|
|
@@ -744,7 +744,7 @@
|
|
|
744
744
|
type="checkbox"
|
|
745
745
|
?disabled=${this.disabled}
|
|
746
746
|
name=${this.name+"-internal"}
|
|
747
|
-
${
|
|
747
|
+
${E(this.inputRef)}
|
|
748
748
|
@change=${this.handleChange}
|
|
749
749
|
@click=${this.handleClick}
|
|
750
750
|
@blur=${this.onBlur}
|
|
@@ -755,7 +755,7 @@
|
|
|
755
755
|
${this.labelPosition==="right"?r():$}
|
|
756
756
|
</div>
|
|
757
757
|
</div>
|
|
758
|
-
`}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))}};$t([o({type:String,reflect:!0})],yt.prototype,"value",2),$t([o({type:String})],yt.prototype,"checkHelptext",2),$t([o({type:Boolean})],yt.prototype,"defaultChecked",2),$t([o({type:Boolean})],yt.prototype,"hasTile",2),$t([o({type:Boolean})],yt.prototype,"isSwitch",2),$t([o({type:String})],yt.prototype,"labelPosition",2),$t([o({type:Boolean})],yt.prototype,"hideLabel",2),$t([o({type:Boolean,reflect:!0})],yt.prototype,"checked",2),$t([o({type:String,reflect:!0})],yt.prototype,"type",2),$t([o({type:String})],yt.prototype,"tagText",2),$t([o({type:Boolean})],yt.prototype,"optionalTag",2),$t([o({type:String})],yt.prototype,"optionalText",2),$t([o({type:Boolean})],yt.prototype,"requiredTag",2),$t([o({type:String})],yt.prototype,"requiredText",2),yt=$t([
|
|
758
|
+
`}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))}};$t([o({type:String,reflect:!0})],yt.prototype,"value",2),$t([o({type:String})],yt.prototype,"checkHelptext",2),$t([o({type:Boolean})],yt.prototype,"defaultChecked",2),$t([o({type:Boolean})],yt.prototype,"hasTile",2),$t([o({type:Boolean})],yt.prototype,"isSwitch",2),$t([o({type:String})],yt.prototype,"labelPosition",2),$t([o({type:Boolean})],yt.prototype,"hideLabel",2),$t([o({type:Boolean,reflect:!0})],yt.prototype,"checked",2),$t([o({type:String,reflect:!0})],yt.prototype,"type",2),$t([o({type:String})],yt.prototype,"tagText",2),$t([o({type:Boolean})],yt.prototype,"optionalTag",2),$t([o({type:String})],yt.prototype,"optionalText",2),$t([o({type:Boolean})],yt.prototype,"requiredTag",2),$t([o({type:String})],yt.prototype,"requiredText",2),yt=$t([j("pkt-checkbox")],yt);const El=s=>new Promise(t=>setTimeout(t,s)),Ie={isIOS(){const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)}},se={parseValue(s){return s?Array.isArray(s)?s.filter(Boolean):typeof s=="string"?s.split(",").filter(Boolean):String(s).split(",").filter(Boolean):[]},formatValue(s){return s.join(",")},normalizeNameForMultiple(s,t,e){return s?(t||e)&&!s.endsWith("[]")?s+"[]":s:null},normalizeStringArray(s){return typeof s=="string"?s.split(",").filter(Boolean):Array.isArray(s)?s:[]},validateRangeOrder(s){return!s||s.length!==2?!0:Yo(s[0],s[1])},sortDates(s){return Go(s)},filterSelectableDates(s,t,e,i,a){return Ko(s,t,e,i,a)}},Ol={getInputType(){return Ie.isIOS()?"text":"date"}},Es={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,a){var n,r,h,d;const p=s.value;p&&(e&&e>p?t.setValidity({rangeUnderflow:!0},((r=(n=a==null?void 0:a.forms)==null?void 0:n.messages)==null?void 0:r.rangeUnderflow)||"Value is below minimum",s):i&&i<p&&t.setValidity({rangeOverflow:!0},((d=(h=a==null?void 0:a.forms)==null?void 0:h.messages)==null?void 0:d.rangeOverflow)||"Value is above maximum",s))}},ni={addToSelected(s,t,e,i){const a=s.target;if(!a.value)return;const n=e?oe(e):null,r=i?oe(i):null,h=oe(a.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!n||h>=n)&&(!r||h<=r)&&t.value&&t.value.handleDateSelect(h),a.value=""},handleCalendarPosition(s,t,e=!1){var i;if(!s.value||!t.value)return;const a=((i=t.value.parentElement)==null?void 0:i.getBoundingClientRect())||t.value.getBoundingClientRect(),n=e?a.height+30:a.height,r=s.value.getBoundingClientRect().height;let h=e?"calc(100% - 30px)":"100%";a&&a.top+r>window.innerHeight&&a.top-r>0&&(h=`calc(100% - ${n}px - ${r}px)`),s.value.style.top=h}},Os={getInputClasses(s,t,e,i,a,n){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":a===!1&&n==="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}}},Oi={processDateSelection(s,t,e){return!t&&!e?s[0]||"":Array.isArray(s)?s.join(","):s},updateInputValues(s,t,e,i,a,n){s.value&&(i&&t!=null&&t.value?(s.value.value=e[0]??"",t.value.value=e[1]??"",n(s.value),n(t.value)):a||(s.value.value=e.length?e[0]:"",n(s.value)))},processRangeBlur(s,t,e,i,a){var n;const r=s.target;if(r.value){a(r);const h=be(r.value);h&&t[0]!==r.value&&t[1]&&(i(),(n=e==null?void 0:e.value)==null||n.handleDateSelect(h))}else t[0]&&i()}},Le={handleInputKeydown(s,t,e,i,a,n){const{key:r}=s;r===","&&(s.preventDefault(),n?n(s):a&&a()),(r==="Space"||r===" ")&&(s.preventDefault(),t(s)),r==="Enter"&&(s.preventDefault(),e?e():i?i():a&&a())},handleButtonKeydown(s,t){const{key:e}=s;(e==="Enter"||e===" "||e==="Space")&&(s.preventDefault(),t(s))}};var Pl=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,Ps=(s,t,e,i)=>{for(var a=i>1?void 0:i?Ml(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Pl(t,e,a),a};let ss=class extends Y{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=ke()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},u`
|
|
759
759
|
<div class=${O(this.classes)} aria-live="polite">
|
|
760
760
|
${Array.isArray(this.dates)&&this.dates[0]?Ai(se.sortDates((this.dates??[]).filter(Boolean)),t=>t,t=>{var e;return u` <pkt-tag
|
|
761
761
|
id=${this.idBase+t+"-tag"}
|
|
@@ -766,16 +766,16 @@
|
|
|
766
766
|
<time datetime=${t}>${Va(t,this.dateformat)}</time>
|
|
767
767
|
</pkt-tag>`}):$}
|
|
768
768
|
</div>
|
|
769
|
-
`}};Ps([o({type:Array})],ss.prototype,"dates",2),Ps([o({type:String})],ss.prototype,"dateformat",2),Ps([o({type:String,attribute:"class"})],ss.prototype,"className",2),Ps([o({type:String,attribute:"id-base"})],ss.prototype,"idBase",2),ss=Ps([
|
|
769
|
+
`}};Ps([o({type:Array})],ss.prototype,"dates",2),Ps([o({type:String})],ss.prototype,"dateformat",2),Ps([o({type:String,attribute:"class"})],ss.prototype,"className",2),Ps([o({type:String,attribute:"id-base"})],ss.prototype,"idBase",2),ss=Ps([j("pkt-date-tags")],ss);const Dl={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},Ms={props:Dl};var Il=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,Et=(s,t,e,i)=>{for(var a=i>1?void 0:i?Ll(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Il(t,e,a),a};let wt=class extends Y{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=A(),this.calendarRef=A(),this.handleDocumentClick=t=>{if(!this.open)return;const e=t.composedPath(),i=this.parentElement,a=this.popupRef.value;!e.includes(this)&&!e.includes(a)&&!(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 ni.addToSelected=="function")return ni.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`
|
|
770
770
|
<div
|
|
771
771
|
class="${O(t)}"
|
|
772
|
-
${
|
|
772
|
+
${E(this.popupRef)}
|
|
773
773
|
id="date-popup"
|
|
774
774
|
?hidden=${!this.open}
|
|
775
775
|
aria-hidden="${!this.open}"
|
|
776
776
|
>
|
|
777
777
|
<pkt-calendar
|
|
778
|
-
${
|
|
778
|
+
${E(this.calendarRef)}
|
|
779
779
|
?multiple=${this.multiple}
|
|
780
780
|
?range=${this.range}
|
|
781
781
|
?weeknumbers=${this.weeknumbers}
|
|
@@ -791,7 +791,7 @@
|
|
|
791
791
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
792
792
|
></pkt-calendar>
|
|
793
793
|
</div>
|
|
794
|
-
`}};Et([o({type:Boolean,reflect:!0})],wt.prototype,"open",2),Et([o({type:Boolean})],wt.prototype,"multiple",2),Et([o({type:Boolean})],wt.prototype,"range",2),Et([o({type:Boolean})],wt.prototype,"weeknumbers",2),Et([o({type:Boolean})],wt.prototype,"withcontrols",2),Et([o({type:Number})],wt.prototype,"maxMultiple",2),Et([o({type:Array})],wt.prototype,"selected",2),Et([o({type:String})],wt.prototype,"earliest",2),Et([o({type:String})],wt.prototype,"latest",2),Et([o({type:Array})],wt.prototype,"excludedates",2),Et([o({type:Array})],wt.prototype,"excludeweekdays",2),Et([o({type:String})],wt.prototype,"currentmonth",2),wt=Et([
|
|
794
|
+
`}};Et([o({type:Boolean,reflect:!0})],wt.prototype,"open",2),Et([o({type:Boolean})],wt.prototype,"multiple",2),Et([o({type:Boolean})],wt.prototype,"range",2),Et([o({type:Boolean})],wt.prototype,"weeknumbers",2),Et([o({type:Boolean})],wt.prototype,"withcontrols",2),Et([o({type:Number})],wt.prototype,"maxMultiple",2),Et([o({type:Array})],wt.prototype,"selected",2),Et([o({type:String})],wt.prototype,"earliest",2),Et([o({type:String})],wt.prototype,"latest",2),Et([o({type:Array})],wt.prototype,"excludedates",2),Et([o({type:Array})],wt.prototype,"excludeweekdays",2),Et([o({type:String})],wt.prototype,"currentmonth",2),wt=Et([j("pkt-datepicker-popup")],wt);var Bl=Object.defineProperty,Fl=Object.getOwnPropertyDescriptor,qt=(s,t,e,i)=>{for(var a=i>1?void 0:i?Fl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Bl(t,e,a),a};let Ot=class extends Y{constructor(){super(...arguments),this.value="",this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=A(),this.btnRef=A()}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}))}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return u`
|
|
795
795
|
<div class="pkt-input__container">
|
|
796
796
|
<input
|
|
797
797
|
class="${O(this.inputClasses)}"
|
|
@@ -811,7 +811,7 @@
|
|
|
811
811
|
@focus=${()=>{this.dispatchFocus(),Ie.isIOS()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
812
812
|
@blur=${t=>{this.dispatchBlur(t),this.dispatchManageValidity(t.target),this.dispatchEvent(new CustomEvent("value-change",{detail:t.target.value,bubbles:!0,composed:!0}))}}
|
|
813
813
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
814
|
-
${
|
|
814
|
+
${E(this.inputRef)}
|
|
815
815
|
/>
|
|
816
816
|
<button
|
|
817
817
|
class="${O(Os.getButtonClasses())}"
|
|
@@ -819,13 +819,13 @@
|
|
|
819
819
|
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
820
820
|
@keydown=${t=>Le.handleButtonKeydown(t,e=>this.dispatchToggleCalendar(e))}
|
|
821
821
|
?disabled=${this.disabled}
|
|
822
|
-
${
|
|
822
|
+
${E(this.btnRef)}
|
|
823
823
|
>
|
|
824
824
|
<pkt-icon name="calendar"></pkt-icon>
|
|
825
825
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
826
826
|
</button>
|
|
827
827
|
</div>
|
|
828
|
-
`}};
|
|
828
|
+
`}};qt([o({type:String})],Ot.prototype,"value",2),qt([o({type:String})],Ot.prototype,"inputType",2),qt([o({type:String})],Ot.prototype,"id",2),qt([o({type:String})],Ot.prototype,"min",2),qt([o({type:String})],Ot.prototype,"max",2),qt([o({type:String})],Ot.prototype,"placeholder",2),qt([o({type:Boolean})],Ot.prototype,"readonly",2),qt([o({type:Boolean})],Ot.prototype,"disabled",2),qt([o({type:Object})],Ot.prototype,"inputClasses",2),qt([o({type:Object})],Ot.prototype,"internals",2),qt([o({type:Object})],Ot.prototype,"strings",2),Ot=qt([j("pkt-datepicker-single")],Ot);var Vl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Pt=(s,t,e,i)=>{for(var a=i>1?void 0:i?jl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Vl(t,e,a),a};let xt=class extends Y{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.showRangeLabels=!1,this.inputClasses={},this.strings={generic:{from:"Fra",to:"Til"}},this.inputRef=A(),this.inputRefTo=A(),this.btnRef=A()}get inputElement(){return this.inputRef.value}get inputElementTo(){return this.inputRefTo.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}))}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){const t=Os.getRangeLabelClasses(this.showRangeLabels);return u`
|
|
829
829
|
<div class="pkt-input__container">
|
|
830
830
|
${this.showRangeLabels?u` <div class="pkt-input-prefix">${this.strings.generic.from}</div> `:$}
|
|
831
831
|
<input
|
|
@@ -845,7 +845,7 @@
|
|
|
845
845
|
@focus=${()=>{this.dispatchFocus(),Ie.isIOS()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
846
846
|
@blur=${e=>{this.dispatchEvent(new CustomEvent("range-blur",{detail:{event:e,values:this.value,inputType:"from"},bubbles:!0,composed:!0}))}}
|
|
847
847
|
@change=${e=>{e.stopImmediatePropagation()}}
|
|
848
|
-
${
|
|
848
|
+
${E(this.inputRef)}
|
|
849
849
|
/>
|
|
850
850
|
<div class="${O(t)}" id="${this.id}-to-label">
|
|
851
851
|
${this.strings.generic.to}
|
|
@@ -869,7 +869,7 @@
|
|
|
869
869
|
@focus=${()=>{this.dispatchFocus(),Ie.isIOS()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
870
870
|
@blur=${e=>{this.dispatchBlur(e),e.target.value&&(this.dispatchManageValidity(e.target),this.dispatchEvent(new CustomEvent("validate-date-input",{detail:e.target,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("handle-date-select",{detail:e.target.value,bubbles:!0,composed:!0})))}}
|
|
871
871
|
@change=${e=>{this.dispatchChange(e),e.stopImmediatePropagation()}}
|
|
872
|
-
${
|
|
872
|
+
${E(this.inputRefTo)}
|
|
873
873
|
/>
|
|
874
874
|
<button
|
|
875
875
|
class="${O(Os.getButtonClasses())}"
|
|
@@ -877,13 +877,13 @@
|
|
|
877
877
|
@click=${e=>this.dispatchToggleCalendar(e)}
|
|
878
878
|
@keydown=${e=>Le.handleButtonKeydown(e,i=>this.dispatchToggleCalendar(i))}
|
|
879
879
|
?disabled=${this.disabled}
|
|
880
|
-
${
|
|
880
|
+
${E(this.btnRef)}
|
|
881
881
|
>
|
|
882
882
|
<pkt-icon name="calendar"></pkt-icon>
|
|
883
883
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
884
884
|
</button>
|
|
885
885
|
</div>
|
|
886
|
-
`}};Pt([o({type:Array})],xt.prototype,"value",2),Pt([o({type:String})],xt.prototype,"inputType",2),Pt([o({type:String})],xt.prototype,"id",2),Pt([o({type:String})],xt.prototype,"min",2),Pt([o({type:String})],xt.prototype,"max",2),Pt([o({type:String})],xt.prototype,"placeholder",2),Pt([o({type:Boolean})],xt.prototype,"readonly",2),Pt([o({type:Boolean})],xt.prototype,"disabled",2),Pt([o({type:Boolean})],xt.prototype,"showRangeLabels",2),Pt([o({type:Object})],xt.prototype,"inputClasses",2),Pt([o({type:Object})],xt.prototype,"internals",2),Pt([o({type:Object})],xt.prototype,"strings",2),xt=Pt([
|
|
886
|
+
`}};Pt([o({type:Array})],xt.prototype,"value",2),Pt([o({type:String})],xt.prototype,"inputType",2),Pt([o({type:String})],xt.prototype,"id",2),Pt([o({type:String})],xt.prototype,"min",2),Pt([o({type:String})],xt.prototype,"max",2),Pt([o({type:String})],xt.prototype,"placeholder",2),Pt([o({type:Boolean})],xt.prototype,"readonly",2),Pt([o({type:Boolean})],xt.prototype,"disabled",2),Pt([o({type:Boolean})],xt.prototype,"showRangeLabels",2),Pt([o({type:Object})],xt.prototype,"inputClasses",2),Pt([o({type:Object})],xt.prototype,"internals",2),Pt([o({type:Object})],xt.prototype,"strings",2),xt=Pt([j("pkt-datepicker-range")],xt);var Hl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,Mt=(s,t,e,i)=>{for(var a=i>1?void 0:i?Ul(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Hl(t,e,a),a};let St=class extends Y{constructor(){super(...arguments),this.value=[],this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.strings={calendar:{buttonAltText:"Åpne kalender"}},this.inputRef=A(),this.btnRef=A()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}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}))}dispatchAddToSelected(t){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:t,bubbles:!0,composed:!0}))}createRenderRoot(){return this}render(){return u`
|
|
887
887
|
<div class="pkt-input__container">
|
|
888
888
|
<input
|
|
889
889
|
class=${O(this.inputClasses)}
|
|
@@ -901,7 +901,7 @@
|
|
|
901
901
|
@focus=${()=>{this.dispatchFocus(),Ie.isIOS()&&this.dispatchToggleCalendar(new Event("focus"))}}
|
|
902
902
|
@keydown=${t=>Le.handleInputKeydown(t,e=>this.dispatchToggleCalendar(e),()=>Es.submitFormOrFallback(this.internals,()=>{var e;return(e=this.inputRef.value)==null?void 0:e.blur()}),void 0,void 0,e=>this.dispatchAddToSelected(e))}
|
|
903
903
|
@change=${t=>{this.dispatchChange(t),t.stopImmediatePropagation()}}
|
|
904
|
-
${
|
|
904
|
+
${E(this.inputRef)}
|
|
905
905
|
/>
|
|
906
906
|
<button
|
|
907
907
|
class="${O(Os.getButtonClasses())}"
|
|
@@ -909,13 +909,13 @@
|
|
|
909
909
|
@click=${t=>this.dispatchToggleCalendar(t)}
|
|
910
910
|
@keydown=${t=>Le.handleButtonKeydown(t,e=>this.dispatchToggleCalendar(e))}
|
|
911
911
|
?disabled=${this.disabled}
|
|
912
|
-
${
|
|
912
|
+
${E(this.btnRef)}
|
|
913
913
|
>
|
|
914
914
|
<pkt-icon name="calendar"></pkt-icon>
|
|
915
915
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
916
916
|
</button>
|
|
917
917
|
</div>
|
|
918
|
-
`}};Mt([o({type:Array})],St.prototype,"value",2),Mt([o({type:String})],St.prototype,"inputType",2),Mt([o({type:String})],St.prototype,"id",2),Mt([o({type:String})],St.prototype,"min",2),Mt([o({type:String})],St.prototype,"max",2),Mt([o({type:String})],St.prototype,"placeholder",2),Mt([o({type:Boolean})],St.prototype,"readonly",2),Mt([o({type:Boolean})],St.prototype,"disabled",2),Mt([o({type:Number})],St.prototype,"maxlength",2),Mt([o({type:Object})],St.prototype,"inputClasses",2),Mt([o({type:Object})],St.prototype,"internals",2),Mt([o({type:Object})],St.prototype,"strings",2),St=Mt([
|
|
918
|
+
`}};Mt([o({type:Array})],St.prototype,"value",2),Mt([o({type:String})],St.prototype,"inputType",2),Mt([o({type:String})],St.prototype,"id",2),Mt([o({type:String})],St.prototype,"min",2),Mt([o({type:String})],St.prototype,"max",2),Mt([o({type:String})],St.prototype,"placeholder",2),Mt([o({type:Boolean})],St.prototype,"readonly",2),Mt([o({type:Boolean})],St.prototype,"disabled",2),Mt([o({type:Number})],St.prototype,"maxlength",2),Mt([o({type:Object})],St.prototype,"inputClasses",2),Mt([o({type:Object})],St.prototype,"internals",2),Mt([o({type:Object})],St.prototype,"strings",2),St=Mt([j("pkt-datepicker-multiple")],St);var ql=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,ht=(s,t,e,i)=>{for(var a=i>1?void 0:i?zl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&ql(t,e,a),a};let et=class extends D{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=A(),this._value=[],this.label="Datovelger",this.dateformat=Ms.props.dateformat.default,this.multiple=Ms.props.multiple.default,this.maxlength=null,this.range=Ms.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=Ms.props.weeknumbers.default,this.withcontrols=Ms.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=A(),this.popupRef=A(),this.helptextSlot=A(),this.singleInputRef=A(),this.rangeInputRef=A(),this.multipleInputRef=A(),this.addToSelected=t=>{const e=this.datepickerPopupRef.value;return e&&typeof e.addToSelected=="function"?e.addToSelected(t,this.min,this.max):ni.addToSelected(t,this.calRef,this.min,this.max)},this.slotController=new at(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 Ol.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=se.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=se.parseValue(t),a=this.multiple&&i.length>1?se.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!se.validateRangeOrder(a)){this._value=[],this._valueProperty="",super.valueChanged("",e);return}this._value=a;const n=se.formatValue(a);this._valueProperty!==n&&(this._valueProperty=n),super.valueChanged(n,e)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&this.valueChanged(i,e),t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=se.normalizeStringArray(i||"")),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=se.normalizeStringArray(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"),a=Array.isArray(i)?i.join(","):i;this.valueChanged(e,a)}(t.has("multiple")||t.has("range"))&&(this.name=se.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),t.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=se.parseValue(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`
|
|
919
919
|
<pkt-datepicker-single
|
|
920
920
|
.value=${this._value[0]??""}
|
|
921
921
|
.inputType=${this.inputType}
|
|
@@ -935,7 +935,7 @@
|
|
|
935
935
|
@manage-validity=${t=>this.manageValidity(t.detail)}
|
|
936
936
|
@value-change=${t=>{this.value=t.detail}}
|
|
937
937
|
@input-changed=${()=>{this.touched=!0}}
|
|
938
|
-
${
|
|
938
|
+
${E(this.singleInputRef)}
|
|
939
939
|
></pkt-datepicker-single>
|
|
940
940
|
`}renderRangeInput(){return u`
|
|
941
941
|
<pkt-datepicker-range
|
|
@@ -960,7 +960,7 @@
|
|
|
960
960
|
@validate-date-input=${t=>{Es.validateDateInput(t.detail,this.internals,this.min,this.max,this.strings)}}
|
|
961
961
|
@handle-date-select=${t=>{var e,i;const a=be(t.detail);a&&this._value[1]!==nt(a)&&((i=(e=this.calRef)==null?void 0:e.value)==null||i.handleDateSelect(a))}}
|
|
962
962
|
@input-changed=${()=>{this.touched=!0}}
|
|
963
|
-
${
|
|
963
|
+
${E(this.rangeInputRef)}
|
|
964
964
|
></pkt-datepicker-range>
|
|
965
965
|
`}renderMultipleInput(){return u`
|
|
966
966
|
<pkt-datepicker-multiple
|
|
@@ -982,7 +982,7 @@
|
|
|
982
982
|
@input-blur=${t=>{var e;(e=this.calRef.value)!=null&&e.contains(t.detail.relatedTarget)||this.onBlur()}}
|
|
983
983
|
@add-to-selected=${t=>this.addToSelected(t.detail)}
|
|
984
984
|
@input-changed=${()=>{this.touched=!0}}
|
|
985
|
-
${
|
|
985
|
+
${E(this.multipleInputRef)}
|
|
986
986
|
></pkt-datepicker-multiple>
|
|
987
987
|
`}renderCalendar(){return u`
|
|
988
988
|
<pkt-datepicker-popup
|
|
@@ -1001,7 +1001,7 @@
|
|
|
1001
1001
|
.currentmonth=${this.currentmonth?ve(this.currentmonth):null}
|
|
1002
1002
|
@date-selected=${t=>{this.value=Oi.processDateSelection(t.detail,this.multiple,this.range),this._value=t.detail,Oi.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,e=>this.manageValidity(e))}}
|
|
1003
1003
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
1004
|
-
${
|
|
1004
|
+
${E(this.datepickerPopupRef)}
|
|
1005
1005
|
></pkt-datepicker-popup>
|
|
1006
1006
|
`}render(){return this.inputClasses=Os.getInputClasses(this.fullwidth,this.showRangeLabels,this.multiple,this.range,this.readonly,this.inputType),u`
|
|
1007
1007
|
<pkt-input-wrapper
|
|
@@ -1028,7 +1028,7 @@
|
|
|
1028
1028
|
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
1029
1029
|
class="pkt-datepicker"
|
|
1030
1030
|
>
|
|
1031
|
-
<div class="pkt-contents" ${
|
|
1031
|
+
<div class="pkt-contents" ${E(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1032
1032
|
${this.multiple?u`<pkt-date-tags
|
|
1033
1033
|
.dates=${this._value}
|
|
1034
1034
|
dateformat=${this.dateformat}
|
|
@@ -1043,13 +1043,13 @@
|
|
|
1043
1043
|
</div>
|
|
1044
1044
|
</pkt-input-wrapper>
|
|
1045
1045
|
${this.renderCalendar()}
|
|
1046
|
-
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;ni.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(),Ie.isIOS()&&e.focusOnCurrentDate();return}await
|
|
1046
|
+
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;ni.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(),Ie.isIOS()&&e.focusOnCurrentDate();return}await El(20),this.handleCalendarPosition(),Ie.isIOS()&&((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=""}};ht([o({type:String,reflect:!0})],et.prototype,"value",1),ht([o({type:Array})],et.prototype,"_value",2),ht([o({type:String,reflect:!0})],et.prototype,"label",2),ht([o({type:String})],et.prototype,"dateformat",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"multiple",2),ht([o({type:Number,reflect:!0})],et.prototype,"maxlength",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"range",2),ht([o({type:Boolean})],et.prototype,"showRangeLabels",2),ht([o({type:String,reflect:!0})],et.prototype,"min",2),ht([o({type:String,reflect:!0})],et.prototype,"max",2),ht([o({type:Boolean})],et.prototype,"weeknumbers",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"withcontrols",2),ht([o({converter:ts.csvToArray})],et.prototype,"excludedates",2),ht([o({converter:ts.csvToArray})],et.prototype,"excludeweekdays",2),ht([o({type:String})],et.prototype,"currentmonth",2),ht([o({type:Boolean,reflect:!0})],et.prototype,"calendarOpen",2),ht([o({type:String})],et.prototype,"timezone",2),ht([F()],et.prototype,"inputClasses",2),et=ht([j("pkt-datepicker")],et);const Wl={href:{default:"#"},target:{default:"_self"}},Ra={props:Wl};var Rl=Object.defineProperty,Kl=Object.getOwnPropertyDescriptor,is=(s,t,e,i)=>{for(var a=i>1?void 0:i?Kl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Rl(t,e,a),a};let Be=class extends Y{constructor(){super(),this.defaultSlot=A(),this.href=Ra.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=Ra.props.target.default,this.slotController=new at(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
|
|
1047
1047
|
class=${O(t)}
|
|
1048
1048
|
href=${this.href}
|
|
1049
1049
|
.target=${this.target}
|
|
1050
1050
|
.rel=${this.external?"noopener noreferrer":$}
|
|
1051
|
-
>${this.iconName?u`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${
|
|
1052
|
-
>`}};is([o({type:String,reflect:!0})],Be.prototype,"href",2),is([o({type:String,reflect:!0})],Be.prototype,"iconName",2),is([o({type:String,reflect:!0})],Be.prototype,"iconPosition",2),is([o({type:Boolean,reflect:!0})],Be.prototype,"external",2),is([o({type:String,reflect:!0})],Be.prototype,"target",2),Be=is([
|
|
1051
|
+
>${this.iconName?u`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${E(this.defaultSlot)}>Link</span></a
|
|
1052
|
+
>`}};is([o({type:String,reflect:!0})],Be.prototype,"href",2),is([o({type:String,reflect:!0})],Be.prototype,"iconName",2),is([o({type:String,reflect:!0})],Be.prototype,"iconPosition",2),is([o({type:Boolean,reflect:!0})],Be.prototype,"external",2),is([o({type:String,reflect:!0})],Be.prototype,"target",2),Be=is([j("pkt-link")],Be);var Gl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,Fe=(s,t,e,i)=>{for(var a=i>1?void 0:i?Yl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Gl(t,e,a),a};let $e=class extends Y{constructor(){super(),this.defaultSlot=A(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new at(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`
|
|
1053
1053
|
<a
|
|
1054
1054
|
href=${this.href}
|
|
1055
1055
|
class=${t}
|
|
@@ -1059,9 +1059,9 @@
|
|
|
1059
1059
|
${this.iconName&&u`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
1060
1060
|
${this.title&&u`<div class=${e}>${this.title}</div>`}
|
|
1061
1061
|
|
|
1062
|
-
<div class="pkt-linkcard__text" ${
|
|
1062
|
+
<div class="pkt-linkcard__text" ${E(this.defaultSlot)}></div>
|
|
1063
1063
|
</a>
|
|
1064
|
-
`}};Fe([o({type:String,reflect:!0})],$e.prototype,"title",2),Fe([o({type:String,reflect:!0})],$e.prototype,"href",2),Fe([o({type:String,reflect:!0})],$e.prototype,"iconName",2),Fe([o({type:Boolean,reflect:!0})],$e.prototype,"external",2),Fe([o({type:Boolean,reflect:!0})],$e.prototype,"openInNewTab",2),Fe([o({type:String,reflect:!0})],$e.prototype,"skin",2),$e=Fe([
|
|
1064
|
+
`}};Fe([o({type:String,reflect:!0})],$e.prototype,"title",2),Fe([o({type:String,reflect:!0})],$e.prototype,"href",2),Fe([o({type:String,reflect:!0})],$e.prototype,"iconName",2),Fe([o({type:Boolean,reflect:!0})],$e.prototype,"external",2),Fe([o({type:Boolean,reflect:!0})],$e.prototype,"openInNewTab",2),Fe([o({type:String,reflect:!0})],$e.prototype,"skin",2),$e=Fe([j("pkt-linkcard")],$e);var Zl=Object.defineProperty,Xl=Object.getOwnPropertyDescriptor,he=(s,t,e,i)=>{for(var a=i>1?void 0:i?Xl(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Zl(t,e,a),a};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/13.15/animations/";let Yt=class extends Y{constructor(){super(),this.defaultSlot=A(),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 at(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=O({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),e=O({"pkt-contents":!0,"pkt-hide":this.isLoading});return u`<div
|
|
1065
1065
|
role="status"
|
|
1066
1066
|
aria-live="polite"
|
|
1067
1067
|
aria-busy=${this.isLoading?"true":"false"}
|
|
@@ -1075,8 +1075,8 @@
|
|
|
1075
1075
|
></pkt-icon>
|
|
1076
1076
|
${this.message&&u`<p>${this.message}</p>`}
|
|
1077
1077
|
</div>`:$}
|
|
1078
|
-
<div class=${e} ${
|
|
1079
|
-
</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))}};he([o({type:Number})],Yt.prototype,"delay",2),he([o({type:Boolean})],Yt.prototype,"inline",2),he([o({type:Boolean})],Yt.prototype,"isLoading",2),he([o({type:String})],Yt.prototype,"message",2),he([o({type:String})],Yt.prototype,"size",2),he([o({type:String})],Yt.prototype,"variant",2),he([o({type:String})],Yt.prototype,"loadingAnimationPath",2),he([F()],Yt.prototype,"_shouldDisplayLoader",2),Yt=he([
|
|
1078
|
+
<div class=${e} ${E(this.defaultSlot)}></div>
|
|
1079
|
+
</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))}};he([o({type:Number})],Yt.prototype,"delay",2),he([o({type:Boolean})],Yt.prototype,"inline",2),he([o({type:Boolean})],Yt.prototype,"isLoading",2),he([o({type:String})],Yt.prototype,"message",2),he([o({type:String})],Yt.prototype,"size",2),he([o({type:String})],Yt.prototype,"variant",2),he([o({type:String})],Yt.prototype,"loadingAnimationPath",2),he([F()],Yt.prototype,"_shouldDisplayLoader",2),Yt=he([j("pkt-loader")],Yt);const Jl={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},Pi={props:Jl};var Ql=Object.defineProperty,th=Object.getOwnPropertyDescriptor,as=(s,t,e,i)=>{for(var a=i>1?void 0:i?th(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Ql(t,e,a),a};let Ve=class extends Y{constructor(){super(),this.defaultSlot=A(),this.closable=Pi.props.closable.default,this.compact=Pi.props.compact.default,this.title="",this.skin=Pi.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 at(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&ka(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=${O(s)}>
|
|
1080
1080
|
${this.closable?u`<div class="pkt-messagebox__close">
|
|
1081
1081
|
<button
|
|
1082
1082
|
@click=${this.close}
|
|
@@ -1087,11 +1087,11 @@
|
|
|
1087
1087
|
</button>
|
|
1088
1088
|
</div>`:$}
|
|
1089
1089
|
${this.title?u`<div class="pkt-messagebox__title">${this.title}</div>`:$}
|
|
1090
|
-
<div class="pkt-messagebox__text" ${
|
|
1091
|
-
</div>`}};as([o({type:Boolean,reflect:!0})],Ve.prototype,"closable",2),as([o({type:Boolean,reflect:!0})],Ve.prototype,"compact",2),as([o({type:String,reflect:!0})],Ve.prototype,"title",2),as([o({type:String,reflect:!0})],Ve.prototype,"skin",2),as([F()],Ve.prototype,"_isClosed",2),Ve=as([
|
|
1090
|
+
<div class="pkt-messagebox__text" ${E(this.defaultSlot)}></div>
|
|
1091
|
+
</div>`}};as([o({type:Boolean,reflect:!0})],Ve.prototype,"closable",2),as([o({type:Boolean,reflect:!0})],Ve.prototype,"compact",2),as([o({type:String,reflect:!0})],Ve.prototype,"title",2),as([o({type:String,reflect:!0})],Ve.prototype,"skin",2),as([F()],Ve.prototype,"_isClosed",2),Ve=as([j("pkt-messagebox")],Ve);const eh={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},Mi={props:eh};var sh=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,Zt=(s,t,e,i)=>{for(var a=i>1?void 0:i?ih(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&sh(t,e,a),a};let Dt=class extends Y{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=Mi.props.hideCloseButton.default,this.closeOnBackdropClick=Mi.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=Mi.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=A(),this.dialogRef=A(),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 a=document.activeElement;a&&!this.isElementInViewport(a)&&a.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 a;this.dialogRef.value&&((a=this.dialogRef.value)==null||a.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 at(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(()=>pd).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},a=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return u`
|
|
1092
1092
|
<dialog
|
|
1093
1093
|
class=${O(t)}
|
|
1094
|
-
${
|
|
1094
|
+
${E(this.dialogRef)}
|
|
1095
1095
|
aria-labelledby="pkt-modal__headingText"
|
|
1096
1096
|
aria-describedby="pkt-modal__content"
|
|
1097
1097
|
@close=${r=>this.close(r,!0)}
|
|
@@ -1119,19 +1119,19 @@
|
|
|
1119
1119
|
<div
|
|
1120
1120
|
id="pkt-modal__content"
|
|
1121
1121
|
class=${O(i)}
|
|
1122
|
-
${
|
|
1122
|
+
${E(this.defaultSlot)}
|
|
1123
1123
|
></div>
|
|
1124
1124
|
</div>
|
|
1125
1125
|
</div>
|
|
1126
1126
|
</dialog>
|
|
1127
|
-
`}};Zt([o({type:String})],Dt.prototype,"headingText",2),Zt([o({type:Boolean})],Dt.prototype,"removePadding",2),Zt([o({type:Boolean})],Dt.prototype,"hideCloseButton",2),Zt([o({type:Boolean})],Dt.prototype,"closeOnBackdropClick",2),Zt([o({type:String})],Dt.prototype,"closeButtonSkin",2),Zt([o({type:String})],Dt.prototype,"size",2),Zt([o({type:String})],Dt.prototype,"variant",2),Zt([o({type:String})],Dt.prototype,"drawerPosition",2),Zt([o({type:Boolean})],Dt.prototype,"transparentBackdrop",2),Zt([F()],Dt.prototype,"_isOpen",2),Dt=Zt([
|
|
1127
|
+
`}};Zt([o({type:String})],Dt.prototype,"headingText",2),Zt([o({type:Boolean})],Dt.prototype,"removePadding",2),Zt([o({type:Boolean})],Dt.prototype,"hideCloseButton",2),Zt([o({type:Boolean})],Dt.prototype,"closeOnBackdropClick",2),Zt([o({type:String})],Dt.prototype,"closeButtonSkin",2),Zt([o({type:String})],Dt.prototype,"size",2),Zt([o({type:String})],Dt.prototype,"variant",2),Zt([o({type:String})],Dt.prototype,"drawerPosition",2),Zt([o({type:Boolean})],Dt.prototype,"transparentBackdrop",2),Zt([F()],Dt.prototype,"_isOpen",2),Dt=Zt([j("pkt-modal")],Dt);/**
|
|
1128
1128
|
* @license
|
|
1129
1129
|
* Copyright 2018 Google LLC
|
|
1130
1130
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1131
|
-
*/const Ka="important",
|
|
1131
|
+
*/const Ka="important",ah=" !"+Ka,nh=Ce(class extends Ye{constructor(s){var t;if(super(s),s.type!==Rt.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 a=t[i];if(a!=null){this.ft.add(i);const n=typeof a=="string"&&a.endsWith(ah);i.includes("-")||n?e.setProperty(i,n?a.slice(0,-11):a,n?Ka:""):e[i]=a}}return _t}});var rh=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,dt=(s,t,e,i)=>{for(var a=i>1?void 0:i?oh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&rh(t,e,a),a};let st=class extends Y{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=ke(),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=A(),this.progressBarRef=A()}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||ke(),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),a=`${this.valueCurrent} av ${t}`,n=O({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),r=O({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),h=O({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),d=O({"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
|
|
1132
1132
|
class="pkt-progressbar__container"
|
|
1133
1133
|
.ref=${this.progressBarRef}
|
|
1134
|
-
style=${
|
|
1134
|
+
style=${nh({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${i}%`})}
|
|
1135
1135
|
>
|
|
1136
1136
|
${this.title?u`<p id=${`${this.progressBarId}-title`} class=${r}>${this.title}</p>`:$}
|
|
1137
1137
|
|
|
@@ -1140,11 +1140,11 @@
|
|
|
1140
1140
|
</div>
|
|
1141
1141
|
|
|
1142
1142
|
${s?u`<div class=${h}>
|
|
1143
|
-
<span class=${d} ${
|
|
1143
|
+
<span class=${d} ${E(this.labelRef)}>
|
|
1144
1144
|
${this.statusType==="percentage"?`${i}%`:a}
|
|
1145
1145
|
</span>
|
|
1146
1146
|
</div>`:$}
|
|
1147
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||ke(),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))}};dt([o({type:String})],st.prototype,"ariaLabel",2),dt([o({type:String,reflect:!0})],st.prototype,"ariaLabelledby",2),dt([o({type:String,reflect:!0})],st.prototype,"ariaValueText",2),dt([o({type:String})],st.prototype,"ariaLive",2),dt([o({type:String,reflect:!0})],st.prototype,"id",2),dt([o({type:String})],st.prototype,"role",2),dt([o({type:String})],st.prototype,"skin",2),dt([o({type:String})],st.prototype,"statusPlacement",2),dt([o({type:String})],st.prototype,"statusType",2),dt([o({type:String,reflect:!0})],st.prototype,"title",2),dt([o({type:String})],st.prototype,"titlePosition",2),dt([o({type:Number,reflect:!0})],st.prototype,"valueCurrent",2),dt([o({type:Number})],st.prototype,"valueMax",2),dt([o({type:Number})],st.prototype,"valueMin",2),dt([F()],st.prototype,"labelWidth",2),dt([F()],st.prototype,"progressbarId",2),dt([F()],st.prototype,"computedAriaLabelledby",2),dt([F()],st.prototype,"computedAriaValueText",2),st=dt([
|
|
1147
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||ke(),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))}};dt([o({type:String})],st.prototype,"ariaLabel",2),dt([o({type:String,reflect:!0})],st.prototype,"ariaLabelledby",2),dt([o({type:String,reflect:!0})],st.prototype,"ariaValueText",2),dt([o({type:String})],st.prototype,"ariaLive",2),dt([o({type:String,reflect:!0})],st.prototype,"id",2),dt([o({type:String})],st.prototype,"role",2),dt([o({type:String})],st.prototype,"skin",2),dt([o({type:String})],st.prototype,"statusPlacement",2),dt([o({type:String})],st.prototype,"statusType",2),dt([o({type:String,reflect:!0})],st.prototype,"title",2),dt([o({type:String})],st.prototype,"titlePosition",2),dt([o({type:Number,reflect:!0})],st.prototype,"valueCurrent",2),dt([o({type:Number})],st.prototype,"valueMax",2),dt([o({type:Number})],st.prototype,"valueMin",2),dt([F()],st.prototype,"labelWidth",2),dt([F()],st.prototype,"progressbarId",2),dt([F()],st.prototype,"computedAriaLabelledby",2),dt([F()],st.prototype,"computedAriaValueText",2),st=dt([j("pkt-progressbar")],st);var lh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,It=(s,t,e,i)=>{for(var a=i>1?void 0:i?hh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&lh(t,e,a),a};let Ct=class extends D{constructor(){super(...arguments),this.inputRef=A(),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=O({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=O({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),e=O({"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",a=()=>u`
|
|
1148
1148
|
${this.tagText?u`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:$}
|
|
1149
1149
|
${this.optionalTag?u`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:$}
|
|
1150
1150
|
${this.requiredTag?u`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:$}
|
|
@@ -1164,7 +1164,7 @@
|
|
|
1164
1164
|
?disabled=${this.disabled}
|
|
1165
1165
|
form=""
|
|
1166
1166
|
name=${this.name+"-internal"}
|
|
1167
|
-
${
|
|
1167
|
+
${E(this.inputRef)}
|
|
1168
1168
|
@change=${this.toggleChecked}
|
|
1169
1169
|
@input=${this.onInput}
|
|
1170
1170
|
@blur=${this.onBlur}
|
|
@@ -1174,7 +1174,7 @@
|
|
|
1174
1174
|
${n()}
|
|
1175
1175
|
</div>
|
|
1176
1176
|
</div>
|
|
1177
|
-
`}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))}};It([o({type:String,reflect:!0})],Ct.prototype,"value",2),It([o({type:String})],Ct.prototype,"checkHelptext",2),It([o({type:Boolean})],Ct.prototype,"defaultChecked",2),It([o({type:Boolean})],Ct.prototype,"hasTile",2),It([o({type:Boolean,reflect:!0})],Ct.prototype,"checked",2),It([o({type:String,reflect:!0})],Ct.prototype,"type",2),It([o({type:String})],Ct.prototype,"tagText",2),It([o({type:Boolean})],Ct.prototype,"optionalTag",2),It([o({type:String})],Ct.prototype,"optionalText",2),It([o({type:Boolean})],Ct.prototype,"requiredTag",2),It([o({type:String})],Ct.prototype,"requiredText",2),It([F()],Ct.prototype,"_checked",2),Ct=It([
|
|
1177
|
+
`}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))}};It([o({type:String,reflect:!0})],Ct.prototype,"value",2),It([o({type:String})],Ct.prototype,"checkHelptext",2),It([o({type:Boolean})],Ct.prototype,"defaultChecked",2),It([o({type:Boolean})],Ct.prototype,"hasTile",2),It([o({type:Boolean,reflect:!0})],Ct.prototype,"checked",2),It([o({type:String,reflect:!0})],Ct.prototype,"type",2),It([o({type:String})],Ct.prototype,"tagText",2),It([o({type:Boolean})],Ct.prototype,"optionalTag",2),It([o({type:String})],Ct.prototype,"optionalText",2),It([o({type:Boolean})],Ct.prototype,"requiredTag",2),It([o({type:String})],Ct.prototype,"requiredText",2),It([F()],Ct.prototype,"_checked",2),Ct=It([j("pkt-radiobutton")],Ct);/**
|
|
1178
1178
|
* @license
|
|
1179
1179
|
* Copyright 2021 Google LLC
|
|
1180
1180
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1190,29 +1190,29 @@
|
|
|
1190
1190
|
* @license
|
|
1191
1191
|
* Copyright 2021 Google LLC
|
|
1192
1192
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1193
|
-
*/class
|
|
1193
|
+
*/class dh{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const i=e||!Object.is(t,this.o);this.o=t,i&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:i}]of this.subscriptions)e(this.o,i)},t!==void 0&&(this.value=t)}addCallback(t,e,i){if(!i)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:a}=this.subscriptions.get(t);t(this.value,a)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
1194
1194
|
* @license
|
|
1195
1195
|
* Copyright 2021 Google LLC
|
|
1196
1196
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1197
|
-
*/let
|
|
1197
|
+
*/let ch=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},Za=class extends dh{constructor(t,e,i){var a,n;super(e.context!==void 0?e.initialValue:i),this.onContextRequest=r=>{if(r.context!==this.context)return;const h=r.contextTarget??r.composedPath()[0];h!==this.host&&(r.stopPropagation(),this.addCallback(r.callback,h,r.subscribe))},this.onProviderRequest=r=>{if(r.context!==this.context||(r.contextTarget??r.composedPath()[0])===this.host)return;const h=new Set;for(const[d,{consumerHost:p}]of this.subscriptions)h.has(d)||(h.add(d),p.dispatchEvent(new Ga(this.context,p,d,!0)));r.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(n=(a=this.host).addController)==null||n.call(a,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new ch(this.context,this.host))}};/**
|
|
1198
1198
|
* @license
|
|
1199
1199
|
* Copyright 2017 Google LLC
|
|
1200
1200
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1201
|
-
*/function
|
|
1201
|
+
*/function ph({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return{get(){return t.get.call(this)},set(a){return i.get(this).setValue(a),t.set.call(this,a)},init(a){return i.set(this,new Za(this,{context:s,initialValue:a})),a}};{t.constructor.addInitializer((r=>{i.set(r,new Za(r,{context:s}))}));const a=Object.getOwnPropertyDescriptor(t,e);let n;if(a===void 0){const r=new WeakMap;n={get(){return r.get(this)},set(h){i.get(this).setValue(h),r.set(this,h)},configurable:!0,enumerable:!0}}else{const r=a.set;n={...a,set(h){i.get(this).setValue(h),r==null||r.call(this,h)}}}return void Object.defineProperty(t,e,n)}}}/**
|
|
1202
1202
|
* @license
|
|
1203
1203
|
* Copyright 2022 Google LLC
|
|
1204
1204
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1205
|
-
*/function
|
|
1205
|
+
*/function uh({context:s,subscribe:t}){return(e,i)=>{typeof i=="object"?i.addInitializer((function(){new Ya(this,{context:s,callback:a=>{e.set.call(this,a)},subscribe:t})})):e.constructor.addInitializer((a=>{new Ya(a,{context:s,callback:n=>{a[i]=n},subscribe:t})}))}}const Xa=Symbol("pkt-tabs-context");var fh=Object.defineProperty,gh=Object.getOwnPropertyDescriptor,ns=(s,t,e,i)=>{for(var a=i>1?void 0:i?gh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&fh(t,e,a),a};let je=class extends Y{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=A(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new at(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,a;this.useArrowNav&&(t.code==="ArrowLeft"&&e!==0&&((i=this.tabRefs[e-1])==null||i.focus()),t.code==="ArrowRight"&&e<this.tabCount-1&&((a=this.tabRefs[e+1])==null||a.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`
|
|
1206
1206
|
<div class="pkt-tabs">
|
|
1207
|
-
<div class="pkt-tabs__list" role=${t} ${
|
|
1207
|
+
<div class="pkt-tabs__list" role=${t} ${E(this.defaultSlot)}></div>
|
|
1208
1208
|
</div>
|
|
1209
|
-
`}};ns([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],je.prototype,"arrowNav",2),ns([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],je.prototype,"disableArrowNav",2),ns([F()],je.prototype,"tabRefs",2),ns([F()],je.prototype,"tabCount",2),ns([
|
|
1209
|
+
`}};ns([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],je.prototype,"arrowNav",2),ns([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],je.prototype,"disableArrowNav",2),ns([F()],je.prototype,"tabRefs",2),ns([F()],je.prototype,"tabCount",2),ns([ph({context:Xa}),F()],je.prototype,"context",2),je=ns([j("pkt-tabs")],je);var mh=Object.defineProperty,vh=Object.getOwnPropertyDescriptor,de=(s,t,e,i)=>{for(var a=i>1?void 0:i?vh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&mh(t,e,a),a};let ie=class extends Y{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=A(),this.defaultSlot=A(),this.slotController=new at(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":"",a=e?"tab":void 0,n=e?this.active:void 0,r=this.active||!e?void 0:-1,h=u`
|
|
1210
1210
|
${this.icon?u`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
|
|
1211
|
-
<span ${
|
|
1211
|
+
<span ${E(this.defaultSlot)}></span>
|
|
1212
1212
|
${this.tag?u`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
|
|
1213
1213
|
`;return this.href?u`
|
|
1214
1214
|
<a
|
|
1215
|
-
${
|
|
1215
|
+
${E(this.elementRef)}
|
|
1216
1216
|
href=${this.href}
|
|
1217
1217
|
class="pkt-tabs__link ${i}"
|
|
1218
1218
|
role=${S(a)}
|
|
@@ -1226,7 +1226,7 @@
|
|
|
1226
1226
|
</a>
|
|
1227
1227
|
`:u`
|
|
1228
1228
|
<button
|
|
1229
|
-
${
|
|
1229
|
+
${E(this.elementRef)}
|
|
1230
1230
|
type="button"
|
|
1231
1231
|
class="pkt-tabs__button pkt-link-button ${i}"
|
|
1232
1232
|
role=${S(a)}
|
|
@@ -1238,11 +1238,11 @@
|
|
|
1238
1238
|
>
|
|
1239
1239
|
${h}
|
|
1240
1240
|
</button>
|
|
1241
|
-
`}};de([o({type:Boolean,reflect:!0})],ie.prototype,"active",2),de([o({type:String,reflect:!0})],ie.prototype,"href",2),de([o({type:String,reflect:!0})],ie.prototype,"icon",2),de([o({type:String,reflect:!0})],ie.prototype,"controls",2),de([o({type:String,reflect:!0})],ie.prototype,"tag",2),de([o({type:String,reflect:!0,attribute:"tag-skin"})],ie.prototype,"tagSkin",2),de([o({type:Number,reflect:!0})],ie.prototype,"index",2),de([
|
|
1241
|
+
`}};de([o({type:Boolean,reflect:!0})],ie.prototype,"active",2),de([o({type:String,reflect:!0})],ie.prototype,"href",2),de([o({type:String,reflect:!0})],ie.prototype,"icon",2),de([o({type:String,reflect:!0})],ie.prototype,"controls",2),de([o({type:String,reflect:!0})],ie.prototype,"tag",2),de([o({type:String,reflect:!0,attribute:"tag-skin"})],ie.prototype,"tagSkin",2),de([o({type:Number,reflect:!0})],ie.prototype,"index",2),de([uh({context:Xa,subscribe:!0}),o({attribute:!1})],ie.prototype,"context",2),ie=de([j("pkt-tab-item")],ie);/**
|
|
1242
1242
|
* @license
|
|
1243
1243
|
* Copyright 2020 Google LLC
|
|
1244
1244
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1245
|
-
*/const
|
|
1245
|
+
*/const bh=Ce(class extends Ye{constructor(s){if(super(s),s.type!==Rt.PROPERTY&&s.type!==Rt.ATTRIBUTE&&s.type!==Rt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ma(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[t]){if(t===_t||t===$)return t;const e=s.element,i=s.name;if(s.type===Rt.PROPERTY){if(t===e[i])return _t}else if(s.type===Rt.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return _t}else if(s.type===Rt.ATTRIBUTE&&e.getAttribute(i)===t+"")return _t;return ba(s),t}});var yh=Object.defineProperty,kh=Object.getOwnPropertyDescriptor,Ds=(s,t,e,i)=>{for(var a=i>1?void 0:i?kh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&yh(t,e,a),a};let rs=class extends D{constructor(){super(),this.inputRef=A(),this.helptextSlot=A(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new at(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=O({"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
|
|
1246
1246
|
label=${this.label}
|
|
1247
1247
|
?counter=${this.counter}
|
|
1248
1248
|
?disabled=${this.disabled}
|
|
@@ -1265,14 +1265,14 @@
|
|
|
1265
1265
|
.tagText=${this.tagText}
|
|
1266
1266
|
class="pkt-textarea"
|
|
1267
1267
|
>
|
|
1268
|
-
<div class="pkt-contents" ${
|
|
1268
|
+
<div class="pkt-contents" ${E(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1269
1269
|
<textarea
|
|
1270
|
-
${
|
|
1270
|
+
${E(this.inputRef)}
|
|
1271
1271
|
class=${t}
|
|
1272
1272
|
id=${this.id+"-input"}
|
|
1273
1273
|
name=${(this.name||this.id)+"-input"}
|
|
1274
1274
|
placeholder=${S(this.placeholder)}
|
|
1275
|
-
.value=${
|
|
1275
|
+
.value=${bh(this.value)}
|
|
1276
1276
|
minlength=${S(this.minlength)}
|
|
1277
1277
|
maxlength=${S(this.maxlength)}
|
|
1278
1278
|
?readonly=${this.readonly}
|
|
@@ -1287,7 +1287,7 @@
|
|
|
1287
1287
|
@focus=${i=>{this.onFocus(),i.stopImmediatePropagation()}}
|
|
1288
1288
|
@blur=${i=>{this.value=i.target.value,this.onBlur(),i.stopImmediatePropagation()}}
|
|
1289
1289
|
></textarea>
|
|
1290
|
-
</pkt-input-wrapper>`}};Ds([o({type:String,reflect:!0})],rs.prototype,"value",2),Ds([o({type:String})],rs.prototype,"autocomplete",2),Ds([o({type:Number})],rs.prototype,"rows",2),Ds([F()],rs.prototype,"counterCurrent",2),rs=Ds([
|
|
1290
|
+
</pkt-input-wrapper>`}};Ds([o({type:String,reflect:!0})],rs.prototype,"value",2),Ds([o({type:String})],rs.prototype,"autocomplete",2),Ds([o({type:Number})],rs.prototype,"rows",2),Ds([F()],rs.prototype,"counterCurrent",2),rs=Ds([j("pkt-textarea")],rs);var $h=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,ae=(s,t,e,i)=>{for(var a=i>1?void 0:i?_h(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&$h(t,e,a),a};let Xt=class extends D{constructor(){super(),this.inputRef=A(),this.helptextSlot=A(),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 at(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=O({"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`
|
|
1291
1291
|
<pkt-input-wrapper
|
|
1292
1292
|
label="${this.label}"
|
|
1293
1293
|
?counter=${this.counter}
|
|
@@ -1312,11 +1312,11 @@
|
|
|
1312
1312
|
.tagText=${this.tagText}
|
|
1313
1313
|
class="pkt-textinput"
|
|
1314
1314
|
>
|
|
1315
|
-
<div class="pkt-contents" ${
|
|
1315
|
+
<div class="pkt-contents" ${E(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1316
1316
|
<div class="pkt-input__container">
|
|
1317
1317
|
${this.prefix?u`<div class="pkt-input-prefix">${this.prefix}</div>`:$}
|
|
1318
1318
|
<input
|
|
1319
|
-
${
|
|
1319
|
+
${E(this.inputRef)}
|
|
1320
1320
|
class=${e}
|
|
1321
1321
|
type=${this.type}
|
|
1322
1322
|
name=${(this.name||this.id)+"-input"}
|
|
@@ -1356,7 +1356,7 @@
|
|
|
1356
1356
|
${!this.suffix&&t?u`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:$}
|
|
1357
1357
|
</div>
|
|
1358
1358
|
</pkt-input-wrapper>
|
|
1359
|
-
`}};ae([o({type:String,reflect:!0})],Xt.prototype,"value",2),ae([o({type:String})],Xt.prototype,"type",2),ae([o({type:Number})],Xt.prototype,"size",2),ae([o({type:String})],Xt.prototype,"autocomplete",2),ae([o({type:String})],Xt.prototype,"iconNameRight",2),ae([o({type:String})],Xt.prototype,"prefix",2),ae([o({type:String})],Xt.prototype,"suffix",2),ae([o({type:Boolean})],Xt.prototype,"omitSearchIcon",2),ae([F()],Xt.prototype,"counterCurrent",2),Xt=ae([
|
|
1359
|
+
`}};ae([o({type:String,reflect:!0})],Xt.prototype,"value",2),ae([o({type:String})],Xt.prototype,"type",2),ae([o({type:Number})],Xt.prototype,"size",2),ae([o({type:String})],Xt.prototype,"autocomplete",2),ae([o({type:String})],Xt.prototype,"iconNameRight",2),ae([o({type:String})],Xt.prototype,"prefix",2),ae([o({type:String})],Xt.prototype,"suffix",2),ae([o({type:Boolean})],Xt.prototype,"omitSearchIcon",2),ae([F()],Xt.prototype,"counterCurrent",2),Xt=ae([j("pkt-textinput")],Xt);var wh=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,ri=(s,t,e,i)=>{for(var a=i>1?void 0:i?xh(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&wh(t,e,a),a};let Is=class extends D{constructor(){super(),this.inputRef=A(),this.helptextSlot=A(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new Wa(this),this.slotController=new at(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 a={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=a.value),this._options.push(a)}):(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 a=e.value||e.text,n=this._options.findIndex(r=>r.value===a);n>=0?this._options.splice(n,0,i):this._options.push(i)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(a=>a.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 a,n;t==="options"&&(this._options=i?JSON.parse(i):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((a=this.inputRef.value)==null?void 0:a.selectedIndex):this._options.findIndex(r=>r.value===i),this.selectedOptions=(n=this.inputRef.value)==null?void 0:n.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(a=>a.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`
|
|
1360
1360
|
<pkt-input-wrapper
|
|
1361
1361
|
?counter=${this.counter}
|
|
1362
1362
|
?disabled=${this.disabled}
|
|
@@ -1391,7 +1391,7 @@
|
|
|
1391
1391
|
@input=${e=>{this.onInput(),e.stopImmediatePropagation()}}
|
|
1392
1392
|
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
1393
1393
|
@blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
|
|
1394
|
-
${
|
|
1394
|
+
${E(this.inputRef)}
|
|
1395
1395
|
>
|
|
1396
1396
|
${this._options.length>0?this._options.map(e=>u`<option
|
|
1397
1397
|
value=${e.value}
|
|
@@ -1402,9 +1402,9 @@
|
|
|
1402
1402
|
${e.label}
|
|
1403
1403
|
</option>`):""}
|
|
1404
1404
|
</select>
|
|
1405
|
-
<div class="pkt-contents" ${
|
|
1405
|
+
<div class="pkt-contents" ${E(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1406
1406
|
</pkt-input-wrapper>
|
|
1407
|
-
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};ri([o({type:Array,attribute:"options"})],Is.prototype,"_optionsProp",2),ri([o({type:String})],Is.prototype,"value",2),ri([F()],Is.prototype,"_options",2),Is=ri([
|
|
1407
|
+
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};ri([o({type:Array,attribute:"options"})],Is.prototype,"_optionsProp",2),ri([o({type:String})],Is.prototype,"value",2),ri([F()],Is.prototype,"_options",2),Is=ri([j("pkt-select")],Is);var Sh=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,Ls=(s,t,e,i)=>{for(var a=i>1?void 0:i?Ch(t,e):t,n=s.length-1,r;n>=0;n--)(r=s[n])&&(a=(i?r(t,e,a):r(a))||a);return i&&a&&Sh(t,e,a),a};let os=class extends Y{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=A(),this.namedSlot=A(),this.slotController=new at(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`
|
|
1408
1408
|
<div class="${O(s)}">
|
|
1409
1409
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
1410
1410
|
|
|
@@ -1413,11 +1413,11 @@
|
|
|
1413
1413
|
<div>${this.renderList(this.doStuff(this._list))}</div>
|
|
1414
1414
|
|
|
1415
1415
|
<h2 class="pkt-txt-22">Slot</h2>
|
|
1416
|
-
<div ${
|
|
1416
|
+
<div ${E(this.defaultSlot)}>defaultSlotRef</div>
|
|
1417
1417
|
<h2 class="pkt-txt-22">Named slot</h2>
|
|
1418
1418
|
<select
|
|
1419
1419
|
name="named-slot"
|
|
1420
|
-
${
|
|
1420
|
+
${E(this.namedSlot)}
|
|
1421
1421
|
@change=${t=>alert(t.target.value)}
|
|
1422
1422
|
>
|
|
1423
1423
|
namedSlotRef
|
|
@@ -1432,8 +1432,8 @@
|
|
|
1432
1432
|
<ul>
|
|
1433
1433
|
${s.map(t=>u`<li>${t}</li>`)}
|
|
1434
1434
|
</ul>
|
|
1435
|
-
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Ls([o({type:String})],os.prototype,"string",2),Ls([o({converter:Ha})],os.prototype,"strings",2),Ls([o({type:Boolean})],os.prototype,"darkmode",2),Ls([o({type:Array})],os.prototype,"_list",2),os=Ls([
|
|
1435
|
+
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Ls([o({type:String})],os.prototype,"string",2),Ls([o({converter:Ha})],os.prototype,"strings",2),Ls([o({type:Boolean})],os.prototype,"darkmode",2),Ls([o({type:Array})],os.prototype,"_list",2),os=Ls([j("pkt-component")],os);const L=Wt({tagName:"pkt-icon",elementClass:Ne,react:x,displayName:"PktIcon",events:{}}),Ja=x.forwardRef(({defaultOpen:s=!1,id:t,title:e,skin:i,compact:a=!1,isOpen:n,children:r,name:h,className:d,onClick:p,onToggle:m},f)=>{const[k,b]=x.useState(s),{name:y}=En(),w=h||y,C=n!==void 0?n:k;x.useEffect(()=>{n===void 0&&b(s)},[s,n]);const M=N=>{const Z=N.currentTarget.open;n===void 0&&b(Z),m==null||m(N)},T=N=>{setTimeout(()=>{p==null||p(N)},0)},V=["pkt-accordion-item",a&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,d].filter(Boolean).join(" ");return l.jsxs("details",{ref:f,className:V,id:t,open:C,onClick:T,name:w,onToggle:M,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(L,{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})})]})});Ja.displayName="PktAccordionItem";function Th(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Di={exports:{}};/*!
|
|
1436
1436
|
Copyright (c) 2018 Jed Watson.
|
|
1437
1437
|
Licensed under the MIT License (MIT), see
|
|
1438
1438
|
http://jedwatson.github.io/classnames
|
|
1439
|
-
*/var Qa;function Eh(){return Qa||(Qa=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var n="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(n=a(n,i(h)))}return n}function i(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return e.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var h in n)t.call(n,h)&&n[h]&&(r=a(r,h));return r}function a(n,r){return r?n?n+" "+r:n+r:n}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(Di)),Di.exports}var Oh=Eh();const gt=Ah(Oh),Ii=({children:s,closeAlert:t,compact:e,title:i,date:a,ariaLive:n,"aria-live":r="polite",role:h="status",skin:d="info",...p})=>{const[m,g]=x.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":m},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!a},y=x.useCallback(()=>{g(!0),p.onClose&&p.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[p.onClose,g]),w=n||r;return l.jsx("div",{...p,"aria-live":w,role:h,className:gt(k),children:l.jsxs("div",{className:gt(b),children:[l.jsx(B,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(He,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:y,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}),a&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",a]})]})})};Ii.displayName="PktAlert";const tn=Ut({tagName:"pkt-backlink",elementClass:Je,react:x,displayName:"PktBackLink"});tn.displayName="PktBackLink";const Ph=x.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},a)=>{const n=s,r=n[n.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:n.map((d,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===n.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?l.jsxs(zi.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(B,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):l.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(B,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(zi.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(B,{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(B,{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/13.14/animations/";const He=x.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",size:a="medium",fullWidth:n=!1,fullWidthOnMobile:r=!1,skin:h="primary",type:d="button",variant:p="label-only",state:m,color:g,isLoading:k=void 0,disabled:b=void 0,loadingAnimationPath:y=window.pktAnimationPath,...w},C)=>{const M=[t,"pkt-btn",a&&`pkt-btn--${a}`,n&&"pkt-btn--full",r&&"pkt-btn--full-small",h&&`pkt-btn--${h}`,p&&`pkt-btn--${p}`,g&&`pkt-btn--${g}`,m&&`pkt-btn--${m}`,k&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...w,"aria-busy":k||void 0,"aria-disabled":b||void 0,disabled:b,className:M,type:d,ref:C,children:[k&&l.jsx(B,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:y}),p!=="label-only"&&l.jsx(B,{className:"pkt-btn__icon",name:e}),l.jsx("span",{className:"pkt-btn__text",children:s}),p==="icons-right-and-left"&&l.jsx(B,{className:"pkt-btn__icon",name:i})]})});He.displayName="PktButton";const Mh=Ut({tagName:"pkt-card",elementClass:lt,react:x,displayName:"PktCard",events:{}}),en=x.forwardRef(({children:s,...t},e)=>l.jsx(Mh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));en.displayName="PktCard";const sn=x.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:a,hasError:n=!1,className:r,isSwitch:h=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:m,checked:g,optionalTag:k,optionalText:b="Valgfritt",requiredTag:y,requiredText:w="Må fylles ut",tagText:C,...M},N)=>{const U=[r,"pkt-input-check"].filter(Boolean).join(" "),E=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),G=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),J=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Lt=()=>l.jsxs(l.Fragment,{children:[C&&l.jsx("span",{className:J+" pkt-tag--gray",children:C}),k&&l.jsx("span",{className:J+" pkt-tag--blue-light",children:b}),y&&l.jsx("span",{className:J+" pkt-tag--beige",children:w})]});return l.jsx("div",{className:U,children:l.jsxs("div",{className:G,children:[p==="left"&&l.jsxs("label",{className:E,htmlFor:s,children:[i," ",Lt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:N,className:`pkt-input-check__input-checkbox ${n?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...g!==void 0?{checked:g}:{defaultChecked:m},...M}),p==="right"&&l.jsxs("label",{className:E,htmlFor:s,children:[i," ",Lt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});sn.displayName="PktCheckbox";const Dh=Ut({tagName:"pkt-combobox",elementClass:Q,react:x,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),an=x.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Dh,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));an.displayName="PktCombobox";const oi=Ut({tagName:"pkt-consent",elementClass:zt,react:x,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});oi.displayName="PktConsent";const Ih=Ut({tagName:"pkt-datepicker",elementClass:et,react:x,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),nn=x.forwardRef(({helptext:s,...t},e)=>l.jsx(Ih,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));nn.displayName="PktDatepicker";const Lh=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:a=!1,personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:g=null,cookieSecure:k=null,cookieExpiryDays:b=null,onToggleConsent:y=w=>{console.log(w.detail)}})=>{var C,M;const w=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:w,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:s.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&l.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((N,U)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${N.external?"pkt-link--external":""}`,href:N.href,target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer__link-icon",name:"chevron-right"}),N.text]})},`links-${U}`))]})]}),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}),(M=t.links)==null?void 0:M.map((N,U)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${N.external?"pkt-link--external":""}`,href:N.href,target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer__link-icon",name:"chevron-right"}),N.text]})},`links-${U}`))]})]}),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:n,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(B,{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:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(oi,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:g,cookieSecure:k,cookieExpiryDays:b,onToggleConsent:y})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(N=>N.language).map((N,U)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:N.href,"aria-label":`til ${N.language} versjon av nettsiden`,target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:N.language})},`sociallinks-language-${U}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(N=>N.iconName).map((N,U)=>l.jsx(x.Fragment,{children:l.jsx("a",{href:N.href,"aria-label":`til ${N.iconName}`,className:"pkt-footer__social-icon-link",target:N.openInNewTab||a?"_blank":"_self",rel:N.openInNewTab||a?"noopener noreferrer":void 0,children:l.jsx(B,{className:"pkt-footer__social-icon",name:N.iconName})})},`sociallinks-${U}`))})]})]})})},Bh=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:a=!1,hotjarId:n=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:g=b=>{console.log(b.detail)},className:k})=>{const b=[k,"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((y,w)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${y.external?" pkt-link--external":""}`,href:y.href,target:y.openInNewTab||t?"_blank":"_self",rel:y.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(B,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),y.text]})},w)),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(B,{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(B,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),a&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(oi,{triggerType:"footerlink",hotjarId:n,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:g})})]})})})},Fh=x.forwardRef(({className:s,logoLink:t="https://www.oslo.kommune.no/",serviceName:e,fixed:i=!0,scrollToHide:a=!0,user:n,userMenu:r,representing:h,userOptions:d,userMenuFooter:p,canChangeRepresentation:m=!0,showMenuButton:g=!1,showLogOutButton:k=!1,openMenu:b,logOut:y,changeRepresentation:w,children:C,...M},N)=>{const U=x.useMemo(()=>typeof(n==null?void 0:n.lastLoggedIn)=="string"?n.lastLoggedIn:n!=null&&n.lastLoggedIn?new Date(n.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[n]),[E,G]=x.useState(!1),[J,Lt]=x.useState(0),[Bt,it]=x.useState(!1),rt=x.useRef(null);x.useEffect(()=>(document&&(document.addEventListener("mouseup",Vt),window.addEventListener("scroll",ot)),()=>{document&&(document.removeEventListener("mouseup",Vt),window.removeEventListener("scroll",ot))}));const Ft=()=>{it(!Bt)},Vt=L=>{rt.current&&!rt.current.contains(L.target)&&it(!1)},ot=()=>{if(a){const L=window.pageYOffset||document.documentElement.scrollTop;if(L<0||Math.abs(L-J)<60)return;G(L>J),Lt(L)}};return l.jsxs("header",{...M,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:gt(s,"pkt-header",{"pkt-header--fixed":i,"pkt-header--scroll-to-hide":a,"pkt-header--hidden":E}),ref:N,children:[l.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?l.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:l.jsx(B,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.14/logos/"})}):l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:l.jsx(B,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.14/logos/"})}),l.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:e})]}),l.jsx("nav",{className:"pkt-header__actions",children:l.jsxs("ul",{className:"pkt-header__actions-row",children:[g&&l.jsx("li",{children:l.jsx(He,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(n||h)&&l.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Bt&&!E?"pkt-header--open-dropdown":""}`,ref:rt,children:[l.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":Bt,onClick:Ft,children:[l.jsx(B,{name:"user",className:"pkt-btn__icon"}),l.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(h==null?void 0:h.name)||(n==null?void 0:n.name)}),l.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(h==null?void 0:h.shortname)||(n==null?void 0:n.shortname)}),l.jsx(B,{name:"chevron-thin-down",className:"pkt-btn--closed"}),l.jsx(B,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),l.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[n&&l.jsxs("li",{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:n.name}),n.lastLoggedIn&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:U})]})]}),r&&l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:r.map((L,Tt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsxs("a",{href:L.target,className:"pkt-link",children:[L.iconName&&l.jsx(B,{name:L.iconName,className:"pkt-link__icon"}),L.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:[L.iconName&&l.jsx(B,{name:L.iconName,className:"pkt-link__icon"}),L.title]})},`userMenu-${Tt}`))})}),(h||m)&&l.jsxs("li",{children:[h&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",h.orgNumber]})]}),l.jsx("ul",{className:"pkt-list mt-size-16",children:m&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:w,children:[l.jsx(B,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:(d||!k)&&l.jsxs(l.Fragment,{children:[d==null?void 0:d.map((L,Tt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsxs("a",{href:L.target,className:"pkt-link",children:[L.iconName&&l.jsx(B,{name:L.iconName,className:"pkt-link__icon"}),L.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:[L.iconName&&l.jsx(B,{name:L.iconName,className:"pkt-link__icon"}),L.title]})},`userOptions-${Tt}`)),!k&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:y,children:[l.jsx(B,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),p&&l.jsx("li",{className:"footer",children:l.jsx("ul",{className:"pkt-list-horizontal bordered",children:p.map((L,Tt)=>l.jsx("li",{children:typeof L.target=="string"?l.jsx("a",{href:L.target,className:"pkt-link",children:L.title}):l.jsx("button",{className:"pkt-link-button pkt-link",onClick:L.target,children:L.title})},`userMenuFooter-${Tt}`))})})]})]}),C&&l.jsx("li",{children:C}),k&&l.jsx("li",{children:l.jsx(He,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:y,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),Vh=Ut({tagName:"pkt-heading",elementClass:Me,react:x,displayName:"PktHeading"}),rn=x.forwardRef(({children:s,...t},e)=>l.jsx(Vh,{"data-testid":"pkt-heading",...t,ref:e,children:s}));rn.displayName="PktHeading";const jh=Ut({tagName:"pkt-helptext",elementClass:le,react:x,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),on=x.forwardRef(({children:s,...t},e)=>l.jsx(jh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));on.displayName="PktHelptext";const ln=x.forwardRef(({label:s,id:t,children:e,...i},a)=>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:a}),e]}));ln.displayName="PktInput";const Bs=x.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:a,counter:n,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:g="Må fylles ut",tagText:k=null,hasError:b=!1,errorMessage:y,disabled:w=!1,inline:C=!1,ariaDescribedby:M,useWrapper:N=!0,children:U,className:E="",hasFieldset:G=!1,role:J="group",counterPosition:Lt="bottom"},Bt)=>{const[it,rt]=x.useState(!1),Ft=M||(e?`${s}-helptext`:void 0),Vt=!!n,ot=Vt&&Lt==="top",L=Vt&&Lt==="bottom",Tt=()=>rt(ct=>!ct),ne=["pkt-inputwrapper",E,b?"pkt-inputwrapper--error":"",w?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),ce=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),re=()=>Vt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,Ue=()=>l.jsxs(l.Fragment,{children:[k&&l.jsx("span",{className:ce+" pkt-tag--gray",children:k}),d&&l.jsx("span",{className:ce+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:ce+" pkt-tag--beige",children:g})]}),ds=()=>{const ct=l.jsxs(l.Fragment,{children:[t," ",Ue()]});return N?G?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ct}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Ft,id:`${s}-label`,children:ct}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Ft,id:`${s}-label`,children:t})},pe=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&N&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(He,{skin:"tertiary",size:"small",variant:"icon-right",iconName:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Tt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:a??'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})]})]}),Rt=l.jsxs(l.Fragment,{children:[ds(),pe(),ot&&l.jsx(re,{}),U,L&&l.jsx(re,{}),b&&y&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(Ii,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:y})})]});return l.jsx("div",{className:ne,ref:Bt,role:J,children:G?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Ft,children:Rt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Rt})})});Bs.displayName="PktInputWrapper";const hn=({href:s,iconName:t,className:e,iconPosition:i,external:a,target:n,children:r,...h})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!t&&i==="left"||!!(t&&!i),"pkt-link--icon-right":!!t&&i==="right","pkt-link--external":a};return l.jsxs("a",{...h,className:gt(d,e),href:s,target:n,rel:a?"noopener noreferrer":void 0,children:[t&&l.jsx(B,{name:t,className:"pkt-link__icon"}),r]})};hn.displayName="PktLink";const dn=({children:s,skin:t,title:e,href:i,iconName:a,openInNewTab:n,external:r,className:h,...d})=>{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",{...d,href:i,className:gt(p,h),target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[a&&l.jsx(B,{className:"pkt-link__icon",name:a}),e&&l.jsx("div",{className:gt(m),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};dn.displayName="PktLinkCard";const Hh=Ut({tagName:"pkt-loader",elementClass:Yt,react:x,displayName:"PktLoader",events:{}}),cn=x.forwardRef(({children:s,...t},e)=>l.jsx(Hh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));cn.displayName="PktLoader";const pn=({children:s,className:t,skin:e,title:i,compact:a,closable:n,onClose:r,...h})=>{const[d,p]=x.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":a,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":n,"pkt-hide":d},g=x.createRef(),k=x.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:gt(m,t),ref:g,children:[n&&l.jsx("div",{className:'"pkt-messagebox__close"',children:l.jsx("button",{onClick:k,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(B,{name:"close",className:"pkt-link__icon"})})}),l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};pn.displayName="PktMessagebox";const Uh=Ut({tagName:"pkt-modal",elementClass:Dt,react:x,displayName:"PktModal",events:{}}),un=x.forwardRef(({children:s,...t},e)=>l.jsx(Uh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));un.displayName="PktModal";const qh=Ut({tagName:"pkt-progressbar",elementClass:st,react:x,displayName:"PktProgressbar",events:{}}),fn=x.forwardRef(({children:s,...t},e)=>l.jsx(qh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));fn.displayName="PktProgressbar";const gn=x.forwardRef(({id:s,name:t,label:e,className:i,hasTile:a=!1,disabled:n=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:g,requiredTag:k,requiredText:b,tagText:y,...w},C)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),N=["pkt-input-check__input",a?"pkt-input-check__input--tile":"",n&&a?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),U=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),E=["pkt-input-check__input-label",n?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),G=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),J=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:G+" pkt-tag--gray",children:y}),m&&l.jsx("span",{className:G+" pkt-tag--blue-light",children:g}),k&&l.jsx("span",{className:G+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:M,children:l.jsxs("div",{className:N,children:[l.jsx("input",{ref:C,id:s,type:"radio",name:t,disabled:n,className:U,...p!==void 0?{checked:p}:{defaultChecked:d},...w}),l.jsxs("label",{className:E,htmlFor:s,children:[e," ",J(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});gn.displayName="PktRadioButton";const zh=x.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:a,name:n,placeholder:r="Søk…",suggestions:h,value:d="",action:p,method:m,onChange:g,onSearch:k,onSuggestionClick:b,...y},w)=>{const C=(E,G)=>{E?E():b&&b(G)},M=E=>{d=E.target.value},N=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let U;return p?U=E=>l.jsx("form",{role:"search",className:N,action:p,method:m,children:E}):U=E=>l.jsx("div",{role:"search",className:N,children:E}),U(l.jsxs(l.Fragment,{children:[a&&l.jsx("label",{htmlFor:a?i:void 0,className:a?"pkt-inputwrapper__label":"",children:a}),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:n||i,id:i,placeholder:r,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:w,"aria-controls":`${i}-suggestions`,onChange:g||M,onKeyUp:k&&(E=>{E.key==="Enter"&&(E.preventDefault(),k(d))}),...y}),l.jsx(He,{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:k&&(E=>{E.preventDefault(),k(d)}),children:a||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((E,G)=>l.jsx("li",{children:x.createElement(E.href?"a":E.onClick?"button":"div",{href:E.href,className:`pkt-searchinput__suggestion ${E.onClick?"pkt-link-button":""} ${E.href||E.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:E.onClick?"button":void 0,onClick:()=>C(E.onClick,G),onKeyUp:J=>J.key==="Enter"&&C(E.onClick,G)},l.jsxs(l.Fragment,{children:[E.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:E.title}),E.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:E.text})]}))},`search-suggestion-${G}`))})]}))}),Wh=x.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:a=!1,errorMessage:n,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:g=!1,fullwidth:k=!1,label:b,name:y,optionalTag:w=!1,optionalText:C,requiredTag:M=!1,requiredText:N,tagText:U,...E},G)=>{const J=[i,"pkt-select"].join(" ");return l.jsx(Bs,{className:J,forId:`${m}-input`,label:b,helptext:h,helptextDropdown:d,helptextDropdownButton:p,optionalTag:w,optionalText:C,requiredTag:M,requiredText:N,tagText:U,hasError:r,errorMessage:n,disabled:a,inline:g,ariaDescribedby:s,children:l.jsx("select",{ref:G,className:`pkt-input ${k?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:a,id:`${m}-input`,name:y||m,...E,children:e})})}),Rh=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)"}})}),Kh=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"})]}),Gh=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"})]}),Yh=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:gt("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:gt("pkt-step__indicator"),children:e==="current"?Kh:e==="completed"?Gh:Rh}),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})]})]}),Zh=x.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:a=!0,orientation:n="vertical",...r},h)=>{const d=gt(t,"pkt-stepper",n==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=x.Children.map(e,(m,g)=>x.isValidElement(m)?x.cloneElement(m,{className:gt(m.props.className,{"pkt-step--hideStep":i&&g!==s,"pkt-step--hideContent":a&&g!==s})}):m);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:p})}),Xh=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:a,...n})=>l.jsx("table",{"data-testid":"pkt-table",className:gt(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",...n,children:a}),Jh=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:gt(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Qh=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:gt(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),td=({className:s,children:t,...e})=>l.jsx("thead",{className:gt(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),ed=({className:s,children:t,...e})=>l.jsx("th",{className:gt(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),sd=({className:s,children:t,...e})=>l.jsx("tr",{className:gt(s,"pkt-table__row",{}),role:"row",...e,children:t}),id=Ut({tagName:"pkt-tag",elementClass:qt,react:On,displayName:"PktTag",events:{onClose:"close"}}),Li=x.forwardRef(({children:s,...t},e)=>l.jsx(id,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Li.displayName="PktTag";const Bi=x.forwardRef(({children:s,active:t,href:e,onClick:i,icon:a,controls:n,tag:r,tagSkin:h,index:d=0},p)=>{const{arrowNav:m,registerTabRef:g,handleKeyPress:k,selectTab:b}=ad(),w={"aria-selected":m?!!t:void 0,"aria-controls":n,role:m?"tab":void 0,onKeyUp:M=>k(d,M),onClick:M=>{b(d),i==null||i(M)},tabIndex:t||!m?void 0:-1,ref:M=>{g(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},C=l.jsxs(l.Fragment,{children:[a&&l.jsx(B,{name:a,className:"pkt-icon--small"}),s,r&&l.jsx(Li,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...w,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:C}):l.jsx("button",{...w,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:C})});Bi.displayName="PktTabItem";const mn=x.createContext(null),ad=()=>{const s=x.useContext(mn);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},nd=x.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:a},n)=>{const r=x.useRef([]),h=s&&!t,p=a&&x.Children.count(a)>0?x.Children.count(a):(e==null?void 0:e.length)||0;x.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=y=>{const w=e==null?void 0:e[y];w!=null&&w.action&&w.action(y),i&&i(y)},g=(y,w)=>{var C,M;h&&(w.code==="ArrowLeft"&&y!==0&&((C=r.current[y-1])==null||C.focus()),w.code==="ArrowRight"&&y<p-1&&((M=r.current[y+1])==null||M.focus()),(w.code==="ArrowDown"||w.code==="Space")&&m(y))},k=(y,w)=>{r.current[y]=w},b=e==null?void 0:e.map((y,w)=>{var C,M;return l.jsx(Bi,{active:y.active,href:y.href,onClick:()=>m(w),icon:y.icon,controls:y.controls,tag:(C=y.tag)==null?void 0:C.text,tagSkin:(M=y.tag)==null?void 0:M.skin,index:w,children:y.text},w)});return l.jsx(mn.Provider,{value:{arrowNav:h,registerTabRef:k,handleKeyPress:g,selectTab:m},children:l.jsx("div",{className:"pkt-tabs",ref:n,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:a||b})})})}),rd=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:a,className:n,disabled:r,errorMessage:h,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:g,inline:k,fullwidth:b=!1,label:y,name:w,optionalTag:C=!1,optionalText:M,requiredTag:N=!1,requiredText:U,tagText:E=null,placeholder:G,rows:J,useWrapper:Lt=!0,onChange:Bt,value:it,autoComplete:rt="off",minLength:Ft,maxLength:Vt,readOnly:ot=!1,skipForwardTestid:L=!1,...Tt},ne)=>{const ce=[n,"pkt-textinput","pkt-textarea"].join(" "),re=`${s}-input`,Ue=`${re}-label`,ds=e||Ue,[pe,Rt]=x.useState(0),ct=qe=>{var ze,ue;if(i&&Rt(((ue=(ze=qe.currentTarget)==null?void 0:ze.value)==null?void 0:ue.length)||0),Bt)return Bt(qe)};return x.useEffect(()=>{it!==void 0&&Rt((it==null?void 0:it.length)||0)},[it]),l.jsx(Bs,{ariaDescribedby:t,className:ce,disabled:r,errorMessage:h,forId:re,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:g,inline:k,label:y,optionalTag:C,optionalText:M,requiredTag:N,requiredText:U,tagText:E,useWrapper:Lt,counter:i,counterCurrent:pe,counterMaxLength:a,children:l.jsx("textarea",{ref:ne,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${a&&pe>a?"pkt-input--counter-error":""}`,name:`${w||s}`,id:re,placeholder:G,disabled:r,rows:J,"aria-labelledby":ds,"aria-invalid":d,"aria-errormessage":`${s}-error`,...Tt,onChange:ct,value:it,autoComplete:rt,minLength:Ft,maxLength:Vt,"data-skip-forward-testid":L?"true":void 0})})}),od=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:a,counterMaxLength:n,className:r,disabled:h=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:g,helptextDropdownButton:k,iconNameRight:b,inline:y=!1,fullwidth:w=!1,label:C,name:M,optionalTag:N=!1,optionalText:U,requiredTag:E=!1,requiredText:G,tagText:J=null,placeholder:Lt,prefix:Bt,suffix:it,type:rt="text",useWrapper:Ft=!0,omitSearchIcon:Vt=!1,value:ot,minLength:L,maxLength:Tt,min:ne,max:ce,step:re,size:Ue,readonly:ds,required:pe,dataTestid:Rt,onChange:ct,skipForwardTestid:qe=!1,...ze},ue)=>{const Vi=[r,"pkt-textinput"].join(" "),li=rt==="search"&&!b&&!Vt,ji=rt==="date"&&ot?ot.slice(0,10):ot,[hi,cs]=x.useState((ot==null?void 0:ot.length)||0),ps=`${s}`,Vs=`${ps}-label`,di=e||Vs,Hi=_e=>{var ci,pi;a&&cs(((pi=(ci=_e.currentTarget)==null?void 0:ci.value)==null?void 0:pi.length)||0),ct&&ct(_e)};return x.useEffect(()=>{ot!==void 0&&cs((ot==null?void 0:ot.length)||0)},[ot]),l.jsx(Bs,{ariaDescribedby:t,className:Vi,disabled:h,errorMessage:d,forId:ps,hasError:p,helptext:m,helptextDropdown:g,helptextDropdownButton:k,inline:y,label:C,optionalTag:N,optionalText:U,requiredTag:E,requiredText:G,tagText:J,useWrapper:Ft,counter:a,counterCurrent:hi,counterMaxLength:n,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Rt,"data-skip-forward-testid":qe?"true":void 0,children:[Bt&&l.jsx("div",{className:"pkt-input-prefix",children:Bt}),l.jsx("input",{...ze,ref:ue,className:`pkt-input ${w?"pkt-input--fullwidth":""} ${n&&hi>n?"pkt-input--counter-error":""}`,type:rt,name:`${M||s}`,value:ji,id:ps,placeholder:Lt,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":di,min:ne,max:ce,onChange:Hi,step:re,minLength:L,maxLength:Tt,size:Ue,required:pe}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(B,{className:"pkt-input-suffix-icon",name:b}),li&&l.jsx(B,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(B,{className:"pkt-input-icon",name:b}),!it&&li&&l.jsx(B,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});var ls=window.CustomEvent;(!ls||typeof ls=="object")&&(ls=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ls.prototype=window.Event.prototype);function vn(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function ld(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,a){return!(t[i]===void 0||t[i]===a)};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 Fs(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 bn(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function hd(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function Fi(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function yn(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 a=s.querySelectorAll("*"),n=0;n<a.length&&!(a[n].tagName&&a[n].shadowRoot&&(i=yn(a[n].shadowRoot),i));n++);return i}function kn(s){return s.isConnected||document.body.contains(s)}function $n(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,a="getRootNode"in i&&i.getRootNode()||document;e=a.activeElement}return!e||e.form!==t?null:e}function dd(s){if(!s.defaultPrevented){var t=s.target,e=z.imagemapUseValue,i=$n(s);e===null&&i&&(e=i.value);var a=Fs(t);if(a){var n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&(s.preventDefault(),e!=null?a.close(e):a.close())}}}function _n(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",dd,!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),a,n=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(a),a=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,n)})}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))}_n.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&kn(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=yn(this.dialog_)),bn(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(!kn(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.");ld(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 ls("close",{bubbles:!1,cancelable:!1});vn(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 a=0;a<i.length;++a){var n=i[a],r=null;try{r=document.querySelectorAll(n.selectorText)}catch{}if(!(!r||!hd(r,s))){var h=n.style.getPropertyValue("top"),d=n.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="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 _n(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 a=0,n;n=i.removedNodes[a];++a){if(n instanceof Element)n.localName==="dialog"&&e.push(n);else continue;e=e.concat(n.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 a=i.dialog.parentNode||document.body;a.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},z.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Fs(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(),bn(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,a=i.compareDocumentPosition(t);return a&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 ls("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&vn(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 wn=document.createElement("form");if(wn.setAttribute("method","dialog"),wn.method!=="dialog"){var hs=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(hs){var cd=hs.get;hs.get=function(){return Fi(this)?"dialog":cd.call(this)};var pd=hs.set;hs.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):pd.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",hs)}}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||!Fi(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 a=Fs(t);a&&(z.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=Fs(t);if(!e){var i=$n(s),a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&s.preventDefault()}});var ud=HTMLFormElement.prototype.submit,fd=function(){if(!Fi(this))return ud.call(this);var s=Fs(this);s&&s.close()};HTMLFormElement.prototype.submit=fd}const gd=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=Ri,P.PktAccordionItem=Ja,P.PktAlert=Ii,P.PktBackLink=tn,P.PktBreadcrumbs=Ph,P.PktButton=He,P.PktCard=en,P.PktCheckbox=sn,P.PktCombobox=an,P.PktConsent=oi,P.PktDatepicker=nn,P.PktFooter=Lh,P.PktFooterSimple=Bh,P.PktHeader=Fh,P.PktHeading=rn,P.PktHelptext=on,P.PktIcon=B,P.PktInput=ln,P.PktInputWrapper=Bs,P.PktLink=hn,P.PktLinkCard=dn,P.PktLoader=cn,P.PktMessagebox=pn,P.PktModal=un,P.PktProgressbar=fn,P.PktRadioButton=gn,P.PktSearchInput=zh,P.PktSelect=Wh,P.PktStep=Yh,P.PktStepper=Zh,P.PktTabItem=Bi,P.PktTable=Xh,P.PktTableBody=Jh,P.PktTableDataCell=Qh,P.PktTableHeader=td,P.PktTableHeaderCell=ed,P.PktTableRow=sd,P.PktTabs=nd,P.PktTag=Li,P.PktTextarea=rd,P.PktTextinput=od,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
1439
|
+
*/var Qa;function Nh(){return Qa||(Qa=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var n="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(n=a(n,i(h)))}return n}function i(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return e.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var r="";for(var h in n)t.call(n,h)&&n[h]&&(r=a(r,h));return r}function a(n,r){return r?n?n+" "+r:n+r:n}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(Di)),Di.exports}var Ah=Nh();const ct=Th(Ah),Ii=({children:s,closeAlert:t,compact:e,title:i,date:a,ariaLive:n,"aria-live":r="polite",role:h="status",skin:d="info",...p})=>{const[m,f]=x.useState(!1),k={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${d}`]:d,"pkt-hide":m},b={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!a},y=x.useCallback(()=>{f(!0),p.onClose&&p.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[p.onClose,f]),w=n||r;return l.jsx("div",{...p,"aria-live":w,role:h,className:ct(k),children:l.jsxs("div",{className:ct(b),children:[l.jsx(L,{className:"pkt-alert__icon","aria-hidden":"true",name:d==="info"?"alert-information":`alert-${d}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(He,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:y,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}),a&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",a]})]})})};Ii.displayName="PktAlert";const tn=Wt({tagName:"pkt-backlink",elementClass:Je,react:x,displayName:"PktBackLink"});tn.displayName="PktBackLink";const Eh=x.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},a)=>{const n=s,r=n[n.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:a,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:n.map((d,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===n.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})}):t==="router"?l.jsxs(zi.Link,{to:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(L,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]}):l.jsxs("a",{href:d.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(L,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:d.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(zi.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(L,{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(L,{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/13.15/animations/";const He=x.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",size:a="medium",fullWidth:n=!1,fullWidthOnMobile:r=!1,skin:h="primary",type:d="button",variant:p="label-only",state:m,color:f,isLoading:k=void 0,disabled:b=void 0,loadingAnimationPath:y=window.pktAnimationPath,...w},C)=>{const M=[t,"pkt-btn",a&&`pkt-btn--${a}`,n&&"pkt-btn--full",r&&"pkt-btn--full-small",h&&`pkt-btn--${h}`,p&&`pkt-btn--${p}`,f&&`pkt-btn--${f}`,m&&`pkt-btn--${m}`,k&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...w,"aria-busy":k||void 0,"aria-disabled":b||void 0,disabled:b,className:M,type:d,ref:C,children:[k&&l.jsx(L,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:y}),p!=="label-only"&&l.jsx(L,{className:"pkt-btn__icon",name:e}),l.jsx("span",{className:"pkt-btn__text",children:s}),p==="icons-right-and-left"&&l.jsx(L,{className:"pkt-btn__icon",name:i})]})});He.displayName="PktButton";const Oh=Wt({tagName:"pkt-card",elementClass:lt,react:x,displayName:"PktCard",events:{}}),en=x.forwardRef(({children:s,...t},e)=>l.jsx(Oh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));en.displayName="PktCard";const sn=x.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:a,hasError:n=!1,className:r,isSwitch:h=!1,hideLabel:d=!1,labelPosition:p="right",defaultChecked:m,checked:f,optionalTag:k,optionalText:b="Valgfritt",requiredTag:y,requiredText:w="Må fylles ut",tagText:C,...M},T)=>{const V=[r,"pkt-input-check"].filter(Boolean).join(" "),N=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,d?"pkt-sr-only":""].filter(Boolean).join(" "),W=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Z=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Lt=()=>l.jsxs(l.Fragment,{children:[C&&l.jsx("span",{className:Z+" pkt-tag--gray",children:C}),k&&l.jsx("span",{className:Z+" pkt-tag--blue-light",children:b}),y&&l.jsx("span",{className:Z+" pkt-tag--beige",children:w})]});return l.jsx("div",{className:V,children:l.jsxs("div",{className:W,children:[p==="left"&&l.jsxs("label",{className:N,htmlFor:s,children:[i," ",Lt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:T,className:`pkt-input-check__input-checkbox ${n?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...f!==void 0?{checked:f}:{defaultChecked:m},...M}),p==="right"&&l.jsxs("label",{className:N,htmlFor:s,children:[i," ",Lt(),a&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:a})]})]})})});sn.displayName="PktCheckbox";const Ph=Wt({tagName:"pkt-combobox",elementClass:Q,react:x,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),an=x.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Ph,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));an.displayName="PktCombobox";const oi=Wt({tagName:"pkt-consent",elementClass:Ut,react:x,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});oi.displayName="PktConsent";const Mh=Wt({tagName:"pkt-datepicker",elementClass:et,react:x,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),nn=x.forwardRef(({helptext:s,...t},e)=>l.jsx(Mh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));nn.displayName="PktDatepicker";const Dh=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:a=!1,personvernOgInfoLink:n="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:d=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:f=null,cookieSecure:k=null,cookieExpiryDays:b=null,onToggleConsent:y=w=>{console.log(w.detail)}})=>{var C,M;const w=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:w,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:s.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&l.jsx("li",{className:"pkt-footer__text",children:s.text}),(C=s.links)==null?void 0:C.map((T,V)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${T.external?"pkt-link--external":""}`,href:T.href,target:T.openInNewTab||a?"_blank":"_self",rel:T.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(L,{className:"pkt-footer__link-icon",name:"chevron-right"}),T.text]})},`links-${V}`))]})]}),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}),(M=t.links)==null?void 0:M.map((T,V)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${T.external?"pkt-link--external":""}`,href:T.href,target:T.openInNewTab||a?"_blank":"_self",rel:T.openInNewTab||a?"noopener noreferrer":void 0,children:[l.jsx(L,{className:"pkt-footer__link-icon",name:"chevron-right"}),T.text]})},`links-${V}`))]})]}),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:n,target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(L,{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:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[l.jsx(L,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(oi,{triggerType:"footerlink",hotjarId:d,googleAnalyticsId:p,devMode:m,cookieDomain:f,cookieSecure:k,cookieExpiryDays:b,onToggleConsent:y})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(T=>T.language).map((T,V)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:T.href,"aria-label":`til ${T.language} versjon av nettsiden`,target:T.openInNewTab||a?"_blank":"_self",rel:T.openInNewTab||a?"noopener noreferrer":void 0,children:T.language})},`sociallinks-language-${V}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(T=>T.iconName).map((T,V)=>l.jsx(x.Fragment,{children:l.jsx("a",{href:T.href,"aria-label":`til ${T.iconName}`,className:"pkt-footer__social-icon-link",target:T.openInNewTab||a?"_blank":"_self",rel:T.openInNewTab||a?"noopener noreferrer":void 0,children:l.jsx(L,{className:"pkt-footer__social-icon",name:T.iconName})})},`sociallinks-${V}`))})]})]})})},Ih=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:a=!1,hotjarId:n=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:d=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:f=b=>{console.log(b.detail)},className:k})=>{const b=[k,"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((y,w)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${y.external?" pkt-link--external":""}`,href:y.href,target:y.openInNewTab||t?"_blank":"_self",rel:y.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(L,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),y.text]})},w)),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(L,{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(L,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),a&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(oi,{triggerType:"footerlink",hotjarId:n,googleAnalyticsId:r,devMode:h,cookieDomain:d,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:f})})]})})})},Lh=x.forwardRef(({className:s,logoLink:t="https://www.oslo.kommune.no/",serviceName:e,fixed:i=!0,scrollToHide:a=!0,user:n,userMenu:r,representing:h,userOptions:d,userMenuFooter:p,canChangeRepresentation:m=!0,showMenuButton:f=!1,showLogOutButton:k=!1,openMenu:b,logOut:y,changeRepresentation:w,children:C,...M},T)=>{const V=x.useMemo(()=>typeof(n==null?void 0:n.lastLoggedIn)=="string"?n.lastLoggedIn:n!=null&&n.lastLoggedIn?new Date(n.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[n]),[N,W]=x.useState(!1),[Z,Lt]=x.useState(0),[Bt,it]=x.useState(!1),rt=x.useRef(null);x.useEffect(()=>(document&&(document.addEventListener("mouseup",Vt),window.addEventListener("scroll",ot)),()=>{document&&(document.removeEventListener("mouseup",Vt),window.removeEventListener("scroll",ot))}));const Ft=()=>{it(!Bt)},Vt=B=>{rt.current&&!rt.current.contains(B.target)&&it(!1)},ot=()=>{if(a){const B=window.pageYOffset||document.documentElement.scrollTop;if(B<0||Math.abs(B-Z)<60)return;W(B>Z),Lt(B)}};return l.jsxs("header",{...M,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:ct(s,"pkt-header",{"pkt-header--fixed":i,"pkt-header--scroll-to-hide":a,"pkt-header--hidden":N}),ref:T,children:[l.jsxs("div",{className:"pkt-header__logo",children:[typeof t=="string"?l.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:t,children:l.jsx(L,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.15/logos/"})}):l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:t,children:l.jsx(L,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/13.15/logos/"})}),l.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:e})]}),l.jsx("nav",{className:"pkt-header__actions",children:l.jsxs("ul",{className:"pkt-header__actions-row",children:[f&&l.jsx("li",{children:l.jsx(He,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:b,children:"Meny"})}),(n||h)&&l.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Bt&&!N?"pkt-header--open-dropdown":""}`,ref:rt,children:[l.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":Bt,onClick:Ft,children:[l.jsx(L,{name:"user",className:"pkt-btn__icon"}),l.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(h==null?void 0:h.name)||(n==null?void 0:n.name)}),l.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(h==null?void 0:h.shortname)||(n==null?void 0:n.shortname)}),l.jsx(L,{name:"chevron-thin-down",className:"pkt-btn--closed"}),l.jsx(L,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),l.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[n&&l.jsxs("li",{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:n.name}),n.lastLoggedIn&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:V})]})]}),r&&l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:r.map((B,Tt)=>l.jsx("li",{children:typeof B.target=="string"?l.jsxs("a",{href:B.target,className:"pkt-link",children:[B.iconName&&l.jsx(L,{name:B.iconName,className:"pkt-link__icon"}),B.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:B.target,children:[B.iconName&&l.jsx(L,{name:B.iconName,className:"pkt-link__icon"}),B.title]})},`userMenu-${Tt}`))})}),(h||m)&&l.jsxs("li",{children:[h&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",h.orgNumber]})]}),l.jsx("ul",{className:"pkt-list mt-size-16",children:m&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:w,children:[l.jsx(L,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),l.jsx("li",{children:l.jsx("ul",{className:"pkt-list",children:(d||!k)&&l.jsxs(l.Fragment,{children:[d==null?void 0:d.map((B,Tt)=>l.jsx("li",{children:typeof B.target=="string"?l.jsxs("a",{href:B.target,className:"pkt-link",children:[B.iconName&&l.jsx(L,{name:B.iconName,className:"pkt-link__icon"}),B.title]}):l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:B.target,children:[B.iconName&&l.jsx(L,{name:B.iconName,className:"pkt-link__icon"}),B.title]})},`userOptions-${Tt}`)),!k&&l.jsx("li",{children:l.jsxs("button",{className:"pkt-link-button pkt-link",onClick:y,children:[l.jsx(L,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),p&&l.jsx("li",{className:"footer",children:l.jsx("ul",{className:"pkt-list-horizontal bordered",children:p.map((B,Tt)=>l.jsx("li",{children:typeof B.target=="string"?l.jsx("a",{href:B.target,className:"pkt-link",children:B.title}):l.jsx("button",{className:"pkt-link-button pkt-link",onClick:B.target,children:B.title})},`userMenuFooter-${Tt}`))})})]})]}),C&&l.jsx("li",{children:C}),k&&l.jsx("li",{children:l.jsx(He,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:y,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),Bh=Wt({tagName:"pkt-heading",elementClass:Me,react:x,displayName:"PktHeading"}),rn=x.forwardRef(({children:s,...t},e)=>l.jsx(Bh,{"data-testid":"pkt-heading",...t,ref:e,children:s}));rn.displayName="PktHeading";const Fh=Wt({tagName:"pkt-helptext",elementClass:le,react:x,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),on=x.forwardRef(({children:s,...t},e)=>l.jsx(Fh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));on.displayName="PktHelptext";const ln=x.forwardRef(({label:s,id:t,children:e,...i},a)=>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:a}),e]}));ln.displayName="PktInput";const Bs=x.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:a,counter:n,counterCurrent:r=0,counterMaxLength:h,optionalTag:d=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:f="Må fylles ut",tagText:k=null,hasError:b=!1,errorMessage:y,disabled:w=!1,inline:C=!1,ariaDescribedby:M,useWrapper:T=!0,children:V,className:N="",hasFieldset:W=!1,role:Z="group",counterPosition:Lt="bottom"},Bt)=>{const[it,rt]=x.useState(!1),Ft=M||(e?`${s}-helptext`:void 0),Vt=!!n,ot=Vt&&Lt==="top",B=Vt&&Lt==="bottom",Tt=()=>rt(pt=>!pt),ne=["pkt-inputwrapper",N,b?"pkt-inputwrapper--error":"",w?"pkt-inputwrapper--disabled":"",C?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),ce=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),re=()=>Vt?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,Ue=()=>l.jsxs(l.Fragment,{children:[k&&l.jsx("span",{className:ce+" pkt-tag--gray",children:k}),d&&l.jsx("span",{className:ce+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:ce+" pkt-tag--beige",children:f})]}),ds=()=>{const pt=l.jsxs(l.Fragment,{children:[t," ",Ue()]});return T?W?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:pt}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":Ft,id:`${s}-label`,children:pt}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":Ft,id:`${s}-label`,children:t})},pe=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&T&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(He,{skin:"tertiary",size:"small",variant:"icon-right",iconName:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:Tt,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:a??'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})]})]}),zt=l.jsxs(l.Fragment,{children:[ds(),pe(),ot&&l.jsx(re,{}),V,B&&l.jsx(re,{}),b&&y&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(Ii,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:y})})]});return l.jsx("div",{className:ne,ref:Bt,role:Z,children:W?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":Ft,children:zt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:zt})})});Bs.displayName="PktInputWrapper";const hn=({href:s,iconName:t,className:e,iconPosition:i,external:a,target:n,children:r,...h})=>{const d={"pkt-link":!0,"pkt-link--icon-left":!!t&&i==="left"||!!(t&&!i),"pkt-link--icon-right":!!t&&i==="right","pkt-link--external":a};return l.jsxs("a",{...h,className:ct(d,e),href:s,target:n,rel:a?"noopener noreferrer":void 0,children:[t&&l.jsx(L,{name:t,className:"pkt-link__icon"}),r]})};hn.displayName="PktLink";const dn=({children:s,skin:t,title:e,href:i,iconName:a,openInNewTab:n,external:r,className:h,...d})=>{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",{...d,href:i,className:ct(p,h),target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[a&&l.jsx(L,{className:"pkt-link__icon",name:a}),e&&l.jsx("div",{className:ct(m),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};dn.displayName="PktLinkCard";const Vh=Wt({tagName:"pkt-loader",elementClass:Yt,react:x,displayName:"PktLoader",events:{}}),cn=x.forwardRef(({children:s,...t},e)=>l.jsx(Vh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));cn.displayName="PktLoader";const pn=({children:s,className:t,skin:e,title:i,compact:a,closable:n,onClose:r,...h})=>{const[d,p]=x.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":a,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":n,"pkt-hide":d},f=x.createRef(),k=x.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:ct(m,t),ref:f,children:[n&&l.jsx("div",{className:'"pkt-messagebox__close"',children:l.jsx("button",{onClick:k,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(L,{name:"close",className:"pkt-link__icon"})})}),l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};pn.displayName="PktMessagebox";const jh=Wt({tagName:"pkt-modal",elementClass:Dt,react:x,displayName:"PktModal",events:{}}),un=x.forwardRef(({children:s,...t},e)=>l.jsx(jh,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));un.displayName="PktModal";const Hh=Wt({tagName:"pkt-progressbar",elementClass:st,react:x,displayName:"PktProgressbar",events:{}}),fn=x.forwardRef(({children:s,...t},e)=>l.jsx(Hh,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));fn.displayName="PktProgressbar";const gn=x.forwardRef(({id:s,name:t,label:e,className:i,hasTile:a=!1,disabled:n=!1,checkHelptext:r,hasError:h=!1,defaultChecked:d,checked:p,optionalTag:m,optionalText:f,requiredTag:k,requiredText:b,tagText:y,...w},C)=>{const M=[i,"pkt-input-check"].filter(Boolean).join(" "),T=["pkt-input-check__input",a?"pkt-input-check__input--tile":"",n&&a?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),V=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),N=["pkt-input-check__input-label",n?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),W=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Z=()=>l.jsxs(l.Fragment,{children:[y&&l.jsx("span",{className:W+" pkt-tag--gray",children:y}),m&&l.jsx("span",{className:W+" pkt-tag--blue-light",children:f}),k&&l.jsx("span",{className:W+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:M,children:l.jsxs("div",{className:T,children:[l.jsx("input",{ref:C,id:s,type:"radio",name:t,disabled:n,className:V,...p!==void 0?{checked:p}:{defaultChecked:d},...w}),l.jsxs("label",{className:N,htmlFor:s,children:[e," ",Z(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});gn.displayName="PktRadioButton";const Uh=x.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:a,name:n,placeholder:r="Søk…",suggestions:h,value:d="",action:p,method:m,onChange:f,onSearch:k,onSuggestionClick:b,...y},w)=>{const C=(N,W)=>{N?N():b&&b(W)},M=N=>{d=N.target.value},T=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let V;return p?V=N=>l.jsx("form",{role:"search",className:T,action:p,method:m,children:N}):V=N=>l.jsx("div",{role:"search",className:T,children:N}),V(l.jsxs(l.Fragment,{children:[a&&l.jsx("label",{htmlFor:a?i:void 0,className:a?"pkt-inputwrapper__label":"",children:a}),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:n||i,id:i,placeholder:r,defaultValue:d,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:w,"aria-controls":`${i}-suggestions`,onChange:f||M,onKeyUp:k&&(N=>{N.key==="Enter"&&(N.preventDefault(),k(d))}),...y}),l.jsx(He,{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:k&&(N=>{N.preventDefault(),k(d)}),children:a||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((N,W)=>l.jsx("li",{children:x.createElement(N.href?"a":N.onClick?"button":"div",{href:N.href,className:`pkt-searchinput__suggestion ${N.onClick?"pkt-link-button":""} ${N.href||N.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:N.onClick?"button":void 0,onClick:()=>C(N.onClick,W),onKeyUp:Z=>Z.key==="Enter"&&C(N.onClick,W)},l.jsxs(l.Fragment,{children:[N.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:N.title}),N.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:N.text})]}))},`search-suggestion-${W}`))})]}))}),qh=x.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:a=!1,errorMessage:n,hasError:r,helptext:h,helptextDropdown:d,helptextDropdownButton:p,id:m,inline:f=!1,fullwidth:k=!1,label:b,name:y,optionalTag:w=!1,optionalText:C,requiredTag:M=!1,requiredText:T,tagText:V,...N},W)=>{const Z=[i,"pkt-select"].join(" ");return l.jsx(Bs,{className:Z,forId:`${m}-input`,label:b,helptext:h,helptextDropdown:d,helptextDropdownButton:p,optionalTag:w,optionalText:C,requiredTag:M,requiredText:T,tagText:V,hasError:r,errorMessage:n,disabled:a,inline:f,ariaDescribedby:s,children:l.jsx("select",{ref:W,className:`pkt-input ${k?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:a,id:`${m}-input`,name:y||m,...N,children:e})})}),zh=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)"}})}),Wh=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"})]}),Rh=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"})]}),Kh=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:ct("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:ct("pkt-step__indicator"),children:e==="current"?Wh:e==="completed"?Rh:zh}),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})]})]}),Gh=x.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:a=!0,orientation:n="vertical",...r},h)=>{const d=ct(t,"pkt-stepper",n==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=x.Children.map(e,(m,f)=>x.isValidElement(m)?x.cloneElement(m,{className:ct(m.props.className,{"pkt-step--hideStep":i&&f!==s,"pkt-step--hideContent":a&&f!==s})}):m);return l.jsx("ol",{"data-testid":"pkt-stepper",className:d,ref:h,...r,children:p})}),Yh=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:a,...n})=>l.jsx("table",{"data-testid":"pkt-table",className:ct(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",...n,children:a}),Zh=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:ct(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Xh=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:ct(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Jh=({className:s,children:t,...e})=>l.jsx("thead",{className:ct(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),Qh=({className:s,children:t,...e})=>l.jsx("th",{className:ct(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),td=({className:s,children:t,...e})=>l.jsx("tr",{className:ct(s,"pkt-table__row",{}),role:"row",...e,children:t}),Li=x.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:a,className:n,iconName:r,ariaLabel:h,onClose:d,type:p,"aria-description":m,...f},k)=>{const[b,y]=x.useState(!1),w=x.useCallback(()=>{y(!0),d&&d()},[y]),C=x.useRef(null),M=x.useMemo(()=>{var N,W;if(a&&!h){const Z=(W=(N=C.current)==null?void 0:N.textContent)==null?void 0:W.trim();return Z&&`Klikk for å fjerne ${Z}`||m}},[a,h]),T={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},V={"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":a&&!!r,"pkt-hide":b};return a?l.jsxs("button",{...f,className:ct(V,n),type:p,onClick:w,"aria-label":h,"aria-description":M,ref:k,children:[r&&l.jsx(L,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:C,children:s}),l.jsx(L,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...f,className:ct(T,n),ref:k,children:[r&&l.jsx(L,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:C,children:s})]})});Li.displayName="PktTag";const Bi=x.forwardRef(({children:s,active:t,href:e,onClick:i,icon:a,controls:n,tag:r,tagSkin:h,index:d=0},p)=>{const{arrowNav:m,registerTabRef:f,handleKeyPress:k,selectTab:b}=ed(),w={"aria-selected":m?!!t:void 0,"aria-controls":n,role:m?"tab":void 0,onKeyUp:M=>k(d,M),onClick:M=>{b(d),i==null||i(M)},tabIndex:t||!m?void 0:-1,ref:M=>{f(d,M),typeof p=="function"?p(M):p&&(p.current=M)}},C=l.jsxs(l.Fragment,{children:[a&&l.jsx(L,{name:a,className:"pkt-icon--small"}),s,r&&l.jsx(Li,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...w,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:C}):l.jsx("button",{...w,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:C})});Bi.displayName="PktTabItem";const mn=x.createContext(null),ed=()=>{const s=x.useContext(mn);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},sd=x.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:a},n)=>{const r=x.useRef([]),h=s&&!t,p=a&&x.Children.count(a)>0?x.Children.count(a):(e==null?void 0:e.length)||0;x.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=y=>{const w=e==null?void 0:e[y];w!=null&&w.action&&w.action(y),i&&i(y)},f=(y,w)=>{var C,M;h&&(w.code==="ArrowLeft"&&y!==0&&((C=r.current[y-1])==null||C.focus()),w.code==="ArrowRight"&&y<p-1&&((M=r.current[y+1])==null||M.focus()),(w.code==="ArrowDown"||w.code==="Space")&&m(y))},k=(y,w)=>{r.current[y]=w},b=e==null?void 0:e.map((y,w)=>{var C,M;return l.jsx(Bi,{active:y.active,href:y.href,onClick:()=>m(w),icon:y.icon,controls:y.controls,tag:(C=y.tag)==null?void 0:C.text,tagSkin:(M=y.tag)==null?void 0:M.skin,index:w,children:y.text},w)});return l.jsx(mn.Provider,{value:{arrowNav:h,registerTabRef:k,handleKeyPress:f,selectTab:m},children:l.jsx("div",{className:"pkt-tabs",ref:n,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:a||b})})})}),id=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:a,className:n,disabled:r,errorMessage:h,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:f,inline:k,fullwidth:b=!1,label:y,name:w,optionalTag:C=!1,optionalText:M,requiredTag:T=!1,requiredText:V,tagText:N=null,placeholder:W,rows:Z,useWrapper:Lt=!0,onChange:Bt,value:it,autoComplete:rt="off",minLength:Ft,maxLength:Vt,readOnly:ot=!1,skipForwardTestid:B=!1,...Tt},ne)=>{const ce=[n,"pkt-textinput","pkt-textarea"].join(" "),re=`${s}-input`,Ue=`${re}-label`,ds=e||Ue,[pe,zt]=x.useState(0),pt=qe=>{var ze,ue;if(i&&zt(((ue=(ze=qe.currentTarget)==null?void 0:ze.value)==null?void 0:ue.length)||0),Bt)return Bt(qe)};return x.useEffect(()=>{it!==void 0&&zt((it==null?void 0:it.length)||0)},[it]),l.jsx(Bs,{ariaDescribedby:t,className:ce,disabled:r,errorMessage:h,forId:re,hasError:d,helptext:p,helptextDropdown:m,helptextDropdownButton:f,inline:k,label:y,optionalTag:C,optionalText:M,requiredTag:T,requiredText:V,tagText:N,useWrapper:Lt,counter:i,counterCurrent:pe,counterMaxLength:a,children:l.jsx("textarea",{ref:ne,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${a&&pe>a?"pkt-input--counter-error":""}`,name:`${w||s}`,id:re,placeholder:W,disabled:r,rows:Z,"aria-labelledby":ds,"aria-invalid":d,"aria-errormessage":`${s}-error`,...Tt,onChange:pt,value:it,autoComplete:rt,minLength:Ft,maxLength:Vt,"data-skip-forward-testid":B?"true":void 0})})}),ad=x.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:a,counterMaxLength:n,className:r,disabled:h=!1,errorMessage:d,hasError:p=!1,helptext:m,helptextDropdown:f,helptextDropdownButton:k,iconNameRight:b,inline:y=!1,fullwidth:w=!1,label:C,name:M,optionalTag:T=!1,optionalText:V,requiredTag:N=!1,requiredText:W,tagText:Z=null,placeholder:Lt,prefix:Bt,suffix:it,type:rt="text",useWrapper:Ft=!0,omitSearchIcon:Vt=!1,value:ot,minLength:B,maxLength:Tt,min:ne,max:ce,step:re,size:Ue,readonly:ds,required:pe,dataTestid:zt,onChange:pt,skipForwardTestid:qe=!1,...ze},ue)=>{const Vi=[r,"pkt-textinput"].join(" "),li=rt==="search"&&!b&&!Vt,ji=rt==="date"&&ot?ot.slice(0,10):ot,[hi,cs]=x.useState((ot==null?void 0:ot.length)||0),ps=`${s}`,Vs=`${ps}-label`,di=e||Vs,Hi=_e=>{var ci,pi;a&&cs(((pi=(ci=_e.currentTarget)==null?void 0:ci.value)==null?void 0:pi.length)||0),pt&&pt(_e)};return x.useEffect(()=>{ot!==void 0&&cs((ot==null?void 0:ot.length)||0)},[ot]),l.jsx(Bs,{ariaDescribedby:t,className:Vi,disabled:h,errorMessage:d,forId:ps,hasError:p,helptext:m,helptextDropdown:f,helptextDropdownButton:k,inline:y,label:C,optionalTag:T,optionalText:V,requiredTag:N,requiredText:W,tagText:Z,useWrapper:Ft,counter:a,counterCurrent:hi,counterMaxLength:n,children:l.jsxs("div",{className:"pkt-input__container","data-testid":zt,"data-skip-forward-testid":qe?"true":void 0,children:[Bt&&l.jsx("div",{className:"pkt-input-prefix",children:Bt}),l.jsx("input",{...ze,ref:ue,className:`pkt-input ${w?"pkt-input--fullwidth":""} ${n&&hi>n?"pkt-input--counter-error":""}`,type:rt,name:`${M||s}`,value:ji,id:ps,placeholder:Lt,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":di,min:ne,max:ce,onChange:Hi,step:re,minLength:B,maxLength:Tt,size:Ue,required:pe}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(L,{className:"pkt-input-suffix-icon",name:b}),li&&l.jsx(L,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(L,{className:"pkt-input-icon",name:b}),!it&&li&&l.jsx(L,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})});var ls=window.CustomEvent;(!ls||typeof ls=="object")&&(ls=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ls.prototype=window.Event.prototype);function vn(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function nd(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,a){return!(t[i]===void 0||t[i]===a)};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 Fs(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 bn(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function rd(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function Fi(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function yn(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 a=s.querySelectorAll("*"),n=0;n<a.length&&!(a[n].tagName&&a[n].shadowRoot&&(i=yn(a[n].shadowRoot),i));n++);return i}function kn(s){return s.isConnected||document.body.contains(s)}function $n(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,a="getRootNode"in i&&i.getRootNode()||document;e=a.activeElement}return!e||e.form!==t?null:e}function od(s){if(!s.defaultPrevented){var t=s.target,e=z.imagemapUseValue,i=$n(s);e===null&&i&&(e=i.value);var a=Fs(t);if(a){var n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&(s.preventDefault(),e!=null?a.close(e):a.close())}}}function _n(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",od,!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),a,n=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(a),a=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,n)})}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))}_n.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&kn(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=yn(this.dialog_)),bn(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(!kn(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.");nd(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 ls("close",{bubbles:!1,cancelable:!1});vn(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 a=0;a<i.length;++a){var n=i[a],r=null;try{r=document.querySelectorAll(n.selectorText)}catch{}if(!(!r||!rd(r,s))){var h=n.style.getPropertyValue("top"),d=n.style.getPropertyValue("bottom");if(h&&h!=="auto"||d&&d!=="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 _n(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 a=0,n;n=i.removedNodes[a];++a){if(n instanceof Element)n.localName==="dialog"&&e.push(n);else continue;e=e.concat(n.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 a=i.dialog.parentNode||document.body;a.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},z.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=Fs(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(),bn(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,a=i.compareDocumentPosition(t);return a&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 ls("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&vn(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 wn=document.createElement("form");if(wn.setAttribute("method","dialog"),wn.method!=="dialog"){var hs=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(hs){var ld=hs.get;hs.get=function(){return Fi(this)?"dialog":ld.call(this)};var hd=hs.set;hs.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):hd.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",hs)}}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||!Fi(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 a=Fs(t);a&&(z.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=Fs(t);if(!e){var i=$n(s),a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&s.preventDefault()}});var dd=HTMLFormElement.prototype.submit,cd=function(){if(!Fi(this))return dd.call(this);var s=Fs(this);s&&s.close()};HTMLFormElement.prototype.submit=cd}const pd=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=Ri,P.PktAccordionItem=Ja,P.PktAlert=Ii,P.PktBackLink=tn,P.PktBreadcrumbs=Eh,P.PktButton=He,P.PktCard=en,P.PktCheckbox=sn,P.PktCombobox=an,P.PktConsent=oi,P.PktDatepicker=nn,P.PktFooter=Dh,P.PktFooterSimple=Ih,P.PktHeader=Lh,P.PktHeading=rn,P.PktHelptext=on,P.PktIcon=L,P.PktInput=ln,P.PktInputWrapper=Bs,P.PktLink=hn,P.PktLinkCard=dn,P.PktLoader=cn,P.PktMessagebox=pn,P.PktModal=un,P.PktProgressbar=fn,P.PktRadioButton=gn,P.PktSearchInput=Uh,P.PktSelect=qh,P.PktStep=Kh,P.PktStepper=Gh,P.PktTabItem=Bi,P.PktTable=Yh,P.PktTableBody=Zh,P.PktTableDataCell=Xh,P.PktTableHeader=Jh,P.PktTableHeaderCell=Qh,P.PktTableRow=td,P.PktTabs=sd,P.PktTag=Li,P.PktTextarea=id,P.PktTextinput=ad,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|