@oslokommune/punkt-elements 14.5.3 → 14.5.4
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 +17 -0
- package/dist/{alert-DqXar67l.js → alert-Cc5FtxHN.js} +2 -2
- package/dist/{alert-GrKyqxuR.cjs → alert-DVCenNTM.cjs} +1 -1
- package/dist/{backlink-QDcQd6vK.cjs → backlink-Bn16ZEIX.cjs} +1 -1
- package/dist/{backlink-CqUcmiPQ.js → backlink-DfMabyBp.js} +1 -1
- package/dist/{button-f36menSU.js → button-DrTXtc-n.js} +1 -1
- package/dist/{button-R4l10Nqd.cjs → button-Ju4zPhVx.cjs} +1 -1
- package/dist/{calendar-wuD6ZH0t.cjs → calendar-5Obd0ZT3.cjs} +1 -1
- package/dist/{calendar-DiNuZ8Ai.js → calendar-CTx8PD1L.js} +1 -1
- package/dist/{card-CnINxZma.js → card-CTtmPB2n.js} +2 -2
- package/dist/{card-C2hWaMev.cjs → card-DvHL7pNu.cjs} +1 -1
- package/dist/{combobox-Dxa7XjLz.js → combobox-DNPfpTjW.js} +3 -3
- package/dist/{combobox-yy6hIGmB.cjs → combobox-DvL3SKz2.cjs} +1 -1
- package/dist/{consent-FbFS1pmz.cjs → consent-DJW7YEat.cjs} +1 -1
- package/dist/{consent-c9PhWxnP.js → consent-OdhmtIK-.js} +2 -2
- package/dist/{datepicker-D_3vYgMt.cjs → datepicker-CTCaZuZU.cjs} +1 -1
- package/dist/{datepicker-C7GWMtXH.js → datepicker-t0W9fA1e.js} +4 -4
- package/dist/{helptext-DebHGRsD.cjs → helptext-7fyVJK2C.cjs} +1 -1
- package/dist/{helptext-DuyRRfCn.js → helptext-CfR0SYe9.js} +1 -1
- package/dist/icon-DBZvMard.js +103 -0
- package/dist/icon-n4-ve48P.cjs +9 -0
- package/dist/{input-wrapper-rgXsRNkk.cjs → input-wrapper-Bta4FZe3.cjs} +1 -1
- package/dist/{input-wrapper-3qfjLkrP.js → input-wrapper-DVUh5rxv.js} +3 -3
- package/dist/{link-CZvcdRek.js → link-40XAFlYS.js} +1 -1
- package/dist/{link-D85g20GS.cjs → link-CBQ7uKqb.cjs} +1 -1
- package/dist/{linkcard-B-9K02q8.cjs → linkcard-D8hxLedl.cjs} +1 -1
- package/dist/{linkcard-C3RTcMqc.js → linkcard-Opb42K2k.js} +1 -1
- package/dist/{loader-Dci0SrOz.js → loader-Bv1R6-AA.js} +1 -1
- package/dist/{loader-1EXLdxfq.cjs → loader-Dh_5sihO.cjs} +1 -1
- package/dist/{messagebox-dscnWgCd.cjs → messagebox-B9MCodIz.cjs} +1 -1
- package/dist/{messagebox-CnZlttZp.js → messagebox-DEXCTOrz.js} +1 -1
- package/dist/{modal-wSGthXAC.js → modal-B4adxB6X.js} +1 -1
- package/dist/{modal-ncKVjcyZ.cjs → modal-Bw61rVrQ.cjs} +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +4 -4
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +21 -21
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{progressbar-D5WBW1Dm.js → progressbar-CJa70NEo.js} +1 -1
- package/dist/{progressbar-ClY1WgnM.cjs → progressbar-ClZOyCz9.cjs} +1 -1
- package/dist/{select-jbIbD7hW.cjs → select--wvwpJ0_.cjs} +1 -1
- package/dist/{select-Bug9sfr5.js → select-DfsNb_Yi.js} +1 -1
- package/dist/{tag-DgoTYNVA.js → tag-Cw3OQqLW.js} +1 -1
- package/dist/{tag-BfjOlIyS.cjs → tag-P9lfQZbM.cjs} +1 -1
- package/dist/{textarea-Da9E3RM7.js → textarea-CM_bj81t.js} +2 -2
- package/dist/{textarea-Dfa4_ZBy.cjs → textarea-DcEKhXia.cjs} +1 -1
- package/dist/{textinput-DaMYc5gd.js → textinput-AVll6Nh7.js} +2 -2
- package/dist/{textinput-CLM9fRjm.cjs → textinput-BzuYzKZ6.cjs} +1 -1
- package/package.json +2 -2
- package/src/components/icon/icon.ts +56 -39
- package/dist/icon-BgG6oO4Q.js +0 -89
- package/dist/icon-Dl9ZPqe6.cjs +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [14.5.4](https://github.com/oslokommune/punkt/compare/14.5.3...14.5.4) (2026-02-12)
|
|
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
|
+
|
|
8
25
|
## [14.5.2](https://github.com/oslokommune/punkt/compare/14.5.1...14.5.2) (2026-02-06)
|
|
9
26
|
|
|
10
27
|
### ⚠ BREAKING CHANGES
|
|
@@ -4,8 +4,8 @@ import { r as k } from "./state-DgnkjP0q.js";
|
|
|
4
4
|
import { P as m } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
5
5
|
import { e as _, n as b } from "./ref-BxiKhrfa.js";
|
|
6
6
|
import { u as y } from "./classutils-RQs1k6D9.js";
|
|
7
|
-
import "./icon-
|
|
8
|
-
import "./button-
|
|
7
|
+
import "./icon-DBZvMard.js";
|
|
8
|
+
import "./button-DrTXtc-n.js";
|
|
9
9
|
const C = { skin: { default: "info" }, ariaLive: { default: "polite" }, compact: { default: !1 }, closeAlert: { default: !1 } }, c = {
|
|
10
10
|
props: C
|
|
11
11
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const c=require("./class-map-CApIYSRo.cjs"),t=require("./element-aUzIoa1s.cjs"),d=require("./state-GDzxl12x.cjs"),h=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./ref-C5iJMIE1.cjs"),k=require("./classutils-BwNK82ZQ.cjs");require("./icon-
|
|
1
|
+
"use strict";const c=require("./class-map-CApIYSRo.cjs"),t=require("./element-aUzIoa1s.cjs"),d=require("./state-GDzxl12x.cjs"),h=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./ref-C5iJMIE1.cjs"),k=require("./classutils-BwNK82ZQ.cjs");require("./icon-n4-ve48P.cjs");require("./button-Ju4zPhVx.cjs");const v={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},a={props:v};var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,i=(o,e,s,l)=>{for(var r=l>1?void 0:l?_(e,s):e,p=o.length-1,n;p>=0;p--)(n=o[p])&&(r=(l?n(e,s,r):n(r))||r);return l&&r&&f(e,s,r),r};exports.PktAlert=class extends t.PktElement{constructor(){super(),this.defaultSlot=u.e(),this.compact=a.props.compact.default,this.title="",this.skin=a.props.skin.default,this.ariaLive=a.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=a.props.closeAlert.default,this.date=null,this.role="status",this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new h.PktSlotController(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,s,l){e==="ariaLive"&&(this["aria-live"]=l),super.attributeChangedCallback(e,s,l)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},s={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return t.x`
|
|
2
2
|
<div class=${c.e(e)} aria-live=${this["aria-live"]}>
|
|
3
3
|
<div class=${c.e(s)}>
|
|
4
4
|
<pkt-icon
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("./element-aUzIoa1s.cjs"),c=require("./if-defined-BElHLTlB.cjs");require("./icon-
|
|
1
|
+
"use strict";const r=require("./element-aUzIoa1s.cjs"),c=require("./if-defined-BElHLTlB.cjs");require("./icon-n4-ve48P.cjs");var p=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=(k,t,a,i)=>{for(var e=i>1?void 0:i?o(t,a):t,s=k.length-1,l;s>=0;s--)(l=k[s])&&(e=(i?l(t,a,e):l(e))||e);return i&&e&&p(t,a,e),e};exports.PktBackLink=class extends r.PktElement{constructor(){super(...arguments),this.href="",this.text="Forsiden",this.ariaLabel=""}attributeChangedCallback(t,a,i){t==="arialabel"&&this.removeAttribute("arialabel"),t==="href"&&this.removeAttribute("href"),t==="text"&&this.removeAttribute("text"),super.attributeChangedCallback(t,a,i)}render(){return r.x`<nav
|
|
2
2
|
class="pkt-back-link"
|
|
3
3
|
aria-label=${this.ariaLabel||"Gå tilbake til forrige side"}
|
|
4
4
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as c, x as k, n as o, t as h } from "./element-BXsf_NlG.js";
|
|
2
2
|
import { o as b } from "./if-defined-CxHgig4I.js";
|
|
3
|
-
import "./icon-
|
|
3
|
+
import "./icon-DBZvMard.js";
|
|
4
4
|
var f = Object.defineProperty, u = Object.getOwnPropertyDescriptor, n = (t, r, i, l) => {
|
|
5
5
|
for (var e = l > 1 ? void 0 : l ? u(r, i) : r, s = t.length - 1, p; s >= 0; s--)
|
|
6
6
|
(p = t[s]) && (e = (l ? p(r, i, e) : p(e)) || e);
|
|
@@ -3,7 +3,7 @@ import { P as u } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
|
3
3
|
import { e as m } from "./class-map-Dt2jXOlF.js";
|
|
4
4
|
import { o as r } from "./if-defined-CxHgig4I.js";
|
|
5
5
|
import { e as y, n as k } from "./ref-BxiKhrfa.js";
|
|
6
|
-
import "./icon-
|
|
6
|
+
import "./icon-DBZvMard.js";
|
|
7
7
|
var g = Object.defineProperty, P = Object.getOwnPropertyDescriptor, e = (t, o, n, p) => {
|
|
8
8
|
for (var a = p > 1 ? void 0 : p ? P(o, n) : o, d = t.length - 1, h; d >= 0; d--)
|
|
9
9
|
(h = t[d]) && (a = (p ? h(o, n, a) : h(a)) || a);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-aUzIoa1s.cjs"),h=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./class-map-CApIYSRo.cjs"),a=require("./if-defined-BElHLTlB.cjs"),d=require("./ref-C5iJMIE1.cjs");require("./icon-
|
|
1
|
+
"use strict";const t=require("./element-aUzIoa1s.cjs"),h=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./class-map-CApIYSRo.cjs"),a=require("./if-defined-BElHLTlB.cjs"),d=require("./ref-C5iJMIE1.cjs");require("./icon-n4-ve48P.cjs");var c=Object.defineProperty,k=Object.getOwnPropertyDescriptor,e=(r,i,o,n)=>{for(var s=n>1?void 0:n?k(i,o):i,l=r.length-1,p;l>=0;l--)(p=r[l])&&(s=(n?p(i,o,s):p(s))||s);return n&&s&&c(i,o,s),s};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/latest/animations/";exports.PktButton=class extends t.PktElement{constructor(){super(),this.defaultSlot=d.e(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new h.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.preventDefault(),i.stopImmediatePropagation())},!0),this.addEventListener("keydown",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopImmediatePropagation())},!0)}attributeChangedCallback(i,o,n){super.attributeChangedCallback(i,o,n),i==="disabled"&&n==="false"&&(this.disabled=!1),(i==="isloading"||i==="isLoading")&&n==="false"&&(this.isLoading=!1)}firstUpdated(i){super.firstUpdated(i),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const i=this.form??this.getAttribute("form")??void 0,o={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return t.x`
|
|
2
2
|
<button
|
|
3
3
|
class=${u.e(o)}
|
|
4
4
|
type=${this.type}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const tt=require("./class-map-CApIYSRo.cjs"),u=require("./element-aUzIoa1s.cjs"),q=require("./state-GDzxl12x.cjs");require("./icon-Dl9ZPqe6.cjs");const ht=6048e5,Mt=864e5,et=Symbol.for("constructDateFrom");function k(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&et in e?e[et](t):e instanceof Date?new e.constructor(t):new Date(t)}function b(e,t){return k(t||e,e)}function nt(e,t,n){const r=b(e,n==null?void 0:n.in);return isNaN(t)?k(e,NaN):(t&&r.setDate(r.getDate()+t),r)}let Tt={};function B(){return Tt}function H(e,t){var o,c,d,f;const n=B(),r=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=b(e,t==null?void 0:t.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function U(e,t){return H(e,{...t,weekStartsOn:1})}function dt(e,t){const n=b(e,t==null?void 0:t.in),r=n.getFullYear(),a=k(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=U(a),i=k(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=U(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function rt(e){const t=b(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ft(e,...t){const n=k.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function G(e,t){const n=b(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function xt(e,t,n){const[r,a]=ft(n==null?void 0:n.in,e,t),s=G(r),i=G(a),o=+s-rt(s),c=+i-rt(i);return Math.round((o-c)/Mt)}function Ot(e,t){const n=dt(e,t),r=k(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),U(r)}function Pt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ct(e){return!(!Pt(e)&&typeof e!="number"||isNaN(+b(e)))}function Nt(e,t){const n=b(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function $t(e,t){const[n,r]=ft(e,t.start,t.end);return{start:n,end:r}}function mt(e,t){const{start:n,end:r}=$t(t==null?void 0:t.in,e);let a=+n>+r;const s=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0);let o=1;const c=[];for(;+i<=s;)c.push(k(n,i)),i.setDate(i.getDate()+o),i.setHours(0,0,0,0);return a?c.reverse():c}function Et(e,t){const n=b(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Wt={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"}},_t=(e,t,n)=>{let r;const a=Wt[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Q(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Yt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},It={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ft={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},At={date:Q({formats:Yt,defaultWidth:"full"}),time:Q({formats:It,defaultWidth:"full"}),dateTime:Q({formats:Ft,defaultWidth:"full"})},Ht={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rt=(e,t,n,r)=>Ht[e];function Y(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{const i=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[o]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return a[s]}}const qt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ut={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"]},Bt={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"]},zt={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"}},jt={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"}},Qt=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Xt={ordinalNumber:Qt,era:Y({values:qt,defaultWidth:"wide"}),quarter:Y({values:Lt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Y({values:Ut,defaultWidth:"wide"}),day:Y({values:Bt,defaultWidth:"wide"}),dayPeriod:Y({values:zt,defaultWidth:"wide",formattingValues:jt,defaultFormattingWidth:"wide"})};function I(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?Vt(o,y=>y.test(i)):Gt(o,y=>y.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(i.length);return{value:d,rest:f}}}function Gt(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Vt(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Kt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const o=t.slice(a.length);return{value:i,rest:o}}}const Jt=/^(\d+)(th|st|nd|rd)?/i,Zt=/\d+/i,te={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},ee={any:[/^b/i,/^(a|c)/i]},ne={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},re={any:[/1/i,/2/i,/3/i,/4/i]},ae={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},se={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]},ie={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},oe={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]},ce={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},ue={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}},le={ordinalNumber:Kt({matchPattern:Jt,parsePattern:Zt,valueCallback:e=>parseInt(e,10)}),era:I({matchPatterns:te,defaultMatchWidth:"wide",parsePatterns:ee,defaultParseWidth:"any"}),quarter:I({matchPatterns:ne,defaultMatchWidth:"wide",parsePatterns:re,defaultParseWidth:"any",valueCallback:e=>e+1}),month:I({matchPatterns:ae,defaultMatchWidth:"wide",parsePatterns:se,defaultParseWidth:"any"}),day:I({matchPatterns:ie,defaultMatchWidth:"wide",parsePatterns:oe,defaultParseWidth:"any"}),dayPeriod:I({matchPatterns:ce,defaultMatchWidth:"any",parsePatterns:ue,defaultParseWidth:"any"})},he={code:"en-US",formatDistance:_t,formatLong:At,formatRelative:Rt,localize:Xt,match:le,options:{weekStartsOn:0,firstWeekContainsDate:1}};function de(e,t){const n=b(e,t==null?void 0:t.in);return xt(n,Et(n))+1}function fe(e,t){const n=b(e,t==null?void 0:t.in),r=+U(n)-+Ot(n);return Math.round(r/ht)+1}function gt(e,t){var f,y,w,S;const n=b(e,t==null?void 0:t.in),r=n.getFullYear(),a=B(),s=(t==null?void 0:t.firstWeekContainsDate)??((y=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??a.firstWeekContainsDate??((S=(w=a.locale)==null?void 0:w.options)==null?void 0:S.firstWeekContainsDate)??1,i=k((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const o=H(i,t),c=k((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=H(c,t);return+n>=+o?r+1:+n>=+d?r:r-1}function me(e,t){var o,c,d,f;const n=B(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=gt(e,t),s=k((t==null?void 0:t.in)||e,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),H(s,t)}function yt(e,t){const n=b(e,t==null?void 0:t.in),r=+H(n,t)-+me(n,t);return Math.round(r/ht)+1}function l(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const v={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return l(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):l(n+1,2)},d(e,t){return l(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return l(e.getHours()%12||12,t.length)},H(e,t){return l(e.getHours(),t.length)},m(e,t){return l(e.getMinutes(),t.length)},s(e,t){return l(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return l(a,t.length)}},$={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},at={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return v.y(e,t)},Y:function(e,t,n,r){const a=gt(e,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return l(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):l(s,t.length)},R:function(e,t){const n=dt(e);return l(n,t.length)},u:function(e,t){const n=e.getFullYear();return l(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return l(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return l(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return v.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return l(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=yt(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):l(a,t.length)},I:function(e,t,n){const r=fe(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):l(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):v.d(e,t)},D:function(e,t,n){const r=de(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):l(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return l(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return l(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return l(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=$.noon:r===0?a=$.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=$.evening:r>=12?a=$.afternoon:r>=4?a=$.morning:a=$.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return v.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):v.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):l(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):l(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):v.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):v.s(e,t)},S:function(e,t){return v.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return it(r);case"XXXX":case"XX":return O(r);case"XXXXX":case"XXX":default:return O(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return it(r);case"xxxx":case"xx":return O(r);case"xxxxx":case"xxx":default:return O(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+st(r,":");case"OOOO":default:return"GMT"+O(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+st(r,":");case"zzzz":default:return"GMT"+O(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return l(r,t.length)},T:function(e,t,n){return l(+e,t.length)}};function st(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+t+l(s,2)}function it(e,t){return e%60===0?(e>0?"-":"+")+l(Math.abs(e)/60,2):O(e,t)}function O(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=l(Math.trunc(r/60),2),s=l(r%60,2);return n+a+t+s}const ot=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},wt=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ge=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return ot(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ot(r,t)).replace("{{time}}",wt(a,t))},ye={p:wt,P:ge},we=/^D+$/,pe=/^Y+$/,be=["D","DD","YY","YYYY"];function De(e){return we.test(e)}function ke(e){return pe.test(e)}function Se(e,t,n){const r=ve(e,t,n);if(console.warn(r),be.includes(e))throw new RangeError(r)}function ve(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Me=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Te=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xe=/^'([^]*?)'?$/,Oe=/''/g,Pe=/[a-zA-Z]/;function Ce(e,t,n){var f,y,w,S;const r=B(),a=r.locale??he,s=r.firstWeekContainsDate??((y=(f=r.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??1,i=r.weekStartsOn??((S=(w=r.locale)==null?void 0:w.options)==null?void 0:S.weekStartsOn)??0,o=b(e,n==null?void 0:n.in);if(!Ct(o))throw new RangeError("Invalid time value");let c=t.match(Te).map(p=>{const g=p[0];if(g==="p"||g==="P"){const _=ye[g];return _(p,a.formatLong)}return p}).join("").match(Me).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:Ne(p)};if(at[g])return{isToken:!0,value:p};if(g.match(Pe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});a.localize.preprocessor&&(c=a.localize.preprocessor(o,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(p=>{if(!p.isToken)return p.value;const g=p.value;(ke(g)||De(g))&&Se(g,t,String(e));const _=at[g[0]];return _(o,g,a.localize,d)}).join("")}function Ne(e){const t=e.match(xe);return t?t[1].replace(Oe,"'"):e}function $e(e,t){const n=b(e,t==null?void 0:t.in).getDay();return n===0?7:n}function Ee(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const X={},A={};function P(e,t){try{const r=(X[e]||(X[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in A?A[r]:ct(r,r.split(":"))}catch{if(e in A)return A[e];const n=e==null?void 0:e.match(We);return n?ct(e,n.slice(1)):NaN}}const We=/([+-]\d\d):?(\d\d)?/;function ct(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return A[e]=n*60+r>0?n*60+r+a:n*60-r-a}class D extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(P(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),pt(this),V(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new D(...n,t):new D(Date.now(),t)}withTimeZone(t){return new D(+this,t)}getTimezoneOffset(){const t=-P(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),V(this),+this}[Symbol.for("constructDateFrom")](t){return new D(+new Date(t),this.timeZone)}}const ut=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!ut.test(e))return;const t=e.replace(ut,"$1UTC");D.prototype[t]&&(e.startsWith("get")?D.prototype[e]=function(){return this.internal[t]()}:(D.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),_e(this),+this},D.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),V(this),+this}))});function V(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-P(e.timeZone,e)*60))}function _e(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),pt(e)}function pt(e){const t=P(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),s=-new Date(+r).getTimezoneOffset(),i=a-s,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const c=a-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const f=a>0?d.getSeconds():(d.getSeconds()-60)%60,y=Math.round(-(P(e.timeZone,e)*60))%60;(y||f)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+y),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+y+f));const w=P(e.timeZone,e),S=w>0?Math.floor(w):Math.ceil(w),g=-new Date(+e).getTimezoneOffset()-S,_=S!==n,Z=g-c;if(_&&Z){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+Z);const z=P(e.timeZone,e),vt=z>0?Math.floor(z):Math.ceil(z),j=S-vt;j&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j))}}class M extends D{static tz(t,...n){return n.length?new M(...n,t):new M(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${Ee(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new M(+this,t)}[Symbol.for("constructDateFrom")](t){return new M(+new Date(t),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Ye=(e=window.pktTz)=>{const t=new M(new Date().toISOString(),e);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function T(e){if(!e||e==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}if(/^\d{4}-\d{2}$/.test(e)){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1)}return/^\d{4}$/.test(e)?new Date(Number(e),0,1):new Date(e)}const m=e=>{if(!e||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`},W=e=>{if(!e)return null;const t=T(e);return isNaN(t.getTime())?null:t},Ie=(e,t)=>{const n=N(e);return isNaN(n.getTime())?"":Ce(n,t)},N=(e="",t)=>{const n=typeof e=="string"?T(e):e;return!n||isNaN(n.getTime())?new Date:t?t==="end"?Nt(n):G(n):n},C=(e,t,n=1)=>{if(typeof e!="number"||typeof t!="number"||typeof n!="number"||isNaN(e)||isNaN(t)||isNaN(n))return new Date;const r=new Date(e,t,n);return isNaN(r.getTime())?new Date:r},F=e=>{let t;return typeof e=="number"?t=new M(e,window.pktTz):t=new M(e,window.pktTz),t.setHours(12,0,0,0),t},Fe=e=>!e||isNaN(e.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(e),Ae=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;const r=t?N(t):null,a=n?N(n):null;return!(r&&e<r||a&&e>a)},He=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;const n=m(e);return t.includes(n)},Re=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;const n=e.getDay().toString();return t.includes(n)},bt=(e,t,n,r,a)=>!(!e||isNaN(e.getTime())||!Ae(e,t,n)||r&&He(e,r)||a&&Re(e,a)),qe=(e,t,n,r,a)=>e.filter(s=>{const i=W(s);return i&&bt(i,t,n,r,a)}),Le=e=>e.slice().sort((t,n)=>{const r=W(t),a=W(n);return!r||!a?0:r.getTime()-a.getTime()}),Ue=(e,t)=>{const n=W(e),r=W(t);return!n||!r?!1:n<=r},Dt=e=>e?Array.isArray(e)?e.filter(Boolean):String(e).split(",").map(t=>t.trim()).filter(Boolean):[],Be=e=>e.join(","),ze=e=>Dt(e),je=e=>e?T(e):null,Qe=e=>{if(typeof e=="string")return e.split(",").map(t=>T(t));if(Array.isArray(e))return e.map(t=>T(t))},L={csvToArray:ze,stringToDate:je,stringsToDate:Qe},Xe={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},x={props:Xe};function kt(e,t){const n=t.excludedates.map(r=>typeof r=="string"?r:m(r));return!bt(e,t.earliest,t.latest,n,t.excludeweekdays)}function Ge(e,t,n,r){return!!(kt(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Ve(e,t,n){const r=C(e,t,0);return!(n&&N(n)>r)}function Ke(e,t,n){const r=C(t===11?e+1:e,t===11?0:t+1,1);return!(n&&N(n)<r)}const R=7,Je=6;function Ze(e,t){const n=C(e,t,1),r=C(e,t+1,0),a=(n.getDay()+Je)%R,s=r.getDate(),i=Math.ceil((s+a)/R),c=C(e,t,0).getDate(),d=yt(n);return{firstDayOfMonth:n,lastDayOfMonth:r,startingDay:a,numDays:s,numRows:i,numDaysPrevMonth:c,initialWeek:d}}function tn(e,t,n,r){const{startingDay:a,numDays:s}=r;return e===0&&t<a?"prev-month":n>s?"next-month":"current-month"}function en(e,t,n,r){const{startingDay:a,numDaysPrevMonth:s,numDays:i}=r;return e==="prev-month"?s-(a-t-1):e==="next-month"?n-i:n}function E(e){return typeof e=="string"&&(e=e.split(",")),e.length===1&&e[0]===""?[]:e.map(t=>T(t))}function lt(e,t){const n=mt({start:e,end:t}),r={};if(Array.isArray(n)&&n.length)for(let a=0;a<n.length;a++){const s=n[a],i=s>e&&s<t;r[m(s)]=i}return r}function St(e,t,n,r){if(t.length!==1)return!0;const a=mt({start:t[0],end:e});if(!Array.isArray(a)||!a.length)return!0;for(let s=0;s<a.length;s++){for(const i of n)if(i>t[0]&&i<e)return!1;if(r.includes($e(a[s]).toString()))return!1}return!0}function K(e,t){const n=m(e);return t.includes(n)?t:[...t,n]}function J(e,t){const n=m(e),r=t.indexOf(n);if(r===-1)return t;if(t.length===1)return[];const a=[...t];return a.splice(r,1),a}function nn(e,t,n){const r=m(e);return t.includes(r)?J(e,t):n>0&&t.length>=n?t:K(e,t)}function rn(e,t,n){const r=m(e),a=E(t);if(t.includes(r))return t.indexOf(r)===0?[]:J(e,t);if(t.length>1)return[r];if(t.length===1){if(!St(e,a,n.excludedates,n.excludeweekdays))return[r];if(a[0]>e)return[r]}return K(e,t)}const an={ArrowLeft:-1,ArrowRight:1,ArrowUp:-R,ArrowDown:R};function sn(e){var n;const t=e.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((n=e.dataset)!=null&&n.date)}function on(e,t,n){let r=nt(e,t);if(!r)return null;let a=n(`button[data-date="${m(r)}"]`);for(;a instanceof HTMLButtonElement&&a.dataset.disabled;)if(r=nt(r,t),a=n(`button[data-date="${m(r)}"]`),!a)return null;return r}function cn(e){return an[e]??null}var un=Object.defineProperty,ln=Object.getOwnPropertyDescriptor,h=(e,t,n,r)=>{for(var a=r>1?void 0:r?ln(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&un(t,n,a),a};exports.PktCalendar=class extends u.PktElement{constructor(){super(...arguments),this.selected=[],this.multiple=x.props.multiple.default,this.maxMultiple=x.props.maxMultiple.default,this.range=x.props.range.default,this.earliest=x.props.earliest.default,this.latest=x.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=x.props.weeknumbers.default,this.withcontrols=x.props.withcontrols.default,this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=E(this.selected),this.range&&this.selected.length===2&&(this.inRange=lt(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=T(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?F(new Date):t}else this.currentmonth===null&&(this.currentmonth=F(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=F(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const n=cn(t.key);n!==null&&this.handleArrowKey(t,n)}handleArrowKey(t,n){const r=t.target;if(sn(r))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const a=this.focusedDate?N(this.focusedDate):C(this.year,this.month,1),s=on(a,n,this.querySelector.bind(this));if(s){const i=this.querySelector(`button[data-date="${m(s)}"]`);i instanceof HTMLButtonElement&&!i.dataset.disabled&&(this.focusedDate=m(s),i.focus())}}render(){return u.x`
|
|
1
|
+
"use strict";const tt=require("./class-map-CApIYSRo.cjs"),u=require("./element-aUzIoa1s.cjs"),q=require("./state-GDzxl12x.cjs");require("./icon-n4-ve48P.cjs");const ht=6048e5,Mt=864e5,et=Symbol.for("constructDateFrom");function k(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&et in e?e[et](t):e instanceof Date?new e.constructor(t):new Date(t)}function b(e,t){return k(t||e,e)}function nt(e,t,n){const r=b(e,n==null?void 0:n.in);return isNaN(t)?k(e,NaN):(t&&r.setDate(r.getDate()+t),r)}let Tt={};function B(){return Tt}function H(e,t){var o,c,d,f;const n=B(),r=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??0,a=b(e,t==null?void 0:t.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function U(e,t){return H(e,{...t,weekStartsOn:1})}function dt(e,t){const n=b(e,t==null?void 0:t.in),r=n.getFullYear(),a=k(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=U(a),i=k(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=U(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function rt(e){const t=b(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ft(e,...t){const n=k.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function G(e,t){const n=b(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function xt(e,t,n){const[r,a]=ft(n==null?void 0:n.in,e,t),s=G(r),i=G(a),o=+s-rt(s),c=+i-rt(i);return Math.round((o-c)/Mt)}function Ot(e,t){const n=dt(e,t),r=k(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),U(r)}function Pt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ct(e){return!(!Pt(e)&&typeof e!="number"||isNaN(+b(e)))}function Nt(e,t){const n=b(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function $t(e,t){const[n,r]=ft(e,t.start,t.end);return{start:n,end:r}}function mt(e,t){const{start:n,end:r}=$t(t==null?void 0:t.in,e);let a=+n>+r;const s=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0);let o=1;const c=[];for(;+i<=s;)c.push(k(n,i)),i.setDate(i.getDate()+o),i.setHours(0,0,0,0);return a?c.reverse():c}function Et(e,t){const n=b(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Wt={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"}},_t=(e,t,n)=>{let r;const a=Wt[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Q(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Yt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},It={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ft={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},At={date:Q({formats:Yt,defaultWidth:"full"}),time:Q({formats:It,defaultWidth:"full"}),dateTime:Q({formats:Ft,defaultWidth:"full"})},Ht={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rt=(e,t,n,r)=>Ht[e];function Y(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):i;a=e.formattingValues[o]||e.formattingValues[i]}else{const i=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[o]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return a[s]}}const qt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ut={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"]},Bt={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"]},zt={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"}},jt={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"}},Qt=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Xt={ordinalNumber:Qt,era:Y({values:qt,defaultWidth:"wide"}),quarter:Y({values:Lt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Y({values:Ut,defaultWidth:"wide"}),day:Y({values:Bt,defaultWidth:"wide"}),dayPeriod:Y({values:zt,defaultWidth:"wide",formattingValues:jt,defaultFormattingWidth:"wide"})};function I(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(a);if(!s)return null;const i=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?Vt(o,y=>y.test(i)):Gt(o,y=>y.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const f=t.slice(i.length);return{value:d,rest:f}}}function Gt(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Vt(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Kt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const o=t.slice(a.length);return{value:i,rest:o}}}const Jt=/^(\d+)(th|st|nd|rd)?/i,Zt=/\d+/i,te={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},ee={any:[/^b/i,/^(a|c)/i]},ne={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},re={any:[/1/i,/2/i,/3/i,/4/i]},ae={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},se={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]},ie={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},oe={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]},ce={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},ue={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}},le={ordinalNumber:Kt({matchPattern:Jt,parsePattern:Zt,valueCallback:e=>parseInt(e,10)}),era:I({matchPatterns:te,defaultMatchWidth:"wide",parsePatterns:ee,defaultParseWidth:"any"}),quarter:I({matchPatterns:ne,defaultMatchWidth:"wide",parsePatterns:re,defaultParseWidth:"any",valueCallback:e=>e+1}),month:I({matchPatterns:ae,defaultMatchWidth:"wide",parsePatterns:se,defaultParseWidth:"any"}),day:I({matchPatterns:ie,defaultMatchWidth:"wide",parsePatterns:oe,defaultParseWidth:"any"}),dayPeriod:I({matchPatterns:ce,defaultMatchWidth:"any",parsePatterns:ue,defaultParseWidth:"any"})},he={code:"en-US",formatDistance:_t,formatLong:At,formatRelative:Rt,localize:Xt,match:le,options:{weekStartsOn:0,firstWeekContainsDate:1}};function de(e,t){const n=b(e,t==null?void 0:t.in);return xt(n,Et(n))+1}function fe(e,t){const n=b(e,t==null?void 0:t.in),r=+U(n)-+Ot(n);return Math.round(r/ht)+1}function gt(e,t){var f,y,w,S;const n=b(e,t==null?void 0:t.in),r=n.getFullYear(),a=B(),s=(t==null?void 0:t.firstWeekContainsDate)??((y=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??a.firstWeekContainsDate??((S=(w=a.locale)==null?void 0:w.options)==null?void 0:S.firstWeekContainsDate)??1,i=k((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const o=H(i,t),c=k((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=H(c,t);return+n>=+o?r+1:+n>=+d?r:r-1}function me(e,t){var o,c,d,f;const n=B(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=gt(e,t),s=k((t==null?void 0:t.in)||e,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),H(s,t)}function yt(e,t){const n=b(e,t==null?void 0:t.in),r=+H(n,t)-+me(n,t);return Math.round(r/ht)+1}function l(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const v={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return l(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):l(n+1,2)},d(e,t){return l(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return l(e.getHours()%12||12,t.length)},H(e,t){return l(e.getHours(),t.length)},m(e,t){return l(e.getMinutes(),t.length)},s(e,t){return l(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return l(a,t.length)}},$={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},at={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return v.y(e,t)},Y:function(e,t,n,r){const a=gt(e,r),s=a>0?a:1-a;if(t==="YY"){const i=s%100;return l(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):l(s,t.length)},R:function(e,t){const n=dt(e);return l(n,t.length)},u:function(e,t){const n=e.getFullYear();return l(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return l(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return l(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return v.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return l(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=yt(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):l(a,t.length)},I:function(e,t,n){const r=fe(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):l(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):v.d(e,t)},D:function(e,t,n){const r=de(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):l(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return l(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return l(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return l(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=$.noon:r===0?a=$.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=$.evening:r>=12?a=$.afternoon:r>=4?a=$.morning:a=$.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return v.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):v.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):l(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):l(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):v.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):v.s(e,t)},S:function(e,t){return v.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return it(r);case"XXXX":case"XX":return O(r);case"XXXXX":case"XXX":default:return O(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return it(r);case"xxxx":case"xx":return O(r);case"xxxxx":case"xxx":default:return O(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+st(r,":");case"OOOO":default:return"GMT"+O(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+st(r,":");case"zzzz":default:return"GMT"+O(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return l(r,t.length)},T:function(e,t,n){return l(+e,t.length)}};function st(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),s=r%60;return s===0?n+String(a):n+String(a)+t+l(s,2)}function it(e,t){return e%60===0?(e>0?"-":"+")+l(Math.abs(e)/60,2):O(e,t)}function O(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=l(Math.trunc(r/60),2),s=l(r%60,2);return n+a+t+s}const ot=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},wt=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ge=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return ot(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",ot(r,t)).replace("{{time}}",wt(a,t))},ye={p:wt,P:ge},we=/^D+$/,pe=/^Y+$/,be=["D","DD","YY","YYYY"];function De(e){return we.test(e)}function ke(e){return pe.test(e)}function Se(e,t,n){const r=ve(e,t,n);if(console.warn(r),be.includes(e))throw new RangeError(r)}function ve(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Me=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Te=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xe=/^'([^]*?)'?$/,Oe=/''/g,Pe=/[a-zA-Z]/;function Ce(e,t,n){var f,y,w,S;const r=B(),a=r.locale??he,s=r.firstWeekContainsDate??((y=(f=r.locale)==null?void 0:f.options)==null?void 0:y.firstWeekContainsDate)??1,i=r.weekStartsOn??((S=(w=r.locale)==null?void 0:w.options)==null?void 0:S.weekStartsOn)??0,o=b(e,n==null?void 0:n.in);if(!Ct(o))throw new RangeError("Invalid time value");let c=t.match(Te).map(p=>{const g=p[0];if(g==="p"||g==="P"){const _=ye[g];return _(p,a.formatLong)}return p}).join("").match(Me).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:Ne(p)};if(at[g])return{isToken:!0,value:p};if(g.match(Pe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});a.localize.preprocessor&&(c=a.localize.preprocessor(o,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(p=>{if(!p.isToken)return p.value;const g=p.value;(ke(g)||De(g))&&Se(g,t,String(e));const _=at[g[0]];return _(o,g,a.localize,d)}).join("")}function Ne(e){const t=e.match(xe);return t?t[1].replace(Oe,"'"):e}function $e(e,t){const n=b(e,t==null?void 0:t.in).getDay();return n===0?7:n}function Ee(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const X={},A={};function P(e,t){try{const r=(X[e]||(X[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in A?A[r]:ct(r,r.split(":"))}catch{if(e in A)return A[e];const n=e==null?void 0:e.match(We);return n?ct(e,n.slice(1)):NaN}}const We=/([+-]\d\d):?(\d\d)?/;function ct(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return A[e]=n*60+r>0?n*60+r+a:n*60-r-a}class D extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(P(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),pt(this),V(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new D(...n,t):new D(Date.now(),t)}withTimeZone(t){return new D(+this,t)}getTimezoneOffset(){const t=-P(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),V(this),+this}[Symbol.for("constructDateFrom")](t){return new D(+new Date(t),this.timeZone)}}const ut=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!ut.test(e))return;const t=e.replace(ut,"$1UTC");D.prototype[t]&&(e.startsWith("get")?D.prototype[e]=function(){return this.internal[t]()}:(D.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),_e(this),+this},D.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),V(this),+this}))});function V(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-P(e.timeZone,e)*60))}function _e(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),pt(e)}function pt(e){const t=P(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),s=-new Date(+r).getTimezoneOffset(),i=a-s,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const c=a-n;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const f=a>0?d.getSeconds():(d.getSeconds()-60)%60,y=Math.round(-(P(e.timeZone,e)*60))%60;(y||f)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+y),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+y+f));const w=P(e.timeZone,e),S=w>0?Math.floor(w):Math.ceil(w),g=-new Date(+e).getTimezoneOffset()-S,_=S!==n,Z=g-c;if(_&&Z){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+Z);const z=P(e.timeZone,e),vt=z>0?Math.floor(z):Math.ceil(z),j=S-vt;j&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j))}}class M extends D{static tz(t,...n){return n.length?new M(...n,t):new M(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${Ee(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new M(+this,t)}[Symbol.for("constructDateFrom")](t){return new M(+new Date(t),this.timeZone)}}window.pktTz=window.pktTz===void 0?"Europe/Oslo":window.pktTz;const Ye=(e=window.pktTz)=>{const t=new M(new Date().toISOString(),e);return t.setHours(0,0,0,0),isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate())};function T(e){if(!e||e==="")return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}if(/^\d{4}-\d{2}$/.test(e)){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1)}return/^\d{4}$/.test(e)?new Date(Number(e),0,1):new Date(e)}const m=e=>{if(!e||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`},W=e=>{if(!e)return null;const t=T(e);return isNaN(t.getTime())?null:t},Ie=(e,t)=>{const n=N(e);return isNaN(n.getTime())?"":Ce(n,t)},N=(e="",t)=>{const n=typeof e=="string"?T(e):e;return!n||isNaN(n.getTime())?new Date:t?t==="end"?Nt(n):G(n):n},C=(e,t,n=1)=>{if(typeof e!="number"||typeof t!="number"||typeof n!="number"||isNaN(e)||isNaN(t)||isNaN(n))return new Date;const r=new Date(e,t,n);return isNaN(r.getTime())?new Date:r},F=e=>{let t;return typeof e=="number"?t=new M(e,window.pktTz):t=new M(e,window.pktTz),t.setHours(12,0,0,0),t},Fe=e=>!e||isNaN(e.getTime())?"":new Intl.DateTimeFormat("no",{dateStyle:"full",timeZone:window.pktTz}).format(e),Ae=(e,t,n)=>{if(!e||isNaN(e.getTime()))return!1;const r=t?N(t):null,a=n?N(n):null;return!(r&&e<r||a&&e>a)},He=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;const n=m(e);return t.includes(n)},Re=(e,t)=>{if(!e||isNaN(e.getTime())||!Array.isArray(t))return!1;const n=e.getDay().toString();return t.includes(n)},bt=(e,t,n,r,a)=>!(!e||isNaN(e.getTime())||!Ae(e,t,n)||r&&He(e,r)||a&&Re(e,a)),qe=(e,t,n,r,a)=>e.filter(s=>{const i=W(s);return i&&bt(i,t,n,r,a)}),Le=e=>e.slice().sort((t,n)=>{const r=W(t),a=W(n);return!r||!a?0:r.getTime()-a.getTime()}),Ue=(e,t)=>{const n=W(e),r=W(t);return!n||!r?!1:n<=r},Dt=e=>e?Array.isArray(e)?e.filter(Boolean):String(e).split(",").map(t=>t.trim()).filter(Boolean):[],Be=e=>e.join(","),ze=e=>Dt(e),je=e=>e?T(e):null,Qe=e=>{if(typeof e=="string")return e.split(",").map(t=>T(t));if(Array.isArray(e))return e.map(t=>T(t))},L={csvToArray:ze,stringToDate:je,stringsToDate:Qe},Xe={earliest:{default:null},latest:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},maxMultiple:{default:4},range:{default:!1}},x={props:Xe};function kt(e,t){const n=t.excludedates.map(r=>typeof r=="string"?r:m(r));return!bt(e,t.earliest,t.latest,n,t.excludeweekdays)}function Ge(e,t,n,r){return!!(kt(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function Ve(e,t,n){const r=C(e,t,0);return!(n&&N(n)>r)}function Ke(e,t,n){const r=C(t===11?e+1:e,t===11?0:t+1,1);return!(n&&N(n)<r)}const R=7,Je=6;function Ze(e,t){const n=C(e,t,1),r=C(e,t+1,0),a=(n.getDay()+Je)%R,s=r.getDate(),i=Math.ceil((s+a)/R),c=C(e,t,0).getDate(),d=yt(n);return{firstDayOfMonth:n,lastDayOfMonth:r,startingDay:a,numDays:s,numRows:i,numDaysPrevMonth:c,initialWeek:d}}function tn(e,t,n,r){const{startingDay:a,numDays:s}=r;return e===0&&t<a?"prev-month":n>s?"next-month":"current-month"}function en(e,t,n,r){const{startingDay:a,numDaysPrevMonth:s,numDays:i}=r;return e==="prev-month"?s-(a-t-1):e==="next-month"?n-i:n}function E(e){return typeof e=="string"&&(e=e.split(",")),e.length===1&&e[0]===""?[]:e.map(t=>T(t))}function lt(e,t){const n=mt({start:e,end:t}),r={};if(Array.isArray(n)&&n.length)for(let a=0;a<n.length;a++){const s=n[a],i=s>e&&s<t;r[m(s)]=i}return r}function St(e,t,n,r){if(t.length!==1)return!0;const a=mt({start:t[0],end:e});if(!Array.isArray(a)||!a.length)return!0;for(let s=0;s<a.length;s++){for(const i of n)if(i>t[0]&&i<e)return!1;if(r.includes($e(a[s]).toString()))return!1}return!0}function K(e,t){const n=m(e);return t.includes(n)?t:[...t,n]}function J(e,t){const n=m(e),r=t.indexOf(n);if(r===-1)return t;if(t.length===1)return[];const a=[...t];return a.splice(r,1),a}function nn(e,t,n){const r=m(e);return t.includes(r)?J(e,t):n>0&&t.length>=n?t:K(e,t)}function rn(e,t,n){const r=m(e),a=E(t);if(t.includes(r))return t.indexOf(r)===0?[]:J(e,t);if(t.length>1)return[r];if(t.length===1){if(!St(e,a,n.excludedates,n.excludeweekdays))return[r];if(a[0]>e)return[r]}return K(e,t)}const an={ArrowLeft:-1,ArrowRight:1,ArrowUp:-R,ArrowDown:R};function sn(e){var n;const t=e.nodeName;return t==="INPUT"||t==="SELECT"||t==="BUTTON"&&!((n=e.dataset)!=null&&n.date)}function on(e,t,n){let r=nt(e,t);if(!r)return null;let a=n(`button[data-date="${m(r)}"]`);for(;a instanceof HTMLButtonElement&&a.dataset.disabled;)if(r=nt(r,t),a=n(`button[data-date="${m(r)}"]`),!a)return null;return r}function cn(e){return an[e]??null}var un=Object.defineProperty,ln=Object.getOwnPropertyDescriptor,h=(e,t,n,r)=>{for(var a=r>1?void 0:r?ln(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&un(t,n,a),a};exports.PktCalendar=class extends u.PktElement{constructor(){super(...arguments),this.selected=[],this.multiple=x.props.multiple.default,this.maxMultiple=x.props.maxMultiple.default,this.range=x.props.range.default,this.earliest=x.props.earliest.default,this.latest=x.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=x.props.weeknumbers.default,this.withcontrols=x.props.withcontrols.default,this.currentmonth=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}firstUpdated(t){this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback()}updated(t){super.updated(t),t.has("selected")&&this.convertSelected()}convertSelected(){typeof this.selected=="string"&&(this.selected=this.selected.split(",")),this.selected.length===1&&this.selected[0]===""&&(this.selected=[]),this._selected=E(this.selected),this.range&&this.selected.length===2&&(this.inRange=lt(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==""){const t=T(this.selected[this.selected.length-1]);this.currentmonth=isNaN(t.getTime())?F(new Date):t}else this.currentmonth===null&&(this.currentmonth=F(new Date));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=F(new Date)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(t){const n=cn(t.key);n!==null&&this.handleArrowKey(t,n)}handleArrowKey(t,n){const r=t.target;if(sn(r))return;if(t.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}const a=this.focusedDate?N(this.focusedDate):C(this.year,this.month,1),s=on(a,n,this.querySelector.bind(this));if(s){const i=this.querySelector(`button[data-date="${m(s)}"]`);i instanceof HTMLButtonElement&&!i.dataset.disabled&&(this.focusedDate=m(s),i.focus())}}render(){return u.x`
|
|
2
2
|
<div
|
|
3
3
|
class="pkt-calendar ${this.weeknumbers?"pkt-cal-weeknumbers":""}"
|
|
4
4
|
@focusout=${this.closeEvent}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { e as nt } from "./class-map-Dt2jXOlF.js";
|
|
2
2
|
import { P as xt, x as D, E as rt, n as f, t as Ot } from "./element-BXsf_NlG.js";
|
|
3
3
|
import { r as q } from "./state-DgnkjP0q.js";
|
|
4
|
-
import "./icon-
|
|
4
|
+
import "./icon-DBZvMard.js";
|
|
5
5
|
const mt = 6048e5, Pt = 864e5, at = Symbol.for("constructDateFrom");
|
|
6
6
|
function k(t, e) {
|
|
7
7
|
return typeof t == "function" ? t(e) : t && typeof t == "object" && at in t ? t[at](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
@@ -3,8 +3,8 @@ import { o as k } from "./if-defined-CxHgig4I.js";
|
|
|
3
3
|
import { P as u, E as d, x as t, n as r, t as m } from "./element-BXsf_NlG.js";
|
|
4
4
|
import { P as $ } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
5
5
|
import { e as y, n as _ } from "./ref-BxiKhrfa.js";
|
|
6
|
-
import "./icon-
|
|
7
|
-
import "./tag-
|
|
6
|
+
import "./icon-DBZvMard.js";
|
|
7
|
+
import "./tag-Cw3OQqLW.js";
|
|
8
8
|
import "./heading-J7dN9nRi.js";
|
|
9
9
|
const b = { layout: { default: "vertical" }, skin: { type: ["outlined", "outlined-beige", "gray", "blue", "beige", "green"], default: "outlined" }, padding: { default: "default" } }, p = {
|
|
10
10
|
props: b
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const p=require("./class-map-CApIYSRo.cjs"),h=require("./if-defined-BElHLTlB.cjs"),t=require("./element-aUzIoa1s.cjs"),c=require("./pkt-slot-controller-BzddBp7z.cjs"),g=require("./ref-C5iJMIE1.cjs");require("./icon-
|
|
1
|
+
"use strict";const p=require("./class-map-CApIYSRo.cjs"),h=require("./if-defined-BElHLTlB.cjs"),t=require("./element-aUzIoa1s.cjs"),c=require("./pkt-slot-controller-BzddBp7z.cjs"),g=require("./ref-C5iJMIE1.cjs");require("./icon-n4-ve48P.cjs");require("./tag-P9lfQZbM.cjs");require("./heading-CBepYb7H.cjs");const k={layout:{default:"vertical"},skin:{type:["outlined","outlined-beige","gray","blue","beige","green"],default:"outlined"},padding:{default:"default"}},o={props:k};var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,e=(i,a,s,n)=>{for(var r=n>1?void 0:n?m(a,s):a,d=i.length-1,l;d>=0;d--)(l=i[d])&&(r=(n?l(a,s,r):l(r))||r);return n&&r&&u(a,s,r),r};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=g.e(),this.ariaLabel="",this.metaLead=null,this.borderOnHover=!0,this.clickCardLink=null,this.metaTrail=null,this.layout=o.props.layout.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=o.props.padding.default,this.skin=o.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new c.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var r,d;const a={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.layout}`]:this.layout,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},s=((r=this.ariaLabel)==null?void 0:r.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),n=((d=this.ariaLabel)==null?void 0:d.trim())||(this.heading?this.heading:"kort");return t.x`
|
|
2
2
|
<article
|
|
3
3
|
class=${p.e(a)}
|
|
4
4
|
aria-label=${h.o(this.clickCardLink?s:n)}
|
|
@@ -7,9 +7,9 @@ import { c as R } from "./repeat-B55jMEsG.js";
|
|
|
7
7
|
import { P as V } from "./input-element-DVZhYDJ_.js";
|
|
8
8
|
import { P as A } from "./pkt-options-controller-zn5cmMvL.js";
|
|
9
9
|
import { P as C } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
10
|
-
import "./input-wrapper-
|
|
11
|
-
import "./icon-
|
|
12
|
-
import "./tag-
|
|
10
|
+
import "./input-wrapper-DVUh5rxv.js";
|
|
11
|
+
import "./icon-DBZvMard.js";
|
|
12
|
+
import "./tag-Cw3OQqLW.js";
|
|
13
13
|
import "./listbox-CLtowV6W.js";
|
|
14
14
|
const S = { displayValueAs: { default: "label" } }, T = {
|
|
15
15
|
props: S
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./element-aUzIoa1s.cjs"),c=require("./if-defined-BElHLTlB.cjs"),d=require("./state-GDzxl12x.cjs"),r=require("./ref-C5iJMIE1.cjs"),y=require("./class-map-CApIYSRo.cjs"),O=require("./repeat-DcYSFU2y.cjs"),$=require("./input-element-RBQVA8i0.cjs"),I=require("./pkt-options-controller-DjBCEHU4.cjs"),w=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-
|
|
1
|
+
"use strict";const o=require("./element-aUzIoa1s.cjs"),c=require("./if-defined-BElHLTlB.cjs"),d=require("./state-GDzxl12x.cjs"),r=require("./ref-C5iJMIE1.cjs"),y=require("./class-map-CApIYSRo.cjs"),O=require("./repeat-DcYSFU2y.cjs"),$=require("./input-element-RBQVA8i0.cjs"),I=require("./pkt-options-controller-DjBCEHU4.cjs"),w=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-Bta4FZe3.cjs");require("./icon-n4-ve48P.cjs");require("./tag-P9lfQZbM.cjs");require("./listbox-C_0RhGhk.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,n=(v,t,e,i)=>{for(var s=i>1?void 0:i?A(t,e):t,a=v.length-1,l;a>=0;a--)(l=v[a])&&(s=(i?l(t,e,s):l(s))||s);return i&&s&&V(t,e,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._value=[],this._isOptionsOpen=!1,this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new I.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var t,e;if(super.connectedCallback(),document&&document.body.addEventListener("click",i=>{this._isOptionsOpen&&!this.contains(i.target)&&this.handleFocusOut(i)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const i=((t=this.options)==null?void 0:t.filter(s=>s.userAdded))||[];this.options=[...i,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if((e=this.optionsController)!=null&&e.nodes&&this.optionsController.nodes.length){const i=[];this.optionsController.nodes.forEach(s=>{if(!s.textContent&&!s.getAttribute("value"))return null;const a={value:s.getAttribute("value")||s.textContent||"",label:s.textContent||s.getAttribute("value")||""};s.getAttribute("data-prefix")&&(a.prefix=s.getAttribute("data-prefix")||void 0),s.getAttribute("tagskincolor")&&(a.tagSkinColor=s.getAttribute("tagskincolor")),s.getAttribute("description")&&(a.description=s.getAttribute("description")||void 0),a.fulltext=a.value+a.label+(a.prefix||""),i.push(a)}),i.length&&(this.options=[...i],this._options=[...i])}}updated(t){if(t.has("_value")&&this.valueChanged(this._value,t.get("_value")),t.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),t.has("defaultOptions")&&this.defaultOptions.length){const e=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...e,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(t.has("options")){const s=(t.get("options")||this._options||[]).filter(l=>l&&l.userAdded).filter(l=>!(Array.isArray(this.options)?this.options:[]).some(h=>h.value===l.value)),a=[...s,...this.options];this._options=a,s.length>0&&(this.options=a),this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const h=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,h)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}t.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(t)}attributeChangedCallback(t,e,i){t==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),t==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(t,e,i)}render(){return o.x`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
.label=${this.label}
|
|
4
4
|
.helptext=${this.helptext}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./element-aUzIoa1s.cjs");require("./button-
|
|
1
|
+
"use strict";const o=require("./element-aUzIoa1s.cjs");require("./button-Ju4zPhVx.cjs");require("./icon-n4-ve48P.cjs");const k={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}};var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,s=(r,e,t,n)=>{for(var i=n>1?void 0:n?p(e,t):e,a=r.length-1,l;a>=0;a--)(l=r[a])&&(i=(n?l(e,t,i):l(i))||i);return n&&i&&d(e,t,i),i};let c=null;function u(){return c||(c=new Promise((r,e)=>{if(document.querySelector("#oslo-consent-script")){r();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>r(),t.onerror=e,document.head.appendChild(t);const n=document.createElement("link");n.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",n.type="text/css",n.rel="stylesheet",n.id="oslo-consent-styles",document.head.appendChild(n)}),c)}exports.PktConsent=class extends o.PktElement{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||k.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const n=this.returnJsonOrObject(e.value).items.reduce((i,a)=>(i[a.name]=a.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:n,bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await u(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const n={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(n),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?o.x`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?o.x`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
2
2
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
3
3
|
${this.triggerText}
|
|
4
4
|
</a>`:this.triggerType==="icon"?o.x`<pkt-button
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("./element-aUzIoa1s.cjs"),B=require("./state-GDzxl12x.cjs"),u=require("./calendar-
|
|
1
|
+
"use strict";const r=require("./element-aUzIoa1s.cjs"),B=require("./state-GDzxl12x.cjs"),u=require("./calendar-5Obd0ZT3.cjs"),A=require("./input-element-RBQVA8i0.cjs"),p=require("./ref-C5iJMIE1.cjs");require("./icon-n4-ve48P.cjs");require("./input-wrapper-Bta4FZe3.cjs");const m=require("./class-map-CApIYSRo.cjs"),M=require("./repeat-DcYSFU2y.cjs");require("./tag-P9lfQZbM.cjs");const I=require("./utils-byXsEz1u.cjs"),g=require("./if-defined-BElHLTlB.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs");var F=Object.defineProperty,q=Object.getOwnPropertyDescriptor,b=(s,e,t,a)=>{for(var i=a>1?void 0:a?q(e,t):e,n=s.length-1,l;n>=0;n--)(l=s[n])&&(i=(a?l(e,t,i):l(i))||i);return a&&i&&F(e,t,i),i};exports.PktDateTags=class extends r.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=I.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},r.x`
|
|
2
2
|
<div class=${m.e(this.classes)} aria-live="polite">
|
|
3
3
|
${Array.isArray(this.dates)&&this.dates[0]?M.c(u.sortDateStrings((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return r.x` <pkt-tag
|
|
4
4
|
id=${this.idBase+e+"-tag"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { P as L, E, x as o, n as l, t as w } from "./element-BXsf_NlG.js";
|
|
2
2
|
import { r as G } from "./state-DgnkjP0q.js";
|
|
3
|
-
import { s as z, f as K, n as A, a as J, i as Q, b as F, v as D, c as X, d as Y, p as Z, e as H } from "./calendar-
|
|
3
|
+
import { s as z, f as K, n as A, a as J, i as Q, b as F, v as D, c as X, d as Y, p as Z, e as H } from "./calendar-CTx8PD1L.js";
|
|
4
4
|
import { P as ee } from "./input-element-DVZhYDJ_.js";
|
|
5
5
|
import { e as g, n as v } from "./ref-BxiKhrfa.js";
|
|
6
|
-
import "./icon-
|
|
7
|
-
import "./input-wrapper-
|
|
6
|
+
import "./icon-DBZvMard.js";
|
|
7
|
+
import "./input-wrapper-DVUh5rxv.js";
|
|
8
8
|
import { e as $ } from "./class-map-Dt2jXOlF.js";
|
|
9
9
|
import { c as te } from "./repeat-B55jMEsG.js";
|
|
10
|
-
import "./tag-
|
|
10
|
+
import "./tag-Cw3OQqLW.js";
|
|
11
11
|
import { u as se, s as ie } from "./utils-DznhwRXm.js";
|
|
12
12
|
import { o as f } from "./if-defined-CxHgig4I.js";
|
|
13
13
|
import { P as ae } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-aUzIoa1s.cjs"),x=require("./ref-C5iJMIE1.cjs"),h=require("./icon-
|
|
1
|
+
"use strict";const t=require("./element-aUzIoa1s.cjs"),x=require("./ref-C5iJMIE1.cjs"),h=require("./icon-n4-ve48P.cjs"),u=require("./class-map-CApIYSRo.cjs"),a=require("./state-GDzxl12x.cjs"),c=require("./utils-byXsEz1u.cjs"),d=require("./input-wrapper-EoSAbU-U.cjs"),k=require("./pkt-slot-controller-BzddBp7z.cjs");var w=Object.defineProperty,_=Object.getOwnPropertyDescriptor,l=(o,p,r,n)=>{for(var e=n>1?void 0:n?_(p,r):p,s=o.length-1,i;s>=0;s--)(i=o[s])&&(e=(n?i(p,r,e):i(e))||e);return n&&e&&w(p,r,e),e};exports.PktHelptext=class extends t.PktElement{constructor(){super(),this.defaultSlot=x.e(),this.forId=c.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new k.PktSlotController(this,this.defaultSlot)}updateSlots(p){this.filledSlots=new Set(p)}render(){const p=()=>{const s=!this.isHelpTextOpen;this.isHelpTextOpen=s,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:s}}))},r=u.e({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),n=()=>this.helptextDropdown?t.x`<div class="pkt-inputwrapper__helptext-expandable">
|
|
2
2
|
<button
|
|
3
3
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
4
4
|
type="button"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as c, x as a, E as f, n as r, t as w } from "./element-BXsf_NlG.js";
|
|
2
2
|
import { e as _, n as m } from "./ref-BxiKhrfa.js";
|
|
3
|
-
import { o as x } from "./icon-
|
|
3
|
+
import { o as x } from "./icon-DBZvMard.js";
|
|
4
4
|
import { e as d } from "./class-map-Dt2jXOlF.js";
|
|
5
5
|
import { r as u } from "./state-DgnkjP0q.js";
|
|
6
6
|
import { u as k } from "./utils-DznhwRXm.js";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { E as y, T as P, P as k, x as I, n as p, t as _ } from "./element-BXsf_NlG.js";
|
|
2
|
+
import { e as m, i as S, t as b } from "./directive-oAbCiebi.js";
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2017 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
class h extends S {
|
|
9
|
+
constructor(t) {
|
|
10
|
+
if (super(t), this.it = y, t.type !== b.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
11
|
+
}
|
|
12
|
+
render(t) {
|
|
13
|
+
if (t === y || t == null) return this._t = void 0, this.it = t;
|
|
14
|
+
if (t === P) return t;
|
|
15
|
+
if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
16
|
+
if (t === this.it) return this._t;
|
|
17
|
+
this.it = t;
|
|
18
|
+
const n = [t];
|
|
19
|
+
return n.raw = n, this._t = { _$litType$: this.constructor.resultType, strings: n, values: [] };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
h.directiveName = "unsafeHTML", h.resultType = 1;
|
|
23
|
+
const R = m(h);
|
|
24
|
+
/**
|
|
25
|
+
* @license
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
+
*/
|
|
29
|
+
class l extends h {
|
|
30
|
+
}
|
|
31
|
+
l.directiveName = "unsafeSVG", l.resultType = 2;
|
|
32
|
+
const f = m(l);
|
|
33
|
+
var C = Object.defineProperty, E = Object.getOwnPropertyDescriptor, c = (e, t, n, s) => {
|
|
34
|
+
for (var o = s > 1 ? void 0 : s ? E(t, n) : t, d = e.length - 1, u; d >= 0; d--)
|
|
35
|
+
(u = e[d]) && (o = (s ? u(t, n, o) : u(o)) || o);
|
|
36
|
+
return s && o && C(t, n, o), o;
|
|
37
|
+
};
|
|
38
|
+
const w = "https://punkt-cdn.oslo.kommune.no/latest/icons/";
|
|
39
|
+
typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || w);
|
|
40
|
+
const a = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>', r = {}, T = 2, F = 1500, g = typeof Storage < "u" && typeof sessionStorage < "u", $ = (e) => window.pktFetch(e).then((t) => {
|
|
41
|
+
if (!t.ok)
|
|
42
|
+
throw new Error("Missing icon: " + e);
|
|
43
|
+
return t.text();
|
|
44
|
+
}), v = async (e, t = T) => {
|
|
45
|
+
try {
|
|
46
|
+
return await $(e);
|
|
47
|
+
} catch {
|
|
48
|
+
return t > 0 ? (await new Promise((s) => setTimeout(s, F)), v(e, t - 1)) : (console.error("Failed to fetch icon: " + e), a);
|
|
49
|
+
}
|
|
50
|
+
}, x = async (e, t) => {
|
|
51
|
+
const n = t + e + ".svg";
|
|
52
|
+
return g && sessionStorage.getItem(n) ? sessionStorage.getItem(n) : n in r ? r[n] : typeof window < "u" && typeof window.pktFetch == "function" ? (r[n] = v(n).then((s) => (s !== a && g && sessionStorage.setItem(n, s), delete r[n], s)), r[n]) : a;
|
|
53
|
+
};
|
|
54
|
+
let i = class extends k {
|
|
55
|
+
constructor() {
|
|
56
|
+
super(...arguments), this.path = typeof window < "u" ? window.pktIconPath : w, this.name = "", this.icon = f(a), this._updatedProps = [];
|
|
57
|
+
}
|
|
58
|
+
connectedCallback() {
|
|
59
|
+
super.connectedCallback(), this.classList.add("pkt-icon");
|
|
60
|
+
}
|
|
61
|
+
async attributeChangedCallback(e, t, n) {
|
|
62
|
+
super.attributeChangedCallback(e, t, n), (e === "name" || e === "path") && this.getIcon(this.name);
|
|
63
|
+
}
|
|
64
|
+
async updated(e) {
|
|
65
|
+
super.updated(e), (e.has("name") || e.has("path")) && this.getIcon(this.name);
|
|
66
|
+
}
|
|
67
|
+
async getIcon(e = "") {
|
|
68
|
+
if (this._updatedProps.length > 0) {
|
|
69
|
+
this.path || (this.path = typeof window < "u" ? window.pktIconPath : w);
|
|
70
|
+
try {
|
|
71
|
+
this.icon = f(
|
|
72
|
+
await x(this.name || "", this.path)
|
|
73
|
+
);
|
|
74
|
+
} catch {
|
|
75
|
+
this.icon = f(a);
|
|
76
|
+
}
|
|
77
|
+
this._updatedProps = [];
|
|
78
|
+
} else
|
|
79
|
+
this._updatedProps.includes(e) || this._updatedProps.push(e);
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
return I`${this.name && this.icon}`;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
c([
|
|
86
|
+
p({ type: String, reflect: !1 })
|
|
87
|
+
], i.prototype, "path", 2);
|
|
88
|
+
c([
|
|
89
|
+
p({ type: String, reflect: !0 })
|
|
90
|
+
], i.prototype, "name", 2);
|
|
91
|
+
c([
|
|
92
|
+
p({ type: SVGElement })
|
|
93
|
+
], i.prototype, "icon", 2);
|
|
94
|
+
c([
|
|
95
|
+
p({ type: Array, noAccessor: !0 })
|
|
96
|
+
], i.prototype, "_updatedProps", 2);
|
|
97
|
+
i = c([
|
|
98
|
+
_("pkt-icon")
|
|
99
|
+
], i);
|
|
100
|
+
export {
|
|
101
|
+
i as P,
|
|
102
|
+
R as o
|
|
103
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";const s=require("./element-aUzIoa1s.cjs"),h=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/class p extends h.i{constructor(t){if(super(t),this.it=s.E,t.type!==h.t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===s.E||t==null)return this._t=void 0,this.it=t;if(t===s.T)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}p.directiveName="unsafeHTML",p.resultType=1;const k=h.e(p);/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/class l extends p{}l.directiveName="unsafeSVG",l.resultType=2;const f=h.e(l);var I=Object.defineProperty,P=Object.getOwnPropertyDescriptor,a=(n,t,e,o)=>{for(var i=o>1?void 0:o?P(t,e):t,d=n.length-1,u;d>=0;d--)(u=n[d])&&(i=(o?u(t,e,i):u(i))||i);return o&&i&&I(t,e,i),i};const w="https://punkt-cdn.oslo.kommune.no/latest/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||w);const c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',r={},m=2,v=1500,y=typeof Storage<"u"&&typeof sessionStorage<"u",_=n=>window.pktFetch(n).then(t=>{if(!t.ok)throw new Error("Missing icon: "+n);return t.text()}),g=async(n,t=m)=>{try{return await _(n)}catch{return t>0?(await new Promise(o=>setTimeout(o,v)),g(n,t-1)):(console.error("Failed to fetch icon: "+n),c)}},S=async(n,t)=>{const e=t+n+".svg";return y&&sessionStorage.getItem(e)?sessionStorage.getItem(e):e in r?r[e]:typeof window<"u"&&typeof window.pktFetch=="function"?(r[e]=g(e).then(o=>(o!==c&&y&&sessionStorage.setItem(e,o),delete r[e],o)),r[e]):c};exports.PktIcon=class extends s.PktElement{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:w,this.name="",this.icon=f(c),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,o){super.attributeChangedCallback(t,e,o),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:w);try{this.icon=f(await S(this.name||"",this.path))}catch{this.icon=f(c)}this._updatedProps=[]}else this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return s.x`${this.name&&this.icon}`}};a([s.n({type:String,reflect:!1})],exports.PktIcon.prototype,"path",2);a([s.n({type:String,reflect:!0})],exports.PktIcon.prototype,"name",2);a([s.n({type:SVGElement})],exports.PktIcon.prototype,"icon",2);a([s.n({type:Array,noAccessor:!0})],exports.PktIcon.prototype,"_updatedProps",2);exports.PktIcon=a([s.t("pkt-icon")],exports.PktIcon);exports.o=k;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-aUzIoa1s.cjs"),x=require("./pkt-slot-controller-BzddBp7z.cjs"),a=require("./ref-C5iJMIE1.cjs"),y=require("./if-defined-BElHLTlB.cjs"),b=require("./icon-
|
|
1
|
+
"use strict";const t=require("./element-aUzIoa1s.cjs"),x=require("./pkt-slot-controller-BzddBp7z.cjs"),a=require("./ref-C5iJMIE1.cjs"),y=require("./if-defined-BElHLTlB.cjs"),b=require("./icon-n4-ve48P.cjs"),$=require("./class-map-CApIYSRo.cjs"),f=require("./utils-byXsEz1u.cjs"),I=require("./booleanish-BKVonob4.cjs"),r=require("./input-wrapper-EoSAbU-U.cjs");require("./helptext-7fyVJK2C.cjs");require("./alert-DVCenNTM.cjs");var P=Object.defineProperty,W=Object.getOwnPropertyDescriptor,e=(u,p,n,o)=>{for(var s=o>1?void 0:o?W(p,n):p,i=u.length-1,l;i>=0;i--)(l=u[i])&&(s=(o?l(p,n,s):l(s))||s);return o&&s&&P(p,n,s),s};exports.PktInputWrapper=class extends t.PktElement{constructor(){super(),this.defaultSlot=a.e(),this.helptextSlot=a.e(),this.forId=f.uuidish(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=r.specs.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=r.specs.props.optionalTag.default,this.optionalText=r.specs.props.optionalText.default,this.requiredTag=r.specs.props.requiredTag.default,this.requiredText=r.specs.props.requiredText.default,this.tagText=null,this.hasError=r.specs.props.hasError.default,this.errorMessage="",this.disabled=r.specs.props.disabled.default,this.inline=r.specs.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=r.specs.props.hasFieldset.default,this.role="group",this.useWrapper=r.specs.props.useWrapper.default,this.slotController=new x.PktSlotController(this,this.defaultSlot,this.helptextSlot)}updated(p){super.updated(p)}render(){const p={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},n="pkt-tag pkt-tag--small pkt-tag--thin-text",o=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:t.E,s=()=>t.x`
|
|
2
2
|
${this.tagText?t.x`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:t.E}
|
|
3
3
|
${this.optionalTag?t.x`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.E}
|
|
4
4
|
${this.requiredTag?t.x`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:t.E}
|