@justeattakeaway/pie-button 0.31.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,22 +1,21 @@
1
- import { unsafeCSS as g, LitElement as f, html as p, nothing as h } from "lit";
2
- import { property as c } from "lit/decorators.js";
3
- const b = (v, r, t) => function(o, e) {
4
- const i = `#${e}`;
5
- Object.defineProperty(o, e, {
1
+ import { unsafeCSS as wt, LitElement as Et, html as R, nothing as ot } from "lit";
2
+ import { property as f } from "lit/decorators.js";
3
+ const N = (v, c, a) => function(m, y) {
4
+ const b = `#${y}`;
5
+ Object.defineProperty(m, y, {
6
6
  get() {
7
- return this[i];
7
+ return this[b];
8
8
  },
9
- set(l) {
10
- const m = this[i];
11
- r.includes(l) ? this[i] = l : (console.error(
12
- `<${v}> Invalid value "${l}" provided for property "${e}".`,
13
- `Must be one of: ${r.join(" | ")}.`,
14
- `Falling back to default value: "${t}"`
15
- ), this[i] = t), this.requestUpdate(e, m);
9
+ set(h) {
10
+ const A = this[b];
11
+ c.includes(h) ? this[b] = h : (console.error(
12
+ `<${v}> Invalid value "${h}" provided for property "${y}".`,
13
+ `Must be one of: ${c.join(" | ")}.`,
14
+ `Falling back to default value: "${a}"`
15
+ ), this[b] = a), this.requestUpdate(y, A);
16
16
  }
17
17
  });
18
- }, u = `*,*:before,*:after{box-sizing:border-box}@keyframes rotate360{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.o-btn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-m-family);--btn-font-weight: var(--dt-font-interactive-m-weight);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--btn-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-primary);--btn-icon-size: 24px;--spinner-size-s: 20px;--spinner-size-m: 24px;--spinner-border-width-s: 2.5px;--spinner-border-width-m: 3px;--spinner-size: var(--spinner-size-m);--spinner-border-width: var(--spinner-border-width-m);--spinner-base-color-h: var(--dt-color-content-interactive-primary-h);--spinner-base-color-s: var(--dt-color-content-interactive-primary-s);--spinner-base-color-l: var(--dt-color-content-interactive-primary-l);--spinner-left-color-opacity: .35;--spinner-left-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), var(--spinner-left-color-opacity));--spinner-right-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), 1);--spinner-animation-duration: 1.15s;--spinner-animation-timing-function: linear;--spinner-animation-iteration-count: infinite;position:relative;display:flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;box-sizing:border-box;padding:var(--btn-padding);border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-bg-color);font-family:var(--btn-font-family);font-size:var(--btn-font-size);font-weight:var(--btn-font-weight);color:var(--btn-text-color);line-height:var(--btn-line-height);cursor:pointer;user-select:none;inline-size:var(--btn-inline-size)}.o-btn[variant=primary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.o-btn[variant=primary]:active:not(:disabled),.o-btn[variant=primary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}.o-btn[variant=primary][size=xsmall],.o-btn[variant=primary][size=small-productive]{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn[variant=primary][size=xsmall]:hover:not(:disabled),.o-btn[variant=primary][size=small-productive]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--hover-modifier)))}.o-btn[variant=primary][size=xsmall]:active:not(:disabled),.o-btn[variant=primary][size=xsmall][isLoading]:not(:disabled),.o-btn[variant=primary][size=small-productive]:active:not(:disabled),.o-btn[variant=primary][size=small-productive][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--active-modifier)))}.o-btn[variant=secondary]{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=secondary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--hover-modifier)))}.o-btn[variant=secondary]:active:not(:disabled),.o-btn[variant=secondary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--active-modifier)))}.o-btn[variant=outline]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary);border:1px solid var(--dt-color-border-strong);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=outline]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=outline]:active:not(:disabled),.o-btn[variant=outline][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=ghost]:active:not(:disabled),.o-btn[variant=ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=inverse]{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--hover-modifier)))}.o-btn[variant=inverse]:active:not(:disabled),.o-btn[variant=inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--active-modifier)))}.o-btn[variant=ghost-inverse],.o-btn[variant=outline-inverse]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn[variant=ghost-inverse]:hover:not(:disabled),.o-btn[variant=outline-inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--hover-modifier))}.o-btn[variant=ghost-inverse]:active:not(:disabled),.o-btn[variant=ghost-inverse][isLoading]:not(:disabled),.o-btn[variant=outline-inverse]:active:not(:disabled),.o-btn[variant=outline-inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--active-modifier))}.o-btn[variant=outline-inverse]{border:1px solid var(--dt-color-border-strong)}.o-btn[variant=destructive]{--btn-bg-color: var(--dt-color-support-error)}.o-btn[variant=destructive]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--hover-modifier)))}.o-btn[variant=destructive]:active:not(:disabled),.o-btn[variant=destructive][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--active-modifier)))}.o-btn[variant=destructive-ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=destructive-ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=destructive-ghost]:active:not(:disabled),.o-btn[variant=destructive-ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[isFullWidth]{--btn-inline-size: 100%}.o-btn[disabled]{--btn-text-color: var(--dt-color-content-disabled) !important;cursor:not-allowed}.o-btn[disabled]:not([variant=ghost],[variant=ghost-inverse],[variant=destructive-ghost]){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled][variant=outline]{border-color:var(--dt-color-disabled-01)!important}.o-btn[size=xsmall]{--btn-padding: 6px var(--dt-spacing-b);--btn-font-size: calc(var(--dt-font-size-14) * 1px);--btn-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--btn-icon-size: 16px;--spinner-size: var(--spinner-size-s);--spinner-border-width: var(--spinner-border-width-s)}.o-btn[size=small-expressive]{--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--btn-icon-size: 20px;--spinner-size: var(--spinner-size-s);--spinner-border-width: var(--spinner-border-width-s)}.o-btn[size=small-productive]{--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--btn-icon-size: 20px;--spinner-size: var(--spinner-size-s);--spinner-border-width: var(--spinner-border-width-s)}.o-btn[size=large]{--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--spinner-size: var(--spinner-size-m);--spinner-border-width: var(--spinner-border-width-m)}.o-btn[isLoading]:before{content:"";position:absolute;left:50%;top:50%;translate:-50% -50%;height:var(--spinner-size);width:var(--spinner-size);display:block;background-color:transparent;border-radius:50%;border-color:var(--spinner-left-color) var(--spinner-right-color) var(--spinner-right-color) var(--spinner-left-color);border-width:var(--spinner-border-width);border-style:solid;will-change:transform;animation:rotate360 var(--spinner-animation-duration) var(--spinner-animation-timing-function) var(--spinner-animation-iteration-count)}.o-btn[isLoading]>*{visibility:hidden}.o-btn:focus-visible{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}::slotted(svg){height:var(--btn-icon-size);width:var(--btn-icon-size)}
19
- `, y = ["xsmall", "small-productive", "small-expressive", "medium", "large"], z = ["submit", "button", "reset", "menu"], x = [
18
+ }, xt = ["xsmall", "small-productive", "small-expressive", "medium", "large"], Mt = ["submit", "button", "reset"], kt = [
20
19
  "primary",
21
20
  "secondary",
22
21
  "outline",
@@ -26,77 +25,599 @@ const b = (v, r, t) => function(o, e) {
26
25
  "ghost-inverse",
27
26
  "destructive",
28
27
  "destructive-ghost"
29
- ], w = ["leading", "trailing"];
30
- var k = Object.defineProperty, L = Object.getOwnPropertyDescriptor, s = (v, r, t, a) => {
31
- for (var o = a > 1 ? void 0 : a ? L(r, t) : r, e = v.length - 1, i; e >= 0; e--)
32
- (i = v[e]) && (o = (a ? i(r, t, o) : i(o)) || o);
33
- return a && o && k(r, t, o), o;
28
+ ], zt = ["leading", "trailing"], Tt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], St = ["post", "get", "dialog"], Vt = ["_self", "_blank", "_parent", "_top"], At = `*,*:before,*:after{box-sizing:border-box}@keyframes rotate360{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.o-btn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-m-family);--btn-font-weight: var(--dt-font-interactive-m-weight);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--btn-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-primary);--btn-icon-size: 24px;--spinner-size-s: 20px;--spinner-size-m: 24px;--spinner-border-width-s: 2.5px;--spinner-border-width-m: 3px;--spinner-size: var(--spinner-size-m);--spinner-border-width: var(--spinner-border-width-m);--spinner-base-color-h: var(--dt-color-content-interactive-primary-h);--spinner-base-color-s: var(--dt-color-content-interactive-primary-s);--spinner-base-color-l: var(--dt-color-content-interactive-primary-l);--spinner-left-color-opacity: .35;--spinner-left-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), var(--spinner-left-color-opacity));--spinner-right-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), 1);--spinner-animation-duration: 1.15s;--spinner-animation-timing-function: linear;--spinner-animation-iteration-count: infinite;position:relative;display:flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;box-sizing:border-box;padding:var(--btn-padding);border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-bg-color);font-family:var(--btn-font-family);font-size:var(--btn-font-size);font-weight:var(--btn-font-weight);color:var(--btn-text-color);line-height:var(--btn-line-height);cursor:pointer;user-select:none;inline-size:var(--btn-inline-size)}.o-btn[variant=primary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.o-btn[variant=primary]:active:not(:disabled),.o-btn[variant=primary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}.o-btn[variant=primary][size=xsmall],.o-btn[variant=primary][size=small-productive]{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn[variant=primary][size=xsmall]:hover:not(:disabled),.o-btn[variant=primary][size=small-productive]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--hover-modifier)))}.o-btn[variant=primary][size=xsmall]:active:not(:disabled),.o-btn[variant=primary][size=xsmall][isLoading]:not(:disabled),.o-btn[variant=primary][size=small-productive]:active:not(:disabled),.o-btn[variant=primary][size=small-productive][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--active-modifier)))}.o-btn[variant=secondary]{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=secondary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--hover-modifier)))}.o-btn[variant=secondary]:active:not(:disabled),.o-btn[variant=secondary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--active-modifier)))}.o-btn[variant=outline]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary);border:1px solid var(--dt-color-border-strong);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=outline]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=outline]:active:not(:disabled),.o-btn[variant=outline][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=ghost]:active:not(:disabled),.o-btn[variant=ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=inverse]{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--hover-modifier)))}.o-btn[variant=inverse]:active:not(:disabled),.o-btn[variant=inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--active-modifier)))}.o-btn[variant=ghost-inverse],.o-btn[variant=outline-inverse]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn[variant=ghost-inverse]:hover:not(:disabled),.o-btn[variant=outline-inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--hover-modifier))}.o-btn[variant=ghost-inverse]:active:not(:disabled),.o-btn[variant=ghost-inverse][isLoading]:not(:disabled),.o-btn[variant=outline-inverse]:active:not(:disabled),.o-btn[variant=outline-inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--active-modifier))}.o-btn[variant=outline-inverse]{border:1px solid var(--dt-color-border-strong)}.o-btn[variant=destructive]{--btn-bg-color: var(--dt-color-support-error)}.o-btn[variant=destructive]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--hover-modifier)))}.o-btn[variant=destructive]:active:not(:disabled),.o-btn[variant=destructive][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--active-modifier)))}.o-btn[variant=destructive-ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error);--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l)}.o-btn[variant=destructive-ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=destructive-ghost]:active:not(:disabled),.o-btn[variant=destructive-ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[isFullWidth]{--btn-inline-size: 100%}.o-btn[disabled]{--btn-text-color: var(--dt-color-content-disabled) !important;cursor:not-allowed}.o-btn[disabled]:not([variant=ghost],[variant=ghost-inverse],[variant=destructive-ghost]){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled][variant=outline]{border-color:var(--dt-color-disabled-01)!important}.o-btn[size=xsmall]{--btn-padding: 6px var(--dt-spacing-b);--btn-font-size: calc(var(--dt-font-size-14) * 1px);--btn-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--btn-icon-size: 16px;--spinner-size: var(--spinner-size-s);--spinner-border-width: var(--spinner-border-width-s)}.o-btn[size=small-expressive]{--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--btn-icon-size: 20px;--spinner-size: var(--spinner-size-s);--spinner-border-width: var(--spinner-border-width-s)}.o-btn[size=small-productive]{--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--btn-icon-size: 20px;--spinner-size: var(--spinner-size-s);--spinner-border-width: var(--spinner-border-width-s)}.o-btn[size=large]{--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--spinner-size: var(--spinner-size-m);--spinner-border-width: var(--spinner-border-width-m)}.o-btn[isLoading]:before{content:"";position:absolute;left:50%;top:50%;translate:-50% -50%;height:var(--spinner-size);width:var(--spinner-size);display:block;background-color:transparent;border-radius:50%;border-color:var(--spinner-left-color) var(--spinner-right-color) var(--spinner-right-color) var(--spinner-left-color);border-width:var(--spinner-border-width);border-style:solid;will-change:transform;animation:rotate360 var(--spinner-animation-duration) var(--spinner-animation-timing-function) var(--spinner-animation-iteration-count)}.o-btn[isLoading]>*{visibility:hidden}.o-btn:focus-visible{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}::slotted(svg){height:var(--btn-icon-size);width:var(--btn-icon-size)}
29
+ `;
30
+ (function() {
31
+ const v = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), C = {
32
+ ariaAtomic: "aria-atomic",
33
+ ariaAutoComplete: "aria-autocomplete",
34
+ ariaBusy: "aria-busy",
35
+ ariaChecked: "aria-checked",
36
+ ariaColCount: "aria-colcount",
37
+ ariaColIndex: "aria-colindex",
38
+ ariaColIndexText: "aria-colindextext",
39
+ ariaColSpan: "aria-colspan",
40
+ ariaCurrent: "aria-current",
41
+ ariaDisabled: "aria-disabled",
42
+ ariaExpanded: "aria-expanded",
43
+ ariaHasPopup: "aria-haspopup",
44
+ ariaHidden: "aria-hidden",
45
+ ariaInvalid: "aria-invalid",
46
+ ariaKeyShortcuts: "aria-keyshortcuts",
47
+ ariaLabel: "aria-label",
48
+ ariaLevel: "aria-level",
49
+ ariaLive: "aria-live",
50
+ ariaModal: "aria-modal",
51
+ ariaMultiLine: "aria-multiline",
52
+ ariaMultiSelectable: "aria-multiselectable",
53
+ ariaOrientation: "aria-orientation",
54
+ ariaPlaceholder: "aria-placeholder",
55
+ ariaPosInSet: "aria-posinset",
56
+ ariaPressed: "aria-pressed",
57
+ ariaReadOnly: "aria-readonly",
58
+ ariaRelevant: "aria-relevant",
59
+ ariaRequired: "aria-required",
60
+ ariaRoleDescription: "aria-roledescription",
61
+ ariaRowCount: "aria-rowcount",
62
+ ariaRowIndex: "aria-rowindex",
63
+ ariaRowIndexText: "aria-rowindextext",
64
+ ariaRowSpan: "aria-rowspan",
65
+ ariaSelected: "aria-selected",
66
+ ariaSetSize: "aria-setsize",
67
+ ariaSort: "aria-sort",
68
+ ariaValueMax: "aria-valuemax",
69
+ ariaValueMin: "aria-valuemin",
70
+ ariaValueNow: "aria-valuenow",
71
+ ariaValueText: "aria-valuetext",
72
+ role: "role"
73
+ }, it = (r, t) => {
74
+ for (let e in C) {
75
+ t[e] = null;
76
+ let o = null;
77
+ const i = C[e];
78
+ Object.defineProperty(t, e, {
79
+ get() {
80
+ return o;
81
+ },
82
+ set(s) {
83
+ o = s, r.isConnected ? r.setAttribute(i, s) : F.set(r, t);
84
+ }
85
+ });
86
+ }
87
+ };
88
+ function q(r) {
89
+ const t = l.get(r), { form: e } = t;
90
+ Q(r, e, t), J(r, t.labels);
91
+ }
92
+ const U = (r, t = !1) => {
93
+ const e = document.createTreeWalker(r, NodeFilter.SHOW_ELEMENT, {
94
+ acceptNode(s) {
95
+ return l.has(s) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
96
+ }
97
+ });
98
+ let o = e.nextNode();
99
+ const i = !t || r.disabled;
100
+ for (; o; )
101
+ o.formDisabledCallback && i && $(o, r.disabled), o = e.nextNode();
102
+ }, j = { attributes: !0, attributeFilter: ["disabled", "name"] }, M = S() ? new MutationObserver((r) => {
103
+ for (const t of r) {
104
+ const e = t.target;
105
+ if (t.attributeName === "disabled" && (e.constructor.formAssociated ? $(e, e.hasAttribute("disabled")) : e.localName === "fieldset" && U(e)), t.attributeName === "name" && e.constructor.formAssociated) {
106
+ const o = l.get(e), i = A.get(e);
107
+ o.setFormValue(i);
108
+ }
109
+ }
110
+ }) : {};
111
+ function P(r) {
112
+ r.forEach((t) => {
113
+ const { addedNodes: e, removedNodes: o } = t, i = Array.from(e), s = Array.from(o);
114
+ i.forEach((n) => {
115
+ var u;
116
+ if (l.has(n) && n.constructor.formAssociated && q(n), F.has(n)) {
117
+ const d = F.get(n);
118
+ Object.keys(C).filter((w) => d[w] !== null).forEach((w) => {
119
+ n.setAttribute(C[w], d[w]);
120
+ }), F.delete(n);
121
+ }
122
+ if (L.has(n)) {
123
+ const d = L.get(n);
124
+ n.setAttribute("internals-valid", d.validity.valid.toString()), n.setAttribute("internals-invalid", (!d.validity.valid).toString()), n.setAttribute("aria-invalid", (!d.validity.valid).toString()), L.delete(n);
125
+ }
126
+ if (n.localName === "form") {
127
+ const d = h.get(n), x = document.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, {
128
+ acceptNode(rt) {
129
+ return l.has(rt) && !(d && d.has(rt)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
130
+ }
131
+ });
132
+ let w = x.nextNode();
133
+ for (; w; )
134
+ q(w), w = x.nextNode();
135
+ }
136
+ n.localName === "fieldset" && ((u = M.observe) == null || u.call(M, n, j), U(n, !0));
137
+ }), s.forEach((n) => {
138
+ const u = l.get(n);
139
+ u && a.get(u) && K(u), b.has(n) && b.get(n).disconnect();
140
+ });
141
+ });
142
+ }
143
+ function at(r) {
144
+ r.forEach((t) => {
145
+ const { removedNodes: e } = t;
146
+ e.forEach((o) => {
147
+ const i = D.get(t.target);
148
+ l.has(o) && Y(o), i.disconnect();
149
+ });
150
+ });
151
+ }
152
+ const nt = (r) => {
153
+ var e;
154
+ const t = new MutationObserver(at);
155
+ (e = t.observe) == null || e.call(t, r, { childList: !0 }), D.set(r, t);
156
+ };
157
+ S() && new MutationObserver(P);
158
+ const _ = {
159
+ childList: !0,
160
+ subtree: !0
161
+ }, $ = (r, t) => {
162
+ r.toggleAttribute("internals-disabled", t), t ? r.setAttribute("aria-disabled", "true") : r.removeAttribute("aria-disabled"), r.formDisabledCallback && r.formDisabledCallback.apply(r, [t]);
163
+ }, K = (r) => {
164
+ a.get(r).forEach((e) => {
165
+ e.remove();
166
+ }), a.set(r, []);
167
+ }, G = (r, t) => {
168
+ const e = document.createElement("input");
169
+ return e.type = "hidden", e.name = r.getAttribute("name"), r.after(e), a.get(t).push(e), e;
170
+ }, st = (r, t) => {
171
+ var e;
172
+ a.set(t, []), (e = M.observe) == null || e.call(M, r, j);
173
+ }, J = (r, t) => {
174
+ if (t.length) {
175
+ Array.from(t).forEach((o) => o.addEventListener("click", r.click.bind(r)));
176
+ let e = t[0].id;
177
+ t[0].id || (e = `${t[0].htmlFor}_Label`, t[0].id = e), r.setAttribute("aria-labelledby", e);
178
+ }
179
+ }, I = (r) => {
180
+ const t = Array.from(r.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), e = h.get(r) || [], o = Array.from(e).filter((s) => s.isConnected).map((s) => l.get(s).validity.valid), i = [...t, ...o].includes(!1);
181
+ r.toggleAttribute("internals-invalid", i), r.toggleAttribute("internals-valid", !i);
182
+ }, lt = (r) => {
183
+ I(T(r.target));
184
+ }, ct = (r) => {
185
+ I(T(r.target));
186
+ }, dt = (r) => {
187
+ const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((e) => `${e}:not([disabled])`).map((e) => `${e}:not([form])${r.id ? `,${e}[form='${r.id}']` : ""}`).join(",");
188
+ r.addEventListener("click", (e) => {
189
+ if (e.target.closest(t)) {
190
+ const i = h.get(r);
191
+ if (r.noValidate)
192
+ return;
193
+ i.size && Array.from(i).reverse().map((u) => l.get(u).reportValidity()).includes(!1) && e.preventDefault();
194
+ }
195
+ });
196
+ }, vt = (r) => {
197
+ const t = h.get(r.target);
198
+ t && t.size && t.forEach((e) => {
199
+ e.constructor.formAssociated && e.formResetCallback && e.formResetCallback.apply(e);
200
+ });
201
+ }, Q = (r, t, e) => {
202
+ if (t) {
203
+ const o = h.get(t);
204
+ if (o)
205
+ o.add(r);
206
+ else {
207
+ const i = /* @__PURE__ */ new Set();
208
+ i.add(r), h.set(t, i), dt(t), t.addEventListener("reset", vt), t.addEventListener("input", lt), t.addEventListener("change", ct);
209
+ }
210
+ y.set(t, { ref: r, internals: e }), r.constructor.formAssociated && r.formAssociatedCallback && setTimeout(() => {
211
+ r.formAssociatedCallback.apply(r, [t]);
212
+ }, 0), I(t);
213
+ }
214
+ }, T = (r) => {
215
+ let t = r.parentNode;
216
+ return t && t.tagName !== "FORM" && (t = T(t)), t;
217
+ }, E = (r, t, e = DOMException) => {
218
+ if (!r.constructor.formAssociated)
219
+ throw new e(t);
220
+ }, X = (r, t, e) => {
221
+ const o = h.get(r);
222
+ return o && o.size && o.forEach((i) => {
223
+ l.get(i)[e]() || (t = !1);
224
+ }), t;
225
+ }, Y = (r) => {
226
+ if (r.constructor.formAssociated) {
227
+ const t = l.get(r), { labels: e, form: o } = t;
228
+ J(r, e), Q(r, o, t);
229
+ }
230
+ };
231
+ function S() {
232
+ return typeof MutationObserver < "u";
233
+ }
234
+ class pt {
235
+ constructor() {
236
+ this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
237
+ }
238
+ }
239
+ const ht = (r) => (r.badInput = !1, r.customError = !1, r.patternMismatch = !1, r.rangeOverflow = !1, r.rangeUnderflow = !1, r.stepMismatch = !1, r.tooLong = !1, r.tooShort = !1, r.typeMismatch = !1, r.valid = !0, r.valueMissing = !1, r), mt = (r, t, e) => (r.valid = bt(t), Object.keys(t).forEach((o) => r[o] = t[o]), e && I(e), r), bt = (r) => {
240
+ let t = !0;
241
+ for (let e in r)
242
+ e !== "valid" && r[e] !== !1 && (t = !1);
243
+ return t;
244
+ }, O = /* @__PURE__ */ new WeakMap();
245
+ function Z(r, t) {
246
+ r.toggleAttribute(t, !0), r.part && r.part.add(t);
247
+ }
248
+ class V extends Set {
249
+ static get isPolyfilled() {
250
+ return !0;
251
+ }
252
+ constructor(t) {
253
+ if (super(), !t || !t.tagName || t.tagName.indexOf("-") === -1)
254
+ throw new TypeError("Illegal constructor");
255
+ O.set(this, t);
256
+ }
257
+ add(t) {
258
+ if (!/^--/.test(t) || typeof t != "string")
259
+ throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
260
+ const e = super.add(t), o = O.get(this), i = `state${t}`;
261
+ return o.isConnected ? Z(o, i) : setTimeout(() => {
262
+ Z(o, i);
263
+ }), e;
264
+ }
265
+ clear() {
266
+ for (let [t] of this.entries())
267
+ this.delete(t);
268
+ super.clear();
269
+ }
270
+ delete(t) {
271
+ const e = super.delete(t), o = O.get(this);
272
+ return o.isConnected ? (o.toggleAttribute(`state${t}`, !1), o.part && o.part.remove(`state${t}`)) : setTimeout(() => {
273
+ o.toggleAttribute(`state${t}`, !1), o.part && o.part.remove(`state${t}`);
274
+ }), e;
275
+ }
276
+ }
277
+ function tt(r, t, e, o) {
278
+ if (e === "a" && !o)
279
+ throw new TypeError("Private accessor was defined without a getter");
280
+ if (typeof t == "function" ? r !== t || !o : !t.has(r))
281
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
282
+ return e === "m" ? o : e === "a" ? o.call(r) : o ? o.value : t.get(r);
283
+ }
284
+ function ut(r, t, e, o, i) {
285
+ if (o === "m")
286
+ throw new TypeError("Private method is not writable");
287
+ if (o === "a" && !i)
288
+ throw new TypeError("Private accessor was defined without a setter");
289
+ if (typeof t == "function" ? r !== t || !i : !t.has(r))
290
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
291
+ return o === "a" ? i.call(r, e) : i ? i.value = e : t.set(r, e), e;
292
+ }
293
+ var k;
294
+ class ft {
295
+ constructor(t) {
296
+ k.set(this, void 0), ut(this, k, t, "f");
297
+ for (let e = 0; e < t.length; e++) {
298
+ let o = t[e];
299
+ this[e] = o, o.hasAttribute("name") && (this[o.getAttribute("name")] = o);
300
+ }
301
+ Object.freeze(this);
302
+ }
303
+ get length() {
304
+ return tt(this, k, "f").length;
305
+ }
306
+ [(k = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
307
+ return tt(this, k, "f")[Symbol.iterator]();
308
+ }
309
+ item(t) {
310
+ return this[t] == null ? null : this[t];
311
+ }
312
+ namedItem(t) {
313
+ return this[t] == null ? null : this[t];
314
+ }
315
+ }
316
+ function gt() {
317
+ const r = HTMLFormElement.prototype.checkValidity;
318
+ HTMLFormElement.prototype.checkValidity = e;
319
+ const t = HTMLFormElement.prototype.reportValidity;
320
+ HTMLFormElement.prototype.reportValidity = o;
321
+ function e(...s) {
322
+ let n = r.apply(this, s);
323
+ return X(this, n, "checkValidity");
324
+ }
325
+ function o(...s) {
326
+ let n = t.apply(this, s);
327
+ return X(this, n, "reportValidity");
328
+ }
329
+ const { get: i } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
330
+ Object.defineProperty(HTMLFormElement.prototype, "elements", {
331
+ get(...s) {
332
+ const n = i.call(this, ...s), u = Array.from(h.get(this) || []);
333
+ if (u.length === 0)
334
+ return n;
335
+ const d = Array.from(n).concat(u).sort((x, w) => x.compareDocumentPosition ? x.compareDocumentPosition(w) & 2 ? 1 : -1 : 0);
336
+ return new ft(d);
337
+ }
338
+ });
339
+ }
340
+ class et {
341
+ static get isPolyfilled() {
342
+ return !0;
343
+ }
344
+ constructor(t) {
345
+ if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
346
+ throw new TypeError("Illegal constructor");
347
+ const e = t.getRootNode(), o = new pt();
348
+ this.states = new V(t), v.set(this, t), c.set(this, o), l.set(t, this), it(t, this), st(t, this), Object.seal(this), e instanceof DocumentFragment && nt(e);
349
+ }
350
+ checkValidity() {
351
+ const t = v.get(this);
352
+ if (E(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
353
+ return !0;
354
+ const e = c.get(this);
355
+ if (!e.valid) {
356
+ const o = new Event("invalid", {
357
+ bubbles: !1,
358
+ cancelable: !0,
359
+ composed: !1
360
+ });
361
+ t.dispatchEvent(o);
362
+ }
363
+ return e.valid;
364
+ }
365
+ get form() {
366
+ const t = v.get(this);
367
+ E(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
368
+ let e;
369
+ return t.constructor.formAssociated === !0 && (e = T(t)), e;
370
+ }
371
+ get labels() {
372
+ const t = v.get(this);
373
+ E(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
374
+ const e = t.getAttribute("id"), o = t.getRootNode();
375
+ return o && e ? o.querySelectorAll(`[for="${e}"]`) : [];
376
+ }
377
+ reportValidity() {
378
+ const t = v.get(this);
379
+ if (E(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
380
+ return !0;
381
+ const e = this.checkValidity(), o = H.get(this);
382
+ if (o && !t.constructor.formAssociated)
383
+ throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
384
+ return !e && o && (t.focus(), o.focus()), e;
385
+ }
386
+ setFormValue(t) {
387
+ const e = v.get(this);
388
+ if (E(e, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), K(this), t != null && !(t instanceof FormData)) {
389
+ if (e.getAttribute("name")) {
390
+ const o = G(e, this);
391
+ o.value = t;
392
+ }
393
+ } else
394
+ t != null && t instanceof FormData && Array.from(t).reverse().forEach(([o, i]) => {
395
+ if (typeof i == "string") {
396
+ const s = G(e, this);
397
+ s.name = o, s.value = i;
398
+ }
399
+ });
400
+ A.set(e, t);
401
+ }
402
+ setValidity(t, e, o) {
403
+ const i = v.get(this);
404
+ if (E(i, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
405
+ throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
406
+ H.set(this, o);
407
+ const s = c.get(this), n = {};
408
+ for (const x in t)
409
+ n[x] = t[x];
410
+ Object.keys(n).length === 0 && ht(s);
411
+ const u = { ...s, ...n };
412
+ delete u.valid;
413
+ const { valid: d } = mt(s, u, this.form);
414
+ if (!d && !e)
415
+ throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
416
+ m.set(this, d ? "" : e), i.isConnected ? (i.toggleAttribute("internals-invalid", !d), i.toggleAttribute("internals-valid", d), i.setAttribute("aria-invalid", `${!d}`)) : L.set(i, this);
417
+ }
418
+ get shadowRoot() {
419
+ const t = v.get(this), e = W.get(t);
420
+ return e || null;
421
+ }
422
+ get validationMessage() {
423
+ const t = v.get(this);
424
+ return E(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), m.get(this);
425
+ }
426
+ get validity() {
427
+ const t = v.get(this);
428
+ return E(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), c.get(this);
429
+ }
430
+ get willValidate() {
431
+ const t = v.get(this);
432
+ return E(t, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(t.disabled || t.hasAttribute("disabled") || t.hasAttribute("readonly"));
433
+ }
434
+ }
435
+ function yt() {
436
+ if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)
437
+ return !1;
438
+ class r extends HTMLElement {
439
+ constructor() {
440
+ super(), this.internals = this.attachInternals();
441
+ }
442
+ }
443
+ const t = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
444
+ customElements.define(t, r);
445
+ const e = new r();
446
+ return [
447
+ "shadowRoot",
448
+ "form",
449
+ "willValidate",
450
+ "validity",
451
+ "validationMessage",
452
+ "labels",
453
+ "setFormValue",
454
+ "setValidity",
455
+ "checkValidity",
456
+ "reportValidity"
457
+ ].every((o) => o in e.internals);
458
+ }
459
+ if (yt()) {
460
+ if (typeof window < "u" && !window.CustomStateSet) {
461
+ window.CustomStateSet = V;
462
+ const r = HTMLElement.prototype.attachInternals;
463
+ HTMLElement.prototype.attachInternals = function(...t) {
464
+ const e = r.call(this, t);
465
+ return e.states = new V(this), e;
466
+ };
467
+ }
468
+ } else {
469
+ if (typeof window < "u" && (window.ElementInternals = et), typeof CustomElementRegistry < "u") {
470
+ const r = CustomElementRegistry.prototype.define;
471
+ CustomElementRegistry.prototype.define = function(t, e, o) {
472
+ if (e.formAssociated) {
473
+ const i = e.prototype.connectedCallback;
474
+ e.prototype.connectedCallback = function() {
475
+ B.has(this) || (B.set(this, !0), this.hasAttribute("disabled") && $(this, !0)), i != null && i.apply(this), Y(this);
476
+ };
477
+ }
478
+ r.call(this, t, e, o);
479
+ };
480
+ }
481
+ if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
482
+ if (this.tagName) {
483
+ if (this.tagName.indexOf("-") === -1)
484
+ throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");
485
+ } else
486
+ return {};
487
+ if (l.has(this))
488
+ throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
489
+ return new et(this);
490
+ }), typeof Element < "u") {
491
+ let r = function(...e) {
492
+ const o = t.apply(this, e);
493
+ if (W.set(this, o), S()) {
494
+ const i = new MutationObserver(P);
495
+ window.ShadyDOM ? i.observe(this, _) : i.observe(o, _), b.set(this, i);
496
+ }
497
+ return o;
498
+ };
499
+ const t = Element.prototype.attachShadow;
500
+ Element.prototype.attachShadow = r;
501
+ }
502
+ S() && typeof document < "u" && new MutationObserver(P).observe(document.documentElement, _), typeof HTMLFormElement < "u" && gt(), typeof window < "u" && !window.CustomStateSet && (window.CustomStateSet = V);
503
+ }
504
+ })();
505
+ var Ft = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, g = (v, c, a, l) => {
506
+ for (var m = l > 1 ? void 0 : l ? Lt(c, a) : c, y = v.length - 1, b; y >= 0; y--)
507
+ (b = v[y]) && (m = (l ? b(c, a, m) : b(m)) || m);
508
+ return l && m && Ft(c, a, m), m;
34
509
  };
35
- const d = "pie-button";
36
- class n extends f {
510
+ const z = "pie-button";
511
+ class p extends Et {
37
512
  constructor() {
38
- super(...arguments), this.size = "medium", this.type = "submit", this.variant = "primary", this.iconPlacement = "leading", this.disabled = !1, this.isLoading = !1, this.isFullWidth = !1;
513
+ super(), this.size = "medium", this.type = "submit", this.variant = "primary", this.iconPlacement = "leading", this.disabled = !1, this.isLoading = !1, this.isFullWidth = !1, this._internals = this.attachInternals();
514
+ }
515
+ get form() {
516
+ return this._internals.form;
517
+ }
518
+ /**
519
+ * This method creates an invisible button of the same type as pie-button. It is then clicked, and immediately removed from the DOM.
520
+ * This is done so that we trigger native form actions, such as submit and reset in the browser. The performance impact of adding and removing a single button to the DOM
521
+ * should be neglible, however this should be monitored.
522
+ * This is the only viable way of guaranteeing native button behaviour when using a web component in place of an actual HTML button.
523
+ *
524
+ * TODO: if we need to repeat this logic elsewhere, then we should consider moving this code to a shared class or mixin.
525
+ */
526
+ _simulateNativeButtonClick(c) {
527
+ if (!this.form)
528
+ return;
529
+ const a = document.createElement("button");
530
+ a.type = c, a.style.position = "absolute", a.style.width = "1px", a.style.height = "1px", a.style.padding = "0", a.style.margin = "-1px", a.style.overflow = "hidden", a.style.border = "0", a.style.whiteSpace = "nowrap", c === "submit" && (this.name && (a.name = this.name), this.value && (a.value = this.value), this.formaction && a.setAttribute("formaction", this.formaction), this.formenctype && a.setAttribute("formenctype", this.formenctype), this.formmethod && a.setAttribute("formmethod", this.formmethod), this.formnovalidate && a.setAttribute("formnovalidate", "formnovalidate"), this.formtarget && a.setAttribute("formtarget", this.formtarget)), this.form.append(a), a.click(), a.remove();
531
+ }
532
+ _handleClick() {
533
+ !this.isLoading && this.form && (this.type === "submit" && (this.formnovalidate || this.form.reportValidity()) && this._simulateNativeButtonClick("submit"), this.type === "reset" && this._simulateNativeButtonClick("reset"));
39
534
  }
40
535
  render() {
41
536
  const {
42
- type: r,
43
- disabled: t,
44
- isFullWidth: a,
45
- variant: o,
46
- size: e,
47
- isLoading: i,
48
- iconPlacement: l
537
+ type: c,
538
+ disabled: a,
539
+ isFullWidth: l,
540
+ variant: m,
541
+ size: y,
542
+ isLoading: b,
543
+ iconPlacement: h
49
544
  } = this;
50
- return p`
545
+ return R`
51
546
  <button
547
+ @click=${this._handleClick}
52
548
  class="o-btn"
53
- type=${r}
54
- variant=${o}
55
- size=${e}
56
- ?disabled=${t}
57
- ?isFullWidth=${a}
58
- ?isLoading=${i}>
59
- ${l === "leading" ? p`<slot name="icon"></slot>` : h}
549
+ type=${c}
550
+ variant=${m}
551
+ size=${y}
552
+ ?disabled=${a}
553
+ ?isFullWidth=${l}
554
+ ?isLoading=${b}>
555
+ ${h === "leading" ? R`<slot name="icon"></slot>` : ot}
60
556
  <slot></slot>
61
- ${l === "trailing" ? p`<slot name="icon"></slot>` : h}
557
+ ${h === "trailing" ? R`<slot name="icon"></slot>` : ot}
62
558
  </button>`;
63
559
  }
64
560
  focus() {
65
- var r, t;
66
- (t = (r = this.shadowRoot) == null ? void 0 : r.querySelector("button")) == null || t.focus();
561
+ var c, a;
562
+ (a = (c = this.shadowRoot) == null ? void 0 : c.querySelector("button")) == null || a.focus();
67
563
  }
68
564
  }
69
- n.styles = g(u);
70
- s([
71
- c(),
72
- b(d, y, "medium")
73
- ], n.prototype, "size", 2);
74
- s([
75
- c(),
76
- b(d, z, "submit")
77
- ], n.prototype, "type", 2);
78
- s([
79
- c(),
80
- b(d, x, "primary")
81
- ], n.prototype, "variant", 2);
82
- s([
83
- c({ type: String }),
84
- b(d, w, "leading")
85
- ], n.prototype, "iconPlacement", 2);
86
- s([
87
- c({ type: Boolean })
88
- ], n.prototype, "disabled", 2);
89
- s([
90
- c({ type: Boolean, reflect: !0 })
91
- ], n.prototype, "isLoading", 2);
92
- s([
93
- c({ type: Boolean })
94
- ], n.prototype, "isFullWidth", 2);
95
- customElements.define(d, n);
565
+ p.formAssociated = !0;
566
+ p.styles = wt(At);
567
+ g([
568
+ f(),
569
+ N(z, xt, "medium")
570
+ ], p.prototype, "size", 2);
571
+ g([
572
+ f(),
573
+ N(z, Mt, "submit")
574
+ ], p.prototype, "type", 2);
575
+ g([
576
+ f(),
577
+ N(z, kt, "primary")
578
+ ], p.prototype, "variant", 2);
579
+ g([
580
+ f({ type: String }),
581
+ N(z, zt, "leading")
582
+ ], p.prototype, "iconPlacement", 2);
583
+ g([
584
+ f({ type: Boolean })
585
+ ], p.prototype, "disabled", 2);
586
+ g([
587
+ f({ type: Boolean, reflect: !0 })
588
+ ], p.prototype, "isLoading", 2);
589
+ g([
590
+ f({ type: Boolean })
591
+ ], p.prototype, "isFullWidth", 2);
592
+ g([
593
+ f({ type: String })
594
+ ], p.prototype, "name", 2);
595
+ g([
596
+ f({ type: String })
597
+ ], p.prototype, "value", 2);
598
+ g([
599
+ f()
600
+ ], p.prototype, "formaction", 2);
601
+ g([
602
+ f()
603
+ ], p.prototype, "formenctype", 2);
604
+ g([
605
+ f()
606
+ ], p.prototype, "formmethod", 2);
607
+ g([
608
+ f({ type: Boolean })
609
+ ], p.prototype, "formnovalidate", 2);
610
+ g([
611
+ f()
612
+ ], p.prototype, "formtarget", 2);
613
+ customElements.define(z, p);
96
614
  export {
97
- n as PieButton,
98
- w as iconPlacements,
99
- y as sizes,
100
- z as types,
101
- x as variants
615
+ p as PieButton,
616
+ Tt as formEncodingtypes,
617
+ St as formMethodTypes,
618
+ Vt as formTargetTypes,
619
+ zt as iconPlacements,
620
+ xt as sizes,
621
+ Mt as types,
622
+ kt as variants
102
623
  };