@oslokommune/punkt-react 14.1.0 → 14.2.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 +18 -0
- package/dist/index.d.ts +11 -13
- package/dist/punkt-react.es.js +409 -425
- package/dist/punkt-react.umd.js +45 -45
- package/package.json +5 -5
- package/src/components/accordion/Accordion.tsx +2 -1
- package/src/components/accordion/AccordionItem.tsx +2 -1
- package/src/components/alert/Alert.tsx +3 -3
- package/src/components/card/Card.tsx +2 -2
- package/src/components/icon/Icon.tsx +1 -2
- package/src/components/messagebox/Messagebox.tsx +2 -1
package/dist/punkt-react.umd.js
CHANGED
|
@@ -95,11 +95,11 @@
|
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2017 Google LLC
|
|
97
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
98
|
-
*/let Ui=class extends gi{};Ui.directiveName="unsafeSVG",Ui.resultType=2;const Un=He(Ui);var Hr=Object.defineProperty,Vr=Object.getOwnPropertyDescriptor,Ls=(s,t,e,i)=>{for(var n=i>1?void 0:i?Vr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Hr(t,e,n),n};const zi="https://punkt-cdn.oslo.kommune.no/14.
|
|
98
|
+
*/let Ui=class extends gi{};Ui.directiveName="unsafeSVG",Ui.resultType=2;const Un=He(Ui);var Hr=Object.defineProperty,Vr=Object.getOwnPropertyDescriptor,Ls=(s,t,e,i)=>{for(var n=i>1?void 0:i?Vr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Hr(t,e,n),n};const zi="https://punkt-cdn.oslo.kommune.no/14.2/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||zi);const Ur=s=>new Promise(t=>setTimeout(t,s)),vi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',qi={},zr=async(s,t)=>{let e=0;for(;qi[t+s+".svg"]==="fetching"&&(e++,!(e>50));)await Ur(50);const i=typeof Storage<"u"&&typeof sessionStorage<"u";return i&&sessionStorage.getItem(t+s+".svg")?Promise.resolve(sessionStorage.getItem(t+s+".svg")):typeof window<"u"&&typeof window.pktFetch=="function"?(qi[t+s+".svg"]="fetching",Promise.resolve(window.pktFetch(t+s+".svg").then(n=>n.ok?n.text():(console.error("Missing icon: "+t+s+".svg"),vi)).then(n=>(n!==vi&&i&&sessionStorage.setItem(t+s+".svg",n),qi[t+s+".svg"]="fetched",n)))):Promise.resolve(vi)};let Ue=class extends X{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:zi,this.name="",this.icon=Un(vi),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){this._updatedProps.length>0?(this.path||(this.path=typeof window<"u"?window.pktIconPath:zi),this.icon=Un(await zr(this.name||"",this.path).then(e=>e)),this._updatedProps=[]):this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return d`${this.name&&this.icon}`}};Ls([o({type:String,reflect:!1})],Ue.prototype,"path",2),Ls([o({type:String,reflect:!0})],Ue.prototype,"name",2),Ls([o({type:SVGElement})],Ue.prototype,"icon",2),Ls([o({type:Array,noAccessor:!0})],Ue.prototype,"_updatedProps",2),Ue=Ls([F("pkt-icon")],Ue);/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const C=s=>s??y;var qr=Object.defineProperty,Wr=Object.getOwnPropertyDescriptor,vt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Wr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&qr(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.
|
|
102
|
+
*/const C=s=>s??y;var qr=Object.defineProperty,Wr=Object.getOwnPropertyDescriptor,vt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Wr(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&qr(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.2/animations/";let pt=class extends X{constructor(){super(),this.defaultSlot=E(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new rt(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 d`
|
|
103
103
|
<button
|
|
104
104
|
class=${N(e)}
|
|
105
105
|
type=${this.type}
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
></pkt-icon
|
|
203
203
|
><span class="pkt-back-link__text">${this.text}</span></a
|
|
204
204
|
>
|
|
205
|
-
</nav>`}};ki([o({type:String})],ds.prototype,"href",2),ki([o({type:String})],ds.prototype,"text",2),ki([o({type:String})],ds.prototype,"ariaLabel",2),ds=ki([F("pkt-backlink")],ds);const zn=6048e5,eo=864e5,qn=Symbol.for("constructDateFrom");function le(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&qn in s?s[qn](t):s instanceof Date?new s.constructor(t):new Date(t)}function Ft(s,t){return le(t||s,s)}function Wn(s,t,e){const i=Ft(s,void 0);return isNaN(t)?le(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let so={};function yi(){return so}function Fs(s,t){var e,i,n,a;const r=yi(),h=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??r.weekStartsOn??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.weekStartsOn)??0,c=Ft(s,t==null?void 0:t.in),p=c.getDay(),m=(p<h?7:0)+p-h;return c.setDate(c.getDate()-m),c.setHours(0,0,0,0),c}function $i(s,t){return Fs(s,{...t,weekStartsOn:1})}function Rn(s,t){const e=Ft(s,void 0),i=e.getFullYear(),n=le(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=$i(n),r=le(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=$i(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Kn(s){const t=Ft(s),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+s-+e}function Yn(s,...t){const e=le.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Gn(s,t){const e=Ft(s,void 0);return e.setHours(0,0,0,0),e}function io(s,t,e){const[i,n]=Yn(void 0,s,t),a=Gn(i),r=Gn(n),h=+a-Kn(a),c=+r-Kn(r);return Math.round((h-c)/eo)}function no(s,t){const e=Rn(s),i=le(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),$i(i)}function ao(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function ro(s){return!(!ao(s)&&typeof s!="number"||isNaN(+Ft(s)))}function oo(s,t){const[e,i]=Yn(s,t.start,t.end);return{start:e,end:i}}function Zn(s,t){const{start:e,end:i}=oo(void 0,s);let n=+e>+i;const a=n?+e:+i,r=n?i:e;r.setHours(0,0,0,0);let h=1;const c=[];for(;+r<=a;)c.push(le(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?c.reverse():c}function lo(s,t){const e=Ft(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ho={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},co=(s,t,e)=>{let i;const n=ho[s];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Wi(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const uo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},po={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fo={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},go={date:Wi({formats:uo,defaultWidth:"full"}),time:Wi({formats:po,defaultWidth:"full"}),dateTime:Wi({formats:fo,defaultWidth:"full"})},mo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vo=(s,t,e,i)=>mo[s];function js(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;n=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;n=s.values[h]||s.values[r]}const a=s.argumentCallback?s.argumentCallback(t):t;return n[a]}}const bo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ko={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yo={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$o={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_o={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},wo={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},xo=(s,t)=>{const e=Number(s),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},So={ordinalNumber:xo,era:js({values:bo,defaultWidth:"wide"}),quarter:js({values:ko,defaultWidth:"wide",argumentCallback:s=>s-1}),month:js({values:yo,defaultWidth:"wide"}),day:js({values:$o,defaultWidth:"wide"}),dayPeriod:js({values:_o,defaultWidth:"wide",formattingValues:wo,defaultFormattingWidth:"wide"})};function Hs(s){return(t,e={})=>{const i=e.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],a=t.match(n);if(!a)return null;const r=a[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],c=Array.isArray(h)?To(h,v=>v.test(r)):Co(h,v=>v.test(r));let p;p=s.valueCallback?s.valueCallback(c):c,p=e.valueCallback?e.valueCallback(p):p;const m=t.slice(r.length);return{value:p,rest:m}}}function Co(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function To(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function No(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const n=i[0],a=t.match(s.parsePattern);if(!a)return null;let r=s.valueCallback?s.valueCallback(a[0]):a[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(n.length);return{value:r,rest:h}}}const Eo=/^(\d+)(th|st|nd|rd)?/i,Mo=/\d+/i,Ao={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Oo={any:[/^b/i,/^(a|c)/i]},Po={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Do={any:[/1/i,/2/i,/3/i,/4/i]},Io={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Lo={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Bo={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Fo={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},jo={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ho={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Vo={ordinalNumber:No({matchPattern:Eo,parsePattern:Mo,valueCallback:s=>parseInt(s,10)}),era:Hs({matchPatterns:Ao,defaultMatchWidth:"wide",parsePatterns:Oo,defaultParseWidth:"any"}),quarter:Hs({matchPatterns:Po,defaultMatchWidth:"wide",parsePatterns:Do,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Hs({matchPatterns:Io,defaultMatchWidth:"wide",parsePatterns:Lo,defaultParseWidth:"any"}),day:Hs({matchPatterns:Bo,defaultMatchWidth:"wide",parsePatterns:Fo,defaultParseWidth:"any"}),dayPeriod:Hs({matchPatterns:jo,defaultMatchWidth:"any",parsePatterns:Ho,defaultParseWidth:"any"})},Uo={code:"en-US",formatDistance:co,formatLong:go,formatRelative:vo,localize:So,match:Vo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zo(s,t){const e=Ft(s,void 0);return io(e,lo(e))+1}function qo(s,t){const e=Ft(s,void 0),i=+$i(e)-+no(e);return Math.round(i/zn)+1}function Xn(s,t){var e,i,n,a;const r=Ft(s,t==null?void 0:t.in),h=r.getFullYear(),c=yi(),p=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??c.firstWeekContainsDate??((a=(n=c.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,m=le((t==null?void 0:t.in)||s,0);m.setFullYear(h+1,0,p),m.setHours(0,0,0,0);const v=Fs(m,t),$=le((t==null?void 0:t.in)||s,0);$.setFullYear(h,0,p),$.setHours(0,0,0,0);const b=Fs($,t);return+r>=+v?h+1:+r>=+b?h:h-1}function Wo(s,t){var e,i,n,a;const r=yi(),h=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??r.firstWeekContainsDate??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,c=Xn(s,t),p=le((t==null?void 0:t.in)||s,0);return p.setFullYear(c,0,h),p.setHours(0,0,0,0),Fs(p,t)}function Jn(s,t){const e=Ft(s,t==null?void 0:t.in),i=+Fs(e,t)-+Wo(e,t);return Math.round(i/zn)+1}function K(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Ne={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return K(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):K(e+1,2)},d(s,t){return K(s.getDate(),t.length)},a(s,t){const e=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(s,t){return K(s.getHours()%12||12,t.length)},H(s,t){return K(s.getHours(),t.length)},m(s,t){return K(s.getMinutes(),t.length)},s(s,t){return K(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return K(n,t.length)}},us={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Qn={G:function(s,t,e){const i=s.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(s,t,e){if(t==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return Ne.y(s,t)},Y:function(s,t,e,i){const n=Xn(s,i),a=n>0?n:1-n;if(t==="YY"){const r=a%100;return K(r,2)}return t==="Yo"?e.ordinalNumber(a,{unit:"year"}):K(a,t.length)},R:function(s,t){const e=Rn(s);return K(e,t.length)},u:function(s,t){const e=s.getFullYear();return K(e,t.length)},Q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return K(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return K(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,t,e){const i=s.getMonth();switch(t){case"M":case"MM":return Ne.M(s,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(s,t,e){const i=s.getMonth();switch(t){case"L":return String(i+1);case"LL":return K(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(s,t,e,i){const n=Jn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):K(n,t.length)},I:function(s,t,e){const i=qo(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):K(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):Ne.d(s,t)},D:function(s,t,e){const i=zo(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):K(i,t.length)},E:function(s,t,e){const i=s.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return K(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return K(a,t.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return K(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(s,t,e){const i=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,t,e){const i=s.getHours();let n;switch(i===12?n=us.noon:i===0?n=us.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let n;switch(i>=17?n=us.evening:i>=12?n=us.afternoon:i>=4?n=us.morning:n=us.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,t,e){if(t==="ho"){let i=s.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Ne.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Ne.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):K(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):K(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):Ne.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Ne.s(s,t)},S:function(s,t){return Ne.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ea(i);case"XXXX":case"XX":return qe(i);case"XXXXX":case"XXX":default:return qe(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return ea(i);case"xxxx":case"xx":return qe(i);case"xxxxx":case"xxx":default:return qe(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ta(i,":");case"OOOO":default:return"GMT"+qe(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ta(i,":");case"zzzz":default:return"GMT"+qe(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return K(i,t.length)},T:function(s,t,e){return K(+s,t.length)}};function ta(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),a=i%60;return a===0?e+String(n):e+String(n)+t+K(a,2)}function ea(s,t){return s%60===0?(s>0?"-":"+")+K(Math.abs(s)/60,2):qe(s,t)}function qe(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=K(Math.trunc(i/60),2),a=K(i%60,2);return e+n+t+a}const sa=(s,t)=>{switch(s){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ia=(s,t)=>{switch(s){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ro=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return sa(s,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",sa(i,t)).replace("{{time}}",ia(n,t))},Ko={p:ia,P:Ro},Yo=/^D+$/,Go=/^Y+$/,Zo=["D","DD","YY","YYYY"];function Xo(s){return Yo.test(s)}function Jo(s){return Go.test(s)}function Qo(s,t,e){const i=tl(s,t,e);if(console.warn(i),Zo.includes(s))throw new RangeError(i)}function tl(s,t,e){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const el=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,il=/^'([^]*?)'?$/,nl=/''/g,al=/[a-zA-Z]/;function rl(s,t,e){var i,n,a,r;const h=yi(),c=h.locale??Uo,p=h.firstWeekContainsDate??((n=(i=h.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,m=h.weekStartsOn??((r=(a=h.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??0,v=Ft(s,void 0);if(!ro(v))throw new RangeError("Invalid time value");let $=t.match(sl).map(k=>{const x=k[0];if(x==="p"||x==="P"){const T=Ko[x];return T(k,c.formatLong)}return k}).join("").match(el).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const x=k[0];if(x==="'")return{isToken:!1,value:ol(k)};if(Qn[x])return{isToken:!0,value:k};if(x.match(al))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:k}});c.localize.preprocessor&&($=c.localize.preprocessor(v,$));const b={firstWeekContainsDate:p,weekStartsOn:m,locale:c};return $.map(k=>{if(!k.isToken)return k.value;const x=k.value;(Jo(x)||Xo(x))&&Qo(x,t,String(s));const T=Qn[x[0]];return T(v,x,c.localize,b)}).join("")}function ol(s){const t=s.match(il);return t?t[1].replace(nl,"'"):s}function ll(s,t){const e=Ft(s,void 0).getDay();return e===0?7:e}function hl(s,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const na={},Vs={};function We(s,t){try{const e=(na[s]||(na[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Vs?Vs[e]:aa(e,e.split(":"))}catch{if(s in Vs)return Vs[s];const e=s==null?void 0:s.match(cl);return e?aa(s,e.slice(1)):NaN}}const cl=/([+-]\d\d):?(\d\d)?/;function aa(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Vs[s]=e*60+i>0?e*60+i+n:e*60-i-n}let Us=class ai extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(We(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),oa(this),Ri(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new ai(...e,t):new ai(Date.now(),t)}withTimeZone(t){return new ai(+this,t)}getTimezoneOffset(){const t=-We(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ri(this),+this}[Symbol.for("constructDateFrom")](t){return new ai(+new Date(t),this.timeZone)}};const ra=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ra.test(s))return;const t=s.replace(ra,"$1UTC");Us.prototype[t]&&(s.startsWith("get")?Us.prototype[s]=function(){return this.internal[t]()}:(Us.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),dl(this),+this},Us.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ri(this),+this}))});function Ri(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-We(s.timeZone,s)*60))}function dl(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),oa(s)}function oa(s){const t=We(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),a=-new Date(+i).getTimezoneOffset(),r=n-a,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const c=n-e;c&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+c);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(We(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const $=We(s.timeZone,s),b=$>0?Math.floor($):Math.ceil($),k=-new Date(+s).getTimezoneOffset()-b,x=b!==e,T=k-c;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const S=We(s.timeZone,s),A=S>0?Math.floor(S):Math.ceil(S),I=b-A;I&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+I),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+I))}}let Ki=class ri extends Us{static tz(t,...e){return e.length?new ri(...e,t):new ri(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),n=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,n]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${n}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,n]=this.tzComponents();return`${t} GMT${e}${i}${n} (${hl(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",i=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),n=String(Math.abs(t)%60).padStart(2,"0");return[e,i,n]}withTimeZone(t){return new ri(+this,t)}[Symbol.for("constructDateFrom")](t){return new ri(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const ul=(s=window.pktTz)=>{const t=new Ki(new Date().toISOString(),s);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function Ee(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[t,e,i]=s.split("-").map(Number);return new Date(t,e-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[t,e]=s.split("-").map(Number);return new Date(t,e-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const bt=s=>{if(!s||isNaN(s.getTime()))return"";const t=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${t}-${e}-${i}`},Me=s=>{if(!s)return null;const t=Ee(s);return isNaN(t.getTime())?null:t},la=(s,t)=>{const e=me(s);return isNaN(e.getTime())?"":rl(e,t)},me=(s="",t)=>{const e=typeof s=="string"?Ee(s):s;return!e||isNaN(e.getTime())?new Date:e},Re=(s,t,e=1)=>{if(typeof s!="number"||typeof t!="number"||typeof e!="number"||isNaN(s)||isNaN(t)||isNaN(e))return new Date;const i=new Date(s,t,e);return isNaN(i.getTime())?new Date:i},zs=s=>{let t;return typeof s=="number"?t=new Ki(s,window.pktTz):t=new Ki(s,window.pktTz),t.setHours(12,0,0,0),t},pl=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),fl=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?me(t):null,n=e?me(e):null;return!(i&&s<i||n&&s>n)},gl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=bt(s);return t.includes(e)},ml=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ha=(s,t,e,i,n)=>!(!s||isNaN(s.getTime())||!fl(s,t,e)||i&&gl(s,i)||n&&ml(s,n)),vl=(s,t,e,i,n)=>s.filter(a=>{const r=Me(a);return r&&ha(r,t,e,i,n)}),ca=s=>s.slice().sort((t,e)=>{const i=Me(t),n=Me(e);return!i||!n?0:i.getTime()-n.getTime()}),bl=(s,t)=>{const e=Me(s),i=Me(t);return!e||!i?!1:e<=i},qs=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],kl=s=>s.join(","),da=s=>qs(s),yl=s=>s?Ee(s):null,$l=s=>{if(typeof s=="string")return s.split(",").map(t=>Ee(t));if(Array.isArray(s))return s.map(t=>Ee(t))},ps={csvToArray:da,stringToDate:yl,stringsToDate:$l},_l={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Ke={props:_l};function ua(s,t){const e=t.excludedates.map(i=>typeof i=="string"?i:bt(i));return!ha(s,t.earliest,t.latest,e,t.excludeweekdays)}function wl(s,t,e,i){return!!(ua(s,e)||!t&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function xl(s,t,e){const i=Re(s,t,0);return!(e&&me(e)>i)}function Sl(s,t,e){const i=Re(t===11?s+1:s,t===11?0:t+1,1);return!(e&&me(e)<i)}const Ws=7,Cl=6;function Tl(s,t){const e=Re(s,t,1),i=Re(s,t+1,0),n=(e.getDay()+Cl)%Ws,a=i.getDate(),r=Math.ceil((a+n)/Ws),h=Re(s,t,0).getDate(),c=Jn(e);return{firstDayOfMonth:e,lastDayOfMonth:i,startingDay:n,numDays:a,numRows:r,numDaysPrevMonth:h,initialWeek:c}}function Nl(s,t,e,i){const{startingDay:n,numDays:a}=i;return s===0&&t<n?"prev-month":e>a?"next-month":"current-month"}function El(s,t,e,i){const{startingDay:n,numDaysPrevMonth:a,numDays:r}=i;return s==="prev-month"?a-(n-t-1):s==="next-month"?e-r:e}function fs(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(t=>Ee(t))}function pa(s,t){const e=Zn({start:s,end:t}),i={};if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n++){const a=e[n],r=a>s&&a<t;i[bt(a)]=r}return i}function fa(s,t,e,i){if(t.length!==1)return!0;const n=Zn({start:t[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let a=0;a<n.length;a++){for(const r of e)if(r>t[0]&&r<s)return!1;if(i.includes(ll(n[a]).toString()))return!1}return!0}function Yi(s,t){const e=bt(s);return t.includes(e)?t:[...t,e]}function Gi(s,t){const e=bt(s),i=t.indexOf(e);if(i===-1)return t;if(t.length===1)return[];const n=[...t];return n.splice(i,1),n}function Ml(s,t,e){const i=bt(s);return t.includes(i)?Gi(s,t):e>0&&t.length>=e?t:Yi(s,t)}function Al(s,t,e){const i=bt(s),n=fs(t);if(t.includes(i))return t.indexOf(i)===0?[]:Gi(s,t);if(t.length>1)return[i];if(t.length===1){if(!fa(s,n,e.excludedates,e.excludeweekdays))return[i];if(n[0]>s)return[i]}return Yi(s,t)}const Ol={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Ws,ArrowDown:Ws};function Pl(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Dl(s,t,e){let i=Wn(s,t);if(!i)return null;let n=e(`button[data-date="${bt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Wn(i,t),n=e(`button[data-date="${bt(i)}"]`),!n)return null;return i}function Il(s){return Ol[s]??null}var Ll=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,J=(s,t,e,i)=>{for(var n=i>1?void 0:i?Bl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Ll(t,e,n),n};let Y=class extends X{constructor(){super(...arguments),this.selected=[],this.multiple=Ke.props.multiple.default,this.maxMultiple=Ke.props.maxMultiple.default,this.range=Ke.props.range.default,this.earliest=Ke.props.earliest.default,this.latest=Ke.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=Ke.props.weeknumbers.default,this.withcontrols=Ke.props.withcontrols.default,this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=fs(this.selected),this.range&&this.selected.length===2&&(this.inRange=pa(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=Ee(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?zs(new Date):t}else this.currentmonth===null&&(this.currentmonth=zs(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=zs(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const e=Il(t.key);e!==null&&this.handleArrowKey(t,e)}handleArrowKey(t,e){const i=t.target;if(Pl(i))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?me(this.focusedDate):Re(this.year,this.month,1),a=Dl(n,e,this.querySelector.bind(this));if(a){const r=this.querySelector(`button[data-date="${bt(a)}"]`);r instanceof HTMLButtonElement&&!r.dataset.disabled&&(this.focusedDate=bt(a),r.focus())}}render(){return d`
|
|
205
|
+
</nav>`}};ki([o({type:String})],ds.prototype,"href",2),ki([o({type:String})],ds.prototype,"text",2),ki([o({type:String})],ds.prototype,"ariaLabel",2),ds=ki([F("pkt-backlink")],ds);const zn=6048e5,eo=864e5,qn=Symbol.for("constructDateFrom");function le(s,t){return typeof s=="function"?s(t):s&&typeof s=="object"&&qn in s?s[qn](t):s instanceof Date?new s.constructor(t):new Date(t)}function jt(s,t){return le(t||s,s)}function Wn(s,t,e){const i=jt(s,void 0);return isNaN(t)?le(s,NaN):(t&&i.setDate(i.getDate()+t),i)}let so={};function yi(){return so}function Fs(s,t){var e,i,n,a;const r=yi(),h=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??r.weekStartsOn??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.weekStartsOn)??0,c=jt(s,t==null?void 0:t.in),p=c.getDay(),m=(p<h?7:0)+p-h;return c.setDate(c.getDate()-m),c.setHours(0,0,0,0),c}function $i(s,t){return Fs(s,{...t,weekStartsOn:1})}function Rn(s,t){const e=jt(s,void 0),i=e.getFullYear(),n=le(e,0);n.setFullYear(i+1,0,4),n.setHours(0,0,0,0);const a=$i(n),r=le(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const h=$i(r);return e.getTime()>=a.getTime()?i+1:e.getTime()>=h.getTime()?i:i-1}function Kn(s){const t=jt(s),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+s-+e}function Yn(s,...t){const e=le.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Gn(s,t){const e=jt(s,void 0);return e.setHours(0,0,0,0),e}function io(s,t,e){const[i,n]=Yn(void 0,s,t),a=Gn(i),r=Gn(n),h=+a-Kn(a),c=+r-Kn(r);return Math.round((h-c)/eo)}function no(s,t){const e=Rn(s),i=le(s,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),$i(i)}function ao(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function ro(s){return!(!ao(s)&&typeof s!="number"||isNaN(+jt(s)))}function oo(s,t){const[e,i]=Yn(s,t.start,t.end);return{start:e,end:i}}function Zn(s,t){const{start:e,end:i}=oo(void 0,s);let n=+e>+i;const a=n?+e:+i,r=n?i:e;r.setHours(0,0,0,0);let h=1;const c=[];for(;+r<=a;)c.push(le(e,r)),r.setDate(r.getDate()+h),r.setHours(0,0,0,0);return n?c.reverse():c}function lo(s,t){const e=jt(s,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ho={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},co=(s,t,e)=>{let i;const n=ho[s];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Wi(s){return(t={})=>{const e=t.width?String(t.width):s.defaultWidth;return s.formats[e]||s.formats[s.defaultWidth]}}const uo={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},po={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fo={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},go={date:Wi({formats:uo,defaultWidth:"full"}),time:Wi({formats:po,defaultWidth:"full"}),dateTime:Wi({formats:fo,defaultWidth:"full"})},mo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vo=(s,t,e,i)=>mo[s];function js(s){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,h=e!=null&&e.width?String(e.width):r;n=s.formattingValues[h]||s.formattingValues[r]}else{const r=s.defaultWidth,h=e!=null&&e.width?String(e.width):s.defaultWidth;n=s.values[h]||s.values[r]}const a=s.argumentCallback?s.argumentCallback(t):t;return n[a]}}const bo={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ko={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yo={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$o={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_o={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},wo={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},xo=(s,t)=>{const e=Number(s),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},So={ordinalNumber:xo,era:js({values:bo,defaultWidth:"wide"}),quarter:js({values:ko,defaultWidth:"wide",argumentCallback:s=>s-1}),month:js({values:yo,defaultWidth:"wide"}),day:js({values:$o,defaultWidth:"wide"}),dayPeriod:js({values:_o,defaultWidth:"wide",formattingValues:wo,defaultFormattingWidth:"wide"})};function Hs(s){return(t,e={})=>{const i=e.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],a=t.match(n);if(!a)return null;const r=a[0],h=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],c=Array.isArray(h)?To(h,v=>v.test(r)):Co(h,v=>v.test(r));let p;p=s.valueCallback?s.valueCallback(c):c,p=e.valueCallback?e.valueCallback(p):p;const m=t.slice(r.length);return{value:p,rest:m}}}function Co(s,t){for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&t(s[e]))return e}function To(s,t){for(let e=0;e<s.length;e++)if(t(s[e]))return e}function No(s){return(t,e={})=>{const i=t.match(s.matchPattern);if(!i)return null;const n=i[0],a=t.match(s.parsePattern);if(!a)return null;let r=s.valueCallback?s.valueCallback(a[0]):a[0];r=e.valueCallback?e.valueCallback(r):r;const h=t.slice(n.length);return{value:r,rest:h}}}const Eo=/^(\d+)(th|st|nd|rd)?/i,Mo=/\d+/i,Ao={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Oo={any:[/^b/i,/^(a|c)/i]},Po={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Do={any:[/1/i,/2/i,/3/i,/4/i]},Io={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Lo={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Bo={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Fo={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},jo={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ho={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Vo={ordinalNumber:No({matchPattern:Eo,parsePattern:Mo,valueCallback:s=>parseInt(s,10)}),era:Hs({matchPatterns:Ao,defaultMatchWidth:"wide",parsePatterns:Oo,defaultParseWidth:"any"}),quarter:Hs({matchPatterns:Po,defaultMatchWidth:"wide",parsePatterns:Do,defaultParseWidth:"any",valueCallback:s=>s+1}),month:Hs({matchPatterns:Io,defaultMatchWidth:"wide",parsePatterns:Lo,defaultParseWidth:"any"}),day:Hs({matchPatterns:Bo,defaultMatchWidth:"wide",parsePatterns:Fo,defaultParseWidth:"any"}),dayPeriod:Hs({matchPatterns:jo,defaultMatchWidth:"any",parsePatterns:Ho,defaultParseWidth:"any"})},Uo={code:"en-US",formatDistance:co,formatLong:go,formatRelative:vo,localize:So,match:Vo,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zo(s,t){const e=jt(s,void 0);return io(e,lo(e))+1}function qo(s,t){const e=jt(s,void 0),i=+$i(e)-+no(e);return Math.round(i/zn)+1}function Xn(s,t){var e,i,n,a;const r=jt(s,t==null?void 0:t.in),h=r.getFullYear(),c=yi(),p=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??c.firstWeekContainsDate??((a=(n=c.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,m=le((t==null?void 0:t.in)||s,0);m.setFullYear(h+1,0,p),m.setHours(0,0,0,0);const v=Fs(m,t),$=le((t==null?void 0:t.in)||s,0);$.setFullYear(h,0,p),$.setHours(0,0,0,0);const b=Fs($,t);return+r>=+v?h+1:+r>=+b?h:h-1}function Wo(s,t){var e,i,n,a;const r=yi(),h=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??r.firstWeekContainsDate??((a=(n=r.locale)==null?void 0:n.options)==null?void 0:a.firstWeekContainsDate)??1,c=Xn(s,t),p=le((t==null?void 0:t.in)||s,0);return p.setFullYear(c,0,h),p.setHours(0,0,0,0),Fs(p,t)}function Jn(s,t){const e=jt(s,t==null?void 0:t.in),i=+Fs(e,t)-+Wo(e,t);return Math.round(i/zn)+1}function K(s,t){const e=s<0?"-":"",i=Math.abs(s).toString().padStart(t,"0");return e+i}const Ne={y(s,t){const e=s.getFullYear(),i=e>0?e:1-e;return K(t==="yy"?i%100:i,t.length)},M(s,t){const e=s.getMonth();return t==="M"?String(e+1):K(e+1,2)},d(s,t){return K(s.getDate(),t.length)},a(s,t){const e=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(s,t){return K(s.getHours()%12||12,t.length)},H(s,t){return K(s.getHours(),t.length)},m(s,t){return K(s.getMinutes(),t.length)},s(s,t){return K(s.getSeconds(),t.length)},S(s,t){const e=t.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return K(n,t.length)}},us={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Qn={G:function(s,t,e){const i=s.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(s,t,e){if(t==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return Ne.y(s,t)},Y:function(s,t,e,i){const n=Xn(s,i),a=n>0?n:1-n;if(t==="YY"){const r=a%100;return K(r,2)}return t==="Yo"?e.ordinalNumber(a,{unit:"year"}):K(a,t.length)},R:function(s,t){const e=Rn(s);return K(e,t.length)},u:function(s,t){const e=s.getFullYear();return K(e,t.length)},Q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return K(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,t,e){const i=Math.ceil((s.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return K(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,t,e){const i=s.getMonth();switch(t){case"M":case"MM":return Ne.M(s,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(s,t,e){const i=s.getMonth();switch(t){case"L":return String(i+1);case"LL":return K(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(s,t,e,i){const n=Jn(s,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):K(n,t.length)},I:function(s,t,e){const i=qo(s);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):K(i,t.length)},d:function(s,t,e){return t==="do"?e.ordinalNumber(s.getDate(),{unit:"date"}):Ne.d(s,t)},D:function(s,t,e){const i=zo(s);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):K(i,t.length)},E:function(s,t,e){const i=s.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return K(a,2);case"eo":return e.ordinalNumber(a,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(s,t,e,i){const n=s.getDay(),a=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return K(a,t.length);case"co":return e.ordinalNumber(a,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(s,t,e){const i=s.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return K(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(s,t,e){const i=s.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(s,t,e){const i=s.getHours();let n;switch(i===12?n=us.noon:i===0?n=us.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,t,e){const i=s.getHours();let n;switch(i>=17?n=us.evening:i>=12?n=us.afternoon:i>=4?n=us.morning:n=us.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,t,e){if(t==="ho"){let i=s.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Ne.h(s,t)},H:function(s,t,e){return t==="Ho"?e.ordinalNumber(s.getHours(),{unit:"hour"}):Ne.H(s,t)},K:function(s,t,e){const i=s.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):K(i,t.length)},k:function(s,t,e){let i=s.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):K(i,t.length)},m:function(s,t,e){return t==="mo"?e.ordinalNumber(s.getMinutes(),{unit:"minute"}):Ne.m(s,t)},s:function(s,t,e){return t==="so"?e.ordinalNumber(s.getSeconds(),{unit:"second"}):Ne.s(s,t)},S:function(s,t){return Ne.S(s,t)},X:function(s,t,e){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ea(i);case"XXXX":case"XX":return qe(i);case"XXXXX":case"XXX":default:return qe(i,":")}},x:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"x":return ea(i);case"xxxx":case"xx":return qe(i);case"xxxxx":case"xxx":default:return qe(i,":")}},O:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ta(i,":");case"OOOO":default:return"GMT"+qe(i,":")}},z:function(s,t,e){const i=s.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ta(i,":");case"zzzz":default:return"GMT"+qe(i,":")}},t:function(s,t,e){const i=Math.trunc(+s/1e3);return K(i,t.length)},T:function(s,t,e){return K(+s,t.length)}};function ta(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),a=i%60;return a===0?e+String(n):e+String(n)+t+K(a,2)}function ea(s,t){return s%60===0?(s>0?"-":"+")+K(Math.abs(s)/60,2):qe(s,t)}function qe(s,t=""){const e=s>0?"-":"+",i=Math.abs(s),n=K(Math.trunc(i/60),2),a=K(i%60,2);return e+n+t+a}const sa=(s,t)=>{switch(s){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ia=(s,t)=>{switch(s){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ro=(s,t)=>{const e=s.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return sa(s,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",sa(i,t)).replace("{{time}}",ia(n,t))},Ko={p:ia,P:Ro},Yo=/^D+$/,Go=/^Y+$/,Zo=["D","DD","YY","YYYY"];function Xo(s){return Yo.test(s)}function Jo(s){return Go.test(s)}function Qo(s,t,e){const i=tl(s,t,e);if(console.warn(i),Zo.includes(s))throw new RangeError(i)}function tl(s,t,e){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const el=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,il=/^'([^]*?)'?$/,nl=/''/g,al=/[a-zA-Z]/;function rl(s,t,e){var i,n,a,r;const h=yi(),c=h.locale??Uo,p=h.firstWeekContainsDate??((n=(i=h.locale)==null?void 0:i.options)==null?void 0:n.firstWeekContainsDate)??1,m=h.weekStartsOn??((r=(a=h.locale)==null?void 0:a.options)==null?void 0:r.weekStartsOn)??0,v=jt(s,void 0);if(!ro(v))throw new RangeError("Invalid time value");let $=t.match(sl).map(k=>{const x=k[0];if(x==="p"||x==="P"){const T=Ko[x];return T(k,c.formatLong)}return k}).join("").match(el).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const x=k[0];if(x==="'")return{isToken:!1,value:ol(k)};if(Qn[x])return{isToken:!0,value:k};if(x.match(al))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");return{isToken:!1,value:k}});c.localize.preprocessor&&($=c.localize.preprocessor(v,$));const b={firstWeekContainsDate:p,weekStartsOn:m,locale:c};return $.map(k=>{if(!k.isToken)return k.value;const x=k.value;(Jo(x)||Xo(x))&&Qo(x,t,String(s));const T=Qn[x[0]];return T(v,x,c.localize,b)}).join("")}function ol(s){const t=s.match(il);return t?t[1].replace(nl,"'"):s}function ll(s,t){const e=jt(s,void 0).getDay();return e===0?7:e}function hl(s,t,e="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:s,timeZoneName:e}).format(t).split(/\s/g).slice(2).join(" ")}const na={},Vs={};function We(s,t){try{const e=(na[s]||(na[s]=new Intl.DateTimeFormat("en-US",{timeZone:s,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return e in Vs?Vs[e]:aa(e,e.split(":"))}catch{if(s in Vs)return Vs[s];const e=s==null?void 0:s.match(cl);return e?aa(s,e.slice(1)):NaN}}const cl=/([+-]\d\d):?(\d\d)?/;function aa(s,t){const e=+(t[0]||0),i=+(t[1]||0),n=+(t[2]||0)/60;return Vs[s]=e*60+i>0?e*60+i+n:e*60-i-n}let Us=class ai extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(We(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),oa(this),Ri(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new ai(...e,t):new ai(Date.now(),t)}withTimeZone(t){return new ai(+this,t)}getTimezoneOffset(){const t=-We(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Ri(this),+this}[Symbol.for("constructDateFrom")](t){return new ai(+new Date(t),this.timeZone)}};const ra=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(s=>{if(!ra.test(s))return;const t=s.replace(ra,"$1UTC");Us.prototype[t]&&(s.startsWith("get")?Us.prototype[s]=function(){return this.internal[t]()}:(Us.prototype[s]=function(){return Date.prototype[t].apply(this.internal,arguments),dl(this),+this},Us.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Ri(this),+this}))});function Ri(s){s.internal.setTime(+s),s.internal.setUTCSeconds(s.internal.getUTCSeconds()-Math.round(-We(s.timeZone,s)*60))}function dl(s){Date.prototype.setFullYear.call(s,s.internal.getUTCFullYear(),s.internal.getUTCMonth(),s.internal.getUTCDate()),Date.prototype.setHours.call(s,s.internal.getUTCHours(),s.internal.getUTCMinutes(),s.internal.getUTCSeconds(),s.internal.getUTCMilliseconds()),oa(s)}function oa(s){const t=We(s.timeZone,s),e=t>0?Math.floor(t):Math.ceil(t),i=new Date(+s);i.setUTCHours(i.getUTCHours()-1);const n=-new Date(+s).getTimezoneOffset(),a=-new Date(+i).getTimezoneOffset(),r=n-a,h=Date.prototype.getHours.apply(s)!==s.internal.getUTCHours();r&&h&&s.internal.setUTCMinutes(s.internal.getUTCMinutes()+r);const c=n-e;c&&Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+c);const p=new Date(+s);p.setUTCSeconds(0);const m=n>0?p.getSeconds():(p.getSeconds()-60)%60,v=Math.round(-(We(s.timeZone,s)*60))%60;(v||m)&&(s.internal.setUTCSeconds(s.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(s,Date.prototype.getUTCSeconds.call(s)+v+m));const $=We(s.timeZone,s),b=$>0?Math.floor($):Math.ceil($),k=-new Date(+s).getTimezoneOffset()-b,x=b!==e,T=k-c;if(x&&T){Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+T);const S=We(s.timeZone,s),A=S>0?Math.floor(S):Math.ceil(S),I=b-A;I&&(s.internal.setUTCMinutes(s.internal.getUTCMinutes()+I),Date.prototype.setUTCMinutes.call(s,Date.prototype.getUTCMinutes.call(s)+I))}}let Ki=class ri extends Us{static tz(t,...e){return e.length?new ri(...e,t):new ri(Date.now(),t)}toISOString(){const[t,e,i]=this.tzComponents(),n=`${t}${e}:${i}`;return this.internal.toISOString().slice(0,-1)+n}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,e,i,n]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${i} ${e} ${n}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[e,i,n]=this.tzComponents();return`${t} GMT${e}${i}${n} (${hl(this.timeZone,this)})`}toLocaleString(t,e){return Date.prototype.toLocaleString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleDateString(t,e){return Date.prototype.toLocaleDateString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}toLocaleTimeString(t,e){return Date.prototype.toLocaleTimeString.call(this,t,{...e,timeZone:(e==null?void 0:e.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),e=t>0?"-":"+",i=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),n=String(Math.abs(t)%60).padStart(2,"0");return[e,i,n]}withTimeZone(t){return new ri(+this,t)}[Symbol.for("constructDateFrom")](t){return new ri(+new Date(t),this.timeZone)}};window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const ul=(s=window.pktTz)=>{const t=new Ki(new Date().toISOString(),s);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function Ee(s){if(!s||s==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(s)){const[t,e,i]=s.split("-").map(Number);return new Date(t,e-1,i)}if(/^\d{4}-\d{2}$/.test(s)){const[t,e]=s.split("-").map(Number);return new Date(t,e-1,1)}return/^\d{4}$/.test(s)?new Date(Number(s),0,1):new Date(s)}const bt=s=>{if(!s||isNaN(s.getTime()))return"";const t=s.getFullYear(),e=String(s.getMonth()+1).padStart(2,"0"),i=String(s.getDate()).padStart(2,"0");return`${t}-${e}-${i}`},Me=s=>{if(!s)return null;const t=Ee(s);return isNaN(t.getTime())?null:t},la=(s,t)=>{const e=me(s);return isNaN(e.getTime())?"":rl(e,t)},me=(s="",t)=>{const e=typeof s=="string"?Ee(s):s;return!e||isNaN(e.getTime())?new Date:e},Re=(s,t,e=1)=>{if(typeof s!="number"||typeof t!="number"||typeof e!="number"||isNaN(s)||isNaN(t)||isNaN(e))return new Date;const i=new Date(s,t,e);return isNaN(i.getTime())?new Date:i},zs=s=>{let t;return typeof s=="number"?t=new Ki(s,window.pktTz):t=new Ki(s,window.pktTz),t.setHours(12,0,0,0),t},pl=s=>!s||isNaN(s.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(s),fl=(s,t,e)=>{if(!s||isNaN(s.getTime()))return!1;const i=t?me(t):null,n=e?me(e):null;return!(i&&s<i||n&&s>n)},gl=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=bt(s);return t.includes(e)},ml=(s,t)=>{if(!s||isNaN(s.getTime())||!Array.isArray(t))return!1;const e=s.getDay().toString();return t.includes(e)},ha=(s,t,e,i,n)=>!(!s||isNaN(s.getTime())||!fl(s,t,e)||i&&gl(s,i)||n&&ml(s,n)),vl=(s,t,e,i,n)=>s.filter(a=>{const r=Me(a);return r&&ha(r,t,e,i,n)}),ca=s=>s.slice().sort((t,e)=>{const i=Me(t),n=Me(e);return!i||!n?0:i.getTime()-n.getTime()}),bl=(s,t)=>{const e=Me(s),i=Me(t);return!e||!i?!1:e<=i},qs=s=>s?Array.isArray(s)?s.filter(Boolean):String(s).split(",").map(t=>t.trim()).filter(Boolean):[],kl=s=>s.join(","),da=s=>qs(s),yl=s=>s?Ee(s):null,$l=s=>{if(typeof s=="string")return s.split(",").map(t=>Ee(t));if(Array.isArray(s))return s.map(t=>Ee(t))},ps={csvToArray:da,stringToDate:yl,stringsToDate:$l},_l={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Ke={props:_l};function ua(s,t){const e=t.excludedates.map(i=>typeof i=="string"?i:bt(i));return!ha(s,t.earliest,t.latest,e,t.excludeweekdays)}function wl(s,t,e,i){return!!(ua(s,e)||!t&&i.multiple&&i.maxMultiple>0&&i.selectedCount>=i.maxMultiple)}function xl(s,t,e){const i=Re(s,t,0);return!(e&&me(e)>i)}function Sl(s,t,e){const i=Re(t===11?s+1:s,t===11?0:t+1,1);return!(e&&me(e)<i)}const Ws=7,Cl=6;function Tl(s,t){const e=Re(s,t,1),i=Re(s,t+1,0),n=(e.getDay()+Cl)%Ws,a=i.getDate(),r=Math.ceil((a+n)/Ws),h=Re(s,t,0).getDate(),c=Jn(e);return{firstDayOfMonth:e,lastDayOfMonth:i,startingDay:n,numDays:a,numRows:r,numDaysPrevMonth:h,initialWeek:c}}function Nl(s,t,e,i){const{startingDay:n,numDays:a}=i;return s===0&&t<n?"prev-month":e>a?"next-month":"current-month"}function El(s,t,e,i){const{startingDay:n,numDaysPrevMonth:a,numDays:r}=i;return s==="prev-month"?a-(n-t-1):s==="next-month"?e-r:e}function fs(s){return typeof s=="string"&&(s=s.split(",")),s.length===1&&s[0]===""?[]:s.map(t=>Ee(t))}function pa(s,t){const e=Zn({start:s,end:t}),i={};if(Array.isArray(e)&&e.length)for(let n=0;n<e.length;n++){const a=e[n],r=a>s&&a<t;i[bt(a)]=r}return i}function fa(s,t,e,i){if(t.length!==1)return!0;const n=Zn({start:t[0],end:s});if(!Array.isArray(n)||!n.length)return!0;for(let a=0;a<n.length;a++){for(const r of e)if(r>t[0]&&r<s)return!1;if(i.includes(ll(n[a]).toString()))return!1}return!0}function Yi(s,t){const e=bt(s);return t.includes(e)?t:[...t,e]}function Gi(s,t){const e=bt(s),i=t.indexOf(e);if(i===-1)return t;if(t.length===1)return[];const n=[...t];return n.splice(i,1),n}function Ml(s,t,e){const i=bt(s);return t.includes(i)?Gi(s,t):e>0&&t.length>=e?t:Yi(s,t)}function Al(s,t,e){const i=bt(s),n=fs(t);if(t.includes(i))return t.indexOf(i)===0?[]:Gi(s,t);if(t.length>1)return[i];if(t.length===1){if(!fa(s,n,e.excludedates,e.excludeweekdays))return[i];if(n[0]>s)return[i]}return Yi(s,t)}const Ol={ArrowLeft:-1,ArrowRight:1,ArrowUp:-Ws,ArrowDown:Ws};function Pl(s){var t;const e=s.nodeName;return e==="INPUT"||e==="SELECT"||e==="BUTTON"&&!((t=s.dataset)!=null&&t.date)}function Dl(s,t,e){let i=Wn(s,t);if(!i)return null;let n=e(`button[data-date="${bt(i)}"]`);for(;n instanceof HTMLButtonElement&&n.dataset.disabled;)if(i=Wn(i,t),n=e(`button[data-date="${bt(i)}"]`),!n)return null;return i}function Il(s){return Ol[s]??null}var Ll=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,J=(s,t,e,i)=>{for(var n=i>1?void 0:i?Bl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Ll(t,e,n),n};let Y=class extends X{constructor(){super(...arguments),this.selected=[],this.multiple=Ke.props.multiple.default,this.maxMultiple=Ke.props.maxMultiple.default,this.range=Ke.props.range.default,this.earliest=Ke.props.earliest.default,this.latest=Ke.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=Ke.props.weeknumbers.default,this.withcontrols=Ke.props.withcontrols.default,this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=fs(this.selected),this.range&&this.selected.length===2&&(this.inRange=pa(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=Ee(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?zs(new Date):t}else this.currentmonth===null&&(this.currentmonth=zs(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=zs(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const e=Il(t.key);e!==null&&this.handleArrowKey(t,e)}handleArrowKey(t,e){const i=t.target;if(Pl(i))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const n=this.focusedDate?me(this.focusedDate):Re(this.year,this.month,1),a=Dl(n,e,this.querySelector.bind(this));if(a){const r=this.querySelector(`button[data-date="${bt(a)}"]`);r instanceof HTMLButtonElement&&!r.dataset.disabled&&(this.focusedDate=bt(a),r.focus())}}render(){return d`
|
|
206
206
|
<div
|
|
207
207
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
208
208
|
@focusout=${this.closeEvent}
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
* @license
|
|
409
409
|
* Copyright 2017 Google LLC
|
|
410
410
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
411
|
-
*/const ga=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Zi=He(class extends ls{constructor(s){if(super(s),s.type!==Qt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const n=[],a=[];let r=0;for(const h of s)n[r]=i?i(h,r):r,a[r]=e(h,r),r++;return{values:a,keys:n}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const n=Dr(s),{values:a,keys:r}=this.dt(t,e,i);if(!Array.isArray(n))return this.ut=r,a;const h=this.ut??(this.ut=[]),c=[];let p,m,v=0,$=n.length-1,b=0,k=a.length-1;for(;v<=$&&b<=k;)if(n[v]===null)v++;else if(n[$]===null)$--;else if(h[v]===r[b])c[b]=Ve(n[v],a[b]),v++,b++;else if(h[$]===r[k])c[k]=Ve(n[$],a[k]),$--,k--;else if(h[v]===r[k])c[k]=Ve(n[v],a[k]),Ds(s,c[k+1],n[v]),v++,k--;else if(h[$]===r[b])c[b]=Ve(n[$],a[b]),Ds(s,n[v],n[$]),$--,b++;else if(p===void 0&&(p=ga(r,b,k),m=ga(h,v,$)),p.has(h[v]))if(p.has(h[$])){const x=m.get(r[b]),T=x!==void 0?n[x]:null;if(T===null){const S=Ds(s,n[v]);Ve(S,a[b]),c[b]=S}else c[b]=Ve(T,a[b]),Ds(s,n[v],T),n[x]=null;b++}else Hi(n[$]),$--;else Hi(n[v]),v++;for(;b<=k;){const x=Ds(s,c[k+1]);Ve(x,a[b]),c[b++]=x}for(;v<=$;){const x=n[v++];x!==null&&Hi(x)}return this.ut=r,jn(s,c),Dt}}),ma=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Rl=s=>new Promise(t=>setTimeout(t,s)),Oe=()=>{const s=ma(),t=ma();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},Kl={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},jt={props:Kl};var Yl={},va;function Gl(){return va||(va=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,h=new WeakMap,c=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,$=new WeakMap,b=new WeakMap,k=new WeakMap,x=new WeakMap,T={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},S=(f,u)=>{for(let g in T){u[g]=null;let w=null;const B=T[g];Object.defineProperty(u,g,{get(){return w},set(U){w=U,f.isConnected?kt(f,B,U):m.set(f,u)}})}};function A(f){const u=n.get(f),{form:g}=u;re(f,g,u),fe(f,u.labels)}const I=(f,u=!1)=>{const g=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(U){return n.has(U)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let w=g.nextNode();const B=!u||f.disabled;for(;w;)w.formDisabledCallback&&B&&zt(w,f.disabled),w=g.nextNode()},O={attributes:!0,attributeFilter:["disabled","name"]},R=Zt()?new MutationObserver(f=>{for(const u of f){const g=u.target;if(u.attributeName==="disabled"&&(g.constructor.formAssociated?zt(g,g.hasAttribute("disabled")):g.localName==="fieldset"&&I(g)),u.attributeName==="name"&&g.constructor.formAssociated){const w=n.get(g),B=p.get(g);w.setFormValue(B)}}}):{};function et(f){f.forEach(u=>{const{addedNodes:g,removedNodes:w}=u,B=Array.from(g),U=Array.from(w);B.forEach(z=>{var qt;if(n.has(z)&&z.constructor.formAssociated&&A(z),m.has(z)){const St=m.get(z);Object.keys(T).filter(Wt=>St[Wt]!==null).forEach(Wt=>{kt(z,T[Wt],St[Wt])}),m.delete(z)}if(x.has(z)){const St=x.get(z);kt(z,"internals-valid",St.validity.valid.toString()),kt(z,"internals-invalid",(!St.validity.valid).toString()),kt(z,"aria-invalid",(!St.validity.valid).toString()),x.delete(z)}if(z.localName==="form"){const St=c.get(z),Wt=document.createTreeWalker(z,NodeFilter.SHOW_ELEMENT,{acceptNode(cn){return n.has(cn)&&cn.constructor.formAssociated&&!(St&&St.has(cn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ni=Wt.nextNode();for(;ni;)A(ni),ni=Wt.nextNode()}z.localName==="fieldset"&&((qt=R.observe)===null||qt===void 0||qt.call(R,z,O),I(z,!0))}),U.forEach(z=>{const qt=n.get(z);qt&&i.get(qt)&&Et(qt),h.has(z)&&h.get(z).disconnect()})})}function Ot(f){f.forEach(u=>{const{removedNodes:g}=u;g.forEach(w=>{const B=b.get(u.target);n.has(w)&&we(w),B.disconnect()})})}const Nt=f=>{var u,g;const w=new MutationObserver(Ot);!((u=window==null?void 0:window.ShadyDOM)===null||u===void 0)&&u.inUse&&f.mode&&f.host&&(f=f.host),(g=w.observe)===null||g===void 0||g.call(w,f,{childList:!0}),b.set(f,w)};Zt()&&new MutationObserver(et);const it={childList:!0,subtree:!0},kt=(f,u,g)=>{f.getAttribute(u)!==g&&f.setAttribute(u,g)},zt=(f,u)=>{f.toggleAttribute("internals-disabled",u),u?kt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[u])},Et=f=>{i.get(f).forEach(u=>{u.remove()}),i.set(f,[])},dt=(f,u)=>{const g=document.createElement("input");return g.type="hidden",g.name=f.getAttribute("name"),f.after(g),i.get(u).push(g),g},ae=(f,u)=>{var g;i.set(u,[]),(g=R.observe)===null||g===void 0||g.call(R,f,O)},fe=(f,u)=>{if(u.length){Array.from(u).forEach(w=>w.addEventListener("click",f.click.bind(f)));let g=u[0].id;u[0].id||(g=`${u[0].htmlFor}_Label`,u[0].id=g),kt(f,"aria-labelledby",g)}},V=f=>{const u=Array.from(f.elements).filter(U=>!U.tagName.includes("-")&&U.validity).map(U=>U.validity.valid),g=c.get(f)||[],w=Array.from(g).filter(U=>U.isConnected).map(U=>n.get(U).validity.valid),B=[...u,...w].includes(!1);f.toggleAttribute("internals-invalid",B),f.toggleAttribute("internals-valid",!B)},xt=f=>{V(Bt(f.target))},Gt=f=>{V(Bt(f.target))},$e=f=>{const u=["button[type=submit]","input[type=submit]","button:not([type])"].map(g=>`${g}:not([disabled])`).map(g=>`${g}:not([form])${f.id?`,${g}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",g=>{if(g.target.closest(u)){const w=c.get(f);if(f.noValidate)return;w.size&&Array.from(w).reverse().map(B=>n.get(B).reportValidity()).includes(!1)&&g.preventDefault()}})},ge=f=>{const u=c.get(f.target);u&&u.size&&u.forEach(g=>{g.constructor.formAssociated&&g.formResetCallback&&g.formResetCallback.apply(g)})},re=(f,u,g)=>{if(u){const w=c.get(u);if(w)w.add(f);else{const B=new Set;B.add(f),c.set(u,B),$e(u),u.addEventListener("reset",ge),u.addEventListener("input",xt),u.addEventListener("change",Gt)}r.set(u,{ref:f,internals:g}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[u])},0),V(u)}},Bt=f=>{let u=f.parentNode;return u&&u.tagName!=="FORM"&&(u=Bt(u)),u},ut=(f,u,g=DOMException)=>{if(!f.constructor.formAssociated)throw new g(u)},_e=(f,u,g)=>{const w=c.get(f);return w&&w.size&&w.forEach(B=>{n.get(B)[g]()||(u=!1)}),u},we=f=>{if(f.constructor.formAssociated){const u=n.get(f),{labels:g,form:w}=u;fe(f,g),re(f,w,u)}};function Zt(){return typeof MutationObserver<"u"}class Ss{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const Ie=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),es=(f,u,g)=>(f.valid=ss(u),Object.keys(u).forEach(w=>f[w]=u[w]),g&&V(g),f),ss=f=>{let u=!0;for(let g in f)g!=="valid"&&f[g]!==!1&&(u=!1);return u},xe=new WeakMap;function Xt(f,u){f.toggleAttribute(u,!0),f.part&&f.part.add(u)}class Se extends Set{static get isPolyfilled(){return!0}constructor(u){if(super(),!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");xe.set(this,u)}add(u){if(!/^--/.test(u)||typeof u!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${u} must start with '--'.`);const g=super.add(u),w=xe.get(this),B=`state${u}`;return w.isConnected?Xt(w,B):setTimeout(()=>{Xt(w,B)}),g}clear(){for(let[u]of this.entries())this.delete(u);super.clear()}delete(u){const g=super.delete(u),w=xe.get(this);return w.isConnected?(w.toggleAttribute(`state${u}`,!1),w.part&&w.part.remove(`state${u}`)):setTimeout(()=>{w.toggleAttribute(`state${u}`,!1),w.part&&w.part.remove(`state${u}`)}),g}}function is(f,u,g,w){if(typeof u=="function"?f!==u||!w:!u.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?w:g==="a"?w.call(f):w?w.value:u.get(f)}function Mt(f,u,g,w,B){if(typeof u=="function"?f!==u||!0:!u.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u.set(f,g),g}var yt;class Cs{constructor(u){yt.set(this,void 0),Mt(this,yt,u);for(let g=0;g<u.length;g++){let w=u[g];this[g]=w,w.hasAttribute("name")&&(this[w.getAttribute("name")]=w)}Object.freeze(this)}get length(){return is(this,yt,"f").length}[(yt=new WeakMap,Symbol.iterator)](){return is(this,yt,"f")[Symbol.iterator]()}item(u){return this[u]==null?null:this[u]}namedItem(u){return this[u]==null?null:this[u]}}function Le(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=g;const u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=w;function g(...U){let z=f.apply(this,U);return _e(this,z,"checkValidity")}function w(...U){let z=u.apply(this,U);return _e(this,z,"reportValidity")}const{get:B}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...U){const z=B.call(this,...U),qt=Array.from(c.get(this)||[]);if(qt.length===0)return z;const St=Array.from(z).concat(qt).sort((Wt,ni)=>Wt.compareDocumentPosition?Wt.compareDocumentPosition(ni)&2?1:-1:0);return new Cs(St)}})}class si{static get isPolyfilled(){return!0}constructor(u){if(!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const g=u.getRootNode(),w=new Ss;this.states=new Se(u),t.set(this,u),e.set(this,w),n.set(u,this),S(u,this),ae(u,this),Object.seal(this),g instanceof DocumentFragment&&Nt(g)}checkValidity(){const u=t.get(this);if(ut(u,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=e.get(this);if(!g.valid){const w=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});u.dispatchEvent(w)}return g.valid}get form(){const u=t.get(this);ut(u,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let g;return u.constructor.formAssociated===!0&&(g=Bt(u)),g}get labels(){const u=t.get(this);ut(u,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const g=u.getAttribute("id"),w=u.getRootNode();return w&&g?w.querySelectorAll(`[for="${g}"]`):[]}reportValidity(){const u=t.get(this);if(ut(u,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=this.checkValidity(),w=$.get(this);if(w&&!u.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!g&&w&&(u.focus(),w.focus()),g}setFormValue(u){const g=t.get(this);if(ut(g,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Et(this),u!=null&&!(u instanceof FormData)){if(g.getAttribute("name")){const w=dt(g,this);w.value=u}}else u!=null&&u instanceof FormData&&Array.from(u).reverse().forEach(([w,B])=>{if(typeof B=="string"){const U=dt(g,this);U.name=w,U.value=B}});p.set(g,u)}setValidity(u,g,w){const B=t.get(this);if(ut(B,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!u)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");$.set(this,w);const U=e.get(this),z={};for(const Wt in u)z[Wt]=u[Wt];Object.keys(z).length===0&&Ie(U);const qt=Object.assign(Object.assign({},U),z);delete qt.valid;const{valid:St}=es(U,qt,this.form);if(!St&&!g)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");a.set(this,St?"":g),B.isConnected?(B.toggleAttribute("internals-invalid",!St),B.toggleAttribute("internals-valid",St),kt(B,"aria-invalid",`${!St}`)):x.set(B,this)}get shadowRoot(){const u=t.get(this);return v.get(u)||null}get validationMessage(){const u=t.get(this);return ut(u,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const u=t.get(this);return ut(u,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const u=t.get(this);return ut(u,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(u.disabled||u.hasAttribute("disabled")||u.hasAttribute("readonly"))}}function Pi(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const u=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(u,f);const g=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(w=>w in g.internals)}let Ts=!1,ii=!1;function j(f){ii||(ii=!0,window.CustomStateSet=Se,f&&(HTMLElement.prototype.attachInternals=function(...u){const g=f.call(this,u);return g.states=new Se(this),g}))}function Pt(f=!0){if(!Ts){if(Ts=!0,typeof window<"u"&&(window.ElementInternals=si),typeof CustomElementRegistry<"u"){const u=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(g,w,B){if(w.formAssociated){const U=w.prototype.connectedCallback;w.prototype.connectedCallback=function(){k.has(this)||(k.set(this,!0),this.hasAttribute("disabled")&&zt(this,!0)),U!=null&&U.apply(this),we(this)}}u.call(this,g,w,B)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new si(this)}),typeof Element<"u"){let u=function(...w){const B=g.apply(this,w);if(v.set(this,B),Zt()){const U=new MutationObserver(et);window.ShadyDOM?U.observe(this,it):U.observe(B,it),h.set(this,U)}return B};const g=Element.prototype.attachShadow;Element.prototype.attachShadow=u}Zt()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&Le(),(f||typeof window<"u"&&!window.CustomStateSet)&&j()}}return customElements.polyfillWrapFlushCallback||(Pi()?typeof window<"u"&&!window.CustomStateSet&&j(HTMLElement.prototype.attachInternals):Pt(!1)),s.forceCustomStateSetPolyfill=j,s.forceElementInternalsPolyfill=Pt,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Yl}Gl();var Zl=Object.defineProperty,H=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&Zl(t,e,n),n};const Xl={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 L=class extends X{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=Oe(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=jt.props.helptextDropdownButton.default,this.label=null,this.optionalText=At.forms.labels.optional,this.requiredText=At.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,i,n,a,r,h,c,p,m,v,$;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},At.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},At.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},At.forms.messages.invalidPattern,t):(a=t.validity)!=null&&a.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},At.forms.messages.tooShort,t):(r=t.validity)!=null&&r.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},At.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?At.forms.messages.rangeUnderflowMin.replace("{min}",(c=this.min)==null?void 0:c.toString()):At.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},At.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?At.forms.messages.rangeOverflowMax.replace("{max}",(v=this.max)==null?void 0:v.toString()):At.forms.messages.rangeOverflow,t):($=t.validity)!=null&&$.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(n=>{const a=n;a.name===this.name&&a.value!==this.value&&a.checked&&(a.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};H([o()],L.prototype,"defaultValue"),H([o({type:Boolean,reflect:!0})],L.prototype,"disabled"),H([o({type:Boolean,reflect:!0})],L.prototype,"readonly"),H([o({type:Boolean,reflect:!0})],L.prototype,"required"),H([o({type:Number,reflect:!0})],L.prototype,"max"),H([o({type:Number,reflect:!0})],L.prototype,"maxlength"),H([o({type:Number,reflect:!0})],L.prototype,"min"),H([o({type:Number,reflect:!0})],L.prototype,"minlength"),H([o({type:Number,reflect:!0})],L.prototype,"step"),H([o({type:String})],L.prototype,"ariaDescribedBy"),H([o({type:String})],L.prototype,"ariaLabelledby"),H([o({type:String,reflect:!0})],L.prototype,"name"),H([o({type:String,reflect:!0})],L.prototype,"pattern"),H([o({type:String,reflect:!0})],L.prototype,"placeholder"),H([o({type:String,reflect:!0})],L.prototype,"id"),H([o({type:Boolean})],L.prototype,"counter"),H([o({type:Boolean})],L.prototype,"hasError"),H([o({type:Boolean})],L.prototype,"inline"),H([o({type:Boolean})],L.prototype,"hasFieldset"),H([o({type:Boolean})],L.prototype,"optionalTag"),H([o({type:Boolean})],L.prototype,"requiredTag"),H([o({type:Boolean})],L.prototype,"skipForwardTestid"),H([o({type:Boolean,reflect:!0,converter:Xl})],L.prototype,"useWrapper"),H([o({type:Boolean,reflect:!0})],L.prototype,"fullwidth"),H([o({type:Number})],L.prototype,"counterMaxLength"),H([o({type:String})],L.prototype,"errorMessage"),H([o({type:String})],L.prototype,"helptext"),H([o({type:String})],L.prototype,"helptextDropdown"),H([o({type:String,reflect:!1})],L.prototype,"helptextDropdownButton"),H([o({type:String})],L.prototype,"label"),H([o({type:String,reflect:!1})],L.prototype,"optionalText"),H([o({type:String,reflect:!1})],L.prototype,"requiredText"),H([o({type:String,reflect:!1})],L.prototype,"tagText"),H([o({type:String,attribute:"data-testid"})],L.prototype,"dataTestid"),H([D()],L.prototype,"touched");let ba=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{hs(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{hs(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&hs(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var Jl=Object.defineProperty,Ql=Object.getOwnPropertyDescriptor,Ye=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ql(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Jl(t,e,n),n};let ve=class extends X{constructor(){super(),this.defaultSlot=E(),this.forId=Oe(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=jt.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new rt(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},e=N({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?d`<div class="pkt-inputwrapper__helptext-expandable">
|
|
411
|
+
*/const ga=(s,t,e)=>{const i=new Map;for(let n=t;n<=e;n++)i.set(s[n],n);return i},Zi=He(class extends ls{constructor(s){if(super(s),s.type!==Qt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const n=[],a=[];let r=0;for(const h of s)n[r]=i?i(h,r):r,a[r]=e(h,r),r++;return{values:a,keys:n}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){const n=Dr(s),{values:a,keys:r}=this.dt(t,e,i);if(!Array.isArray(n))return this.ut=r,a;const h=this.ut??(this.ut=[]),c=[];let p,m,v=0,$=n.length-1,b=0,k=a.length-1;for(;v<=$&&b<=k;)if(n[v]===null)v++;else if(n[$]===null)$--;else if(h[v]===r[b])c[b]=Ve(n[v],a[b]),v++,b++;else if(h[$]===r[k])c[k]=Ve(n[$],a[k]),$--,k--;else if(h[v]===r[k])c[k]=Ve(n[v],a[k]),Ds(s,c[k+1],n[v]),v++,k--;else if(h[$]===r[b])c[b]=Ve(n[$],a[b]),Ds(s,n[v],n[$]),$--,b++;else if(p===void 0&&(p=ga(r,b,k),m=ga(h,v,$)),p.has(h[v]))if(p.has(h[$])){const x=m.get(r[b]),T=x!==void 0?n[x]:null;if(T===null){const S=Ds(s,n[v]);Ve(S,a[b]),c[b]=S}else c[b]=Ve(T,a[b]),Ds(s,n[v],T),n[x]=null;b++}else Hi(n[$]),$--;else Hi(n[v]),v++;for(;b<=k;){const x=Ds(s,c[k+1]);Ve(x,a[b]),c[b++]=x}for(;v<=$;){const x=n[v++];x!==null&&Hi(x)}return this.ut=r,jn(s,c),Dt}}),ma=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),Rl=s=>new Promise(t=>setTimeout(t,s)),Oe=()=>{const s=ma(),t=ma();return s.slice(0,8)+"-"+s.slice(8,12)+"-4"+s.slice(13)+"-a"+t.slice(1,4)+"-"+t.slice(4)},It={fromAttribute(s){return s==null?!1:s===""||s==="true"||s===!0?!0:s==="false"||s===!1?!1:!!s},toAttribute(s){return s?"true":"false"}},Kl={helptextDropdownButton:{default:"Les mer <span class='pkt-sr-only'>om feltet</span>"},counter:{default:!1},optionalTag:{default:!1},optionalText:{default:"Valgfritt"},requiredTag:{default:!1},requiredText:{default:"Må fylles ut"},hasError:{default:!1},disabled:{default:!1},inline:{default:!1},hasFieldset:{default:!1},useWrapper:{default:!0}},Ht={props:Kl};var Yl={},va;function Gl(){return va||(va=1,(function(){(function(s){const t=new WeakMap,e=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,h=new WeakMap,c=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,$=new WeakMap,b=new WeakMap,k=new WeakMap,x=new WeakMap,T={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},S=(f,u)=>{for(let g in T){u[g]=null;let w=null;const B=T[g];Object.defineProperty(u,g,{get(){return w},set(U){w=U,f.isConnected?kt(f,B,U):m.set(f,u)}})}};function A(f){const u=n.get(f),{form:g}=u;re(f,g,u),fe(f,u.labels)}const I=(f,u=!1)=>{const g=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT,{acceptNode(U){return n.has(U)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let w=g.nextNode();const B=!u||f.disabled;for(;w;)w.formDisabledCallback&&B&&qt(w,f.disabled),w=g.nextNode()},O={attributes:!0,attributeFilter:["disabled","name"]},R=Zt()?new MutationObserver(f=>{for(const u of f){const g=u.target;if(u.attributeName==="disabled"&&(g.constructor.formAssociated?qt(g,g.hasAttribute("disabled")):g.localName==="fieldset"&&I(g)),u.attributeName==="name"&&g.constructor.formAssociated){const w=n.get(g),B=p.get(g);w.setFormValue(B)}}}):{};function et(f){f.forEach(u=>{const{addedNodes:g,removedNodes:w}=u,B=Array.from(g),U=Array.from(w);B.forEach(z=>{var Wt;if(n.has(z)&&z.constructor.formAssociated&&A(z),m.has(z)){const St=m.get(z);Object.keys(T).filter(Rt=>St[Rt]!==null).forEach(Rt=>{kt(z,T[Rt],St[Rt])}),m.delete(z)}if(x.has(z)){const St=x.get(z);kt(z,"internals-valid",St.validity.valid.toString()),kt(z,"internals-invalid",(!St.validity.valid).toString()),kt(z,"aria-invalid",(!St.validity.valid).toString()),x.delete(z)}if(z.localName==="form"){const St=c.get(z),Rt=document.createTreeWalker(z,NodeFilter.SHOW_ELEMENT,{acceptNode(cn){return n.has(cn)&&cn.constructor.formAssociated&&!(St&&St.has(cn))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let ni=Rt.nextNode();for(;ni;)A(ni),ni=Rt.nextNode()}z.localName==="fieldset"&&((Wt=R.observe)===null||Wt===void 0||Wt.call(R,z,O),I(z,!0))}),U.forEach(z=>{const Wt=n.get(z);Wt&&i.get(Wt)&&Et(Wt),h.has(z)&&h.get(z).disconnect()})})}function Ot(f){f.forEach(u=>{const{removedNodes:g}=u;g.forEach(w=>{const B=b.get(u.target);n.has(w)&&we(w),B.disconnect()})})}const Nt=f=>{var u,g;const w=new MutationObserver(Ot);!((u=window==null?void 0:window.ShadyDOM)===null||u===void 0)&&u.inUse&&f.mode&&f.host&&(f=f.host),(g=w.observe)===null||g===void 0||g.call(w,f,{childList:!0}),b.set(f,w)};Zt()&&new MutationObserver(et);const it={childList:!0,subtree:!0},kt=(f,u,g)=>{f.getAttribute(u)!==g&&f.setAttribute(u,g)},qt=(f,u)=>{f.toggleAttribute("internals-disabled",u),u?kt(f,"aria-disabled","true"):f.removeAttribute("aria-disabled"),f.formDisabledCallback&&f.formDisabledCallback.apply(f,[u])},Et=f=>{i.get(f).forEach(u=>{u.remove()}),i.set(f,[])},dt=(f,u)=>{const g=document.createElement("input");return g.type="hidden",g.name=f.getAttribute("name"),f.after(g),i.get(u).push(g),g},ae=(f,u)=>{var g;i.set(u,[]),(g=R.observe)===null||g===void 0||g.call(R,f,O)},fe=(f,u)=>{if(u.length){Array.from(u).forEach(w=>w.addEventListener("click",f.click.bind(f)));let g=u[0].id;u[0].id||(g=`${u[0].htmlFor}_Label`,u[0].id=g),kt(f,"aria-labelledby",g)}},V=f=>{const u=Array.from(f.elements).filter(U=>!U.tagName.includes("-")&&U.validity).map(U=>U.validity.valid),g=c.get(f)||[],w=Array.from(g).filter(U=>U.isConnected).map(U=>n.get(U).validity.valid),B=[...u,...w].includes(!1);f.toggleAttribute("internals-invalid",B),f.toggleAttribute("internals-valid",!B)},xt=f=>{V(Ft(f.target))},Gt=f=>{V(Ft(f.target))},$e=f=>{const u=["button[type=submit]","input[type=submit]","button:not([type])"].map(g=>`${g}:not([disabled])`).map(g=>`${g}:not([form])${f.id?`,${g}[form='${f.id}']`:""}`).join(",");f.addEventListener("click",g=>{if(g.target.closest(u)){const w=c.get(f);if(f.noValidate)return;w.size&&Array.from(w).reverse().map(B=>n.get(B).reportValidity()).includes(!1)&&g.preventDefault()}})},ge=f=>{const u=c.get(f.target);u&&u.size&&u.forEach(g=>{g.constructor.formAssociated&&g.formResetCallback&&g.formResetCallback.apply(g)})},re=(f,u,g)=>{if(u){const w=c.get(u);if(w)w.add(f);else{const B=new Set;B.add(f),c.set(u,B),$e(u),u.addEventListener("reset",ge),u.addEventListener("input",xt),u.addEventListener("change",Gt)}r.set(u,{ref:f,internals:g}),f.constructor.formAssociated&&f.formAssociatedCallback&&setTimeout(()=>{f.formAssociatedCallback.apply(f,[u])},0),V(u)}},Ft=f=>{let u=f.parentNode;return u&&u.tagName!=="FORM"&&(u=Ft(u)),u},ut=(f,u,g=DOMException)=>{if(!f.constructor.formAssociated)throw new g(u)},_e=(f,u,g)=>{const w=c.get(f);return w&&w.size&&w.forEach(B=>{n.get(B)[g]()||(u=!1)}),u},we=f=>{if(f.constructor.formAssociated){const u=n.get(f),{labels:g,form:w}=u;fe(f,g),re(f,w,u)}};function Zt(){return typeof MutationObserver<"u"}class Ss{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const Ie=f=>(f.badInput=!1,f.customError=!1,f.patternMismatch=!1,f.rangeOverflow=!1,f.rangeUnderflow=!1,f.stepMismatch=!1,f.tooLong=!1,f.tooShort=!1,f.typeMismatch=!1,f.valid=!0,f.valueMissing=!1,f),es=(f,u,g)=>(f.valid=ss(u),Object.keys(u).forEach(w=>f[w]=u[w]),g&&V(g),f),ss=f=>{let u=!0;for(let g in f)g!=="valid"&&f[g]!==!1&&(u=!1);return u},xe=new WeakMap;function Xt(f,u){f.toggleAttribute(u,!0),f.part&&f.part.add(u)}class Se extends Set{static get isPolyfilled(){return!0}constructor(u){if(super(),!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");xe.set(this,u)}add(u){if(!/^--/.test(u)||typeof u!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${u} must start with '--'.`);const g=super.add(u),w=xe.get(this),B=`state${u}`;return w.isConnected?Xt(w,B):setTimeout(()=>{Xt(w,B)}),g}clear(){for(let[u]of this.entries())this.delete(u);super.clear()}delete(u){const g=super.delete(u),w=xe.get(this);return w.isConnected?(w.toggleAttribute(`state${u}`,!1),w.part&&w.part.remove(`state${u}`)):setTimeout(()=>{w.toggleAttribute(`state${u}`,!1),w.part&&w.part.remove(`state${u}`)}),g}}function is(f,u,g,w){if(typeof u=="function"?f!==u||!w:!u.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?w:g==="a"?w.call(f):w?w.value:u.get(f)}function Mt(f,u,g,w,B){if(typeof u=="function"?f!==u||!0:!u.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u.set(f,g),g}var yt;class Cs{constructor(u){yt.set(this,void 0),Mt(this,yt,u);for(let g=0;g<u.length;g++){let w=u[g];this[g]=w,w.hasAttribute("name")&&(this[w.getAttribute("name")]=w)}Object.freeze(this)}get length(){return is(this,yt,"f").length}[(yt=new WeakMap,Symbol.iterator)](){return is(this,yt,"f")[Symbol.iterator]()}item(u){return this[u]==null?null:this[u]}namedItem(u){return this[u]==null?null:this[u]}}function Le(){const f=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=g;const u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=w;function g(...U){let z=f.apply(this,U);return _e(this,z,"checkValidity")}function w(...U){let z=u.apply(this,U);return _e(this,z,"reportValidity")}const{get:B}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...U){const z=B.call(this,...U),Wt=Array.from(c.get(this)||[]);if(Wt.length===0)return z;const St=Array.from(z).concat(Wt).sort((Rt,ni)=>Rt.compareDocumentPosition?Rt.compareDocumentPosition(ni)&2?1:-1:0);return new Cs(St)}})}class si{static get isPolyfilled(){return!0}constructor(u){if(!u||!u.tagName||u.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const g=u.getRootNode(),w=new Ss;this.states=new Se(u),t.set(this,u),e.set(this,w),n.set(u,this),S(u,this),ae(u,this),Object.seal(this),g instanceof DocumentFragment&&Nt(g)}checkValidity(){const u=t.get(this);if(ut(u,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=e.get(this);if(!g.valid){const w=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});u.dispatchEvent(w)}return g.valid}get form(){const u=t.get(this);ut(u,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let g;return u.constructor.formAssociated===!0&&(g=Ft(u)),g}get labels(){const u=t.get(this);ut(u,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const g=u.getAttribute("id"),w=u.getRootNode();return w&&g?w.querySelectorAll(`[for="${g}"]`):[]}reportValidity(){const u=t.get(this);if(ut(u,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const g=this.checkValidity(),w=$.get(this);if(w&&!u.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!g&&w&&(u.focus(),w.focus()),g}setFormValue(u){const g=t.get(this);if(ut(g,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Et(this),u!=null&&!(u instanceof FormData)){if(g.getAttribute("name")){const w=dt(g,this);w.value=u}}else u!=null&&u instanceof FormData&&Array.from(u).reverse().forEach(([w,B])=>{if(typeof B=="string"){const U=dt(g,this);U.name=w,U.value=B}});p.set(g,u)}setValidity(u,g,w){const B=t.get(this);if(ut(B,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!u)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");$.set(this,w);const U=e.get(this),z={};for(const Rt in u)z[Rt]=u[Rt];Object.keys(z).length===0&&Ie(U);const Wt=Object.assign(Object.assign({},U),z);delete Wt.valid;const{valid:St}=es(U,Wt,this.form);if(!St&&!g)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");a.set(this,St?"":g),B.isConnected?(B.toggleAttribute("internals-invalid",!St),B.toggleAttribute("internals-valid",St),kt(B,"aria-invalid",`${!St}`)):x.set(B,this)}get shadowRoot(){const u=t.get(this);return v.get(u)||null}get validationMessage(){const u=t.get(this);return ut(u,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get validity(){const u=t.get(this);return ut(u,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),e.get(this)}get willValidate(){const u=t.get(this);return ut(u,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(u.disabled||u.hasAttribute("disabled")||u.hasAttribute("readonly"))}}function Pi(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class f extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const u=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(u,f);const g=new f;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(w=>w in g.internals)}let Ts=!1,ii=!1;function j(f){ii||(ii=!0,window.CustomStateSet=Se,f&&(HTMLElement.prototype.attachInternals=function(...u){const g=f.call(this,u);return g.states=new Se(this),g}))}function Pt(f=!0){if(!Ts){if(Ts=!0,typeof window<"u"&&(window.ElementInternals=si),typeof CustomElementRegistry<"u"){const u=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(g,w,B){if(w.formAssociated){const U=w.prototype.connectedCallback;w.prototype.connectedCallback=function(){k.has(this)||(k.set(this,!0),this.hasAttribute("disabled")&&qt(this,!0)),U!=null&&U.apply(this),we(this)}}u.call(this,g,w,B)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new si(this)}),typeof Element<"u"){let u=function(...w){const B=g.apply(this,w);if(v.set(this,B),Zt()){const U=new MutationObserver(et);window.ShadyDOM?U.observe(this,it):U.observe(B,it),h.set(this,U)}return B};const g=Element.prototype.attachShadow;Element.prototype.attachShadow=u}Zt()&&typeof document<"u"&&new MutationObserver(et).observe(document.documentElement,it),typeof HTMLFormElement<"u"&&Le(),(f||typeof window<"u"&&!window.CustomStateSet)&&j()}}return customElements.polyfillWrapFlushCallback||(Pi()?typeof window<"u"&&!window.CustomStateSet&&j(HTMLElement.prototype.attachInternals):Pt(!1)),s.forceCustomStateSetPolyfill=j,s.forceElementInternalsPolyfill=Pt,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})()),Yl}Gl();var Zl=Object.defineProperty,H=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&Zl(t,e,n),n};let L=class extends X{constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=Oe(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage="",this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Ht.props.helptextDropdownButton.default,this.label=null,this.optionalText=At.forms.labels.optional,this.requiredText=At.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var e,i,n,a,r,h,c,p,m,v,$;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},At.forms.messages.required,t):(e=t.validity)!=null&&e.typeMismatch||(i=t.validity)!=null&&i.badInput?this.internals.setValidity({typeMismatch:!0},At.forms.messages.invalid,t):(n=t.validity)!=null&&n.patternMismatch?this.internals.setValidity({patternMismatch:!0},At.forms.messages.invalidPattern,t):(a=t.validity)!=null&&a.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},At.forms.messages.tooShort,t):(r=t.validity)!=null&&r.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},At.forms.messages.tooLong,t):(h=t.validity)!=null&&h.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?At.forms.messages.rangeUnderflowMin.replace("{min}",(c=this.min)==null?void 0:c.toString()):At.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.stepMismatch?this.internals.setValidity({stepMismatch:!0},At.forms.messages.invalid,t):(m=t.validity)!=null&&m.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?At.forms.messages.rangeOverflowMax.replace("{max}",(v=this.max)==null?void 0:v.toString()):At.forms.messages.rangeOverflow,t):($=t.validity)!=null&&$.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(i=>{e.append(this.name,i)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const e=this.internals.form||this.closest("form"),i=e?new FormData(e):null;e&&e.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(n=>{const a=n;a.name===this.name&&a.value!==this.value&&a.checked&&(a.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),i&&i.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),i&&i.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,e){(e!==this.value||e!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{"selected"in t&&(t.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(t){super.updated(t),t.has("dataTestid")&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute("data-testid")||this.setAttribute("data-testid",this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute("data-testid")))}firstUpdated(t){if(super.firstUpdated(t),!this.form){const e=this.internals.form||this.closest("form");this.form=e}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const e=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=e,this.internals.setFormValue(e?this.value||"on":"",e?this.value||"on":"")}else this.internals.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute("form",""),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute("form",""),this.manageValidity(this.inputRefTo.value))}};H([o()],L.prototype,"defaultValue"),H([o({type:Boolean,reflect:!0})],L.prototype,"disabled"),H([o({type:Boolean,reflect:!0})],L.prototype,"readonly"),H([o({type:Boolean,reflect:!0})],L.prototype,"required"),H([o({type:Number,reflect:!0})],L.prototype,"max"),H([o({type:Number,reflect:!0})],L.prototype,"maxlength"),H([o({type:Number,reflect:!0})],L.prototype,"min"),H([o({type:Number,reflect:!0})],L.prototype,"minlength"),H([o({type:Number,reflect:!0})],L.prototype,"step"),H([o({type:String})],L.prototype,"ariaDescribedBy"),H([o({type:String})],L.prototype,"ariaLabelledby"),H([o({type:String,reflect:!0})],L.prototype,"name"),H([o({type:String,reflect:!0})],L.prototype,"pattern"),H([o({type:String,reflect:!0})],L.prototype,"placeholder"),H([o({type:String,reflect:!0})],L.prototype,"id"),H([o({type:Boolean})],L.prototype,"counter"),H([o({type:Boolean})],L.prototype,"hasError"),H([o({type:Boolean})],L.prototype,"inline"),H([o({type:Boolean})],L.prototype,"hasFieldset"),H([o({type:Boolean})],L.prototype,"optionalTag"),H([o({type:Boolean})],L.prototype,"requiredTag"),H([o({type:Boolean})],L.prototype,"skipForwardTestid"),H([o({type:Boolean,reflect:!0,converter:It})],L.prototype,"useWrapper"),H([o({type:Boolean,reflect:!0})],L.prototype,"fullwidth"),H([o({type:Number})],L.prototype,"counterMaxLength"),H([o({type:String})],L.prototype,"errorMessage"),H([o({type:String})],L.prototype,"helptext"),H([o({type:String})],L.prototype,"helptextDropdown"),H([o({type:String,reflect:!1})],L.prototype,"helptextDropdownButton"),H([o({type:String})],L.prototype,"label"),H([o({type:String,reflect:!1})],L.prototype,"optionalText"),H([o({type:String,reflect:!1})],L.prototype,"requiredText"),H([o({type:String,reflect:!1})],L.prototype,"tagText"),H([o({type:String,attribute:"data-testid"})],L.prototype,"dataTestid"),H([D()],L.prototype,"touched");let ba=class{constructor(t){this.nodes=[],this.options=[],this.host=t,this.host.addController(this),this.nodes=[],this.options=[],this.observer=new MutationObserver(e=>this.handleMutations(e))}hostConnected(){Array.from(this.host.childNodes).forEach(t=>{(t.nodeName==="OPTION"||t.nodeName==="DATA")&&this.addNode(t)}),this.observer.observe(this.host,{childList:!0,subtree:!1,attributes:!0})}hostDisconnected(){this.observer.disconnect()}addNode(t){(t.nodeName==="OPTION"||t.nodeName==="DATA")&&(t.hasAttribute("hidden")&&!t.hasAttribute("data-skip")&&t.setAttribute("data-hidden","true"),!t.hasAttribute("hidden")&&t.hasAttribute("data-skip")&&t.hasAttribute("data-hidden")&&t.removeAttribute("data-hidden"),t.setAttribute("class","pkt-hide"),t.setAttribute("data-skip","true"),t.setAttribute("hidden","true"),this.nodes.push(t))}createOptions(){this.options=this.nodes.map(t=>({value:t.hasAttribute("value")?t.getAttribute("value")??"":t.textContent??"",label:t.textContent||t.getAttribute("value")||"",selected:t.hasAttribute("selected"),disabled:t.hasAttribute("disabled"),hidden:t.hasAttribute("data-hidden")})),this.host.setAttribute("options",JSON.stringify(this.options))}handleMutations(t){let e=!1;t.forEach(i=>{i.type==="childList"&&(i.addedNodes.forEach(n=>{hs(n)&&(this.addNode(n),e=!0)}),i.removedNodes.forEach(n=>{hs(n)&&(this.nodes=this.nodes.filter(a=>a!==n),e=!0)})),i.type==="attributes"&&hs(i.target)&&(this.addNode(i.target),e=!0)}),e&&this.createOptions()}};var Xl=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,Ye=(s,t,e,i)=>{for(var n=i>1?void 0:i?Jl(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Xl(t,e,n),n};let ve=class extends X{constructor(){super(),this.defaultSlot=E(),this.forId=Oe(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=Ht.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new rt(this,this.defaultSlot)}updateSlots(t){this.filledSlots=new Set(t)}render(){const t=()=>{const n=!this.isHelpTextOpen;this.isHelpTextOpen=n,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:n}}))},e=N({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),i=()=>this.helptextDropdown?d`<div class="pkt-inputwrapper__helptext-expandable">
|
|
412
412
|
<button
|
|
413
413
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
414
414
|
type="button"
|
|
@@ -431,7 +431,7 @@
|
|
|
431
431
|
${this.helptext&&mi(this.helptext)}
|
|
432
432
|
</div>
|
|
433
433
|
${i()}
|
|
434
|
-
</div>`}`}};Ye([o({type:String,reflect:!0})],ve.prototype,"forId",2),Ye([o({type:String})],ve.prototype,"helptext",2),Ye([o({type:String})],ve.prototype,"helptextDropdown",2),Ye([o({type:String})],ve.prototype,"helptextDropdownButton",2),Ye([D()],ve.prototype,"isHelpTextOpen",2),Ye([D()],ve.prototype,"filledSlots",2),ve=Ye([F("pkt-helptext")],ve);var
|
|
434
|
+
</div>`}`}};Ye([o({type:String,reflect:!0})],ve.prototype,"forId",2),Ye([o({type:String})],ve.prototype,"helptext",2),Ye([o({type:String})],ve.prototype,"helptextDropdown",2),Ye([o({type:String})],ve.prototype,"helptextDropdownButton",2),Ye([D()],ve.prototype,"isHelpTextOpen",2),Ye([D()],ve.prototype,"filledSlots",2),ve=Ye([F("pkt-helptext")],ve);var Ql=Object.defineProperty,th=Object.getOwnPropertyDescriptor,st=(s,t,e,i)=>{for(var n=i>1?void 0:i?th(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Ql(t,e,n),n};let tt=class extends X{constructor(){super(),this.defaultSlot=E(),this.helptextSlot=E(),this.forId=Oe(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=Ht.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=Ht.props.optionalTag.default,this.optionalText=Ht.props.optionalText.default,this.requiredTag=Ht.props.requiredTag.default,this.requiredText=Ht.props.requiredText.default,this.tagText=null,this.hasError=Ht.props.hasError.default,this.errorMessage="",this.disabled=Ht.props.disabled.default,this.inline=Ht.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=Ht.props.hasFieldset.default,this.role="group",this.useWrapper=Ht.props.useWrapper.default,this.slotController=new rt(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`:y,n=()=>d`
|
|
435
435
|
${this.tagText?d`<span class=${e+" pkt-tag--gray"}>${this.tagText}</span>`:y}
|
|
436
436
|
${this.optionalTag?d`<span class=${e+" pkt-tag--blue-light"}>${this.optionalText}</span>`:y}
|
|
437
437
|
${this.requiredTag?d`<span class=${e+" pkt-tag--beige"}>${this.requiredText}</span>`:y}
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
.forId=${this.forId}
|
|
462
462
|
.helptext=${this.helptext}
|
|
463
463
|
.helptextDropdown=${this.helptextDropdown}
|
|
464
|
-
.helptextDropdownButton=${this.helptextDropdownButton||
|
|
464
|
+
.helptextDropdownButton=${this.helptextDropdownButton||Ht.props.helptextDropdownButton.default}
|
|
465
465
|
@toggleHelpText=${v=>{this.toggleDropdown(v)}}
|
|
466
466
|
${M(this.helptextSlot)}
|
|
467
467
|
name="helptext"
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
${c()}
|
|
487
487
|
`,m=()=>this.hasFieldset?d`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${i}">
|
|
488
488
|
${p()}
|
|
489
|
-
</fieldset>`:d`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return d`<div class=${N(t)}>${m()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};st([o({type:String})],tt.prototype,"forId",2),st([o({type:String})],tt.prototype,"label",2),st([o({type:String})],tt.prototype,"helptext",2),st([o({type:String})],tt.prototype,"helptextDropdown",2),st([o({type:String})],tt.prototype,"helptextDropdownButton",2),st([o({type:Boolean})],tt.prototype,"counter",2),st([o({type:Number})],tt.prototype,"counterCurrent",2),st([o({type:Number})],tt.prototype,"counterMaxLength",2),st([o({type:String})],tt.prototype,"counterError",2),st([o({type:String,reflect:!1})],tt.prototype,"counterPosition",2),st([o({type:Boolean})],tt.prototype,"optionalTag",2),st([o({type:String})],tt.prototype,"optionalText",2),st([o({type:Boolean})],tt.prototype,"requiredTag",2),st([o({type:String})],tt.prototype,"requiredText",2),st([o({type:String})],tt.prototype,"tagText",2),st([o({type:Boolean})],tt.prototype,"hasError",2),st([o({type:String})],tt.prototype,"errorMessage",2),st([o({type:Boolean})],tt.prototype,"disabled",2),st([o({type:Boolean})],tt.prototype,"inline",2),st([o({type:String})],tt.prototype,"ariaDescribedby",2),st([o({type:Boolean})],tt.prototype,"hasFieldset",2),st([o({type:String,reflect:!0})],tt.prototype,"role",2),st([o({type:Boolean,reflect:!0,converter:
|
|
489
|
+
</fieldset>`:d`<div class="pkt-inputwrapper__fieldset">${p()}</div>`;return d`<div class=${N(t)}>${m()}</div> `}toggleDropdown(t){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:t.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};st([o({type:String})],tt.prototype,"forId",2),st([o({type:String})],tt.prototype,"label",2),st([o({type:String})],tt.prototype,"helptext",2),st([o({type:String})],tt.prototype,"helptextDropdown",2),st([o({type:String})],tt.prototype,"helptextDropdownButton",2),st([o({type:Boolean})],tt.prototype,"counter",2),st([o({type:Number})],tt.prototype,"counterCurrent",2),st([o({type:Number})],tt.prototype,"counterMaxLength",2),st([o({type:String})],tt.prototype,"counterError",2),st([o({type:String,reflect:!1})],tt.prototype,"counterPosition",2),st([o({type:Boolean})],tt.prototype,"optionalTag",2),st([o({type:String})],tt.prototype,"optionalText",2),st([o({type:Boolean})],tt.prototype,"requiredTag",2),st([o({type:String})],tt.prototype,"requiredText",2),st([o({type:String})],tt.prototype,"tagText",2),st([o({type:Boolean})],tt.prototype,"hasError",2),st([o({type:String})],tt.prototype,"errorMessage",2),st([o({type:Boolean})],tt.prototype,"disabled",2),st([o({type:Boolean})],tt.prototype,"inline",2),st([o({type:String})],tt.prototype,"ariaDescribedby",2),st([o({type:Boolean})],tt.prototype,"hasFieldset",2),st([o({type:String,reflect:!0})],tt.prototype,"role",2),st([o({type:Boolean,reflect:!0,converter:It})],tt.prototype,"useWrapper",2),tt=st([F("pkt-input-wrapper")],tt);var eh=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,Ct=(s,t,e,i)=>{for(var n=i>1?void 0:i?sh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&eh(t,e,n),n};let _t=class extends X{constructor(){super(...arguments),this.id=Oe(),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 d`
|
|
490
490
|
<div
|
|
491
491
|
class=${N({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
492
492
|
role="listbox"
|
|
@@ -580,7 +580,7 @@
|
|
|
580
580
|
role="searchbox"
|
|
581
581
|
/>
|
|
582
582
|
</div>
|
|
583
|
-
`:y}handleSearchInput(t){this.searchValue=t.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(t){switch(t.key){case"Enter":t.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),t.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(t){const e=t.currentTarget,i=e.dataset.value,n=e.dataset.type,a=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&n!=="new-option"&&n!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":i&&(a?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():n==="searchbox"||n==="new-option"?this.focusFirstOption():this.focusNextOption(e),t.preventDefault();break;case"ArrowUp":if(t.altKey)this.focusFirstOption();else if(e.dataset.index==="0"&&this.includeSearch){const r=this.querySelector('[role="searchbox"]');r&&r.focus()}else if(e.dataset.index==="0"&&this.customUserInput){const r=this.querySelector('[data-type="new-option"]');r&&r.focus()}else this.focusPreviousOption(e);t.preventDefault();break;case"Home":this.focusFirstOption(),t.preventDefault();break;case"End":this.focusLastOption(),t.preventDefault();break;default:(t.metaKey||t.ctrlKey)&&t.key==="a"&&(this.selectAll(),t.preventDefault()),this.isLetterOrSpace(t.key)&&(this.handleTypeAhead(t.key),t.preventDefault());break}}focusAndScrollIntoView(t){t.scrollIntoView({block:"nearest"}),window.setTimeout(()=>t.focus(),0)}focusNextOption(t){const e=t.nextElementSibling;e&&this.focusAndScrollIntoView(e)}focusPreviousOption(t){const e=t.previousElementSibling;if(t.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else e&&this.focusAndScrollIntoView(e)}focusFirstOption(){const t=this.getOptionElements()[0];t&&this.focusAndScrollIntoView(t)}focusLastOption(){const t=this.getOptionElements().pop();t&&this.focusAndScrollIntoView(t)}focusFirstOrSelectedOption(){if(this.disabled)return;const t=this.getOptionElements().find(e=>e.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const e=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(e)}else if(t)this.focusAndScrollIntoView(t);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const e=this.querySelector('[role="searchbox"]');window.setTimeout(()=>e.focus(),0)}else this.focusFirstOption()}toggleOption(t){const e=t instanceof HTMLElement?t.dataset.disabled:t.disabled;if(this.disabled||e)return;const i=t instanceof HTMLElement?t.dataset.value:t.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(t=>{var e;return(t.fulltext||t.label+t.value+(t.prefix||"")).toLowerCase().includes(((e=this.searchValue)==null?void 0:e.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(t){return/^[\p{L} ]$/u.test(t)}handleTypeAhead(t){this.typeAheadString+=t.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const e=this.getOptionElements().find(i=>{var n;return(n=i.textContent)==null?void 0:n.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};Ct([o({type:String})],_t.prototype,"id",2),Ct([o({type:String})],_t.prototype,"label",2),Ct([o({type:Array})],_t.prototype,"options",2),Ct([o({type:Boolean,reflect:!0})],_t.prototype,"isOpen",2),Ct([o({type:Boolean})],_t.prototype,"disabled",2),Ct([o({type:Boolean})],_t.prototype,"includeSearch",2),Ct([o({type:Boolean})],_t.prototype,"isMultiSelect",2),Ct([o({type:Boolean})],_t.prototype,"allowUserInput",2),Ct([o({type:Boolean})],_t.prototype,"maxIsReached",2),Ct([o({type:String})],_t.prototype,"customUserInput",2),Ct([o({type:String})],_t.prototype,"searchPlaceholder",2),Ct([o({type:String})],_t.prototype,"searchValue",2),Ct([o({type:Number})],_t.prototype,"maxLength",2),Ct([o({type:String})],_t.prototype,"userMessage",2),Ct([D()],_t.prototype,"_filteredOptions",2),_t=Ct([F("pkt-listbox")],_t);const
|
|
583
|
+
`:y}handleSearchInput(t){this.searchValue=t.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(t){switch(t.key){case"Enter":t.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),t.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(t){const e=t.currentTarget,i=e.dataset.value,n=e.dataset.type,a=e.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&n!=="new-option"&&n!=="searchbox"))switch(t.key){case" ":case"Enter":this.toggleOption(e),t.preventDefault();break;case"Backspace":i&&(a?this.toggleOption(e):this.closeOptions()),t.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":t.altKey?this.focusLastOption():n==="searchbox"||n==="new-option"?this.focusFirstOption():this.focusNextOption(e),t.preventDefault();break;case"ArrowUp":if(t.altKey)this.focusFirstOption();else if(e.dataset.index==="0"&&this.includeSearch){const r=this.querySelector('[role="searchbox"]');r&&r.focus()}else if(e.dataset.index==="0"&&this.customUserInput){const r=this.querySelector('[data-type="new-option"]');r&&r.focus()}else this.focusPreviousOption(e);t.preventDefault();break;case"Home":this.focusFirstOption(),t.preventDefault();break;case"End":this.focusLastOption(),t.preventDefault();break;default:(t.metaKey||t.ctrlKey)&&t.key==="a"&&(this.selectAll(),t.preventDefault()),this.isLetterOrSpace(t.key)&&(this.handleTypeAhead(t.key),t.preventDefault());break}}focusAndScrollIntoView(t){t.scrollIntoView({block:"nearest"}),window.setTimeout(()=>t.focus(),0)}focusNextOption(t){const e=t.nextElementSibling;e&&this.focusAndScrollIntoView(e)}focusPreviousOption(t){const e=t.previousElementSibling;if(t.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else e&&this.focusAndScrollIntoView(e)}focusFirstOption(){const t=this.getOptionElements()[0];t&&this.focusAndScrollIntoView(t)}focusLastOption(){const t=this.getOptionElements().pop();t&&this.focusAndScrollIntoView(t)}focusFirstOrSelectedOption(){if(this.disabled)return;const t=this.getOptionElements().find(e=>e.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const e=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(e)}else if(t)this.focusAndScrollIntoView(t);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const e=this.querySelector('[role="searchbox"]');window.setTimeout(()=>e.focus(),0)}else this.focusFirstOption()}toggleOption(t){const e=t instanceof HTMLElement?t.dataset.disabled:t.disabled;if(this.disabled||e)return;const i=t instanceof HTMLElement?t.dataset.value:t.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(t=>{var e;return(t.fulltext||t.label+t.value+(t.prefix||"")).toLowerCase().includes(((e=this.searchValue)==null?void 0:e.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(t){return/^[\p{L} ]$/u.test(t)}handleTypeAhead(t){this.typeAheadString+=t.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const e=this.getOptionElements().find(i=>{var n;return(n=i.textContent)==null?void 0:n.trim().toLowerCase().startsWith(this.typeAheadString)});e&&this.focusAndScrollIntoView(e)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};Ct([o({type:String})],_t.prototype,"id",2),Ct([o({type:String})],_t.prototype,"label",2),Ct([o({type:Array})],_t.prototype,"options",2),Ct([o({type:Boolean,reflect:!0})],_t.prototype,"isOpen",2),Ct([o({type:Boolean})],_t.prototype,"disabled",2),Ct([o({type:Boolean})],_t.prototype,"includeSearch",2),Ct([o({type:Boolean})],_t.prototype,"isMultiSelect",2),Ct([o({type:Boolean})],_t.prototype,"allowUserInput",2),Ct([o({type:Boolean})],_t.prototype,"maxIsReached",2),Ct([o({type:String})],_t.prototype,"customUserInput",2),Ct([o({type:String})],_t.prototype,"searchPlaceholder",2),Ct([o({type:String})],_t.prototype,"searchValue",2),Ct([o({type:Number})],_t.prototype,"maxLength",2),Ct([o({type:String})],_t.prototype,"userMessage",2),Ct([D()],_t.prototype,"_filteredOptions",2),_t=Ct([F("pkt-listbox")],_t);const ih={displayValueAs:{default:"label"}},nh={props:ih};var ah=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,lt=(s,t,e,i)=>{for(var n=i>1?void 0:i?rh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ah(t,e,n),n};let nt=class extends L{constructor(){super(),this.helptextSlot=E(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=nh.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=E(),this.arrowRef=E(),this.listboxRef=E(),this.focusRef=E(),this.optionTagRef=E(),this.optionsController=new ba(this),this.slotController=new rt(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t;if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const e=((t=this.options)==null?void 0:t.filter(i=>i.userAdded))||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const n={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(n.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(n.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(n.description=i.getAttribute("description")||void 0),n.fulltext=n.value+n.label+(n.prefix||""),e.push(n)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const e=(t.get("options")||this._options||[]).filter(n=>n&&n.userAdded).filter(n=>!(Array.isArray(this.options)?this.options:[]).some(a=>a.value===n.value)),i=[...e,...this.options];this._options=i,e.length>0&&(this.options=i),this._options.forEach(n=>{if(n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)){const a=[...this._value];this._value=[...this._value,n.value],this.valueChanged(this._value,a)}n.fulltext=n.value+n.label+(n.prefix||""),n.selected=n.selected||this._value.includes(n.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),t==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(n=>{n.value&&!n.label&&(n.label=n.value),n.selected&&!this._value.includes(n.value)&&(this._value=[...this._value,n.value]),n.fulltext=n.value+n.label+(n.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,i)}render(){return d`
|
|
584
584
|
<pkt-input-wrapper
|
|
585
585
|
.label=${this.label}
|
|
586
586
|
.helptext=${this.helptext}
|
|
@@ -708,7 +708,7 @@
|
|
|
708
708
|
>${t.value}</span
|
|
709
709
|
>`;case"label":default:return d`<span class="pkt-combobox__value" data-focusfix=${this.id}
|
|
710
710
|
>${t.label||t.value}</span
|
|
711
|
-
>`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var n;return(n=i.fulltext)==null?void 0:n.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var a;return!n.selected&&((a=n.label)==null?void 0:a.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=i[0];n!=null&&n.label&&(e.value=n.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,n,a,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((a=(n=t.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:a.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,c=this.findValueInOptions(h);!this._value.includes(h)&&!c?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):c&&!this._value.includes(c.value)&&this.setSelected(c.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t)}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,n;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",i=e.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(h=>h.toLowerCase()===i),a=this._options.filter(h=>{var c;return((c=h.label)==null?void 0:c.toLowerCase().includes(i))??!1}),r=a.find(h=>{var c;return((c=h.label)==null?void 0:c.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((a.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(a.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!n:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case a.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,a=this._value.includes(t||n||""),r=!!n,h=((i=this._options.find(T=>T.value===t))==null?void 0:i.disabled)||!1,c=!(t!=null&&t.trim()),p=!this.multiple,m=this.multiple,v=this.isMaxItemsReached();let $=!1,b=!0,k="",x="";h||(!r&&this.allowUserInput&&!c?(this.addNewUserValue(t),k="Ny verdi lagt til",$=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),b=!1,$=!0,k="Ingen treff i søket"):a?(this.removeValue(n),$=!0):c&&p?(this.removeAllSelected(),$=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),$=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!v?(this.setSelected(n),$=!0):m&&v?(this._userInfoMessage="Maks antall valg nådd",b=!1,x=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,$=!0,x=t),this._isOptionsOpen=$,$||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=k,this._search=x||"",this.resetComboboxInput(b),m&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};lt([o({type:String,reflect:!0})],nt.prototype,"value",2),lt([o({type:Array})],nt.prototype,"options",2),lt([o({type:Array})],nt.prototype,"defaultOptions",2),lt([o({type:Boolean})],nt.prototype,"allowUserInput",2),lt([o({type:Boolean})],nt.prototype,"typeahead",2),lt([o({type:Boolean})],nt.prototype,"includeSearch",2),lt([o({type:String})],nt.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],nt.prototype,"multiple",2),lt([o({type:Number})],nt.prototype,"maxlength",2),lt([o({type:String})],nt.prototype,"displayValueAs",2),lt([o({type:String})],nt.prototype,"tagPlacement",2),lt([D()],nt.prototype,"_options",2),lt([D()],nt.prototype,"_isOptionsOpen",2),lt([D()],nt.prototype,"_value",2),lt([D()],nt.prototype,"_userInfoMessage",2),lt([D()],nt.prototype,"_addValueText",2),lt([D()],nt.prototype,"_maxIsReached",2),lt([D()],nt.prototype,"_search",2),lt([D()],nt.prototype,"_inputFocus",2),lt([D()],nt.prototype,"_editingSingleValue",2),nt=lt([F("pkt-combobox")],nt);const hh={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var ch=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,ce=(s,t,e,i)=>{for(var n=i>1?void 0:i?dh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ch(t,e,n),n};let Xi=null;function uh(){return Xi||(Xi=new Promise((s,t)=>{if(document.querySelector("#oslo-consent-script")){s();return}const e=document.createElement("script");e.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",e.id="oslo-consent-script",e.onload=()=>s(),e.onerror=t,document.head.appendChild(e);const i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Xi)}let Rt=class extends X{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||hh.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var t;super.disconnectedCallback(),this._cookieEventHandler&&((t=window.__cookieEvents)==null||t.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(t){let e;try{e=JSON.parse(t)}catch{e=t}return e}emitCookieConsents(t){const e=this.returnJsonOrObject(t.value).items.reduce((i,n)=>(i[n.name]=n.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:e,bubbles:!0,cancelable:!1}))}async firstUpdated(t){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await uh(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(t=>{if(t){const e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(t){var e;t.preventDefault(),(e=window.cookieBanner)!=null&&e.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?d`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?d`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
711
|
+
>`}}handleInput(t){if(t.stopPropagation(),t.stopImmediatePropagation(),this.disabled)return;this.touched=!0;const e=t.target;if(this._search=e.value,this.checkForMatches(),this.typeahead)if(this._search){if(this._options=this.options.filter(i=>{var n;return(n=i.fulltext)==null?void 0:n.toLowerCase().includes(this._search.toLowerCase())}),t.inputType!=="deleteContentBackward"){const i=this._options.filter(n=>{var a;return!n.selected&&((a=n.label)==null?void 0:a.toLowerCase().startsWith(this._search.toLowerCase()))});if(i.length>0&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const n=i[0];n!=null&&n.label&&(e.value=n.label,window.setTimeout(()=>e.setSelectionRange(this._search.length,e.value.length),0),e.selectionDirection="backward")}}}else this._options=[...this.options]}handleFocus(){if(!this.disabled){if(!this.multiple&&this._value[0]&&this.inputRef.value&&this.inputRef.value.type!=="hidden"){const t=this.findValueInOptions(this._value[0]);this._editingSingleValue=!0,this.inputRef.value.value=this.displayValueAs==="label"&&t!=null&&t.label?t.label:this._value[0]}this._inputFocus=!0,this._search="",this._options=[...this.options],this._isOptionsOpen=!0,this.onFocus(),this.requestUpdate()}}handleFocusOut(t){var e,i,n,a,r;if(!this.disabled&&((i=(e=t.relatedTarget)==null?void 0:e.closest("pkt-combobox"))==null?void 0:i.id)!==this.id&&((a=(n=t.relatedTarget)==null?void 0:n.closest("pkt-combobox"))==null?void 0:a.id)!==this.id&&((r=t.target)==null?void 0:r.getAttribute("data-focusfix"))!==this.id&&t.relatedTarget!==this.focusRef.value&&t.relatedTarget!==this.inputRef.value&&t.relatedTarget!==this.arrowRef.value&&this._isOptionsOpen){if(this._inputFocus=!1,this._addValueText=null,this._userInfoMessage="",this._search="",this.inputRef.value&&this.inputRef.value.type!=="hidden"&&this.inputRef.value.value!==""){const h=this.inputRef.value.value,c=this.findValueInOptions(h);!this._value.includes(h)&&!c?this.allowUserInput?this.addNewUserValue(h):this.multiple||this.removeValue(this._value[0]):c&&!this._value.includes(c.value)&&this.setSelected(c.value),this.inputRef.value.value=""}this._isOptionsOpen=!1,this.onBlur()}}handleBlur(){this._inputFocus=!1,this._editingSingleValue=!1,this.onBlur()}handleInputClick(t){var e,i;if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.currentTarget&&t.currentTarget!==this.arrowRef.value&&((e=this.inputRef.value)==null?void 0:e.type)!=="hidden"?((i=this.inputRef.value)==null||i.focus(),this.requestUpdate()):this.handleArrowClick(t)}handlePlaceholderClick(t){this.disabled||(t.stopPropagation(),this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.focus(),this._inputFocus=!0,this.requestUpdate()))}handleArrowClick(t){var e,i;this.disabled||t instanceof KeyboardEvent&&t.key&&t.key!=="Enter"&&t.key!==" "&&t.key!=="ArrowDown"||(t.stopImmediatePropagation(),t.preventDefault(),this._isOptionsOpen=!this._isOptionsOpen,this._isOptionsOpen?(e=this.listboxRef.value)==null||e.focusFirstOrSelectedOption():(i=this.arrowRef.value)==null||i.focus())}handleOptionToggled(t){this.toggleValue(t.detail)}handleSearch(t){t.stopPropagation(),this._search=t.detail.toLowerCase()}handleInputKeydown(t){var e,i,n;switch(t.key){case",":this.multiple&&(t.preventDefault(),this.addValue());break;case"Enter":t.preventDefault(),this.addValue();break;case"Backspace":!this._search&&((e=this.inputRef.value)==null?void 0:e.type)==="hidden"&&this.removeLastValue(t);break;case"Tab":case"ArrowDown":t.shiftKey||((i=this.listboxRef.value)==null||i.focusFirstOrSelectedOption(),t.preventDefault());break;case"Escape":this._isOptionsOpen=!1,(n=this.arrowRef.value)==null||n.focus(),t.preventDefault();break}}handleTagRemove(t){this.removeSelected(t)}blurInput(){this.inputRef.value&&this.inputRef.value.matches(":focus")&&this.inputRef.value.blur()}checkForMatches(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value)||this._search||"",i=e.trim().toLowerCase()||"";if(!i){!this.multiple&&this._value[0]&&this.removeValue(this._value[0]),this.resetComboboxInput(!1);return}const n=this._value.find(h=>h.toLowerCase()===i),a=this._options.filter(h=>{var c;return((c=h.label)==null?void 0:c.toLowerCase().includes(i))??!1}),r=a.find(h=>{var c;return((c=h.label)==null?void 0:c.toLowerCase())===i||h.value.toLowerCase()===i});switch(!0){case((a.length===0||!r)&&this.allowUserInput):this._addValueText=e,this._userInfoMessage="";break;case(a.length===0&&!this._options.length&&!this.allowUserInput):this._addValueText=null,this._userInfoMessage="Ingen match i søket";break;case!!n:this._addValueText=null,this._userInfoMessage="Verdien er allerede valgt";break;case a.length>1:this._addValueText=null,this._userInfoMessage="";break;default:this._addValueText=null,this._userInfoMessage=""}}findValueInOptions(t){return this.options.find(e=>e.value===t||e.label===t)||null}findIndexInOptions(t){return this._options.findIndex(e=>e.value===t||e.label===t)}isMaxItemsReached(){const t=this.maxlength!==null&&this._value.length>=this.maxlength;return t?this._maxIsReached=!0:this._maxIsReached=!1,t}toggleValue(t){var e,i;if(this.disabled)return;this.touched=!0,this._userInfoMessage="",this._addValueText=null;const n=((e=this.findValueInOptions(t))==null?void 0:e.value)||null,a=this._value.includes(t||n||""),r=!!n,h=((i=this._options.find(T=>T.value===t))==null?void 0:i.disabled)||!1,c=!(t!=null&&t.trim()),p=!this.multiple,m=this.multiple,v=this.isMaxItemsReached();let $=!1,b=!0,k="",x="";h||(!r&&this.allowUserInput&&!c?(this.addNewUserValue(t),k="Ny verdi lagt til",$=!m):!r&&!this.allowUserInput?(p&&this._value[0]&&this.removeValue(this._value[0]),b=!1,$=!0,k="Ingen treff i søket"):a?(this.removeValue(n),$=!0):c&&p?(this.removeAllSelected(),$=!0):p?(this._value[0]&&this.removeSelected(this._value[0]),this.setSelected(n),$=!1,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&(this.inputRef.value.value="",this.inputRef.value.blur())):m&&!v?(this.setSelected(n),$=!0):m&&v?(this._userInfoMessage="Maks antall valg nådd",b=!1,x=t):(p&&this.removeAllSelected(),this._userInfoMessage="Ingen gyldig verdi valgt",b=!1,$=!0,x=t),this._isOptionsOpen=$,$||window.setTimeout(()=>{var T;(T=this.focusRef.value)==null||T.focus()},0),this._userInfoMessage=k,this._search=x||"",this.resetComboboxInput(b),m&&this.isMaxItemsReached())}setSelected(t){if(!this._value.includes(t)){if(this.multiple&&this.isMaxItemsReached()){this._userInfoMessage="Maks antall valg nådd";return}!this.multiple&&this.removeAllSelected(),this._value=t?[...this._value,t]:this._value,this._options=this._options.map(e=>(e.value===t&&(e.selected=!0),e)),this.resetComboboxInput(!0)}}removeSelected(t){if(!t)return;this._value=this._value.filter(i=>i!==t);const e=this.findValueInOptions(t);e?(e.selected=!1,e.userAdded?(this._options=[...this._options.filter(i=>i.value!==t)],this.options=[...this.options.filter(i=>i.value!==t)]):this._options=[...this._options,e]):!t&&!this.multiple&&(this._options=this._options.map(i=>(i.selected=!1,i)))}addAllOptions(){if(this.multiple){if(this.maxlength&&this._options.length>this.maxlength){this._userInfoMessage="For mange valgt";return}this._value=this._options.map(t=>t.value),this._options=this._options.map(t=>(t.selected=!0,t)),this.requestUpdate()}}removeAllSelected(){this._value=[],this._options=this._options.map(t=>(t.selected=!1,t)),this._options=this._options.filter(t=>!t.userAdded),this.requestUpdate()}addValue(){var t;const e=((t=this.inputRef.value)==null?void 0:t.value.trim())||"";this._search=e,this.toggleValue(e)}removeValue(t){this._value=this.multiple?this._value.filter(e=>e!==t):[],this.removeSelected(t)}addNewUserValue(t){if(!t||t.trim()==="")return;if(!this.multiple)this._value[0]&&this.removeSelected(this._value[0]),this._value=[t],this._isOptionsOpen=!1,this.blurInput();else if(!this.findValueInOptions(t)){if(this.isMaxItemsReached())return;this._value=[...this._value,t]}const e={value:t,label:t,userAdded:!0};this.options=[e,...this.options],this._options=[e,...this._options],this.setSelected(t),this.requestUpdate()}resetComboboxInput(t=!0){if(this._addValueText=null,this.inputRef.value&&this.inputRef.value.type!=="hidden"&&t)if(this._search="",this.multiple)this.inputRef.value.value="";else{const e=this.findValueInOptions(this._value[0]);window.setTimeout(()=>{!this.inputRef.value||this.inputRef.value.type==="hidden"||(this.inputRef.value.value=this.displayValueAs==="label"&&e!=null&&e.label?e.label:this._value[0]||"")},0),this._userInfoMessage=""}this._options=[...this.options]}removeLastValue(t){if(this._value.length===0)return;t.preventDefault();const e=this._value[this._value.length-1];e&&this.removeSelected(e),this.isMaxItemsReached()}};lt([o({type:String,reflect:!0})],nt.prototype,"value",2),lt([o({type:Array})],nt.prototype,"options",2),lt([o({type:Array})],nt.prototype,"defaultOptions",2),lt([o({type:Boolean})],nt.prototype,"allowUserInput",2),lt([o({type:Boolean})],nt.prototype,"typeahead",2),lt([o({type:Boolean})],nt.prototype,"includeSearch",2),lt([o({type:String})],nt.prototype,"searchPlaceholder",2),lt([o({type:Boolean})],nt.prototype,"multiple",2),lt([o({type:Number})],nt.prototype,"maxlength",2),lt([o({type:String})],nt.prototype,"displayValueAs",2),lt([o({type:String})],nt.prototype,"tagPlacement",2),lt([D()],nt.prototype,"_options",2),lt([D()],nt.prototype,"_isOptionsOpen",2),lt([D()],nt.prototype,"_value",2),lt([D()],nt.prototype,"_userInfoMessage",2),lt([D()],nt.prototype,"_addValueText",2),lt([D()],nt.prototype,"_maxIsReached",2),lt([D()],nt.prototype,"_search",2),lt([D()],nt.prototype,"_inputFocus",2),lt([D()],nt.prototype,"_editingSingleValue",2),nt=lt([F("pkt-combobox")],nt);const oh={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var lh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,ce=(s,t,e,i)=>{for(var n=i>1?void 0:i?hh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&lh(t,e,n),n};let Xi=null;function ch(){return Xi||(Xi=new Promise((s,t)=>{if(document.querySelector("#oslo-consent-script")){s();return}const e=document.createElement("script");e.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",e.id="oslo-consent-script",e.onload=()=>s(),e.onerror=t,document.head.appendChild(e);const i=document.createElement("link");i.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",i.type="text/css",i.rel="stylesheet",i.id="oslo-consent-styles",document.head.appendChild(i)}),Xi)}let Kt=class extends X{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||oh.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var t;super.disconnectedCallback(),this._cookieEventHandler&&((t=window.__cookieEvents)==null||t.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(t){let e;try{e=JSON.parse(t)}catch{e=t}return e}emitCookieConsents(t){const e=this.returnJsonOrObject(t.value).items.reduce((i,n)=>(i[n.name]=n.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:e,bubbles:!0,cancelable:!1}))}async firstUpdated(t){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await ch(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(t=>{if(t){const e={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(e),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(t){var e;t.preventDefault(),(e=window.cookieBanner)!=null&&e.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?d`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?d`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
712
712
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
713
713
|
${this.triggerText}
|
|
714
714
|
</a>`:this.triggerType==="icon"?d`<pkt-button
|
|
@@ -718,7 +718,7 @@
|
|
|
718
718
|
@click=${this.openModal}
|
|
719
719
|
>
|
|
720
720
|
>${this.triggerText}</pkt-button
|
|
721
|
-
>`:d`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ce([o({type:Boolean})],
|
|
721
|
+
>`:d`<pkt-button @click=${this.openModal}>${this.triggerText}</pkt-button>`}};ce([o({type:Boolean})],Kt.prototype,"devMode",2),ce([o({type:String})],Kt.prototype,"hotjarId",2),ce([o({type:String})],Kt.prototype,"googleAnalyticsId",2),ce([o({type:String})],Kt.prototype,"cookieDomain",2),ce([o({type:String})],Kt.prototype,"cookieSecure",2),ce([o({type:String})],Kt.prototype,"cookieExpiryDays",2),ce([o({type:String})],Kt.prototype,"triggerType",2),ce([o({type:String})],Kt.prototype,"triggerText",2),ce([o({type:String})],Kt.prototype,"i18nLanguage",2),Kt=ce([F("pkt-consent")],Kt);var dh=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,Tt=(s,t,e,i)=>{for(var n=i>1?void 0:i?uh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&dh(t,e,n),n};let wt=class extends L{constructor(){super(...arguments),this.inputRef=E(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,e,i){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),t==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(t,e,i)}firstUpdated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(t)}updated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),t.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),t.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(t)}render(){const t=N({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),e=N({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),i=N({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),n="pkt-tag pkt-tag--small pkt-tag--thin-text",a=()=>d`
|
|
722
722
|
${this.tagText?d`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:y}
|
|
723
723
|
${this.optionalTag?d`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:y}
|
|
724
724
|
${this.requiredTag?d`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:y}
|
|
@@ -748,7 +748,7 @@
|
|
|
748
748
|
${this.labelPosition==="right"?r():y}
|
|
749
749
|
</div>
|
|
750
750
|
</div>
|
|
751
|
-
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};Tt([o({type:String,reflect:!0})],wt.prototype,"value",2),Tt([o({type:String})],wt.prototype,"checkHelptext",2),Tt([o({type:Boolean})],wt.prototype,"defaultChecked",2),Tt([o({type:Boolean})],wt.prototype,"hasTile",2),Tt([o({type:Boolean})],wt.prototype,"isSwitch",2),Tt([o({type:String})],wt.prototype,"labelPosition",2),Tt([o({type:Boolean})],wt.prototype,"hideLabel",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"checked",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"indeterminate",2),Tt([o({type:String,reflect:!0})],wt.prototype,"type",2),Tt([o({type:String})],wt.prototype,"tagText",2),Tt([o({type:Boolean})],wt.prototype,"optionalTag",2),Tt([o({type:String})],wt.prototype,"optionalText",2),Tt([o({type:Boolean})],wt.prototype,"requiredTag",2),Tt([o({type:String})],wt.prototype,"requiredText",2),wt=Tt([F("pkt-checkbox")],wt);var
|
|
751
|
+
`}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const e=t.target;if(e&&e.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};Tt([o({type:String,reflect:!0})],wt.prototype,"value",2),Tt([o({type:String})],wt.prototype,"checkHelptext",2),Tt([o({type:Boolean})],wt.prototype,"defaultChecked",2),Tt([o({type:Boolean})],wt.prototype,"hasTile",2),Tt([o({type:Boolean})],wt.prototype,"isSwitch",2),Tt([o({type:String})],wt.prototype,"labelPosition",2),Tt([o({type:Boolean})],wt.prototype,"hideLabel",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"checked",2),Tt([o({type:Boolean,reflect:!0})],wt.prototype,"indeterminate",2),Tt([o({type:String,reflect:!0})],wt.prototype,"type",2),Tt([o({type:String})],wt.prototype,"tagText",2),Tt([o({type:Boolean})],wt.prototype,"optionalTag",2),Tt([o({type:String})],wt.prototype,"optionalText",2),Tt([o({type:Boolean})],wt.prototype,"requiredTag",2),Tt([o({type:String})],wt.prototype,"requiredText",2),wt=Tt([F("pkt-checkbox")],wt);var ph=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,Rs=(s,t,e,i)=>{for(var n=i>1?void 0:i?fh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&ph(t,e,n),n};let vs=class extends X{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=Oe()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},d`
|
|
752
752
|
<div class=${N(this.classes)} aria-live="polite">
|
|
753
753
|
${Array.isArray(this.dates)&&this.dates[0]?Zi(ca((this.dates??[]).filter(Boolean)),t=>t,t=>{var e;return d` <pkt-tag
|
|
754
754
|
id=${this.idBase+t+"-tag"}
|
|
@@ -759,7 +759,7 @@
|
|
|
759
759
|
<time datetime=${t}>${la(t,this.dateformat)}</time>
|
|
760
760
|
</pkt-tag>`}):y}
|
|
761
761
|
</div>
|
|
762
|
-
`}};Rs([o({type:Array})],vs.prototype,"dates",2),Rs([o({type:String})],vs.prototype,"dateformat",2),Rs([o({type:String,attribute:"class"})],vs.prototype,"className",2),Rs([o({type:String,attribute:"id-base"})],vs.prototype,"idBase",2),vs=Rs([F("pkt-date-tags")],vs);const
|
|
762
|
+
`}};Rs([o({type:Array})],vs.prototype,"dates",2),Rs([o({type:String})],vs.prototype,"dateformat",2),Rs([o({type:String,attribute:"class"})],vs.prototype,"className",2),Rs([o({type:String,attribute:"id-base"})],vs.prototype,"idBase",2),vs=Rs([F("pkt-date-tags")],vs);const gh={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},Ks={props:gh},Ge=()=>{const s=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(s)||/Macintosh/.test(s)&&"ontouchend"in document)},wi={normalizeNameForMultiple(s,t,e){return s?(t||e)&&!s.endsWith("[]")?s+"[]":s:null},validateRangeOrder(s){return!s||s.length!==2?!0:bl(s[0],s[1])},sortDates(s){return ca(s)},filterSelectableDates(s,t,e,i,n){return vl(s,t,e,i,n)}},mh={getInputType(){return Ge()?"text":"date"}},Ys={submitForm(s){var t;const e=(t=s.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(s,t){const e=s==null?void 0:s.form;e?e.requestSubmit():t()},validateDateInput(s,t,e,i,n){var a,r,h,c;const p=s.value;p&&(e&&e>p?t.setValidity({rangeUnderflow:!0},((r=(a=n==null?void 0:n.forms)==null?void 0:a.messages)==null?void 0:r.rangeUnderflow)||"Value is below minimum",s):i&&i<p&&t.setValidity({rangeOverflow:!0},((c=(h=n==null?void 0:n.forms)==null?void 0:h.messages)==null?void 0:c.rangeOverflow)||"Value is above maximum",s))}},xi={addToSelected(s,t,e,i){const n=s.target;if(!n.value)return;const a=e?me(e):null,r=i?me(i):null,h=me(n.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!a||h>=a)&&(!r||h<=r)&&t.value&&t.value.handleDateSelect(h),n.value=""},handleCalendarPosition(s,t,e=!1){var i;if(!s.value||!t.value)return;const n=((i=t.value.parentElement)==null?void 0:i.getBoundingClientRect())||t.value.getBoundingClientRect(),a=e?n.height+30:n.height,r=s.value.getBoundingClientRect().height;let h=e?"calc(100% - 30px)":"100%";n&&n.top+r>window.innerHeight&&n.top-r>0&&(h=`calc(100% - ${a}px - ${r}px)`),s.value.style.top=h}},Ji={getInputClasses(s,t,e,i,n,a){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":s,"pkt-datepicker--hasrangelabels":t,"pkt-datepicker--multiple":e,"pkt-datepicker--range":i,"ios-readonly-hack":n===!1&&a==="text"}},getButtonClasses(){return{"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}},getRangeLabelClasses(s){return{"pkt-input-prefix":s,"pkt-hide":!s}}},Qi={processDateSelection(s,t,e){return!t&&!e?s[0]||"":Array.isArray(s)?s.join(","):s},updateInputValues(s,t,e,i,n,a){s.value&&(i&&t!=null&&t.value?(s.value.value=e[0]??"",t.value.value=e[1]??"",a(s.value),a(t.value)):n||(s.value.value=e.length?e[0]:"",a(s.value)))},processRangeBlur(s,t,e,i,n){var a;const r=s.target;if(r.value){n(r);const h=Me(r.value);h&&((a=e==null?void 0:e.value)==null||a.handleDateSelect(h))}else t[0]&&i()}},Si={handleInputKeydown(s,t,e,i,n,a){const{key:r}=s;r===","&&(s.preventDefault(),a?a(s):n&&n()),(r==="Space"||r===" ")&&(s.preventDefault(),t(s)),r==="Enter"&&(s.preventDefault(),e?e():i?i():n&&n())},handleButtonKeydown(s,t){const{key:e}=s;(e==="Enter"||e===" "||e==="Space")&&(s.preventDefault(),t(s))}};var vh=Object.defineProperty,bh=Object.getOwnPropertyDescriptor,Vt=(s,t,e,i)=>{for(var n=i>1?void 0:i?bh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&vh(t,e,n),n};let Lt=class extends X{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.popupRef=E(),this.calendarRef=E(),this.handleDocumentClick=t=>{if(!this.open)return;const e=t.composedPath(),i=this.parentElement,n=this.popupRef.value;!e.includes(this)&&!e.includes(n)&&!(i&&e.includes(i))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var t;this.open=!0,(t=this.calendarRef.value)==null||t.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(t){var e;return!!t&&!!((e=this.popupRef.value)!=null&&e.contains(t))}focusOnCurrentDate(){const t=this.calendarRef.value;t&&typeof t.focusOnCurrentDate=="function"&&t.focusOnCurrentDate()}addToSelected(t,e,i){if(typeof xi.addToSelected=="function")return xi.addToSelected(t,this.calendarRef,e,i)}handleDateSelect(t){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(t)}render(){const t={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return d`
|
|
763
763
|
<div
|
|
764
764
|
class="${N(t)}"
|
|
765
765
|
${M(this.popupRef)}
|
|
@@ -784,7 +784,7 @@
|
|
|
784
784
|
@close=${()=>{this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}
|
|
785
785
|
></pkt-calendar>
|
|
786
786
|
</div>
|
|
787
|
-
`}};
|
|
787
|
+
`}};Vt([o({type:Boolean,reflect:!0})],Lt.prototype,"open",2),Vt([o({type:Boolean})],Lt.prototype,"multiple",2),Vt([o({type:Boolean})],Lt.prototype,"range",2),Vt([o({type:Boolean})],Lt.prototype,"weeknumbers",2),Vt([o({type:Boolean})],Lt.prototype,"withcontrols",2),Vt([o({type:Number})],Lt.prototype,"maxMultiple",2),Vt([o({type:Array})],Lt.prototype,"selected",2),Vt([o({type:String})],Lt.prototype,"earliest",2),Vt([o({type:String})],Lt.prototype,"latest",2),Vt([o({type:Array})],Lt.prototype,"excludedates",2),Vt([o({type:Array})],Lt.prototype,"excludeweekdays",2),Vt([o({type:String})],Lt.prototype,"currentmonth",2),Lt=Vt([F("pkt-datepicker-popup")],Lt);var kh=Object.defineProperty,be=(s,t,e,i)=>{for(var n=void 0,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=r(t,e,n)||n);return n&&kh(t,e,n),n};let Yt=class extends X{constructor(){super(...arguments),this.inputType="date",this.id="",this.readonly=!1,this.disabled=!1,this.inputClasses={},this.inputRef=E(),this.btnRef=E()}get inputElement(){return this.inputRef.value}get buttonElement(){return this.btnRef.value}get isInputReadonly(){return this.readonly||this.inputType==="text"}dispatchToggleCalendar(t){this.readonly||this.dispatchEvent(new CustomEvent("toggle-calendar",{detail:t,bubbles:!0,composed:!0}))}dispatchInput(t){this.dispatchEvent(new CustomEvent("input-change",{detail:t,bubbles:!0,composed:!0}))}dispatchFocus(){this.dispatchEvent(new CustomEvent("input-focus",{bubbles:!0,composed:!0}))}dispatchBlur(t){this.dispatchEvent(new CustomEvent("input-blur",{detail:t,bubbles:!0,composed:!0}))}dispatchChange(t){this.dispatchEvent(new CustomEvent("input-changed",{detail:t,bubbles:!0,composed:!0}))}renderCalendarButton(){var t;return d`
|
|
788
788
|
<button
|
|
789
789
|
class="${N(Ji.getButtonClasses())}"
|
|
790
790
|
type="button"
|
|
@@ -796,7 +796,7 @@
|
|
|
796
796
|
<pkt-icon name="calendar"></pkt-icon>
|
|
797
797
|
<span class="pkt-btn__text">${((t=this.strings.calendar)==null?void 0:t.buttonAltText)||"Åpne kalender"}</span>
|
|
798
798
|
</button>
|
|
799
|
-
`}createRenderRoot(){return this}};be([o({type:String})],
|
|
799
|
+
`}createRenderRoot(){return this}};be([o({type:String})],Yt.prototype,"inputType"),be([o({type:String})],Yt.prototype,"id"),be([o({type:String})],Yt.prototype,"min"),be([o({type:String})],Yt.prototype,"max"),be([o({type:String})],Yt.prototype,"placeholder"),be([o({type:Boolean})],Yt.prototype,"readonly"),be([o({type:Boolean})],Yt.prototype,"disabled"),be([o({type:Object})],Yt.prototype,"inputClasses"),be([o({type:Object})],Yt.prototype,"internals");const ka={calendar:{buttonAltText:"Åpne kalender"}},yh={calendar:{buttonAltText:"Åpne kalender"},generic:{from:"Fra",to:"Til"}};var $h=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,tn=(s,t,e,i)=>{for(var n=i>1?void 0:i?_h(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&$h(t,e,n),n};let Ci=class extends Yt{constructor(){super(...arguments),this.value="",this.strings=ka}dispatchManageValidity(t){this.dispatchEvent(new CustomEvent("manage-validity",{detail:t,bubbles:!0,composed:!0}))}render(){return d`
|
|
800
800
|
<div class="pkt-input__container">
|
|
801
801
|
<input
|
|
802
802
|
class="${N(this.inputClasses)}"
|
|
@@ -820,7 +820,7 @@
|
|
|
820
820
|
/>
|
|
821
821
|
${this.renderCalendarButton()}
|
|
822
822
|
</div>
|
|
823
|
-
`}};tn([o({type:String})],Ci.prototype,"value",2),tn([o({type:Object})],Ci.prototype,"strings",2),Ci=tn([F("pkt-datepicker-single")],Ci);var
|
|
823
|
+
`}};tn([o({type:String})],Ci.prototype,"value",2),tn([o({type:Object})],Ci.prototype,"strings",2),Ci=tn([F("pkt-datepicker-single")],Ci);var wh=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,Ti=(s,t,e,i)=>{for(var n=i>1?void 0:i?xh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&wh(t,e,n),n};let Gs=class extends Yt{constructor(){super(...arguments),this.value=[],this.showRangeLabels=!1,this.strings=yh,this.inputRefTo=E()}get inputElementTo(){return this.inputRefTo.value}render(){var t,e;const i=Ji.getRangeLabelClasses(this.showRangeLabels);return d`
|
|
824
824
|
<div class="pkt-input__container">
|
|
825
825
|
${this.showRangeLabels?d` <div class="pkt-input-prefix">${(t=this.strings.generic)==null?void 0:t.from}</div> `:y}
|
|
826
826
|
<input
|
|
@@ -868,7 +868,7 @@
|
|
|
868
868
|
/>
|
|
869
869
|
${this.renderCalendarButton()}
|
|
870
870
|
</div>
|
|
871
|
-
`}};Ti([o({type:Array})],Gs.prototype,"value",2),Ti([o({type:Boolean})],Gs.prototype,"showRangeLabels",2),Ti([o({type:Object})],Gs.prototype,"strings",2),Gs=Ti([F("pkt-datepicker-range")],Gs);var
|
|
871
|
+
`}};Ti([o({type:Array})],Gs.prototype,"value",2),Ti([o({type:Boolean})],Gs.prototype,"showRangeLabels",2),Ti([o({type:Object})],Gs.prototype,"strings",2),Gs=Ti([F("pkt-datepicker-range")],Gs);var Sh=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,Ni=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ch(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Sh(t,e,n),n};let Zs=class extends Yt{constructor(){super(...arguments),this.value=[],this.strings=ka}get isInputDisabled(){return this.disabled||this.maxlength!==void 0&&this.maxlength!==null&&this.value.length>=this.maxlength}dispatchAddToSelected(t){this.dispatchEvent(new CustomEvent("add-to-selected",{detail:t,bubbles:!0,composed:!0}))}render(){return d`
|
|
872
872
|
<div class="pkt-input__container">
|
|
873
873
|
<input
|
|
874
874
|
class=${N(this.inputClasses)}
|
|
@@ -890,7 +890,7 @@
|
|
|
890
890
|
/>
|
|
891
891
|
${this.renderCalendarButton()}
|
|
892
892
|
</div>
|
|
893
|
-
`}};Ni([o({type:Array})],Zs.prototype,"value",2),Ni([o({type:Number})],Zs.prototype,"maxlength",2),Ni([o({type:Object})],Zs.prototype,"strings",2),Zs=Ni([F("pkt-datepicker-multiple")],Zs);var
|
|
893
|
+
`}};Ni([o({type:Array})],Zs.prototype,"value",2),Ni([o({type:Number})],Zs.prototype,"maxlength",2),Ni([o({type:Object})],Zs.prototype,"strings",2),Zs=Ni([F("pkt-datepicker-multiple")],Zs);var Th=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,gt=(s,t,e,i)=>{for(var n=i>1?void 0:i?Nh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Th(t,e,n),n};let ht=class extends L{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=E(),this._value=[],this.label="Datovelger",this.dateformat=Ks.props.dateformat.default,this.multiple=Ks.props.multiple.default,this.maxlength=null,this.range=Ks.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=Ks.props.weeknumbers.default,this.withcontrols=Ks.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=E(),this.popupRef=E(),this.helptextSlot=E(),this.singleInputRef=E(),this.rangeInputRef=E(),this.multipleInputRef=E(),this.addToSelected=t=>{const e=this.datepickerPopupRef.value;return e&&typeof e.addToSelected=="function"?e.addToSelected(t,this.min,this.max):xi.addToSelected(t,this.calRef,this.min,this.max)},this.slotController=new rt(this,this.helptextSlot)}get value(){return this._valueProperty}set value(t){const e=this._valueProperty;this._valueProperty=Array.isArray(t)?t.join(","):t||"",this.valueChanged(this._valueProperty,e),this.requestUpdate("value",e)}get inputType(){return mh.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=wi.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(t,e){if(t===e)return;const i=qs(t),n=this.multiple&&i.length>1?wi.filterSelectableDates(i,this.min,this.max,this.excludedates,this.excludeweekdays):i;if(this.range&&!wi.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",e);return}this._value=n;const a=kl(n);this._valueProperty!==a&&(this._valueProperty=a),super.valueChanged(a,e)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&this.valueChanged(i,e),t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=qs(i||"")),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=qs(i||"")),super.attributeChangedCallback(t,e,i)}updated(t){if(t.has("value")){const e=Array.isArray(this.value)?this.value.join(","):this.value,i=t.get("value"),n=Array.isArray(i)?i.join(","):i;this.valueChanged(e,n)}(t.has("multiple")||t.has("range"))&&(this.name=wi.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),t.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=qs(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(t)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.inputElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.inputElement:(i=this.singleInputRef.value)==null?void 0:i.inputElement}get currentInputElementTo(){var t;if(this.range)return(t=this.rangeInputRef.value)==null?void 0:t.inputElementTo}get currentButtonElement(){var t,e,i;return this.multiple?(t=this.multipleInputRef.value)==null?void 0:t.buttonElement:this.range?(e=this.rangeInputRef.value)==null?void 0:e.buttonElement:(i=this.singleInputRef.value)==null?void 0:i.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return d`
|
|
894
894
|
<pkt-datepicker-single
|
|
895
895
|
.value=${this._value[0]??""}
|
|
896
896
|
.inputType=${this.inputType}
|
|
@@ -1018,13 +1018,13 @@
|
|
|
1018
1018
|
</div>
|
|
1019
1019
|
</pkt-input-wrapper>
|
|
1020
1020
|
${this.renderCalendar()}
|
|
1021
|
-
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;xi.handleCalendarPosition(this.popupRef,this.inputRef,t)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),Ge()&&e.focusOnCurrentDate();return}await Rl(20),this.handleCalendarPosition(),Ge()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const t=this.datepickerPopupRef.value;if(this.calendarOpen=!1,t&&typeof t.hide=="function")return t.hide()}async toggleCalendar(t){t.preventDefault();const e=this.datepickerPopupRef.value;if(e&&typeof e.toggle=="function"){const i=!!e.open;e.toggle(),this.calendarOpen=!i;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};gt([o({type:String,reflect:!0})],ht.prototype,"value",1),gt([o({type:Array})],ht.prototype,"_value",2),gt([o({type:String,reflect:!0})],ht.prototype,"label",2),gt([o({type:String})],ht.prototype,"dateformat",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"multiple",2),gt([o({type:Number,reflect:!0})],ht.prototype,"maxlength",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"range",2),gt([o({type:Boolean})],ht.prototype,"showRangeLabels",2),gt([o({type:String,reflect:!0})],ht.prototype,"min",2),gt([o({type:String,reflect:!0})],ht.prototype,"max",2),gt([o({type:Boolean})],ht.prototype,"weeknumbers",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"withcontrols",2),gt([o({converter:ps.csvToArray})],ht.prototype,"excludedates",2),gt([o({converter:ps.csvToArray})],ht.prototype,"excludeweekdays",2),gt([o({type:String})],ht.prototype,"currentmonth",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"calendarOpen",2),gt([o({type:String})],ht.prototype,"timezone",2),gt([D()],ht.prototype,"inputClasses",2),ht=gt([F("pkt-datepicker")],ht);const
|
|
1021
|
+
`}handleCalendarPosition(){const t=this.multiple&&!!this.maxlength;xi.handleCalendarPosition(this.popupRef,this.inputRef,t)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),Ge()&&e.focusOnCurrentDate();return}await Rl(20),this.handleCalendarPosition(),Ge()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const t=this.datepickerPopupRef.value;if(this.calendarOpen=!1,t&&typeof t.hide=="function")return t.hide()}async toggleCalendar(t){t.preventDefault();const e=this.datepickerPopupRef.value;if(e&&typeof e.toggle=="function"){const i=!!e.open;e.toggle(),this.calendarOpen=!i;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};gt([o({type:String,reflect:!0})],ht.prototype,"value",1),gt([o({type:Array})],ht.prototype,"_value",2),gt([o({type:String,reflect:!0})],ht.prototype,"label",2),gt([o({type:String})],ht.prototype,"dateformat",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"multiple",2),gt([o({type:Number,reflect:!0})],ht.prototype,"maxlength",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"range",2),gt([o({type:Boolean})],ht.prototype,"showRangeLabels",2),gt([o({type:String,reflect:!0})],ht.prototype,"min",2),gt([o({type:String,reflect:!0})],ht.prototype,"max",2),gt([o({type:Boolean})],ht.prototype,"weeknumbers",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"withcontrols",2),gt([o({converter:ps.csvToArray})],ht.prototype,"excludedates",2),gt([o({converter:ps.csvToArray})],ht.prototype,"excludeweekdays",2),gt([o({type:String})],ht.prototype,"currentmonth",2),gt([o({type:Boolean,reflect:!0})],ht.prototype,"calendarOpen",2),gt([o({type:String})],ht.prototype,"timezone",2),gt([D()],ht.prototype,"inputClasses",2),ht=gt([F("pkt-datepicker")],ht);const Eh={href:{default:"#"},target:{default:"_self"}},ya={props:Eh};var Mh=Object.defineProperty,Ah=Object.getOwnPropertyDescriptor,bs=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ah(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Mh(t,e,n),n};let Ze=class extends X{constructor(){super(),this.defaultSlot=E(),this.href=ya.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=ya.props.target.default,this.slotController=new rt(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 d`<a
|
|
1022
1022
|
class=${N(t)}
|
|
1023
1023
|
href=${this.href}
|
|
1024
1024
|
.target=${this.target}
|
|
1025
1025
|
.rel=${this.external?"noopener noreferrer":y}
|
|
1026
1026
|
>${this.iconName?d`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${M(this.defaultSlot)}>Link</span></a
|
|
1027
|
-
>`}};bs([o({type:String,reflect:!0})],Ze.prototype,"href",2),bs([o({type:String,reflect:!0})],Ze.prototype,"iconName",2),bs([o({type:String,reflect:!0})],Ze.prototype,"iconPosition",2),bs([o({type:Boolean,reflect:!0})],Ze.prototype,"external",2),bs([o({type:String,reflect:!0})],Ze.prototype,"target",2),Ze=bs([F("pkt-link")],Ze);var
|
|
1027
|
+
>`}};bs([o({type:String,reflect:!0})],Ze.prototype,"href",2),bs([o({type:String,reflect:!0})],Ze.prototype,"iconName",2),bs([o({type:String,reflect:!0})],Ze.prototype,"iconPosition",2),bs([o({type:Boolean,reflect:!0})],Ze.prototype,"external",2),bs([o({type:String,reflect:!0})],Ze.prototype,"target",2),Ze=bs([F("pkt-link")],Ze);var Oh=Object.defineProperty,Ph=Object.getOwnPropertyDescriptor,de=(s,t,e,i)=>{for(var n=i>1?void 0:i?Ph(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Oh(t,e,n),n};let se=class extends L{constructor(){super(),this.inputRef=E(),this.helptextSlot=E(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new rt(this,this.helptextSlot)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}updated(t){var e;super.updated(t),t.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const t=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,e=N({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),i=this.ariaLabelledby||`${this.id}-input-label`;return d`
|
|
1028
1028
|
<pkt-input-wrapper
|
|
1029
1029
|
label="${this.label}"
|
|
1030
1030
|
?counter=${this.counter}
|
|
@@ -1093,7 +1093,7 @@
|
|
|
1093
1093
|
${!this.suffix&&t?d`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:y}
|
|
1094
1094
|
</div>
|
|
1095
1095
|
</pkt-input-wrapper>
|
|
1096
|
-
`}};de([o({type:String,reflect:!0})],se.prototype,"value",2),de([o({type:String})],se.prototype,"type",2),de([o({type:Number})],se.prototype,"size",2),de([o({type:String})],se.prototype,"autocomplete",2),de([o({type:String})],se.prototype,"iconNameRight",2),de([o({type:String})],se.prototype,"prefix",2),de([o({type:String})],se.prototype,"suffix",2),de([o({type:Boolean})],se.prototype,"omitSearchIcon",2),de([D()],se.prototype,"counterCurrent",2),se=de([F("pkt-textinput")],se);const
|
|
1096
|
+
`}};de([o({type:String,reflect:!0})],se.prototype,"value",2),de([o({type:String})],se.prototype,"type",2),de([o({type:Number})],se.prototype,"size",2),de([o({type:String})],se.prototype,"autocomplete",2),de([o({type:String})],se.prototype,"iconNameRight",2),de([o({type:String})],se.prototype,"prefix",2),de([o({type:String})],se.prototype,"suffix",2),de([o({type:Boolean})],se.prototype,"omitSearchIcon",2),de([D()],se.prototype,"counterCurrent",2),se=de([F("pkt-textinput")],se);const Dh=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Ih=s=>Dh(s),Lh=s=>{if(!s)return;const t=typeof s=="string"?new Date(s):s;if(!isNaN(t.getTime()))return t.toLocaleDateString("nb-NO",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})};var Bh=Object.defineProperty,Fh=Object.getOwnPropertyDescriptor,Xe=(s,t,e,i)=>{for(var n=i>1?void 0:i?Fh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Bh(t,e,n),n};let Pe=class extends X{constructor(){super(...arguments),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent("change-representation",{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleMenuItemClick(t){"onClick"in t&&typeof t.onClick=="function"&&t.onClick()}renderLinkOrButton(t,e){const i="href"in t,n=N({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[e||""]:!!e});return i?d`
|
|
1097
1097
|
<pkt-link
|
|
1098
1098
|
icon-name=${t.iconName||y}
|
|
1099
1099
|
href=${t.href}
|
|
@@ -1117,7 +1117,7 @@
|
|
|
1117
1117
|
<li class="pkt-user-menu__subitem">${this.renderLinkOrButton(e)}</li>
|
|
1118
1118
|
`)}
|
|
1119
1119
|
</ul>
|
|
1120
|
-
`}render(){var t;const e=(t=this.userMenu)==null?void 0:t.map(
|
|
1120
|
+
`}render(){var t;const e=(t=this.userMenu)==null?void 0:t.map(Ih);return d`
|
|
1121
1121
|
<nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
|
|
1122
1122
|
<ul class="pkt-user-menu__list">
|
|
1123
1123
|
<!-- User section -->
|
|
@@ -1175,8 +1175,8 @@
|
|
|
1175
1175
|
`:y}
|
|
1176
1176
|
</ul>
|
|
1177
1177
|
</nav>
|
|
1178
|
-
`}};Xe([o({type:Object})],Pe.prototype,"user",2),Xe([o({type:String,attribute:"formatted-last-logged-in"})],Pe.prototype,"formattedLastLoggedIn",2),Xe([o({type:Object})],Pe.prototype,"representing",2),Xe([o({type:Array,attribute:"user-menu"})],Pe.prototype,"userMenu",2),Xe([o({type:Boolean,attribute:"can-change-representation",converter:
|
|
1179
|
-
<pkt-icon name="oslologo" aria-hidden="true" path=${
|
|
1178
|
+
`}};Xe([o({type:Object})],Pe.prototype,"user",2),Xe([o({type:String,attribute:"formatted-last-logged-in"})],Pe.prototype,"formattedLastLoggedIn",2),Xe([o({type:Object})],Pe.prototype,"representing",2),Xe([o({type:Array,attribute:"user-menu"})],Pe.prototype,"userMenu",2),Xe([o({type:Boolean,attribute:"can-change-representation",converter:It})],Pe.prototype,"canChangeRepresentation",2),Xe([o({type:Boolean,attribute:"logout-on-click",converter:It})],Pe.prototype,"logoutOnClick",2),Pe=Xe([F("pkt-header-user-menu")],Pe);var jh=Object.defineProperty,Hh=Object.getOwnPropertyDescriptor,Q=(s,t,e,i)=>{for(var n=i>1?void 0:i?Hh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&jh(t,e,n),n};const Vh="https://punkt-cdn.oslo.kommune.no/14.2/logos/";let G=class extends X{constructor(){super(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.isMobile=!1,this.isTablet=!1,this.openMenu="none",this.isHidden=!1,this.componentWidth=typeof window<"u"?window.innerWidth:0,this.hasSlotContent=!1,this.alignSlotRight=!1,this.alignSearchRight=!1,this.defaultSlot=E(),this.headerRef=E(),this.userContainerRef=E(),this.slotContainerRef=E(),this.searchContainerRef=E(),this.slotContentRef=E(),this.searchMenuRef=E(),this.lastScrollPosition=0,this.savedScrollY=0,this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.handleScroll=()=>{if(!this.shouldHideOnScroll)return;const t=window.pageYOffset||document.documentElement.scrollTop;t<0||Math.abs(t-this.lastScrollPosition)<60||(this.isHidden=t>this.lastScrollPosition,this.lastScrollPosition=t)},this.handleClickOutside=t=>{const e=t.target;this.user&&this.openMenu==="user"&&!e.closest(".pkt-header-service__user-container")&&(this.openMenu="none"),this.openMenu==="slot"&&!e.closest(".pkt-header-service__slot-container")&&(this.openMenu="none"),this.openMenu==="search"&&!e.closest(".pkt-header-service__search-container")&&!e.closest(".pkt-header-service__search-input")&&(this.openMenu="none")},this.handleFocusOut=(t,e)=>{const i=t.relatedTarget;let n;switch(e){case"user":n=this.userContainerRef;break;case"slot":n=this.slotContainerRef;break;case"search":n=this.searchContainerRef;break;default:return}const a=n.value;a&&(!i||!a.contains(i))&&(this.openMenu="none")},this.handleEscapeKey=t=>{t.key==="Escape"&&this.openMenu!=="none"&&(t.preventDefault(),this.shouldRestoreFocus=!0,this.openMenu="none")},this.slotController=new rt(this,this.defaultSlot)}updateSlots(t){this.hasSlotContent=t.has(null)||t.has(void 0)}connectedCallback(){super.connectedCallback(),this.setupScrollListener()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.resizeObserver)==null||t.disconnect(),window.removeEventListener("scroll",this.handleScroll),this.unlockScroll()}firstUpdated(){this.setupResizeObserver()}updated(t){if(super.updated(t),t.has("openedMenu")&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu),(t.has("mobileBreakpoint")||t.has("tabletBreakpoint"))&&(this.updateIsMobile(),this.updateIsTablet()),t.has("openMenu")){const e=t.get("openMenu");this.openMenu!=="none"&&(e==="none"||e===void 0)?(document.addEventListener("mousedown",this.handleClickOutside),document.addEventListener("keydown",this.handleEscapeKey),(this.openMenu==="slot"||this.openMenu==="search")&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu==="none"&&e!=="none"&&(document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleEscapeKey),this.restoreFocus())}(t.has("openMenu")||t.has("isMobile"))&&this.updateScrollLock()}setupResizeObserver(){const t=this.headerRef.value;t&&(this.componentWidth=t.offsetWidth,this.updateIsMobile(),this.updateIsTablet(),this.resizeObserver=new ResizeObserver(e=>{for(const i of e)i.borderBoxSize&&i.borderBoxSize.length>0?this.componentWidth=i.borderBoxSize[0].inlineSize:this.componentWidth=i.contentRect.width,this.updateIsMobile(),this.updateIsTablet()}),this.resizeObserver.observe(t))}updateIsMobile(){this.isMobile=this.componentWidth<this.mobileBreakpoint}updateIsTablet(){this.isTablet=this.componentWidth<this.tabletBreakpoint}updateScrollLock(){this.position==="fixed"&&this.isMobile&&this.openMenu!=="none"?this.lockScroll():this.unlockScroll()}lockScroll(){const t=document.body,e=document.documentElement;this.savedScrollY=window.scrollY||window.pageYOffset;const i=window.innerWidth-e.clientWidth;i>0&&(t.style.paddingRight=`${i}px`),t.style.position="fixed",t.style.top=`-${this.savedScrollY}px`,t.style.left="0",t.style.right="0",t.style.width="100%",t.style.overflow="hidden",e.classList.add("is-scroll-locked")}unlockScroll(){const t=document.body,e=document.documentElement;e.classList.contains("is-scroll-locked")&&(t.style.removeProperty("position"),t.style.removeProperty("top"),t.style.removeProperty("left"),t.style.removeProperty("right"),t.style.removeProperty("width"),t.style.removeProperty("overflow"),t.style.removeProperty("padding-right"),e.classList.remove("is-scroll-locked"),window.scrollTo({top:this.savedScrollY}))}setupScrollListener(){window.addEventListener("scroll",this.handleScroll)}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}checkDropdownAlignment(t){const e=t==="slot"?this.slotContainerRef:this.searchContainerRef,i=t==="slot"?this.slotContentRef:this.searchMenuRef;if(!e.value||!i.value||!this.isTablet||this.isMobile)return;const n=e.value.getBoundingClientRect(),a=i.value.offsetWidth,r=n.left+a>window.innerWidth;t==="slot"?this.alignSlotRight=r:this.alignSearchRight=r}handleMenuToggle(t){this.openMenu!=="none"?this.openMenu="none":(this.lastFocusedElement=document.activeElement,this.openMenu=t)}handleLogoClick(t){this.dispatchEvent(new CustomEvent("logo-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleServiceClick(t){this.dispatchEvent(new CustomEvent("service-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleLogout(){this.dispatchEvent(new CustomEvent("log-out",{bubbles:!0,composed:!0}))}handleSearch(t){this.dispatchEvent(new CustomEvent("search",{detail:{query:t},bubbles:!0,composed:!0}))}handleSearchChange(t){this.dispatchEvent(new CustomEvent("search-change",{detail:{query:t},bubbles:!0,composed:!0}))}handleSearchInputChange(t){const e=t.target.value;this.handleSearchChange(e)}handleSearchKeyDown(t){t.key==="Enter"&&this.handleSearch(t.target.value)}get formattedLastLoggedIn(){var t;return Lh((t=this.user)==null?void 0:t.lastLoggedIn)}get isFixed(){return this.position==="fixed"}get shouldHideOnScroll(){return this.scrollBehavior==="hide"}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement==="header"||this.logOutButtonPlacement==="both")}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement==="userMenu"||this.logOutButtonPlacement==="both")}renderLogo(){if(this.hideLogo)return y;const t=d`
|
|
1179
|
+
<pkt-icon name="oslologo" aria-hidden="true" path=${Vh}></pkt-icon>
|
|
1180
1180
|
`;return this.logoLink&&typeof this.logoLink=="string"?d`
|
|
1181
1181
|
<span class="pkt-header-service__logo">
|
|
1182
1182
|
<a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
|
|
@@ -1370,7 +1370,7 @@
|
|
|
1370
1370
|
${t}
|
|
1371
1371
|
<div class=${e}></div>
|
|
1372
1372
|
</div>
|
|
1373
|
-
`}return t}};Q([o({type:String,attribute:"service-name"})],G.prototype,"serviceName",2),Q([o({type:String,attribute:"service-link"})],G.prototype,"serviceLink",2),Q([o({type:String,attribute:"logo-link"})],G.prototype,"logoLink",2),Q([o({type:String,attribute:"search-placeholder"})],G.prototype,"searchPlaceholder",2),Q([o({type:String,attribute:"search-value"})],G.prototype,"searchValue",2),Q([o({type:Number,attribute:"mobile-breakpoint"})],G.prototype,"mobileBreakpoint",2),Q([o({type:Number,attribute:"tablet-breakpoint"})],G.prototype,"tabletBreakpoint",2),Q([o({type:String,attribute:"opened-menu"})],G.prototype,"openedMenu",2),Q([o({type:String,attribute:"log-out-button-placement"})],G.prototype,"logOutButtonPlacement",2),Q([o({type:String})],G.prototype,"position",2),Q([o({type:String,attribute:"scroll-behavior"})],G.prototype,"scrollBehavior",2),Q([o({type:Boolean,attribute:"hide-logo",converter:
|
|
1373
|
+
`}return t}};Q([o({type:String,attribute:"service-name"})],G.prototype,"serviceName",2),Q([o({type:String,attribute:"service-link"})],G.prototype,"serviceLink",2),Q([o({type:String,attribute:"logo-link"})],G.prototype,"logoLink",2),Q([o({type:String,attribute:"search-placeholder"})],G.prototype,"searchPlaceholder",2),Q([o({type:String,attribute:"search-value"})],G.prototype,"searchValue",2),Q([o({type:Number,attribute:"mobile-breakpoint"})],G.prototype,"mobileBreakpoint",2),Q([o({type:Number,attribute:"tablet-breakpoint"})],G.prototype,"tabletBreakpoint",2),Q([o({type:String,attribute:"opened-menu"})],G.prototype,"openedMenu",2),Q([o({type:String,attribute:"log-out-button-placement"})],G.prototype,"logOutButtonPlacement",2),Q([o({type:String})],G.prototype,"position",2),Q([o({type:String,attribute:"scroll-behavior"})],G.prototype,"scrollBehavior",2),Q([o({type:Boolean,attribute:"hide-logo",converter:It})],G.prototype,"hideLogo",2),Q([o({type:Boolean,converter:It})],G.prototype,"compact",2),Q([o({type:Boolean,attribute:"show-search",converter:It})],G.prototype,"showSearch",2),Q([o({type:Boolean,attribute:"can-change-representation",converter:It})],G.prototype,"canChangeRepresentation",2),Q([o({type:Boolean,attribute:"has-log-out",converter:It})],G.prototype,"hasLogOut",2),Q([o({type:Object})],G.prototype,"user",2),Q([o({type:Array,attribute:"user-menu"})],G.prototype,"userMenu",2),Q([o({type:Object})],G.prototype,"representing",2),Q([D()],G.prototype,"isMobile",2),Q([D()],G.prototype,"isTablet",2),Q([D()],G.prototype,"openMenu",2),Q([D()],G.prototype,"isHidden",2),Q([D()],G.prototype,"componentWidth",2),Q([D()],G.prototype,"hasSlotContent",2),Q([D()],G.prototype,"alignSlotRight",2),Q([D()],G.prototype,"alignSearchRight",2),G=Q([F("pkt-header-service")],G);var Uh=Object.defineProperty,zh=Object.getOwnPropertyDescriptor,ot=(s,t,e,i)=>{for(var n=i>1?void 0:i?zh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Uh(t,e,n),n};let at=class extends X{constructor(){super(),this.defaultSlot=E(),this.searchPlaceholder="Søk",this.searchValue="",this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu="none",this.logOutButtonPlacement="none",this.position="fixed",this.scrollBehavior="hide",this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.slotController=new rt(this,this.defaultSlot)}firstUpdated(t){super.firstUpdated(t),this.emitDeprecationWarnings()}emitDeprecationWarnings(){this.userMenuFooter!==void 0&&console.warn("[PktHeader] userMenuFooter is deprecated. Use userMenu instead."),this.userOptions!==void 0&&console.warn("[PktHeader] userOptions is deprecated. Use userMenu instead.")}get effectiveUserMenu(){const t=this.userMenu||[],e=this.userMenuFooter||[],i=this.userOptions||[];return e.length||i.length?[...t,...i,...e]:this.userMenu}render(){return d`
|
|
1374
1374
|
<pkt-header-service
|
|
1375
1375
|
service-name=${C(this.serviceName)}
|
|
1376
1376
|
service-link=${C(this.serviceLink)}
|
|
@@ -1394,7 +1394,7 @@
|
|
|
1394
1394
|
>
|
|
1395
1395
|
<div class="pkt-contents" ${M(this.defaultSlot)}></div>
|
|
1396
1396
|
</pkt-header-service>
|
|
1397
|
-
`}};ot([o({type:String,attribute:"service-name"})],at.prototype,"serviceName",2),ot([o({type:String,attribute:"service-link"})],at.prototype,"serviceLink",2),ot([o({type:String,attribute:"logo-link"})],at.prototype,"logoLink",2),ot([o({type:String,attribute:"search-placeholder"})],at.prototype,"searchPlaceholder",2),ot([o({type:String,attribute:"search-value"})],at.prototype,"searchValue",2),ot([o({type:Number,attribute:"mobile-breakpoint"})],at.prototype,"mobileBreakpoint",2),ot([o({type:Number,attribute:"tablet-breakpoint"})],at.prototype,"tabletBreakpoint",2),ot([o({type:String,attribute:"opened-menu"})],at.prototype,"openedMenu",2),ot([o({type:String,attribute:"log-out-button-placement"})],at.prototype,"logOutButtonPlacement",2),ot([o({type:String})],at.prototype,"position",2),ot([o({type:String,attribute:"scroll-behavior"})],at.prototype,"scrollBehavior",2),ot([o({type:Boolean,attribute:"hide-logo",converter:
|
|
1397
|
+
`}};ot([o({type:String,attribute:"service-name"})],at.prototype,"serviceName",2),ot([o({type:String,attribute:"service-link"})],at.prototype,"serviceLink",2),ot([o({type:String,attribute:"logo-link"})],at.prototype,"logoLink",2),ot([o({type:String,attribute:"search-placeholder"})],at.prototype,"searchPlaceholder",2),ot([o({type:String,attribute:"search-value"})],at.prototype,"searchValue",2),ot([o({type:Number,attribute:"mobile-breakpoint"})],at.prototype,"mobileBreakpoint",2),ot([o({type:Number,attribute:"tablet-breakpoint"})],at.prototype,"tabletBreakpoint",2),ot([o({type:String,attribute:"opened-menu"})],at.prototype,"openedMenu",2),ot([o({type:String,attribute:"log-out-button-placement"})],at.prototype,"logOutButtonPlacement",2),ot([o({type:String})],at.prototype,"position",2),ot([o({type:String,attribute:"scroll-behavior"})],at.prototype,"scrollBehavior",2),ot([o({type:Boolean,attribute:"hide-logo",converter:It})],at.prototype,"hideLogo",2),ot([o({type:Boolean,converter:It})],at.prototype,"compact",2),ot([o({type:Boolean,attribute:"show-search",converter:It})],at.prototype,"showSearch",2),ot([o({type:Boolean,attribute:"can-change-representation",converter:It})],at.prototype,"canChangeRepresentation",2),ot([o({type:Boolean,attribute:"has-log-out",converter:It})],at.prototype,"hasLogOut",2),ot([o({type:Object})],at.prototype,"user",2),ot([o({type:Array,attribute:"user-menu"})],at.prototype,"userMenu",2),ot([o({type:Object})],at.prototype,"representing",2),ot([o({type:Array,attribute:"user-menu-footer"})],at.prototype,"userMenuFooter",2),ot([o({type:Array,attribute:"user-options"})],at.prototype,"userOptions",2),at=ot([F("pkt-header")],at);var qh=Object.defineProperty,Wh=Object.getOwnPropertyDescriptor,Je=(s,t,e,i)=>{for(var n=i>1?void 0:i?Wh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&qh(t,e,n),n};let De=class extends X{constructor(){super(),this.defaultSlot=E(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new rt(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 d`
|
|
1398
1398
|
<a
|
|
1399
1399
|
href=${this.href}
|
|
1400
1400
|
class=${t}
|
|
@@ -1406,7 +1406,7 @@
|
|
|
1406
1406
|
|
|
1407
1407
|
<div class="pkt-linkcard__text" ${M(this.defaultSlot)}></div>
|
|
1408
1408
|
</a>
|
|
1409
|
-
`}};Je([o({type:String,reflect:!0})],De.prototype,"title",2),Je([o({type:String,reflect:!0})],De.prototype,"href",2),Je([o({type:String,reflect:!0})],De.prototype,"iconName",2),Je([o({type:Boolean,reflect:!0})],De.prototype,"external",2),Je([o({type:Boolean,reflect:!0})],De.prototype,"openInNewTab",2),Je([o({type:String,reflect:!0})],De.prototype,"skin",2),De=Je([F("pkt-linkcard")],De);var
|
|
1409
|
+
`}};Je([o({type:String,reflect:!0})],De.prototype,"title",2),Je([o({type:String,reflect:!0})],De.prototype,"href",2),Je([o({type:String,reflect:!0})],De.prototype,"iconName",2),Je([o({type:Boolean,reflect:!0})],De.prototype,"external",2),Je([o({type:Boolean,reflect:!0})],De.prototype,"openInNewTab",2),Je([o({type:String,reflect:!0})],De.prototype,"skin",2),De=Je([F("pkt-linkcard")],De);var Rh=Object.defineProperty,Kh=Object.getOwnPropertyDescriptor,ke=(s,t,e,i)=>{for(var n=i>1?void 0:i?Kh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Rh(t,e,n),n};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.2/animations/";let ie=class extends X{constructor(){super(),this.defaultSlot=E(),this.delay=0,this.inline=!1,this.isLoading=!0,this.message=null,this.size="medium",this.variant="shapes",this.loadingAnimationPath=window.pktAnimationPath,this._shouldDisplayLoader=!1,this.slotController=new rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this._shouldDisplayLoader=this.delay===0,this.delay>0&&this.setupLoader()}updated(t){t.has("delay")&&this.setupLoader()}render(){const t=N({"pkt-loader":!0,[`pkt-loader--${this.inline?"inline":"box"}`]:!0,[`pkt-loader--${this.size}`]:!0}),e=N({"pkt-contents":!0,"pkt-hide":this.isLoading});return d`<div
|
|
1410
1410
|
role="status"
|
|
1411
1411
|
aria-live="polite"
|
|
1412
1412
|
aria-busy=${this.isLoading?"true":"false"}
|
|
@@ -1421,7 +1421,7 @@
|
|
|
1421
1421
|
${this.message&&d`<p>${this.message}</p>`}
|
|
1422
1422
|
</div>`:y}
|
|
1423
1423
|
<div class=${e} ${M(this.defaultSlot)}></div>
|
|
1424
|
-
</div>`}getVariant(t){switch(t){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};ke([o({type:Number})],ie.prototype,"delay",2),ke([o({type:Boolean})],ie.prototype,"inline",2),ke([o({type:Boolean})],ie.prototype,"isLoading",2),ke([o({type:String})],ie.prototype,"message",2),ke([o({type:String})],ie.prototype,"size",2),ke([o({type:String})],ie.prototype,"variant",2),ke([o({type:String})],ie.prototype,"loadingAnimationPath",2),ke([D()],ie.prototype,"_shouldDisplayLoader",2),ie=ke([F("pkt-loader")],ie);const
|
|
1424
|
+
</div>`}getVariant(t){switch(t){case"blue":return"spinner-blue";case"rainbow":return"spinner";default:return"loader"}}setupLoader(){this.delay>0&&(this._shouldDisplayLoader=!1,setTimeout(()=>{this._shouldDisplayLoader=!0,this.requestUpdate()},this.delay))}};ke([o({type:Number})],ie.prototype,"delay",2),ke([o({type:Boolean})],ie.prototype,"inline",2),ke([o({type:Boolean})],ie.prototype,"isLoading",2),ke([o({type:String})],ie.prototype,"message",2),ke([o({type:String})],ie.prototype,"size",2),ke([o({type:String})],ie.prototype,"variant",2),ke([o({type:String})],ie.prototype,"loadingAnimationPath",2),ke([D()],ie.prototype,"_shouldDisplayLoader",2),ie=ke([F("pkt-loader")],ie);const Yh={skin:{default:"beige"},compact:{default:!1},closable:{default:!1}},en={props:Yh};var Gh=Object.defineProperty,Zh=Object.getOwnPropertyDescriptor,ks=(s,t,e,i)=>{for(var n=i>1?void 0:i?Zh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Gh(t,e,n),n};let Qe=class extends X{constructor(){super(),this.defaultSlot=E(),this.closable=en.props.closable.default,this.compact=en.props.compact.default,this.title="",this.skin=en.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 rt(this,this.defaultSlot),this._isClosed=!1}updated(s){super.updated(s),s.has("_isClosed")&&Vn(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 d`<div class=${N(s)}>
|
|
1425
1425
|
${this.closable?d`<div class="pkt-messagebox__close">
|
|
1426
1426
|
<button
|
|
1427
1427
|
@click=${this.close}
|
|
@@ -1433,7 +1433,7 @@
|
|
|
1433
1433
|
</div>`:y}
|
|
1434
1434
|
${this.title?d`<div class="pkt-messagebox__title">${this.title}</div>`:y}
|
|
1435
1435
|
<div class="pkt-messagebox__text" ${M(this.defaultSlot)}></div>
|
|
1436
|
-
</div>`}};ks([o({type:Boolean,reflect:!0})],Qe.prototype,"closable",2),ks([o({type:Boolean,reflect:!0})],Qe.prototype,"compact",2),ks([o({type:String,reflect:!0})],Qe.prototype,"title",2),ks([o({type:String,reflect:!0})],Qe.prototype,"skin",2),ks([D()],Qe.prototype,"_isClosed",2),Qe=ks([F("pkt-messagebox")],Qe);const
|
|
1436
|
+
</div>`}};ks([o({type:Boolean,reflect:!0})],Qe.prototype,"closable",2),ks([o({type:Boolean,reflect:!0})],Qe.prototype,"compact",2),ks([o({type:String,reflect:!0})],Qe.prototype,"title",2),ks([o({type:String,reflect:!0})],Qe.prototype,"skin",2),ks([D()],Qe.prototype,"_isClosed",2),Qe=ks([F("pkt-messagebox")],Qe);const Xh={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},sn={props:Xh};var Jh=Object.defineProperty,Qh=Object.getOwnPropertyDescriptor,ne=(s,t,e,i)=>{for(var n=i>1?void 0:i?Qh(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&Jh(t,e,n),n};let Ut=class extends X{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=sn.props.hideCloseButton.default,this.closeOnBackdropClick=sn.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=sn.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=E(),this.dialogRef=E(),this._isOpen=!1,this.close=(t,e=!1)=>{var i;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const n=document.activeElement;n&&!this.isElementInViewport(n)&&n.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),e||(i=this.dialogRef.value)==null||i.close(),this.requestUpdate()},this.showModal=(t=null)=>{var e;this._isOpen=!0,(e=this.dialogRef.value)==null||e.showModal();const i=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var n;this.dialogRef.value&&((n=this.dialogRef.value)==null||n.focus())}),i&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:t},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new rt(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(t){super.firstUpdated(t),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>hd).then(e=>e.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(t){t.key==="Escape"&&this.close(t)}handleBackdropClick(t){var e;this.closeOnBackdropClick&&t.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(t)}isElementInViewport(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const t={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},i={"pkt-modal__content":!0,"pkt-txt-18-light":!0},n=this.closeButtonSkin==="blue",a={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0};return d`
|
|
1437
1437
|
<dialog
|
|
1438
1438
|
class=${N(t)}
|
|
1439
1439
|
${M(this.dialogRef)}
|
|
@@ -1469,14 +1469,14 @@
|
|
|
1469
1469
|
</div>
|
|
1470
1470
|
</div>
|
|
1471
1471
|
</dialog>
|
|
1472
|
-
`}};ne([o({type:String})],
|
|
1472
|
+
`}};ne([o({type:String})],Ut.prototype,"headingText",2),ne([o({type:Boolean})],Ut.prototype,"removePadding",2),ne([o({type:Boolean})],Ut.prototype,"hideCloseButton",2),ne([o({type:Boolean})],Ut.prototype,"closeOnBackdropClick",2),ne([o({type:String})],Ut.prototype,"closeButtonSkin",2),ne([o({type:String})],Ut.prototype,"size",2),ne([o({type:String})],Ut.prototype,"variant",2),ne([o({type:String})],Ut.prototype,"drawerPosition",2),ne([o({type:Boolean})],Ut.prototype,"transparentBackdrop",2),ne([D()],Ut.prototype,"_isOpen",2),Ut=ne([F("pkt-modal")],Ut);/**
|
|
1473
1473
|
* @license
|
|
1474
1474
|
* Copyright 2018 Google LLC
|
|
1475
1475
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1476
|
-
*/const $a="important",
|
|
1476
|
+
*/const $a="important",tc=" !"+$a,ec=He(class extends ls{constructor(s){var t;if(super(s),s.type!==Qt.ATTRIBUTE||s.name!=="style"||((t=s.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce(((t,e)=>{const i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(s,[t]){const{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(const i in t){const n=t[i];if(n!=null){this.ft.add(i);const a=typeof n=="string"&&n.endsWith(tc);i.includes("-")||a?e.setProperty(i,a?n.slice(0,-11):n,a?$a:""):e[i]=n}}return Dt}});var sc=Object.defineProperty,ic=Object.getOwnPropertyDescriptor,mt=(s,t,e,i)=>{for(var n=i>1?void 0:i?ic(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&sc(t,e,n),n};let ct=class extends X{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive="polite",this.id=Oe(),this.role="progressbar",this.skin="dark-blue",this.statusPlacement="following",this.statusType="none",this.title="",this.titlePosition="left",this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.computedAriaLabelledby=null,this.computedAriaValueText="",this.labelRef=E(),this.progressBarRef=E()}firstUpdated(s){super.firstUpdated(s),this.setComputedValues(),this.syncAttributes()}updated(s){super.updated(s),s.has("valueCurrent")&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),s.has("id")&&this.id&&(this.progressBarId=this.id),(s.has("statusType")||s.has("id")||s.has("ariaLabelledby"))&&(this.progressbarId=this.id||Oe(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(s.has("ariaValueText")||s.has("valueCurrent")||s.has("valueMax"))&&(this.computedAriaValueText=this.statusType==="fraction"&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||""),this.syncAttributes()}render(){const s=this.statusType!=="none",t=this.valueMax-this.valueMin,e=this.valueCurrent/t*100,i=this.statusType==="fraction"?Math.round(e):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),n=`${this.valueCurrent} av ${t}`,a=N({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),r=N({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition==="center"}),h=N({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement==="center"}),c=N({"pkt-progressbar__status-placement--following":this.statusPlacement==="following","pkt-progressbar__status-placement--center":this.statusPlacement==="center","pkt-progressbar__status-placement--left":this.statusPlacement==="left"});return d` <div
|
|
1477
1477
|
class="pkt-progressbar__container"
|
|
1478
1478
|
.ref=${this.progressBarRef}
|
|
1479
|
-
style=${
|
|
1479
|
+
style=${ec({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${i}%`})}
|
|
1480
1480
|
>
|
|
1481
1481
|
${this.title?d`<p id=${`${this.progressBarId}-title`} class=${r}>${this.title}</p>`:y}
|
|
1482
1482
|
|
|
@@ -1489,7 +1489,7 @@
|
|
|
1489
1489
|
${this.statusType==="percentage"?`${i}%`:n}
|
|
1490
1490
|
</span>
|
|
1491
1491
|
</div>`:y}
|
|
1492
|
-
</div>`}setComputedValues(){this.progressbarId=this.id||Oe(),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))}};mt([o({type:String})],ct.prototype,"ariaLabel",2),mt([o({type:String,reflect:!0})],ct.prototype,"ariaLabelledby",2),mt([o({type:String,reflect:!0})],ct.prototype,"ariaValueText",2),mt([o({type:String})],ct.prototype,"ariaLive",2),mt([o({type:String,reflect:!0})],ct.prototype,"id",2),mt([o({type:String})],ct.prototype,"role",2),mt([o({type:String})],ct.prototype,"skin",2),mt([o({type:String})],ct.prototype,"statusPlacement",2),mt([o({type:String})],ct.prototype,"statusType",2),mt([o({type:String,reflect:!0})],ct.prototype,"title",2),mt([o({type:String})],ct.prototype,"titlePosition",2),mt([o({type:Number,reflect:!0})],ct.prototype,"valueCurrent",2),mt([o({type:Number})],ct.prototype,"valueMax",2),mt([o({type:Number})],ct.prototype,"valueMin",2),mt([D()],ct.prototype,"labelWidth",2),mt([D()],ct.prototype,"progressbarId",2),mt([D()],ct.prototype,"computedAriaLabelledby",2),mt([D()],ct.prototype,"computedAriaValueText",2),ct=mt([F("pkt-progressbar")],ct);var
|
|
1492
|
+
</div>`}setComputedValues(){this.progressbarId=this.id||Oe(),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))}};mt([o({type:String})],ct.prototype,"ariaLabel",2),mt([o({type:String,reflect:!0})],ct.prototype,"ariaLabelledby",2),mt([o({type:String,reflect:!0})],ct.prototype,"ariaValueText",2),mt([o({type:String})],ct.prototype,"ariaLive",2),mt([o({type:String,reflect:!0})],ct.prototype,"id",2),mt([o({type:String})],ct.prototype,"role",2),mt([o({type:String})],ct.prototype,"skin",2),mt([o({type:String})],ct.prototype,"statusPlacement",2),mt([o({type:String})],ct.prototype,"statusType",2),mt([o({type:String,reflect:!0})],ct.prototype,"title",2),mt([o({type:String})],ct.prototype,"titlePosition",2),mt([o({type:Number,reflect:!0})],ct.prototype,"valueCurrent",2),mt([o({type:Number})],ct.prototype,"valueMax",2),mt([o({type:Number})],ct.prototype,"valueMin",2),mt([D()],ct.prototype,"labelWidth",2),mt([D()],ct.prototype,"progressbarId",2),mt([D()],ct.prototype,"computedAriaLabelledby",2),mt([D()],ct.prototype,"computedAriaValueText",2),ct=mt([F("pkt-progressbar")],ct);var nc=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,zt=(s,t,e,i)=>{for(var n=i>1?void 0:i?ac(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&nc(t,e,n),n};let Bt=class extends L{constructor(){super(...arguments),this.inputRef=E(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(s,t,e){s==="defaultChecked"&&(this._checked=this.defaultChecked),s==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(s,t,e)}render(){const s=N({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),t=N({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),e=N({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),i="pkt-tag pkt-tag--small pkt-tag--thin-text",n=()=>d`
|
|
1493
1493
|
${this.tagText?d`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:y}
|
|
1494
1494
|
${this.optionalTag?d`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:y}
|
|
1495
1495
|
${this.requiredTag?d`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:y}
|
|
@@ -1519,7 +1519,7 @@
|
|
|
1519
1519
|
${a()}
|
|
1520
1520
|
</div>
|
|
1521
1521
|
</div>
|
|
1522
|
-
`}toggleChecked(s=null){s&&s.preventDefault(),s&&s.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};
|
|
1522
|
+
`}toggleChecked(s=null){s&&s.preventDefault(),s&&s.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(":checked"),this.valueChecked(this._checked))}};zt([o({type:String,reflect:!0})],Bt.prototype,"value",2),zt([o({type:String})],Bt.prototype,"checkHelptext",2),zt([o({type:Boolean})],Bt.prototype,"defaultChecked",2),zt([o({type:Boolean})],Bt.prototype,"hasTile",2),zt([o({type:Boolean,reflect:!0})],Bt.prototype,"checked",2),zt([o({type:String,reflect:!0})],Bt.prototype,"type",2),zt([o({type:String})],Bt.prototype,"tagText",2),zt([o({type:Boolean})],Bt.prototype,"optionalTag",2),zt([o({type:String})],Bt.prototype,"optionalText",2),zt([o({type:Boolean})],Bt.prototype,"requiredTag",2),zt([o({type:String})],Bt.prototype,"requiredText",2),zt([D()],Bt.prototype,"_checked",2),Bt=zt([F("pkt-radiobutton")],Bt);/**
|
|
1523
1523
|
* @license
|
|
1524
1524
|
* Copyright 2021 Google LLC
|
|
1525
1525
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1535,23 +1535,23 @@
|
|
|
1535
1535
|
* @license
|
|
1536
1536
|
* Copyright 2021 Google LLC
|
|
1537
1537
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1538
|
-
*/class
|
|
1538
|
+
*/class rc{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:n}=this.subscriptions.get(t);t(this.value,n)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
1539
1539
|
* @license
|
|
1540
1540
|
* Copyright 2021 Google LLC
|
|
1541
1541
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1542
|
-
*/let
|
|
1542
|
+
*/let oc=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},xa=class extends rc{constructor(t,e,i){var n,a;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[c,{consumerHost:p}]of this.subscriptions)h.has(c)||(h.add(c),p.dispatchEvent(new _a(this.context,p,c,!0)));r.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),(a=(n=this.host).addController)==null||a.call(n,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new oc(this.context,this.host))}};/**
|
|
1543
1543
|
* @license
|
|
1544
1544
|
* Copyright 2017 Google LLC
|
|
1545
1545
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1546
|
-
*/function
|
|
1546
|
+
*/function lc({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return{get(){return t.get.call(this)},set(n){return i.get(this).setValue(n),t.set.call(this,n)},init(n){return i.set(this,new xa(this,{context:s,initialValue:n})),n}};{t.constructor.addInitializer((r=>{i.set(r,new xa(r,{context:s}))}));const n=Object.getOwnPropertyDescriptor(t,e);let a;if(n===void 0){const r=new WeakMap;a={get(){return r.get(this)},set(h){i.get(this).setValue(h),r.set(this,h)},configurable:!0,enumerable:!0}}else{const r=n.set;a={...n,set(h){i.get(this).setValue(h),r==null||r.call(this,h)}}}return void Object.defineProperty(t,e,a)}}}/**
|
|
1547
1547
|
* @license
|
|
1548
1548
|
* Copyright 2022 Google LLC
|
|
1549
1549
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1550
|
-
*/function
|
|
1550
|
+
*/function hc({context:s,subscribe:t}){return(e,i)=>{typeof i=="object"?i.addInitializer((function(){new wa(this,{context:s,callback:n=>{e.set.call(this,n)},subscribe:t})})):e.constructor.addInitializer((n=>{new wa(n,{context:s,callback:a=>{n[i]=a},subscribe:t})}))}}const Sa=Symbol("pkt-tabs-context");var cc=Object.defineProperty,dc=Object.getOwnPropertyDescriptor,ys=(s,t,e,i)=>{for(var n=i>1?void 0:i?dc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&cc(t,e,n),n};let ts=class extends X{constructor(){super(),this.arrowNav=!0,this.disableArrowNav=!1,this.tabRefs=[],this.tabCount=0,this.defaultSlot=E(),this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)},this.slotController=new rt(this,this.defaultSlot)}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(t){(t.has("arrowNav")||t.has("disableArrowNav"))&&(this.context={...this.context,useArrowNav:this.useArrowNav})}registerTab(t,e){this.tabRefs[e]=t,this.tabCount=Math.max(this.tabCount,e+1)}handleClick(t){this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:t},bubbles:!0,composed:!0}))}handleKeyUp(t,e){var i,n;this.useArrowNav&&(t.code==="ArrowLeft"&&e!==0&&((i=this.tabRefs[e-1])==null||i.focus()),t.code==="ArrowRight"&&e<this.tabCount-1&&((n=this.tabRefs[e+1])==null||n.focus()),(t.code==="ArrowDown"||t.code==="Space")&&this.dispatchEvent(new CustomEvent("tab-selected",{detail:{index:e},bubbles:!0,composed:!0})))}render(){const t=this.useArrowNav?"tablist":"navigation";return d`
|
|
1551
1551
|
<div class="pkt-tabs">
|
|
1552
1552
|
<div class="pkt-tabs__list" role=${t} ${M(this.defaultSlot)}></div>
|
|
1553
1553
|
</div>
|
|
1554
|
-
`}};ys([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],ts.prototype,"arrowNav",2),ys([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],ts.prototype,"disableArrowNav",2),ys([D()],ts.prototype,"tabRefs",2),ys([D()],ts.prototype,"tabCount",2),ys([
|
|
1554
|
+
`}};ys([o({type:Boolean,reflect:!0,attribute:"arrow-nav"})],ts.prototype,"arrowNav",2),ys([o({type:Boolean,reflect:!0,attribute:"disable-arrow-nav"})],ts.prototype,"disableArrowNav",2),ys([D()],ts.prototype,"tabRefs",2),ys([D()],ts.prototype,"tabCount",2),ys([lc({context:Sa}),D()],ts.prototype,"context",2),ts=ys([F("pkt-tabs")],ts);var uc=Object.defineProperty,pc=Object.getOwnPropertyDescriptor,ye=(s,t,e,i)=>{for(var n=i>1?void 0:i?pc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&uc(t,e,n),n};let ue=class extends X{constructor(){super(),this.active=!1,this.href="",this.icon="",this.controls="",this.tag="",this.tagSkin="blue",this.index=0,this.elementRef=E(),this.defaultSlot=E(),this.slotController=new rt(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index)})}handleClick(){this.context&&this.context.handleClick(this.index)}handleKeyUp(t){this.context&&this.context.handleKeyUp(t,this.index)}render(){var t;const e=((t=this.context)==null?void 0:t.useArrowNav)??!0,i=this.active?"active":"",n=e?"tab":void 0,a=e?this.active:void 0,r=this.active||!e?void 0:-1,h=d`
|
|
1555
1555
|
${this.icon?d`<pkt-icon name=${this.icon} class="pkt-icon--small"></pkt-icon>`:""}
|
|
1556
1556
|
<span ${M(this.defaultSlot)}></span>
|
|
1557
1557
|
${this.tag?d`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:""}
|
|
@@ -1583,11 +1583,11 @@
|
|
|
1583
1583
|
>
|
|
1584
1584
|
${h}
|
|
1585
1585
|
</button>
|
|
1586
|
-
`}};ye([o({type:Boolean,reflect:!0})],ue.prototype,"active",2),ye([o({type:String,reflect:!0})],ue.prototype,"href",2),ye([o({type:String,reflect:!0})],ue.prototype,"icon",2),ye([o({type:String,reflect:!0})],ue.prototype,"controls",2),ye([o({type:String,reflect:!0})],ue.prototype,"tag",2),ye([o({type:String,reflect:!0,attribute:"tag-skin"})],ue.prototype,"tagSkin",2),ye([o({type:Number,reflect:!0})],ue.prototype,"index",2),ye([
|
|
1586
|
+
`}};ye([o({type:Boolean,reflect:!0})],ue.prototype,"active",2),ye([o({type:String,reflect:!0})],ue.prototype,"href",2),ye([o({type:String,reflect:!0})],ue.prototype,"icon",2),ye([o({type:String,reflect:!0})],ue.prototype,"controls",2),ye([o({type:String,reflect:!0})],ue.prototype,"tag",2),ye([o({type:String,reflect:!0,attribute:"tag-skin"})],ue.prototype,"tagSkin",2),ye([o({type:Number,reflect:!0})],ue.prototype,"index",2),ye([hc({context:Sa,subscribe:!0}),o({attribute:!1})],ue.prototype,"context",2),ue=ye([F("pkt-tab-item")],ue);/**
|
|
1587
1587
|
* @license
|
|
1588
1588
|
* Copyright 2020 Google LLC
|
|
1589
1589
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1590
|
-
*/const
|
|
1590
|
+
*/const fc=He(class extends ls{constructor(s){if(super(s),s.type!==Qt.PROPERTY&&s.type!==Qt.ATTRIBUTE&&s.type!==Qt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Bn(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[t]){if(t===Dt||t===y)return t;const e=s.element,i=s.name;if(s.type===Qt.PROPERTY){if(t===e[i])return Dt}else if(s.type===Qt.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return Dt}else if(s.type===Qt.ATTRIBUTE&&e.getAttribute(i)===t+"")return Dt;return jn(s),t}});var gc=Object.defineProperty,mc=Object.getOwnPropertyDescriptor,Xs=(s,t,e,i)=>{for(var n=i>1?void 0:i?mc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&gc(t,e,n),n};let $s=class extends L{constructor(){super(),this.inputRef=E(),this.helptextSlot=E(),this.value="",this.autocomplete="off",this.rows=null,this.counterCurrent=0,this.slotController=new rt(this,this.helptextSlot)}attributeChangedCallback(t,e,i){t==="value"&&this.value!==e&&(this.counterCurrent=i?i.length:0,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}updated(t){var e;super.updated(t),t.has("value")&&(this.counterCurrent=((e=this.value)==null?void 0:e.length)||0,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const t=N({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),e=this.ariaLabelledby||`${this.id}-input-label`;return d`<pkt-input-wrapper
|
|
1591
1591
|
label=${this.label}
|
|
1592
1592
|
?counter=${this.counter}
|
|
1593
1593
|
?disabled=${this.disabled}
|
|
@@ -1617,7 +1617,7 @@
|
|
|
1617
1617
|
id=${this.id+"-input"}
|
|
1618
1618
|
name=${(this.name||this.id)+"-input"}
|
|
1619
1619
|
placeholder=${C(this.placeholder)}
|
|
1620
|
-
.value=${
|
|
1620
|
+
.value=${fc(this.value)}
|
|
1621
1621
|
minlength=${C(this.minlength)}
|
|
1622
1622
|
maxlength=${C(this.maxlength)}
|
|
1623
1623
|
?readonly=${this.readonly}
|
|
@@ -1632,7 +1632,7 @@
|
|
|
1632
1632
|
@focus=${i=>{this.onFocus(),i.stopImmediatePropagation()}}
|
|
1633
1633
|
@blur=${i=>{this.value=i.target.value,this.onBlur(),i.stopImmediatePropagation()}}
|
|
1634
1634
|
></textarea>
|
|
1635
|
-
</pkt-input-wrapper>`}};Xs([o({type:String,reflect:!0})],$s.prototype,"value",2),Xs([o({type:String})],$s.prototype,"autocomplete",2),Xs([o({type:Number})],$s.prototype,"rows",2),Xs([D()],$s.prototype,"counterCurrent",2),$s=Xs([F("pkt-textarea")],$s);var
|
|
1635
|
+
</pkt-input-wrapper>`}};Xs([o({type:String,reflect:!0})],$s.prototype,"value",2),Xs([o({type:String})],$s.prototype,"autocomplete",2),Xs([o({type:Number})],$s.prototype,"rows",2),Xs([D()],$s.prototype,"counterCurrent",2),$s=Xs([F("pkt-textarea")],$s);var vc=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,Ei=(s,t,e,i)=>{for(var n=i>1?void 0:i?bc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&vc(t,e,n),n};let Js=class extends L{constructor(){super(),this.inputRef=E(),this.helptextSlot=E(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new ba(this),this.slotController=new rt(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(i=>{const n={value:i.hasAttribute("value")?i.getAttribute("value")??"":i.textContent??"",label:i.textContent||i.getAttribute("value")||"",disabled:i.hasAttribute("disabled"),selected:i.hasAttribute("selected"),hidden:i.hasAttribute("data-hidden")};i.getAttribute("selected")&&!this.value&&(this.value=n.value),this._options.push(n)}):(this._options=this._optionsProp,this._options.forEach(i=>{i.selected&&!this.value&&(this.value=i.value)}))}add(t,e){const i={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(i);else if(typeof e=="number")this._options.splice(e,0,i);else{const n=e.value||e.text,a=this._options.findIndex(r=>r.value===n);a>=0?this._options.splice(a,0,i):this._options.push(i)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(n=>n.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,i){var n,a;t==="options"&&(this._options=i?JSON.parse(i):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((n=this.inputRef.value)==null?void 0:n.selectedIndex):this._options.findIndex(r=>r.value===i),this.selectedOptions=(a=this.inputRef.value)==null?void 0:a.selectedOptions,this.valueChanged(i,e)),super.attributeChangedCallback(t,e,i)}update(t){var e,i;super.update(t),t.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(n=>n.value===this.value),this.selectedOptions=(i=this.inputRef.value)==null?void 0:i.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return d`
|
|
1636
1636
|
<pkt-input-wrapper
|
|
1637
1637
|
?counter=${this.counter}
|
|
1638
1638
|
?disabled=${this.disabled}
|
|
@@ -1680,7 +1680,7 @@
|
|
|
1680
1680
|
</select>
|
|
1681
1681
|
<div class="pkt-contents" ${M(this.helptextSlot)} name="helptext" slot="helptext"></div>
|
|
1682
1682
|
</pkt-input-wrapper>
|
|
1683
|
-
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};Ei([o({type:Array,attribute:"options"})],Js.prototype,"_optionsProp",2),Ei([o({type:String})],Js.prototype,"value",2),Ei([D()],Js.prototype,"_options",2),Js=Ei([F("pkt-select")],Js);var
|
|
1683
|
+
`}returnNumberOrNull(t){return t==null||isNaN(t)?null:t}};Ei([o({type:Array,attribute:"options"})],Js.prototype,"_optionsProp",2),Ei([o({type:String})],Js.prototype,"value",2),Ei([D()],Js.prototype,"_options",2),Js=Ei([F("pkt-select")],Js);var kc=Object.defineProperty,yc=Object.getOwnPropertyDescriptor,Qs=(s,t,e,i)=>{for(var n=i>1?void 0:i?yc(t,e):t,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(i?r(t,e,n):r(n))||n);return i&&n&&kc(t,e,n),n};let _s=class extends X{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=E(),this.namedSlot=E(),this.slotController=new rt(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 d`
|
|
1684
1684
|
<div class="${N(s)}">
|
|
1685
1685
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
1686
1686
|
|
|
@@ -1708,8 +1708,8 @@
|
|
|
1708
1708
|
<ul>
|
|
1709
1709
|
${s.map(t=>d`<li>${t}</li>`)}
|
|
1710
1710
|
</ul>
|
|
1711
|
-
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Qs([o({type:String})],_s.prototype,"string",2),Qs([o({converter:da})],_s.prototype,"strings",2),Qs([o({type:Boolean})],_s.prototype,"darkmode",2),Qs([o({type:Array})],_s.prototype,"_list",2),_s=Qs([F("pkt-component")],_s);const q=Jt({tagName:"pkt-icon",elementClass:Ue,react:_,displayName:"PktIcon",events:{}}),Ca=_.forwardRef(({defaultOpen:s=!1,id:t,title:e,skin:i,compact:n=!1,isOpen:a,children:r,name:h,className:c,onClick:p,onToggle:m},v)=>{const[$,b]=_.useState(s),{name:k}=tr(),x=h||k,T=a!==void 0?a:$;_.useEffect(()=>{a===void 0&&b(s)},[s,a]);const S=O=>{const et=O.currentTarget.open;a===void 0&&b(et),m==null||m(O)},A=O=>{setTimeout(()=>{p==null||p(O)},0)},I=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,c].filter(Boolean).join(" ");return l.jsxs("details",{ref:v,className:I,id:t,open:T,onClick:A,name:x,onToggle:S,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(q,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),l.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${t}`,role:"region",children:l.jsx("div",{className:"pkt-accordion-item__content-inner",children:r})})]})});Ca.displayName="PktAccordionItem";function
|
|
1711
|
+
`}doStuff(s){return s.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};Qs([o({type:String})],_s.prototype,"string",2),Qs([o({converter:da})],_s.prototype,"strings",2),Qs([o({type:Boolean})],_s.prototype,"darkmode",2),Qs([o({type:Array})],_s.prototype,"_list",2),_s=Qs([F("pkt-component")],_s);const q=Jt({tagName:"pkt-icon",elementClass:Ue,react:_,displayName:"PktIcon",events:{}}),Ca=_.forwardRef(({defaultOpen:s=!1,id:t,title:e,skin:i,compact:n=!1,isOpen:a,children:r,name:h,className:c,onClick:p,onToggle:m},v)=>{const[$,b]=_.useState(s),{name:k}=tr(),x=h||k,T=a!==void 0?a:$;_.useEffect(()=>{a===void 0&&b(s)},[s,a]);const S=O=>{const et=O.currentTarget.open;a===void 0&&b(et),m==null||m(O)},A=O=>{setTimeout(()=>{p==null||p(O)},0)},I=["pkt-accordion-item",n&&"pkt-accordion-item--compact",i&&`pkt-accordion-item--${i}`,c].filter(Boolean).join(" ");return l.jsxs("details",{ref:v,className:I,id:t,open:T,onClick:A,name:x,onToggle:S,children:[l.jsxs("summary",{className:"pkt-accordion-item__title",id:`pkt-accordion-item-summary-${t}`,children:[e,l.jsx(q,{name:"chevron-thin-down",className:"pkt-accordion-item__icon","aria-hidden":"true"})]}),l.jsx("div",{className:"pkt-accordion-item__content",id:`pkt-accordion-item__content-${t}`,role:"region",children:l.jsx("div",{className:"pkt-accordion-item__content-inner",children:r})})]})});Ca.displayName="PktAccordionItem";function $c(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var nn={exports:{}};/*!
|
|
1712
1712
|
Copyright (c) 2018 Jed Watson.
|
|
1713
1713
|
Licensed under the MIT License (MIT), see
|
|
1714
1714
|
http://jedwatson.github.io/classnames
|
|
1715
|
-
*/var Ta;function wc(){return Ta||(Ta=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var a="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(a=n(a,i(h)))}return a}function i(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return e.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var r="";for(var h in a)t.call(a,h)&&a[h]&&(r=n(r,h));return r}function n(a,r){return r?a?a+" "+r:a+r:a}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(nn)),nn.exports}var xc=wc();const Z=_c(xc),an=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:c="info",className:p,...m})=>{const[v,$]=_.useState(!1),b={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${c}`]:c,"pkt-hide":v},k={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=_.useCallback(()=>{$(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,$]),T=a||r;return l.jsx("div",{...m,"aria-live":T,role:h,className:Z(b,p),children:l.jsxs("div",{className:Z(k),children:[l.jsx(q,{className:"pkt-alert__icon","aria-hidden":"true",name:c==="info"?"alert-information":`alert-${c}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(pe,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:x,children:l.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&l.jsx("div",{className:"pkt-alert__title",children:i}),l.jsx("div",{className:"pkt-alert__text",children:s}),n&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};an.displayName="PktAlert";const Na=Jt({tagName:"pkt-backlink",elementClass:ds,react:_,displayName:"PktBackLink"});Na.displayName="PktBackLink";const Sc=_.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},n)=>{const a=s,r=a[a.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:n,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((c,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===a.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})}):t==="router"?l.jsxs(dn.Link,{to:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]}):l.jsxs("a",{href:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(dn.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.1/animations/";const pe=_.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",iconPath:n,secondIconPath:a,size:r="medium",fullWidth:h=!1,fullWidthOnMobile:c=!1,skin:p="primary",type:m="button",variant:v="label-only",state:$,color:b,isLoading:k=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...S},A)=>{const I=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",c&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,b&&`pkt-btn--${b}`,$&&`pkt-btn--${$}`,k&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...S,"aria-busy":k||void 0,"aria-disabled":x||void 0,disabled:x,className:I,type:m,ref:A,children:[k&&l.jsx(q,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),v!=="label-only"&&l.jsx(q,{className:"pkt-btn__icon",name:e,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&l.jsx(q,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});pe.displayName="PktButton";const Cc=Jt({tagName:"pkt-card",elementClass:ft,react:_,displayName:"PktCard",events:{}}),Ea=_.forwardRef(({children:s,...t},e)=>l.jsx(Cc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ea.displayName="PktCard";const Ma=_.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:n,hasError:a=!1,className:r,isSwitch:h=!1,hideLabel:c=!1,labelPosition:p="right",defaultChecked:m,checked:v,indeterminate:$,optionalTag:b,optionalText:k="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:S,...A},I)=>{const O=_.useRef(null);_.useEffect(()=>{O.current&&$!==void 0&&(O.current.indeterminate=$)},[$]),_.useEffect(()=>{typeof I=="function"?I(O.current):I&&(I.current=O.current)},[I]);const R=[r,"pkt-input-check"].filter(Boolean).join(" "),et=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,c?"pkt-sr-only":""].filter(Boolean).join(" "),Ot=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Nt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),it=()=>l.jsxs(l.Fragment,{children:[S&&l.jsx("span",{className:Nt+" pkt-tag--gray",children:S}),b&&l.jsx("span",{className:Nt+" pkt-tag--blue-light",children:k}),x&&l.jsx("span",{className:Nt+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:R,children:l.jsxs("div",{className:Ot,children:[p==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:O,className:`pkt-input-check__input-checkbox ${a?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...v!==void 0?{checked:v}:{defaultChecked:m},...A}),p==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Ma.displayName="PktCheckbox";const Tc=Jt({tagName:"pkt-combobox",elementClass:nt,react:_,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Aa=_.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Tc,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));Aa.displayName="PktCombobox";const Mi=Jt({tagName:"pkt-consent",elementClass:Rt,react:_,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Mi.displayName="PktConsent";const Nc=Jt({tagName:"pkt-datepicker",elementClass:ht,react:_,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Oa=_.forwardRef(({helptext:s,...t},e)=>l.jsx(Nc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));Oa.displayName="PktDatepicker";const Ec=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:a="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:c=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:$=null,cookieExpiryDays:b=null,onToggleConsent:k=x=>{console.log(x.detail)}})=>{var T,S;const x=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:x,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:s.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&l.jsx("li",{className:"pkt-footer__text",children:s.text}),(T=s.links)==null?void 0:T.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:t.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&l.jsx("li",{className:"pkt-footer__text",children:t.text}),(S=t.links)==null?void 0:S.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),l.jsxs("ul",{className:"pkt-footer__list",children:[l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:c,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:$,cookieExpiryDays:b,onToggleConsent:k})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(A=>A.language).map((A,I)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:A.href,"aria-label":`til ${A.language} versjon av nettsiden`,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:A.language})},`sociallinks-language-${I}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(A=>A.iconName).map((A,I)=>l.jsx(_.Fragment,{children:l.jsx("a",{href:A.href,"aria-label":`til ${A.iconName}`,className:"pkt-footer__social-icon-link",target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(q,{className:"pkt-footer__social-icon",name:A.iconName})})},`sociallinks-${I}`))})]})]})})},Mc=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:a=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:c=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:v=b=>{console.log(b.detail)},className:$})=>{const b=[$,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((k,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${k.external?" pkt-link--external":""}`,href:k.href,target:k.openInNewTab||t?"_blank":"_self",rel:k.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),k.text]})},x)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:e,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:c,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},Ai=({href:s,iconName:t,className:e,iconPosition:i,external:n,target:a,children:r,...h})=>{const c={"pkt-link":!0,"pkt-link--icon-left":!!t&&i==="left"||!!(t&&!i),"pkt-link--icon-right":!!t&&i==="right","pkt-link--external":n};return l.jsxs("a",{...h,className:Z(c,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(q,{name:t,className:"pkt-link__icon"}),r]})};Ai.displayName="PktLink";const Ac=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Oi=({item:s,className:t})=>"href"in s?l.jsx(Ai,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:Z("pkt-user-menu__link",t),children:s.title}):l.jsxs("button",{className:Z("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",t),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&l.jsx(q,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),Oc=({links:s})=>l.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((t,e)=>l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:t})},e))}),Pc=_.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const c=i==null?void 0:i.map(Ac);return l.jsx("nav",{className:"pkt-user-menu",ref:h,"aria-label":"Meny for innlogget bruker",children:l.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),t&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:t})]})]}),c&&c.length>0&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Oc,{links:c})}),e&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:e.name}),e.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",e.orgNumber]}),n&&a&&l.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})]}),!e&&n&&a&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx("ul",{className:"pkt-user-menu__sublist",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})}),r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Oi,{item:{title:"Logg ut",iconName:"exit",onClick:r}})})]})})}),ti=_.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:c=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:$=null,hasError:b=!1,errorMessage:k,disabled:x=!1,inline:T=!1,ariaDescribedby:S,useWrapper:A=!0,children:I,className:O="",hasFieldset:R=!1,role:et="group",counterPosition:Ot="bottom"},Nt)=>{const[it,kt]=_.useState(!1),zt=S||(e?`${s}-helptext`:void 0),Et=!!a,dt=Et&&Ot==="top",ae=Et&&Ot==="bottom",fe=()=>kt(ut=>!ut),V=["pkt-inputwrapper",O,b?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),xt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Gt=()=>Et?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,$e=()=>l.jsxs(l.Fragment,{children:[$&&l.jsx("span",{className:xt+" pkt-tag--gray",children:$}),c&&l.jsx("span",{className:xt+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:xt+" pkt-tag--beige",children:v})]}),ge=()=>{const ut=l.jsxs(l.Fragment,{children:[t," ",$e()]});return A?R?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ut}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":zt,id:`${s}-label`,children:ut}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":zt,id:`${s}-label`,children:t})},re=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&A&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(pe,{skin:"tertiary",size:"small",variant:"icon-right",iconName:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:fe,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${it?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Bt=l.jsxs(l.Fragment,{children:[ge(),re(),dt&&l.jsx(Gt,{}),I,ae&&l.jsx(Gt,{}),b&&k&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(an,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:k})})]});return l.jsx("div",{className:V,ref:Nt,role:et,children:R?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":zt,children:Bt}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Bt})})});ti.displayName="PktInputWrapper";const rn=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:c,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:$,iconNameRight:b,inline:k=!1,fullwidth:x=!1,label:T,name:S,optionalTag:A=!1,optionalText:I,requiredTag:O=!1,requiredText:R,tagText:et=null,placeholder:Ot,prefix:Nt,suffix:it,type:kt="text",useWrapper:zt=!0,omitSearchIcon:Et=!1,value:dt,minLength:ae,maxLength:fe,min:V,max:xt,step:Gt,size:$e,readonly:ge,required:re,dataTestid:Bt,onChange:ut,skipForwardTestid:_e=!1,...we},Zt)=>{const Ss=[r,"pkt-textinput"].join(" "),Ie=kt==="search"&&!b&&!Et,es=kt==="date"&&dt?dt.slice(0,10):dt,[ss,xe]=_.useState((dt==null?void 0:dt.length)||0),Xt=`${s}`,Se=`${Xt}-label`,is=e||Se,Mt=yt=>{var Cs,Le;n&&xe(((Le=(Cs=yt.currentTarget)==null?void 0:Cs.value)==null?void 0:Le.length)||0),ut&&ut(yt)};return _.useEffect(()=>{dt!==void 0&&xe((dt==null?void 0:dt.length)||0)},[dt]),l.jsx(ti,{ariaDescribedby:t,className:Ss,disabled:h,errorMessage:c,forId:Xt,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:$,inline:k,label:T,optionalTag:A,optionalText:I,requiredTag:O,requiredText:R,tagText:et,useWrapper:zt,counter:n,counterCurrent:ss,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Bt,"data-skip-forward-testid":_e?"true":void 0,children:[Nt&&l.jsx("div",{className:"pkt-input-prefix",children:Nt}),l.jsx("input",{...we,ref:Zt,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&ss>a?"pkt-input--counter-error":""}`,type:kt,name:`${S||s}`,value:es,id:Xt,placeholder:Ot,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":is,min:V,max:xt,onChange:Mt,step:Gt,minLength:ae,maxLength:fe,size:$e,required:re}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(q,{className:"pkt-input-suffix-icon",name:b}),Ie&&l.jsx(q,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(q,{className:"pkt-input-icon",name:b}),!it&&Ie&&l.jsx(q,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})}),Dc=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=_.useState(e);return _.useEffect(()=>{const a=s.current;if(!a)return;if(n(a.offsetWidth),typeof ResizeObserver>"u"){const h=()=>{a&&n(a.offsetWidth)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)}const r=new ResizeObserver(h=>{for(const c of h)c.borderBoxSize&&c.borderBoxSize.length>0?n(c.borderBoxSize[0].inlineSize):n(c.contentRect.width)});return r.observe(a),()=>{r.disconnect()}},[s]),i};function Ic(s){const t=_.useRef(0);_.useEffect(()=>{const e=document.body,i=document.documentElement;if(s){t.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(e.style.paddingRight=`${n}px`),e.style.position="fixed",e.style.top=`-${t.current}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",i.classList.add("is-scroll-locked")}else e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current});return()=>{s&&(e.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current}))}},[s])}const Pa=_.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,compact:i=!1,"data-mode":n,logOutButtonPlacement:a="none",logOut:r,openedMenu:h,showSearch:c=!1,onSearch:p,onSearchChange:m,searchValue:v,searchPlaceholder:$="Søk",representing:b,serviceLink:k,serviceClick:x,serviceName:T,user:S,userMenu:A,userMenuFooter:I,userOptions:O,canChangeRepresentation:R=!1,changeRepresentation:et,hideLogo:Ot=!1,logoLink:Nt,logoClick:it,position:kt="fixed",scrollBehavior:zt="hide"},Et)=>{const dt=kt==="fixed",ae=zt==="hide";_.useEffect(()=>{I&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[I]),_.useEffect(()=>{O&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[O]),_.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),b!=null&&b.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,b==null?void 0:b.shortname]);const fe=_.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[V,xt]=_.useState(h||"none"),[Gt,$e]=_.useState(!1),[ge,re]=_.useState(0),[Bt,ut]=_.useState(!1),[_e,we]=_.useState(!1),Zt=_.useRef(null),Ss=_.useRef(null),Ie=_.useRef(null),es=_.useRef(null),ss=_.useRef(null),xe=_.useRef(null),Xt=_.useRef(null),Se=_.useRef(!1),is=Dc(Zt),Mt=is<s,yt=is<t,Cs=_.useCallback(j=>{Zt.current=j,typeof Et=="function"?Et(j):Et&&(Et.current=j)},[Et]);Ic(dt&&Mt&&V!=="none");const Le=_.useCallback((j,Pt)=>{const f=j.relatedTarget;let u;switch(Pt){case"user":u=Ss;break;case"slot":u=Ie;break;case"search":u=es;break;default:return}const g=u.current;g&&(!f||!g.contains(f))&&xt("none")},[]),si=_.useCallback(()=>{Se.current&&Xt.current&&document.contains(Xt.current)&&Xt.current.focus(),Xt.current=null,Se.current=!1},[]);_.useEffect(()=>{const j=f=>{S&&V==="user"&&!f.target.closest(".pkt-header-service__user-container")&&xt("none"),V==="slot"&&!f.target.closest(".pkt-header-service__slot-container")&&xt("none"),V==="search"&&!f.target.closest(".pkt-header-service__search-container")&&!f.target.closest(".pkt-header-service__search-input")&&xt("none")},Pt=f=>{f.key==="Escape"&&V!=="none"&&(f.preventDefault(),Se.current=!0,xt("none"))};if(V!=="none")return document.addEventListener("mousedown",j),document.addEventListener("keydown",Pt),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",Pt)};si()},[V,S,si]),_.useEffect(()=>{const j=()=>{if(ae){const Pt=window.pageYOffset||document.documentElement.scrollTop;if(Pt<0||Math.abs(Pt-ge)<60)return;$e(Pt>ge),re(Pt)}};return document&&window.addEventListener("scroll",j),()=>{document&&window.removeEventListener("scroll",j)}},[ae,ge]);const Pi=_.useCallback(j=>{const Pt=j==="slot"?Ie:es,f=j==="slot"?ss:xe;if(!Pt.current||!f.current||!yt||Mt)return;const u=Pt.current.getBoundingClientRect(),g=f.current.offsetWidth,w=u.left+g>window.innerWidth;j==="slot"?ut(w):we(w)},[yt,Mt]),Ts=_.useCallback(j=>{V!=="none"?xt("none"):(Xt.current=document.activeElement,xt(j))},[V]);_.useEffect(()=>{(V==="slot"||V==="search")&&requestAnimationFrame(()=>{Pi(V)})},[V,Pi]);const ii=l.jsxs("header",{className:Z("pkt-header-service",i&&"pkt-header-service--compact",Mt&&"pkt-header-service--mobile",yt&&"pkt-header-service--tablet",dt&&"pkt-header-service--fixed",ae&&"pkt-header-service--scroll-to-hide",Gt&&"pkt-header-service--hidden"),"data-mode":n,ref:Cs,children:[l.jsxs("div",{className:Z("pkt-header-service__logo-area",(!T||T==="")&&"pkt-header-service__logo-area--without-service"),children:[!Ot&&l.jsx("span",{className:"pkt-header-service__logo",children:Nt?l.jsx("a",{href:Nt,"aria-label":"Tilbake til forside",children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.1/logos/"})}):it?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:it,children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.1/logos/"})}):l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.1/logos/"})}),T&&l.jsx("span",{className:"pkt-header-service__service-name",children:k?l.jsx(Ai,{href:k,className:"pkt-header-service__service-link ",children:T}):x?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:x,children:T}):l.jsx("span",{className:"pkt-header-service__service-link",children:T})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:Z("pkt-header-service__slot-container",V==="slot"&&"is-open"),onBlur:j=>Le(j,"slot"),ref:Ie,children:[yt&&e&&l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"menu",size:Mt?"small":"medium",state:V==="slot"?"active":"normal",onClick:()=>Ts("slot"),"aria-expanded":V==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:"Meny"}),l.jsx("div",{className:Z("pkt-header-service__slot-content",Bt&&"align-right"),id:"mobile-slot-menu",role:yt?"menu":void 0,"aria-label":yt?"Meny":void 0,ref:ss,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),c&&l.jsx(l.Fragment,{children:yt?l.jsxs("div",{className:Z("pkt-header-service__search-container",V==="search"&&"is-open"),onBlur:j=>Le(j,"search"),ref:es,children:[l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:Mt?"small":"medium",onClick:()=>Ts("search"),state:V==="search"?"active":"normal","aria-expanded":V==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:Z("pkt-header-service__mobile-menu",V==="search"&&"is-open",_e&&"align-right"),ref:xe,children:V==="search"&&l.jsx(rn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:v,autoFocus:!0,fullwidth:!0,onChange:j=>m==null?void 0:m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(p==null||p(j.target.value))}})})]}):l.jsx(rn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:v,onChange:j=>m==null?void 0:m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(p==null||p(j.target.value))}})}),yt&&r&&(a==="header"||a==="both")&&l.jsx(pe,{skin:"secondary",size:Mt?"small":"medium",variant:"icon-only",iconName:"exit",onClick:r,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:j=>Le(j,"user"),ref:Ss,children:[l.jsxs(pe,{className:Z("pkt-header-service__user-button",Mt&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:Mt?"small":"medium",state:V==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:V==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Ts("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),V==="user"&&S&&l.jsx("div",{className:Z(Mt?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(Pc,{user:S,formattedLastLoggedIn:fe,representing:b,userMenu:A,canChangeRepresentation:R,changeRepresentation:et,logoutOnClick:a==="userMenu"||a==="both"?r:void 0})})]}),!Mt&&r&&(a==="header"||a==="both")&&l.jsx(pe,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:r,children:"Logg ut"})]})]});return dt?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[ii,l.jsx("div",{className:Z("pkt-header-service-spacer",i&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",Mt&&"pkt-header-service-spacer--mobile",yt&&"pkt-header-service-spacer--tablet")})]}):ii}),Da=_.forwardRef((s,t)=>l.jsx(Pa,{...s,ref:t}));Da.displayName="PktHeader";const Lc=Jt({tagName:"pkt-heading",elementClass:Ae,react:_,displayName:"PktHeading"}),Ia=_.forwardRef(({children:s,...t},e)=>l.jsx(Lc,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Ia.displayName="PktHeading";const Bc=Jt({tagName:"pkt-helptext",elementClass:ve,react:_,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),La=_.forwardRef(({children:s,...t},e)=>l.jsx(Bc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));La.displayName="PktHelptext";const Ba=_.forwardRef(({label:s,id:t,children:e,...i},n)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:t,...i,ref:n}),e]}));Ba.displayName="PktInput";const Fa=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...c})=>{const p=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...c,href:i,className:Z(p,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(q,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:Z(m),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};Fa.displayName="PktLinkCard";const Fc=Jt({tagName:"pkt-loader",elementClass:ie,react:_,displayName:"PktLoader",events:{}}),ja=_.forwardRef(({children:s,...t},e)=>l.jsx(Fc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));ja.displayName="PktLoader";const Ha=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[c,p]=_.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":c},v=_.createRef(),$=_.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:Z(m,t),ref:v,children:[a&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:$,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(q,{name:"close",className:"pkt-link__icon"})})}),i&&l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};Ha.displayName="PktMessagebox";const jc=Jt({tagName:"pkt-modal",elementClass:Vt,react:_,displayName:"PktModal",events:{}}),Va=_.forwardRef(({children:s,...t},e)=>l.jsx(jc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Va.displayName="PktModal";const Hc=Jt({tagName:"pkt-progressbar",elementClass:ct,react:_,displayName:"PktProgressbar",events:{}}),Ua=_.forwardRef(({children:s,...t},e)=>l.jsx(Hc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ua.displayName="PktProgressbar";const za=_.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:c,checked:p,optionalTag:m,optionalText:v,requiredTag:$,requiredText:b,tagText:k,...x},T)=>{const S=[i,"pkt-input-check"].filter(Boolean).join(" "),A=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),I=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),O=["pkt-input-check__input-label",a?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),R=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),et=()=>l.jsxs(l.Fragment,{children:[k&&l.jsx("span",{className:R+" pkt-tag--gray",children:k}),m&&l.jsx("span",{className:R+" pkt-tag--blue-light",children:v}),$&&l.jsx("span",{className:R+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:S,children:l.jsxs("div",{className:A,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:I,...p!==void 0?{checked:p}:{defaultChecked:c},...x}),l.jsxs("label",{className:O,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});za.displayName="PktRadioButton";const Vc=_.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:n,name:a,placeholder:r="Søk…",suggestions:h,value:c="",action:p,method:m,onChange:v,onSearch:$,onSuggestionClick:b,...k},x)=>{const T=(O,R)=>{O?O():b&&b(R)},S=O=>{c=O.target.value},A=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let I;return p?I=O=>l.jsx("form",{role:"search",className:A,action:p,method:m,children:O}):I=O=>l.jsx("div",{role:"search",className:A,children:O}),I(l.jsxs(l.Fragment,{children:[n&&l.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),l.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${e?"pkt-input--fullwidth":""}`,type:"search",name:a||i,id:i,placeholder:r,defaultValue:c,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${i}-suggestions`,onChange:v||S,onKeyUp:$&&(O=>{O.key==="Enter"&&(O.preventDefault(),$(c))}),...k}),l.jsx(pe,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:t,onClick:$&&(O=>{O.preventDefault(),$(c)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((O,R)=>l.jsx("li",{children:_.createElement(O.href?"a":O.onClick?"button":"div",{href:O.href,className:`pkt-searchinput__suggestion ${O.onClick?"pkt-link-button":""} ${O.href||O.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:O.onClick?"button":void 0,onClick:()=>T(O.onClick,R),onKeyUp:et=>et.key==="Enter"&&T(O.onClick,R)},l.jsxs(l.Fragment,{children:[O.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:O.title}),O.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:O.text})]}))},`search-suggestion-${R}`))})]}))}),Uc=_.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:c,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:$=!1,label:b,name:k,optionalTag:x=!1,optionalText:T,requiredTag:S=!1,requiredText:A,tagText:I,...O},R)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(ti,{className:et,forId:`${m}-input`,label:b,helptext:h,helptextDropdown:c,helptextDropdownButton:p,optionalTag:x,optionalText:T,requiredTag:S,requiredText:A,tagText:I,hasError:r,errorMessage:a,disabled:n,inline:v,ariaDescribedby:s,children:l.jsx("select",{ref:R,className:`pkt-input ${$?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${m}-input`,name:k||m,...O,children:e})})}),zc=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)"}})}),qc=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"})]}),Wc=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"})]}),Rc=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:Z("pkt-step",t,`pkt-step--${e}`),"data-testid":"pkt-step",children:[l.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),l.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),l.jsx("span",{className:Z("pkt-step__indicator"),children:e==="current"?qc:e==="completed"?Wc:zc}),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})]})]}),Kc=_.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const c=Z(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=_.Children.map(e,(m,v)=>_.isValidElement(m)?_.cloneElement(m,{className:Z(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return l.jsx("ol",{"data-testid":"pkt-stepper",className:c,ref:h,...r,children:p})}),Yc=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:n,...a})=>l.jsx("table",{"data-testid":"pkt-table",className:Z(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...a,children:n}),Gc=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:Z(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Zc=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:Z(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Xc=({className:s,children:t,...e})=>l.jsx("thead",{className:Z(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),Jc=({className:s,children:t,...e})=>l.jsx("th",{className:Z(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),Qc=({className:s,children:t,...e})=>l.jsx("tr",{className:Z(s,"pkt-table__row",{}),role:"row",...e,children:t}),on=_.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:c,type:p,"aria-description":m,...v},$)=>{const[b,k]=_.useState(!1),x=_.useCallback(()=>{k(!0),c&&c()},[k]),T=_.useRef(null),[S,A]=_.useState("");_.useEffect(()=>{var et,Ot;A(((Ot=(et=T.current)==null?void 0:et.textContent)==null?void 0:Ot.trim())??"")},[s]);const I=_.useMemo(()=>{if(n&&!h)return S&&`Klikk for å fjerne ${S}`||m},[n,h,S,m]),O={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},R={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,"pkt-btn--icons-right-and-left":n&&!!r,"pkt-hide":b};return n?l.jsxs("button",{...v,className:Z(R,a),type:p,onClick:x,"aria-label":h,"aria-description":I,ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(q,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...v,className:Z(O,a),ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});on.displayName="PktTag";const ln=_.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:c=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:$,selectTab:b}=td(),x={"aria-selected":m?!!t:void 0,"aria-controls":a,role:m?"tab":void 0,onKeyUp:S=>$(c,S),onClick:S=>{b(c),i==null||i(S)},tabIndex:t||!m?void 0:-1,ref:S=>{v(c,S),typeof p=="function"?p(S):p&&(p.current=S)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(q,{name:n,className:"pkt-icon--small"}),s,r&&l.jsx(on,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...x,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:T}):l.jsx("button",{...x,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:T})});ln.displayName="PktTabItem";const qa=_.createContext(null),td=()=>{const s=_.useContext(qa);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},ed=_.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=_.useRef([]),h=s&&!t,p=n&&_.Children.count(n)>0?_.Children.count(n):(e==null?void 0:e.length)||0;_.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=k=>{const x=e==null?void 0:e[k];x!=null&&x.action&&x.action(k),i&&i(k)},v=(k,x)=>{var T,S;h&&(x.code==="ArrowLeft"&&k!==0&&((T=r.current[k-1])==null||T.focus()),x.code==="ArrowRight"&&k<p-1&&((S=r.current[k+1])==null||S.focus()),(x.code==="ArrowDown"||x.code==="Space")&&m(k))},$=(k,x)=>{r.current[k]=x},b=e==null?void 0:e.map((k,x)=>{var T,S;return l.jsx(ln,{active:k.active,href:k.href,onClick:()=>m(x),icon:k.icon,controls:k.controls,tag:(T=k.tag)==null?void 0:T.text,tagSkin:(S=k.tag)==null?void 0:S.skin,index:x,children:k.text},x)});return l.jsx(qa.Provider,{value:{arrowNav:h,registerTabRef:$,handleKeyPress:v,selectTab:m},children:l.jsx("div",{className:"pkt-tabs",ref:a,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:n||b})})})}),sd=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:c,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:$,fullwidth:b=!1,label:k,name:x,optionalTag:T=!1,optionalText:S,requiredTag:A=!1,requiredText:I,tagText:O=null,placeholder:R,rows:et,useWrapper:Ot=!0,onChange:Nt,value:it,autoComplete:kt="off",minLength:zt,maxLength:Et,readOnly:dt=!1,skipForwardTestid:ae=!1,...fe},V)=>{const xt=[a,"pkt-textinput","pkt-textarea"].join(" "),Gt=`${s}-input`,$e=`${Gt}-label`,ge=e||$e,[re,Bt]=_.useState(0),ut=_e=>{var we,Zt;if(i&&Bt(((Zt=(we=_e.currentTarget)==null?void 0:we.value)==null?void 0:Zt.length)||0),Nt)return Nt(_e)};return _.useEffect(()=>{it!==void 0&&Bt((it==null?void 0:it.length)||0)},[it]),l.jsx(ti,{ariaDescribedby:t,className:xt,disabled:r,errorMessage:h,forId:Gt,hasError:c,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:$,label:k,optionalTag:T,optionalText:S,requiredTag:A,requiredText:I,tagText:O,useWrapper:Ot,counter:i,counterCurrent:re,counterMaxLength:n,children:l.jsx("textarea",{ref:V,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${n&&re>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:Gt,placeholder:R,disabled:r,rows:et,"aria-labelledby":ge,"aria-invalid":c,"aria-errormessage":`${s}-error`,...fe,onChange:ut,value:it,autoComplete:kt,minLength:zt,maxLength:Et,"data-skip-forward-testid":ae?"true":void 0})})});var ws=window.CustomEvent;(!ws||typeof ws=="object")&&(ws=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ws.prototype=window.Event.prototype);function Wa(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function id(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,n){return!(t[i]===void 0||t[i]===n)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function ei(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function Ra(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function nd(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function hn(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Ka(s){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(e.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),a=0;a<n.length&&!(n[a].tagName&&n[a].shadowRoot&&(i=Ka(n[a].shadowRoot),i));a++);return i}function Ya(s){return s.isConnected||document.body.contains(s)}function Ga(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=W.formSubmitter;if(!e){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;e=n.activeElement}return!e||e.form!==t?null:e}function ad(s){if(!s.defaultPrevented){var t=s.target,e=W.imagemapUseValue,i=Ga(s);e===null&&i&&(e=i.value);var n=ei(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function Za(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",ad,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,i=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),n,a=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,a)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}Za.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Ya(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),W.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var e=document.createEvent("MouseEvents");e.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(e),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=Ka(this.dialog_)),Ra(document.activeElement),s&&s.focus()},updateZIndex:function(s,t){if(s<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!Ya(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!W.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");id(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,W.needsCentering(this.dialog_)?(W.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var t=new ws("close",{bubbles:!1,cancelable:!1});Wa(this.dialog_,t)}};var W={};if(W.reposition=function(s){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(t,e)+"px"},W.isInlinePositionSetByStylesheet=function(s){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],i=null;try{i=e.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var a=i[n],r=null;try{r=document.querySelectorAll(a.selectorText)}catch{}if(!(!r||!nd(r,s))){var h=a.style.getPropertyValue("top"),c=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||c&&c!=="auto")return!0}}}return!1},W.needsCentering=function(s){var t=window.getComputedStyle(s);return t.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!W.isInlinePositionSetByStylesheet(s)},W.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new Za(s)},W.registerDialog=function(s){s.showModal||W.forceRegisterDialog(s)},W.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(t){this.forwardTab_=void 0,t.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var e=[];t.forEach(function(i){for(var n=0,a;a=i.removedNodes[n];++n){if(a instanceof Element)a.localName==="dialog"&&e.push(a);else continue;e=e.concat(a.querySelectorAll("dialog"))}}),e.length&&s(e)}))},W.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},W.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},W.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--s,--s),t===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},W.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=ei(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},W.DialogManager.prototype.handleFocus_=function(s){var t=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),Ra(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,n=i.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},W.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new ws("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&Wa(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},W.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},W.DialogManager.prototype.pushDialog=function(s){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},W.DialogManager.prototype.removeDialog=function(s){var t=this.pendingDialogStack.indexOf(s);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},W.dm=new W.DialogManager,W.formSubmitter=null,W.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Xa=document.createElement("form");if(Xa.setAttribute("method","dialog"),Xa.method!=="dialog"){var xs=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(xs){var rd=xs.get;xs.get=function(){return hn(this)?"dialog":rd.call(this)};var od=xs.set;xs.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):od.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",xs)}}document.addEventListener("click",function(s){if(W.formSubmitter=null,W.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!hn(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;W.imagemapUseValue=s.offsetX+","+s.offsetY}var n=ei(t);n&&(W.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=ei(t);if(!e){var i=Ga(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var ld=HTMLFormElement.prototype.submit,hd=function(){if(!hn(this))return ld.call(this);var s=ei(this);s&&s.close()};HTMLFormElement.prototype.submit=hd}const cd=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=pn,P.PktAccordionItem=Ca,P.PktAlert=an,P.PktBackLink=Na,P.PktBreadcrumbs=Sc,P.PktButton=pe,P.PktCard=Ea,P.PktCheckbox=Ma,P.PktCombobox=Aa,P.PktConsent=Mi,P.PktDatepicker=Oa,P.PktFooter=Ec,P.PktFooterSimple=Mc,P.PktHeader=Da,P.PktHeaderService=Pa,P.PktHeading=Ia,P.PktHelptext=La,P.PktIcon=q,P.PktInput=Ba,P.PktInputWrapper=ti,P.PktLink=Ai,P.PktLinkCard=Fa,P.PktLoader=ja,P.PktMessagebox=Ha,P.PktModal=Va,P.PktProgressbar=Ua,P.PktRadioButton=za,P.PktSearchInput=Vc,P.PktSelect=Uc,P.PktStep=Rc,P.PktStepper=Kc,P.PktTabItem=ln,P.PktTable=Yc,P.PktTableBody=Gc,P.PktTableDataCell=Zc,P.PktTableHeader=Xc,P.PktTableHeaderCell=Jc,P.PktTableRow=Qc,P.PktTabs=ed,P.PktTag=on,P.PktTextarea=sd,P.PktTextinput=rn,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|
|
1715
|
+
*/var Ta;function _c(){return Ta||(Ta=1,(function(s){(function(){var t={}.hasOwnProperty;function e(){for(var a="",r=0;r<arguments.length;r++){var h=arguments[r];h&&(a=n(a,i(h)))}return a}function i(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return e.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var r="";for(var h in a)t.call(a,h)&&a[h]&&(r=n(r,h));return r}function n(a,r){return r?a?a+" "+r:a+r:a}s.exports?(e.default=e,s.exports=e):window.classNames=e})()})(nn)),nn.exports}var wc=_c();const Z=$c(wc),an=({children:s,closeAlert:t,compact:e,title:i,date:n,ariaLive:a,"aria-live":r="polite",role:h="status",skin:c="info",className:p,...m})=>{const[v,$]=_.useState(!1),b={"pkt-alert":!0,"pkt-alert--compact":e,[`pkt-alert--${c}`]:c,"pkt-hide":v},k={"pkt-alert__grid":!0,"pkt-alert__noTitle":!i,"pkt-alert__noDate":!n},x=_.useCallback(()=>{$(!0),m.onClose&&m.onClose(new CustomEvent("close",{detail:{origin:event},bubbles:!0,composed:!0}))},[m.onClose,$]),T=a||r;return l.jsx("div",{...m,"aria-live":T,role:h,className:Z(b,p),children:l.jsxs("div",{className:Z(k),children:[l.jsx(q,{className:"pkt-alert__icon","aria-hidden":"true",name:c==="info"?"alert-information":`alert-${c}`}),t&&l.jsx("div",{className:"pkt-alert__close",children:l.jsx(pe,{tabIndex:0,"aria-label":"close",size:e?"small":"medium",type:"button",skin:"tertiary",iconName:"close",variant:"icon-only",onClick:x,children:l.jsx("span",{className:"sr-only",children:"Lukk"})})}),i&&l.jsx("div",{className:"pkt-alert__title",children:i}),l.jsx("div",{className:"pkt-alert__text",children:s}),n&&l.jsxs("div",{className:"pkt-alert__date",children:["Sist oppdatert: ",n]})]})})};an.displayName="PktAlert";const Na=Jt({tagName:"pkt-backlink",elementClass:ds,react:_,displayName:"PktBackLink"});Na.displayName="PktBackLink";const xc=_.forwardRef(({breadcrumbs:s,navigationType:t,className:e,...i},n)=>{const a=s,r=a[a.length-2],h=[e,"pkt-breadcrumbs"].filter(Boolean).join(" ");return l.jsxs("nav",{ref:n,"aria-label":"brødsmulemeny",className:h,children:[l.jsx("ol",{className:"pkt-breadcrumbs__list pkt-breadcrumbs--desktop",children:a.map((c,p)=>l.jsx("li",{className:"pkt-breadcrumbs__item",children:p===a.length-1?l.jsx("span",{className:"pkt-breadcrumbs__label","aria-current":"true",children:l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})}):t==="router"?l.jsxs(dn.Link,{to:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]}):l.jsxs("a",{href:c.href,className:"pkt-link pkt-link--icon-right pkt-breadcrumbs__label pkt-breadcrumbs__link",...i,children:[l.jsx(q,{className:"pkt-icon pkt-breadcrumbs__icon pkt-link__icon",name:"chevron-thin-right"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:c.text})]})},`breadcrumb-${p}`))}),t==="router"?l.jsxs(dn.Link,{to:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]}):l.jsxs("a",{href:r.href,className:"pkt-link pkt-link--icon-left pkt-breadcrumbs--mobile",...i,children:[l.jsx(q,{className:"pkt-back-link__icon pkt-icon pkt-link__icon",name:"chevron-thin-left"}),l.jsx("span",{className:"pkt-breadcrumbs__text",children:r.text})]})]})});window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/14.2/animations/";const pe=_.forwardRef(({children:s,className:t,iconName:e="user",secondIconName:i="user",iconPath:n,secondIconPath:a,size:r="medium",fullWidth:h=!1,fullWidthOnMobile:c=!1,skin:p="primary",type:m="button",variant:v="label-only",state:$,color:b,isLoading:k=void 0,disabled:x=void 0,loadingAnimationPath:T=window.pktAnimationPath,...S},A)=>{const I=[t,"pkt-btn",r&&`pkt-btn--${r}`,h&&"pkt-btn--full",c&&"pkt-btn--full-small",p&&`pkt-btn--${p}`,v&&`pkt-btn--${v}`,b&&`pkt-btn--${b}`,$&&`pkt-btn--${$}`,k&&"pkt-btn--isLoading"].filter(Boolean).join(" ");return l.jsxs("button",{...S,"aria-busy":k||void 0,"aria-disabled":x||void 0,disabled:x,className:I,type:m,ref:A,children:[k&&l.jsx(q,{className:"pkt-btn__icon pkt-btn__spinner",name:"spinner-blue",path:T}),v!=="label-only"&&l.jsx(q,{className:"pkt-btn__icon",name:e,...n&&{path:n}}),l.jsx("span",{className:"pkt-btn__text",children:s}),v==="icons-right-and-left"&&l.jsx(q,{className:"pkt-btn__icon",name:i,...a&&{path:a}})]})});pe.displayName="PktButton";const Sc=Jt({tagName:"pkt-card",elementClass:ft,react:_,displayName:"PktCard",events:{}}),Ea=_.forwardRef(({children:s,...t},e)=>l.jsx(Sc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ea.displayName="PktCard";const Ma=_.forwardRef(({id:s,hasTile:t=!1,disabled:e=!1,label:i,checkHelptext:n,hasError:a=!1,className:r,isSwitch:h=!1,hideLabel:c=!1,labelPosition:p="right",defaultChecked:m,checked:v,indeterminate:$,optionalTag:b,optionalText:k="Valgfritt",requiredTag:x,requiredText:T="Må fylles ut",tagText:S,...A},I)=>{const O=_.useRef(null);_.useEffect(()=>{O.current&&$!==void 0&&(O.current.indeterminate=$)},[$]),_.useEffect(()=>{typeof I=="function"?I(O.current):I&&(I.current=O.current)},[I]);const R=[r,"pkt-input-check"].filter(Boolean).join(" "),et=["pkt-input-check__input-label",e?"pkt-input-check__input-label--disabled":"",`pkt-input-check__input-label--${p}`,c?"pkt-sr-only":""].filter(Boolean).join(" "),Ot=["pkt-input-check__input",t?"pkt-input-check__input--tile":"",e&&t?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),Nt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),it=()=>l.jsxs(l.Fragment,{children:[S&&l.jsx("span",{className:Nt+" pkt-tag--gray",children:S}),b&&l.jsx("span",{className:Nt+" pkt-tag--blue-light",children:k}),x&&l.jsx("span",{className:Nt+" pkt-tag--beige",children:T})]});return l.jsx("div",{className:R,children:l.jsxs("div",{className:Ot,children:[p==="left"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]}),l.jsx("input",{role:h?"switch":"checkbox",ref:O,className:`pkt-input-check__input-checkbox ${a?"pkt-input-check__input-checkbox--error":""}`,type:"checkbox",id:s,disabled:e,...v!==void 0?{checked:v}:{defaultChecked:m},...A}),p==="right"&&l.jsxs("label",{className:et,htmlFor:s,children:[i," ",it(),n&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:n})]})]})})});Ma.displayName="PktCheckbox";const Cc=Jt({tagName:"pkt-combobox",elementClass:nt,react:_,displayName:"PktCombobox",events:{onClick:"click",onChange:"change",onInput:"input",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Aa=_.forwardRef(({children:s,helptext:t,...e},i)=>l.jsxs(Cc,{...e,ref:i,children:[t&&l.jsx("div",{slot:"helptext",className:"pkt-contents",children:t}),s]}));Aa.displayName="PktCombobox";const Mi=Jt({tagName:"pkt-consent",elementClass:Kt,react:_,displayName:"PktConsent",events:{onToggleConsent:"toggle-consent"}});Mi.displayName="PktConsent";const Tc=Jt({tagName:"pkt-datepicker",elementClass:ht,react:_,displayName:"PktDatepicker",events:{onChange:"change",onBlur:"blur",onFocus:"focus",onValueChange:"value-change",onToggleHelpText:"toggleHelpText"}}),Oa=_.forwardRef(({helptext:s,...t},e)=>l.jsx(Tc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",slot:"helptext",children:s})}));Oa.displayName="PktDatepicker";const Nc=({columnOne:s,columnTwo:t,socialLinks:e,className:i,openLinksInNewTab:n=!1,personvernOgInfoLink:a="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:r="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:h=!1,hotjarId:c=null,googleAnalyticsId:p=null,devMode:m=!1,cookieDomain:v=null,cookieSecure:$=null,cookieExpiryDays:b=null,onToggleConsent:k=x=>{console.log(x.detail)}})=>{var T,S;const x=[i,"pkt-footer"].filter(Boolean).join(" ");return l.jsx("footer",{className:x,"data-mode":"dark",children:l.jsxs("div",{className:"pkt-footer__container",children:[l.jsxs("div",{className:"pkt-grid pkt-grid--rowgap-size-32 pkt-grid--gap-size-16",children:[l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:s.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[s.text&&l.jsx("li",{className:"pkt-footer__text",children:s.text}),(T=s.links)==null?void 0:T.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:t.title}),l.jsxs("ul",{className:"pkt-footer__list",children:[t.text&&l.jsx("li",{className:"pkt-footer__text",children:t.text}),(S=t.links)==null?void 0:S.map((A,I)=>l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:`pkt-footer__link ${A.external?"pkt-link--external":""}`,href:A.href,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),A.text]})},`links-${I}`))]})]}),l.jsxs("div",{className:"pkt-footer__column pkt-cell pkt-cell--span12 pkt-cell--span4-laptop-up",children:[l.jsx("h2",{className:"pkt-footer__title",children:"Om nettstedet"}),l.jsxs("ul",{className:"pkt-footer__list",children:[l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:a,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer__list-item",children:l.jsxs("a",{className:"pkt-footer__link",href:r,target:n?"_blank":"_self",rel:n?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),h&&l.jsx("li",{className:"pkt-footer__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:c,googleAnalyticsId:p,devMode:m,cookieDomain:v,cookieSecure:$,cookieExpiryDays:b,onToggleConsent:k})})]})]})]}),e&&l.jsxs("div",{className:"pkt-footer__social","aria-label":"standard lenker",children:[l.jsx("div",{className:"pkt-footer__social-languages",children:e.filter(A=>A.language).map((A,I)=>l.jsx("div",{className:"pkt-footer__social-language",children:l.jsx("a",{href:A.href,"aria-label":`til ${A.language} versjon av nettsiden`,target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:A.language})},`sociallinks-language-${I}`))}),l.jsx("div",{className:"pkt-footer__social-icons",children:e.filter(A=>A.iconName).map((A,I)=>l.jsx(_.Fragment,{children:l.jsx("a",{href:A.href,"aria-label":`til ${A.iconName}`,className:"pkt-footer__social-icon-link",target:A.openInNewTab||n?"_blank":"_self",rel:A.openInNewTab||n?"noopener noreferrer":void 0,children:l.jsx(q,{className:"pkt-footer__social-icon",name:A.iconName})})},`sociallinks-${I}`))})]})]})})},Ec=({links:s=[],openLinksInNewTab:t=!1,personvernOgInfoLink:e="https://www.oslo.kommune.no/personvern-og-informasjonskapsler/",tilgjengelighetLink:i="https://www.oslo.kommune.no/tilgjengelighet/",includeConsent:n=!1,hotjarId:a=null,googleAnalyticsId:r=null,devMode:h=!1,cookieDomain:c=null,cookieSecure:p=null,cookieExpiryDays:m=null,onToggleConsent:v=b=>{console.log(b.detail)},className:$})=>{const b=[$,"pkt-footer-simple"].filter(Boolean).join(" ");return l.jsx("footer",{className:b,"data-mode":"dark",children:l.jsx("div",{className:"pkt-footer-simple__container",children:l.jsxs("ul",{className:"pkt-footer-simple__list",children:[s.map((k,x)=>l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:`pkt-footer-simple__link ${k.external?" pkt-link--external":""}`,href:k.href,target:k.openInNewTab||t?"_blank":"_self",rel:k.openInNewTab||t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),k.text]})},x)),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:e,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Personvern og informasjonskapsler"]})}),l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsxs("a",{className:"pkt-footer-simple__link",href:i,target:t?"_blank":"_self",rel:t?"noopener noreferrer":void 0,children:[l.jsx(q,{className:"pkt-footer-simple__link-icon",name:"chevron-right"}),"Tilgjengelighet"]})}),n&&l.jsx("li",{className:"pkt-footer-simple__list-item",children:l.jsx(Mi,{triggerType:"footerlink",hotjarId:a,googleAnalyticsId:r,devMode:h,cookieDomain:c,cookieSecure:p,cookieExpiryDays:m,onToggleConsent:v})})]})})})},Ai=({href:s,iconName:t,className:e,iconPosition:i,external:n,target:a,children:r,...h})=>{const c={"pkt-link":!0,"pkt-link--icon-left":!!t&&i==="left"||!!(t&&!i),"pkt-link--icon-right":!!t&&i==="right","pkt-link--external":n};return l.jsxs("a",{...h,className:Z(c,e),href:s,target:a,rel:n?"noopener noreferrer":void 0,children:[t&&l.jsx(q,{name:t,className:"pkt-link__icon"}),r]})};Ai.displayName="PktLink";const Mc=s=>typeof s.target=="string"?{title:s.title,iconName:s.iconName,href:s.target}:{title:s.title,iconName:s.iconName,onClick:s.target},Oi=({item:s,className:t})=>"href"in s?l.jsx(Ai,{iconName:s.iconName,href:s.href,"aria-hidden":"true",className:Z("pkt-user-menu__link",t),children:s.title}):l.jsxs("button",{className:Z("pkt-user-menu__link pkt-link-button pkt-link pkt-link--icon-left",t),type:"button",onClick:()=>{"onClick"in s&&typeof s.onClick=="function"?s.onClick():console.error("UserMenuButton item is missing onClick handler or onClick is not a function:",s)},children:[s.iconName&&l.jsx(q,{name:s.iconName,className:"pkt-link__icon","aria-hidden":"true"}),s.title]}),Ac=({links:s})=>l.jsx("ul",{className:"pkt-user-menu__sublist",children:s.map((t,e)=>l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:t})},e))}),Oc=_.forwardRef(({user:s,formattedLastLoggedIn:t,representing:e,userMenu:i,canChangeRepresentation:n,changeRepresentation:a,logoutOnClick:r},h)=>{const c=i==null?void 0:i.map(Mc);return l.jsx("nav",{className:"pkt-user-menu",ref:h,"aria-label":"Meny for innlogget bruker",children:l.jsxs("ul",{className:"pkt-user-menu__list",children:[s&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:s.name}),t&&l.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",l.jsx("time",{children:t})]})]}),c&&c.length>0&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Ac,{links:c})}),e&&l.jsxs("li",{className:"pkt-user-menu__item",children:[l.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),l.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:e.name}),e.orgNumber&&l.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",e.orgNumber]}),n&&a&&l.jsx("ul",{className:"pkt-user-menu__sublist mt-size-16",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})]}),!e&&n&&a&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx("ul",{className:"pkt-user-menu__sublist",children:l.jsx("li",{className:"pkt-user-menu__subitem",children:l.jsx(Oi,{item:{title:"Endre organisasjon",iconName:"cogwheel",onClick:a}})})})}),r&&l.jsx("li",{className:"pkt-user-menu__item",children:l.jsx(Oi,{item:{title:"Logg ut",iconName:"exit",onClick:r}})})]})})}),ti=_.forwardRef(({forId:s,label:t,helptext:e,helptextDropdown:i,helptextDropdownButton:n,counter:a,counterCurrent:r=0,counterMaxLength:h,optionalTag:c=!1,optionalText:p="Valgfritt",requiredTag:m=!1,requiredText:v="Må fylles ut",tagText:$=null,hasError:b=!1,errorMessage:k,disabled:x=!1,inline:T=!1,ariaDescribedby:S,useWrapper:A=!0,children:I,className:O="",hasFieldset:R=!1,role:et="group",counterPosition:Ot="bottom"},Nt)=>{const[it,kt]=_.useState(!1),qt=S||(e?`${s}-helptext`:void 0),Et=!!a,dt=Et&&Ot==="top",ae=Et&&Ot==="bottom",fe=()=>kt(ut=>!ut),V=["pkt-inputwrapper",O,b?"pkt-inputwrapper--error":"",x?"pkt-inputwrapper--disabled":"",T?"pkt-inputwrapper--inline":""].filter(Boolean).join(" "),xt=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),Gt=()=>Et?l.jsxs("div",{className:"pkt-input__counter","aria-live":"polite","aria-atomic":"true",children:[r,h?`/${h}`:""]}):null,$e=()=>l.jsxs(l.Fragment,{children:[$&&l.jsx("span",{className:xt+" pkt-tag--gray",children:$}),c&&l.jsx("span",{className:xt+" pkt-tag--blue-light",children:p}),m&&l.jsx("span",{className:xt+" pkt-tag--beige",children:v})]}),ge=()=>{const ut=l.jsxs(l.Fragment,{children:[t," ",$e()]});return A?R?l.jsx("legend",{className:"pkt-inputwrapper__legend",id:`${s}-label`,children:ut}):l.jsx("label",{className:"pkt-inputwrapper__label",htmlFor:s,"aria-describedby":qt,id:`${s}-label`,children:ut}):l.jsx("label",{htmlFor:s,className:"pkt-sr-only","aria-describedby":qt,id:`${s}-label`,children:t})},re=()=>!e&&!i?null:l.jsxs(l.Fragment,{children:[e&&A&&l.jsx("div",{className:"pkt-inputwrapper__helptext",id:`${s}-helptext`,children:e}),i&&l.jsxs("div",{className:"pkt-inputwrapper__helptext-expandable",children:[l.jsx(pe,{skin:"tertiary",size:"small",variant:"icon-right",iconName:it?"chevron-thin-up":"chevron-thin-down",className:"pkt-link pkt-link--icon-right",onClick:fe,children:l.jsx("span",{dangerouslySetInnerHTML:{__html:n??'Les mer <span class="pkt-sr-only">om inputfeltet</span>'}})}),l.jsx("div",{className:`pkt-inputwrapper__helptext ${it?"pkt-inputwrapper__helptext-expandable-open":"pkt-inputwrapper__helptext-expandable-closed"}`,children:i})]})]}),Ft=l.jsxs(l.Fragment,{children:[ge(),re(),dt&&l.jsx(Gt,{}),I,ae&&l.jsx(Gt,{}),b&&k&&l.jsx("div",{className:"pkt-inputwrapper__alert-wrapper",children:l.jsx(an,{skin:"error","aria-live":"assertive",role:"alert",id:`${s}-error`,compact:!0,children:k})})]});return l.jsx("div",{className:V,ref:Nt,role:et,children:R?l.jsx("fieldset",{className:"pkt-inputwrapper__fieldset","aria-describedby":qt,children:Ft}):l.jsx("div",{className:"pkt-inputwrapper__fieldset",children:Ft})})});ti.displayName="PktInputWrapper";const rn=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,autocomplete:i="off",counter:n,counterMaxLength:a,className:r,disabled:h=!1,errorMessage:c,hasError:p=!1,helptext:m,helptextDropdown:v,helptextDropdownButton:$,iconNameRight:b,inline:k=!1,fullwidth:x=!1,label:T,name:S,optionalTag:A=!1,optionalText:I,requiredTag:O=!1,requiredText:R,tagText:et=null,placeholder:Ot,prefix:Nt,suffix:it,type:kt="text",useWrapper:qt=!0,omitSearchIcon:Et=!1,value:dt,minLength:ae,maxLength:fe,min:V,max:xt,step:Gt,size:$e,readonly:ge,required:re,dataTestid:Ft,onChange:ut,skipForwardTestid:_e=!1,...we},Zt)=>{const Ss=[r,"pkt-textinput"].join(" "),Ie=kt==="search"&&!b&&!Et,es=kt==="date"&&dt?dt.slice(0,10):dt,[ss,xe]=_.useState((dt==null?void 0:dt.length)||0),Xt=`${s}`,Se=`${Xt}-label`,is=e||Se,Mt=yt=>{var Cs,Le;n&&xe(((Le=(Cs=yt.currentTarget)==null?void 0:Cs.value)==null?void 0:Le.length)||0),ut&&ut(yt)};return _.useEffect(()=>{dt!==void 0&&xe((dt==null?void 0:dt.length)||0)},[dt]),l.jsx(ti,{ariaDescribedby:t,className:Ss,disabled:h,errorMessage:c,forId:Xt,hasError:p,helptext:m,helptextDropdown:v,helptextDropdownButton:$,inline:k,label:T,optionalTag:A,optionalText:I,requiredTag:O,requiredText:R,tagText:et,useWrapper:qt,counter:n,counterCurrent:ss,counterMaxLength:a,children:l.jsxs("div",{className:"pkt-input__container","data-testid":Ft,"data-skip-forward-testid":_e?"true":void 0,children:[Nt&&l.jsx("div",{className:"pkt-input-prefix",children:Nt}),l.jsx("input",{...we,ref:Zt,className:`pkt-input ${x?"pkt-input--fullwidth":""} ${a&&ss>a?"pkt-input--counter-error":""}`,type:kt,name:`${S||s}`,value:es,id:Xt,placeholder:Ot,autoComplete:i,disabled:h,"aria-invalid":p,"aria-errormessage":`${s}-error`,"aria-labelledby":is,min:V,max:xt,onChange:Mt,step:Gt,minLength:ae,maxLength:fe,size:$e,required:re}),it&&l.jsxs("p",{className:"pkt-input-suffix",children:[it,b&&l.jsx(q,{className:"pkt-input-suffix-icon",name:b}),Ie&&l.jsx(q,{className:"pkt-input-suffix-icon",name:"magnifying-glass-big"})]}),!it&&b&&l.jsx(q,{className:"pkt-input-icon",name:b}),!it&&Ie&&l.jsx(q,{className:"pkt-input-icon",name:"magnifying-glass-big"})]})})}),Pc=(s,t)=>{const e=()=>typeof window>"u"?0:window.innerWidth,[i,n]=_.useState(e);return _.useEffect(()=>{const a=s.current;if(!a)return;if(n(a.offsetWidth),typeof ResizeObserver>"u"){const h=()=>{a&&n(a.offsetWidth)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)}const r=new ResizeObserver(h=>{for(const c of h)c.borderBoxSize&&c.borderBoxSize.length>0?n(c.borderBoxSize[0].inlineSize):n(c.contentRect.width)});return r.observe(a),()=>{r.disconnect()}},[s]),i};function Dc(s){const t=_.useRef(0);_.useEffect(()=>{const e=document.body,i=document.documentElement;if(s){t.current=window.scrollY||window.pageYOffset;const n=window.innerWidth-i.clientWidth;n>0&&(e.style.paddingRight=`${n}px`),e.style.position="fixed",e.style.top=`-${t.current}px`,e.style.left="0",e.style.right="0",e.style.width="100%",e.style.overflow="hidden",i.classList.add("is-scroll-locked")}else e.style.removeProperty("position"),e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("width"),e.style.removeProperty("overflow"),e.style.removeProperty("padding-right"),document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current});return()=>{s&&(e.style.cssText="",document.documentElement.classList.remove("is-scroll-locked"),window.scrollTo({top:t.current}))}},[s])}const Pa=_.forwardRef(({mobileBreakpoint:s=768,tabletBreakpoint:t=1280,children:e,compact:i=!1,"data-mode":n,logOutButtonPlacement:a="none",logOut:r,openedMenu:h,showSearch:c=!1,onSearch:p,onSearchChange:m,searchValue:v,searchPlaceholder:$="Søk",representing:b,serviceLink:k,serviceClick:x,serviceName:T,user:S,userMenu:A,userMenuFooter:I,userOptions:O,canChangeRepresentation:R=!1,changeRepresentation:et,hideLogo:Ot=!1,logoLink:Nt,logoClick:it,position:kt="fixed",scrollBehavior:qt="hide"},Et)=>{const dt=kt==="fixed",ae=qt==="hide";_.useEffect(()=>{I&&console.warn('PktHeaderService: The "userMenuFooter" prop is deprecated and will be removed in a future version. Please use "userMenu" instead.')},[I]),_.useEffect(()=>{O&&console.warn('PktHeaderService: The "userOptions" prop is no longer available. Please use "userMenu" instead.')},[O]),_.useEffect(()=>{S!=null&&S.shortname&&console.warn('PktHeaderService: The "shortname" property on the user object is deprecated and will be removed in a future version.'),b!=null&&b.shortname&&console.warn('PktHeaderService: The "shortname" property on the representing object is deprecated and will be removed in a future version.')},[S==null?void 0:S.shortname,b==null?void 0:b.shortname]);const fe=_.useMemo(()=>{if(S!=null&&S.lastLoggedIn)return typeof S.lastLoggedIn=="string"?S.lastLoggedIn:new Date(S.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"})},[S==null?void 0:S.lastLoggedIn]),[V,xt]=_.useState(h||"none"),[Gt,$e]=_.useState(!1),[ge,re]=_.useState(0),[Ft,ut]=_.useState(!1),[_e,we]=_.useState(!1),Zt=_.useRef(null),Ss=_.useRef(null),Ie=_.useRef(null),es=_.useRef(null),ss=_.useRef(null),xe=_.useRef(null),Xt=_.useRef(null),Se=_.useRef(!1),is=Pc(Zt),Mt=is<s,yt=is<t,Cs=_.useCallback(j=>{Zt.current=j,typeof Et=="function"?Et(j):Et&&(Et.current=j)},[Et]);Dc(dt&&Mt&&V!=="none");const Le=_.useCallback((j,Pt)=>{const f=j.relatedTarget;let u;switch(Pt){case"user":u=Ss;break;case"slot":u=Ie;break;case"search":u=es;break;default:return}const g=u.current;g&&(!f||!g.contains(f))&&xt("none")},[]),si=_.useCallback(()=>{Se.current&&Xt.current&&document.contains(Xt.current)&&Xt.current.focus(),Xt.current=null,Se.current=!1},[]);_.useEffect(()=>{const j=f=>{S&&V==="user"&&!f.target.closest(".pkt-header-service__user-container")&&xt("none"),V==="slot"&&!f.target.closest(".pkt-header-service__slot-container")&&xt("none"),V==="search"&&!f.target.closest(".pkt-header-service__search-container")&&!f.target.closest(".pkt-header-service__search-input")&&xt("none")},Pt=f=>{f.key==="Escape"&&V!=="none"&&(f.preventDefault(),Se.current=!0,xt("none"))};if(V!=="none")return document.addEventListener("mousedown",j),document.addEventListener("keydown",Pt),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",Pt)};si()},[V,S,si]),_.useEffect(()=>{const j=()=>{if(ae){const Pt=window.pageYOffset||document.documentElement.scrollTop;if(Pt<0||Math.abs(Pt-ge)<60)return;$e(Pt>ge),re(Pt)}};return document&&window.addEventListener("scroll",j),()=>{document&&window.removeEventListener("scroll",j)}},[ae,ge]);const Pi=_.useCallback(j=>{const Pt=j==="slot"?Ie:es,f=j==="slot"?ss:xe;if(!Pt.current||!f.current||!yt||Mt)return;const u=Pt.current.getBoundingClientRect(),g=f.current.offsetWidth,w=u.left+g>window.innerWidth;j==="slot"?ut(w):we(w)},[yt,Mt]),Ts=_.useCallback(j=>{V!=="none"?xt("none"):(Xt.current=document.activeElement,xt(j))},[V]);_.useEffect(()=>{(V==="slot"||V==="search")&&requestAnimationFrame(()=>{Pi(V)})},[V,Pi]);const ii=l.jsxs("header",{className:Z("pkt-header-service",i&&"pkt-header-service--compact",Mt&&"pkt-header-service--mobile",yt&&"pkt-header-service--tablet",dt&&"pkt-header-service--fixed",ae&&"pkt-header-service--scroll-to-hide",Gt&&"pkt-header-service--hidden"),"data-mode":n,ref:Cs,children:[l.jsxs("div",{className:Z("pkt-header-service__logo-area",(!T||T==="")&&"pkt-header-service__logo-area--without-service"),children:[!Ot&&l.jsx("span",{className:"pkt-header-service__logo",children:Nt?l.jsx("a",{href:Nt,"aria-label":"Tilbake til forside",children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.2/logos/"})}):it?l.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header-service__logo-link",onClick:it,children:l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.2/logos/"})}):l.jsx(q,{name:"oslologo","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/14.2/logos/"})}),T&&l.jsx("span",{className:"pkt-header-service__service-name",children:k?l.jsx(Ai,{href:k,className:"pkt-header-service__service-link ",children:T}):x?l.jsx("button",{className:"pkt-link-button pkt-link pkt-header-service__service-link",onClick:x,children:T}):l.jsx("span",{className:"pkt-header-service__service-link",children:T})})]}),l.jsxs("div",{className:"pkt-header-service__content",children:[l.jsxs("div",{className:Z("pkt-header-service__slot-container",V==="slot"&&"is-open"),onBlur:j=>Le(j,"slot"),ref:Ie,children:[yt&&e&&l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"menu",size:Mt?"small":"medium",state:V==="slot"?"active":"normal",onClick:()=>Ts("slot"),"aria-expanded":V==="slot","aria-controls":"mobile-slot-menu","aria-label":"Åpne meny",children:"Meny"}),l.jsx("div",{className:Z("pkt-header-service__slot-content",Ft&&"align-right"),id:"mobile-slot-menu",role:yt?"menu":void 0,"aria-label":yt?"Meny":void 0,ref:ss,children:l.jsx("div",{className:"pkt-contents",children:e})})]}),c&&l.jsx(l.Fragment,{children:yt?l.jsxs("div",{className:Z("pkt-header-service__search-container",V==="search"&&"is-open"),onBlur:j=>Le(j,"search"),ref:es,children:[l.jsx(pe,{skin:"secondary",variant:"icon-only",iconName:"magnifying-glass-big",size:Mt?"small":"medium",onClick:()=>Ts("search"),state:V==="search"?"active":"normal","aria-expanded":V==="search","aria-controls":"mobile-search-menu","aria-label":"Åpne søkefelt",children:"Søk"}),l.jsx("div",{className:Z("pkt-header-service__mobile-menu",V==="search"&&"is-open",_e&&"align-right"),ref:xe,children:V==="search"&&l.jsx(rn,{id:"mobile-search-menu",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:v,autoFocus:!0,fullwidth:!0,onChange:j=>m==null?void 0:m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(p==null||p(j.target.value))}})})]}):l.jsx(rn,{id:"header-service-search",className:"pkt-header-service__search-input",type:"search",label:"Søk",useWrapper:!1,placeholder:$,value:v,onChange:j=>m==null?void 0:m(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(p==null||p(j.target.value))}})}),yt&&r&&(a==="header"||a==="both")&&l.jsx(pe,{skin:"secondary",size:Mt?"small":"medium",variant:"icon-only",iconName:"exit",onClick:r,children:"Logg ut"})]}),l.jsxs("div",{className:"pkt-header-service__user",children:[S&&l.jsxs("div",{className:"pkt-header-service__user-container",onBlur:j=>Le(j,"user"),ref:Ss,children:[l.jsxs(pe,{className:Z("pkt-header-service__user-button",Mt&&"pkt-header-service__user-button--mobile"),skin:"secondary",size:Mt?"small":"medium",state:V==="user"?"active":"normal",variant:"icons-right-and-left",iconName:"user",secondIconName:V==="user"?"chevron-thin-up":"chevron-thin-down",onClick:()=>Ts("user"),children:[l.jsx("span",{className:"pkt-sr-only",children:"Brukermeny: "}),(b==null?void 0:b.name)||S.name]}),V==="user"&&S&&l.jsx("div",{className:Z(Mt?"pkt-header-service__mobile-menu":"pkt-header-service__user-menu","is-open"),children:l.jsx(Oc,{user:S,formattedLastLoggedIn:fe,representing:b,userMenu:A,canChangeRepresentation:R,changeRepresentation:et,logoutOnClick:a==="userMenu"||a==="both"?r:void 0})})]}),!Mt&&r&&(a==="header"||a==="both")&&l.jsx(pe,{skin:"tertiary",size:"medium",variant:"icon-right",iconName:"exit",onClick:r,children:"Logg ut"})]})]});return dt?l.jsxs("div",{className:"pkt-header-service-wrapper",children:[ii,l.jsx("div",{className:Z("pkt-header-service-spacer",i&&"pkt-header-service-spacer--compact",S&&"pkt-header-service-spacer--has-user",Mt&&"pkt-header-service-spacer--mobile",yt&&"pkt-header-service-spacer--tablet")})]}):ii}),Da=_.forwardRef((s,t)=>l.jsx(Pa,{...s,ref:t}));Da.displayName="PktHeader";const Ic=Jt({tagName:"pkt-heading",elementClass:Ae,react:_,displayName:"PktHeading"}),Ia=_.forwardRef(({children:s,...t},e)=>l.jsx(Ic,{"data-testid":"pkt-heading",...t,ref:e,children:s}));Ia.displayName="PktHeading";const Lc=Jt({tagName:"pkt-helptext",elementClass:ve,react:_,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),La=_.forwardRef(({children:s,...t},e)=>l.jsx(Lc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));La.displayName="PktHelptext";const Ba=_.forwardRef(({label:s,id:t,children:e,...i},n)=>l.jsxs("div",{className:"pkt-form-group",children:[l.jsx("label",{htmlFor:t,className:"pkt-form-label",children:s}),l.jsx("input",{className:"pkt-form-input",id:t,...i,ref:n}),e]}));Ba.displayName="PktInput";const Fa=({children:s,skin:t,title:e,href:i,iconName:n,openInNewTab:a,external:r,className:h,...c})=>{const p=["pkt-linkcard",t&&`pkt-linkcard--${t}`].filter(Boolean).join(" "),m=["pkt-linkcard__title",r&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return l.jsxs("a",{...c,href:i,className:Z(p,h),target:a?"_blank":"_self",rel:a?"noopener noreferrer":void 0,children:[n&&l.jsx(q,{className:"pkt-link__icon",name:n}),e&&l.jsx("div",{className:Z(m),children:e}),l.jsx("div",{className:"pkt-linkcard__text",children:s})]})};Fa.displayName="PktLinkCard";const Bc=Jt({tagName:"pkt-loader",elementClass:ie,react:_,displayName:"PktLoader",events:{}}),ja=_.forwardRef(({children:s,...t},e)=>l.jsx(Bc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));ja.displayName="PktLoader";const Ha=({children:s,className:t,skin:e,title:i,compact:n,closable:a,onClose:r,...h})=>{const[c,p]=_.useState(!1),m={"pkt-messagebox":!0,"pkt-messagebox--compact":n,[`pkt-messagebox--${e}`]:e,"pkt-messagebox--closable":a,"pkt-hide":c},v=_.createRef(),$=_.useCallback(()=>{p(!0),r&&r()},[p,r]);return l.jsxs("div",{...h,className:Z(m,t),ref:v,children:[a&&l.jsx("div",{className:"pkt-messagebox__close",children:l.jsx("button",{onClick:$,className:"pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only","aria-label":"Lukk",children:l.jsx(q,{name:"close",className:"pkt-link__icon"})})}),i&&l.jsx("div",{className:"pkt-messagebox__title",children:i}),l.jsx("div",{className:"pkt-messagebox__text",children:s})]})};Ha.displayName="PktMessagebox";const Fc=Jt({tagName:"pkt-modal",elementClass:Ut,react:_,displayName:"PktModal",events:{}}),Va=_.forwardRef(({children:s,...t},e)=>l.jsx(Fc,{...t,ref:e,children:l.jsx("div",{className:"pkt-contents",children:s})}));Va.displayName="PktModal";const jc=Jt({tagName:"pkt-progressbar",elementClass:ct,react:_,displayName:"PktProgressbar",events:{}}),Ua=_.forwardRef(({children:s,...t},e)=>l.jsx(jc,{ref:e,...t,children:l.jsx("div",{className:"pkt-contents",children:s})}));Ua.displayName="PktProgressbar";const za=_.forwardRef(({id:s,name:t,label:e,className:i,hasTile:n=!1,disabled:a=!1,checkHelptext:r,hasError:h=!1,defaultChecked:c,checked:p,optionalTag:m,optionalText:v,requiredTag:$,requiredText:b,tagText:k,...x},T)=>{const S=[i,"pkt-input-check"].filter(Boolean).join(" "),A=["pkt-input-check__input",n?"pkt-input-check__input--tile":"",a&&n?"pkt-input-check__input--tile-disabled":""].filter(Boolean).join(" "),I=["pkt-input-check__input-checkbox",h?"pkt-input-check__input-checkbox--error":""].filter(Boolean).join(" "),O=["pkt-input-check__input-label",a?"pkt-input-check__input-label--disabled":""].filter(Boolean).join(" "),R=["pkt-tag","pkt-tag--small","pkt-tag--thin-text"].join(" "),et=()=>l.jsxs(l.Fragment,{children:[k&&l.jsx("span",{className:R+" pkt-tag--gray",children:k}),m&&l.jsx("span",{className:R+" pkt-tag--blue-light",children:v}),$&&l.jsx("span",{className:R+" pkt-tag--beige",children:b})]});return l.jsx("div",{className:S,children:l.jsxs("div",{className:A,children:[l.jsx("input",{ref:T,id:s,type:"radio",name:t,disabled:a,className:I,...p!==void 0?{checked:p}:{defaultChecked:c},...x}),l.jsxs("label",{className:O,htmlFor:s,children:[e," ",et(),r&&l.jsx("div",{className:"pkt-input-check__input-helptext",children:r})]})]})})});za.displayName="PktRadioButton";const Hc=_.forwardRef(({appearance:s="local",disabled:t=!1,fullwidth:e=!1,id:i,label:n,name:a,placeholder:r="Søk…",suggestions:h,value:c="",action:p,method:m,onChange:v,onSearch:$,onSuggestionClick:b,...k},x)=>{const T=(O,R)=>{O?O():b&&b(R)},S=O=>{c=O.target.value},A=`pkt-searchinput pkt-searchinput--${s} ${e?"pkt-searchinput--fullwidth":""}`;let I;return p?I=O=>l.jsx("form",{role:"search",className:A,action:p,method:m,children:O}):I=O=>l.jsx("div",{role:"search",className:A,children:O}),I(l.jsxs(l.Fragment,{children:[n&&l.jsx("label",{htmlFor:n?i:void 0,className:n?"pkt-inputwrapper__label":"",children:n}),l.jsxs("div",{className:s==="local"?"pkt-input__container":"pkt-searchinput__field",children:[l.jsx("input",{className:`pkt-input ${e?"pkt-input--fullwidth":""}`,type:"search",name:a||i,id:i,placeholder:r,defaultValue:c,disabled:t,autoComplete:"off","aria-autocomplete":"list",ref:x,"aria-controls":`${i}-suggestions`,onChange:v||S,onKeyUp:$&&(O=>{O.key==="Enter"&&(O.preventDefault(),$(c))}),...k}),l.jsx(pe,{className:`pkt-searchinput__button ${s==="local"?"pkt-input-icon":""}`,variant:"icon-only",iconName:"magnifying-glass-big",skin:s==="local"?"tertiary":"primary",color:s==="global"?"yellow":void 0,type:"submit",disabled:t,onClick:$&&(O=>{O.preventDefault(),$(c)}),children:n||r})]}),h&&l.jsx("ul",{id:`${i}-suggestions`,className:"pkt-searchinput__suggestions","aria-live":"assertive",children:h.map((O,R)=>l.jsx("li",{children:_.createElement(O.href?"a":O.onClick?"button":"div",{href:O.href,className:`pkt-searchinput__suggestion ${O.onClick?"pkt-link-button":""} ${O.href||O.onClick?"pkt-searchinput__suggestion--has-hover":""}`,type:O.onClick?"button":void 0,onClick:()=>T(O.onClick,R),onKeyUp:et=>et.key==="Enter"&&T(O.onClick,R)},l.jsxs(l.Fragment,{children:[O.title&&l.jsx("h3",{className:"pkt-searchinput__suggestion-title",children:O.title}),O.text&&l.jsx("p",{className:"pkt-searchinput__suggestion-text",children:O.text})]}))},`search-suggestion-${R}`))})]}))}),Vc=_.forwardRef(({ariaDescribedby:s,ariaLabelledby:t,children:e,className:i,disabled:n=!1,errorMessage:a,hasError:r,helptext:h,helptextDropdown:c,helptextDropdownButton:p,id:m,inline:v=!1,fullwidth:$=!1,label:b,name:k,optionalTag:x=!1,optionalText:T,requiredTag:S=!1,requiredText:A,tagText:I,...O},R)=>{const et=[i,"pkt-select"].join(" ");return l.jsx(ti,{className:et,forId:`${m}-input`,label:b,helptext:h,helptextDropdown:c,helptextDropdownButton:p,optionalTag:x,optionalText:T,requiredTag:S,requiredText:A,tagText:I,hasError:r,errorMessage:a,disabled:n,inline:v,ariaDescribedby:s,children:l.jsx("select",{ref:R,className:`pkt-input ${$?"pkt-input--fullwidth":""}`,"aria-invalid":r,"aria-errormessage":`${m}-error`,"aria-labelledby":t||void 0,disabled:n,id:`${m}-input`,name:k||m,...O,children:e})})}),Uc=l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:l.jsx("circle",{cx:"12",cy:"12",r:"7",style:{fill:"var(--pkt-color-grays-grey-200, #CCC)"}})}),zc=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("circle",{opacity:".15",cx:"12",cy:"12",r:"12",fill:"#2A2859"}),l.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"#2A2859"})]}),qc=l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",children:[l.jsx("path",{fill:"#2A2859",d:"M3 3h18v18H3z"}),l.jsx("path",{d:"m10.34 16-1.11-1.14L7 12.58l1.11-1.15 2.23 2.28L15.88 8 17 9.15l-5.55 5.71L10.34 16Z",fill:"#F1FDFF"})]}),Wc=({children:s,className:t,status:e="incomplete",title:i})=>l.jsxs("li",{className:Z("pkt-step",t,`pkt-step--${e}`),"data-testid":"pkt-step",children:[l.jsx("span",{className:"pkt-step__line pkt-step__line--1","aria-hidden":!0}),l.jsx("span",{className:"pkt-step__line pkt-step__line--2","aria-hidden":!0}),l.jsx("span",{className:Z("pkt-step__indicator"),children:e==="current"?zc:e==="completed"?qc:Uc}),l.jsx("span",{className:"pkt-step__line pkt-step__line--3","aria-hidden":!0}),l.jsxs("div",{className:"pkt-step__wrapper",children:[l.jsx("div",{className:"pkt-step__title",children:i}),l.jsx("div",{className:"pkt-step__content",children:s})]})]}),Rc=_.forwardRef(({activeStep:s,className:t,children:e,hideNonActiveSteps:i=!1,hideNonActiveStepsContent:n=!0,orientation:a="vertical",...r},h)=>{const c=Z(t,"pkt-stepper",a==="horizontal"?"pkt-stepper--horizontal":"pkt-stepper--vertical"),p=_.Children.map(e,(m,v)=>_.isValidElement(m)?_.cloneElement(m,{className:Z(m.props.className,{"pkt-step--hideStep":i&&v!==s,"pkt-step--hideContent":n&&v!==s})}):m);return l.jsx("ol",{"data-testid":"pkt-stepper",className:c,ref:h,...r,children:p})}),Kc=({className:s,compact:t=!1,skin:e="basic",responsiveView:i=!0,children:n,...a})=>l.jsx("table",{"data-testid":"pkt-table",className:Z(s,"pkt-table",{"pkt-table--responsive":i,"pkt-table--compact":t,"pkt-table--basic":e==="basic","pkt-table--zebra-blue":e==="zebra-blue"}),role:"table",...a,children:n}),Yc=({id:s,children:t,className:e,...i})=>l.jsx("tbody",{id:s,className:Z(e,"pkt-table__body",{}),...i,role:"rowgroup",children:t}),Gc=({children:s,className:t,dataLabel:e,...i})=>l.jsx("td",{className:Z(t,"pkt-table__data-cell",{}),"data-label":e,role:"cell","data-testid":"pkt-table__data-cell",...i,children:s}),Zc=({className:s,children:t,...e})=>l.jsx("thead",{className:Z(s,"pkt-table__header",{}),role:"rowgroup",...e,children:t}),Xc=({className:s,children:t,...e})=>l.jsx("th",{className:Z(s,"pkt-table__header-cell",{}),role:"columnheader",...e,children:t}),Jc=({className:s,children:t,...e})=>l.jsx("tr",{className:Z(s,"pkt-table__row",{}),role:"row",...e,children:t}),on=_.forwardRef(({children:s,skin:t,textStyle:e,size:i,closeTag:n,className:a,iconName:r,ariaLabel:h,onClose:c,type:p,"aria-description":m,...v},$)=>{const[b,k]=_.useState(!1),x=_.useCallback(()=>{k(!0),c&&c()},[k]),T=_.useRef(null),[S,A]=_.useState("");_.useEffect(()=>{var et,Ot;A(((Ot=(et=T.current)==null?void 0:et.textContent)==null?void 0:Ot.trim())??"")},[s]);const I=_.useMemo(()=>{if(n&&!h)return S&&`Klikk for å fjerne ${S}`||m},[n,h,S,m]),O={"pkt-tag":!0,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,[`pkt-tag--${e}`]:!!e},R={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${e}`]:!!e,[`pkt-tag--${i}`]:!!i,[`pkt-tag--${t}`]:!!t,"pkt-btn--icons-right-and-left":n&&!!r,"pkt-hide":b};return n?l.jsxs("button",{...v,className:Z(R,a),type:p,onClick:x,"aria-label":h,"aria-description":I,ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r}),l.jsx("span",{ref:T,children:s}),l.jsx(q,{className:"pkt-tag__close-btn",name:"close"})]}):l.jsxs("span",{...v,className:Z(O,a),ref:$,children:[r&&l.jsx(q,{className:"pkt-tag__icon",name:r,"aria-hidden":"true"}),l.jsx("span",{ref:T,children:s})]})});on.displayName="PktTag";const ln=_.forwardRef(({children:s,active:t,href:e,onClick:i,icon:n,controls:a,tag:r,tagSkin:h,index:c=0},p)=>{const{arrowNav:m,registerTabRef:v,handleKeyPress:$,selectTab:b}=Qc(),x={"aria-selected":m?!!t:void 0,"aria-controls":a,role:m?"tab":void 0,onKeyUp:S=>$(c,S),onClick:S=>{b(c),i==null||i(S)},tabIndex:t||!m?void 0:-1,ref:S=>{v(c,S),typeof p=="function"?p(S):p&&(p.current=S)}},T=l.jsxs(l.Fragment,{children:[n&&l.jsx(q,{name:n,className:"pkt-icon--small"}),s,r&&l.jsx(on,{skin:h,size:"small",children:r})]});return e?l.jsx("a",{...x,href:e,className:`pkt-tabs__link ${t?"active":""}`,children:T}):l.jsx("button",{...x,type:"button",className:`pkt-tabs__button pkt-link-button ${t?"active":""}`,children:T})});ln.displayName="PktTabItem";const qa=_.createContext(null),Qc=()=>{const s=_.useContext(qa);if(!s)throw new Error("TabItem must be used within a Tabs component");return s},td=_.forwardRef(({arrowNav:s=!0,disableArrowNav:t=!1,tabs:e,onTabSelected:i,children:n},a)=>{const r=_.useRef([]),h=s&&!t,p=n&&_.Children.count(n)>0?_.Children.count(n):(e==null?void 0:e.length)||0;_.useEffect(()=>{r.current=r.current.slice(0,p)},[p]);const m=k=>{const x=e==null?void 0:e[k];x!=null&&x.action&&x.action(k),i&&i(k)},v=(k,x)=>{var T,S;h&&(x.code==="ArrowLeft"&&k!==0&&((T=r.current[k-1])==null||T.focus()),x.code==="ArrowRight"&&k<p-1&&((S=r.current[k+1])==null||S.focus()),(x.code==="ArrowDown"||x.code==="Space")&&m(k))},$=(k,x)=>{r.current[k]=x},b=e==null?void 0:e.map((k,x)=>{var T,S;return l.jsx(ln,{active:k.active,href:k.href,onClick:()=>m(x),icon:k.icon,controls:k.controls,tag:(T=k.tag)==null?void 0:T.text,tagSkin:(S=k.tag)==null?void 0:S.skin,index:x,children:k.text},x)});return l.jsx(qa.Provider,{value:{arrowNav:h,registerTabRef:$,handleKeyPress:v,selectTab:m},children:l.jsx("div",{className:"pkt-tabs",ref:a,children:l.jsx("div",{className:"pkt-tabs__list",role:h?"tablist":"navigation",children:n||b})})})}),ed=_.forwardRef(({id:s,ariaDescribedby:t,ariaLabelledby:e,counter:i,counterMaxLength:n,className:a,disabled:r,errorMessage:h,hasError:c,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:$,fullwidth:b=!1,label:k,name:x,optionalTag:T=!1,optionalText:S,requiredTag:A=!1,requiredText:I,tagText:O=null,placeholder:R,rows:et,useWrapper:Ot=!0,onChange:Nt,value:it,autoComplete:kt="off",minLength:qt,maxLength:Et,readOnly:dt=!1,skipForwardTestid:ae=!1,...fe},V)=>{const xt=[a,"pkt-textinput","pkt-textarea"].join(" "),Gt=`${s}-input`,$e=`${Gt}-label`,ge=e||$e,[re,Ft]=_.useState(0),ut=_e=>{var we,Zt;if(i&&Ft(((Zt=(we=_e.currentTarget)==null?void 0:we.value)==null?void 0:Zt.length)||0),Nt)return Nt(_e)};return _.useEffect(()=>{it!==void 0&&Ft((it==null?void 0:it.length)||0)},[it]),l.jsx(ti,{ariaDescribedby:t,className:xt,disabled:r,errorMessage:h,forId:Gt,hasError:c,helptext:p,helptextDropdown:m,helptextDropdownButton:v,inline:$,label:k,optionalTag:T,optionalText:S,requiredTag:A,requiredText:I,tagText:O,useWrapper:Ot,counter:i,counterCurrent:re,counterMaxLength:n,children:l.jsx("textarea",{ref:V,className:`pkt-input ${b?"pkt-input--fullwidth":""} ${n&&re>n?"pkt-input--counter-error":""}`,name:`${x||s}`,id:Gt,placeholder:R,disabled:r,rows:et,"aria-labelledby":ge,"aria-invalid":c,"aria-errormessage":`${s}-error`,...fe,onChange:ut,value:it,autoComplete:kt,minLength:qt,maxLength:Et,"data-skip-forward-testid":ae?"true":void 0})})});var ws=window.CustomEvent;(!ws||typeof ws=="object")&&(ws=function(s,t){t=t||{};var e=document.createEvent("CustomEvent");return e.initCustomEvent(s,!!t.bubbles,!!t.cancelable,t.detail||null),e},ws.prototype=window.Event.prototype);function Wa(s,t){var e="on"+t.type.toLowerCase();return typeof s[e]=="function"&&s[e](t),s.dispatchEvent(t)}function sd(s){for(;s&&s!==document.body;){var t=window.getComputedStyle(s),e=function(i,n){return!(t[i]===void 0||t[i]===n)};if(t.opacity<1||e("zIndex","auto")||e("transform","none")||e("mixBlendMode","normal")||e("filter","none")||e("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;s=s.parentElement}return!1}function ei(s){for(;s;){if(s.localName==="dialog")return s;s.parentElement?s=s.parentElement:s.parentNode?s=s.parentNode.host:s=null}return null}function Ra(s){for(;s&&s.shadowRoot&&s.shadowRoot.activeElement;)s=s.shadowRoot.activeElement;s&&s.blur&&s!==document.body&&s.blur()}function id(s,t){for(var e=0;e<s.length;++e)if(s[e]===t)return!0;return!1}function hn(s){return!s||!s.hasAttribute("method")?!1:s.getAttribute("method").toLowerCase()==="dialog"}function Ka(s){var t=["button","input","keygen","select","textarea"],e=t.map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');var i=s.querySelector(e.join(", "));if(!i&&"attachShadow"in Element.prototype)for(var n=s.querySelectorAll("*"),a=0;a<n.length&&!(n[a].tagName&&n[a].shadowRoot&&(i=Ka(n[a].shadowRoot),i));a++);return i}function Ya(s){return s.isConnected||document.body.contains(s)}function Ga(s){if(s.submitter)return s.submitter;var t=s.target;if(!(t instanceof HTMLFormElement))return null;var e=W.formSubmitter;if(!e){var i=s.target,n="getRootNode"in i&&i.getRootNode()||document;e=n.activeElement}return!e||e.form!==t?null:e}function nd(s){if(!s.defaultPrevented){var t=s.target,e=W.imagemapUseValue,i=Ga(s);e===null&&i&&(e=i.value);var n=ei(t);if(n){var a=i&&i.getAttribute("formmethod")||t.getAttribute("method");a==="dialog"&&(s.preventDefault(),e!=null?n.close(e):n.close())}}}function Za(s){if(this.dialog_=s,this.replacedStyleTop_=!1,this.openAsModal_=!1,s.hasAttribute("role")||s.setAttribute("role","dialog"),s.show=this.show.bind(this),s.showModal=this.showModal.bind(this),s.close=this.close.bind(this),s.addEventListener("submit",nd,!1),"returnValue"in s||(s.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(s,{attributes:!0,attributeFilter:["open"]})}else{var e=!1,i=(function(){e?this.downgradeModal():this.maybeHideModal(),e=!1}).bind(this),n,a=function(r){if(r.target===s){var h="DOMNodeRemoved";e|=r.type.substr(0,h.length)===h,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){s.addEventListener(r,a)})}Object.defineProperty(s,"open",{set:this.setOpen.bind(this),get:s.hasAttribute.bind(s,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}Za.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&Ya(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),W.dm.removeDialog(this))},setOpen:function(s){s?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(s){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var e=document.createEvent("MouseEvents");e.initMouseEvent(s.type,s.bubbles,s.cancelable,window,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,s.relatedTarget),this.dialog_.dispatchEvent(e),s.stopPropagation()},focus_:function(){var s=this.dialog_.querySelector("[autofocus]:not([disabled])");!s&&this.dialog_.tabIndex>=0&&(s=this.dialog_),s||(s=Ka(this.dialog_)),Ra(document.activeElement),s&&s.focus()},updateZIndex:function(s,t){if(s<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=s,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!Ya(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!W.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");sd(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,W.needsCentering(this.dialog_)?(W.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(s){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),s!==void 0&&(this.dialog_.returnValue=s);var t=new ws("close",{bubbles:!1,cancelable:!1});Wa(this.dialog_,t)}};var W={};if(W.reposition=function(s){var t=document.body.scrollTop||document.documentElement.scrollTop,e=t+(window.innerHeight-s.offsetHeight)/2;s.style.top=Math.max(t,e)+"px"},W.isInlinePositionSetByStylesheet=function(s){for(var t=0;t<document.styleSheets.length;++t){var e=document.styleSheets[t],i=null;try{i=e.cssRules}catch{}if(i)for(var n=0;n<i.length;++n){var a=i[n],r=null;try{r=document.querySelectorAll(a.selectorText)}catch{}if(!(!r||!id(r,s))){var h=a.style.getPropertyValue("top"),c=a.style.getPropertyValue("bottom");if(h&&h!=="auto"||c&&c!=="auto")return!0}}}return!1},W.needsCentering=function(s){var t=window.getComputedStyle(s);return t.position!=="absolute"||s.style.top!=="auto"&&s.style.top!==""||s.style.bottom!=="auto"&&s.style.bottom!==""?!1:!W.isInlinePositionSetByStylesheet(s)},W.forceRegisterDialog=function(s){if((window.HTMLDialogElement||s.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",s),s.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new Za(s)},W.registerDialog=function(s){s.showModal||W.forceRegisterDialog(s)},W.DialogManager=function(){this.pendingDialogStack=[];var s=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(t){this.forwardTab_=void 0,t.stopPropagation(),s([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var e=[];t.forEach(function(i){for(var n=0,a;a=i.removedNodes[n];++n){if(a instanceof Element)a.localName==="dialog"&&e.push(a);else continue;e=e.concat(a.querySelectorAll("dialog"))}}),e.length&&s(e)}))},W.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},W.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},W.DialogManager.prototype.updateStacking=function(){for(var s=this.zIndexHigh_,t=0,e;e=this.pendingDialogStack[t];++t)e.updateZIndex(--s,--s),t===0&&(this.overlay.style.zIndex=--s);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},W.DialogManager.prototype.containedByTopDialog_=function(s){for(;s=ei(s);){for(var t=0,e;e=this.pendingDialogStack[t];++t)if(e.dialog===s)return t===0;s=s.parentElement}return!1},W.DialogManager.prototype.handleFocus_=function(s){var t=s.composedPath?s.composedPath()[0]:s.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(s.preventDefault(),s.stopPropagation(),Ra(t),this.forwardTab_!==void 0)){var e=this.pendingDialogStack[0],i=e.dialog,n=i.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?e.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},W.DialogManager.prototype.handleKey_=function(s){if(this.forwardTab_=void 0,s.keyCode===27){s.preventDefault(),s.stopPropagation();var t=new ws("cancel",{bubbles:!1,cancelable:!0}),e=this.pendingDialogStack[0];e&&Wa(e.dialog,t)&&e.dialog.close()}else s.keyCode===9&&(this.forwardTab_=!s.shiftKey)},W.DialogManager.prototype.checkDOM_=function(s){var t=this.pendingDialogStack.slice();t.forEach(function(e){s.indexOf(e.dialog)!==-1?e.downgradeModal():e.maybeHideModal()})},W.DialogManager.prototype.pushDialog=function(s){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(s)===1&&this.blockDocument(),this.updateStacking(),!0)},W.DialogManager.prototype.removeDialog=function(s){var t=this.pendingDialogStack.indexOf(s);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())},W.dm=new W.DialogManager,W.formSubmitter=null,W.imagemapUseValue=null,window.HTMLDialogElement===void 0){var Xa=document.createElement("form");if(Xa.setAttribute("method","dialog"),Xa.method!=="dialog"){var xs=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(xs){var ad=xs.get;xs.get=function(){return hn(this)?"dialog":ad.call(this)};var rd=xs.set;xs.set=function(s){return typeof s=="string"&&s.toLowerCase()==="dialog"?this.setAttribute("method",s):rd.call(this,s)},Object.defineProperty(HTMLFormElement.prototype,"method",xs)}}document.addEventListener("click",function(s){if(W.formSubmitter=null,W.imagemapUseValue=null,!s.defaultPrevented){var t=s.target;if("composedPath"in s){var e=s.composedPath();t=e.shift()||t}if(!(!t||!hn(t.form))){var i=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!i){if(!(t.localName==="input"&&t.type==="image"))return;W.imagemapUseValue=s.offsetX+","+s.offsetY}var n=ei(t);n&&(W.formSubmitter=t)}}},!1),document.addEventListener("submit",function(s){var t=s.target,e=ei(t);if(!e){var i=Ga(s),n=i&&i.getAttribute("formmethod")||t.getAttribute("method");n==="dialog"&&s.preventDefault()}});var od=HTMLFormElement.prototype.submit,ld=function(){if(!hn(this))return od.call(this);var s=ei(this);s&&s.close()};HTMLFormElement.prototype.submit=ld}const hd=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));P.PktAccordion=pn,P.PktAccordionItem=Ca,P.PktAlert=an,P.PktBackLink=Na,P.PktBreadcrumbs=xc,P.PktButton=pe,P.PktCard=Ea,P.PktCheckbox=Ma,P.PktCombobox=Aa,P.PktConsent=Mi,P.PktDatepicker=Oa,P.PktFooter=Nc,P.PktFooterSimple=Ec,P.PktHeader=Da,P.PktHeaderService=Pa,P.PktHeading=Ia,P.PktHelptext=La,P.PktIcon=q,P.PktInput=Ba,P.PktInputWrapper=ti,P.PktLink=Ai,P.PktLinkCard=Fa,P.PktLoader=ja,P.PktMessagebox=Ha,P.PktModal=Va,P.PktProgressbar=Ua,P.PktRadioButton=za,P.PktSearchInput=Hc,P.PktSelect=Vc,P.PktStep=Wc,P.PktStepper=Rc,P.PktTabItem=ln,P.PktTable=Kc,P.PktTableBody=Yc,P.PktTableDataCell=Gc,P.PktTableHeader=Zc,P.PktTableHeaderCell=Xc,P.PktTableRow=Jc,P.PktTabs=td,P.PktTag=on,P.PktTextarea=ed,P.PktTextinput=rn,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
|