@tabworthy/components 0.10.1 → 0.11.1

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.
Files changed (30) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tabworthy-components.cjs.js +1 -1
  3. package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +2 -2
  4. package/dist/cjs/tabworthy-times-picker.cjs.entry.js +39 -5
  5. package/dist/cjs/tabworthy-times.cjs.entry.js +21 -8
  6. package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.js +2 -2
  7. package/dist/collection/components/tabworthy-times/tabworthy-times.js +42 -8
  8. package/dist/collection/components/tabworthy-times-picker/tabworthy-times-picker.js +80 -5
  9. package/dist/components/{p-D0CX07Ep.js → p-CIQgnOXj.js} +1 -1
  10. package/dist/components/p-D_zy0B-F.js +1 -0
  11. package/dist/components/tabworthy-dates-modal.js +1 -1
  12. package/dist/components/tabworthy-dates.js +1 -1
  13. package/dist/components/tabworthy-times-picker.js +1 -1
  14. package/dist/components/tabworthy-times.js +1 -1
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/tabworthy-components.js +1 -1
  17. package/dist/esm/tabworthy-dates-calendar_2.entry.js +2 -2
  18. package/dist/esm/tabworthy-times-picker.entry.js +39 -5
  19. package/dist/esm/tabworthy-times.entry.js +21 -8
  20. package/dist/tabworthy-components/p-dc960590.entry.js +1 -0
  21. package/dist/tabworthy-components/p-ea7b79b0.entry.js +1 -0
  22. package/dist/tabworthy-components/{p-42e77ac7.entry.js → p-f1688c61.entry.js} +1 -1
  23. package/dist/tabworthy-components/tabworthy-components.esm.js +1 -1
  24. package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +2 -0
  25. package/dist/types/components/tabworthy-times-picker/tabworthy-times-picker.d.ts +11 -0
  26. package/dist/types/components.d.ts +27 -0
  27. package/package.json +2 -1
  28. package/dist/components/p-DDp2dGlo.js +0 -1
  29. package/dist/tabworthy-components/p-327d119d.entry.js +0 -1
  30. package/dist/tabworthy-components/p-a67ad7af.entry.js +0 -1
@@ -2,20 +2,26 @@ import { h, Host } from "@stencil/core";
2
2
  const defaultLabels = {
3
3
  hours: "Hours",
4
4
  minutes: "Minutes",
5
+ seconds: "Seconds",
5
6
  am: "AM",
6
7
  pm: "PM",
7
8
  timePicker: "Time picker",
8
9
  incrementHours: "Increment hours",
9
10
  decrementHours: "Decrement hours",
10
11
  incrementMinutes: "Increment minutes",
11
- decrementMinutes: "Decrement minutes"
12
+ decrementMinutes: "Decrement minutes",
13
+ incrementSeconds: "Increment seconds",
14
+ decrementSeconds: "Decrement seconds"
12
15
  };
