@govtechsg/sgds-web-component 3.23.0-rc.5 → 3.23.0-rc.7
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/components/Checkbox/index.umd.min.js +2 -2
- package/components/Checkbox/index.umd.min.js.map +1 -1
- package/components/Checkbox/sgds-checkbox-group.d.ts +2 -1
- package/components/Checkbox/sgds-checkbox-group.js +4 -9
- package/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/components/Checkbox/types.d.ts +3 -0
- package/components/ComboBox/index.umd.min.js +1 -1
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.d.ts +2 -0
- package/components/ComboBox/sgds-combo-box.js +14 -5
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Radio/index.umd.min.js +1 -1
- package/components/Radio/index.umd.min.js.map +1 -1
- package/components/Radio/sgds-radio-group.js +2 -1
- package/components/Radio/sgds-radio-group.js.map +1 -1
- package/components/index.umd.min.js +4 -4
- package/components/index.umd.min.js.map +1 -1
- package/css/reboot.css +12 -6
- package/css/utility.css +8 -0
- package/custom-elements.json +17 -13
- package/index.umd.min.js +4 -4
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js +4 -9
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.js +4 -9
- package/react/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +14 -5
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +14 -5
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.cjs.js +2 -1
- package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.js +2 -1
- package/react/components/Radio/sgds-radio-group.js.map +1 -1
- package/themes/responsive.css +15 -0
- package/themes/root.css +5 -0
- package/types/react.d.ts +6 -0
package/css/reboot.css
CHANGED
|
@@ -27,28 +27,34 @@ label {
|
|
|
27
27
|
ol,
|
|
28
28
|
ul {
|
|
29
29
|
font-family: var(--sgds-font-family-brand);
|
|
30
|
-
font-size: var(--sgds-font-size-
|
|
30
|
+
font-size: var(--sgds-font-size-list-md);
|
|
31
31
|
font-weight: var(--sgds-font-weight-regular);
|
|
32
32
|
line-height: var(--sgds-line-height-xs);
|
|
33
33
|
list-style-position: outside;
|
|
34
34
|
padding-left: var(--sgds-padding-2-xl);
|
|
35
|
-
margin-top: var(--sgds-margin-
|
|
35
|
+
margin-top: var(--sgds-margin-none);
|
|
36
|
+
margin-bottom: var(--sgds-paragraph-spacing-lg);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
li {
|
|
39
40
|
font-family: var(--sgds-font-family-brand);
|
|
40
|
-
font-size: var(--sgds-font-size-
|
|
41
|
+
font-size: var(--sgds-font-size-list-md);
|
|
41
42
|
font-weight: var(--sgds-font-weight-regular);
|
|
42
43
|
line-height: var(--sgds-line-height-xs);
|
|
43
44
|
list-style-position: outside;
|
|
44
|
-
margin-top: var(--sgds-
|
|
45
|
+
margin-top: var(--sgds-list-spacing-md);
|
|
46
|
+
}
|
|
47
|
+
li:last-child {
|
|
48
|
+
margin-bottom: var(--sgds-margin-none);
|
|
45
49
|
}
|
|
46
50
|
li > ol {
|
|
47
51
|
list-style-type: lower-alpha;
|
|
52
|
+
margin-bottom: var(--sgds-list-spacing-md);
|
|
48
53
|
}
|
|
49
54
|
li > ul {
|
|
50
55
|
list-style-type: disc;
|
|
51
|
-
|
|
56
|
+
margin-bottom: var(--sgds-list-spacing-md);
|
|
57
|
+
}
|
|
52
58
|
|
|
53
59
|
/* HEADINGS */
|
|
54
60
|
h1,
|
|
@@ -124,7 +130,7 @@ caption {
|
|
|
124
130
|
p {
|
|
125
131
|
font-size: var(--sgds-font-size-body-md);
|
|
126
132
|
font-weight: var(--sgds-font-weight-regular);
|
|
127
|
-
margin-bottom: var(--sgds-paragraph-spacing-
|
|
133
|
+
margin-bottom: var(--sgds-paragraph-spacing-lg);
|
|
128
134
|
font-family: var(--sgds-font-family-brand);
|
|
129
135
|
line-height: var(--sgds-line-height-xs);
|
|
130
136
|
letter-spacing: var(--sgds-letter-spacing-normal);
|
package/css/utility.css
CHANGED
|
@@ -285,6 +285,9 @@
|
|
|
285
285
|
--text-body-sm: var(--sgds-font-size-body-sm);
|
|
286
286
|
--text-body-md: var(--sgds-font-size-body-md);
|
|
287
287
|
--text-body-lg: var(--sgds-font-size-body-lg);
|
|
288
|
+
--text-list-sm: var(--sgds-font-size-list-sm);
|
|
289
|
+
--text-list-md: var(--sgds-font-size-list-md);
|
|
290
|
+
--text-list-lg: var(--sgds-font-size-list-lg);
|
|
288
291
|
--text-label-xs: var(--sgds-font-size-label-xs);
|
|
289
292
|
--text-label-sm: var(--sgds-font-size-label-sm);
|
|
290
293
|
--text-label-md: var(--sgds-font-size-label-md);
|
|
@@ -433,6 +436,11 @@
|
|
|
433
436
|
--margin-paragraph-lg: var(--sgds-paragraph-spacing-lg);
|
|
434
437
|
--margin-paragraph-xl: var(--sgds-paragraph-spacing-xl);
|
|
435
438
|
|
|
439
|
+
/* List Spacing */
|
|
440
|
+
--margin-list-sm: var(--sgds-list-spacing-sm);
|
|
441
|
+
--margin-list-md: var(--sgds-list-spacing-md);
|
|
442
|
+
--margin-list-lg: var(--sgds-list-spacing-lg);
|
|
443
|
+
|
|
436
444
|
/* Z-Index - Primitive */
|
|
437
445
|
--z-0: var(--sgds-z-index-0);
|
|
438
446
|
--z-100: var(--sgds-z-index-100);
|
package/custom-elements.json
CHANGED
|
@@ -2876,14 +2876,6 @@
|
|
|
2876
2876
|
"default": "new Set<SgdsCheckbox>()",
|
|
2877
2877
|
"type": {}
|
|
2878
2878
|
},
|
|
2879
|
-
{
|
|
2880
|
-
"kind": "field",
|
|
2881
|
-
"name": "formEvent",
|
|
2882
|
-
"type": {
|
|
2883
|
-
"text": "\"reset\" | \"change\" | \"undefined\""
|
|
2884
|
-
},
|
|
2885
|
-
"privacy": "private"
|
|
2886
|
-
},
|
|
2887
2879
|
{
|
|
2888
2880
|
"kind": "method",
|
|
2889
2881
|
"name": "_renderHintText",
|
|
@@ -3007,10 +2999,7 @@
|
|
|
3007
2999
|
"parameters": [
|
|
3008
3000
|
{
|
|
3009
3001
|
"name": "eventName",
|
|
3010
|
-
"default": "\"change\""
|
|
3011
|
-
"type": {
|
|
3012
|
-
"text": "FormEvent"
|
|
3013
|
-
}
|
|
3002
|
+
"default": "\"change\""
|
|
3014
3003
|
}
|
|
3015
3004
|
],
|
|
3016
3005
|
"description": "when input value is set programatically, need to manually dispatch a change event\nIn order to prevent race conditions and ensure sequence of events, set input's value here instead of binding to value prop of input",
|
|
@@ -3302,6 +3291,14 @@
|
|
|
3302
3291
|
}
|
|
3303
3292
|
],
|
|
3304
3293
|
"exports": [
|
|
3294
|
+
{
|
|
3295
|
+
"kind": "js",
|
|
3296
|
+
"name": "ISgdsCheckboxGroupChangeEventDetail",
|
|
3297
|
+
"declaration": {
|
|
3298
|
+
"name": "ISgdsCheckboxGroupChangeEventDetail",
|
|
3299
|
+
"module": "src/components/Checkbox/sgds-checkbox-group.ts"
|
|
3300
|
+
}
|
|
3301
|
+
},
|
|
3305
3302
|
{
|
|
3306
3303
|
"kind": "js",
|
|
3307
3304
|
"name": "SgdsCheckboxGroup",
|
|
@@ -4484,6 +4481,13 @@
|
|
|
4484
4481
|
"name": "_handleValueChange",
|
|
4485
4482
|
"type": {}
|
|
4486
4483
|
},
|
|
4484
|
+
{
|
|
4485
|
+
"kind": "method",
|
|
4486
|
+
"name": "_emitChangeEvents",
|
|
4487
|
+
"privacy": "private",
|
|
4488
|
+
"description": "Emits sgds-change and sgds-select events. Call after setting this.value from user interaction.",
|
|
4489
|
+
"type": {}
|
|
4490
|
+
},
|
|
4487
4491
|
{
|
|
4488
4492
|
"kind": "method",
|
|
4489
4493
|
"name": "_handleOptionListChange",
|
|
@@ -27951,7 +27955,7 @@
|
|
|
27951
27955
|
"package": {
|
|
27952
27956
|
"name": "@govtechsg/sgds-web-component",
|
|
27953
27957
|
"description": "",
|
|
27954
|
-
"version": "3.23.0-rc.
|
|
27958
|
+
"version": "3.23.0-rc.7",
|
|
27955
27959
|
"author": "GovTechSG",
|
|
27956
27960
|
"license": "MIT"
|
|
27957
27961
|
}
|
package/index.umd.min.js
CHANGED
|
@@ -2565,7 +2565,7 @@ const Fa=(e,t,s)=>{const i=new Map;for(let a=t;a<=s;a++)i.set(e[a],a);return i};
|
|
|
2565
2565
|
`}}Ha.styles=[...Pe.styles,da,Pa],e([Ve({type:String,reflect:!0})],Ha.prototype,"variant",void 0),e([Ve({type:String,reflect:!0})],Ha.prototype,"tone",void 0),e([Ve({type:String,reflect:!0})],Ha.prototype,"size",void 0),e([Ve({reflect:!0,type:String})],Ha.prototype,"label",void 0),e([Ve({type:String,reflect:!0})],Ha.prototype,"orientation",void 0);class za extends Sa{constructor(){super(...arguments),this.multiSelect=!1,this.badgeFullWidth=!1,this.clearable=!1,this.noValidate=!1,this.async=!1,this.emptyMenuAsync=!1,this.scrollBottomOffset=0,this.filterFunction=(e,t)=>t.label.toLowerCase().startsWith(e.toLowerCase()),this.optionList=[],this.emptyMenuAfterFiltering=!1,this.isFocused=!1,this.isScrollEnd=!1,this.suffixIconTemplate=ee`<sgds-icon
|
|
2566
2566
|
name=${this.menuIsOpen?"chevron-up":"chevron-down"}
|
|
2567
2567
|
size="md"
|
|
2568
|
-
></sgds-icon>`,this.prefixIconTemplate=ee`${ie}`}connectedCallback(){super.connectedCallback(),this.addEventListener("focus",async()=>{this.isFocused=!0}),this.addEventListener("blur",async()=>{this.isFocused=!1}),this.addEventListener("keydown",e=>{var t,s;"Enter"===e.key&&(null===(s=null===(t=e.target.shadowRoot)||void 0===t?void 0:t.querySelector(".form-clearable"))||void 0===s?void 0:s.matches(":focus"))&&this._handleClear()}),this.addEventListener("sgds-hide",async e=>{if(!e.detail.isOutside){(await this._input).focus()}this.options.forEach(e=>e.removeAttribute("hidden")),this.emptyMenuAfterFiltering=!1})}async firstUpdated(e){super.firstUpdated(e),this.async&&(this.filterFunction=()=>!0),this.menuList.forEach(e=>{const t=document.createElement("sgds-combo-box-option");t.innerText=e.label,t.value=e.value,t.checkbox=this.multiSelect,t.active=this.value.includes(e.value),this.appendChild(t)}),this._setupValidation(this.menuList),this.menuIsOpen&&await this.updateFloatingPosition()}async _handleDefaultSlotChange(e){const t=e.target.assignedElements({flatten:!0});t.forEach(e=>!e.hasAttribute("disabled")&&(!e.clickEventAdded&&(e.addEventListener("click",e=>{e.preventDefault();const t=e.target;return this.multiSelect&&t.active?this._handleItemUnselect(e):this._handleItemSelected(e),!1}),e.clickEventAdded=!0,void e.addEventListener("keydown",e=>{if("Enter"===e.key){this.close="outside";e.target.click()}})))),await this.updateComplete,this.optionList=await this._getMenuListFromOptions(t),this._setupValidation(this.optionList)}async _setupValidation(e){var t;if(this.value&&e.length>0){const s=this.value.split(";"),i=e.filter(({value:e})=>s.includes(e));this.selectedItems=[...i,...this.selectedItems],this.multiSelect||(this.displayValue=null===(t=i[0])||void 0===t?void 0:t.label)}this.multiSelect?this.input=await this._multiSelectInput:this.input=await this._input,this._mixinValidate(this.input)}async _handleValueChange(){this.
|
|
2568
|
+
></sgds-icon>`,this.prefixIconTemplate=ee`${ie}`}connectedCallback(){super.connectedCallback(),this.addEventListener("focus",async()=>{this.isFocused=!0}),this.addEventListener("blur",async()=>{this.isFocused=!1}),this.addEventListener("keydown",e=>{var t,s;"Enter"===e.key&&(null===(s=null===(t=e.target.shadowRoot)||void 0===t?void 0:t.querySelector(".form-clearable"))||void 0===s?void 0:s.matches(":focus"))&&this._handleClear()}),this.addEventListener("sgds-hide",async e=>{if(!e.detail.isOutside){(await this._input).focus()}this.options.forEach(e=>e.removeAttribute("hidden")),this.emptyMenuAfterFiltering=!1})}async firstUpdated(e){super.firstUpdated(e),this.async&&(this.filterFunction=()=>!0),this.menuList.forEach(e=>{const t=document.createElement("sgds-combo-box-option");t.innerText=e.label,t.value=e.value,t.checkbox=this.multiSelect,t.active=this.value.includes(e.value),this.appendChild(t)}),this._setupValidation(this.menuList),this.menuIsOpen&&await this.updateFloatingPosition()}async _handleDefaultSlotChange(e){const t=e.target.assignedElements({flatten:!0});t.forEach(e=>!e.hasAttribute("disabled")&&(!e.clickEventAdded&&(e.addEventListener("click",e=>{e.preventDefault();const t=e.target;return this.multiSelect&&t.active?this._handleItemUnselect(e):this._handleItemSelected(e),!1}),e.clickEventAdded=!0,void e.addEventListener("keydown",e=>{if("Enter"===e.key){this.close="outside";e.target.click()}})))),await this.updateComplete,this.optionList=await this._getMenuListFromOptions(t),this._setupValidation(this.optionList)}async _setupValidation(e){var t;if(this.value&&e.length>0){const s=this.value.split(";"),i=e.filter(({value:e})=>s.includes(e));this.selectedItems=[...i,...this.selectedItems],this.multiSelect||(this.displayValue=null===(t=i[0])||void 0===t?void 0:t.label)}this.multiSelect?this.input=await this._multiSelectInput:this.input=await this._input,this._mixinValidate(this.input)}async _handleValueChange(){this.options.forEach(e=>e.removeAttribute("hidden"));const e=await this._input;this._mixinSetFormValue(),this.multiSelect?this._mixinValidate(this.input):this._mixinValidate(e);this.selectedItems.map(e=>e.value).join(";")!==this.value&&this._updateValueAndDisplayValue(this.optionList),(this._isTouched||""!==this.value)&&(this._mixinShouldSkipSgdsValidation()||(this.invalid=!this._mixinReportValidity()))}_emitChangeEvents(){this._mixinSetFormValue(),this.emit("sgds-change"),this.value&&this.emit("sgds-select")}_handleOptionListChange(){this._updateValueAndDisplayValue(this.optionList)}_handleMenuListChange(){const e=this.menuList.map(e=>{const t=document.createElement("sgds-combo-box-option");return t.innerText=e.label,t.value=e.value,t.checkbox=this.multiSelect,t.active=this.value.includes(e.value),t});this.replaceChildren(...e)}_updateValueAndDisplayValue(e){var t;const s=this.value.split(";"),i=e.filter(({value:e})=>s.includes(e));this.selectedItems=[...i];const a=i.map(e=>e.value).join(";");a!==this.value&&(this.value=a),this.multiSelect||this.async||(this.displayValue=(null===(t=i[0])||void 0===t?void 0:t.label)||""),this.options.forEach(e=>e.active=s.includes(e.value))}async _handleInputChange(e){const t=e.target;this.displayValue=t.value,this.emit("sgds-input",{detail:{displayValue:this.displayValue}}),this.invalid=!1,this.showMenu(),""!==this.displayValue||this.multiSelect||(this.selectedItems=[],this.value=this.selectedItems.join(";"),this.options.forEach(e=>e.active=!1),this._emitChangeEvents());const s=this.options.map(e=>({value:e.value,label:e.textContent.trim()}));this.filteredList=s.filter(e=>this.filterFunction(this.displayValue,e)),this.emptyMenuAfterFiltering=0===this.filteredList.length;const i=this.filteredList.map(e=>e.value);this.options.forEach(e=>{i.includes(e.value)?e.hidden=!1:e.hidden=!0})}async _handleItemSelected(e){var t,s,i;const a=e.target;if(a.disabled)return;const o=null!==(s=null===(t=a.textContent)||void 0===t?void 0:t.trim())&&void 0!==s?s:"",n=null!==(i=a.getAttribute("value"))&&void 0!==i?i:o,r=this.filteredList.find(e=>e.value.toString()===n)||{label:o,value:n};this.multiSelect?(this.selectedItems.some(e=>e.value===r.value)||(this.selectedItems=[...this.selectedItems,r]),this.value=this.selectedItems.map(e=>e.value).join(";"),a.active=!0):0!==this.selectedItems.length&&this.selectedItems[0].value===r.value||(this.options.forEach(e=>e.active=!1),a.active=!0,this.selectedItems=[r],this.value=r.value.toString(),this.displayValue=r.label,this.hideMenu()),this._emitChangeEvents()}_handleItemUnselect(e){var t,s,i;const a=e.target;if(a.disabled)return;a.removeAttribute("active");const o=null!==(s=null===(t=a.textContent)||void 0===t?void 0:t.trim())&&void 0!==s?s:"",n=null!==(i=a.getAttribute("value"))&&void 0!==i?i:o,r=this.filteredList.find(e=>e.value.toString()===n)||{label:o,value:n};this.selectedItems=this.selectedItems.filter(e=>e.value!==r.value),this.value=this.selectedItems.map(e=>e.value).join(";"),this._emitChangeEvents()}async _handleBadgeDismissed(e,t){var s;e.preventDefault();const i=t.value;null===(s=this.options)||void 0===s||s.forEach(e=>e.value===i?e.active=!1:null),this.selectedItems=this.selectedItems.filter(e=>e.value!==t.value),this.value=this.selectedItems.map(e=>e.value).join(";"),this._emitChangeEvents()}async _handleMultiSelectKeyDown(e){var t;if(this.multiSelect&&"Backspace"===e.key&&this.multiSelect&&""===this.displayValue.trim()&&this.selectedItems.length>0){const e=this.selectedItems[this.selectedItems.length-1].value;null===(t=this.options)||void 0===t||t.forEach(t=>t.value===e?t.active=!1:null),this.selectedItems=this.selectedItems.slice(0,-1),this.value=this.selectedItems.map(e=>e.value).join(";"),this._emitChangeEvents()}}_handleFocus(){this.emit("sgds-focus")}async _handleInputBlur(e){if(e.preventDefault(),this.emit("sgds-blur"),this.multiSelect){this.selectedItems.filter(({label:e})=>this.displayValue===e).length<=0&&(this.displayValue="")}else this.selectedItems.length>0?this.displayValue=this.selectedItems[0].label:this.displayValue=""}async _handleClear(){var e;this.value=this.displayValue="",null===(e=this.options)||void 0===e||e.forEach(e=>e.active=!1),this._emitChangeEvents();(await this._input).focus(),this.showMenu()}async _mixinResetFormControl(){if(this.value=this.defaultValue,this.multiSelect){const e=this.value.split(";");this.options.forEach(t=>{t.active=e.includes(t.value)});const t=this.options.filter(t=>e.includes(t.value));this.selectedItems=t.map(e=>({value:e.value,label:e.textContent.trim()})),this._mixinResetValidity(await this._multiSelectInput)}else{this.options.forEach(e=>{e.active=e.value===this.value});const e=this.options.filter(e=>e.value===this.value);e.length<=0?this.displayValue="":this.displayValue=e[0].textContent.trim(),this._mixinResetValidity(await this._input)}}async _handleScroll(e){const t=e.target;if(t){const e=t.scrollHeight-t.clientHeight,s=Math.max(0,this.scrollBottomOffset);t.scrollTop>=e-s?(this.isScrollEnd||this.emit("sgds-scroll-end"),this.isScrollEnd=!0):this.isScrollEnd=!1}}_renderInput(e){const t=this.hasFeedback,s=e;return ee`
|
|
2569
2569
|
<div
|
|
2570
2570
|
${rs(this.myDropdown)}
|
|
2571
2571
|
class="form-control-group ${We({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&t})}"
|
|
@@ -2657,7 +2657,7 @@ const Fa=(e,t,s)=>{const i=new Map;for(let a=t;a<=s;a++)i.set(e[a],a);return i};
|
|
|
2657
2657
|
aria-hidden="true"
|
|
2658
2658
|
.autocomplete=${this.autocomplete}
|
|
2659
2659
|
/>`:ie}
|
|
2660
|
-
`}}za.styles=[...Sa.styles,ya,Ma],za.childName="sgds-combo-box-option",za.dependencies={[za.childName]:La,"sgds-icon":Lt,"sgds-badge":zi,"sgds-spinner":Ha},e([Ve({type:Boolean,reflect:!0})],za.prototype,"multiSelect",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"badgeFullWidth",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"clearable",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"noValidate",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"async",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"emptyMenuAsync",void 0),e([Ve({type:Number,reflect:!0})],za.prototype,"scrollBottomOffset",void 0),e([Ve()],za.prototype,"filterFunction",void 0),e([Ze("input#multi-select-input-tracker")],za.prototype,"_multiSelectInput",void 0),e([Le({flatten:!0,selector:"sgds-combo-box-option"})],za.prototype,"options",void 0),e([De()],za.prototype,"optionList",void 0),e([De()],za.prototype,"emptyMenuAfterFiltering",void 0),e([De()],za.prototype,"isFocused",void 0),e([De()],za.prototype,"isScrollEnd",void 0),e([ot("value",{waitUntilFirstUpdate:!0})],za.prototype,"_handleValueChange",null),e([ot("optionList",{waitUntilFirstUpdate:!0})],za.prototype,"_handleOptionListChange",null),e([ot("menuList",{waitUntilFirstUpdate:!0})],za.prototype,"_handleMenuListChange",null),lt("sgds-combo-box",za),lt("sgds-combo-box-option",La);var Ra=n`:host{--sgds-checkbox-group-gap:var(--sgds-spacer-2)}fieldset{border:0;gap:var(--sgds-form-gap-md);margin:0;min-width:0;padding:0}.label-hint-container,fieldset{display:flex;flex-direction:column}.label-hint-container{gap:var(--sgds-form-gap-sm)}.label-hint-container .form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.checkbox-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md);padding:var(--sgds-form-padding-inline-sm) 0}.checkbox-group-validation-input{display:none}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-40)}`;class Oa extends(_a(Ea)){constructor(){super(...arguments),this.label="",this.invalidFeedback="Please tick at least one box if you want to proceed",this.hasFeedback=!1,this.hintText="",this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this.defaultValue="",this._blurredCheckboxes=new Set}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-check",e=>{const{value:t}=e.detail;!this.value.includes(t)&&this._addValue(t)}),this.addEventListener("sgds-uncheck",e=>{const{value:t}=e.detail;this._removeValue(t)}),this.addEventListener("sgds-blur",e=>{const t=e.target;this._blurredCheckboxes.add(t),Array.from(this._blurredCheckboxes).length===this._checkboxes.length&&(this._isTouched=!0,this._blurredCheckboxes.clear())})}firstUpdated(e){super.firstUpdated(e),this.value&&this._updateInputValue(),this.invalid&&this._updateInvalid()}_renderHintText(){const e=ee` <div class="form-text" id="${this._controlId}Help">${this.hintText}</div> `;return this.hintText&&e}_addValue(e){const t=this.value?this.value.split(";"):[];t.push(e),this.value=t.join(";")}_removeValue(e){const t=(this.value?this.value.split(";"):[]).filter(t=>t!==e);this.value=t.join(";")}_sanitizeSlot(){this._checkboxes.forEach(e=>{e.checked=e.defaultChecked=this.value.includes(e.value),e.hasFeedback=this.hasFeedback?"style":null,e.required&&(console.error("Checkboxes in a group cannot have required or hasFeedback prop set to true"),e.remove())}),this._disabledChildCheckboxes()}_disabledChildCheckboxes(){if(this.disabled){this._checkboxes.forEach(e=>e.disabled=this.disabled)}}_handleValueChange(){
|
|
2660
|
+
`}}za.styles=[...Sa.styles,ya,Ma],za.childName="sgds-combo-box-option",za.dependencies={[za.childName]:La,"sgds-icon":Lt,"sgds-badge":zi,"sgds-spinner":Ha},e([Ve({type:Boolean,reflect:!0})],za.prototype,"multiSelect",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"badgeFullWidth",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"clearable",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"noValidate",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"async",void 0),e([Ve({type:Boolean,reflect:!0})],za.prototype,"emptyMenuAsync",void 0),e([Ve({type:Number,reflect:!0})],za.prototype,"scrollBottomOffset",void 0),e([Ve()],za.prototype,"filterFunction",void 0),e([Ze("input#multi-select-input-tracker")],za.prototype,"_multiSelectInput",void 0),e([Le({flatten:!0,selector:"sgds-combo-box-option"})],za.prototype,"options",void 0),e([De()],za.prototype,"optionList",void 0),e([De()],za.prototype,"emptyMenuAfterFiltering",void 0),e([De()],za.prototype,"isFocused",void 0),e([De()],za.prototype,"isScrollEnd",void 0),e([ot("value",{waitUntilFirstUpdate:!0})],za.prototype,"_handleValueChange",null),e([ot("optionList",{waitUntilFirstUpdate:!0})],za.prototype,"_handleOptionListChange",null),e([ot("menuList",{waitUntilFirstUpdate:!0})],za.prototype,"_handleMenuListChange",null),lt("sgds-combo-box",za),lt("sgds-combo-box-option",La);var Ra=n`:host{--sgds-checkbox-group-gap:var(--sgds-spacer-2)}fieldset{border:0;gap:var(--sgds-form-gap-md);margin:0;min-width:0;padding:0}.label-hint-container,fieldset{display:flex;flex-direction:column}.label-hint-container{gap:var(--sgds-form-gap-sm)}.label-hint-container .form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.checkbox-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md);padding:var(--sgds-form-padding-inline-sm) 0}.checkbox-group-validation-input{display:none}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-40)}`;class Oa extends(_a(Ea)){constructor(){super(...arguments),this.label="",this.invalidFeedback="Please tick at least one box if you want to proceed",this.hasFeedback=!1,this.hintText="",this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this.defaultValue="",this._blurredCheckboxes=new Set}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-check",e=>{const{value:t}=e.detail;!this.value.includes(t)&&this._addValue(t)}),this.addEventListener("sgds-uncheck",e=>{const{value:t}=e.detail;this._removeValue(t)}),this.addEventListener("sgds-blur",e=>{const t=e.target;this._blurredCheckboxes.add(t),Array.from(this._blurredCheckboxes).length===this._checkboxes.length&&(this._isTouched=!0,this._blurredCheckboxes.clear())})}firstUpdated(e){super.firstUpdated(e),this.value&&this._updateInputValue(),this.invalid&&this._updateInvalid()}_renderHintText(){const e=ee` <div class="form-text" id="${this._controlId}Help">${this.hintText}</div> `;return this.hintText&&e}_addValue(e){const t=this.value?this.value.split(";"):[];t.push(e),this.value=t.join(";"),this._updateInputValue(),this.emit("sgds-change",{detail:{value:this.value}})}_removeValue(e){const t=(this.value?this.value.split(";"):[]).filter(t=>t!==e);this.value=t.join(";"),this._updateInputValue(),this.emit("sgds-change",{detail:{value:this.value}})}_sanitizeSlot(){this._checkboxes.forEach(e=>{e.checked=e.defaultChecked=this.value.includes(e.value),e.hasFeedback=this.hasFeedback?"style":null,e.required&&(console.error("Checkboxes in a group cannot have required or hasFeedback prop set to true"),e.remove())}),this._disabledChildCheckboxes()}_disabledChildCheckboxes(){if(this.disabled){this._checkboxes.forEach(e=>e.disabled=this.disabled)}}_handleValueChange(){this._checkboxes.forEach(e=>{e.checked=this.value.includes(e.value)}),this._updateInputValue(),this._updateInvalid()}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&(this.invalid=!this.input.checkValidity(),this._updateInvalid())}_updateInvalid(){this._checkboxes.forEach(e=>e.invalid=this.invalid)}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_mixinResetFormControl(){this.value=this.input.value=this.defaultValue,this._updateInputValue("reset"),this._mixinResetValidity(this.input)}async _updateInputValue(e="change"){this.input.value=this.value,this.input.dispatchEvent(new InputEvent(e))}render(){return ee`
|
|
2661
2661
|
<fieldset>
|
|
2662
2662
|
<div class="label-hint-container">
|
|
2663
2663
|
<label class="form-label">${this.label}</label>
|
|
@@ -2686,7 +2686,7 @@ const Fa=(e,t,s)=>{const i=new Map;for(let a=t;a<=s;a++)i.set(e[a],a);return i};
|
|
|
2686
2686
|
</div>
|
|
2687
2687
|
`:ie}
|
|
2688
2688
|
</fieldset>
|
|
2689
|
-
`}}function Na(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Ua(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function qa(e,t){const s=Na(e);return isNaN(t)?Ua(e,NaN):t?(s.setDate(s.getDate()+t),s):s}Oa.styles=[...Ea.styles,Ra],Oa.dependencies={"sgds-icon":Lt},e([Ve({reflect:!0})],Oa.prototype,"label",void 0),e([Ve({type:String,reflect:!0})],Oa.prototype,"invalidFeedback",void 0),e([Ve({type:Boolean,reflect:!0})],Oa.prototype,"hasFeedback",void 0),e([Ve({reflect:!0})],Oa.prototype,"hintText",void 0),e([Ve({type:Boolean,reflect:!0})],Oa.prototype,"required",void 0),e([Ve({type:Boolean,reflect:!0})],Oa.prototype,"noValidate",void 0),e([Ve({reflect:!0})],Oa.prototype,"value",void 0),e([De()],Oa.prototype,"_isTouched",void 0),e([xa()],Oa.prototype,"defaultValue",void 0),e([De()],Oa.prototype,"_blurredCheckboxes",void 0),e([De()],Oa.prototype,"formEvent",void 0),e([Le()],Oa.prototype,"_checkboxes",void 0),e([ot("value",{waitUntilFirstUpdate:!0})],Oa.prototype,"_handleValueChange",null),e([ot("_isTouched",{waitUntilFirstUpdate:!0})],Oa.prototype,"_handleIsTouched",null),e([ot("invalid",{waitUntilFirstUpdate:!0})],Oa.prototype,"_updateInvalid",null),lt("sgds-checkbox",Za),lt("sgds-checkbox-group",Oa),lt("sgds-close-button",ft);const Ya=6048e5;let ja={};function Wa(){return ja}function Ka(e,t){const s=Wa(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,a=Na(e),o=a.getDay(),n=(o<i?7:0)+o-i;return a.setDate(a.getDate()-n),a.setHours(0,0,0,0),a}function Ga(e){return Ka(e,{weekStartsOn:1})}function Xa(e){const t=Na(e),s=t.getFullYear(),i=Ua(e,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const a=Ga(i),o=Ua(e,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const n=Ga(o);return t.getTime()>=a.getTime()?s+1:t.getTime()>=n.getTime()?s:s-1}function Qa(e){const t=Na(e);return t.setHours(0,0,0,0),t}function Ja(e){const t=Na(e),s=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return s.setUTCFullYear(t.getFullYear()),+e-+s}function eo(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const s=Na(e);return!isNaN(Number(s))}function to(e){const t=Na(e);return+function(e){const t=Na(e);return t.setHours(23,59,59,999),t}(t)===+function(e){const t=Na(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}(t)}const so={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"}};function io(e){return(t={})=>{const s=t.width?String(t.width):e.defaultWidth;return e.formats[s]||e.formats[e.defaultWidth]}}const ao={date:io({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:io({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:io({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},oo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function no(e){return(t,s)=>{let i;if("formatting"===(s?.context?String(s.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,a=s?.width?String(s.width):t;i=e.formattingValues[a]||e.formattingValues[t]}else{const t=e.defaultWidth,a=s?.width?String(s.width):e.defaultWidth;i=e.values[a]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function ro(e){return(t,s={})=>{const i=s.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const n=o[0],r=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?function(e,t){for(let s=0;s<e.length;s++)if(t(e[s]))return s;return}(r,e=>e.test(n)):function(e,t){for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t(e[s]))return s;return}(r,e=>e.test(n));let d;d=e.valueCallback?e.valueCallback(l):l,d=s.valueCallback?s.valueCallback(d):d;return{value:d,rest:t.slice(n.length)}}}var lo;const co={code:"en-US",formatDistance:(e,t,s)=>{let i;const a=so[e];return i="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"in "+i:i+" ago":i},formatLong:ao,formatRelative:(e,t,s,i)=>oo[e],localize:{ordinalNumber:(e,t)=>{const s=Number(e),i=s%100;if(i>20||i<10)switch(i%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},era:no({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:no({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:no({values:{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"]},defaultWidth:"wide"}),day:no({values:{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"]},defaultWidth:"wide"}),dayPeriod:no({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(lo={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const s=e.match(lo.matchPattern);if(!s)return null;const i=s[0],a=e.match(lo.parsePattern);if(!a)return null;let o=lo.valueCallback?lo.valueCallback(a[0]):a[0];return o=t.valueCallback?t.valueCallback(o):o,{value:o,rest:e.slice(i.length)}}),era:ro({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ro({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:ro({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:ro({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:ro({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ho(e){const t=Na(e),s=function(e,t){const s=Qa(e),i=Qa(t),a=+s-Ja(s),o=+i-Ja(i);return Math.round((a-o)/864e5)}(t,function(e){const t=Na(e),s=Ua(e,0);return s.setFullYear(t.getFullYear(),0,1),s.setHours(0,0,0,0),s}(t));return s+1}function uo(e){const t=Na(e),s=+Ga(t)-+function(e){const t=Xa(e),s=Ua(e,0);return s.setFullYear(t,0,4),s.setHours(0,0,0,0),Ga(s)}(t);return Math.round(s/Ya)+1}function po(e,t){const s=Na(e),i=s.getFullYear(),a=Wa(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,n=Ua(e,0);n.setFullYear(i+1,0,o),n.setHours(0,0,0,0);const r=Ka(n,t),l=Ua(e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const d=Ka(l,t);return s.getTime()>=r.getTime()?i+1:s.getTime()>=d.getTime()?i:i-1}function go(e,t){const s=Na(e),i=+Ka(s,t)-+function(e,t){const s=Wa(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=po(e,t),o=Ua(e,0);return o.setFullYear(a,0,i),o.setHours(0,0,0,0),Ka(o,t)}(s,t);return Math.round(i/Ya)+1}function vo(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const mo={y(e,t){const s=e.getFullYear(),i=s>0?s:1-s;return vo("yy"===t?i%100:i,t.length)},M(e,t){const s=e.getMonth();return"M"===t?String(s+1):vo(s+1,2)},d:(e,t)=>vo(e.getDate(),t.length),a(e,t){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return"am"===s?"a.m.":"p.m."}},h:(e,t)=>vo(e.getHours()%12||12,t.length),H:(e,t)=>vo(e.getHours(),t.length),m:(e,t)=>vo(e.getMinutes(),t.length),s:(e,t)=>vo(e.getSeconds(),t.length),S(e,t){const s=t.length,i=e.getMilliseconds();return vo(Math.trunc(i*Math.pow(10,s-3)),t.length)}},fo="midnight",bo="noon",wo="morning",yo="afternoon",xo="evening",ko="night",_o={G:function(e,t,s){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return s.era(i,{width:"abbreviated"});case"GGGGG":return s.era(i,{width:"narrow"});default:return s.era(i,{width:"wide"})}},y:function(e,t,s){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return s.ordinalNumber(i,{unit:"year"})}return mo.y(e,t)},Y:function(e,t,s,i){const a=po(e,i),o=a>0?a:1-a;if("YY"===t){return vo(o%100,2)}return"Yo"===t?s.ordinalNumber(o,{unit:"year"}):vo(o,t.length)},R:function(e,t){return vo(Xa(e),t.length)},u:function(e,t){return vo(e.getFullYear(),t.length)},Q:function(e,t,s){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return vo(i,2);case"Qo":return s.ordinalNumber(i,{unit:"quarter"});case"QQQ":return s.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(i,{width:"narrow",context:"formatting"});default:return s.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,s){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return vo(i,2);case"qo":return s.ordinalNumber(i,{unit:"quarter"});case"qqq":return s.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(i,{width:"narrow",context:"standalone"});default:return s.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,s){const i=e.getMonth();switch(t){case"M":case"MM":return mo.M(e,t);case"Mo":return s.ordinalNumber(i+1,{unit:"month"});case"MMM":return s.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(i,{width:"narrow",context:"formatting"});default:return s.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,s){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return vo(i+1,2);case"Lo":return s.ordinalNumber(i+1,{unit:"month"});case"LLL":return s.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(i,{width:"narrow",context:"standalone"});default:return s.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,s,i){const a=go(e,i);return"wo"===t?s.ordinalNumber(a,{unit:"week"}):vo(a,t.length)},I:function(e,t,s){const i=uo(e);return"Io"===t?s.ordinalNumber(i,{unit:"week"}):vo(i,t.length)},d:function(e,t,s){return"do"===t?s.ordinalNumber(e.getDate(),{unit:"date"}):mo.d(e,t)},D:function(e,t,s){const i=ho(e);return"Do"===t?s.ordinalNumber(i,{unit:"dayOfYear"}):vo(i,t.length)},E:function(e,t,s){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return s.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,s,i){const a=e.getDay(),o=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return vo(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(a,{width:"short",context:"formatting"});default:return s.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,s,i){const a=e.getDay(),o=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return vo(o,t.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(a,{width:"narrow",context:"standalone"});case"cccccc":return s.day(a,{width:"short",context:"standalone"});default:return s.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,s){const i=e.getDay(),a=0===i?7:i;switch(t){case"i":return String(a);case"ii":return vo(a,t.length);case"io":return s.ordinalNumber(a,{unit:"day"});case"iii":return s.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,s){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,s){const i=e.getHours();let a;switch(a=12===i?bo:0===i?fo:i/12>=1?"pm":"am",t){case"b":case"bb":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(a,{width:"narrow",context:"formatting"});default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,s){const i=e.getHours();let a;switch(a=i>=17?xo:i>=12?yo:i>=4?wo:ko,t){case"B":case"BB":case"BBB":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(a,{width:"narrow",context:"formatting"});default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,s){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),s.ordinalNumber(t,{unit:"hour"})}return mo.h(e,t)},H:function(e,t,s){return"Ho"===t?s.ordinalNumber(e.getHours(),{unit:"hour"}):mo.H(e,t)},K:function(e,t,s){const i=e.getHours()%12;return"Ko"===t?s.ordinalNumber(i,{unit:"hour"}):vo(i,t.length)},k:function(e,t,s){let i=e.getHours();return 0===i&&(i=24),"ko"===t?s.ordinalNumber(i,{unit:"hour"}):vo(i,t.length)},m:function(e,t,s){return"mo"===t?s.ordinalNumber(e.getMinutes(),{unit:"minute"}):mo.m(e,t)},s:function(e,t,s){return"so"===t?s.ordinalNumber(e.getSeconds(),{unit:"second"}):mo.s(e,t)},S:function(e,t){return mo.S(e,t)},X:function(e,t,s){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return So(i);case"XXXX":case"XX":return Mo(i);default:return Mo(i,":")}},x:function(e,t,s){const i=e.getTimezoneOffset();switch(t){case"x":return So(i);case"xxxx":case"xx":return Mo(i);default:return Mo(i,":")}},O:function(e,t,s){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Co(i,":");default:return"GMT"+Mo(i,":")}},z:function(e,t,s){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Co(i,":");default:return"GMT"+Mo(i,":")}},t:function(e,t,s){return vo(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,s){return vo(e.getTime(),t.length)}};function Co(e,t=""){const s=e>0?"-":"+",i=Math.abs(e),a=Math.trunc(i/60),o=i%60;return 0===o?s+String(a):s+String(a)+t+vo(o,2)}function So(e,t){if(e%60==0){return(e>0?"-":"+")+vo(Math.abs(e)/60,2)}return Mo(e,t)}function Mo(e,t=""){const s=e>0?"-":"+",i=Math.abs(e);return s+vo(Math.trunc(i/60),2)+t+vo(i%60,2)}const $o=(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"});default:return t.date({width:"full"})}},Ao=(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"});default:return t.time({width:"full"})}},Vo={p:Ao,P:(e,t)=>{const s=e.match(/(P+)(p+)?/)||[],i=s[1],a=s[2];if(!a)return $o(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"})}return o.replace("{{date}}",$o(i,t)).replace("{{time}}",Ao(a,t))}},Do=/^D+$/,Eo=/^Y+$/,Io=["D","DD","YY","YYYY"];function Bo(e){return Do.test(e)}function Zo(e){return Eo.test(e)}function Lo(e,t,s){const i=function(e,t,s){const i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,s);if(console.warn(i),Io.includes(e))throw new RangeError(i)}const Fo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,To=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Po=/^'([^]*?)'?$/,Ho=/''/g,zo=/[a-zA-Z]/;function Ro(e,t,s){const i=Wa(),a=s?.locale??i.locale??co,o=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,n=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=Na(e);if(!eo(r))throw new RangeError("Invalid time value");let l=t.match(To).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,Vo[t])(e,a.formatLong)}return e}).join("").match(Fo).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Oo(e)};if(_o[t])return{isToken:!0,value:e};if(t.match(zo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});a.localize.preprocessor&&(l=a.localize.preprocessor(r,l));const d={firstWeekContainsDate:o,weekStartsOn:n,locale:a};return l.map(i=>{if(!i.isToken)return i.value;const o=i.value;(!s?.useAdditionalWeekYearTokens&&Zo(o)||!s?.useAdditionalDayOfYearTokens&&Bo(o))&&Lo(o,t,String(e));return(0,_o[o[0]])(r,o,a.localize,d)}).join("")}function Oo(e){const t=e.match(Po);return t?t[1].replace(Ho,"'"):e}function No(e){const t=Na(e),s=t.getFullYear(),i=t.getMonth(),a=Ua(e,0);return a.setFullYear(s,i+1,0),a.setHours(0,0,0,0),a.getDate()}function Uo(e){const t=Na(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(0,0,0,0),t}function qo(e,t){const s=Na(e),i=Na(t);return s.getTime()>i.getTime()}function Yo(e,t){return+Na(e)<+Na(t)}function jo(e,t){return+Na(e)===+Na(t)}class Wo{subPriority=0;validate(e,t){return!0}}class Ko extends Wo{constructor(e,t,s,i,a){super(),this.value=e,this.validateValue=t,this.setValue=s,this.priority=i,a&&(this.subPriority=a)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,s){return this.setValue(e,t,this.value,s)}}class Go extends Wo{priority=10;subPriority=-1;set(e,t){return t.timestampIsSet?e:Ua(e,function(e,t){const s=t instanceof Date?Ua(t,0):new t(0);return s.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),s.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),s}(e,Date))}}class Xo{run(e,t,s,i){const a=this.parse(e,t,s,i);return a?{setter:new Ko(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(e,t,s){return!0}}const Qo=/^(1[0-2]|0?\d)/,Jo=/^(3[0-1]|[0-2]?\d)/,en=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,tn=/^(5[0-3]|[0-4]?\d)/,sn=/^(2[0-3]|[0-1]?\d)/,an=/^(2[0-4]|[0-1]?\d)/,on=/^(1[0-1]|0?\d)/,nn=/^(1[0-2]|0?\d)/,rn=/^[0-5]?\d/,ln=/^[0-5]?\d/,dn=/^\d/,cn=/^\d{1,2}/,hn=/^\d{1,3}/,un=/^\d{1,4}/,pn=/^-?\d+/,gn=/^-?\d/,vn=/^-?\d{1,2}/,mn=/^-?\d{1,3}/,fn=/^-?\d{1,4}/,bn=/^([+-])(\d{2})(\d{2})?|Z/,wn=/^([+-])(\d{2})(\d{2})|Z/,yn=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,xn=/^([+-])(\d{2}):(\d{2})|Z/,kn=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function _n(e,t){return e?{value:t(e.value),rest:e.rest}:e}function Cn(e,t){const s=t.match(e);return s?{value:parseInt(s[0],10),rest:t.slice(s[0].length)}:null}function Sn(e,t){const s=t.match(e);if(!s)return null;if("Z"===s[0])return{value:0,rest:t.slice(1)};return{value:("+"===s[1]?1:-1)*(36e5*(s[2]?parseInt(s[2],10):0)+6e4*(s[3]?parseInt(s[3],10):0)+1e3*(s[5]?parseInt(s[5],10):0)),rest:t.slice(s[0].length)}}function Mn(e){return Cn(pn,e)}function $n(e,t){switch(e){case 1:return Cn(dn,t);case 2:return Cn(cn,t);case 3:return Cn(hn,t);case 4:return Cn(un,t);default:return Cn(new RegExp("^\\d{1,"+e+"}"),t)}}function An(e,t){switch(e){case 1:return Cn(gn,t);case 2:return Cn(vn,t);case 3:return Cn(mn,t);case 4:return Cn(fn,t);default:return Cn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Vn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Dn(e,t){const s=t>0,i=s?t:1-t;let a;if(i<=50)a=e||100;else{const t=i+50;a=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return s?a:1-a}function En(e){return e%400==0||e%4==0&&e%100!=0}const In=[31,28,31,30,31,30,31,31,30,31,30,31],Bn=[31,29,31,30,31,30,31,31,30,31,30,31];function Zn(e,t,s){const i=Wa(),a=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=Na(e),n=o.getDay(),r=7-a;return qa(o,t<0||t>6?t-(n+r)%7:((t%7+7)%7+r)%7-(n+r)%7)}function Ln(e,t){const s=Na(e),i=function(e){let t=Na(e).getDay();return 0===t&&(t=7),t}(s);return qa(s,t-i)}const Fn={G:new class extends Xo{priority=140;parse(e,t,s){switch(t){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,t,s){return t.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends Xo{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,s){const i=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return _n($n(4,e),i);case"yo":return _n(s.ordinalNumber(e,{unit:"year"}),i);default:return _n($n(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,s){const i=e.getFullYear();if(s.isTwoDigitYear){const t=Dn(s.year,i);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const a="era"in t&&1!==t.era?1-s.year:s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}},Y:new class extends Xo{priority=130;parse(e,t,s){const i=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return _n($n(4,e),i);case"Yo":return _n(s.ordinalNumber(e,{unit:"year"}),i);default:return _n($n(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,s,i){const a=po(e,i);if(s.isTwoDigitYear){const t=Dn(s.year,a);return e.setFullYear(t,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),Ka(e,i)}const o="era"in t&&1!==t.era?1-s.year:s.year;return e.setFullYear(o,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),Ka(e,i)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Xo{priority=130;parse(e,t){return An("R"===t?4:t.length,e)}set(e,t,s){const i=Ua(e,0);return i.setFullYear(s,0,4),i.setHours(0,0,0,0),Ga(i)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Xo{priority=130;parse(e,t){return An("u"===t?4:t.length,e)}set(e,t,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Xo{priority=120;parse(e,t,s){switch(t){case"Q":case"QQ":return $n(t.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,s){return e.setMonth(3*(s-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Xo{priority=120;parse(e,t,s){switch(t){case"q":case"qq":return $n(t.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,s){return e.setMonth(3*(s-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Xo{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,s){const i=e=>e-1;switch(t){case"M":return _n(Cn(Qo,e),i);case"MM":return _n($n(2,e),i);case"Mo":return _n(s.ordinalNumber(e,{unit:"month"}),i);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}},L:new class extends Xo{priority=110;parse(e,t,s){const i=e=>e-1;switch(t){case"L":return _n(Cn(Qo,e),i);case"LL":return _n($n(2,e),i);case"Lo":return _n(s.ordinalNumber(e,{unit:"month"}),i);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Xo{priority=100;parse(e,t,s){switch(t){case"w":return Cn(tn,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return $n(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,s,i){return Ka(function(e,t,s){const i=Na(e),a=go(i,s)-t;return i.setDate(i.getDate()-7*a),i}(e,s,i),i)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Xo{priority=100;parse(e,t,s){switch(t){case"I":return Cn(tn,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return $n(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,s){return Ga(function(e,t){const s=Na(e),i=uo(s)-t;return s.setDate(s.getDate()-7*i),s}(e,s))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Xo{priority=90;subPriority=1;parse(e,t,s){switch(t){case"d":return Cn(Jo,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return $n(t.length,e)}}validate(e,t){const s=En(e.getFullYear()),i=e.getMonth();return s?t>=1&&t<=Bn[i]:t>=1&&t<=In[i]}set(e,t,s){return e.setDate(s),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Xo{priority=90;subpriority=1;parse(e,t,s){switch(t){case"D":case"DD":return Cn(en,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return $n(t.length,e)}}validate(e,t){return En(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Xo{priority=90;parse(e,t,s){switch(t){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,s,i){return(e=Zn(e,s,i)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Xo{priority=90;parse(e,t,s,i){const a=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return _n($n(t.length,e),a);case"eo":return _n(s.ordinalNumber(e,{unit:"day"}),a);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,s,i){return(e=Zn(e,s,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Xo{priority=90;parse(e,t,s,i){const a=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return _n($n(t.length,e),a);case"co":return _n(s.ordinalNumber(e,{unit:"day"}),a);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,s,i){return(e=Zn(e,s,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Xo{priority=90;parse(e,t,s){const i=e=>0===e?7:e;switch(t){case"i":case"ii":return $n(t.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return _n(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return _n(s.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return _n(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),i);default:return _n(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),i)}}validate(e,t){return t>=1&&t<=7}set(e,t,s){return(e=Ln(e,s)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Xo{priority=80;parse(e,t,s){switch(t){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,s){return e.setHours(Vn(s),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Xo{priority=80;parse(e,t,s){switch(t){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,s){return e.setHours(Vn(s),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Xo{priority=80;parse(e,t,s){switch(t){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,s){return e.setHours(Vn(s),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends Xo{priority=70;parse(e,t,s){switch(t){case"h":return Cn(nn,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return $n(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,s){const i=e.getHours()>=12;return i&&s<12?e.setHours(s+12,0,0,0):i||12!==s?e.setHours(s,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Xo{priority=70;parse(e,t,s){switch(t){case"H":return Cn(sn,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return $n(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,s){return e.setHours(s,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Xo{priority=70;parse(e,t,s){switch(t){case"K":return Cn(on,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return $n(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Xo{priority=70;parse(e,t,s){switch(t){case"k":return Cn(an,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return $n(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,s){const i=s<=24?s%24:s;return e.setHours(i,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Xo{priority=60;parse(e,t,s){switch(t){case"m":return Cn(rn,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return $n(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,s){return e.setMinutes(s,0,0),e}incompatibleTokens=["t","T"]},s:new class extends Xo{priority=50;parse(e,t,s){switch(t){case"s":return Cn(ln,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return $n(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,s){return e.setSeconds(s,0),e}incompatibleTokens=["t","T"]},S:new class extends Xo{priority=30;parse(e,t){return _n($n(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,s){return e.setMilliseconds(s),e}incompatibleTokens=["t","T"]},X:new class extends Xo{priority=10;parse(e,t){switch(t){case"X":return Sn(bn,e);case"XX":return Sn(wn,e);case"XXXX":return Sn(yn,e);case"XXXXX":return Sn(kn,e);default:return Sn(xn,e)}}set(e,t,s){return t.timestampIsSet?e:Ua(e,e.getTime()-Ja(e)-s)}incompatibleTokens=["t","T","x"]},x:new class extends Xo{priority=10;parse(e,t){switch(t){case"x":return Sn(bn,e);case"xx":return Sn(wn,e);case"xxxx":return Sn(yn,e);case"xxxxx":return Sn(kn,e);default:return Sn(xn,e)}}set(e,t,s){return t.timestampIsSet?e:Ua(e,e.getTime()-Ja(e)-s)}incompatibleTokens=["t","T","X"]},t:new class extends Xo{priority=40;parse(e){return Mn(e)}set(e,t,s){return[Ua(e,1e3*s),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Xo{priority=20;parse(e){return Mn(e)}set(e,t,s){return[Ua(e,s),{timestampIsSet:!0}]}incompatibleTokens="*"}},Tn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hn=/^'([^]*?)'?$/,zn=/''/g,Rn=/\S/,On=/[a-zA-Z]/;function Nn(e,t,s,i){const a=Object.assign({},Wa()),o=i?.locale??a.locale??co,n=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,r=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===t)return""===e?Na(s):Ua(s,NaN);const l={firstWeekContainsDate:n,weekStartsOn:r,locale:o},d=[new Go],c=t.match(Pn).map(e=>{const t=e[0];if(t in Vo){return(0,Vo[t])(e,o.formatLong)}return e}).join("").match(Tn),h=[];for(let a of c){!i?.useAdditionalWeekYearTokens&&Zo(a)&&Lo(a,t,e),!i?.useAdditionalDayOfYearTokens&&Bo(a)&&Lo(a,t,e);const n=a[0],r=Fn[n];if(r){const{incompatibleTokens:t}=r;if(Array.isArray(t)){const e=h.find(e=>t.includes(e.token)||e.token===n);if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${a}\` at the same time`)}else if("*"===r.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${a}\` and any other token at the same time`);h.push({token:n,fullToken:a});const i=r.run(e,a,o.match,l);if(!i)return Ua(s,NaN);d.push(i.setter),e=i.rest}else{if(n.match(On))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===a?a="'":"'"===n&&(a=Un(a)),0!==e.indexOf(a))return Ua(s,NaN);e=e.slice(a.length)}}if(e.length>0&&Rn.test(e))return Ua(s,NaN);const u=d.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,s)=>s.indexOf(e)===t).map(e=>d.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let p=Na(s);if(isNaN(p.getTime()))return Ua(s,NaN);const g={};for(const e of u){if(!e.validate(p,l))return Ua(s,NaN);const t=e.set(p,g,l);Array.isArray(t)?(p=t[0],Object.assign(g,t[1])):p=t}return Ua(s,p)}function Un(e){return e.match(Hn)[1].replace(zn,"'")}const qn={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:"dd/MM/yyyy"},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:"MM/dd/yyyy"},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:"yyyy/MM/dd"}},Yn=e=>{const t=e.getMonth(),s=e.getFullYear(),i=e.getDate(),a=new Date(s,t+1),o=No(a);return to(e)&&o<i?Uo(a):new Date(s,t+1,i)},jn=e=>{const t=e.getMonth(),s=e.getFullYear(),i=e.getDate(),a=new Date(s,t-1),o=No(a);return to(e)&&o<i?Uo(a):new Date(s,t-1,i)},Wn=e=>{const t=new Date(e);return t.setHours(12),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t};var Kn=n`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}.monthpicker [role=row],.yearpicker [role=row]{display:contents}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;const Gn=new Date,Xn={ArrowUp:{days:-7,months:-3,years:-3},ArrowDown:{days:7,months:3,years:3},ArrowRight:{days:1,months:1,years:1},ArrowLeft:{days:-1,months:-1,years:-1}};class Qn extends Pe{constructor(){super(...arguments),this.selectedDate=[],this.mode="single"}focusOnCalendar(e){e.blur(),this._focusOnCalendarCell()}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeyPress),this.addEventListener("blur",e=>e.stopPropagation())}updated(){3===this.focusedTabIndex&&this._focusOnCalendarCell()}_updateFocusedDate(){this.focusedDate=Wn(this.displayDate),this.focusedDate.getFullYear()<1900&&this.focusedDate.setFullYear(1900)}_setFocusedDate(e){const t=this.focusedDate.getDate(),s=this.focusedDate.getMonth(),i=this.focusedDate.getFullYear();switch(this.view){case"days":{const a=Wn(new Date(i,s,t+e));(qo(a,new Date(0,0,1,12))||jo(a,new Date(0,0,1,12)))&&(this.focusedDate=a);break}case"months":{const a=Wn(new Date(i,s+e,t));(qo(a,new Date(0,0,1,12))||jo(a,new Date(0,0,1,12)))&&(this.focusedDate=a);break}case"years":{const a=Wn(new Date(i+e,s,t));a.getFullYear()>=1900&&(this.focusedDate=a);break}}}_handleEnterDateKeyboard(e){const t=e.composedPath()[0];if(!t.classList.contains("disabled"))switch(this.view){case"days":this._onClickDay(e);break;case"months":{const{month:e}=t.dataset;this._onClickMonth(parseInt(e));break}case"years":{const{year:e}=t.dataset;this._onClickYear(parseInt(e))}}}_handleKeyPress(e){if("Enter"===e.key)return e.preventDefault(),void this._handleEnterDateKeyboard(e);if("Tab"===e.key){const e=this._getFocusedTarget();return void(3!==this.focusedTabIndex&&e.blur())}if(e.key.includes("Arrow")){e.preventDefault(),this._blurCalendarCell();const t=Xn[e.key][this.view];this._setFocusedDate(t),this._focusOnCalendarCell()}}_generateIncrementDates(){const e=Wn(this.selectedDate[0]);if(this.selectedDate.length<2)return[e];const t=Wn(this.selectedDate[1]),s=[];if(e.getTime()<t.getTime())for(let i=e;i<=t;i.setDate(i.getDate()+1))s.push(new Date(i));else for(let i=t;i<=e;i.setDate(i.getDate()+1))s.push(new Date(i));return s}_onClickDay(e){const{day:t,date:s}=e.composedPath()[0].dataset,i=new Date(this.displayDate);if(i.setDate(parseInt(t)),"click"===e.type&&(this.focusedDate=Wn(new Date(s))),"single"===this.mode)this.selectedDate=[i],this.emit("sgds-selectdates",{detail:this.selectedDate});else if("range"===this.mode){const e=[...this.selectedDate];0!==e.length&&2!==e.length||(e.length=0),e.push(i),this.selectedDate=e,this.emit("sgds-selectdates",{detail:this.selectedDate})}const a=this.minDate?Wn(new Date(this.minDate)):null,o=this.maxDate?Wn(new Date(this.maxDate)):null,n=Wn(i);(a&&n<a||o&&n>o)&&(e.stopPropagation(),e.preventDefault())}_onClickMonth(e,t=this.focusedDate.getFullYear()){const s=new Date(this.displayDate);this.view="days",s.setMonth(e),s.setFullYear(t),this.displayDate=s,this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectmonth",{detail:this.displayDate})}_onClickYear(e){const t=new Date(this.displayDate);t.setFullYear(e),this.displayDate=t,this.view="months",this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectyear",{detail:this.displayDate})}_getFocusedTarget(){const e={days:`td[data-date="${this.focusedDate.toISOString()}"]`,months:`button[data-month="${this.focusedDate.getMonth()}"][data-year="${this.focusedDate.getFullYear()}"]`,years:`button[data-year="${this.focusedDate.getFullYear()}"]`}[this.view];return this.shadowRoot.querySelector(`${e}`)}_blurCalendarCell(){const e=this._getFocusedTarget();e.setAttribute("tabindex","-1"),e.blur()}_focusOnCalendarCell(){const e=this._getFocusedTarget();e?(e.setAttribute("tabindex","0"),e.focus(),this.emit("sgds-update-focus",{detail:this.focusedDate})):this.emit("sgds-change-calendar",{detail:this.focusedDate})}_generateDays(){const e=this.selectedDate.map(e=>Wn(e)),t=this._generateIncrementDates(),s=this.minDate?Wn(new Date(this.minDate)):null,i=this.maxDate?Wn(new Date(this.maxDate)):null,a=this.displayDate.getFullYear(),o=this.displayDate.getMonth(),n=new Date(a,o,1).getDay();let r=Qn.daysInMonth[o];1===o&&(a%4==0&&a%100!=0||a%400==0)&&(r=29);const l=[];let d=1;for(let c=0;c<9;c++){const h=[];for(let l=0;l<=6;l++)if(d<=r&&(c>0||l>=n)){const n=new Date(a,o,d,12,0,0,0),r=n.toISOString(),c=s&&Date.parse(r)<Date.parse(s.toISOString()),u=i&&Date.parse(r)>Date.parse(i.toISOString()),p=c||u?void 0:this._onClickDay,g=Gn.getMonth()===this.displayDate.getMonth(),v=Gn.getFullYear()===this.displayDate.getFullYear(),m=Gn.getDate()===d,f=e.length>0&&t.some(e=>Date.parse(r)===Date.parse(e.toISOString())),b=e.length>0&&t[0].toISOString()===r,w=e.length>1&&t[t.length-1].toISOString()===r,y=""+(m&&g&&v?"Today's date, ":"")+Ro(n,"PPPP");h.push(ee`<td
|
|
2689
|
+
`}}function Na(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function Ua(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function qa(e,t){const s=Na(e);return isNaN(t)?Ua(e,NaN):t?(s.setDate(s.getDate()+t),s):s}Oa.styles=[...Ea.styles,Ra],Oa.dependencies={"sgds-icon":Lt},e([Ve({reflect:!0})],Oa.prototype,"label",void 0),e([Ve({type:String,reflect:!0})],Oa.prototype,"invalidFeedback",void 0),e([Ve({type:Boolean,reflect:!0})],Oa.prototype,"hasFeedback",void 0),e([Ve({reflect:!0})],Oa.prototype,"hintText",void 0),e([Ve({type:Boolean,reflect:!0})],Oa.prototype,"required",void 0),e([Ve({type:Boolean,reflect:!0})],Oa.prototype,"noValidate",void 0),e([Ve({reflect:!0})],Oa.prototype,"value",void 0),e([De()],Oa.prototype,"_isTouched",void 0),e([xa()],Oa.prototype,"defaultValue",void 0),e([De()],Oa.prototype,"_blurredCheckboxes",void 0),e([Le()],Oa.prototype,"_checkboxes",void 0),e([ot("value",{waitUntilFirstUpdate:!0})],Oa.prototype,"_handleValueChange",null),e([ot("_isTouched",{waitUntilFirstUpdate:!0})],Oa.prototype,"_handleIsTouched",null),e([ot("invalid",{waitUntilFirstUpdate:!0})],Oa.prototype,"_updateInvalid",null),lt("sgds-checkbox",Za),lt("sgds-checkbox-group",Oa),lt("sgds-close-button",ft);const Ya=6048e5;let ja={};function Wa(){return ja}function Ka(e,t){const s=Wa(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,a=Na(e),o=a.getDay(),n=(o<i?7:0)+o-i;return a.setDate(a.getDate()-n),a.setHours(0,0,0,0),a}function Ga(e){return Ka(e,{weekStartsOn:1})}function Xa(e){const t=Na(e),s=t.getFullYear(),i=Ua(e,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const a=Ga(i),o=Ua(e,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const n=Ga(o);return t.getTime()>=a.getTime()?s+1:t.getTime()>=n.getTime()?s:s-1}function Qa(e){const t=Na(e);return t.setHours(0,0,0,0),t}function Ja(e){const t=Na(e),s=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return s.setUTCFullYear(t.getFullYear()),+e-+s}function eo(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const s=Na(e);return!isNaN(Number(s))}function to(e){const t=Na(e);return+function(e){const t=Na(e);return t.setHours(23,59,59,999),t}(t)===+function(e){const t=Na(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(23,59,59,999),t}(t)}const so={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"}};function io(e){return(t={})=>{const s=t.width?String(t.width):e.defaultWidth;return e.formats[s]||e.formats[e.defaultWidth]}}const ao={date:io({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:io({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:io({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},oo={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function no(e){return(t,s)=>{let i;if("formatting"===(s?.context?String(s.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,a=s?.width?String(s.width):t;i=e.formattingValues[a]||e.formattingValues[t]}else{const t=e.defaultWidth,a=s?.width?String(s.width):e.defaultWidth;i=e.values[a]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function ro(e){return(t,s={})=>{const i=s.width,a=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const n=o[0],r=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?function(e,t){for(let s=0;s<e.length;s++)if(t(e[s]))return s;return}(r,e=>e.test(n)):function(e,t){for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t(e[s]))return s;return}(r,e=>e.test(n));let d;d=e.valueCallback?e.valueCallback(l):l,d=s.valueCallback?s.valueCallback(d):d;return{value:d,rest:t.slice(n.length)}}}var lo;const co={code:"en-US",formatDistance:(e,t,s)=>{let i;const a=so[e];return i="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"in "+i:i+" ago":i},formatLong:ao,formatRelative:(e,t,s,i)=>oo[e],localize:{ordinalNumber:(e,t)=>{const s=Number(e),i=s%100;if(i>20||i<10)switch(i%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},era:no({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:no({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:no({values:{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"]},defaultWidth:"wide"}),day:no({values:{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"]},defaultWidth:"wide"}),dayPeriod:no({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(lo={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const s=e.match(lo.matchPattern);if(!s)return null;const i=s[0],a=e.match(lo.parsePattern);if(!a)return null;let o=lo.valueCallback?lo.valueCallback(a[0]):a[0];return o=t.valueCallback?t.valueCallback(o):o,{value:o,rest:e.slice(i.length)}}),era:ro({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ro({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:ro({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:ro({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:ro({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ho(e){const t=Na(e),s=function(e,t){const s=Qa(e),i=Qa(t),a=+s-Ja(s),o=+i-Ja(i);return Math.round((a-o)/864e5)}(t,function(e){const t=Na(e),s=Ua(e,0);return s.setFullYear(t.getFullYear(),0,1),s.setHours(0,0,0,0),s}(t));return s+1}function uo(e){const t=Na(e),s=+Ga(t)-+function(e){const t=Xa(e),s=Ua(e,0);return s.setFullYear(t,0,4),s.setHours(0,0,0,0),Ga(s)}(t);return Math.round(s/Ya)+1}function po(e,t){const s=Na(e),i=s.getFullYear(),a=Wa(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,n=Ua(e,0);n.setFullYear(i+1,0,o),n.setHours(0,0,0,0);const r=Ka(n,t),l=Ua(e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const d=Ka(l,t);return s.getTime()>=r.getTime()?i+1:s.getTime()>=d.getTime()?i:i-1}function go(e,t){const s=Na(e),i=+Ka(s,t)-+function(e,t){const s=Wa(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=po(e,t),o=Ua(e,0);return o.setFullYear(a,0,i),o.setHours(0,0,0,0),Ka(o,t)}(s,t);return Math.round(i/Ya)+1}function vo(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const mo={y(e,t){const s=e.getFullYear(),i=s>0?s:1-s;return vo("yy"===t?i%100:i,t.length)},M(e,t){const s=e.getMonth();return"M"===t?String(s+1):vo(s+1,2)},d:(e,t)=>vo(e.getDate(),t.length),a(e,t){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return"am"===s?"a.m.":"p.m."}},h:(e,t)=>vo(e.getHours()%12||12,t.length),H:(e,t)=>vo(e.getHours(),t.length),m:(e,t)=>vo(e.getMinutes(),t.length),s:(e,t)=>vo(e.getSeconds(),t.length),S(e,t){const s=t.length,i=e.getMilliseconds();return vo(Math.trunc(i*Math.pow(10,s-3)),t.length)}},fo="midnight",bo="noon",wo="morning",yo="afternoon",xo="evening",ko="night",_o={G:function(e,t,s){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return s.era(i,{width:"abbreviated"});case"GGGGG":return s.era(i,{width:"narrow"});default:return s.era(i,{width:"wide"})}},y:function(e,t,s){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return s.ordinalNumber(i,{unit:"year"})}return mo.y(e,t)},Y:function(e,t,s,i){const a=po(e,i),o=a>0?a:1-a;if("YY"===t){return vo(o%100,2)}return"Yo"===t?s.ordinalNumber(o,{unit:"year"}):vo(o,t.length)},R:function(e,t){return vo(Xa(e),t.length)},u:function(e,t){return vo(e.getFullYear(),t.length)},Q:function(e,t,s){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return vo(i,2);case"Qo":return s.ordinalNumber(i,{unit:"quarter"});case"QQQ":return s.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(i,{width:"narrow",context:"formatting"});default:return s.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,s){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return vo(i,2);case"qo":return s.ordinalNumber(i,{unit:"quarter"});case"qqq":return s.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(i,{width:"narrow",context:"standalone"});default:return s.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,s){const i=e.getMonth();switch(t){case"M":case"MM":return mo.M(e,t);case"Mo":return s.ordinalNumber(i+1,{unit:"month"});case"MMM":return s.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(i,{width:"narrow",context:"formatting"});default:return s.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,s){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return vo(i+1,2);case"Lo":return s.ordinalNumber(i+1,{unit:"month"});case"LLL":return s.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(i,{width:"narrow",context:"standalone"});default:return s.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,s,i){const a=go(e,i);return"wo"===t?s.ordinalNumber(a,{unit:"week"}):vo(a,t.length)},I:function(e,t,s){const i=uo(e);return"Io"===t?s.ordinalNumber(i,{unit:"week"}):vo(i,t.length)},d:function(e,t,s){return"do"===t?s.ordinalNumber(e.getDate(),{unit:"date"}):mo.d(e,t)},D:function(e,t,s){const i=ho(e);return"Do"===t?s.ordinalNumber(i,{unit:"dayOfYear"}):vo(i,t.length)},E:function(e,t,s){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return s.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,s,i){const a=e.getDay(),o=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return vo(o,2);case"eo":return s.ordinalNumber(o,{unit:"day"});case"eee":return s.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(a,{width:"short",context:"formatting"});default:return s.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,s,i){const a=e.getDay(),o=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return vo(o,t.length);case"co":return s.ordinalNumber(o,{unit:"day"});case"ccc":return s.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(a,{width:"narrow",context:"standalone"});case"cccccc":return s.day(a,{width:"short",context:"standalone"});default:return s.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,s){const i=e.getDay(),a=0===i?7:i;switch(t){case"i":return String(a);case"ii":return vo(a,t.length);case"io":return s.ordinalNumber(a,{unit:"day"});case"iii":return s.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,s){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,s){const i=e.getHours();let a;switch(a=12===i?bo:0===i?fo:i/12>=1?"pm":"am",t){case"b":case"bb":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(a,{width:"narrow",context:"formatting"});default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,s){const i=e.getHours();let a;switch(a=i>=17?xo:i>=12?yo:i>=4?wo:ko,t){case"B":case"BB":case"BBB":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(a,{width:"narrow",context:"formatting"});default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,s){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),s.ordinalNumber(t,{unit:"hour"})}return mo.h(e,t)},H:function(e,t,s){return"Ho"===t?s.ordinalNumber(e.getHours(),{unit:"hour"}):mo.H(e,t)},K:function(e,t,s){const i=e.getHours()%12;return"Ko"===t?s.ordinalNumber(i,{unit:"hour"}):vo(i,t.length)},k:function(e,t,s){let i=e.getHours();return 0===i&&(i=24),"ko"===t?s.ordinalNumber(i,{unit:"hour"}):vo(i,t.length)},m:function(e,t,s){return"mo"===t?s.ordinalNumber(e.getMinutes(),{unit:"minute"}):mo.m(e,t)},s:function(e,t,s){return"so"===t?s.ordinalNumber(e.getSeconds(),{unit:"second"}):mo.s(e,t)},S:function(e,t){return mo.S(e,t)},X:function(e,t,s){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return So(i);case"XXXX":case"XX":return Mo(i);default:return Mo(i,":")}},x:function(e,t,s){const i=e.getTimezoneOffset();switch(t){case"x":return So(i);case"xxxx":case"xx":return Mo(i);default:return Mo(i,":")}},O:function(e,t,s){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Co(i,":");default:return"GMT"+Mo(i,":")}},z:function(e,t,s){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Co(i,":");default:return"GMT"+Mo(i,":")}},t:function(e,t,s){return vo(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,s){return vo(e.getTime(),t.length)}};function Co(e,t=""){const s=e>0?"-":"+",i=Math.abs(e),a=Math.trunc(i/60),o=i%60;return 0===o?s+String(a):s+String(a)+t+vo(o,2)}function So(e,t){if(e%60==0){return(e>0?"-":"+")+vo(Math.abs(e)/60,2)}return Mo(e,t)}function Mo(e,t=""){const s=e>0?"-":"+",i=Math.abs(e);return s+vo(Math.trunc(i/60),2)+t+vo(i%60,2)}const $o=(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"});default:return t.date({width:"full"})}},Ao=(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"});default:return t.time({width:"full"})}},Vo={p:Ao,P:(e,t)=>{const s=e.match(/(P+)(p+)?/)||[],i=s[1],a=s[2];if(!a)return $o(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"})}return o.replace("{{date}}",$o(i,t)).replace("{{time}}",Ao(a,t))}},Do=/^D+$/,Eo=/^Y+$/,Io=["D","DD","YY","YYYY"];function Bo(e){return Do.test(e)}function Zo(e){return Eo.test(e)}function Lo(e,t,s){const i=function(e,t,s){const i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,s);if(console.warn(i),Io.includes(e))throw new RangeError(i)}const Fo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,To=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Po=/^'([^]*?)'?$/,Ho=/''/g,zo=/[a-zA-Z]/;function Ro(e,t,s){const i=Wa(),a=s?.locale??i.locale??co,o=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,n=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=Na(e);if(!eo(r))throw new RangeError("Invalid time value");let l=t.match(To).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,Vo[t])(e,a.formatLong)}return e}).join("").match(Fo).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Oo(e)};if(_o[t])return{isToken:!0,value:e};if(t.match(zo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});a.localize.preprocessor&&(l=a.localize.preprocessor(r,l));const d={firstWeekContainsDate:o,weekStartsOn:n,locale:a};return l.map(i=>{if(!i.isToken)return i.value;const o=i.value;(!s?.useAdditionalWeekYearTokens&&Zo(o)||!s?.useAdditionalDayOfYearTokens&&Bo(o))&&Lo(o,t,String(e));return(0,_o[o[0]])(r,o,a.localize,d)}).join("")}function Oo(e){const t=e.match(Po);return t?t[1].replace(Ho,"'"):e}function No(e){const t=Na(e),s=t.getFullYear(),i=t.getMonth(),a=Ua(e,0);return a.setFullYear(s,i+1,0),a.setHours(0,0,0,0),a.getDate()}function Uo(e){const t=Na(e),s=t.getMonth();return t.setFullYear(t.getFullYear(),s+1,0),t.setHours(0,0,0,0),t}function qo(e,t){const s=Na(e),i=Na(t);return s.getTime()>i.getTime()}function Yo(e,t){return+Na(e)<+Na(t)}function jo(e,t){return+Na(e)===+Na(t)}class Wo{subPriority=0;validate(e,t){return!0}}class Ko extends Wo{constructor(e,t,s,i,a){super(),this.value=e,this.validateValue=t,this.setValue=s,this.priority=i,a&&(this.subPriority=a)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,s){return this.setValue(e,t,this.value,s)}}class Go extends Wo{priority=10;subPriority=-1;set(e,t){return t.timestampIsSet?e:Ua(e,function(e,t){const s=t instanceof Date?Ua(t,0):new t(0);return s.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),s.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),s}(e,Date))}}class Xo{run(e,t,s,i){const a=this.parse(e,t,s,i);return a?{setter:new Ko(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(e,t,s){return!0}}const Qo=/^(1[0-2]|0?\d)/,Jo=/^(3[0-1]|[0-2]?\d)/,en=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,tn=/^(5[0-3]|[0-4]?\d)/,sn=/^(2[0-3]|[0-1]?\d)/,an=/^(2[0-4]|[0-1]?\d)/,on=/^(1[0-1]|0?\d)/,nn=/^(1[0-2]|0?\d)/,rn=/^[0-5]?\d/,ln=/^[0-5]?\d/,dn=/^\d/,cn=/^\d{1,2}/,hn=/^\d{1,3}/,un=/^\d{1,4}/,pn=/^-?\d+/,gn=/^-?\d/,vn=/^-?\d{1,2}/,mn=/^-?\d{1,3}/,fn=/^-?\d{1,4}/,bn=/^([+-])(\d{2})(\d{2})?|Z/,wn=/^([+-])(\d{2})(\d{2})|Z/,yn=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,xn=/^([+-])(\d{2}):(\d{2})|Z/,kn=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function _n(e,t){return e?{value:t(e.value),rest:e.rest}:e}function Cn(e,t){const s=t.match(e);return s?{value:parseInt(s[0],10),rest:t.slice(s[0].length)}:null}function Sn(e,t){const s=t.match(e);if(!s)return null;if("Z"===s[0])return{value:0,rest:t.slice(1)};return{value:("+"===s[1]?1:-1)*(36e5*(s[2]?parseInt(s[2],10):0)+6e4*(s[3]?parseInt(s[3],10):0)+1e3*(s[5]?parseInt(s[5],10):0)),rest:t.slice(s[0].length)}}function Mn(e){return Cn(pn,e)}function $n(e,t){switch(e){case 1:return Cn(dn,t);case 2:return Cn(cn,t);case 3:return Cn(hn,t);case 4:return Cn(un,t);default:return Cn(new RegExp("^\\d{1,"+e+"}"),t)}}function An(e,t){switch(e){case 1:return Cn(gn,t);case 2:return Cn(vn,t);case 3:return Cn(mn,t);case 4:return Cn(fn,t);default:return Cn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Vn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Dn(e,t){const s=t>0,i=s?t:1-t;let a;if(i<=50)a=e||100;else{const t=i+50;a=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return s?a:1-a}function En(e){return e%400==0||e%4==0&&e%100!=0}const In=[31,28,31,30,31,30,31,31,30,31,30,31],Bn=[31,29,31,30,31,30,31,31,30,31,30,31];function Zn(e,t,s){const i=Wa(),a=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=Na(e),n=o.getDay(),r=7-a;return qa(o,t<0||t>6?t-(n+r)%7:((t%7+7)%7+r)%7-(n+r)%7)}function Ln(e,t){const s=Na(e),i=function(e){let t=Na(e).getDay();return 0===t&&(t=7),t}(s);return qa(s,t-i)}const Fn={G:new class extends Xo{priority=140;parse(e,t,s){switch(t){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,t,s){return t.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends Xo{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,s){const i=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return _n($n(4,e),i);case"yo":return _n(s.ordinalNumber(e,{unit:"year"}),i);default:return _n($n(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,s){const i=e.getFullYear();if(s.isTwoDigitYear){const t=Dn(s.year,i);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const a="era"in t&&1!==t.era?1-s.year:s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}},Y:new class extends Xo{priority=130;parse(e,t,s){const i=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return _n($n(4,e),i);case"Yo":return _n(s.ordinalNumber(e,{unit:"year"}),i);default:return _n($n(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,s,i){const a=po(e,i);if(s.isTwoDigitYear){const t=Dn(s.year,a);return e.setFullYear(t,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),Ka(e,i)}const o="era"in t&&1!==t.era?1-s.year:s.year;return e.setFullYear(o,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),Ka(e,i)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends Xo{priority=130;parse(e,t){return An("R"===t?4:t.length,e)}set(e,t,s){const i=Ua(e,0);return i.setFullYear(s,0,4),i.setHours(0,0,0,0),Ga(i)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends Xo{priority=130;parse(e,t){return An("u"===t?4:t.length,e)}set(e,t,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends Xo{priority=120;parse(e,t,s){switch(t){case"Q":case"QQ":return $n(t.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,s){return e.setMonth(3*(s-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends Xo{priority=120;parse(e,t,s){switch(t){case"q":case"qq":return $n(t.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,s){return e.setMonth(3*(s-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends Xo{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,s){const i=e=>e-1;switch(t){case"M":return _n(Cn(Qo,e),i);case"MM":return _n($n(2,e),i);case"Mo":return _n(s.ordinalNumber(e,{unit:"month"}),i);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}},L:new class extends Xo{priority=110;parse(e,t,s){const i=e=>e-1;switch(t){case"L":return _n(Cn(Qo,e),i);case"LL":return _n($n(2,e),i);case"Lo":return _n(s.ordinalNumber(e,{unit:"month"}),i);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends Xo{priority=100;parse(e,t,s){switch(t){case"w":return Cn(tn,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return $n(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,s,i){return Ka(function(e,t,s){const i=Na(e),a=go(i,s)-t;return i.setDate(i.getDate()-7*a),i}(e,s,i),i)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends Xo{priority=100;parse(e,t,s){switch(t){case"I":return Cn(tn,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return $n(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,s){return Ga(function(e,t){const s=Na(e),i=uo(s)-t;return s.setDate(s.getDate()-7*i),s}(e,s))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends Xo{priority=90;subPriority=1;parse(e,t,s){switch(t){case"d":return Cn(Jo,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return $n(t.length,e)}}validate(e,t){const s=En(e.getFullYear()),i=e.getMonth();return s?t>=1&&t<=Bn[i]:t>=1&&t<=In[i]}set(e,t,s){return e.setDate(s),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends Xo{priority=90;subpriority=1;parse(e,t,s){switch(t){case"D":case"DD":return Cn(en,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return $n(t.length,e)}}validate(e,t){return En(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends Xo{priority=90;parse(e,t,s){switch(t){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,s,i){return(e=Zn(e,s,i)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends Xo{priority=90;parse(e,t,s,i){const a=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return _n($n(t.length,e),a);case"eo":return _n(s.ordinalNumber(e,{unit:"day"}),a);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,s,i){return(e=Zn(e,s,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends Xo{priority=90;parse(e,t,s,i){const a=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return _n($n(t.length,e),a);case"co":return _n(s.ordinalNumber(e,{unit:"day"}),a);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,s,i){return(e=Zn(e,s,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends Xo{priority=90;parse(e,t,s){const i=e=>0===e?7:e;switch(t){case"i":case"ii":return $n(t.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return _n(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return _n(s.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return _n(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),i);default:return _n(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),i)}}validate(e,t){return t>=1&&t<=7}set(e,t,s){return(e=Ln(e,s)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends Xo{priority=80;parse(e,t,s){switch(t){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,s){return e.setHours(Vn(s),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends Xo{priority=80;parse(e,t,s){switch(t){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,s){return e.setHours(Vn(s),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends Xo{priority=80;parse(e,t,s){switch(t){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,s){return e.setHours(Vn(s),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends Xo{priority=70;parse(e,t,s){switch(t){case"h":return Cn(nn,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return $n(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,s){const i=e.getHours()>=12;return i&&s<12?e.setHours(s+12,0,0,0):i||12!==s?e.setHours(s,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends Xo{priority=70;parse(e,t,s){switch(t){case"H":return Cn(sn,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return $n(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,s){return e.setHours(s,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends Xo{priority=70;parse(e,t,s){switch(t){case"K":return Cn(on,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return $n(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends Xo{priority=70;parse(e,t,s){switch(t){case"k":return Cn(an,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return $n(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,s){const i=s<=24?s%24:s;return e.setHours(i,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends Xo{priority=60;parse(e,t,s){switch(t){case"m":return Cn(rn,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return $n(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,s){return e.setMinutes(s,0,0),e}incompatibleTokens=["t","T"]},s:new class extends Xo{priority=50;parse(e,t,s){switch(t){case"s":return Cn(ln,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return $n(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,s){return e.setSeconds(s,0),e}incompatibleTokens=["t","T"]},S:new class extends Xo{priority=30;parse(e,t){return _n($n(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,s){return e.setMilliseconds(s),e}incompatibleTokens=["t","T"]},X:new class extends Xo{priority=10;parse(e,t){switch(t){case"X":return Sn(bn,e);case"XX":return Sn(wn,e);case"XXXX":return Sn(yn,e);case"XXXXX":return Sn(kn,e);default:return Sn(xn,e)}}set(e,t,s){return t.timestampIsSet?e:Ua(e,e.getTime()-Ja(e)-s)}incompatibleTokens=["t","T","x"]},x:new class extends Xo{priority=10;parse(e,t){switch(t){case"x":return Sn(bn,e);case"xx":return Sn(wn,e);case"xxxx":return Sn(yn,e);case"xxxxx":return Sn(kn,e);default:return Sn(xn,e)}}set(e,t,s){return t.timestampIsSet?e:Ua(e,e.getTime()-Ja(e)-s)}incompatibleTokens=["t","T","X"]},t:new class extends Xo{priority=40;parse(e){return Mn(e)}set(e,t,s){return[Ua(e,1e3*s),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends Xo{priority=20;parse(e){return Mn(e)}set(e,t,s){return[Ua(e,s),{timestampIsSet:!0}]}incompatibleTokens="*"}},Tn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Hn=/^'([^]*?)'?$/,zn=/''/g,Rn=/\S/,On=/[a-zA-Z]/;function Nn(e,t,s,i){const a=Object.assign({},Wa()),o=i?.locale??a.locale??co,n=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,r=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(""===t)return""===e?Na(s):Ua(s,NaN);const l={firstWeekContainsDate:n,weekStartsOn:r,locale:o},d=[new Go],c=t.match(Pn).map(e=>{const t=e[0];if(t in Vo){return(0,Vo[t])(e,o.formatLong)}return e}).join("").match(Tn),h=[];for(let a of c){!i?.useAdditionalWeekYearTokens&&Zo(a)&&Lo(a,t,e),!i?.useAdditionalDayOfYearTokens&&Bo(a)&&Lo(a,t,e);const n=a[0],r=Fn[n];if(r){const{incompatibleTokens:t}=r;if(Array.isArray(t)){const e=h.find(e=>t.includes(e.token)||e.token===n);if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${a}\` at the same time`)}else if("*"===r.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${a}\` and any other token at the same time`);h.push({token:n,fullToken:a});const i=r.run(e,a,o.match,l);if(!i)return Ua(s,NaN);d.push(i.setter),e=i.rest}else{if(n.match(On))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===a?a="'":"'"===n&&(a=Un(a)),0!==e.indexOf(a))return Ua(s,NaN);e=e.slice(a.length)}}if(e.length>0&&Rn.test(e))return Ua(s,NaN);const u=d.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,s)=>s.indexOf(e)===t).map(e=>d.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let p=Na(s);if(isNaN(p.getTime()))return Ua(s,NaN);const g={};for(const e of u){if(!e.validate(p,l))return Ua(s,NaN);const t=e.set(p,g,l);Array.isArray(t)?(p=t[0],Object.assign(g,t[1])):p=t}return Ua(s,p)}function Un(e){return e.match(Hn)[1].replace(zn,"'")}const qn={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:"dd/MM/yyyy"},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:"MM/dd/yyyy"},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:"yyyy/MM/dd"}},Yn=e=>{const t=e.getMonth(),s=e.getFullYear(),i=e.getDate(),a=new Date(s,t+1),o=No(a);return to(e)&&o<i?Uo(a):new Date(s,t+1,i)},jn=e=>{const t=e.getMonth(),s=e.getFullYear(),i=e.getDate(),a=new Date(s,t-1),o=No(a);return to(e)&&o<i?Uo(a):new Date(s,t-1,i)},Wn=e=>{const t=new Date(e);return t.setHours(12),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t};var Kn=n`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}.monthpicker [role=row],.yearpicker [role=row]{display:contents}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);font-size:var(--sgds-font-size-label-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-2-xs);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-40)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;const Gn=new Date,Xn={ArrowUp:{days:-7,months:-3,years:-3},ArrowDown:{days:7,months:3,years:3},ArrowRight:{days:1,months:1,years:1},ArrowLeft:{days:-1,months:-1,years:-1}};class Qn extends Pe{constructor(){super(...arguments),this.selectedDate=[],this.mode="single"}focusOnCalendar(e){e.blur(),this._focusOnCalendarCell()}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeyPress),this.addEventListener("blur",e=>e.stopPropagation())}updated(){3===this.focusedTabIndex&&this._focusOnCalendarCell()}_updateFocusedDate(){this.focusedDate=Wn(this.displayDate),this.focusedDate.getFullYear()<1900&&this.focusedDate.setFullYear(1900)}_setFocusedDate(e){const t=this.focusedDate.getDate(),s=this.focusedDate.getMonth(),i=this.focusedDate.getFullYear();switch(this.view){case"days":{const a=Wn(new Date(i,s,t+e));(qo(a,new Date(0,0,1,12))||jo(a,new Date(0,0,1,12)))&&(this.focusedDate=a);break}case"months":{const a=Wn(new Date(i,s+e,t));(qo(a,new Date(0,0,1,12))||jo(a,new Date(0,0,1,12)))&&(this.focusedDate=a);break}case"years":{const a=Wn(new Date(i+e,s,t));a.getFullYear()>=1900&&(this.focusedDate=a);break}}}_handleEnterDateKeyboard(e){const t=e.composedPath()[0];if(!t.classList.contains("disabled"))switch(this.view){case"days":this._onClickDay(e);break;case"months":{const{month:e}=t.dataset;this._onClickMonth(parseInt(e));break}case"years":{const{year:e}=t.dataset;this._onClickYear(parseInt(e))}}}_handleKeyPress(e){if("Enter"===e.key)return e.preventDefault(),void this._handleEnterDateKeyboard(e);if("Tab"===e.key){const e=this._getFocusedTarget();return void(3!==this.focusedTabIndex&&e.blur())}if(e.key.includes("Arrow")){e.preventDefault(),this._blurCalendarCell();const t=Xn[e.key][this.view];this._setFocusedDate(t),this._focusOnCalendarCell()}}_generateIncrementDates(){const e=Wn(this.selectedDate[0]);if(this.selectedDate.length<2)return[e];const t=Wn(this.selectedDate[1]),s=[];if(e.getTime()<t.getTime())for(let i=e;i<=t;i.setDate(i.getDate()+1))s.push(new Date(i));else for(let i=t;i<=e;i.setDate(i.getDate()+1))s.push(new Date(i));return s}_onClickDay(e){const{day:t,date:s}=e.composedPath()[0].dataset,i=new Date(this.displayDate);if(i.setDate(parseInt(t)),"click"===e.type&&(this.focusedDate=Wn(new Date(s))),"single"===this.mode)this.selectedDate=[i],this.emit("sgds-selectdates",{detail:this.selectedDate});else if("range"===this.mode){const e=[...this.selectedDate];0!==e.length&&2!==e.length||(e.length=0),e.push(i),this.selectedDate=e,this.emit("sgds-selectdates",{detail:this.selectedDate})}const a=this.minDate?Wn(new Date(this.minDate)):null,o=this.maxDate?Wn(new Date(this.maxDate)):null,n=Wn(i);(a&&n<a||o&&n>o)&&(e.stopPropagation(),e.preventDefault())}_onClickMonth(e,t=this.focusedDate.getFullYear()){const s=new Date(this.displayDate);this.view="days",s.setMonth(e),s.setFullYear(t),this.displayDate=s,this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectmonth",{detail:this.displayDate})}_onClickYear(e){const t=new Date(this.displayDate);t.setFullYear(e),this.displayDate=t,this.view="months",this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectyear",{detail:this.displayDate})}_getFocusedTarget(){const e={days:`td[data-date="${this.focusedDate.toISOString()}"]`,months:`button[data-month="${this.focusedDate.getMonth()}"][data-year="${this.focusedDate.getFullYear()}"]`,years:`button[data-year="${this.focusedDate.getFullYear()}"]`}[this.view];return this.shadowRoot.querySelector(`${e}`)}_blurCalendarCell(){const e=this._getFocusedTarget();e.setAttribute("tabindex","-1"),e.blur()}_focusOnCalendarCell(){const e=this._getFocusedTarget();e?(e.setAttribute("tabindex","0"),e.focus(),this.emit("sgds-update-focus",{detail:this.focusedDate})):this.emit("sgds-change-calendar",{detail:this.focusedDate})}_generateDays(){const e=this.selectedDate.map(e=>Wn(e)),t=this._generateIncrementDates(),s=this.minDate?Wn(new Date(this.minDate)):null,i=this.maxDate?Wn(new Date(this.maxDate)):null,a=this.displayDate.getFullYear(),o=this.displayDate.getMonth(),n=new Date(a,o,1).getDay();let r=Qn.daysInMonth[o];1===o&&(a%4==0&&a%100!=0||a%400==0)&&(r=29);const l=[];let d=1;for(let c=0;c<9;c++){const h=[];for(let l=0;l<=6;l++)if(d<=r&&(c>0||l>=n)){const n=new Date(a,o,d,12,0,0,0),r=n.toISOString(),c=s&&Date.parse(r)<Date.parse(s.toISOString()),u=i&&Date.parse(r)>Date.parse(i.toISOString()),p=c||u?void 0:this._onClickDay,g=Gn.getMonth()===this.displayDate.getMonth(),v=Gn.getFullYear()===this.displayDate.getFullYear(),m=Gn.getDate()===d,f=e.length>0&&t.some(e=>Date.parse(r)===Date.parse(e.toISOString())),b=e.length>0&&t[0].toISOString()===r,w=e.length>1&&t[t.length-1].toISOString()===r,y=""+(m&&g&&v?"Today's date, ":"")+Ro(n,"PPPP");h.push(ee`<td
|
|
2690
2690
|
key=${l}
|
|
2691
2691
|
data-date=${r}
|
|
2692
2692
|
data-day=${d}
|
|
@@ -3652,7 +3652,7 @@ const Ol="important",Nl=" !"+Ol;const Ul=Ye(class extends je{constructor(e){if(s
|
|
|
3652
3652
|
<slot></slot>
|
|
3653
3653
|
</label>
|
|
3654
3654
|
</div>
|
|
3655
|
-
`}}Gl.styles=[...Pe.styles,Ba,Va,Kl],e([Ve({type:Boolean,reflect:!0})],Gl.prototype,"checked",void 0),e([Ve()],Gl.prototype,"value",void 0),e([Ve({type:Boolean,reflect:!0})],Gl.prototype,"disabled",void 0),e([Ve({type:Boolean,reflect:!0})],Gl.prototype,"invalid",void 0),e([Ve({type:Boolean,reflect:!1})],Gl.prototype,"autofocus",void 0),e([Be("input")],Gl.prototype,"input",void 0),e([ot("checked")],Gl.prototype,"handleCheckedChange",null),e([ot("disabled",{waitUntilFirstUpdate:!0})],Gl.prototype,"handleDisabledChange",null);var Xl=n`fieldset{border:0;gap:var(--sgds-form-gap-md);margin:0;min-width:0;padding:0}.label-hint-container,fieldset{display:flex;flex-direction:column}.label-hint-container{gap:var(--sgds-form-gap-sm)}.radio-group-validation-input{display:none}.radio-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-40)}`;class Ql extends(_a(Ea)){constructor(){super(...arguments),this.defaultValue="",this.value="",this.invalidFeedback="",this.hasFeedback=!1,this.required=!1,this.noValidate=!1,this.autofocus=!1,this._isTouched=!1}_handleValueChange(){this.
|
|
3655
|
+
`}}Gl.styles=[...Pe.styles,Ba,Va,Kl],e([Ve({type:Boolean,reflect:!0})],Gl.prototype,"checked",void 0),e([Ve()],Gl.prototype,"value",void 0),e([Ve({type:Boolean,reflect:!0})],Gl.prototype,"disabled",void 0),e([Ve({type:Boolean,reflect:!0})],Gl.prototype,"invalid",void 0),e([Ve({type:Boolean,reflect:!1})],Gl.prototype,"autofocus",void 0),e([Be("input")],Gl.prototype,"input",void 0),e([ot("checked")],Gl.prototype,"handleCheckedChange",null),e([ot("disabled",{waitUntilFirstUpdate:!0})],Gl.prototype,"handleDisabledChange",null);var Xl=n`fieldset{border:0;gap:var(--sgds-form-gap-md);margin:0;min-width:0;padding:0}.label-hint-container,fieldset{display:flex;flex-direction:column}.label-hint-container{gap:var(--sgds-form-gap-sm)}.radio-group-validation-input{display:none}.radio-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}:host([disabled]) .label-hint-container{cursor:not-allowed;opacity:var(--sgds-opacity-40)}`;class Ql extends(_a(Ea)){constructor(){super(...arguments),this.defaultValue="",this.value="",this.invalidFeedback="",this.hasFeedback=!1,this.required=!1,this.noValidate=!1,this.autofocus=!1,this._isTouched=!1}_handleValueChange(){this._updateCheckedRadio()}_handleInvalidChange(){this._radios.forEach(e=>e.invalid=this.invalid)}_mixinResetFormControl(){this.value=this.input.value=this.defaultValue,this._updateInputValue("reset"),this._mixinResetValidity(this.input)}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value,this.addEventListener("sgds-blur",()=>{this._isTouched=!0})}firstUpdated(e){super.firstUpdated(e);const t=this._radios;t.forEach((e,s)=>{if(t.length>1)switch(s){case 0:e.setAttribute("first-of-type","");break;case t.length-1:e.setAttribute("last-of-type","");break;default:e.setAttribute("nth-of-type","")}}),this.value&&this._updateInputValue("change")}_handleRadioClick(e){e.preventDefault();const t=e.target;if(t.disabled)return;this.value=t.value,this.emit("sgds-change",{detail:{value:this.value}}),this._updateInputValue();this._radios.forEach(e=>e.checked=e===t)}_updateInputValue(e="change"){this.input.value=this.value,this.input.dispatchEvent(new InputEvent(e))}_handleKeyDown(e){var t;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(e.key))return;const s=this._radios.filter(e=>!e.disabled),i=null!==(t=s.find(e=>e.checked))&&void 0!==t?t:s[0],a=" "===e.key?0:["ArrowUp","ArrowLeft"].includes(e.key)?-1:1;let o=s.indexOf(i)+a;o<0&&(o=s.length-1),o>s.length-1&&(o=0),this._radios.forEach(e=>{e.checked=!1,e.tabIndex=-1}),this.value=s[o].value,this.emit("sgds-change",{detail:{value:this.value}}),this._updateInputValue(),s[o].checked=!0,s[o].tabIndex=0,e.preventDefault()}_handleSlotChange(){const e=this._radios;e.forEach(e=>(e.autofocus=this.autofocus,e.checked=e.value===this.value,e)),this._disabledChildRadios(),e.some(e=>e.checked)||e[0]&&(e[0].tabIndex=0)}_updateCheckedRadio(){this._radios.forEach(e=>e.checked=e.value===this.value)}_renderHintText(){const e=ee` <div id="${this._controlId}Help" class="form-text">${this.hintText}</div> `;return this.hintText&&e}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&(this.invalid=!this.input.checkValidity())}_handleDisabledChange(){this.setInvalid(!1),this._disabledChildRadios()}_disabledChildRadios(){if(this.disabled){this._radios.forEach(e=>e.disabled=this.disabled)}}render(){const e=ee`
|
|
3656
3656
|
<slot
|
|
3657
3657
|
class="radio-container"
|
|
3658
3658
|
@click=${this._handleRadioClick}
|