@oslokommune/punkt-react 12.38.0 → 12.38.2
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 +35 -0
- package/dist/index.d.ts +3 -2
- package/dist/punkt-react.es.js +4 -16
- package/dist/punkt-react.umd.js +3 -4
- package/package.json +4 -4
- package/src/components/link/Link.tsx +16 -12
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [12.38.2](https://github.com/oslokommune/punkt/compare/12.38.1...12.38.2) (2025-05-14)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
Ingen
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
Ingen
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [12.38.1](https://github.com/oslokommune/punkt/compare/12.38.0...12.38.1) (2025-05-14)
|
|
26
|
+
|
|
27
|
+
### ⚠ BREAKING CHANGES
|
|
28
|
+
Ingen
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
Ingen
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
* Link click trigger to ganger, og button disabled funker ikke (#2545).
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Chores
|
|
38
|
+
Ingen
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
|
|
8
43
|
## [12.38.0](https://github.com/oslokommune/punkt/compare/12.37.8...12.38.0) (2025-05-13)
|
|
9
44
|
|
|
10
45
|
### ⚠ BREAKING CHANGES
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { IPktProgressbar as IPktProgressbar_2 } from '@oslokommune/punkt-element
|
|
|
21
21
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
22
22
|
import { KeyboardEventHandler } from 'react';
|
|
23
23
|
import { LegacyRef } from 'react';
|
|
24
|
+
import { LinkHTMLAttributes } from 'react';
|
|
24
25
|
import { MouseEventHandler } from 'react';
|
|
25
26
|
import { PktInputWrapper as PktInputWrapper_2 } from '@oslokommune/punkt-elements';
|
|
26
27
|
import * as React_2 from 'react';
|
|
@@ -304,13 +305,13 @@ export declare interface IPktInputWrapper extends Omit<PktElType, 'ref'> {
|
|
|
304
305
|
onToggleHelpText?: (e: CustomEvent) => void;
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
declare interface IPktLink extends
|
|
308
|
+
declare interface IPktLink extends LinkHTMLAttributes<HTMLAnchorElement> {
|
|
308
309
|
href?: string;
|
|
309
310
|
iconName?: string | undefined;
|
|
310
311
|
iconPosition?: string | undefined;
|
|
311
312
|
external?: boolean;
|
|
312
313
|
target?: string | null;
|
|
313
|
-
|
|
314
|
+
ref?: LegacyRef<HTMLAnchorElement>;
|
|
314
315
|
}
|
|
315
316
|
|
|
316
317
|
export declare interface IPktLinkCard extends PktElType {
|
package/dist/punkt-react.es.js
CHANGED
|
@@ -23157,16 +23157,16 @@ ol([
|
|
|
23157
23157
|
z({ type: String })
|
|
23158
23158
|
], mo.prototype, "variant", 2);
|
|
23159
23159
|
ol([
|
|
23160
|
-
z({ type: String })
|
|
23160
|
+
z({ type: String, reflect: !0 })
|
|
23161
23161
|
], mo.prototype, "state", 2);
|
|
23162
23162
|
ol([
|
|
23163
23163
|
z({ type: String, reflect: !0 })
|
|
23164
23164
|
], mo.prototype, "type", 2);
|
|
23165
23165
|
ol([
|
|
23166
|
-
z({ type: Boolean })
|
|
23166
|
+
z({ type: Boolean, reflect: !0 })
|
|
23167
23167
|
], mo.prototype, "isLoading", 2);
|
|
23168
23168
|
ol([
|
|
23169
|
-
z({ type: Boolean })
|
|
23169
|
+
z({ type: Boolean, reflect: !0 })
|
|
23170
23170
|
], mo.prototype, "disabled", 2);
|
|
23171
23171
|
mo = ol([
|
|
23172
23172
|
cr("pkt-button")
|
|
@@ -27612,20 +27612,11 @@ let wf = class extends Gr {
|
|
|
27612
27612
|
return we`<a
|
|
27613
27613
|
class=${Mt(n)}
|
|
27614
27614
|
href=${this.href}
|
|
27615
|
-
@click=${this.handleClick}
|
|
27616
27615
|
.target=${this.target}
|
|
27617
27616
|
.rel=${this.external ? "noopener noreferrer" : qe}
|
|
27618
27617
|
>${this.iconName ? we`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>` : ""} <span ${Kt(this.defaultSlot)}>Link</span></a
|
|
27619
27618
|
>`;
|
|
27620
27619
|
}
|
|
27621
|
-
handleClick() {
|
|
27622
|
-
this.dispatchEvent(
|
|
27623
|
-
new CustomEvent("click", {
|
|
27624
|
-
detail: "pkt-link-clicked",
|
|
27625
|
-
bubbles: !0
|
|
27626
|
-
})
|
|
27627
|
-
);
|
|
27628
|
-
}
|
|
27629
27620
|
};
|
|
27630
27621
|
ug([
|
|
27631
27622
|
z({ type: String, reflect: !0 })
|
|
@@ -29251,10 +29242,7 @@ const WI = jr({
|
|
|
29251
29242
|
tagName: "pkt-link",
|
|
29252
29243
|
elementClass: wf,
|
|
29253
29244
|
react: Ht,
|
|
29254
|
-
displayName: "PktLink"
|
|
29255
|
-
events: {
|
|
29256
|
-
onClick: "click"
|
|
29257
|
-
}
|
|
29245
|
+
displayName: "PktLink"
|
|
29258
29246
|
}), KI = Ir(
|
|
29259
29247
|
({ children: r, ...n }, i) => /* @__PURE__ */ B.jsx(GI, { ...n, ref: i, children: /* @__PURE__ */ B.jsx("span", { className: "pkt-contents", children: r }) })
|
|
29260
29248
|
);
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -425,7 +425,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
425
425
|
<span class="pkt-btn__text" ${qt(this.defaultSlot)}></span>
|
|
426
426
|
${this.variant==="icons-right-and-left"?we`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:qe}
|
|
427
427
|
</div>
|
|
428
|
-
`}updateElementClasses(){const n=new Set,i=this.getAttribute("class");n.add("pkt-btn"),i&&i.split(" ").forEach(l=>n.add(l)),this.size&&n.add(`pkt-btn--${this.size}`),this.skin&&n.add(`pkt-btn--${this.skin}`),this.variant&&n.add(`pkt-btn--${this.variant}`),this.color&&n.add(`pkt-btn--${this.color}`),this.isLoading&&n.add("pkt-btn--active"),this.state&&n.add(`pkt-btn--${this.state}`),this.disabled&&n.add("pkt-btn--disabled"),this.className=[...n].join(" ")}handleClick(n){if(this.disabled||this.isLoading){n.preventDefault(),n.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit();return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(n),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:n}}))}handleKeydown(n){if(!(this.disabled||this.isLoading)&&(n.key==="Enter"||n.key===" ")){n.preventDefault();const i=n.target;i&&i.click()}}};Yi.formAssociated=!0,Cs([z({type:String})],Yi.prototype,"iconName",2),Cs([z({type:String})],Yi.prototype,"secondIconName",2),Cs([z({type:String})],Yi.prototype,"mode",2),Cs([z({type:String})],Yi.prototype,"size",2),Cs([z({type:String})],Yi.prototype,"color",2),Cs([z({type:String})],Yi.prototype,"skin",2),Cs([z({type:String})],Yi.prototype,"variant",2),Cs([z({type:String})],Yi.prototype,"state",2),Cs([z({type:String,reflect:!0})],Yi.prototype,"type",2),Cs([z({type:Boolean})],Yi.prototype,"isLoading",2),Cs([z({type:Boolean})],Yi.prototype,"disabled",2),Yi=Cs([dr("pkt-button")],Yi);const D1=6048e5,HP=864e5,VP=36e5,S1=Symbol.for("constructDateFrom");function dl(r,n){return typeof r=="function"?r(n):r&&typeof r=="object"&&S1 in r?r[S1](n):r instanceof Date?new r.constructor(n):new Date(n)}function Di(r,n){return dl(n||r,r)}function s0(r,n,i){const l=Di(r,void 0);return isNaN(n)?dl(r,NaN):(n&&l.setDate(l.getDate()+n),l)}function qP(r,n,i){return dl(r,+Di(r)+n)}function C1(r,n,i){return qP(r,n*VP)}let WP={};function Zy(){return WP}function Ag(r,n){var i,l,c,h;const m=Zy(),D=(n==null?void 0:n.weekStartsOn)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??m.weekStartsOn??((h=(c=m.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??0,C=Di(r,n==null?void 0:n.in),T=C.getDay(),$=(T<D?7:0)+T-D;return C.setDate(C.getDate()-$),C.setHours(0,0,0,0),C}function eb(r,n){return Ag(r,{...n,weekStartsOn:1})}function x1(r,n){const i=Di(r,void 0),l=i.getFullYear(),c=dl(i,0);c.setFullYear(l+1,0,4),c.setHours(0,0,0,0);const h=eb(c),m=dl(i,0);m.setFullYear(l,0,4),m.setHours(0,0,0,0);const D=eb(m);return i.getTime()>=h.getTime()?l+1:i.getTime()>=D.getTime()?l:l-1}function _1(r){const n=Di(r),i=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return i.setUTCFullYear(n.getFullYear()),+r-+i}function E1(r,...n){const i=dl.bind(null,n.find(l=>typeof l=="object"));return n.map(i)}function l0(r,n){const i=Di(r,void 0);return i.setHours(0,0,0,0),i}function YP(r,n,i){const[l,c]=E1(void 0,r,n),h=l0(l),m=l0(c),D=+h-_1(h),C=+m-_1(m);return Math.round((D-C)/HP)}function GP(r,n){const i=x1(r),l=dl(r,0);return l.setFullYear(i,0,4),l.setHours(0,0,0,0),eb(l)}function KP(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function QP(r){return!(!KP(r)&&typeof r!="number"||isNaN(+Di(r)))}function XP(r,n){const i=Di(r,void 0);return i.setHours(23,59,59,999),i}function JP(r,n){const[i,l]=E1(r,n.start,n.end);return{start:i,end:l}}function u0(r,n){const{start:i,end:l}=JP(void 0,r);let c=+i>+l;const h=c?+i:+l,m=c?l:i;m.setHours(0,0,0,0);let D=1;const C=[];for(;+m<=h;)C.push(dl(i,m)),m.setDate(m.getDate()+D),m.setHours(0,0,0,0);return c?C.reverse():C}function ZP(r,n){const i=Di(r,void 0);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}const eN={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"}},tN=(r,n,i)=>{let l;const c=eN[r];return typeof c=="string"?l=c:n===1?l=c.one:l=c.other.replace("{{count}}",n.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+l:l+" ago":l};function c0(r){return(n={})=>{const i=n.width?String(n.width):r.defaultWidth;return r.formats[i]||r.formats[r.defaultWidth]}}const nN={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},rN={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},aN={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iN={date:c0({formats:nN,defaultWidth:"full"}),time:c0({formats:rN,defaultWidth:"full"}),dateTime:c0({formats:aN,defaultWidth:"full"})},oN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sN=(r,n,i,l)=>oN[r];function Fg(r){return(n,i)=>{const l=i!=null&&i.context?String(i.context):"standalone";let c;if(l==="formatting"&&r.formattingValues){const m=r.defaultFormattingWidth||r.defaultWidth,D=i!=null&&i.width?String(i.width):m;c=r.formattingValues[D]||r.formattingValues[m]}else{const m=r.defaultWidth,D=i!=null&&i.width?String(i.width):r.defaultWidth;c=r.values[D]||r.values[m]}const h=r.argumentCallback?r.argumentCallback(n):n;return c[h]}}const lN={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uN={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cN={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"]},dN={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"]},fN={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"}},pN={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"}},hN=(r,n)=>{const i=Number(r),l=i%100;if(l>20||l<10)switch(l%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},mN={ordinalNumber:hN,era:Fg({values:lN,defaultWidth:"wide"}),quarter:Fg({values:uN,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Fg({values:cN,defaultWidth:"wide"}),day:Fg({values:dN,defaultWidth:"wide"}),dayPeriod:Fg({values:fN,defaultWidth:"wide",formattingValues:pN,defaultFormattingWidth:"wide"})};function $g(r){return(n,i={})=>{const l=i.width,c=l&&r.matchPatterns[l]||r.matchPatterns[r.defaultMatchWidth],h=n.match(c);if(!h)return null;const m=h[0],D=l&&r.parsePatterns[l]||r.parsePatterns[r.defaultParseWidth],C=Array.isArray(D)?vN(D,N=>N.test(m)):gN(D,N=>N.test(m));let T;T=r.valueCallback?r.valueCallback(C):C,T=i.valueCallback?i.valueCallback(T):T;const $=n.slice(m.length);return{value:T,rest:$}}}function gN(r,n){for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&n(r[i]))return i}function vN(r,n){for(let i=0;i<r.length;i++)if(n(r[i]))return i}function yN(r){return(n,i={})=>{const l=n.match(r.matchPattern);if(!l)return null;const c=l[0],h=n.match(r.parsePattern);if(!h)return null;let m=r.valueCallback?r.valueCallback(h[0]):h[0];m=i.valueCallback?i.valueCallback(m):m;const D=n.slice(c.length);return{value:m,rest:D}}}const bN=/^(\d+)(th|st|nd|rd)?/i,kN=/\d+/i,wN={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},DN={any:[/^b/i,/^(a|c)/i]},SN={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},CN={any:[/1/i,/2/i,/3/i,/4/i]},xN={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},_N={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]},EN={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},TN={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]},AN={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},FN={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}},$N={ordinalNumber:yN({matchPattern:bN,parsePattern:kN,valueCallback:r=>parseInt(r,10)}),era:$g({matchPatterns:wN,defaultMatchWidth:"wide",parsePatterns:DN,defaultParseWidth:"any"}),quarter:$g({matchPatterns:SN,defaultMatchWidth:"wide",parsePatterns:CN,defaultParseWidth:"any",valueCallback:r=>r+1}),month:$g({matchPatterns:xN,defaultMatchWidth:"wide",parsePatterns:_N,defaultParseWidth:"any"}),day:$g({matchPatterns:EN,defaultMatchWidth:"wide",parsePatterns:TN,defaultParseWidth:"any"}),dayPeriod:$g({matchPatterns:AN,defaultMatchWidth:"any",parsePatterns:FN,defaultParseWidth:"any"})},PN={code:"en-US",formatDistance:tN,formatLong:iN,formatRelative:sN,localize:mN,match:$N,options:{weekStartsOn:0,firstWeekContainsDate:1}};function NN(r,n){const i=Di(r,void 0);return YP(i,ZP(i))+1}function ON(r,n){const i=Di(r,void 0),l=+eb(i)-+GP(i);return Math.round(l/D1)+1}function T1(r,n){var i,l,c,h;const m=Di(r,n==null?void 0:n.in),D=m.getFullYear(),C=Zy(),T=(n==null?void 0:n.firstWeekContainsDate)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??C.firstWeekContainsDate??((h=(c=C.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,$=dl((n==null?void 0:n.in)||r,0);$.setFullYear(D+1,0,T),$.setHours(0,0,0,0);const N=Ag($,n),O=dl((n==null?void 0:n.in)||r,0);O.setFullYear(D,0,T),O.setHours(0,0,0,0);const R=Ag(O,n);return+m>=+N?D+1:+m>=+R?D:D-1}function RN(r,n){var i,l,c,h;const m=Zy(),D=(n==null?void 0:n.firstWeekContainsDate)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??m.firstWeekContainsDate??((h=(c=m.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,C=T1(r,n),T=dl((n==null?void 0:n.in)||r,0);return T.setFullYear(C,0,D),T.setHours(0,0,0,0),Ag(T,n)}function A1(r,n){const i=Di(r,n==null?void 0:n.in),l=+Ag(i,n)-+RN(i,n);return Math.round(l/D1)+1}function ar(r,n){const i=r<0?"-":"",l=Math.abs(r).toString().padStart(n,"0");return i+l}const wd={y(r,n){const i=r.getFullYear(),l=i>0?i:1-i;return ar(n==="yy"?l%100:l,n.length)},M(r,n){const i=r.getMonth();return n==="M"?String(i+1):ar(i+1,2)},d(r,n){return ar(r.getDate(),n.length)},a(r,n){const i=r.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h(r,n){return ar(r.getHours()%12||12,n.length)},H(r,n){return ar(r.getHours(),n.length)},m(r,n){return ar(r.getMinutes(),n.length)},s(r,n){return ar(r.getSeconds(),n.length)},S(r,n){const i=n.length,l=r.getMilliseconds(),c=Math.trunc(l*Math.pow(10,i-3));return ar(c,n.length)}},xh={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},F1={G:function(r,n,i){const l=r.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return i.era(l,{width:"abbreviated"});case"GGGGG":return i.era(l,{width:"narrow"});case"GGGG":default:return i.era(l,{width:"wide"})}},y:function(r,n,i){if(n==="yo"){const l=r.getFullYear(),c=l>0?l:1-l;return i.ordinalNumber(c,{unit:"year"})}return wd.y(r,n)},Y:function(r,n,i,l){const c=T1(r,l),h=c>0?c:1-c;if(n==="YY"){const m=h%100;return ar(m,2)}return n==="Yo"?i.ordinalNumber(h,{unit:"year"}):ar(h,n.length)},R:function(r,n){const i=x1(r);return ar(i,n.length)},u:function(r,n){const i=r.getFullYear();return ar(i,n.length)},Q:function(r,n,i){const l=Math.ceil((r.getMonth()+1)/3);switch(n){case"Q":return String(l);case"QQ":return ar(l,2);case"Qo":return i.ordinalNumber(l,{unit:"quarter"});case"QQQ":return i.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(l,{width:"wide",context:"formatting"})}},q:function(r,n,i){const l=Math.ceil((r.getMonth()+1)/3);switch(n){case"q":return String(l);case"qq":return ar(l,2);case"qo":return i.ordinalNumber(l,{unit:"quarter"});case"qqq":return i.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(l,{width:"wide",context:"standalone"})}},M:function(r,n,i){const l=r.getMonth();switch(n){case"M":case"MM":return wd.M(r,n);case"Mo":return i.ordinalNumber(l+1,{unit:"month"});case"MMM":return i.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(l,{width:"wide",context:"formatting"})}},L:function(r,n,i){const l=r.getMonth();switch(n){case"L":return String(l+1);case"LL":return ar(l+1,2);case"Lo":return i.ordinalNumber(l+1,{unit:"month"});case"LLL":return i.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(l,{width:"wide",context:"standalone"})}},w:function(r,n,i,l){const c=A1(r,l);return n==="wo"?i.ordinalNumber(c,{unit:"week"}):ar(c,n.length)},I:function(r,n,i){const l=ON(r);return n==="Io"?i.ordinalNumber(l,{unit:"week"}):ar(l,n.length)},d:function(r,n,i){return n==="do"?i.ordinalNumber(r.getDate(),{unit:"date"}):wd.d(r,n)},D:function(r,n,i){const l=NN(r);return n==="Do"?i.ordinalNumber(l,{unit:"dayOfYear"}):ar(l,n.length)},E:function(r,n,i){const l=r.getDay();switch(n){case"E":case"EE":case"EEE":return i.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(l,{width:"short",context:"formatting"});case"EEEE":default:return i.day(l,{width:"wide",context:"formatting"})}},e:function(r,n,i,l){const c=r.getDay(),h=(c-l.weekStartsOn+8)%7||7;switch(n){case"e":return String(h);case"ee":return ar(h,2);case"eo":return i.ordinalNumber(h,{unit:"day"});case"eee":return i.day(c,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(c,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(c,{width:"short",context:"formatting"});case"eeee":default:return i.day(c,{width:"wide",context:"formatting"})}},c:function(r,n,i,l){const c=r.getDay(),h=(c-l.weekStartsOn+8)%7||7;switch(n){case"c":return String(h);case"cc":return ar(h,n.length);case"co":return i.ordinalNumber(h,{unit:"day"});case"ccc":return i.day(c,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(c,{width:"narrow",context:"standalone"});case"cccccc":return i.day(c,{width:"short",context:"standalone"});case"cccc":default:return i.day(c,{width:"wide",context:"standalone"})}},i:function(r,n,i){const l=r.getDay(),c=l===0?7:l;switch(n){case"i":return String(c);case"ii":return ar(c,n.length);case"io":return i.ordinalNumber(c,{unit:"day"});case"iii":return i.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(l,{width:"short",context:"formatting"});case"iiii":default:return i.day(l,{width:"wide",context:"formatting"})}},a:function(r,n,i){const l=r.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return i.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(r,n,i){const l=r.getHours();let c;switch(l===12?c=xh.noon:l===0?c=xh.midnight:c=l/12>=1?"pm":"am",n){case"b":case"bb":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(c,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(c,{width:"wide",context:"formatting"})}},B:function(r,n,i){const l=r.getHours();let c;switch(l>=17?c=xh.evening:l>=12?c=xh.afternoon:l>=4?c=xh.morning:c=xh.night,n){case"B":case"BB":case"BBB":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(c,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(c,{width:"wide",context:"formatting"})}},h:function(r,n,i){if(n==="ho"){let l=r.getHours()%12;return l===0&&(l=12),i.ordinalNumber(l,{unit:"hour"})}return wd.h(r,n)},H:function(r,n,i){return n==="Ho"?i.ordinalNumber(r.getHours(),{unit:"hour"}):wd.H(r,n)},K:function(r,n,i){const l=r.getHours()%12;return n==="Ko"?i.ordinalNumber(l,{unit:"hour"}):ar(l,n.length)},k:function(r,n,i){let l=r.getHours();return l===0&&(l=24),n==="ko"?i.ordinalNumber(l,{unit:"hour"}):ar(l,n.length)},m:function(r,n,i){return n==="mo"?i.ordinalNumber(r.getMinutes(),{unit:"minute"}):wd.m(r,n)},s:function(r,n,i){return n==="so"?i.ordinalNumber(r.getSeconds(),{unit:"second"}):wd.s(r,n)},S:function(r,n){return wd.S(r,n)},X:function(r,n,i){const l=r.getTimezoneOffset();if(l===0)return"Z";switch(n){case"X":return P1(l);case"XXXX":case"XX":return Bf(l);case"XXXXX":case"XXX":default:return Bf(l,":")}},x:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"x":return P1(l);case"xxxx":case"xx":return Bf(l);case"xxxxx":case"xxx":default:return Bf(l,":")}},O:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+$1(l,":");case"OOOO":default:return"GMT"+Bf(l,":")}},z:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+$1(l,":");case"zzzz":default:return"GMT"+Bf(l,":")}},t:function(r,n,i){const l=Math.trunc(+r/1e3);return ar(l,n.length)},T:function(r,n,i){return ar(+r,n.length)}};function $1(r,n=""){const i=r>0?"-":"+",l=Math.abs(r),c=Math.trunc(l/60),h=l%60;return h===0?i+String(c):i+String(c)+n+ar(h,2)}function P1(r,n){return r%60===0?(r>0?"-":"+")+ar(Math.abs(r)/60,2):Bf(r,n)}function Bf(r,n=""){const i=r>0?"-":"+",l=Math.abs(r),c=ar(Math.trunc(l/60),2),h=ar(l%60,2);return i+c+n+h}const N1=(r,n)=>{switch(r){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},O1=(r,n)=>{switch(r){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},LN=(r,n)=>{const i=r.match(/(P+)(p+)?/)||[],l=i[1],c=i[2];if(!c)return N1(r,n);let h;switch(l){case"P":h=n.dateTime({width:"short"});break;case"PP":h=n.dateTime({width:"medium"});break;case"PPP":h=n.dateTime({width:"long"});break;case"PPPP":default:h=n.dateTime({width:"full"});break}return h.replace("{{date}}",N1(l,n)).replace("{{time}}",O1(c,n))},BN={p:O1,P:LN},MN=/^D+$/,IN=/^Y+$/,jN=["D","DD","YY","YYYY"];function zN(r){return MN.test(r)}function UN(r){return IN.test(r)}function HN(r,n,i){const l=VN(r,n,i);if(console.warn(l),jN.includes(r))throw new RangeError(l)}function VN(r,n,i){const l=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${n}\`) for formatting ${l} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const qN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YN=/^'([^]*?)'?$/,GN=/''/g,KN=/[a-zA-Z]/;function QN(r,n,i){var l,c,h,m;const D=Zy(),C=D.locale??PN,T=D.firstWeekContainsDate??((c=(l=D.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??1,$=D.weekStartsOn??((m=(h=D.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,N=Di(r,void 0);if(!QP(N))throw new RangeError("Invalid time value");let O=n.match(WN).map(I=>{const K=I[0];if(K==="p"||K==="P"){const Y=BN[K];return Y(I,C.formatLong)}return I}).join("").match(qN).map(I=>{if(I==="''")return{isToken:!1,value:"'"};const K=I[0];if(K==="'")return{isToken:!1,value:XN(I)};if(F1[K])return{isToken:!0,value:I};if(K.match(KN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+K+"`");return{isToken:!1,value:I}});C.localize.preprocessor&&(O=C.localize.preprocessor(N,O));const R={firstWeekContainsDate:T,weekStartsOn:$,locale:C};return O.map(I=>{if(!I.isToken)return I.value;const K=I.value;(UN(K)||zN(K))&&HN(K,n,String(r));const Y=F1[K[0]];return Y(N,K,C.localize,R)}).join("")}function XN(r){const n=r.match(YN);return n?n[1].replace(GN,"'"):r}function JN(r,n){const i=Di(r,void 0).getDay();return i===0?7:i}function ZN(r,n,i){const l=Di(r,void 0);return l.setHours(n),l}const R1={},Pg={};function Ng(r,n){try{const i=(R1[r]||(R1[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(n).split("GMT")[1]||"";return i in Pg?Pg[i]:L1(i,i.split(":"))}catch{if(r in Pg)return Pg[r];const i=r==null?void 0:r.match(e3);return i?L1(r,i.slice(1)):NaN}}const e3=/([+-]\d\d):?(\d\d)?/;function L1(r,n){const i=+n[0],l=+(n[1]||0);return Pg[r]=i>0?i*60+l:i*60-l}let Og=class Oy extends Date{constructor(...n){super(),n.length>1&&typeof n[n.length-1]=="string"&&(this.timeZone=n.pop()),this.internal=new Date,isNaN(Ng(this.timeZone,this))?this.setTime(NaN):n.length?typeof n[0]=="number"&&(n.length===1||n.length===2&&typeof n[1]!="number")?this.setTime(n[0]):typeof n[0]=="string"?this.setTime(+new Date(n[0])):n[0]instanceof Date?this.setTime(+n[0]):(this.setTime(+new Date(...n)),M1(this),d0(this)):this.setTime(Date.now())}static tz(n,...i){return i.length?new Oy(...i,n):new Oy(Date.now(),n)}withTimeZone(n){return new Oy(+this,n)}getTimezoneOffset(){return-Ng(this.timeZone,this)}setTime(n){return Date.prototype.setTime.apply(this,arguments),d0(this),+this}[Symbol.for("constructDateFrom")](n){return new Oy(+new Date(n),this.timeZone)}};const B1=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!B1.test(r))return;const n=r.replace(B1,"$1UTC");Og.prototype[n]&&(r.startsWith("get")?Og.prototype[r]=function(){return this.internal[n]()}:(Og.prototype[r]=function(){return Date.prototype[n].apply(this.internal,arguments),t3(this),+this},Og.prototype[n]=function(){return Date.prototype[n].apply(this,arguments),d0(this),+this}))});function d0(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function t3(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),M1(r)}function M1(r){const n=Ng(r.timeZone,r),i=new Date(+r);i.setUTCHours(i.getUTCHours()-1);const l=-new Date(+r).getTimezoneOffset(),c=-new Date(+i).getTimezoneOffset(),h=l-c,m=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();h&&m&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+h);const D=l-n;D&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+D);const C=Ng(r.timeZone,r),T=-new Date(+r).getTimezoneOffset()-C,$=C!==n,N=T-D;if($&&N){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+N);const O=Ng(r.timeZone,r),R=C-O;R&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+R),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+R))}}let tb=class Ry extends Og{static tz(n,...i){return i.length?new Ry(...i,n):new Ry(Date.now(),n)}toISOString(){const[n,i,l]=this.tzComponents(),c=`${n}${i}:${l}`;return this.internal.toISOString().slice(0,-1)+c}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[n,i,l,c]=this.internal.toUTCString().split(" ");return`${n==null?void 0:n.slice(0,-1)} ${l} ${i} ${c}`}toTimeString(){const n=this.internal.toUTCString().split(" ")[4],[i,l,c]=this.tzComponents();return`${n} GMT${i}${l}${c} (${n3(this.timeZone,this)})`}toLocaleString(n,i){return Date.prototype.toLocaleString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}toLocaleDateString(n,i){return Date.prototype.toLocaleDateString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}toLocaleTimeString(n,i){return Date.prototype.toLocaleTimeString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}tzComponents(){const n=this.getTimezoneOffset(),i=n>0?"-":"+",l=String(Math.floor(Math.abs(n)/60)).padStart(2,"0"),c=String(Math.abs(n)%60).padStart(2,"0");return[i,l,c]}withTimeZone(n){return new Ry(+this,n)}[Symbol.for("constructDateFrom")](n){return new Ry(+new Date(n),this.timeZone)}};function n3(r,n){return new Intl.DateTimeFormat("en-GB",{timeZone:r,timeZoneName:"long"}).format(n).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Va=r=>r.toISOString().split("T")[0],f0=r=>{if(!r)return null;const n=C1(new tb(r,window.pktTz),12);return isNaN(n.getTime())?null:n},I1=(r,n)=>{const i=Qr(r);return isNaN(i.getTime())?"":QN(i,n)},Qr=(r="",n)=>{const i=r===""||!r?new Date:r;return n?new tb(n==="end"?XP(i):l0(i),window.pktTz):ZN(new tb(i.toString(),window.pktTz),12)},Dd=(r,n,i=1)=>C1(new tb(r,n,i,window.pktTz),12),r3=r=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(r),j1=r=>{if(Array.isArray(r))return r;if(typeof r=="string")return r.split(",")},a3=r=>r?new Date(r):null,i3=r=>{if(typeof r=="string")return r.split(",").map(n=>new Date(n));if(Array.isArray(r))return r.map(n=>new Date(n))},_h={csvToArray:j1,stringToDate:a3,stringsToDate:i3},o3={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Mf={props:o3};var s3=Object.defineProperty,l3=Object.getOwnPropertyDescriptor,fr=(r,n,i,l)=>{for(var c=l>1?void 0:l?l3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&s3(n,i,c),c};let ir=class extends Hr{constructor(){super(...arguments),this.multiple=Mf.props.multiple.default,this.maxMultiple=Mf.props.maxMultiple.default,this.range=Mf.props.range.default,this.weeknumbers=Mf.props.weeknumbers.default,this.withcontrols=Mf.props.withcontrols.default,this.selected=[],this.earliest=Mf.props.earliest.default,this.latest=Mf.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(n,i,l){n==="selected"&&l&&this.convertSelected(),super.attributeChangedCallback(n,i,l)}updated(n){super.updated(n),n.has("selected")&&this.convertSelected()}firstUpdated(n){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(n=>Qr(n)),this.range&&this.selected.length===2){const n=u0({start:Qr(this.selected[0]),end:Qr(this.selected[1])});if(this.inRange={},Array.isArray(n)&&n.length){const i={};for(let l=0;l<n.length;l++)i[Va(n[l])]=this.isInRange(n[l]);this.inRange=i}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=Qr(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=Qr()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(n){switch(n.key){case"ArrowLeft":this.handleArrowKey(n,-1);break;case"ArrowRight":this.handleArrowKey(n,1);break;case"ArrowUp":this.handleArrowKey(n,-7);break;case"ArrowDown":this.handleArrowKey(n,7);break}}handleArrowKey(n,i){var l,c,h;if(((l=n.target)==null?void 0:l.nodeName)==="INPUT"||((c=n.target)==null?void 0:c.nodeName)==="SELECT"||((h=n.target)==null?void 0:h.nodeName)==="BUTTON")return;n.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const m=this.focusedDate?Qr(this.focusedDate):Dd(this.year,this.month,1);let D=s0(m,i);if(D){let C=this.querySelector(`div[data-date="${Va(D)}"]`);if(C instanceof HTMLDivElement){if(C.dataset.disabled){D=s0(D,i);let T=this.querySelector(`div[data-date="${Va(D)}"]`);for(;T&&T instanceof HTMLDivElement&&T.dataset.disabled;)D=s0(D,i),T=this.querySelector(`div[data-date="${Va(D)}"]`);C=T}C instanceof HTMLDivElement&&!C.dataset.disabled&&(this.focusedDate=Va(D),C.focus())}}}render(){return we`
|
|
428
|
+
`}updateElementClasses(){const n=new Set,i=this.getAttribute("class");n.add("pkt-btn"),i&&i.split(" ").forEach(l=>n.add(l)),this.size&&n.add(`pkt-btn--${this.size}`),this.skin&&n.add(`pkt-btn--${this.skin}`),this.variant&&n.add(`pkt-btn--${this.variant}`),this.color&&n.add(`pkt-btn--${this.color}`),this.isLoading&&n.add("pkt-btn--active"),this.state&&n.add(`pkt-btn--${this.state}`),this.disabled&&n.add("pkt-btn--disabled"),this.className=[...n].join(" ")}handleClick(n){if(this.disabled||this.isLoading){n.preventDefault(),n.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit();return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(n),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:n}}))}handleKeydown(n){if(!(this.disabled||this.isLoading)&&(n.key==="Enter"||n.key===" ")){n.preventDefault();const i=n.target;i&&i.click()}}};Yi.formAssociated=!0,Cs([z({type:String})],Yi.prototype,"iconName",2),Cs([z({type:String})],Yi.prototype,"secondIconName",2),Cs([z({type:String})],Yi.prototype,"mode",2),Cs([z({type:String})],Yi.prototype,"size",2),Cs([z({type:String})],Yi.prototype,"color",2),Cs([z({type:String})],Yi.prototype,"skin",2),Cs([z({type:String})],Yi.prototype,"variant",2),Cs([z({type:String,reflect:!0})],Yi.prototype,"state",2),Cs([z({type:String,reflect:!0})],Yi.prototype,"type",2),Cs([z({type:Boolean,reflect:!0})],Yi.prototype,"isLoading",2),Cs([z({type:Boolean,reflect:!0})],Yi.prototype,"disabled",2),Yi=Cs([dr("pkt-button")],Yi);const D1=6048e5,HP=864e5,VP=36e5,S1=Symbol.for("constructDateFrom");function dl(r,n){return typeof r=="function"?r(n):r&&typeof r=="object"&&S1 in r?r[S1](n):r instanceof Date?new r.constructor(n):new Date(n)}function Di(r,n){return dl(n||r,r)}function s0(r,n,i){const l=Di(r,void 0);return isNaN(n)?dl(r,NaN):(n&&l.setDate(l.getDate()+n),l)}function qP(r,n,i){return dl(r,+Di(r)+n)}function C1(r,n,i){return qP(r,n*VP)}let WP={};function Zy(){return WP}function Ag(r,n){var i,l,c,h;const m=Zy(),D=(n==null?void 0:n.weekStartsOn)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.weekStartsOn)??m.weekStartsOn??((h=(c=m.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??0,C=Di(r,n==null?void 0:n.in),T=C.getDay(),$=(T<D?7:0)+T-D;return C.setDate(C.getDate()-$),C.setHours(0,0,0,0),C}function eb(r,n){return Ag(r,{...n,weekStartsOn:1})}function x1(r,n){const i=Di(r,void 0),l=i.getFullYear(),c=dl(i,0);c.setFullYear(l+1,0,4),c.setHours(0,0,0,0);const h=eb(c),m=dl(i,0);m.setFullYear(l,0,4),m.setHours(0,0,0,0);const D=eb(m);return i.getTime()>=h.getTime()?l+1:i.getTime()>=D.getTime()?l:l-1}function _1(r){const n=Di(r),i=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return i.setUTCFullYear(n.getFullYear()),+r-+i}function E1(r,...n){const i=dl.bind(null,n.find(l=>typeof l=="object"));return n.map(i)}function l0(r,n){const i=Di(r,void 0);return i.setHours(0,0,0,0),i}function YP(r,n,i){const[l,c]=E1(void 0,r,n),h=l0(l),m=l0(c),D=+h-_1(h),C=+m-_1(m);return Math.round((D-C)/HP)}function GP(r,n){const i=x1(r),l=dl(r,0);return l.setFullYear(i,0,4),l.setHours(0,0,0,0),eb(l)}function KP(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function QP(r){return!(!KP(r)&&typeof r!="number"||isNaN(+Di(r)))}function XP(r,n){const i=Di(r,void 0);return i.setHours(23,59,59,999),i}function JP(r,n){const[i,l]=E1(r,n.start,n.end);return{start:i,end:l}}function u0(r,n){const{start:i,end:l}=JP(void 0,r);let c=+i>+l;const h=c?+i:+l,m=c?l:i;m.setHours(0,0,0,0);let D=1;const C=[];for(;+m<=h;)C.push(dl(i,m)),m.setDate(m.getDate()+D),m.setHours(0,0,0,0);return c?C.reverse():C}function ZP(r,n){const i=Di(r,void 0);return i.setFullYear(i.getFullYear(),0,1),i.setHours(0,0,0,0),i}const eN={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"}},tN=(r,n,i)=>{let l;const c=eN[r];return typeof c=="string"?l=c:n===1?l=c.one:l=c.other.replace("{{count}}",n.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+l:l+" ago":l};function c0(r){return(n={})=>{const i=n.width?String(n.width):r.defaultWidth;return r.formats[i]||r.formats[r.defaultWidth]}}const nN={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},rN={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},aN={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iN={date:c0({formats:nN,defaultWidth:"full"}),time:c0({formats:rN,defaultWidth:"full"}),dateTime:c0({formats:aN,defaultWidth:"full"})},oN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sN=(r,n,i,l)=>oN[r];function Fg(r){return(n,i)=>{const l=i!=null&&i.context?String(i.context):"standalone";let c;if(l==="formatting"&&r.formattingValues){const m=r.defaultFormattingWidth||r.defaultWidth,D=i!=null&&i.width?String(i.width):m;c=r.formattingValues[D]||r.formattingValues[m]}else{const m=r.defaultWidth,D=i!=null&&i.width?String(i.width):r.defaultWidth;c=r.values[D]||r.values[m]}const h=r.argumentCallback?r.argumentCallback(n):n;return c[h]}}const lN={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uN={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cN={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"]},dN={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"]},fN={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"}},pN={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"}},hN=(r,n)=>{const i=Number(r),l=i%100;if(l>20||l<10)switch(l%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},mN={ordinalNumber:hN,era:Fg({values:lN,defaultWidth:"wide"}),quarter:Fg({values:uN,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Fg({values:cN,defaultWidth:"wide"}),day:Fg({values:dN,defaultWidth:"wide"}),dayPeriod:Fg({values:fN,defaultWidth:"wide",formattingValues:pN,defaultFormattingWidth:"wide"})};function $g(r){return(n,i={})=>{const l=i.width,c=l&&r.matchPatterns[l]||r.matchPatterns[r.defaultMatchWidth],h=n.match(c);if(!h)return null;const m=h[0],D=l&&r.parsePatterns[l]||r.parsePatterns[r.defaultParseWidth],C=Array.isArray(D)?vN(D,N=>N.test(m)):gN(D,N=>N.test(m));let T;T=r.valueCallback?r.valueCallback(C):C,T=i.valueCallback?i.valueCallback(T):T;const $=n.slice(m.length);return{value:T,rest:$}}}function gN(r,n){for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&n(r[i]))return i}function vN(r,n){for(let i=0;i<r.length;i++)if(n(r[i]))return i}function yN(r){return(n,i={})=>{const l=n.match(r.matchPattern);if(!l)return null;const c=l[0],h=n.match(r.parsePattern);if(!h)return null;let m=r.valueCallback?r.valueCallback(h[0]):h[0];m=i.valueCallback?i.valueCallback(m):m;const D=n.slice(c.length);return{value:m,rest:D}}}const bN=/^(\d+)(th|st|nd|rd)?/i,kN=/\d+/i,wN={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},DN={any:[/^b/i,/^(a|c)/i]},SN={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},CN={any:[/1/i,/2/i,/3/i,/4/i]},xN={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},_N={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]},EN={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},TN={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]},AN={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},FN={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}},$N={ordinalNumber:yN({matchPattern:bN,parsePattern:kN,valueCallback:r=>parseInt(r,10)}),era:$g({matchPatterns:wN,defaultMatchWidth:"wide",parsePatterns:DN,defaultParseWidth:"any"}),quarter:$g({matchPatterns:SN,defaultMatchWidth:"wide",parsePatterns:CN,defaultParseWidth:"any",valueCallback:r=>r+1}),month:$g({matchPatterns:xN,defaultMatchWidth:"wide",parsePatterns:_N,defaultParseWidth:"any"}),day:$g({matchPatterns:EN,defaultMatchWidth:"wide",parsePatterns:TN,defaultParseWidth:"any"}),dayPeriod:$g({matchPatterns:AN,defaultMatchWidth:"any",parsePatterns:FN,defaultParseWidth:"any"})},PN={code:"en-US",formatDistance:tN,formatLong:iN,formatRelative:sN,localize:mN,match:$N,options:{weekStartsOn:0,firstWeekContainsDate:1}};function NN(r,n){const i=Di(r,void 0);return YP(i,ZP(i))+1}function ON(r,n){const i=Di(r,void 0),l=+eb(i)-+GP(i);return Math.round(l/D1)+1}function T1(r,n){var i,l,c,h;const m=Di(r,n==null?void 0:n.in),D=m.getFullYear(),C=Zy(),T=(n==null?void 0:n.firstWeekContainsDate)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??C.firstWeekContainsDate??((h=(c=C.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,$=dl((n==null?void 0:n.in)||r,0);$.setFullYear(D+1,0,T),$.setHours(0,0,0,0);const N=Ag($,n),O=dl((n==null?void 0:n.in)||r,0);O.setFullYear(D,0,T),O.setHours(0,0,0,0);const R=Ag(O,n);return+m>=+N?D+1:+m>=+R?D:D-1}function RN(r,n){var i,l,c,h;const m=Zy(),D=(n==null?void 0:n.firstWeekContainsDate)??((l=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:l.firstWeekContainsDate)??m.firstWeekContainsDate??((h=(c=m.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,C=T1(r,n),T=dl((n==null?void 0:n.in)||r,0);return T.setFullYear(C,0,D),T.setHours(0,0,0,0),Ag(T,n)}function A1(r,n){const i=Di(r,n==null?void 0:n.in),l=+Ag(i,n)-+RN(i,n);return Math.round(l/D1)+1}function ar(r,n){const i=r<0?"-":"",l=Math.abs(r).toString().padStart(n,"0");return i+l}const wd={y(r,n){const i=r.getFullYear(),l=i>0?i:1-i;return ar(n==="yy"?l%100:l,n.length)},M(r,n){const i=r.getMonth();return n==="M"?String(i+1):ar(i+1,2)},d(r,n){return ar(r.getDate(),n.length)},a(r,n){const i=r.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h(r,n){return ar(r.getHours()%12||12,n.length)},H(r,n){return ar(r.getHours(),n.length)},m(r,n){return ar(r.getMinutes(),n.length)},s(r,n){return ar(r.getSeconds(),n.length)},S(r,n){const i=n.length,l=r.getMilliseconds(),c=Math.trunc(l*Math.pow(10,i-3));return ar(c,n.length)}},xh={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},F1={G:function(r,n,i){const l=r.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return i.era(l,{width:"abbreviated"});case"GGGGG":return i.era(l,{width:"narrow"});case"GGGG":default:return i.era(l,{width:"wide"})}},y:function(r,n,i){if(n==="yo"){const l=r.getFullYear(),c=l>0?l:1-l;return i.ordinalNumber(c,{unit:"year"})}return wd.y(r,n)},Y:function(r,n,i,l){const c=T1(r,l),h=c>0?c:1-c;if(n==="YY"){const m=h%100;return ar(m,2)}return n==="Yo"?i.ordinalNumber(h,{unit:"year"}):ar(h,n.length)},R:function(r,n){const i=x1(r);return ar(i,n.length)},u:function(r,n){const i=r.getFullYear();return ar(i,n.length)},Q:function(r,n,i){const l=Math.ceil((r.getMonth()+1)/3);switch(n){case"Q":return String(l);case"QQ":return ar(l,2);case"Qo":return i.ordinalNumber(l,{unit:"quarter"});case"QQQ":return i.quarter(l,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(l,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(l,{width:"wide",context:"formatting"})}},q:function(r,n,i){const l=Math.ceil((r.getMonth()+1)/3);switch(n){case"q":return String(l);case"qq":return ar(l,2);case"qo":return i.ordinalNumber(l,{unit:"quarter"});case"qqq":return i.quarter(l,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(l,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(l,{width:"wide",context:"standalone"})}},M:function(r,n,i){const l=r.getMonth();switch(n){case"M":case"MM":return wd.M(r,n);case"Mo":return i.ordinalNumber(l+1,{unit:"month"});case"MMM":return i.month(l,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(l,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(l,{width:"wide",context:"formatting"})}},L:function(r,n,i){const l=r.getMonth();switch(n){case"L":return String(l+1);case"LL":return ar(l+1,2);case"Lo":return i.ordinalNumber(l+1,{unit:"month"});case"LLL":return i.month(l,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(l,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(l,{width:"wide",context:"standalone"})}},w:function(r,n,i,l){const c=A1(r,l);return n==="wo"?i.ordinalNumber(c,{unit:"week"}):ar(c,n.length)},I:function(r,n,i){const l=ON(r);return n==="Io"?i.ordinalNumber(l,{unit:"week"}):ar(l,n.length)},d:function(r,n,i){return n==="do"?i.ordinalNumber(r.getDate(),{unit:"date"}):wd.d(r,n)},D:function(r,n,i){const l=NN(r);return n==="Do"?i.ordinalNumber(l,{unit:"dayOfYear"}):ar(l,n.length)},E:function(r,n,i){const l=r.getDay();switch(n){case"E":case"EE":case"EEE":return i.day(l,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(l,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(l,{width:"short",context:"formatting"});case"EEEE":default:return i.day(l,{width:"wide",context:"formatting"})}},e:function(r,n,i,l){const c=r.getDay(),h=(c-l.weekStartsOn+8)%7||7;switch(n){case"e":return String(h);case"ee":return ar(h,2);case"eo":return i.ordinalNumber(h,{unit:"day"});case"eee":return i.day(c,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(c,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(c,{width:"short",context:"formatting"});case"eeee":default:return i.day(c,{width:"wide",context:"formatting"})}},c:function(r,n,i,l){const c=r.getDay(),h=(c-l.weekStartsOn+8)%7||7;switch(n){case"c":return String(h);case"cc":return ar(h,n.length);case"co":return i.ordinalNumber(h,{unit:"day"});case"ccc":return i.day(c,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(c,{width:"narrow",context:"standalone"});case"cccccc":return i.day(c,{width:"short",context:"standalone"});case"cccc":default:return i.day(c,{width:"wide",context:"standalone"})}},i:function(r,n,i){const l=r.getDay(),c=l===0?7:l;switch(n){case"i":return String(c);case"ii":return ar(c,n.length);case"io":return i.ordinalNumber(c,{unit:"day"});case"iii":return i.day(l,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(l,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(l,{width:"short",context:"formatting"});case"iiii":default:return i.day(l,{width:"wide",context:"formatting"})}},a:function(r,n,i){const l=r.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return i.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(r,n,i){const l=r.getHours();let c;switch(l===12?c=xh.noon:l===0?c=xh.midnight:c=l/12>=1?"pm":"am",n){case"b":case"bb":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(c,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(c,{width:"wide",context:"formatting"})}},B:function(r,n,i){const l=r.getHours();let c;switch(l>=17?c=xh.evening:l>=12?c=xh.afternoon:l>=4?c=xh.morning:c=xh.night,n){case"B":case"BB":case"BBB":return i.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(c,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(c,{width:"wide",context:"formatting"})}},h:function(r,n,i){if(n==="ho"){let l=r.getHours()%12;return l===0&&(l=12),i.ordinalNumber(l,{unit:"hour"})}return wd.h(r,n)},H:function(r,n,i){return n==="Ho"?i.ordinalNumber(r.getHours(),{unit:"hour"}):wd.H(r,n)},K:function(r,n,i){const l=r.getHours()%12;return n==="Ko"?i.ordinalNumber(l,{unit:"hour"}):ar(l,n.length)},k:function(r,n,i){let l=r.getHours();return l===0&&(l=24),n==="ko"?i.ordinalNumber(l,{unit:"hour"}):ar(l,n.length)},m:function(r,n,i){return n==="mo"?i.ordinalNumber(r.getMinutes(),{unit:"minute"}):wd.m(r,n)},s:function(r,n,i){return n==="so"?i.ordinalNumber(r.getSeconds(),{unit:"second"}):wd.s(r,n)},S:function(r,n){return wd.S(r,n)},X:function(r,n,i){const l=r.getTimezoneOffset();if(l===0)return"Z";switch(n){case"X":return P1(l);case"XXXX":case"XX":return Bf(l);case"XXXXX":case"XXX":default:return Bf(l,":")}},x:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"x":return P1(l);case"xxxx":case"xx":return Bf(l);case"xxxxx":case"xxx":default:return Bf(l,":")}},O:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+$1(l,":");case"OOOO":default:return"GMT"+Bf(l,":")}},z:function(r,n,i){const l=r.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+$1(l,":");case"zzzz":default:return"GMT"+Bf(l,":")}},t:function(r,n,i){const l=Math.trunc(+r/1e3);return ar(l,n.length)},T:function(r,n,i){return ar(+r,n.length)}};function $1(r,n=""){const i=r>0?"-":"+",l=Math.abs(r),c=Math.trunc(l/60),h=l%60;return h===0?i+String(c):i+String(c)+n+ar(h,2)}function P1(r,n){return r%60===0?(r>0?"-":"+")+ar(Math.abs(r)/60,2):Bf(r,n)}function Bf(r,n=""){const i=r>0?"-":"+",l=Math.abs(r),c=ar(Math.trunc(l/60),2),h=ar(l%60,2);return i+c+n+h}const N1=(r,n)=>{switch(r){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},O1=(r,n)=>{switch(r){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},LN=(r,n)=>{const i=r.match(/(P+)(p+)?/)||[],l=i[1],c=i[2];if(!c)return N1(r,n);let h;switch(l){case"P":h=n.dateTime({width:"short"});break;case"PP":h=n.dateTime({width:"medium"});break;case"PPP":h=n.dateTime({width:"long"});break;case"PPPP":default:h=n.dateTime({width:"full"});break}return h.replace("{{date}}",N1(l,n)).replace("{{time}}",O1(c,n))},BN={p:O1,P:LN},MN=/^D+$/,IN=/^Y+$/,jN=["D","DD","YY","YYYY"];function zN(r){return MN.test(r)}function UN(r){return IN.test(r)}function HN(r,n,i){const l=VN(r,n,i);if(console.warn(l),jN.includes(r))throw new RangeError(l)}function VN(r,n,i){const l=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${n}\`) for formatting ${l} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const qN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YN=/^'([^]*?)'?$/,GN=/''/g,KN=/[a-zA-Z]/;function QN(r,n,i){var l,c,h,m;const D=Zy(),C=D.locale??PN,T=D.firstWeekContainsDate??((c=(l=D.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??1,$=D.weekStartsOn??((m=(h=D.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,N=Di(r,void 0);if(!QP(N))throw new RangeError("Invalid time value");let O=n.match(WN).map(I=>{const K=I[0];if(K==="p"||K==="P"){const Y=BN[K];return Y(I,C.formatLong)}return I}).join("").match(qN).map(I=>{if(I==="''")return{isToken:!1,value:"'"};const K=I[0];if(K==="'")return{isToken:!1,value:XN(I)};if(F1[K])return{isToken:!0,value:I};if(K.match(KN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+K+"`");return{isToken:!1,value:I}});C.localize.preprocessor&&(O=C.localize.preprocessor(N,O));const R={firstWeekContainsDate:T,weekStartsOn:$,locale:C};return O.map(I=>{if(!I.isToken)return I.value;const K=I.value;(UN(K)||zN(K))&&HN(K,n,String(r));const Y=F1[K[0]];return Y(N,K,C.localize,R)}).join("")}function XN(r){const n=r.match(YN);return n?n[1].replace(GN,"'"):r}function JN(r,n){const i=Di(r,void 0).getDay();return i===0?7:i}function ZN(r,n,i){const l=Di(r,void 0);return l.setHours(n),l}const R1={},Pg={};function Ng(r,n){try{const i=(R1[r]||(R1[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(n).split("GMT")[1]||"";return i in Pg?Pg[i]:L1(i,i.split(":"))}catch{if(r in Pg)return Pg[r];const i=r==null?void 0:r.match(e3);return i?L1(r,i.slice(1)):NaN}}const e3=/([+-]\d\d):?(\d\d)?/;function L1(r,n){const i=+n[0],l=+(n[1]||0);return Pg[r]=i>0?i*60+l:i*60-l}let Og=class Oy extends Date{constructor(...n){super(),n.length>1&&typeof n[n.length-1]=="string"&&(this.timeZone=n.pop()),this.internal=new Date,isNaN(Ng(this.timeZone,this))?this.setTime(NaN):n.length?typeof n[0]=="number"&&(n.length===1||n.length===2&&typeof n[1]!="number")?this.setTime(n[0]):typeof n[0]=="string"?this.setTime(+new Date(n[0])):n[0]instanceof Date?this.setTime(+n[0]):(this.setTime(+new Date(...n)),M1(this),d0(this)):this.setTime(Date.now())}static tz(n,...i){return i.length?new Oy(...i,n):new Oy(Date.now(),n)}withTimeZone(n){return new Oy(+this,n)}getTimezoneOffset(){return-Ng(this.timeZone,this)}setTime(n){return Date.prototype.setTime.apply(this,arguments),d0(this),+this}[Symbol.for("constructDateFrom")](n){return new Oy(+new Date(n),this.timeZone)}};const B1=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!B1.test(r))return;const n=r.replace(B1,"$1UTC");Og.prototype[n]&&(r.startsWith("get")?Og.prototype[r]=function(){return this.internal[n]()}:(Og.prototype[r]=function(){return Date.prototype[n].apply(this.internal,arguments),t3(this),+this},Og.prototype[n]=function(){return Date.prototype[n].apply(this,arguments),d0(this),+this}))});function d0(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function t3(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),M1(r)}function M1(r){const n=Ng(r.timeZone,r),i=new Date(+r);i.setUTCHours(i.getUTCHours()-1);const l=-new Date(+r).getTimezoneOffset(),c=-new Date(+i).getTimezoneOffset(),h=l-c,m=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();h&&m&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+h);const D=l-n;D&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+D);const C=Ng(r.timeZone,r),T=-new Date(+r).getTimezoneOffset()-C,$=C!==n,N=T-D;if($&&N){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+N);const O=Ng(r.timeZone,r),R=C-O;R&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+R),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+R))}}let tb=class Ry extends Og{static tz(n,...i){return i.length?new Ry(...i,n):new Ry(Date.now(),n)}toISOString(){const[n,i,l]=this.tzComponents(),c=`${n}${i}:${l}`;return this.internal.toISOString().slice(0,-1)+c}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[n,i,l,c]=this.internal.toUTCString().split(" ");return`${n==null?void 0:n.slice(0,-1)} ${l} ${i} ${c}`}toTimeString(){const n=this.internal.toUTCString().split(" ")[4],[i,l,c]=this.tzComponents();return`${n} GMT${i}${l}${c} (${n3(this.timeZone,this)})`}toLocaleString(n,i){return Date.prototype.toLocaleString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}toLocaleDateString(n,i){return Date.prototype.toLocaleDateString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}toLocaleTimeString(n,i){return Date.prototype.toLocaleTimeString.call(this,n,{...i,timeZone:(i==null?void 0:i.timeZone)||this.timeZone})}tzComponents(){const n=this.getTimezoneOffset(),i=n>0?"-":"+",l=String(Math.floor(Math.abs(n)/60)).padStart(2,"0"),c=String(Math.abs(n)%60).padStart(2,"0");return[i,l,c]}withTimeZone(n){return new Ry(+this,n)}[Symbol.for("constructDateFrom")](n){return new Ry(+new Date(n),this.timeZone)}};function n3(r,n){return new Intl.DateTimeFormat("en-GB",{timeZone:r,timeZoneName:"long"}).format(n).slice(12)}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Va=r=>r.toISOString().split("T")[0],f0=r=>{if(!r)return null;const n=C1(new tb(r,window.pktTz),12);return isNaN(n.getTime())?null:n},I1=(r,n)=>{const i=Qr(r);return isNaN(i.getTime())?"":QN(i,n)},Qr=(r="",n)=>{const i=r===""||!r?new Date:r;return n?new tb(n==="end"?XP(i):l0(i),window.pktTz):ZN(new tb(i.toString(),window.pktTz),12)},Dd=(r,n,i=1)=>C1(new tb(r,n,i,window.pktTz),12),r3=r=>new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(r),j1=r=>{if(Array.isArray(r))return r;if(typeof r=="string")return r.split(",")},a3=r=>r?new Date(r):null,i3=r=>{if(typeof r=="string")return r.split(",").map(n=>new Date(n));if(Array.isArray(r))return r.map(n=>new Date(n))},_h={csvToArray:j1,stringToDate:a3,stringsToDate:i3},o3={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},Mf={props:o3};var s3=Object.defineProperty,l3=Object.getOwnPropertyDescriptor,fr=(r,n,i,l)=>{for(var c=l>1?void 0:l?l3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&s3(n,i,c),c};let ir=class extends Hr{constructor(){super(...arguments),this.multiple=Mf.props.multiple.default,this.maxMultiple=Mf.props.maxMultiple.default,this.range=Mf.props.range.default,this.weeknumbers=Mf.props.weeknumbers.default,this.withcontrols=Mf.props.withcontrols.default,this.selected=[],this.earliest=Mf.props.earliest.default,this.latest=Mf.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.year=0,this.month=0,this.week=0,this.rangeHovered=null,this.inRange={},this.focusedDate=null,this.selectableDates=[],this.currentmonthtouched=!1,this.tabIndexSet=0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}attributeChangedCallback(n,i,l){n==="selected"&&l&&this.convertSelected(),super.attributeChangedCallback(n,i,l)}updated(n){super.updated(n),n.has("selected")&&this.convertSelected()}firstUpdated(n){this.addEventListener("keydown",this.handleKeydown)}convertSelected(){if(typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=this.selected.map(n=>Qr(n)),this.range&&this.selected.length===2){const n=u0({start:Qr(this.selected[0]),end:Qr(this.selected[1])});if(this.inRange={},Array.isArray(n)&&n.length){const i={};for(let l=0;l<n.length;l++)i[Va(n[l])]=this.isInRange(n[l]);this.inRange=i}}this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched){this.currentmonthtouched=!0;return}this.selected.length&&this.selected[0]!==""?this.currentmonth=Qr(this.selected[this.selected.length-1]):this.currentmonth===null&&(this.currentmonth=Qr()),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(n){switch(n.key){case"ArrowLeft":this.handleArrowKey(n,-1);break;case"ArrowRight":this.handleArrowKey(n,1);break;case"ArrowUp":this.handleArrowKey(n,-7);break;case"ArrowDown":this.handleArrowKey(n,7);break}}handleArrowKey(n,i){var l,c,h;if(((l=n.target)==null?void 0:l.nodeName)==="INPUT"||((c=n.target)==null?void 0:c.nodeName)==="SELECT"||((h=n.target)==null?void 0:h.nodeName)==="BUTTON")return;n.preventDefault(),this.focusedDate||this.focusOnCurrentDate();const m=this.focusedDate?Qr(this.focusedDate):Dd(this.year,this.month,1);let D=s0(m,i);if(D){let C=this.querySelector(`div[data-date="${Va(D)}"]`);if(C instanceof HTMLDivElement){if(C.dataset.disabled){D=s0(D,i);let T=this.querySelector(`div[data-date="${Va(D)}"]`);for(;T&&T instanceof HTMLDivElement&&T.dataset.disabled;)D=s0(D,i),T=this.querySelector(`div[data-date="${Va(D)}"]`);C=T}C instanceof HTMLDivElement&&!C.dataset.disabled&&(this.focusedDate=Va(D),C.focus())}}}render(){return we`
|
|
429
429
|
<div
|
|
430
430
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":qe}"
|
|
431
431
|
@focusout=${this.closeEvent}
|
|
@@ -1111,11 +1111,10 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
1111
1111
|
`}handleCalendarPosition(){var n;if(this.popupRef.value&&this.inputRef.value){const i=this.multiple&&!!this.maxlength,l=((n=this.inputRef.value.parentElement)==null?void 0:n.getBoundingClientRect())||this.inputRef.value.getBoundingClientRect(),c=i?l.height+30:l.height,h=this.popupRef.value.getBoundingClientRect().height;let m=i?"calc(100% - 30px)":"100%";l&&l.top+h>window.innerHeight&&l.top-h>0&&(m=`calc(100% - ${c}px - ${h}px)`),this.popupRef.value.style.top=m}}handleFocusOut(n){this.contains(n.target)||(this.onBlur(),this.hideCalendar())}async showCalendar(){var n;this.calendarOpen=!0,await W1(20),this.handleCalendarPosition(),this.isMobileSafari&&((n=this.calRef.value)==null||n.focusOnCurrentDate())}hideCalendar(){this.calendarOpen=!1}async toggleCalendar(n){n.preventDefault(),this.calendarOpen?this.hideCalendar():this.showCalendar()}};ha([z({type:String,reflect:!0})],Jr.prototype,"value",2),ha([z({type:Array})],Jr.prototype,"_value",2),ha([z({type:String,reflect:!0})],Jr.prototype,"label",2),ha([z({type:String})],Jr.prototype,"dateformat",2),ha([z({type:Boolean,reflect:!0})],Jr.prototype,"multiple",2),ha([z({type:Number,reflect:!0})],Jr.prototype,"maxlength",2),ha([z({type:Boolean,reflect:!0})],Jr.prototype,"range",2),ha([z({type:Boolean})],Jr.prototype,"showRangeLabels",2),ha([z({type:String,reflect:!0})],Jr.prototype,"min",2),ha([z({type:String,reflect:!0})],Jr.prototype,"max",2),ha([z({type:Boolean})],Jr.prototype,"weeknumbers",2),ha([z({type:Boolean,reflect:!0})],Jr.prototype,"withcontrols",2),ha([z({converter:_h.csvToArray})],Jr.prototype,"excludedates",2),ha([z({converter:_h.csvToArray})],Jr.prototype,"excludeweekdays",2),ha([z({type:String})],Jr.prototype,"currentmonth",2),ha([z({type:Boolean,reflect:!0})],Jr.prototype,"calendarOpen",2),ha([z({type:String})],Jr.prototype,"timezone",2),ha([$n()],Jr.prototype,"inputClasses",2),ha([$n()],Jr.prototype,"buttonClasses",2),Jr=ha([dr("pkt-datepicker")],Jr);var L3=Object.defineProperty,B3=Object.getOwnPropertyDescriptor,Ah=(r,n,i,l)=>{for(var c=l>1?void 0:l?B3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&L3(n,i,c),c};let zf=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.size="medium",this.level=2,this.noSpacing=!0,this.visuallyHidden=!1,this.align="start",this.slotController=new xa(this,this.defaultSlot)}render(){const n={"pkt-heading":!0,[`pkt-heading--${this.size}`]:this.size,"pkt-heading--noSpacing":this.noSpacing,"pkt-sr-only":this.visuallyHidden,[`pkt-heading--${this.align}`]:this.align};switch(this.level){case 2:return we`<h2 class=${It(n)} ${qt(this.defaultSlot)}></h2>`;case 3:return we`<h3 class=${It(n)} ${qt(this.defaultSlot)}></h3>`;case 4:return we`<h4 class=${It(n)} ${qt(this.defaultSlot)}></h4>`;case 5:return we`<h5 class=${It(n)} ${qt(this.defaultSlot)}></h5>`;case 6:return we`<h6 class=${It(n)} ${qt(this.defaultSlot)}></h6>`;case 1:default:return we`<h1 class=${It(n)} ${qt(this.defaultSlot)}></h1>`}}};Ah([z({type:String,reflect:!0})],zf.prototype,"size",2),Ah([z({type:Number,reflect:!0})],zf.prototype,"level",2),Ah([z({type:Boolean,reflect:!0})],zf.prototype,"noSpacing",2),Ah([z({type:Boolean,reflect:!0})],zf.prototype,"visuallyHidden",2),Ah([z({type:String,reflect:!0})],zf.prototype,"align",2),zf=Ah([dr("pkt-heading")],zf);const M3={href:{default:"#"},target:{default:"_self"},external:{default:!1}},m0={props:M3};var I3=Object.defineProperty,j3=Object.getOwnPropertyDescriptor,Fh=(r,n,i,l)=>{for(var c=l>1?void 0:l?j3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&I3(n,i,c),c};let xd=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.href=m0.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=m0.props.external.default,this.target=m0.props.target.default,this.slotController=new xa(this,this.defaultSlot)}render(){const n={"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 we`<a
|
|
1112
1112
|
class=${It(n)}
|
|
1113
1113
|
href=${this.href}
|
|
1114
|
-
@click=${this.handleClick}
|
|
1115
1114
|
.target=${this.target}
|
|
1116
1115
|
.rel=${this.external?"noopener noreferrer":qe}
|
|
1117
1116
|
>${this.iconName?we`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${qt(this.defaultSlot)}>Link</span></a
|
|
1118
|
-
>`}
|
|
1117
|
+
>`}};Fh([z({type:String,reflect:!0})],xd.prototype,"href",2),Fh([z({type:String,reflect:!0})],xd.prototype,"iconName",2),Fh([z({type:String,reflect:!0})],xd.prototype,"iconPosition",2),Fh([z({type:Boolean,reflect:!0})],xd.prototype,"external",2),Fh([z({type:String,reflect:!0})],xd.prototype,"target",2),xd=Fh([dr("pkt-link")],xd);var z3=Object.defineProperty,U3=Object.getOwnPropertyDescriptor,Uf=(r,n,i,l)=>{for(var c=l>1?void 0:l?U3(n,i):n,h=r.length-1,m;h>=0;h--)(m=r[h])&&(c=(l?m(n,i,c):m(c))||c);return l&&c&&z3(n,i,c),c};let pc=class extends Hr{constructor(){super(),this.defaultSlot=dn(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new xa(this,this.defaultSlot)}render(){const n=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),i=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return we`
|
|
1119
1118
|
<a
|
|
1120
1119
|
href=${this.href}
|
|
1121
1120
|
class=${n}
|
|
@@ -1417,7 +1416,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
1417
1416
|
Copyright (c) 2018 Jed Watson.
|
|
1418
1417
|
Licensed under the MIT License (MIT), see
|
|
1419
1418
|
http://jedwatson.github.io/classnames
|
|
1420
|
-
*/(function(r){(function(){var n={}.hasOwnProperty;function i(){for(var h="",m=0;m<arguments.length;m++){var D=arguments[m];D&&(h=c(h,l(D)))}return h}function l(h){if(typeof h=="string"||typeof h=="number")return h;if(typeof h!="object")return"";if(Array.isArray(h))return i.apply(null,h);if(h.toString!==Object.prototype.toString&&!h.toString.toString().includes("[native code]"))return h.toString();var m="";for(var D in h)n.call(h,D)&&h[D]&&(m=c(m,D));return m}function c(h,m){return m?h?h+" "+m:h+m:h}r.exports?(i.default=i,r.exports=i):window.classNames=i})()})(ex);var DO=ex.exports;const fl=By(DO),SO=$e.forwardRef(({className:r,logoLink:n="https://www.oslo.kommune.no/",serviceName:i,fixed:l=!0,scrollToHide:c=!0,user:h,userMenu:m,representing:D,userOptions:C,userMenuFooter:T,canChangeRepresentation:$=!0,showMenuButton:N=!1,showLogOutButton:O=!1,openMenu:R,logOut:I,changeRepresentation:K,children:Y,...Ce},J)=>{const G=$e.useMemo(()=>typeof(h==null?void 0:h.lastLoggedIn)=="string"?h.lastLoggedIn:h!=null&&h.lastLoggedIn?new Date(h.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[h]),[re,V]=$e.useState(!1),[ae,ce]=$e.useState(0),[Te,be]=$e.useState(!1),Ge=$e.useRef(null);$e.useEffect(()=>(document&&(document.addEventListener("mouseup",Ke),window.addEventListener("scroll",nt)),()=>{document&&(document.removeEventListener("mouseup",Ke),window.removeEventListener("scroll",nt))}));const We=()=>{be(!Te)},Ke=He=>{Ge.current&&!Ge.current.contains(He.target)&&be(!1)},nt=()=>{if(c){const He=window.pageYOffset||document.documentElement.scrollTop;if(He<0||Math.abs(He-ae)<60)return;V(He>ae),ce(He)}};return B.jsxs("header",{...Ce,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:fl(r,"pkt-header",{"pkt-header--fixed":l,"pkt-header--scroll-to-hide":c,"pkt-header--hidden":re}),ref:J,children:[B.jsxs("div",{className:"pkt-header__logo",children:[typeof n=="string"?B.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:n,children:B.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.38/logos/"})}):B.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:n,children:B.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.38/logos/"})}),B.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:i})]}),B.jsx("nav",{className:"pkt-header__actions",children:B.jsxs("ul",{className:"pkt-header__actions-row",children:[N&&B.jsx("li",{children:B.jsx(Fd,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:R,children:"Meny"})}),(h||D)&&B.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Te&&!re?"pkt-header--open-dropdown":""}`,ref:Ge,children:[B.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":Te,onClick:We,children:[B.jsx(br,{name:"user",className:"pkt-btn__icon"}),B.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(D==null?void 0:D.name)||(h==null?void 0:h.name)}),B.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(D==null?void 0:D.shortname)||(h==null?void 0:h.shortname)}),B.jsx(br,{name:"chevron-thin-down",className:"pkt-btn--closed"}),B.jsx(br,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),B.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[h&&B.jsxs("li",{children:[B.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),B.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.lastLoggedIn&&B.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",B.jsx("time",{children:G})]})]}),m&&B.jsx("li",{children:B.jsx("ul",{className:"pkt-list",children:m.map((He,dt)=>B.jsx("li",{children:typeof He.target=="string"?B.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&B.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):B.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&B.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userMenu-${dt}`))})}),(D||$)&&B.jsxs("li",{children:[D&&B.jsxs(B.Fragment,{children:[B.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),B.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:D.name}),D.orgNumber&&B.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",D.orgNumber]})]}),B.jsx("ul",{className:"pkt-list mt-size-16",children:$&&B.jsx("li",{children:B.jsxs("button",{className:"pkt-link-button pkt-link",onClick:K,children:[B.jsx(br,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),B.jsx("li",{children:B.jsx("ul",{className:"pkt-list",children:(C||!O)&&B.jsxs(B.Fragment,{children:[C==null?void 0:C.map((He,dt)=>B.jsx("li",{children:typeof He.target=="string"?B.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&B.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):B.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&B.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userOptions-${dt}`)),!O&&B.jsx("li",{children:B.jsxs("button",{className:"pkt-link-button pkt-link",onClick:I,children:[B.jsx(br,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),T&&B.jsx("li",{className:"footer",children:B.jsx("ul",{className:"pkt-list-horizontal bordered",children:T.map((He,dt)=>B.jsx("li",{children:typeof He.target=="string"?B.jsx("a",{href:He.target,className:"pkt-link",children:He.title}):B.jsx("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:He.title})},`userMenuFooter-${dt}`))})})]})]}),Y&&B.jsx("li",{children:Y}),O&&B.jsx("li",{children:B.jsx(Fd,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:I,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),CO=Or({tagName:"pkt-helptext",elementClass:Sd,react:$e,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),tx=$e.forwardRef(({children:r,...n},i)=>B.jsx(CO,{...n,ref:i,children:B.jsx("div",{className:"pkt-contents",children:r})}));tx.displayName="PktHelptext";const nx=$e.forwardRef(({label:r,id:n,children:i,...l},c)=>B.jsxs("div",{className:"pkt-form-group",children:[B.jsx("label",{htmlFor:n,className:"pkt-form-label",children:r}),B.jsx("input",{className:"pkt-form-input",id:n,...l,ref:c}),i]}));nx.displayName="PktInput";const xO=Or({tagName:"pkt-input-wrapper",elementClass:yr,react:$e,displayName:"PktInputWrapper",events:{onToggleHelpText:"toggleHelpText"}}),rx=$e.forwardRef(({children:r,helptext:n,...i},l)=>B.jsxs(xO,{ref:l,...i,children:[B.jsx("div",{className:"pkt-contents",slot:"helptext",children:n}),B.jsx("div",{className:"pkt-contents",children:r})]})),_O=Or({tagName:"pkt-link",elementClass:xd,react:$e,displayName:"PktLink"
|
|
1419
|
+
*/(function(r){(function(){var n={}.hasOwnProperty;function i(){for(var h="",m=0;m<arguments.length;m++){var D=arguments[m];D&&(h=c(h,l(D)))}return h}function l(h){if(typeof h=="string"||typeof h=="number")return h;if(typeof h!="object")return"";if(Array.isArray(h))return i.apply(null,h);if(h.toString!==Object.prototype.toString&&!h.toString.toString().includes("[native code]"))return h.toString();var m="";for(var D in h)n.call(h,D)&&h[D]&&(m=c(m,D));return m}function c(h,m){return m?h?h+" "+m:h+m:h}r.exports?(i.default=i,r.exports=i):window.classNames=i})()})(ex);var DO=ex.exports;const fl=By(DO),SO=$e.forwardRef(({className:r,logoLink:n="https://www.oslo.kommune.no/",serviceName:i,fixed:l=!0,scrollToHide:c=!0,user:h,userMenu:m,representing:D,userOptions:C,userMenuFooter:T,canChangeRepresentation:$=!0,showMenuButton:N=!1,showLogOutButton:O=!1,openMenu:R,logOut:I,changeRepresentation:K,children:Y,...Ce},J)=>{const G=$e.useMemo(()=>typeof(h==null?void 0:h.lastLoggedIn)=="string"?h.lastLoggedIn:h!=null&&h.lastLoggedIn?new Date(h.lastLoggedIn).toLocaleString("nb-NO",{year:"numeric",month:"long",day:"numeric"}):"",[h]),[re,V]=$e.useState(!1),[ae,ce]=$e.useState(0),[Te,be]=$e.useState(!1),Ge=$e.useRef(null);$e.useEffect(()=>(document&&(document.addEventListener("mouseup",Ke),window.addEventListener("scroll",nt)),()=>{document&&(document.removeEventListener("mouseup",Ke),window.removeEventListener("scroll",nt))}));const We=()=>{be(!Te)},Ke=He=>{Ge.current&&!Ge.current.contains(He.target)&&be(!1)},nt=()=>{if(c){const He=window.pageYOffset||document.documentElement.scrollTop;if(He<0||Math.abs(He-ae)<60)return;V(He>ae),ce(He)}};return B.jsxs("header",{...Ce,id:"pkt-header","data-testid":"pkt-header","aria-label":"Topp",className:fl(r,"pkt-header",{"pkt-header--fixed":l,"pkt-header--scroll-to-hide":c,"pkt-header--hidden":re}),ref:J,children:[B.jsxs("div",{className:"pkt-header__logo",children:[typeof n=="string"?B.jsx("a",{"aria-label":"Tilbake til forside",className:"pkt-header__logo-link",href:n,children:B.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.38/logos/"})}):B.jsx("button",{"aria-label":"Tilbake til forside",className:"pkt-link-button pkt-link pkt-header__logo-link",onClick:n,children:B.jsx(br,{name:"oslologo",className:"pkt-header__logo-svg","aria-hidden":"true",path:"https://punkt-cdn.oslo.kommune.no/12.38/logos/"})}),B.jsx("span",{className:"pkt-header__logo-service",translate:"no",children:i})]}),B.jsx("nav",{className:"pkt-header__actions",children:B.jsxs("ul",{className:"pkt-header__actions-row",children:[N&&B.jsx("li",{children:B.jsx(Fd,{className:"pkt-header__menu-btn",skin:"secondary",variant:"icon-right",iconName:"menu",onClick:R,children:"Meny"})}),(h||D)&&B.jsxs("li",{"data-testid":"usermenu",className:`pkt-header--has-dropdown ${Te&&!re?"pkt-header--open-dropdown":""}`,ref:Ge,children:[B.jsxs("button",{className:"pkt-header__user-btn pkt-btn pkt-btn--secondary pkt-btn--icons-right-and-left",type:"button",role:"button","aria-controls":"pktUserDropdown","aria-expanded":Te,onClick:We,children:[B.jsx(br,{name:"user",className:"pkt-btn__icon"}),B.jsx("span",{className:"pkt-header__user-fullname",translate:"no",children:(D==null?void 0:D.name)||(h==null?void 0:h.name)}),B.jsx("span",{className:"pkt-header__user-shortname",translate:"no",children:(D==null?void 0:D.shortname)||(h==null?void 0:h.shortname)}),B.jsx(br,{name:"chevron-thin-down",className:"pkt-btn--closed"}),B.jsx(br,{name:"chevron-thin-up",className:"pkt-btn--open"})]}),B.jsxs("ul",{id:"pktUserDropdown",className:"pkt-header__dropdown pkt-user-menu",children:[h&&B.jsxs("li",{children:[B.jsx("div",{className:"pkt-user-menu__label",children:"Pålogget som"}),B.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:h.name}),h.lastLoggedIn&&B.jsxs("div",{className:"pkt-user-menu__last-logged-in",children:["Sist pålogget: ",B.jsx("time",{children:G})]})]}),m&&B.jsx("li",{children:B.jsx("ul",{className:"pkt-list",children:m.map((He,dt)=>B.jsx("li",{children:typeof He.target=="string"?B.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&B.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):B.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&B.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userMenu-${dt}`))})}),(D||$)&&B.jsxs("li",{children:[D&&B.jsxs(B.Fragment,{children:[B.jsx("div",{className:"pkt-user-menu__label",children:"Representerer"}),B.jsx("div",{className:"pkt-user-menu__name",translate:"no",children:D.name}),D.orgNumber&&B.jsxs("div",{className:"pkt-user-menu__org-number",children:["Org.nr. ",D.orgNumber]})]}),B.jsx("ul",{className:"pkt-list mt-size-16",children:$&&B.jsx("li",{children:B.jsxs("button",{className:"pkt-link-button pkt-link",onClick:K,children:[B.jsx(br,{name:"cogwheel",className:"pkt-link__icon"}),"Endre organisasjon"]})})})]}),B.jsx("li",{children:B.jsx("ul",{className:"pkt-list",children:(C||!O)&&B.jsxs(B.Fragment,{children:[C==null?void 0:C.map((He,dt)=>B.jsx("li",{children:typeof He.target=="string"?B.jsxs("a",{href:He.target,className:"pkt-link",children:[He.iconName&&B.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]}):B.jsxs("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:[He.iconName&&B.jsx(br,{name:He.iconName,className:"pkt-link__icon"}),He.title]})},`userOptions-${dt}`)),!O&&B.jsx("li",{children:B.jsxs("button",{className:"pkt-link-button pkt-link",onClick:I,children:[B.jsx(br,{name:"exit",className:"pkt-link__icon"}),"Logg ut"]})})]})})}),T&&B.jsx("li",{className:"footer",children:B.jsx("ul",{className:"pkt-list-horizontal bordered",children:T.map((He,dt)=>B.jsx("li",{children:typeof He.target=="string"?B.jsx("a",{href:He.target,className:"pkt-link",children:He.title}):B.jsx("button",{className:"pkt-link-button pkt-link",onClick:He.target,children:He.title})},`userMenuFooter-${dt}`))})})]})]}),Y&&B.jsx("li",{children:Y}),O&&B.jsx("li",{children:B.jsx(Fd,{className:"pkt-header__user-btn pkt-header__user-btn-logout",iconName:"exit",role:"button",onClick:I,skin:"secondary",variant:"icon-right",children:"Logg ut"})})]})})]})}),CO=Or({tagName:"pkt-helptext",elementClass:Sd,react:$e,displayName:"PktHelptext",events:{onToggleHelpText:"toggleHelpText"}}),tx=$e.forwardRef(({children:r,...n},i)=>B.jsx(CO,{...n,ref:i,children:B.jsx("div",{className:"pkt-contents",children:r})}));tx.displayName="PktHelptext";const nx=$e.forwardRef(({label:r,id:n,children:i,...l},c)=>B.jsxs("div",{className:"pkt-form-group",children:[B.jsx("label",{htmlFor:n,className:"pkt-form-label",children:r}),B.jsx("input",{className:"pkt-form-input",id:n,...l,ref:c}),i]}));nx.displayName="PktInput";const xO=Or({tagName:"pkt-input-wrapper",elementClass:yr,react:$e,displayName:"PktInputWrapper",events:{onToggleHelpText:"toggleHelpText"}}),rx=$e.forwardRef(({children:r,helptext:n,...i},l)=>B.jsxs(xO,{ref:l,...i,children:[B.jsx("div",{className:"pkt-contents",slot:"helptext",children:n}),B.jsx("div",{className:"pkt-contents",children:r})]})),_O=Or({tagName:"pkt-link",elementClass:xd,react:$e,displayName:"PktLink"}),ax=$e.forwardRef(({children:r,...n},i)=>B.jsx(_O,{...n,ref:i,children:B.jsx("span",{className:"pkt-contents",children:r})}));ax.displayName="PktLink";const EO=Or({tagName:"pkt-linkcard",elementClass:pc,react:$e,displayName:"PktLinkCard",events:{}}),ix=$e.forwardRef(({children:r,...n},i)=>B.jsx(EO,{ref:i,...n,children:B.jsx("div",{className:"pkt-contents",children:r})}));ix.displayName="PktLinkCard";const TO=Or({tagName:"pkt-loader",elementClass:uu,react:$e,displayName:"PktLoader",events:{}}),ox=$e.forwardRef(({children:r,...n},i)=>B.jsx(TO,{...n,ref:i,children:B.jsx("div",{className:"pkt-contents",children:r})}));ox.displayName="PktLoader";const AO=Or({tagName:"pkt-messagebox",elementClass:Ed,react:$e,displayName:"PktMessagebox",events:{onClose:"close"}}),sx=$e.forwardRef(({children:r,...n},i)=>B.jsx(AO,{...n,ref:i,children:B.jsx("div",{className:"pkt-contents",children:r})}));sx.displayName="PktMessagebox";const FO=Or({tagName:"pkt-modal",elementClass:cu,react:$e,displayName:"PktModal",events:{}}),lx=$e.forwardRef(({children:r,...n},i)=>B.jsx(FO,{...n,ref:i,children:B.jsx("div",{className:"pkt-contents",children:r})}));lx.displayName="PktModal";/*!
|
|
1421
1420
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
1422
1421
|
*
|
|
1423
1422
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.38.
|
|
3
|
+
"version": "12.38.2",
|
|
4
4
|
"description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@lit-labs/ssr-dom-shim": "^1.2.1",
|
|
40
40
|
"@lit/react": "^1.0.7",
|
|
41
|
-
"@oslokommune/punkt-elements": "^12.38.
|
|
41
|
+
"@oslokommune/punkt-elements": "^12.38.2",
|
|
42
42
|
"angular-html-parser": "^6.0.2",
|
|
43
43
|
"html-format": "^1.1.7",
|
|
44
44
|
"prettier": "^3.3.3",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
|
|
51
51
|
"@oslokommune/punkt-assets": "^12.37.0",
|
|
52
|
-
"@oslokommune/punkt-css": "^12.38.
|
|
52
|
+
"@oslokommune/punkt-css": "^12.38.2",
|
|
53
53
|
"@testing-library/jest-dom": "^6.5.0",
|
|
54
54
|
"@testing-library/react": "^16.0.1",
|
|
55
55
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "8fbbad35ae8acad17550674f96d23f8b77044c8d"
|
|
116
116
|
}
|
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
4
|
-
|
|
3
|
+
import React, {
|
|
4
|
+
FC,
|
|
5
|
+
ForwardedRef,
|
|
6
|
+
forwardRef,
|
|
7
|
+
ForwardRefExoticComponent,
|
|
8
|
+
LegacyRef,
|
|
9
|
+
LinkHTMLAttributes,
|
|
10
|
+
ReactElement,
|
|
11
|
+
} from 'react'
|
|
12
|
+
import { createComponent } from '@lit/react'
|
|
5
13
|
import { PktLink as PktElLink } from '@oslokommune/punkt-elements'
|
|
6
|
-
import type { PktElType, PktElConstructor } from '@/interfaces/IPktElements'
|
|
7
14
|
|
|
8
|
-
interface IPktLink extends
|
|
15
|
+
interface IPktLink extends LinkHTMLAttributes<HTMLAnchorElement> {
|
|
9
16
|
href?: string
|
|
10
17
|
iconName?: string | undefined
|
|
11
18
|
iconPosition?: string | undefined
|
|
12
19
|
external?: boolean
|
|
13
20
|
target?: string | null
|
|
14
|
-
|
|
21
|
+
ref?: LegacyRef<HTMLAnchorElement>
|
|
15
22
|
}
|
|
16
23
|
|
|
17
|
-
const LitComponent
|
|
24
|
+
const LitComponent = createComponent({
|
|
18
25
|
tagName: 'pkt-link',
|
|
19
|
-
elementClass: PktElLink
|
|
26
|
+
elementClass: PktElLink,
|
|
20
27
|
react: React,
|
|
21
28
|
displayName: 'PktLink',
|
|
22
|
-
|
|
23
|
-
onClick: 'click' as EventName<CustomEvent>,
|
|
24
|
-
},
|
|
25
|
-
})
|
|
29
|
+
}) as ForwardRefExoticComponent<IPktLink>
|
|
26
30
|
|
|
27
31
|
export const PktLink: FC<IPktLink> = forwardRef(
|
|
28
|
-
({ children, ...props }: IPktLink, ref:
|
|
32
|
+
({ children, ...props }: IPktLink, ref: LegacyRef<HTMLAnchorElement>): ReactElement => {
|
|
29
33
|
return (
|
|
30
34
|
<LitComponent {...props} ref={ref}>
|
|
31
35
|
<span className="pkt-contents">{children}</span>
|