13
16
  export class TabworthyTimesPicker {
14
17
  constructor() {
15
18
  // Current time value (24-hour format)
16
19
  this.hours = 12;
17
20
  this.minutes = 0;
21
+ this.seconds = 0;
18
22
  this.useTwelveHourFormat = false;
23
+ // Show seconds control
24
+ this.showSeconds = false;
19
25
  // Labels for accessibility and i18n
20
26
  this.labels = defaultLabels;
21
27
  // Hide labels visually but keep them for screen readers
@@ -24,6 +30,7 @@ export class TabworthyTimesPicker {
24
30
  this.elementClassName = "tabworthy-times-picker";
25
31
  this.internalHours = this.hours;
26
32
  this.internalMinutes = this.minutes;
33
+ this.internalSeconds = this.seconds;
27
34
  this.period = this.hours >= 12 ? "PM" : "AM";
28
35
  this.handleHourChange = (e) => {
29
36
  const value = parseInt(e.target.value, 10);
@@ -101,6 +108,19 @@ export class TabworthyTimesPicker {
101
108
  this.internalMinutes === 0 ? 59 : this.internalMinutes - 1;
102
109
  this.emitTimeChange();
103
110
  };
111
+ this.handleSecondChange = (e) => {
112
+ this.internalSeconds = parseInt(e.target.value, 10);
113
+ this.emitTimeChange();
114
+ };
115
+ this.handleSecondIncrement = () => {
116
+ this.internalSeconds = (this.internalSeconds + 1) % 60;
117
+ this.emitTimeChange();
118
+ };
119
+ this.handleSecondDecrement = () => {
120
+ this.internalSeconds =
121
+ this.internalSeconds === 0 ? 59 : this.internalSeconds - 1;
122
+ this.emitTimeChange();
123
+ };
104
124
  }
105
125
  watchHours(newValue) {
106
126
  this.internalHours = newValue;
@@ -109,9 +129,13 @@ export class TabworthyTimesPicker {
109
129
  watchMinutes(newValue) {
110
130
  this.internalMinutes = newValue;
111
131
  }
132
+ watchSeconds(newValue) {
133
+ this.internalSeconds = newValue;
134
+ }
112
135
  componentWillLoad() {
113
136
  this.internalHours = this.hours;
114
137
  this.internalMinutes = this.minutes;
138
+ this.internalSeconds = this.seconds;
115
139
  this.period = this.hours >= 12 ? "PM" : "AM";
116
140
  }
117
141
  getDisplayHours() {
@@ -140,6 +164,7 @@ export class TabworthyTimesPicker {
140
164
  this.timeChanged.emit({
141
165
  hours: this.get24HourValue(),
142
166
  minutes: this.internalMinutes,
167
+ seconds: this.showSeconds ? this.internalSeconds : undefined,
143
168
  period: this.useTwelveHourFormat ? this.period : undefined
144
169
  });
145
170
  }
@@ -150,16 +175,22 @@ export class TabworthyTimesPicker {
150
175
  const displayHours = this.getDisplayHours();
151
176
  const maxHours = this.useTwelveHourFormat ? 12 : 23;
152
177
  const minHours = this.useTwelveHourFormat ? 1 : 0;
153
- return (h(Host, { key: '9b58907eb4784f4b3b1c0a25fd51fec33832ce07', class: this.elementClassName, "aria-label": this.labels.timePicker }, h("div", { key: 'a337deb490c90bc628d92cf8025a1dbab461d98a', class: `${this.elementClassName}__container` }, h("div", { key: 'e3b37266b5bf5758f4435f8b4d23a34a6da5906d', class: `${this.elementClassName}__field` }, h("label", { key: '08ee8679d4f3abbf211feb4c4c83d103542679bb', htmlFor: `${this.elementClassName}-hours`, class: {
178
+ return (h(Host, { key: 'be075e309d41904bf237c3a4b31b063ac4d1a7e0', class: this.elementClassName, "aria-label": this.labels.timePicker }, h("div", { key: '39d3a55428ad6f567490aa9a55ab94766de39e7f', class: `${this.elementClassName}__container` }, h("div", { key: '5efcc6b13a4473d5d889689d205128b328ae9417', class: `${this.elementClassName}__field` }, h("label", { key: 'f2e760229dd54d2265539e924dc133eda7f53fb8', htmlFor: `${this.elementClassName}-hours`, class: {
154
179
  [`${this.elementClassName}__label`]: true,
155
180
  [`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
156
- } }, this.labels.hours), h("div", { key: 'b55bc02c9bf1b68bdbd443781ab63f672e470a25', class: `${this.elementClassName}__control` }, h("button", { key: '2f39fbe193148518255188a72ced6253a362972b', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleHourIncrement, disabled: this.disabled, "aria-label": this.labels.incrementHours }, h("svg", { key: '870b6b42129f6f6e17de83c79abfaa1d3bbfa63a', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: 'be9e46c59488605aab9793e9a5dfb720390eb66a', points: "18 15 12 9 6 15" }))), h("input", { key: '46ae9335a93cec99f4f4c66ea798aa4bedd10173', id: `${this.elementClassName}-hours`, type: "number", class: `${this.elementClassName}__input`, value: this.padZero(displayHours), min: minHours, max: maxHours, onInput: this.handleHourChange, disabled: this.disabled, "aria-label": this.labels.hours }), h("button", { key: '45a67eb11ec557b9177a28aa0ff1a209b8253cdb', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleHourDecrement, disabled: this.disabled, "aria-label": this.labels.decrementHours }, h("svg", { key: '2e54fbfd5177e0bf967f0f07a0bcc90f9de70676', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '6f386c6c865b2c4fa1547fb2eb84bcb1d73dfb6c', points: "6 9 12 15 18 9" }))))), h("div", { key: '745ee4c84ac76dcb35df64109b666100364e8053', class: `${this.elementClassName}__separator` }, ":"), h("div", { key: 'e299001fc01bc9c4bbb46cd9580764c95614e8ca', class: `${this.elementClassName}__field` }, h("label", { key: '9bb317196dc9619ccbe91007b1003cd7231626a7', htmlFor: `${this.elementClassName}-minutes`, class: {
181
+ } }, this.labels.hours), h("div", { key: 'a1f92371d923c50adb423d8fa36d84fe632fcdcb', class: `${this.elementClassName}__control` }, h("button", { key: 'ce1a13d5d97f664cd5a7ef9ac144cb2d7a76b0e3', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleHourIncrement, disabled: this.disabled, "aria-label": this.labels.incrementHours }, h("svg", { key: '9f4f27bc5e3ecc1da7f9520c5a67bef79b546229', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '2537a3c151f846b52f427bff20145dd581b2db7b', points: "18 15 12 9 6 15" }))), h("input", { key: 'dbe3c7e05bf44f2942f38e397fa8abcd5ec9a080', id: `${this.elementClassName}-hours`, type: "number", class: `${this.elementClassName}__input`, value: this.padZero(displayHours), min: minHours, max: maxHours, onInput: this.handleHourChange, disabled: this.disabled, "aria-label": this.labels.hours }), h("button", { key: '69e610902e8324369a57f5943699f019533f9b0a', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleHourDecrement, disabled: this.disabled, "aria-label": this.labels.decrementHours }, h("svg", { key: 'fd3a91c8c82abb4ba948c1735a4d6b1ab9879452', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: 'f2fb31860bc57fe95b78e0331d4dce611976f1cc', points: "6 9 12 15 18 9" }))))), h("div", { key: '5f488705145ebbaaba10f7e0370dd614e5ac9c91', class: `${this.elementClassName}__separator` }, ":"), h("div", { key: 'c886bc72ad9098a1015d97cdb64d609d10b4b7c0', class: `${this.elementClassName}__field` }, h("label", { key: '3590285320f4ee5403e41cceb964aa2440ee3caa', htmlFor: `${this.elementClassName}-minutes`, class: {
157
182
  [`${this.elementClassName}__label`]: true,
158
183
  [`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
159
- } }, this.labels.minutes), h("div", { key: '62033213721f2696cbe36dd76ba522e3a21ce718', class: `${this.elementClassName}__control` }, h("button", { key: '011daa926e28024e7e76f996af334fe34728ce78', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleMinuteIncrement, disabled: this.disabled, "aria-label": this.labels.incrementMinutes }, h("svg", { key: '03ee7c275d8924d87b735751b56505bab3c09f94', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '0f27d33a1440e7418c3f98863df276cdd596eee8', points: "18 15 12 9 6 15" }))), h("input", { key: '63b25ff463cbfccff9360f486279bc25381a3a3a', id: `${this.elementClassName}-minutes`, type: "number", class: `${this.elementClassName}__input`, value: this.padZero(this.internalMinutes), min: 0, max: 59, onInput: this.handleMinuteChange, disabled: this.disabled, "aria-label": this.labels.minutes }), h("button", { key: 'bc2d44f2e89dc7adb87930b84c3b7bfb6f5dcf3c', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleMinuteDecrement, disabled: this.disabled, "aria-label": this.labels.decrementMinutes }, h("svg", { key: 'b565bf9b1564e18f930bdaedf9c47ace88eaa6ac', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: 'bf864da5aca3787bda78283fff66c8c4611ed541', points: "6 9 12 15 18 9" }))))), this.useTwelveHourFormat && (h("div", { key: '9b9268553b3417ed186a4057258e9565e49a87f7', class: `${this.elementClassName}__period` }, h("button", { key: '6a953b254ca0e827aed00ac2889c6127df308a61', type: "button", class: {
184
+ } }, this.labels.minutes), h("div", { key: '0e4271bc5e35b9664ef599af056c997a0b09c64f', class: `${this.elementClassName}__control` }, h("button", { key: '29d095829fb141f2f2495a5cbc4bb7f28f39b54b', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleMinuteIncrement, disabled: this.disabled, "aria-label": this.labels.incrementMinutes }, h("svg", { key: '683cb78389935a9a68e59d875df60dc168ca5a4b', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '21084833e0479ace54ee23b2b9a39276752d6467', points: "18 15 12 9 6 15" }))), h("input", { key: '07d608da760816c37ae394fe5798ad25ca0c17db', id: `${this.elementClassName}-minutes`, type: "number", class: `${this.elementClassName}__input`, value: this.padZero(this.internalMinutes), min: 0, max: 59, onInput: this.handleMinuteChange, disabled: this.disabled, "aria-label": this.labels.minutes }), h("button", { key: '07aee6f5f9b6cfe23fa50ae9ad2319f627c9efe2', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleMinuteDecrement, disabled: this.disabled, "aria-label": this.labels.decrementMinutes }, h("svg", { key: '3e284e93b451ab57b0c4e0a29b8c3953f5a79033', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '589c1da5150f4b3def68b9dcb14f2ee56b9022e2', points: "6 9 12 15 18 9" }))))), this.showSeconds && [
185
+ h("div", { key: '717844859ad07d5912fdd0b386151aeb40ccbf94', class: `${this.elementClassName}__separator` }, ":"),
186
+ h("div", { key: 'a27907f31a3d71abb9f7c5bce411569ddd22594d', class: `${this.elementClassName}__field` }, h("label", { key: 'c6312aeccdfe835aa0bd02bc7078b4a30aa70921', htmlFor: `${this.elementClassName}-seconds`, class: {
187
+ [`${this.elementClassName}__label`]: true,
188
+ [`${this.elementClassName}__label--sr-only`]: this.labelsSrOnly
189
+ } }, this.labels.seconds), h("div", { key: 'c347d3847e999a900cba2410dbc2c5711d01d746', class: `${this.elementClassName}__control` }, h("button", { key: 'b0862893f9d99e6ef7da0cfc02f6a6e1f0bc4443', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--increment`, onClick: this.handleSecondIncrement, disabled: this.disabled, "aria-label": this.labels.incrementSeconds }, h("svg", { key: 'b4032699911ed9e589c015b4c3b9d31766b53d38', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '5bfbeefa5ea9d4901a7bc08de5bf01578fbf6cec', points: "18 15 12 9 6 15" }))), h("input", { key: '3c7e4e5b4f7a162e9ce9efa815d1c180ff5395d2', id: `${this.elementClassName}-seconds`, type: "number", class: `${this.elementClassName}__input`, value: this.padZero(this.internalSeconds), min: 0, max: 59, onInput: this.handleSecondChange, disabled: this.disabled, "aria-label": this.labels.seconds }), h("button", { key: '6f5a37921ef128033fe8241b63903739f0ddc245', type: "button", class: `${this.elementClassName}__button ${this.elementClassName}__button--decrement`, onClick: this.handleSecondDecrement, disabled: this.disabled, "aria-label": this.labels.decrementSeconds }, h("svg", { key: '5c24cc5df194f53889ec353a5527c239df94a380', fill: "none", height: "16", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "16" }, h("polyline", { key: '090946e452acf54e8bc491094573368160f55cbe', points: "6 9 12 15 18 9" })))))
190
+ ], this.useTwelveHourFormat && (h("div", { key: '4bbd646f21dc099efc94e86b05ce35e22c28ee16', class: `${this.elementClassName}__period` }, h("button", { key: '3b41814b8fe32ffe3ef898fe816cc027440c6c2b', type: "button", class: {
160
191
  [`${this.elementClassName}__period-button`]: true,
161
192
  [`${this.elementClassName}__period-button--active`]: this.period === "AM"
162
- }, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), h("button", { key: '5371401b679895edd32d8a901c1339a8d3baacb6', type: "button", class: {
193
+ }, onClick: () => this.handlePeriodChange("AM"), disabled: this.disabled, "aria-label": this.labels.am, "aria-pressed": this.period === "AM" }, this.labels.am), h("button", { key: 'fd9052000876c0516e13ab701a4e5164a7d72112', type: "button", class: {
163
194
  [`${this.elementClassName}__period-button`]: true,
164
195
  [`${this.elementClassName}__period-button--active`]: this.period === "PM"
165
196
  }, onClick: () => this.handlePeriodChange("PM"), disabled: this.disabled, "aria-label": this.labels.pm, "aria-pressed": this.period === "PM" }, this.labels.pm))))));
@@ -208,6 +239,26 @@ export class TabworthyTimesPicker {
208
239
  "attribute": "minutes",
209
240
  "defaultValue": "0"
210
241
  },
242
+ "seconds": {
243
+ "type": "number",
244
+ "mutable": true,
245
+ "complexType": {
246
+ "original": "number",
247
+ "resolved": "number",
248
+ "references": {}
249
+ },
250
+ "required": false,
251
+ "optional": false,
252
+ "docs": {
253
+ "tags": [],
254
+ "text": ""
255
+ },
256
+ "getter": false,
257
+ "setter": false,
258
+ "reflect": false,
259
+ "attribute": "seconds",
260
+ "defaultValue": "0"
261
+ },
211
262
  "useTwelveHourFormat": {
212
263
  "type": "boolean",
213
264
  "mutable": false,
@@ -228,6 +279,26 @@ export class TabworthyTimesPicker {
228
279
  "attribute": "use-twelve-hour-format",
229
280
  "defaultValue": "false"
230
281
  },
282
+ "showSeconds": {
283
+ "type": "boolean",
284
+ "mutable": false,
285
+ "complexType": {
286
+ "original": "boolean",
287
+ "resolved": "boolean",
288
+ "references": {}
289
+ },
290
+ "required": false,
291
+ "optional": false,
292
+ "docs": {
293
+ "tags": [],
294
+ "text": ""
295
+ },
296
+ "getter": false,
297
+ "setter": false,
298
+ "reflect": false,
299
+ "attribute": "show-seconds",
300
+ "defaultValue": "false"
301
+ },
231
302
  "labels": {
232
303
  "type": "unknown",
233
304
  "mutable": false,
@@ -318,6 +389,7 @@ export class TabworthyTimesPicker {
318
389
  return {
319
390
  "internalHours": {},
320
391
  "internalMinutes": {},
392
+ "internalSeconds": {},
321
393
  "period": {}
322
394
  };
323
395
  }
@@ -353,6 +425,9 @@ export class TabworthyTimesPicker {
353
425
  }, {
354
426
  "propName": "minutes",
355
427
  "methodName": "watchMinutes"
428
+ }, {
429
+ "propName": "seconds",
430
+ "methodName": "watchSeconds"
356
431
  }];
357
432
  }
358
433
  }
@@ -1 +1 @@
1
- import{p as t,H as n,c as e,h as i,d as r,t as o}from"./p-BiJ0HZVY.js";function a(t,n,e,i=20,r=0){let o=[];if(r>=i)return o;const s=t=>{const o=t.assignedNodes().filter((t=>1===t.nodeType));return o.length>0?a(o[0].parentElement,n,e,i,r+1):[]},u=Array.from(t.children||[]);for(const t of u)n(t)||(e(t)&&o.push(t),null!=t.shadowRoot?o.push(...a(t.shadowRoot,n,e,i,r+1)):"SLOT"===t.tagName?o.push(...s(t)):o.push(...a(t,n,e,i,r+1)));return o}function s(t){return t.hasAttribute("hidden")||t.hasAttribute("aria-hidden")&&"false"!==t.getAttribute("aria-hidden")||"none"===t.style.display||"0"===t.style.opacity||"hidden"===t.style.visibility||"collapse"===t.style.visibility}function u(t){return"-1"!==t.getAttribute("tabindex")&&!s(t)&&!function(t){return t.hasAttribute("disabled")||t.hasAttribute("aria-disabled")&&"false"!==t.getAttribute("aria-disabled")}(t)&&(t.hasAttribute("tabindex")||(t instanceof HTMLAnchorElement||t instanceof HTMLAreaElement)&&t.hasAttribute("href")||t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLIFrameElement)}const c=new Map,f=document.createElement("template");f.innerHTML='\n\t<div id="start"></div>\n\t<div id="backup"></div>\n\t<slot></slot>\n\t<div id="end"></div>\n';class d extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const t=this.attachShadow({mode:"open"});t.appendChild(f.content.cloneNode(!0)),this.$backup=t.querySelector("#backup"),this.$start=t.querySelector("#start"),this.$end=t.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(t){t?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return a(this,s,u)}trapFocus(t){if(this.inactive)return;let n=this.getFocusableElements();n.length>0?(t?n[n.length-1].focus():n[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(t){!function(t,n,e){const i=c.get(e);null!=i&&window.clearTimeout(i),c.set(e,window.setTimeout((()=>{t(),c.delete(e)}),0))}((()=>{this.focused!==t&&(this._focused=t,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}window.customElements.define("focus-trap",d);var h=new WeakMap,l=new WeakMap,p={},v=0,b=function(t){return t&&(t.host||b(t.parentNode))},m=function(t,n,e){void 0===e&&(e="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=function(t){return"undefined"==typeof document?null:(Array.isArray(t)?t[0]:t).ownerDocument.body}(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live]"))),function(t,n,e,i){var r=function(t,n){return n.map((function(n){if(t.contains(n))return n;var e=b(n);return e&&t.contains(e)?e:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)})).filter((function(t){return Boolean(t)}))}(n,Array.isArray(t)?t:[t]);p[e]||(p[e]=new WeakMap);var o=p[e],a=[],s=new Set,u=new Set(r),c=function(t){t&&!s.has(t)&&(s.add(t),c(t.parentNode))};r.forEach(c);var f=function(t){t&&!u.has(t)&&Array.prototype.forEach.call(t.children,(function(t){if(s.has(t))f(t);else{var n=t.getAttribute(i),r=null!==n&&"false"!==n,u=(h.get(t)||0)+1,c=(o.get(t)||0)+1;h.set(t,u),o.set(t,c),a.push(t),1===u&&r&&l.set(t,!0),1===c&&t.setAttribute(e,"true"),r||t.setAttribute(i,"true")}}))};return f(n),s.clear(),v++,function(){a.forEach((function(t){var n=h.get(t)-1,r=o.get(t)-1;h.set(t,n),o.set(t,r),n||(l.has(t)||t.removeAttribute(i),l.delete(t)),r||t.removeAttribute(e)})),--v||(h=new WeakMap,h=new WeakMap,l=new WeakMap,p={})}}(i,r,e,"aria-hidden")):function(){return null}},y="top",w="bottom",g="right",x="left",O="auto",j=[y,w,g,x],k="start",M="end",E="viewport",A="popper",T=j.reduce((function(t,n){return t.concat([n+"-"+k,n+"-"+M])}),[]),S=[].concat(j,[O]).reduce((function(t,n){return t.concat([n,n+"-"+k,n+"-"+M])}),[]),L=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function P(t){return t?(t.nodeName||"").toLowerCase():null}function H(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function W(t){return t instanceof H(t).Element||t instanceof Element}function B(t){return t instanceof H(t).HTMLElement||t instanceof HTMLElement}function F(t){return"undefined"!=typeof ShadowRoot&&(t instanceof H(t).ShadowRoot||t instanceof ShadowRoot)}function I(t){return t.split("-")[0]}var q=Math.max,C=Math.min,R=Math.round;function z(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function D(){return!/^((?!chrome|android).)*safari/i.test(z())}function V(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var i=t.getBoundingClientRect(),r=1,o=1;n&&B(t)&&(r=t.offsetWidth>0&&R(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&R(i.height)/t.offsetHeight||1);var a=(W(t)?H(t):window).visualViewport,s=!D()&&e,u=(i.left+(s&&a?a.offsetLeft:0))/r,c=(i.top+(s&&a?a.offsetTop:0))/o,f=i.width/r,d=i.height/o;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function J(t){var n=V(t),e=t.offsetWidth,i=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-i)<=1&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:i}}function K(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&F(e)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function U(t){return H(t).getComputedStyle(t)}function Y(t){return["table","td","th"].indexOf(P(t))>=0}function Z(t){return((W(t)?t.ownerDocument:t.document)||window.document).documentElement}function _(t){return"html"===P(t)?t:t.assignedSlot||t.parentNode||(F(t)?t.host:null)||Z(t)}function G(t){return B(t)&&"fixed"!==U(t).position?t.offsetParent:null}function N(t){for(var n=H(t),e=G(t);e&&Y(e)&&"static"===U(e).position;)e=G(e);return e&&("html"===P(e)||"body"===P(e)&&"static"===U(e).position)?n:e||function(t){var n=/firefox/i.test(z());if(/Trident/i.test(z())&&B(t)&&"fixed"===U(t).position)return null;var e=_(t);for(F(e)&&(e=e.host);B(e)&&["html","body"].indexOf(P(e))<0;){var i=U(e);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return e;e=e.parentNode}return null}(t)||n}function Q(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function X(t,n,e){return q(t,C(n,e))}function $(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function tt(t,n){return n.reduce((function(n,e){return n[e]=t,n}),{})}function nt(t){return t.split("-")[1]}var et={top:"auto",right:"auto",bottom:"auto",left:"auto"};function it(t){var n,e=t.popper,i=t.popperRect,r=t.placement,o=t.variation,a=t.offsets,s=t.position,u=t.gpuAcceleration,c=t.adaptive,f=t.roundOffsets,d=t.isFixed,h=a.x,l=void 0===h?0:h,p=a.y,v=void 0===p?0:p,b="function"==typeof f?f({x:l,y:v}):{x:l,y:v};l=b.x,v=b.y;var m=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),j=x,k=y,E=window;if(c){var A=N(e),T="clientHeight",S="clientWidth";A===H(e)&&"static"!==U(A=Z(e)).position&&"absolute"===s&&(T="scrollHeight",S="scrollWidth"),(r===y||(r===x||r===g)&&o===M)&&(k=w,v-=(d&&A===E&&E.visualViewport?E.visualViewport.height:A[T])-i.height,v*=u?1:-1),r!==x&&(r!==y&&r!==w||o!==M)||(j=g,l-=(d&&A===E&&E.visualViewport?E.visualViewport.width:A[S])-i.width,l*=u?1:-1)}var L,P=Object.assign({position:s},c&&et),W=!0===f?function(t,n){var e=t.y,i=n.devicePixelRatio||1;return{x:R(t.x*i)/i||0,y:R(e*i)/i||0}}({x:l,y:v},H(e)):{x:l,y:v};return l=W.x,v=W.y,Object.assign({},P,u?((L={})[k]=O?"0":"",L[j]=m?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+l+"px, "+v+"px)":"translate3d("+l+"px, "+v+"px, 0)",L):((n={})[k]=O?v+"px":"",n[j]=m?l+"px":"",n.transform="",n))}var rt={passive:!0},ot={left:"right",right:"left",bottom:"top",top:"bottom"};function at(t){return t.replace(/left|right|bottom|top/g,(function(t){return ot[t]}))}var st={start:"end",end:"start"};function ut(t){return t.replace(/start|end/g,(function(t){return st[t]}))}function ct(t){var n=H(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function ft(t){return V(Z(t)).left+ct(t).scrollLeft}function dt(t){var n=U(t);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function ht(t){return["html","body","#document"].indexOf(P(t))>=0?t.ownerDocument.body:B(t)&&dt(t)?t:ht(_(t))}function lt(t,n){var e;void 0===n&&(n=[]);var i=ht(t),r=i===(null==(e=t.ownerDocument)?void 0:e.body),o=H(i),a=r?[o].concat(o.visualViewport||[],dt(i)?i:[]):i,s=n.concat(a);return r?s:s.concat(lt(_(a)))}function pt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vt(t,n,e){return n===E?pt(function(t,n){var e=H(t),i=Z(t),r=e.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,u=0;if(r){o=r.width,a=r.height;var c=D();(c||!c&&"fixed"===n)&&(s=r.offsetLeft,u=r.offsetTop)}return{width:o,height:a,x:s+ft(t),y:u}}(t,e)):W(n)?function(t,n){var e=V(t,!1,"fixed"===n);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(n,e):pt(function(t){var n,e=Z(t),i=ct(t),r=null==(n=t.ownerDocument)?void 0:n.body,o=q(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=q(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+ft(t),u=-i.scrollTop;return"rtl"===U(r||e).direction&&(s+=q(e.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}(Z(t)))}function bt(t){var n,e=t.reference,i=t.element,r=t.placement,o=r?I(r):null,a=r?nt(r):null,s=e.x+e.width/2-i.width/2,u=e.y+e.height/2-i.height/2;switch(o){case y:n={x:s,y:e.y-i.height};break;case w:n={x:s,y:e.y+e.height};break;case g:n={x:e.x+e.width,y:u};break;case x:n={x:e.x-i.width,y:u};break;default:n={x:e.x,y:e.y}}var c=o?Q(o):null;if(null!=c){var f="y"===c?"height":"width";switch(a){case k:n[c]=n[c]-(e[f]/2-i[f]/2);break;case M:n[c]=n[c]+(e[f]/2-i[f]/2)}}return n}function mt(t,n){void 0===n&&(n={});var e=n.placement,i=void 0===e?t.placement:e,r=n.strategy,o=void 0===r?t.strategy:r,a=n.boundary,s=void 0===a?"clippingParents":a,u=n.rootBoundary,c=void 0===u?E:u,f=n.elementContext,d=void 0===f?A:f,h=n.altBoundary,l=void 0!==h&&h,p=n.padding,v=void 0===p?0:p,b=$("number"!=typeof v?v:tt(v,j)),m=t.rects.popper,x=t.elements[l?d===A?"reference":A:d],O=function(t,n,e,i){var r="clippingParents"===n?function(t){var n=lt(_(t)),e=["absolute","fixed"].indexOf(U(t).position)>=0&&B(t)?N(t):t;return W(e)?n.filter((function(t){return W(t)&&K(t,e)&&"body"!==P(t)})):[]}(t):[].concat(n),o=[].concat(r,[e]),a=o.reduce((function(n,e){var r=vt(t,e,i);return n.top=q(r.top,n.top),n.right=C(r.right,n.right),n.bottom=C(r.bottom,n.bottom),n.left=q(r.left,n.left),n}),vt(t,o[0],i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(W(x)?x:x.contextElement||Z(t.elements.popper),s,c,o),k=V(t.elements.reference),M=bt({reference:k,element:m,placement:i}),T=pt(Object.assign({},m,M)),S=d===A?T:k,L={top:O.top-S.top+b.top,bottom:S.bottom-O.bottom+b.bottom,left:O.left-S.left+b.left,right:S.right-O.right+b.right},H=t.modifiersData.offset;if(d===A&&H){var F=H[i];Object.keys(L).forEach((function(t){var n=[g,w].indexOf(t)>=0?1:-1,e=[y,w].indexOf(t)>=0?"y":"x";L[t]+=F[e]*n}))}return L}function yt(t,n){void 0===n&&(n={});var e=n.boundary,i=n.rootBoundary,r=n.padding,o=n.flipVariations,a=n.allowedAutoPlacements,s=void 0===a?S:a,u=nt(n.placement),c=u?o?T:T.filter((function(t){return nt(t)===u})):j,f=c.filter((function(t){return s.indexOf(t)>=0}));0===f.length&&(f=c);var d=f.reduce((function(n,o){return n[o]=mt(t,{placement:o,boundary:e,rootBoundary:i,padding:r})[I(o)],n}),{});return Object.keys(d).sort((function(t,n){return d[t]-d[n]}))}var wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var r=e.mainAxis,o=void 0===r||r,a=e.altAxis,s=void 0===a||a,u=e.fallbackPlacements,c=e.padding,f=e.boundary,d=e.rootBoundary,h=e.altBoundary,l=e.flipVariations,p=void 0===l||l,v=e.allowedAutoPlacements,b=n.options.placement,m=I(b),j=u||(m!==b&&p?function(t){if(I(t)===O)return[];var n=at(t);return[ut(t),n,ut(n)]}(b):[at(b)]),M=[b].concat(j).reduce((function(t,e){return t.concat(I(e)===O?yt(n,{placement:e,boundary:f,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:v}):e)}),[]),E=n.rects.reference,A=n.rects.popper,T=new Map,S=!0,L=M[0],P=0;P<M.length;P++){var H=M[P],W=I(H),B=nt(H)===k,F=[y,w].indexOf(W)>=0,q=F?"width":"height",C=mt(n,{placement:H,boundary:f,rootBoundary:d,altBoundary:h,padding:c}),R=F?B?g:x:B?w:y;E[q]>A[q]&&(R=at(R));var z=at(R),D=[];if(o&&D.push(C[W]<=0),s&&D.push(C[R]<=0,C[z]<=0),D.every((function(t){return t}))){L=H,S=!1;break}T.set(H,D)}if(S)for(var V=function(t){var n=M.find((function(n){var e=T.get(n);if(e)return e.slice(0,t).every((function(t){return t}))}));if(n)return L=n,"break"},J=p?3:1;J>0&&"break"!==V(J);J--);n.placement!==L&&(n.modifiersData[i]._skip=!0,n.placement=L,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function gt(t,n,e){return void 0===e&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function xt(t){return[y,g,w,x].some((function(n){return t[n]>=0}))}function Ot(t,n,e){void 0===e&&(e=!1);var i,r,o=B(n),a=B(n)&&function(t){var n=t.getBoundingClientRect(),e=R(n.width)/t.offsetWidth||1,i=R(n.height)/t.offsetHeight||1;return 1!==e||1!==i}(n),s=Z(n),u=V(t,a,e),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(o||!o&&!e)&&(("body"!==P(n)||dt(s))&&(c=(i=n)!==H(i)&&B(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:ct(i)),B(n)?((f=V(n,!0)).x+=n.clientLeft,f.y+=n.clientTop):s&&(f.x=ft(s))),{x:u.left+c.scrollLeft-f.x,y:u.top+c.scrollTop-f.y,width:u.width,height:u.height}}function jt(t){var n=new Map,e=new Set,i=[];function r(t){e.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!e.has(t)){var i=n.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){e.has(t.name)||r(t)})),i}var kt={placement:"bottom",modifiers:[],strategy:"absolute"};function Mt(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Et(t){void 0===t&&(t={});var n=t.defaultModifiers,e=void 0===n?[]:n,i=t.defaultOptions,r=void 0===i?kt:i;return function(t,n,i){void 0===i&&(i=r);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},kt,r),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],c=!1,f={state:s,setOptions:function(i){var o="function"==typeof i?i(s.options):i;d(),s.options=Object.assign({},r,s.options,o),s.scrollParents={reference:W(t)?lt(t):t.contextElement?lt(t.contextElement):[],popper:lt(n)};var a,c,h=function(t){var n=jt(t);return L.reduce((function(t,e){return t.concat(n.filter((function(t){return t.phase===e})))}),[])}((a=[].concat(e,s.options.modifiers),c=a.reduce((function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return s.orderedModifiers=h.filter((function(t){return t.enabled})),s.orderedModifiers.forEach((function(t){var n=t.options,e=t.effect;if("function"==typeof e){var i=e({state:s,name:t.name,instance:f,options:void 0===n?{}:n});u.push(i||function(){})}})),f.update()},forceUpdate:function(){if(!c){var t=s.elements,n=t.reference,e=t.popper;if(Mt(n,e)){s.rects={reference:Ot(n,N(e),"fixed"===s.options.strategy),popper:J(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(t){return s.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<s.orderedModifiers.length;i++)if(!0!==s.reset){var r=s.orderedModifiers[i],o=r.fn,a=r.options;"function"==typeof o&&(s=o({state:s,options:void 0===a?{}:a,name:r.name,instance:f})||s)}else s.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(t){f.forceUpdate(),t(s)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(o())}))}))),a}),destroy:function(){d(),c=!0}};if(!Mt(t,n))return f;function d(){u.forEach((function(t){return t()})),u=[]}return f.setOptions(i).then((function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)})),f}}var At=Et({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,e=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,u=H(n.elements.popper),c=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",e.update,rt)})),s&&u.addEventListener("resize",e.update,rt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",e.update,rt)})),s&&u.removeEventListener("resize",e.update,rt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state;n.modifiersData[t.name]=bt({reference:n.rects.reference,element:n.rects.popper,placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=t.options,i=e.gpuAcceleration,r=void 0===i||i,o=e.adaptive,a=void 0===o||o,s=e.roundOffsets,u=void 0===s||s,c={placement:I(n.placement),variation:nt(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,it(Object.assign({},c,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,it(Object.assign({},c,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach((function(t){var e=n.styles[t]||{},i=n.attributes[t]||{},r=n.elements[t];B(r)&&P(r)&&(Object.assign(r.style,e),Object.keys(i).forEach((function(t){var n=i[t];!1===n?r.removeAttribute(t):r.setAttribute(t,!0===n?"":n)})))}))},effect:function(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach((function(t){var i=n.elements[t],r=n.attributes[t]||{},o=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:e[t]).reduce((function(t,n){return t[n]="",t}),{});B(i)&&P(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,e=t.name,i=t.options.offset,r=void 0===i?[0,0]:i,o=S.reduce((function(t,e){return t[e]=function(t,n,e){var i=I(t),r=[x,y].indexOf(i)>=0?-1:1,o="function"==typeof e?e(Object.assign({},n,{placement:t})):e,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[x,g].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(e,n.rects,r),t}),{}),a=o[n.placement],s=a.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=a.x,n.modifiersData.popperOffsets.y+=s),n.modifiersData[e]=o}},wt,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name,r=e.mainAxis,o=void 0===r||r,a=e.altAxis,s=void 0!==a&&a,u=e.tether,c=void 0===u||u,f=e.tetherOffset,d=void 0===f?0:f,h=mt(n,{boundary:e.boundary,rootBoundary:e.rootBoundary,padding:e.padding,altBoundary:e.altBoundary}),l=I(n.placement),p=nt(n.placement),v=!p,b=Q(l),m="x"===b?"y":"x",O=n.modifiersData.popperOffsets,j=n.rects.reference,M=n.rects.popper,E="function"==typeof d?d(Object.assign({},n.rects,{placement:n.placement})):d,A="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,S={x:0,y:0};if(O){if(o){var L,P="y"===b?y:x,H="y"===b?w:g,W="y"===b?"height":"width",B=O[b],F=B+h[P],R=B-h[H],z=c?-M[W]/2:0,D=p===k?j[W]:M[W],V=p===k?-M[W]:-j[W],K=n.elements.arrow,U=c&&K?J(K):{width:0,height:0},Y=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=Y[P],_=Y[H],G=X(0,j[W],U[W]),$=v?j[W]/2-z-G-Z-A.mainAxis:D-G-Z-A.mainAxis,tt=v?-j[W]/2+z+G+_+A.mainAxis:V+G+_+A.mainAxis,et=n.elements.arrow&&N(n.elements.arrow),it=null!=(L=null==T?void 0:T[b])?L:0,rt=B+tt-it,ot=X(c?C(F,B+$-it-(et?"y"===b?et.clientTop||0:et.clientLeft||0:0)):F,B,c?q(R,rt):R);O[b]=ot,S[b]=ot-B}if(s){var at,st=O[m],ut="y"===m?"height":"width",ct=st+h["x"===b?y:x],ft=st-h["x"===b?w:g],dt=-1!==[y,x].indexOf(l),ht=null!=(at=null==T?void 0:T[m])?at:0,lt=dt?ct:st-j[ut]-M[ut]-ht+A.altAxis,pt=dt?st+j[ut]+M[ut]-ht-A.altAxis:ft,vt=c&&dt?function(t,n,e){var i=X(t,n,e);return i>e?e:i}(lt,st,pt):X(c?lt:ct,st,c?pt:ft);O[m]=vt,S[m]=vt-st}n.modifiersData[i]=S}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e=t.state,i=t.name,r=t.options,o=e.elements.arrow,a=e.modifiersData.popperOffsets,s=I(e.placement),u=Q(s),c=[x,g].indexOf(s)>=0?"height":"width";if(o&&a){var f=function(t,n){return $("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:tt(t,j))}(r.padding,e),d=J(o),h="y"===u?y:x,l="y"===u?w:g,p=e.rects.reference[c]+e.rects.reference[u]-a[u]-e.rects.popper[c],v=a[u]-e.rects.reference[u],b=N(o),m=b?"y"===u?b.clientHeight||0:b.clientWidth||0:0,O=m/2-d[c]/2+(p/2-v/2),k=X(f[h],O,m-d[c]-f[l]);e.modifiersData[i]=((n={})[u]=k,n.centerOffset=k-O,n)}},effect:function(t){var n=t.state,e=t.options.element,i=void 0===e?"[data-popper-arrow]":e;null!=i&&("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&K(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,e=t.name,i=n.rects.reference,r=n.rects.popper,o=n.modifiersData.preventOverflow,a=mt(n,{elementContext:"reference"}),s=mt(n,{altBoundary:!0}),u=gt(a,i),c=gt(s,r,o),f=xt(u),d=xt(c);n.modifiersData[e]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}}]});const Tt=t(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.opened=e(this,"opened",7),this.closed=e(this,"closed",7),this.inline=!1,this.placement="bottom-start",this.offset=[0,8],this.closing=!1,this.showing=this.inline||!1,this.positioned=!1,this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1,this.popperInstance=null,this.onKeyDown=t=>{"Escape"===t.code&&this.close()}}watchShowing(t){t||(this.destroyPopperInstance(),this.cleanupPortal()),this.positioned=!1}getAppendToElement(){return this.appendTo?"body"===this.appendTo?document.body:"string"==typeof this.appendTo?document.querySelector(this.appendTo):this.appendTo:null}setupPortal(){const t=this.getAppendToElement();t&&(this.originalParent=this.hostElement.parentElement,this.originalNextSibling=this.hostElement.nextSibling,this.isMovingPortal=!0,t.appendChild(this.hostElement),this.isMovingPortal=!1)}cleanupPortal(){this.isMovingPortal||this.originalParent&&(this.isMovingPortal=!0,this.originalNextSibling?this.originalParent.insertBefore(this.hostElement,this.originalNextSibling):this.originalParent.appendChild(this.hostElement),this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1)}createPopperInstance(){if(!this.triggerElement||!this.bodyRef)return;const t=!!this.appendTo,n=t?"viewport":"clippingParents";this.popperInstance=At(this.triggerElement,this.bodyRef,{placement:this.placement,strategy:t?"fixed":"absolute",modifiers:[{name:"offset",options:{offset:this.offset}},{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-end"],boundary:n}},{name:"preventOverflow",options:{boundary:n,altAxis:!0,padding:8}},{name:"computeStyles",options:{gpuAcceleration:!0}},{name:"applyStyles",enabled:!0}]}),this.popperInstance.forceUpdate(),this.positioned=!0}destroyPopperInstance(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null)}async open(){this.inline||(this.showing=!0,this.undo=m(this.el),this.opened.emit(void 0))}async close(){var t;this.inline||(this.showing=!1,this.closed.emit(void 0),null===(t=this.undo)||void 0===t||t.call(this),this.triggerElement&&this.triggerElement.focus())}disconnectedCallback(){this.isMovingPortal||(this.destroyPopperInstance(),this.cleanupPortal())}async getState(){return this.showing}async setTriggerElement(t){this.triggerElement=t}async updatePosition(){var t;await(null===(t=this.popperInstance)||void 0===t?void 0:t.update())}handleClick(t){var n;if(this.showing){const e=t.target;this.hostElement.contains(e)||(null===(n=this.triggerElement)||void 0===n?void 0:n.contains(e))||this.originalParent&&this.originalParent.contains(e)||this.close()}}render(){return i(r,{key:"086d18e9b2c4924a12bc7dffb47df846ffc66f2f",showing:this.showing,ref:t=>t&&(this.el=t)},!this.inline&&this.showing&&i("div",{key:"db2947e2f1a80b986fd815fbe3ee9c2cebc486c3",part:"body",ref:t=>{t&&(this.bodyRef=t,this.showing&&this.triggerElement&&!this.popperInstance&&(this.setupPortal(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.createPopperInstance()}))}))))},style:{visibility:this.positioned?"visible":"hidden"},onKeyDown:this.onKeyDown,role:"dialog",tabindex:-1,"aria-hidden":!this.showing,"aria-label":this.label,"aria-modal":this.showing},i("focus-trap",{key:"7801a9389dd510ad741b5edefdbdfb22f7beb29b"},i("div",{key:"9e54bb90bc8f2aa5fe928eb063c10a1d9c1e69c9",part:"content"},i("slot",{key:"42242c16758b365e489eaaae6267b540e19a6bb6"})))),this.inline&&i("div",{key:"fade4f7462beb49692ed196e74ecbc4971fb102d",part:"content"},i("slot",{key:"6c0c7f4c842965350bb1cac12be2042c135e2c64"})))}get hostElement(){return this}static get watchers(){return{showing:[{watchShowing:0}]}}static get style(){return":host::part(body){position:absolute;top:0;left:0;width:-moz-fit-content;width:fit-content;z-index:1200}:host::part(backdrop){}:host::part(content){}"}},[257,"tabworthy-dates-modal",{label:[1],inline:[4],placement:[1],offset:[16],appendTo:[1,"append-to"],closing:[32],showing:[32],positioned:[32],open:[64],close:[64],getState:[64],setTriggerElement:[64],updatePosition:[64]},[[10,"click","handleClick"]],{showing:[{watchShowing:0}]}]);function St(){"undefined"!=typeof customElements&&["tabworthy-dates-modal"].forEach((t=>{"tabworthy-dates-modal"===t&&(customElements.get(o(t))||customElements.define(o(t),Tt))}))}export{Tt as I,St as d}
1
+ import{p as t,H as n,c as e,h as i,d as r,t as o}from"./p-BiJ0HZVY.js";function a(t,n,e,i=20,r=0){let o=[];if(r>=i)return o;const s=t=>{const o=t.assignedNodes().filter((t=>1===t.nodeType));return o.length>0?a(o[0].parentElement,n,e,i,r+1):[]},u=Array.from(t.children||[]);for(const t of u)n(t)||(e(t)&&o.push(t),null!=t.shadowRoot?o.push(...a(t.shadowRoot,n,e,i,r+1)):"SLOT"===t.tagName?o.push(...s(t)):o.push(...a(t,n,e,i,r+1)));return o}function s(t){return t.hasAttribute("hidden")||t.hasAttribute("aria-hidden")&&"false"!==t.getAttribute("aria-hidden")||"none"===t.style.display||"0"===t.style.opacity||"hidden"===t.style.visibility||"collapse"===t.style.visibility}function u(t){return"-1"!==t.getAttribute("tabindex")&&!s(t)&&!function(t){return t.hasAttribute("disabled")||t.hasAttribute("aria-disabled")&&"false"!==t.getAttribute("aria-disabled")}(t)&&(t.hasAttribute("tabindex")||(t instanceof HTMLAnchorElement||t instanceof HTMLAreaElement)&&t.hasAttribute("href")||t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLIFrameElement)}const c=new Map,f=document.createElement("template");f.innerHTML='\n\t<div id="start"></div>\n\t<div id="backup"></div>\n\t<slot></slot>\n\t<div id="end"></div>\n';class d extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const t=this.attachShadow({mode:"open"});t.appendChild(f.content.cloneNode(!0)),this.$backup=t.querySelector("#backup"),this.$start=t.querySelector("#start"),this.$end=t.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(t){t?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return a(this,s,u)}trapFocus(t){if(this.inactive)return;let n=this.getFocusableElements();n.length>0?(t?n[n.length-1].focus():n[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(t){!function(t,n,e){const i=c.get(e);null!=i&&window.clearTimeout(i),c.set(e,window.setTimeout((()=>{t(),c.delete(e)}),0))}((()=>{this.focused!==t&&(this._focused=t,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}window.customElements.define("focus-trap",d);var h=new WeakMap,l=new WeakMap,p={},v=0,b=function(t){return t&&(t.host||b(t.parentNode))},m=function(t,n,e){void 0===e&&(e="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=function(t){return"undefined"==typeof document?null:(Array.isArray(t)?t[0]:t).ownerDocument.body}(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live]"))),function(t,n,e,i){var r=function(t,n){return n.map((function(n){if(t.contains(n))return n;var e=b(n);return e&&t.contains(e)?e:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)})).filter((function(t){return Boolean(t)}))}(n,Array.isArray(t)?t:[t]);p[e]||(p[e]=new WeakMap);var o=p[e],a=[],s=new Set,u=new Set(r),c=function(t){t&&!s.has(t)&&(s.add(t),c(t.parentNode))};r.forEach(c);var f=function(t){t&&!u.has(t)&&Array.prototype.forEach.call(t.children,(function(t){if(s.has(t))f(t);else{var n=t.getAttribute(i),r=null!==n&&"false"!==n,u=(h.get(t)||0)+1,c=(o.get(t)||0)+1;h.set(t,u),o.set(t,c),a.push(t),1===u&&r&&l.set(t,!0),1===c&&t.setAttribute(e,"true"),r||t.setAttribute(i,"true")}}))};return f(n),s.clear(),v++,function(){a.forEach((function(t){var n=h.get(t)-1,r=o.get(t)-1;h.set(t,n),o.set(t,r),n||(l.has(t)||t.removeAttribute(i),l.delete(t)),r||t.removeAttribute(e)})),--v||(h=new WeakMap,h=new WeakMap,l=new WeakMap,p={})}}(i,r,e,"aria-hidden")):function(){return null}},y="top",w="bottom",g="right",x="left",O="auto",j=[y,w,g,x],k="start",M="end",E="viewport",A="popper",T=j.reduce((function(t,n){return t.concat([n+"-"+k,n+"-"+M])}),[]),S=[].concat(j,[O]).reduce((function(t,n){return t.concat([n,n+"-"+k,n+"-"+M])}),[]),L=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function P(t){return t?(t.nodeName||"").toLowerCase():null}function H(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function W(t){return t instanceof H(t).Element||t instanceof Element}function B(t){return t instanceof H(t).HTMLElement||t instanceof HTMLElement}function F(t){return"undefined"!=typeof ShadowRoot&&(t instanceof H(t).ShadowRoot||t instanceof ShadowRoot)}function I(t){return t.split("-")[0]}var q=Math.max,C=Math.min,R=Math.round;function z(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function D(){return!/^((?!chrome|android).)*safari/i.test(z())}function V(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var i=t.getBoundingClientRect(),r=1,o=1;n&&B(t)&&(r=t.offsetWidth>0&&R(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&R(i.height)/t.offsetHeight||1);var a=(W(t)?H(t):window).visualViewport,s=!D()&&e,u=(i.left+(s&&a?a.offsetLeft:0))/r,c=(i.top+(s&&a?a.offsetTop:0))/o,f=i.width/r,d=i.height/o;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function J(t){var n=V(t),e=t.offsetWidth,i=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-i)<=1&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:i}}function K(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&F(e)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function U(t){return H(t).getComputedStyle(t)}function Y(t){return["table","td","th"].indexOf(P(t))>=0}function Z(t){return((W(t)?t.ownerDocument:t.document)||window.document).documentElement}function _(t){return"html"===P(t)?t:t.assignedSlot||t.parentNode||(F(t)?t.host:null)||Z(t)}function G(t){return B(t)&&"fixed"!==U(t).position?t.offsetParent:null}function N(t){for(var n=H(t),e=G(t);e&&Y(e)&&"static"===U(e).position;)e=G(e);return e&&("html"===P(e)||"body"===P(e)&&"static"===U(e).position)?n:e||function(t){var n=/firefox/i.test(z());if(/Trident/i.test(z())&&B(t)&&"fixed"===U(t).position)return null;var e=_(t);for(F(e)&&(e=e.host);B(e)&&["html","body"].indexOf(P(e))<0;){var i=U(e);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return e;e=e.parentNode}return null}(t)||n}function Q(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function X(t,n,e){return q(t,C(n,e))}function $(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function tt(t,n){return n.reduce((function(n,e){return n[e]=t,n}),{})}function nt(t){return t.split("-")[1]}var et={top:"auto",right:"auto",bottom:"auto",left:"auto"};function it(t){var n,e=t.popper,i=t.popperRect,r=t.placement,o=t.variation,a=t.offsets,s=t.position,u=t.gpuAcceleration,c=t.adaptive,f=t.roundOffsets,d=t.isFixed,h=a.x,l=void 0===h?0:h,p=a.y,v=void 0===p?0:p,b="function"==typeof f?f({x:l,y:v}):{x:l,y:v};l=b.x,v=b.y;var m=a.hasOwnProperty("x"),O=a.hasOwnProperty("y"),j=x,k=y,E=window;if(c){var A=N(e),T="clientHeight",S="clientWidth";A===H(e)&&"static"!==U(A=Z(e)).position&&"absolute"===s&&(T="scrollHeight",S="scrollWidth"),(r===y||(r===x||r===g)&&o===M)&&(k=w,v-=(d&&A===E&&E.visualViewport?E.visualViewport.height:A[T])-i.height,v*=u?1:-1),r!==x&&(r!==y&&r!==w||o!==M)||(j=g,l-=(d&&A===E&&E.visualViewport?E.visualViewport.width:A[S])-i.width,l*=u?1:-1)}var L,P=Object.assign({position:s},c&&et),W=!0===f?function(t,n){var e=t.y,i=n.devicePixelRatio||1;return{x:R(t.x*i)/i||0,y:R(e*i)/i||0}}({x:l,y:v},H(e)):{x:l,y:v};return l=W.x,v=W.y,Object.assign({},P,u?((L={})[k]=O?"0":"",L[j]=m?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+l+"px, "+v+"px)":"translate3d("+l+"px, "+v+"px, 0)",L):((n={})[k]=O?v+"px":"",n[j]=m?l+"px":"",n.transform="",n))}var rt={passive:!0},ot={left:"right",right:"left",bottom:"top",top:"bottom"};function at(t){return t.replace(/left|right|bottom|top/g,(function(t){return ot[t]}))}var st={start:"end",end:"start"};function ut(t){return t.replace(/start|end/g,(function(t){return st[t]}))}function ct(t){var n=H(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function ft(t){return V(Z(t)).left+ct(t).scrollLeft}function dt(t){var n=U(t);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function ht(t){return["html","body","#document"].indexOf(P(t))>=0?t.ownerDocument.body:B(t)&&dt(t)?t:ht(_(t))}function lt(t,n){var e;void 0===n&&(n=[]);var i=ht(t),r=i===(null==(e=t.ownerDocument)?void 0:e.body),o=H(i),a=r?[o].concat(o.visualViewport||[],dt(i)?i:[]):i,s=n.concat(a);return r?s:s.concat(lt(_(a)))}function pt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function vt(t,n,e){return n===E?pt(function(t,n){var e=H(t),i=Z(t),r=e.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,u=0;if(r){o=r.width,a=r.height;var c=D();(c||!c&&"fixed"===n)&&(s=r.offsetLeft,u=r.offsetTop)}return{width:o,height:a,x:s+ft(t),y:u}}(t,e)):W(n)?function(t,n){var e=V(t,!1,"fixed"===n);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(n,e):pt(function(t){var n,e=Z(t),i=ct(t),r=null==(n=t.ownerDocument)?void 0:n.body,o=q(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=q(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+ft(t),u=-i.scrollTop;return"rtl"===U(r||e).direction&&(s+=q(e.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}(Z(t)))}function bt(t){var n,e=t.reference,i=t.element,r=t.placement,o=r?I(r):null,a=r?nt(r):null,s=e.x+e.width/2-i.width/2,u=e.y+e.height/2-i.height/2;switch(o){case y:n={x:s,y:e.y-i.height};break;case w:n={x:s,y:e.y+e.height};break;case g:n={x:e.x+e.width,y:u};break;case x:n={x:e.x-i.width,y:u};break;default:n={x:e.x,y:e.y}}var c=o?Q(o):null;if(null!=c){var f="y"===c?"height":"width";switch(a){case k:n[c]=n[c]-(e[f]/2-i[f]/2);break;case M:n[c]=n[c]+(e[f]/2-i[f]/2)}}return n}function mt(t,n){void 0===n&&(n={});var e=n.placement,i=void 0===e?t.placement:e,r=n.strategy,o=void 0===r?t.strategy:r,a=n.boundary,s=void 0===a?"clippingParents":a,u=n.rootBoundary,c=void 0===u?E:u,f=n.elementContext,d=void 0===f?A:f,h=n.altBoundary,l=void 0!==h&&h,p=n.padding,v=void 0===p?0:p,b=$("number"!=typeof v?v:tt(v,j)),m=t.rects.popper,x=t.elements[l?d===A?"reference":A:d],O=function(t,n,e,i){var r="clippingParents"===n?function(t){var n=lt(_(t)),e=["absolute","fixed"].indexOf(U(t).position)>=0&&B(t)?N(t):t;return W(e)?n.filter((function(t){return W(t)&&K(t,e)&&"body"!==P(t)})):[]}(t):[].concat(n),o=[].concat(r,[e]),a=o.reduce((function(n,e){var r=vt(t,e,i);return n.top=q(r.top,n.top),n.right=C(r.right,n.right),n.bottom=C(r.bottom,n.bottom),n.left=q(r.left,n.left),n}),vt(t,o[0],i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(W(x)?x:x.contextElement||Z(t.elements.popper),s,c,o),k=V(t.elements.reference),M=bt({reference:k,element:m,placement:i}),T=pt(Object.assign({},m,M)),S=d===A?T:k,L={top:O.top-S.top+b.top,bottom:S.bottom-O.bottom+b.bottom,left:O.left-S.left+b.left,right:S.right-O.right+b.right},H=t.modifiersData.offset;if(d===A&&H){var F=H[i];Object.keys(L).forEach((function(t){var n=[g,w].indexOf(t)>=0?1:-1,e=[y,w].indexOf(t)>=0?"y":"x";L[t]+=F[e]*n}))}return L}function yt(t,n){void 0===n&&(n={});var e=n.boundary,i=n.rootBoundary,r=n.padding,o=n.flipVariations,a=n.allowedAutoPlacements,s=void 0===a?S:a,u=nt(n.placement),c=u?o?T:T.filter((function(t){return nt(t)===u})):j,f=c.filter((function(t){return s.indexOf(t)>=0}));0===f.length&&(f=c);var d=f.reduce((function(n,o){return n[o]=mt(t,{placement:o,boundary:e,rootBoundary:i,padding:r})[I(o)],n}),{});return Object.keys(d).sort((function(t,n){return d[t]-d[n]}))}var wt={name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var r=e.mainAxis,o=void 0===r||r,a=e.altAxis,s=void 0===a||a,u=e.fallbackPlacements,c=e.padding,f=e.boundary,d=e.rootBoundary,h=e.altBoundary,l=e.flipVariations,p=void 0===l||l,v=e.allowedAutoPlacements,b=n.options.placement,m=I(b),j=u||(m!==b&&p?function(t){if(I(t)===O)return[];var n=at(t);return[ut(t),n,ut(n)]}(b):[at(b)]),M=[b].concat(j).reduce((function(t,e){return t.concat(I(e)===O?yt(n,{placement:e,boundary:f,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:v}):e)}),[]),E=n.rects.reference,A=n.rects.popper,T=new Map,S=!0,L=M[0],P=0;P<M.length;P++){var H=M[P],W=I(H),B=nt(H)===k,F=[y,w].indexOf(W)>=0,q=F?"width":"height",C=mt(n,{placement:H,boundary:f,rootBoundary:d,altBoundary:h,padding:c}),R=F?B?g:x:B?w:y;E[q]>A[q]&&(R=at(R));var z=at(R),D=[];if(o&&D.push(C[W]<=0),s&&D.push(C[R]<=0,C[z]<=0),D.every((function(t){return t}))){L=H,S=!1;break}T.set(H,D)}if(S)for(var V=function(t){var n=M.find((function(n){var e=T.get(n);if(e)return e.slice(0,t).every((function(t){return t}))}));if(n)return L=n,"break"},J=p?3:1;J>0&&"break"!==V(J);J--);n.placement!==L&&(n.modifiersData[i]._skip=!0,n.placement=L,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function gt(t,n,e){return void 0===e&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function xt(t){return[y,g,w,x].some((function(n){return t[n]>=0}))}function Ot(t,n,e){void 0===e&&(e=!1);var i,r,o=B(n),a=B(n)&&function(t){var n=t.getBoundingClientRect(),e=R(n.width)/t.offsetWidth||1,i=R(n.height)/t.offsetHeight||1;return 1!==e||1!==i}(n),s=Z(n),u=V(t,a,e),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(o||!o&&!e)&&(("body"!==P(n)||dt(s))&&(c=(i=n)!==H(i)&&B(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:ct(i)),B(n)?((f=V(n,!0)).x+=n.clientLeft,f.y+=n.clientTop):s&&(f.x=ft(s))),{x:u.left+c.scrollLeft-f.x,y:u.top+c.scrollTop-f.y,width:u.width,height:u.height}}function jt(t){var n=new Map,e=new Set,i=[];function r(t){e.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!e.has(t)){var i=n.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){e.has(t.name)||r(t)})),i}var kt={placement:"bottom",modifiers:[],strategy:"absolute"};function Mt(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Et(t){void 0===t&&(t={});var n=t.defaultModifiers,e=void 0===n?[]:n,i=t.defaultOptions,r=void 0===i?kt:i;return function(t,n,i){void 0===i&&(i=r);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},kt,r),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],c=!1,f={state:s,setOptions:function(i){var o="function"==typeof i?i(s.options):i;d(),s.options=Object.assign({},r,s.options,o),s.scrollParents={reference:W(t)?lt(t):t.contextElement?lt(t.contextElement):[],popper:lt(n)};var a,c,h=function(t){var n=jt(t);return L.reduce((function(t,e){return t.concat(n.filter((function(t){return t.phase===e})))}),[])}((a=[].concat(e,s.options.modifiers),c=a.reduce((function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return s.orderedModifiers=h.filter((function(t){return t.enabled})),s.orderedModifiers.forEach((function(t){var n=t.options,e=t.effect;if("function"==typeof e){var i=e({state:s,name:t.name,instance:f,options:void 0===n?{}:n});u.push(i||function(){})}})),f.update()},forceUpdate:function(){if(!c){var t=s.elements,n=t.reference,e=t.popper;if(Mt(n,e)){s.rects={reference:Ot(n,N(e),"fixed"===s.options.strategy),popper:J(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(t){return s.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<s.orderedModifiers.length;i++)if(!0!==s.reset){var r=s.orderedModifiers[i],o=r.fn,a=r.options;"function"==typeof o&&(s=o({state:s,options:void 0===a?{}:a,name:r.name,instance:f})||s)}else s.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(t){f.forceUpdate(),t(s)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(o())}))}))),a}),destroy:function(){d(),c=!0}};if(!Mt(t,n))return f;function d(){u.forEach((function(t){return t()})),u=[]}return f.setOptions(i).then((function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)})),f}}var At=Et({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,e=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,u=H(n.elements.popper),c=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",e.update,rt)})),s&&u.addEventListener("resize",e.update,rt),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",e.update,rt)})),s&&u.removeEventListener("resize",e.update,rt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state;n.modifiersData[t.name]=bt({reference:n.rects.reference,element:n.rects.popper,placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=t.options,i=e.gpuAcceleration,r=void 0===i||i,o=e.adaptive,a=void 0===o||o,s=e.roundOffsets,u=void 0===s||s,c={placement:I(n.placement),variation:nt(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,it(Object.assign({},c,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,it(Object.assign({},c,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach((function(t){var e=n.styles[t]||{},i=n.attributes[t]||{},r=n.elements[t];B(r)&&P(r)&&(Object.assign(r.style,e),Object.keys(i).forEach((function(t){var n=i[t];!1===n?r.removeAttribute(t):r.setAttribute(t,!0===n?"":n)})))}))},effect:function(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach((function(t){var i=n.elements[t],r=n.attributes[t]||{},o=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:e[t]).reduce((function(t,n){return t[n]="",t}),{});B(i)&&P(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,e=t.name,i=t.options.offset,r=void 0===i?[0,0]:i,o=S.reduce((function(t,e){return t[e]=function(t,n,e){var i=I(t),r=[x,y].indexOf(i)>=0?-1:1,o="function"==typeof e?e(Object.assign({},n,{placement:t})):e,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[x,g].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(e,n.rects,r),t}),{}),a=o[n.placement],s=a.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=a.x,n.modifiersData.popperOffsets.y+=s),n.modifiersData[e]=o}},wt,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name,r=e.mainAxis,o=void 0===r||r,a=e.altAxis,s=void 0!==a&&a,u=e.tether,c=void 0===u||u,f=e.tetherOffset,d=void 0===f?0:f,h=mt(n,{boundary:e.boundary,rootBoundary:e.rootBoundary,padding:e.padding,altBoundary:e.altBoundary}),l=I(n.placement),p=nt(n.placement),v=!p,b=Q(l),m="x"===b?"y":"x",O=n.modifiersData.popperOffsets,j=n.rects.reference,M=n.rects.popper,E="function"==typeof d?d(Object.assign({},n.rects,{placement:n.placement})):d,A="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,S={x:0,y:0};if(O){if(o){var L,P="y"===b?y:x,H="y"===b?w:g,W="y"===b?"height":"width",B=O[b],F=B+h[P],R=B-h[H],z=c?-M[W]/2:0,D=p===k?j[W]:M[W],V=p===k?-M[W]:-j[W],K=n.elements.arrow,U=c&&K?J(K):{width:0,height:0},Y=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=Y[P],_=Y[H],G=X(0,j[W],U[W]),$=v?j[W]/2-z-G-Z-A.mainAxis:D-G-Z-A.mainAxis,tt=v?-j[W]/2+z+G+_+A.mainAxis:V+G+_+A.mainAxis,et=n.elements.arrow&&N(n.elements.arrow),it=null!=(L=null==T?void 0:T[b])?L:0,rt=B+tt-it,ot=X(c?C(F,B+$-it-(et?"y"===b?et.clientTop||0:et.clientLeft||0:0)):F,B,c?q(R,rt):R);O[b]=ot,S[b]=ot-B}if(s){var at,st=O[m],ut="y"===m?"height":"width",ct=st+h["x"===b?y:x],ft=st-h["x"===b?w:g],dt=-1!==[y,x].indexOf(l),ht=null!=(at=null==T?void 0:T[m])?at:0,lt=dt?ct:st-j[ut]-M[ut]-ht+A.altAxis,pt=dt?st+j[ut]+M[ut]-ht-A.altAxis:ft,vt=c&&dt?function(t,n,e){var i=X(t,n,e);return i>e?e:i}(lt,st,pt):X(c?lt:ct,st,c?pt:ft);O[m]=vt,S[m]=vt-st}n.modifiersData[i]=S}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e=t.state,i=t.name,r=t.options,o=e.elements.arrow,a=e.modifiersData.popperOffsets,s=I(e.placement),u=Q(s),c=[x,g].indexOf(s)>=0?"height":"width";if(o&&a){var f=function(t,n){return $("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:tt(t,j))}(r.padding,e),d=J(o),h="y"===u?y:x,l="y"===u?w:g,p=e.rects.reference[c]+e.rects.reference[u]-a[u]-e.rects.popper[c],v=a[u]-e.rects.reference[u],b=N(o),m=b?"y"===u?b.clientHeight||0:b.clientWidth||0:0,O=m/2-d[c]/2+(p/2-v/2),k=X(f[h],O,m-d[c]-f[l]);e.modifiersData[i]=((n={})[u]=k,n.centerOffset=k-O,n)}},effect:function(t){var n=t.state,e=t.options.element,i=void 0===e?"[data-popper-arrow]":e;null!=i&&("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&K(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,e=t.name,i=n.rects.reference,r=n.rects.popper,o=n.modifiersData.preventOverflow,a=mt(n,{elementContext:"reference"}),s=mt(n,{altBoundary:!0}),u=gt(a,i),c=gt(s,r,o),f=xt(u),d=xt(c);n.modifiersData[e]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}}]});const Tt=t(class extends n{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.opened=e(this,"opened",7),this.closed=e(this,"closed",7),this.inline=!1,this.placement="bottom-start",this.offset=[0,8],this.closing=!1,this.showing=this.inline||!1,this.positioned=!1,this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1,this.popperInstance=null,this.onKeyDown=t=>{"Escape"===t.code&&this.close()}}watchShowing(t){t||(this.destroyPopperInstance(),this.cleanupPortal()),this.positioned=!1}getAppendToElement(){return this.appendTo?"body"===this.appendTo?document.body:"string"==typeof this.appendTo?document.querySelector(this.appendTo):this.appendTo:null}setupPortal(){const t=this.getAppendToElement();t&&(this.originalParent=this.hostElement.parentElement,this.originalNextSibling=this.hostElement.nextSibling,this.isMovingPortal=!0,t.appendChild(this.hostElement),this.isMovingPortal=!1)}cleanupPortal(){this.isMovingPortal||this.originalParent&&(this.isMovingPortal=!0,this.originalNextSibling?this.originalParent.insertBefore(this.hostElement,this.originalNextSibling):this.originalParent.appendChild(this.hostElement),this.originalParent=null,this.originalNextSibling=null,this.isMovingPortal=!1)}createPopperInstance(){if(!this.triggerElement||!this.bodyRef)return;const t=!!this.appendTo,n=t?"viewport":"clippingParents";this.popperInstance=At(this.triggerElement,this.bodyRef,{placement:this.placement,strategy:t?"fixed":"absolute",modifiers:[{name:"offset",options:{offset:this.offset}},{name:"flip",options:{fallbackPlacements:["top-start","top-end","bottom-end"],boundary:n}},{name:"preventOverflow",options:{boundary:n,altAxis:!0,padding:8}},{name:"computeStyles",options:{gpuAcceleration:!0}},{name:"applyStyles",enabled:!0}]}),this.popperInstance.forceUpdate(),this.positioned=!0}destroyPopperInstance(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null)}async open(){this.inline||(this.showing=!0,this.undo=m(this.el),this.opened.emit(void 0))}async close(){var t;this.inline||(this.showing=!1,this.closed.emit(void 0),null===(t=this.undo)||void 0===t||t.call(this),this.triggerElement&&this.triggerElement.focus())}disconnectedCallback(){this.isMovingPortal||(this.destroyPopperInstance(),this.cleanupPortal())}async getState(){return this.showing}async setTriggerElement(t){this.triggerElement=t}async updatePosition(){var t;await(null===(t=this.popperInstance)||void 0===t?void 0:t.update())}handleClick(t){var n;if(this.showing){const e=t.target;this.hostElement.contains(e)||(null===(n=this.triggerElement)||void 0===n?void 0:n.contains(e))||this.originalParent&&this.originalParent.contains(e)||this.close()}}render(){return i(r,{key:"bf48e957915fbc2975d7ba2f2ca6844e2c14270e",showing:this.showing,ref:t=>t&&(this.el=t)},!this.inline&&this.showing&&i("div",{key:"87fd577d1289e3c6f888b614d127e729003b1fe6",part:"body",ref:t=>{t&&(this.bodyRef=t,this.showing&&this.triggerElement&&!this.popperInstance&&(this.setupPortal(),requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.createPopperInstance()}))}))))},style:{visibility:this.positioned?"visible":"hidden"},onKeyDown:this.onKeyDown,role:"dialog",tabindex:-1,"aria-hidden":!this.showing,"aria-label":this.label,"aria-modal":this.showing},i("focus-trap",{key:"5f994a20957137ce8e95d17191cb9436ae4c2315"},i("div",{key:"6ab5e6990d04e9e6b0905971b52b33410608759e",part:"content"},i("slot",{key:"9d99fbd7f47ee014277fe4493f86a90b3929103c"})))),this.inline&&i("div",{key:"fc1766214d1727cc2865a17da6661f06bd67429f",part:"content"},i("slot",{key:"28d41dba4356ce3bd0aa7db06943296de4372695"})))}get hostElement(){return this}static get watchers(){return{showing:[{watchShowing:0}]}}static get style(){return":host::part(body){position:absolute;top:0;left:0;width:-moz-fit-content;width:fit-content;z-index:1200}:host::part(backdrop){}:host::part(content){}"}},[257,"tabworthy-dates-modal",{label:[1],inline:[4],placement:[1],offset:[16],appendTo:[1,"append-to"],closing:[32],showing:[32],positioned:[32],open:[64],close:[64],getState:[64],setTriggerElement:[64],updatePosition:[64]},[[10,"click","handleClick"]],{showing:[{watchShowing:0}]}]);function St(){"undefined"!=typeof customElements&&["tabworthy-dates-modal"].forEach((t=>{"tabworthy-dates-modal"===t&&(customElements.get(o(t))||customElements.define(o(t),Tt))}))}export{Tt as I,St as d}
@@ -0,0 +1 @@
1
+ import{p as t,H as e,c as s,h as i,d as h,t as a}from"./p-BiJ0HZVY.js";const n={hours:"Hours",minutes:"Minutes",seconds:"Seconds",am:"AM",pm:"PM",timePicker:"Time picker",incrementHours:"Increment hours",decrementHours:"Decrement hours",incrementMinutes:"Increment minutes",decrementMinutes:"Decrement minutes",incrementSeconds:"Increment seconds",decrementSeconds:"Decrement seconds"},c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.timeChanged=s(this,"timeChanged",7),this.hours=12,this.minutes=0,this.seconds=0,this.useTwelveHourFormat=!1,this.showSeconds=!1,this.labels=n,this.labelsSrOnly=!0,this.disabled=!1,this.elementClassName="tabworthy-times-picker",this.internalHours=this.hours,this.internalMinutes=this.minutes,this.internalSeconds=this.seconds,this.period=this.hours>=12?"PM":"AM",this.handleHourChange=t=>{const e=parseInt(t.target.value,10);this.internalHours=this.useTwelveHourFormat?"AM"===this.period?12===e?0:e:12===e?12:e+12:e,this.emitTimeChange()},this.handleMinuteChange=t=>{this.internalMinutes=parseInt(t.target.value,10),this.emitTimeChange()},this.handlePeriodChange=t=>{if(this.period===t||!this.useTwelveHourFormat)return;this.period=t;const e=this.getDisplayHours();this.internalHours="AM"===t?12===e?0:e:12===e?12:e+12,this.emitTimeChange()},this.handleHourIncrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),e=12===t?1:t+1;this.internalHours="AM"===this.period?12===e?0:e:12===e?12:e+12}else this.internalHours=(this.internalHours+1)%24;this.emitTimeChange()},this.handleHourDecrement=()=>{if(this.useTwelveHourFormat){const t=this.getDisplayHours(),e=1===t?12:t-1;this.internalHours="AM"===this.period?12===e?0:e:12===e?12:e+12}else this.internalHours=0===this.internalHours?23:this.internalHours-1;this.emitTimeChange()},this.handleMinuteIncrement=()=>{this.internalMinutes=(this.internalMinutes+1)%60,this.emitTimeChange()},this.handleMinuteDecrement=()=>{this.internalMinutes=0===this.internalMinutes?59:this.internalMinutes-1,this.emitTimeChange()},this.handleSecondChange=t=>{this.internalSeconds=parseInt(t.target.value,10),this.emitTimeChange()},this.handleSecondIncrement=()=>{this.internalSeconds=(this.internalSeconds+1)%60,this.emitTimeChange()},this.handleSecondDecrement=()=>{this.internalSeconds=0===this.internalSeconds?59:this.internalSeconds-1,this.emitTimeChange()}}watchHours(t){this.internalHours=t,this.period=t>=12?"PM":"AM"}watchMinutes(t){this.internalMinutes=t}watchSeconds(t){this.internalSeconds=t}componentWillLoad(){this.internalHours=this.hours,this.internalMinutes=this.minutes,this.internalSeconds=this.seconds,this.period=this.hours>=12?"PM":"AM"}getDisplayHours(){return this.useTwelveHourFormat?0===this.internalHours?12:this.internalHours>12?this.internalHours-12:this.internalHours:this.internalHours}get24HourValue(){if(!this.useTwelveHourFormat)return this.internalHours;const t=this.getDisplayHours();return"AM"===this.period?12===t?0:t:12===t?12:t+12}emitTimeChange(){this.timeChanged.emit({hours:this.get24HourValue(),minutes:this.internalMinutes,seconds:this.showSeconds?this.internalSeconds:void 0,period:this.useTwelveHourFormat?this.period:void 0})}padZero(t){return t.toString().padStart(2,"0")}render(){const t=this.getDisplayHours(),e=this.useTwelveHourFormat?12:23,s=this.useTwelveHourFormat?1:0;return i(h,{key:"be075e309d41904bf237c3a4b31b063ac4d1a7e0",class:this.elementClassName,"aria-label":this.labels.timePicker},i("div",{key:"39d3a55428ad6f567490aa9a55ab94766de39e7f",class:`${this.elementClassName}__container`},i("div",{key:"5efcc6b13a4473d5d889689d205128b328ae9417",class:`${this.elementClassName}__field`},i("label",{key:"f2e760229dd54d2265539e924dc133eda7f53fb8",htmlFor:`${this.elementClassName}-hours`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.hours),i("div",{key:"a1f92371d923c50adb423d8fa36d84fe632fcdcb",class:`${this.elementClassName}__control`},i("button",{key:"ce1a13d5d97f664cd5a7ef9ac144cb2d7a76b0e3",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleHourIncrement,disabled:this.disabled,"aria-label":this.labels.incrementHours},i("svg",{key:"9f4f27bc5e3ecc1da7f9520c5a67bef79b546229",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"2537a3c151f846b52f427bff20145dd581b2db7b",points:"18 15 12 9 6 15"}))),i("input",{key:"dbe3c7e05bf44f2942f38e397fa8abcd5ec9a080",id:`${this.elementClassName}-hours`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(t),min:s,max:e,onInput:this.handleHourChange,disabled:this.disabled,"aria-label":this.labels.hours}),i("button",{key:"69e610902e8324369a57f5943699f019533f9b0a",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleHourDecrement,disabled:this.disabled,"aria-label":this.labels.decrementHours},i("svg",{key:"fd3a91c8c82abb4ba948c1735a4d6b1ab9879452",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"f2fb31860bc57fe95b78e0331d4dce611976f1cc",points:"6 9 12 15 18 9"}))))),i("div",{key:"5f488705145ebbaaba10f7e0370dd614e5ac9c91",class:`${this.elementClassName}__separator`},":"),i("div",{key:"c886bc72ad9098a1015d97cdb64d609d10b4b7c0",class:`${this.elementClassName}__field`},i("label",{key:"3590285320f4ee5403e41cceb964aa2440ee3caa",htmlFor:`${this.elementClassName}-minutes`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.minutes),i("div",{key:"0e4271bc5e35b9664ef599af056c997a0b09c64f",class:`${this.elementClassName}__control`},i("button",{key:"29d095829fb141f2f2495a5cbc4bb7f28f39b54b",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleMinuteIncrement,disabled:this.disabled,"aria-label":this.labels.incrementMinutes},i("svg",{key:"683cb78389935a9a68e59d875df60dc168ca5a4b",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"21084833e0479ace54ee23b2b9a39276752d6467",points:"18 15 12 9 6 15"}))),i("input",{key:"07d608da760816c37ae394fe5798ad25ca0c17db",id:`${this.elementClassName}-minutes`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(this.internalMinutes),min:0,max:59,onInput:this.handleMinuteChange,disabled:this.disabled,"aria-label":this.labels.minutes}),i("button",{key:"07aee6f5f9b6cfe23fa50ae9ad2319f627c9efe2",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleMinuteDecrement,disabled:this.disabled,"aria-label":this.labels.decrementMinutes},i("svg",{key:"3e284e93b451ab57b0c4e0a29b8c3953f5a79033",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"589c1da5150f4b3def68b9dcb14f2ee56b9022e2",points:"6 9 12 15 18 9"}))))),this.showSeconds&&[i("div",{key:"717844859ad07d5912fdd0b386151aeb40ccbf94",class:`${this.elementClassName}__separator`},":"),i("div",{key:"a27907f31a3d71abb9f7c5bce411569ddd22594d",class:`${this.elementClassName}__field`},i("label",{key:"c6312aeccdfe835aa0bd02bc7078b4a30aa70921",htmlFor:`${this.elementClassName}-seconds`,class:{[`${this.elementClassName}__label`]:!0,[`${this.elementClassName}__label--sr-only`]:this.labelsSrOnly}},this.labels.seconds),i("div",{key:"c347d3847e999a900cba2410dbc2c5711d01d746",class:`${this.elementClassName}__control`},i("button",{key:"b0862893f9d99e6ef7da0cfc02f6a6e1f0bc4443",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--increment`,onClick:this.handleSecondIncrement,disabled:this.disabled,"aria-label":this.labels.incrementSeconds},i("svg",{key:"b4032699911ed9e589c015b4c3b9d31766b53d38",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"5bfbeefa5ea9d4901a7bc08de5bf01578fbf6cec",points:"18 15 12 9 6 15"}))),i("input",{key:"3c7e4e5b4f7a162e9ce9efa815d1c180ff5395d2",id:`${this.elementClassName}-seconds`,type:"number",class:`${this.elementClassName}__input`,value:this.padZero(this.internalSeconds),min:0,max:59,onInput:this.handleSecondChange,disabled:this.disabled,"aria-label":this.labels.seconds}),i("button",{key:"6f5a37921ef128033fe8241b63903739f0ddc245",type:"button",class:`${this.elementClassName}__button ${this.elementClassName}__button--decrement`,onClick:this.handleSecondDecrement,disabled:this.disabled,"aria-label":this.labels.decrementSeconds},i("svg",{key:"5c24cc5df194f53889ec353a5527c239df94a380",fill:"none",height:"16","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"16"},i("polyline",{key:"090946e452acf54e8bc491094573368160f55cbe",points:"6 9 12 15 18 9"})))))],this.useTwelveHourFormat&&i("div",{key:"4bbd646f21dc099efc94e86b05ce35e22c28ee16",class:`${this.elementClassName}__period`},i("button",{key:"3b41814b8fe32ffe3ef898fe816cc027440c6c2b",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"AM"===this.period},onClick:()=>this.handlePeriodChange("AM"),disabled:this.disabled,"aria-label":this.labels.am,"aria-pressed":"AM"===this.period},this.labels.am),i("button",{key:"fd9052000876c0516e13ab701a4e5164a7d72112",type:"button",class:{[`${this.elementClassName}__period-button`]:!0,[`${this.elementClassName}__period-button--active`]:"PM"===this.period},onClick:()=>this.handlePeriodChange("PM"),disabled:this.disabled,"aria-label":this.labels.pm,"aria-pressed":"PM"===this.period},this.labels.pm))))}get el(){return this}static get watchers(){return{hours:[{watchHours:0}],minutes:[{watchMinutes:0}],seconds:[{watchSeconds:0}]}}},[2,"tabworthy-times-picker",{hours:[1026],minutes:[1026],seconds:[1026],useTwelveHourFormat:[4,"use-twelve-hour-format"],showSeconds:[4,"show-seconds"],labels:[16],labelsSrOnly:[4,"labels-sr-only"],disabled:[4],elementClassName:[1,"element-class-name"],internalHours:[32],internalMinutes:[32],internalSeconds:[32],period:[32]},void 0,{hours:[{watchHours:0}],minutes:[{watchMinutes:0}],seconds:[{watchSeconds:0}]}]);function o(){"undefined"!=typeof customElements&&["tabworthy-times-picker"].forEach((t=>{"tabworthy-times-picker"===t&&(customElements.get(a(t))||customElements.define(a(t),c))}))}export{c as T,o as d}
@@ -1 +1 @@
1
- import{I as o,d as p}from"./p-D0CX07Ep.js";const s=o,r=p;export{s as TabworthyDatesModal,r as defineCustomElement}
1
+ import{I as o,d as s}from"./p-CIQgnOXj.js";const p=o,r=s;export{p as TabworthyDatesModal,r as defineCustomElement}