@stackoverflow/stacks 2.8.4 → 2.8.6

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/README.md CHANGED
@@ -6,159 +6,19 @@ Stacks is Stack Overflow’s design system. It includes the resources needed to
6
6
 
7
7
  Our documentation is built with Stacks itself, using its [immutable, atomic classes](http://johnpolacek.com/rethinking/) and components.
8
8
 
9
- The Stacks website documents:
9
+ The [Stacks website](https://stackoverflow.design/) documents:
10
10
 
11
- ### Product
11
+ ## Product
12
12
  - Semantic and accessible component markup
13
13
  - Cross-browser compatible Less / CSS
14
14
  - An [icon library](https://github.com/StackExchange/Stacks-Icons)
15
15
 
16
- ### Email
16
+ ## Email
17
17
  - Email templates & components
18
18
 
19
- Stacks documentation can be found at https://stackoverflow.design/
20
-
21
- ## Table of contents
22
-
23
- - [Using Stacks](#using-stacks)
24
- - [Migrating from v1 to v2](#migrating-from-v1-to-v2)
25
- - [Local Development](#local-development)
26
- - [Format Stacks](#format-stacks)
27
- - [Linting Stacks](#linting-stacks)
28
- - [Testing Stacks](#testing-stacks)
29
- - [Releasing Stacks](#releasing-a-new-version-of-stacks)
30
- - [Bugs and feature requests](#bugs-and-feature-requests)
31
- - [Contributing](#contributing)
32
- - [License](#license)
33
-
34
- ## Using Stacks
19
+ # Using Stacks
35
20
  Using Stacks is outlined in our [usage guidelines](https://stackoverflow.design/product/develop/using-stacks).
36
21
 
37
22
  ## Migrating from v1 to v2
38
23
 
39
- To migrate from Stacks v1 to v2, see our [migration guide](/MIGRATION_GUIDE.md).
40
-
41
- ## Local Development
42
-
43
- To contribute to Stacks documentation or its CSS library, you’ll need to build Stacks locally:
44
- ```sh
45
- npm i
46
- npm start
47
- ```
48
- This command will pull up the local dev server at http://localhost:8080. You can also view our [building guidelines](https://stackoverflow.design/product/develop/building).
49
-
50
- Having trouble getting these steps to work? Open [an issue](https://github.com/StackExchange/Stacks/issues/new) with a `setup` label.
51
-
52
- ## Format Stacks
53
-
54
- Format the source code with prettier via running:
55
- ```sh
56
- npm run format
57
- ```
58
-
59
- ## Linting Stacks
60
-
61
- Run all lint suites by running:
62
- ```sh
63
- npm run lint
64
- ```
65
-
66
- Lint the styles (stylelint) by running:
67
- ```sh
68
- npm run lint:css
69
- ```
70
- Lint the typescript source code (eslint) via running:
71
- ```sh
72
- npm run lint:ts
73
- ```
74
- Lint the source code format (prettier) via running:
75
- ```sh
76
- npm run lint:format
77
- ```
78
-
79
- ## Testing Stacks
80
-
81
- Run all test suites by running:
82
- ```sh
83
- npm test
84
- ```
85
- ### Unit/Component Tests
86
-
87
- Unit/Component tests are written with [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro).
88
- Please follow the library's principles and documentation to write tests.
89
-
90
- Stacks uses [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) and [Playwright](https://modern-web.dev/docs/test-runner/browser-launchers/playwright/) to run tests in a real browser context.
91
-
92
- Execute the unit/component tests suite by running:
93
- ```sh
94
- npm run test:unit
95
- ```
96
- or if you prefer watch mode run:
97
- ```sh
98
- npm run test:unit:watch
99
- ```
100
-
101
- ### Visual Regression Tests
102
-
103
- **Prerequisites:**
104
- - `git lfs` ([installation docs](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage))
105
- - `docker` ([installation docs](https://docs.docker.com/engine/install/))
106
- - `pwsh` ([Installation docs](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.3))
107
- - Run `git config diff.lfs.textconv cat` to make sure image diff works as expected ([More info](https://github.com/microsoft/vscode/issues/86611#issuecomment-875894108))
108
-
109
- This [Web Test Runner plugin](https://www.npmjs.com/package/@web/test-runner-visual-regression) is used to run visual regression tests.
110
- Visual regression tests end with this suffix `*.visual.test.ts`.
111
-
112
- Execute the visual regression tests suite by running:
113
- ```sh
114
- npm run test:visual
115
- ```
116
- After the first run, if there are failing snapshots, they end up overriding the baseline ones in the filesystem (e.g. `/screenshots/<browser>/baseline/<name>.png`).
117
- We do this for easier comparison of the dif directly in vscode and to make sure only the failing snapshots get regenerated (see [this GH discussion](https://github.com/modernweb-dev/web/discussions/427#discussioncomment-3543771) that inspired the approach).
118
-
119
- We also recommend to install [this vscode extension](https://marketplace.visualstudio.com/items?itemName=RayWiis.png-image-diff) for getting better diffs.
120
-
121
- ### Less Tests
122
-
123
- This is an experimental suite to test the generation of CSS from Less files.
124
- Less tests end with this suffix `*.less.test.ts`.
125
-
126
- Execute the less tests suite by running:
127
- ```sh
128
- npm run test:less
129
- ```
130
-
131
- Update the css snapshots via:
132
- ```sh
133
- npm run test:less:update
134
- ```
135
-
136
- ## Releasing a new version of Stacks
137
- Stacks uses [Semantic Versioning](https://semver.org/), is distributed via [npm](https://www.npmjs.com/package/@stackoverflow/stacks), and publishes [release notes on Github](https://github.com/StackExchange/Stacks/releases).
138
-
139
- We use [changesets](https://github.com/changesets/changesets) to automatize the steps necessary to publish to NPM, create GH releases and a changelog.
140
-
141
- - Every time you do work that requires a new release to be published, [add a changesets entry](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) by running `npx chageset` and follow the instrcutions on screen. (changes that do not require a new release - e.g. changing a test file - don't need a changeset).
142
- - When opening a PR without a corresponding changeset the [changesets-bot](https://github.com/apps/changeset-bot) will remind you to do so. It generally makes sense to have one changeset for PR (if the PR changes do not require a new release to be published the bot message can be safely ignored)
143
- - The [release github workflow](.github/workflows/release.yml) continuosly check if there are new pending changesets in the main branch, if there are it creates a GH PR (`chore(release)` [see example](https://github.com/StackExchange/apca-check/pull/2)) and continue updating it as more changesets are potentially pushed/merged to the main branch.
144
- - When we are ready to cut a release we need to simply merge the `chore(release)` PR back to main and the release github workflow will take care of publishing the changes to NPM and create a GH release for us. The `chore(release)` PR also give us an opportunity to adjust the automatically generated changelog when necessary (the entry in the changelog file is also what will end up in the GH release notes).
145
-
146
- _The release github workflow only run if the CI workflow (running linter, formatter and tests) is successful: CI is blocking accidental releases_.
147
-
148
- _Despite using changesets to communicate the intent of creating releases in a more explicit way, we still follow [conventional commits standards](https://www.conventionalcommits.org/en/v1.0.0/) for keeping our git history easily parseable by the human eye._
149
-
150
- Successful releases trigger automatically a new deployment to stackoverflow.design by merging the `develop` branch into the `production` branch.
151
-
152
- ## Bugs and feature requests
153
- Have a bug or feature request? First search existing or closed issues to make sure the issue hasn’t been noted yet. If not, review our [issue guidelines](/CONTRIBUTING.md#open-an-issue) for submitting [a bug report](/CONTRIBUTING.md#reporting-bugs) or [feature request](/CONTRIBUTING.md#feature-requests).
154
-
155
- ## Contributing
156
- If you’d like to contribute to Stacks, please read through our [contribution guidelines](/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.
157
-
158
- ## License
159
- Code and documentation copyright 2017-2024 Stack Exchange, Inc and released under the [MIT License](/LICENSE.MD).
160
-
161
- [gh-action-url]: https://github.com/StackExchange/Stacks/actions/workflows/main.yml
162
- [gh-action-badge]: https://github.com/StackExchange/Stacks/actions/workflows/workflow.yml/badge.svg?branch=develop
163
- [npm-url]: https://npmjs.org/package/@stackoverflow/stacks
164
- [npm-badge]: https://img.shields.io/npm/v/@stackoverflow/stacks.svg
24
+ To migrate from Stacks v1 to v2, see our [migration guide](/MIGRATION_GUIDE.md).
@@ -2152,15 +2152,12 @@ pre.s-code-block::-webkit-scrollbar-corner {
2152
2152
  .s-expandable {
2153
2153
  --_ex-after-h: 10px;
2154
2154
  --_ex-after-hmx: 0;
2155
- --_ex-after-transition: height 100ms linear,
2156
- max-height 0s 100ms linear;
2155
+ --_ex-after-transition: height 100ms linear, max-height 0s 100ms linear;
2157
2156
  --_ex-content-hmx: 1000000px;
2158
2157
  --_ex-content-mb: 0;
2159
2158
  --_ex-content-o: unset;
2160
2159
  --_ex-content-transform: unset;
2161
- --_ex-content-transition: margin-bottom 100ms cubic-bezier(0, 0, 0, 1),
2162
- transform 100ms cubic-bezier(1, 0, 1, 1),
2163
- opacity 100ms cubic-bezier(1, 0, 1, 1);
2160
+ --_ex-content-transition: margin-bottom 100ms cubic-bezier(0, 0, 0, 1), transform 100ms cubic-bezier(1, 0, 1, 1), opacity 100ms cubic-bezier(1, 0, 1, 1);
2164
2161
  --_ex-content-v: unset;
2165
2162
  align-items: flex-start;
2166
2163
  display: flex;
@@ -2176,11 +2173,7 @@ pre.s-code-block::-webkit-scrollbar-corner {
2176
2173
  --_ex-content-mb: -1500px;
2177
2174
  --_ex-content-o: 0;
2178
2175
  --_ex-content-transform: scaleY(0);
2179
- --_ex-content-transition: margin-bottom 100ms cubic-bezier(1, 0, 1, 1),
2180
- visibility 0s 100ms,
2181
- max-height 0s 100ms,
2182
- transform 100ms cubic-bezier(0, 1, 1, 1),
2183
- opacity 100ms cubic-bezier(0, 1, 1, 1);
2176
+ --_ex-content-transition: margin-bottom 100ms cubic-bezier(1, 0, 1, 1), visibility 0s 100ms, max-height 0s 100ms, transform 100ms cubic-bezier(0, 1, 1, 1), opacity 100ms cubic-bezier(0, 1, 1, 1);
2184
2177
  --_ex-content-v: hidden;
2185
2178
  -webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
2186
2179
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
package/dist/js/stacks.js CHANGED
@@ -78,7 +78,7 @@ __webpack_require__.d(__webpack_exports__, {
78
78
  showToast: () => (/* reexport */ showToast)
79
79
  });
80
80
 
81
- ;// ./node_modules/@hotwired/stimulus/dist/stimulus.js
81
+ ;// ../../node_modules/@hotwired/stimulus/dist/stimulus.js
82
82
  /*
83
83
  Stimulus 3.2.1
84
84
  Copyright © 2023 Basecamp, LLC
@@ -3425,7 +3425,7 @@ class TabListController extends StacksController {
3425
3425
  }
3426
3426
  }
3427
3427
 
3428
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js
3428
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js
3429
3429
  function getWindow(node) {
3430
3430
  if (node == null) {
3431
3431
  return window;
@@ -3438,7 +3438,7 @@ function getWindow(node) {
3438
3438
 
3439
3439
  return node;
3440
3440
  }
3441
- ;// ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
3441
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
3442
3442
 
3443
3443
 
3444
3444
  function isElement(node) {
@@ -3462,11 +3462,11 @@ function isShadowRoot(node) {
3462
3462
  }
3463
3463
 
3464
3464
 
3465
- ;// ./node_modules/@popperjs/core/lib/utils/math.js
3465
+ ;// ../../node_modules/@popperjs/core/lib/utils/math.js
3466
3466
  var math_max = Math.max;
3467
3467
  var math_min = Math.min;
3468
3468
  var round = Math.round;
3469
- ;// ./node_modules/@popperjs/core/lib/utils/userAgent.js
3469
+ ;// ../../node_modules/@popperjs/core/lib/utils/userAgent.js
3470
3470
  function getUAString() {
3471
3471
  var uaData = navigator.userAgentData;
3472
3472
 
@@ -3478,12 +3478,12 @@ function getUAString() {
3478
3478
 
3479
3479
  return navigator.userAgent;
3480
3480
  }
3481
- ;// ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
3481
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
3482
3482
 
3483
3483
  function isLayoutViewport() {
3484
3484
  return !/^((?!chrome|android).)*safari/i.test(getUAString());
3485
3485
  }
3486
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
3486
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
3487
3487
 
3488
3488
 
3489
3489
 
@@ -3525,7 +3525,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
3525
3525
  y: y
3526
3526
  };
3527
3527
  }
3528
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
3528
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
3529
3529
 
3530
3530
  function getWindowScroll(node) {
3531
3531
  var win = getWindow(node);
@@ -3536,14 +3536,14 @@ function getWindowScroll(node) {
3536
3536
  scrollTop: scrollTop
3537
3537
  };
3538
3538
  }
3539
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
3539
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
3540
3540
  function getHTMLElementScroll(element) {
3541
3541
  return {
3542
3542
  scrollLeft: element.scrollLeft,
3543
3543
  scrollTop: element.scrollTop
3544
3544
  };
3545
3545
  }
3546
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
3546
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
3547
3547
 
3548
3548
 
3549
3549
 
@@ -3555,18 +3555,18 @@ function getNodeScroll(node) {
3555
3555
  return getHTMLElementScroll(node);
3556
3556
  }
3557
3557
  }
3558
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
3558
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
3559
3559
  function getNodeName(element) {
3560
3560
  return element ? (element.nodeName || '').toLowerCase() : null;
3561
3561
  }
3562
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
3562
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
3563
3563
 
3564
3564
  function getDocumentElement(element) {
3565
3565
  // $FlowFixMe[incompatible-return]: assume body is always available
3566
3566
  return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
3567
3567
  element.document) || window.document).documentElement;
3568
3568
  }
3569
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
3569
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
3570
3570
 
3571
3571
 
3572
3572
 
@@ -3580,12 +3580,12 @@ function getWindowScrollBarX(element) {
3580
3580
  // this (e.g. Edge 2019, IE11, Safari)
3581
3581
  return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
3582
3582
  }
3583
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
3583
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
3584
3584
 
3585
3585
  function getComputedStyle_getComputedStyle(element) {
3586
3586
  return getWindow(element).getComputedStyle(element);
3587
3587
  }
3588
- ;// ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
3588
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
3589
3589
 
3590
3590
  function isScrollParent(element) {
3591
3591
  // Firefox wants us to check `-x` and `-y` variations as well
@@ -3596,7 +3596,7 @@ function isScrollParent(element) {
3596
3596
 
3597
3597
  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
3598
3598
  }
3599
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
3599
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
3600
3600
 
3601
3601
 
3602
3602
 
@@ -3655,7 +3655,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
3655
3655
  height: rect.height
3656
3656
  };
3657
3657
  }
3658
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
3658
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
3659
3659
  // Returns the layout rect of an element relative to its offsetParent. Layout
3660
3660
  // means it doesn't take into account transforms.
3661
3661
 
@@ -3681,7 +3681,7 @@ function getLayoutRect(element) {
3681
3681
  height: height
3682
3682
  };
3683
3683
  }
3684
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
3684
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
3685
3685
 
3686
3686
 
3687
3687
 
@@ -3701,7 +3701,7 @@ function getParentNode(element) {
3701
3701
 
3702
3702
  );
3703
3703
  }
3704
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
3704
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
3705
3705
 
3706
3706
 
3707
3707
 
@@ -3718,7 +3718,7 @@ function getScrollParent(node) {
3718
3718
 
3719
3719
  return getScrollParent(getParentNode(node));
3720
3720
  }
3721
- ;// ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
3721
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
3722
3722
 
3723
3723
 
3724
3724
 
@@ -3745,12 +3745,12 @@ function listScrollParents(element, list) {
3745
3745
  return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
3746
3746
  updatedList.concat(listScrollParents(getParentNode(target)));
3747
3747
  }
3748
- ;// ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
3748
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
3749
3749
 
3750
3750
  function isTableElement(element) {
3751
3751
  return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
3752
3752
  }
3753
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
3753
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
3754
3754
 
3755
3755
 
3756
3756
 
@@ -3820,7 +3820,7 @@ function getOffsetParent(element) {
3820
3820
 
3821
3821
  return offsetParent || getContainingBlock(element) || window;
3822
3822
  }
3823
- ;// ./node_modules/@popperjs/core/lib/enums.js
3823
+ ;// ../../node_modules/@popperjs/core/lib/enums.js
3824
3824
  var enums_top = 'top';
3825
3825
  var bottom = 'bottom';
3826
3826
  var right = 'right';
@@ -3852,7 +3852,7 @@ var beforeWrite = 'beforeWrite';
3852
3852
  var write = 'write';
3853
3853
  var afterWrite = 'afterWrite';
3854
3854
  var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
3855
- ;// ./node_modules/@popperjs/core/lib/utils/orderModifiers.js
3855
+ ;// ../../node_modules/@popperjs/core/lib/utils/orderModifiers.js
3856
3856
  // source: https://stackoverflow.com/questions/49875255
3857
3857
 
3858
3858
  function order(modifiers) {
@@ -3897,7 +3897,7 @@ function orderModifiers(modifiers) {
3897
3897
  }));
3898
3898
  }, []);
3899
3899
  }
3900
- ;// ./node_modules/@popperjs/core/lib/utils/debounce.js
3900
+ ;// ../../node_modules/@popperjs/core/lib/utils/debounce.js
3901
3901
  function debounce(fn) {
3902
3902
  var pending;
3903
3903
  return function () {
@@ -3913,7 +3913,7 @@ function debounce(fn) {
3913
3913
  return pending;
3914
3914
  };
3915
3915
  }
3916
- ;// ./node_modules/@popperjs/core/lib/utils/mergeByName.js
3916
+ ;// ../../node_modules/@popperjs/core/lib/utils/mergeByName.js
3917
3917
  function mergeByName(modifiers) {
3918
3918
  var merged = modifiers.reduce(function (merged, current) {
3919
3919
  var existing = merged[current.name];
@@ -3928,7 +3928,7 @@ function mergeByName(modifiers) {
3928
3928
  return merged[key];
3929
3929
  });
3930
3930
  }
3931
- ;// ./node_modules/@popperjs/core/lib/createPopper.js
3931
+ ;// ../../node_modules/@popperjs/core/lib/createPopper.js
3932
3932
 
3933
3933
 
3934
3934
 
@@ -4128,7 +4128,7 @@ function popperGenerator(generatorOptions) {
4128
4128
  var createPopper = /*#__PURE__*/(/* unused pure expression or super */ null && (popperGenerator())); // eslint-disable-next-line import/no-unused-modules
4129
4129
 
4130
4130
 
4131
- ;// ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js
4131
+ ;// ../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js
4132
4132
  // eslint-disable-next-line import/no-unused-modules
4133
4133
 
4134
4134
  var passive = {
@@ -4178,20 +4178,20 @@ function effect(_ref) {
4178
4178
  effect: effect,
4179
4179
  data: {}
4180
4180
  });
4181
- ;// ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js
4181
+ ;// ../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js
4182
4182
 
4183
4183
  function getBasePlacement(placement) {
4184
4184
  return placement.split('-')[0];
4185
4185
  }
4186
- ;// ./node_modules/@popperjs/core/lib/utils/getVariation.js
4186
+ ;// ../../node_modules/@popperjs/core/lib/utils/getVariation.js
4187
4187
  function getVariation(placement) {
4188
4188
  return placement.split('-')[1];
4189
4189
  }
4190
- ;// ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
4190
+ ;// ../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
4191
4191
  function getMainAxisFromPlacement(placement) {
4192
4192
  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
4193
4193
  }
4194
- ;// ./node_modules/@popperjs/core/lib/utils/computeOffsets.js
4194
+ ;// ../../node_modules/@popperjs/core/lib/utils/computeOffsets.js
4195
4195
 
4196
4196
 
4197
4197
 
@@ -4262,7 +4262,7 @@ function computeOffsets(_ref) {
4262
4262
 
4263
4263
  return offsets;
4264
4264
  }
4265
- ;// ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
4265
+ ;// ../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
4266
4266
 
4267
4267
 
4268
4268
  function popperOffsets(_ref) {
@@ -4288,7 +4288,7 @@ function popperOffsets(_ref) {
4288
4288
  fn: popperOffsets,
4289
4289
  data: {}
4290
4290
  });
4291
- ;// ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js
4291
+ ;// ../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js
4292
4292
 
4293
4293
 
4294
4294
 
@@ -4458,7 +4458,7 @@ function computeStyles(_ref5) {
4458
4458
  fn: computeStyles,
4459
4459
  data: {}
4460
4460
  });
4461
- ;// ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js
4461
+ ;// ../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js
4462
4462
 
4463
4463
  // This modifier takes the styles prepared by the `computeStyles` modifier
4464
4464
  // and applies them to the HTMLElements such as popper and arrow
@@ -4543,7 +4543,7 @@ function applyStyles_effect(_ref2) {
4543
4543
  effect: applyStyles_effect,
4544
4544
  requires: ['computeStyles']
4545
4545
  });
4546
- ;// ./node_modules/@popperjs/core/lib/modifiers/offset.js
4546
+ ;// ../../node_modules/@popperjs/core/lib/modifiers/offset.js
4547
4547
 
4548
4548
  // eslint-disable-next-line import/no-unused-modules
4549
4549
 
@@ -4598,7 +4598,7 @@ function offset(_ref2) {
4598
4598
  requires: ['popperOffsets'],
4599
4599
  fn: offset
4600
4600
  });
4601
- ;// ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js
4601
+ ;// ../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js
4602
4602
  var hash = {
4603
4603
  left: 'right',
4604
4604
  right: 'left',
@@ -4610,7 +4610,7 @@ function getOppositePlacement(placement) {
4610
4610
  return hash[matched];
4611
4611
  });
4612
4612
  }
4613
- ;// ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js
4613
+ ;// ../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js
4614
4614
  var getOppositeVariationPlacement_hash = {
4615
4615
  start: 'end',
4616
4616
  end: 'start'
@@ -4620,7 +4620,7 @@ function getOppositeVariationPlacement(placement) {
4620
4620
  return getOppositeVariationPlacement_hash[matched];
4621
4621
  });
4622
4622
  }
4623
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js
4623
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js
4624
4624
 
4625
4625
 
4626
4626
 
@@ -4652,7 +4652,7 @@ function getViewportRect(element, strategy) {
4652
4652
  y: y
4653
4653
  };
4654
4654
  }
4655
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js
4655
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js
4656
4656
 
4657
4657
 
4658
4658
 
@@ -4682,7 +4682,7 @@ function getDocumentRect(element) {
4682
4682
  y: y
4683
4683
  };
4684
4684
  }
4685
- ;// ./node_modules/@popperjs/core/lib/dom-utils/contains.js
4685
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/contains.js
4686
4686
 
4687
4687
  function contains(parent, child) {
4688
4688
  var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
@@ -4706,7 +4706,7 @@ function contains(parent, child) {
4706
4706
 
4707
4707
  return false;
4708
4708
  }
4709
- ;// ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js
4709
+ ;// ../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js
4710
4710
  function rectToClientRect(rect) {
4711
4711
  return Object.assign({}, rect, {
4712
4712
  left: rect.x,
@@ -4715,7 +4715,7 @@ function rectToClientRect(rect) {
4715
4715
  bottom: rect.y + rect.height
4716
4716
  });
4717
4717
  }
4718
- ;// ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js
4718
+ ;// ../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js
4719
4719
 
4720
4720
 
4721
4721
 
@@ -4786,7 +4786,7 @@ function getClippingRect(element, boundary, rootBoundary, strategy) {
4786
4786
  clippingRect.y = clippingRect.top;
4787
4787
  return clippingRect;
4788
4788
  }
4789
- ;// ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js
4789
+ ;// ../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js
4790
4790
  function getFreshSideObject() {
4791
4791
  return {
4792
4792
  top: 0,
@@ -4795,19 +4795,19 @@ function getFreshSideObject() {
4795
4795
  left: 0
4796
4796
  };
4797
4797
  }
4798
- ;// ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js
4798
+ ;// ../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js
4799
4799
 
4800
4800
  function mergePaddingObject(paddingObject) {
4801
4801
  return Object.assign({}, getFreshSideObject(), paddingObject);
4802
4802
  }
4803
- ;// ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js
4803
+ ;// ../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js
4804
4804
  function expandToHashMap(value, keys) {
4805
4805
  return keys.reduce(function (hashMap, key) {
4806
4806
  hashMap[key] = value;
4807
4807
  return hashMap;
4808
4808
  }, {});
4809
4809
  }
4810
- ;// ./node_modules/@popperjs/core/lib/utils/detectOverflow.js
4810
+ ;// ../../node_modules/@popperjs/core/lib/utils/detectOverflow.js
4811
4811
 
4812
4812
 
4813
4813
 
@@ -4873,7 +4873,7 @@ function detectOverflow(state, options) {
4873
4873
 
4874
4874
  return overflowOffsets;
4875
4875
  }
4876
- ;// ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js
4876
+ ;// ../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js
4877
4877
 
4878
4878
 
4879
4879
 
@@ -4917,7 +4917,7 @@ function computeAutoPlacement(state, options) {
4917
4917
  return overflows[a] - overflows[b];
4918
4918
  });
4919
4919
  }
4920
- ;// ./node_modules/@popperjs/core/lib/modifiers/flip.js
4920
+ ;// ../../node_modules/@popperjs/core/lib/modifiers/flip.js
4921
4921
 
4922
4922
 
4923
4923
 
@@ -5065,11 +5065,11 @@ function flip(_ref) {
5065
5065
  _skip: false
5066
5066
  }
5067
5067
  });
5068
- ;// ./node_modules/@popperjs/core/lib/utils/getAltAxis.js
5068
+ ;// ../../node_modules/@popperjs/core/lib/utils/getAltAxis.js
5069
5069
  function getAltAxis(axis) {
5070
5070
  return axis === 'x' ? 'y' : 'x';
5071
5071
  }
5072
- ;// ./node_modules/@popperjs/core/lib/utils/within.js
5072
+ ;// ../../node_modules/@popperjs/core/lib/utils/within.js
5073
5073
 
5074
5074
  function within(min, value, max) {
5075
5075
  return math_max(min, math_min(value, max));
@@ -5078,7 +5078,7 @@ function withinMaxClamp(min, value, max) {
5078
5078
  var v = within(min, value, max);
5079
5079
  return v > max ? max : v;
5080
5080
  }
5081
- ;// ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js
5081
+ ;// ../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js
5082
5082
 
5083
5083
 
5084
5084
 
@@ -5221,7 +5221,7 @@ function preventOverflow(_ref) {
5221
5221
  fn: preventOverflow,
5222
5222
  requiresIfExists: ['offset']
5223
5223
  });
5224
- ;// ./node_modules/@popperjs/core/lib/modifiers/arrow.js
5224
+ ;// ../../node_modules/@popperjs/core/lib/modifiers/arrow.js
5225
5225
 
5226
5226
 
5227
5227
 
@@ -5312,7 +5312,7 @@ function arrow_effect(_ref2) {
5312
5312
  requires: ['popperOffsets'],
5313
5313
  requiresIfExists: ['preventOverflow']
5314
5314
  });
5315
- ;// ./node_modules/@popperjs/core/lib/modifiers/hide.js
5315
+ ;// ../../node_modules/@popperjs/core/lib/modifiers/hide.js
5316
5316
 
5317
5317
 
5318
5318
 
@@ -5374,7 +5374,7 @@ function hide(_ref) {
5374
5374
  requiresIfExists: ['preventOverflow'],
5375
5375
  fn: hide
5376
5376
  });
5377
- ;// ./node_modules/@popperjs/core/lib/popper.js
5377
+ ;// ../../node_modules/@popperjs/core/lib/popper.js
5378
5378
 
5379
5379
 
5380
5380
 
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Stacks=t():e.Stacks=t()}(globalThis,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{BannerController:()=>ce,BasePopoverController:()=>Dt,ExpandableController:()=>ve,ModalController:()=>be,PopoverController:()=>Nt,StacksApplication:()=>se,StacksController:()=>oe,TabListController:()=>Oe,TableController:()=>Kt,ToastController:()=>Ht,TooltipController:()=>qt,UploaderController:()=>Yt,addController:()=>le,application:()=>re,attachPopover:()=>$t,createController:()=>ae,detachPopover:()=>jt,hideBanner:()=>de,hideModal:()=>Ee,hidePopover:()=>It,hideToast:()=>Ut,setTooltipHtml:()=>zt,setTooltipText:()=>Jt,showBanner:()=>he,showModal:()=>ye,showPopover:()=>Bt,showToast:()=>Rt});class n{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort(((e,t)=>{const n=e.index,i=t.index;return n<i?-1:n>i?1:0}))}}class i{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach((e=>e.connect())))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach((e=>e.disconnect())))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce(((e,t)=>e.concat(Array.from(t.values()))),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:n,eventOptions:i}=e,s=this.fetchEventListenerMapForEventTarget(t),r=this.cacheKey(n,i);s.delete(r),0==s.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:n,eventOptions:i}=e;return this.fetchEventListener(t,n,i)}fetchEventListener(e,t,n){const i=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,n);let r=i.get(s);return r||(r=this.createEventListener(e,t,n),i.set(s,r)),r}createEventListener(e,t,i){const s=new n(e,t,i);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const n=[e];return Object.keys(t).sort().forEach((e=>{n.push(`${t[e]?"":"!"}${e}`)})),n.join(":")}}const s={stop:({event:e,value:t})=>(t&&e.stopPropagation(),!0),prevent:({event:e,value:t})=>(t&&e.preventDefault(),!0),self:({event:e,value:t,element:n})=>!t||n===e.target},r=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function o(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function a(e){return o(e.replace(/--/g,"-").replace(/__/g,"_"))}function l(e){return e.charAt(0).toUpperCase()+e.slice(1)}function c(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function h(e){return null!=e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const u=["meta","ctrl","alt","shift"];class p{constructor(e,t,n,i){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){const t=e.tagName.toLowerCase();if(t in m)return m[t](e)}(e)||f("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||f("missing identifier"),this.methodName=n.methodName||f("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=i}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(r)||[];let n=t[2],i=t[3];return i&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${i}`,i=""),{eventTarget:(s=t[4],"window"==s?window:"document"==s?document:void 0),eventName:n,eventOptions:t[7]?(o=t[7],o.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||i};var s,o}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const n=t.filter((e=>!u.includes(e)))[0];return!!n&&(d(this.keyMappings,n)||f(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:i}of Array.from(this.element.attributes)){const s=n.match(t),r=s&&s[1];r&&(e[o(r)]=g(i))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,i,s,r]=u.map((e=>t.includes(e)));return e.metaKey!==n||e.ctrlKey!==i||e.altKey!==s||e.shiftKey!==r}}const m={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function f(e){throw new Error(e)}function g(e){try{return JSON.parse(e)}catch(t){return e}}class v{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:i}=this.context;let s=!0;for(const[r,o]of Object.entries(this.eventOptions))if(r in n){const a=n[r];s=s&&a({name:r,value:o,event:e,element:t,controller:i})}return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:n}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){const{identifier:n,controller:i,element:s,index:r}=this,o={identifier:n,controller:i,element:s,index:r,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class b{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class y{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new b(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function E(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}class w{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e.concat(Array.from(t))),[])}get size(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e+t.size),0)}add(e,t){!function(e,t,n){E(e,t).add(n)}(this.valuesByKey,e,t)}delete(e,t){!function(e,t,n){E(e,t).delete(n),function(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}(e,t)}(this.valuesByKey,e,t)}has(e,t){const n=this.valuesByKey.get(e);return null!=n&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some((t=>t.has(e)))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter((([t,n])=>n.has(e))).map((([e,t])=>e))}}class O{constructor(e,t,n,i){this._selector=t,this.details=i,this.elementObserver=new b(e,this),this.delegate=n,this.matchesByElement=new w}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const n=e.matches(t);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(e,this.details):n}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const n=this.matchElement(e)?[e]:[],i=Array.from(e.querySelectorAll(t)).filter((e=>this.matchElement(e)));return n.concat(i)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const n of t)this.selectorUnmatched(e,n)}elementAttributeChanged(e,t){const{selector:n}=this;if(n){const t=this.matchElement(e),i=this.matchesByElement.has(n,e);t&&!i?this.selectorMatched(e,n):!t&&i&&this.selectorUnmatched(e,n)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class A{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const n=this.delegate.getStringMapKeyForAttribute(e);if(null!=n){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);const i=this.element.getAttribute(e);if(this.stringMap.get(e)!=i&&this.stringMapValueChanged(i,n,t),null==i){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,i)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map((e=>e.name))}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class T{constructor(e,t,n){this.attributeObserver=new y(e,t,this),this.delegate=n,this.tokensByElement=new w}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach((e=>this.tokenMatched(e)))}tokensUnmatched(e){e.forEach((e=>this.tokenUnmatched(e)))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),i=function(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},((n,i)=>[e[i],t[i]]))}(t,n).findIndex((([e,t])=>!function(e,t){return e&&t&&e.index==t.index&&e.content==t.content}(e,t)));return-1==i?[[],[]]:[t.slice(i),n.slice(i)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,n){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,i)=>({element:t,attributeName:n,content:e,index:i})))}(e.getAttribute(t)||"",e,t)}}class x{constructor(e,t,n){this.tokenListObserver=new T(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class k{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new x(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new v(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach((e=>this.delegate.bindingDisconnected(e,!0))),this.bindingsByAction.clear()}parseValueForToken(e){const t=p.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class C{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new A(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){const i=this.valueDescriptorNameMap[t];null!==e&&(null===n&&(n=i.writer(i.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){const i=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,i.writer(this.receiver[e]),n):this.invokeChangedCallback(e,i.writer(i.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:n,writer:i}of this.valueDescriptors)null==n||this.controller.data.has(e)||this.invokeChangedCallback(t,i(n),void 0)}invokeChangedCallback(e,t,n){const i=`${e}Changed`,s=this.receiver[i];if("function"==typeof s){const i=this.valueDescriptorNameMap[e];try{const e=i.reader(t);let r=n;n&&(r=i.reader(n)),s.call(this.receiver,e,r)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${i.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map((t=>e[t]))}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach((t=>{const n=this.valueDescriptorMap[t];e[n.name]=n})),e}hasValue(e){const t=`has${l(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class M{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new w}start(){this.tokenListObserver||(this.tokenListObserver=new T(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetConnected(e,t))))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetDisconnected(e,t))))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function L(e,t){const n=F(e);return Array.from(n.reduce(((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach((t=>e.add(t))),e)),new Set))}function F(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class S{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new w,this.outletElementsByName=new w,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach((e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)})),this.started=!0,this.dependentContexts.forEach((e=>e.refresh())))}refresh(){this.selectorObserverMap.forEach((e=>e.refresh())),this.attributeObserverMap.forEach((e=>e.refresh()))}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach((e=>e.stop())),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach((e=>e.stop())),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:n}){const i=this.getOutlet(e,n);i&&this.connectOutlet(i,e,n)}selectorUnmatched(e,t,{outletName:n}){const i=this.getOutletFromMap(e,n);i&&this.disconnectOutlet(i,e,n)}selectorMatchElement(e,{outletName:t}){const n=this.selector(t),i=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&i&&s&&e.matches(n)}elementMatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(e,t,n){var i;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause((()=>this.delegate.outletConnected(e,t,n))))}disconnectOutlet(e,t,n){var i;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause((()=>this.delegate.outletDisconnected(e,t,n))))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),n=new O(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new y(this.scope.element,t,this);this.attributeObserverMap.set(e,n),n.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find((t=>this.attributeNameForOutletName(t)===e))}get outletDependencies(){const e=new w;return this.router.modules.forEach((t=>{L(t.definition.controllerConstructor,"outlets").forEach((n=>e.add(n,t.identifier)))})),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter((t=>e.includes(t.identifier)))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find((t=>t.element===e))}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class D{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:i,element:s}=this;t=Object.assign({identifier:n,controller:i,element:s},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new k(this,this.dispatcher),this.valueObserver=new C(this,this.controller),this.targetObserver=new M(this,this),this.outletObserver=new S(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){const{identifier:i,controller:s,element:r}=this;n=Object.assign({identifier:i,controller:s,element:r},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${a(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${a(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}const N="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,B=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e((function(){this.a.call(this)}));t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class I{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:(t=e.controllerConstructor,function(e,t){const n=B(e),i=function(e,t){return N(t).reduce(((n,i)=>{const s=function(e,t,n){const i=Object.getOwnPropertyDescriptor(e,n);if(!i||!("value"in i)){const e=Object.getOwnPropertyDescriptor(t,n).value;return i&&(e.get=i.get||e.get,e.set=i.set||e.set),e}}(e,t,i);return s&&Object.assign(n,{[i]:s}),n}),{})}(e.prototype,t);return Object.defineProperties(n.prototype,i),n}(t,function(e){return L(e,"blessings").reduce(((t,n)=>{const i=n(e);for(const e in i){const n=t[e]||{};t[e]=Object.assign(n,i[e])}return t}),{})}(t)))};var t}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new D(this,e),this.contextsByScope.set(e,t)),t}}class ${constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){return(this.data.get(this.getDataKey(e))||"").match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class j{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${c(e)}`}}class P{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let i=this.warnedKeysByObject.get(e);i||(i=new Set,this.warnedKeysByObject.set(e,i)),i.has(t)||(i.add(t),this.logger.warn(n,e))}}function V(e,t){return`[${e}~="${t}"]`}class K{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)]),[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return V(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map((t=>this.deprecate(t,e)))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return V(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,i=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${i}="${n}.${t}" with ${s}="${t}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class _{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findOutlet(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllOutlets(t)]),[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))}matchesElement(e,t,n){const i=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&i.split(" ").includes(n)}}class H{constructor(e,t,n,i){this.targets=new K(this),this.classes=new $(this),this.data=new j(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new P(i),this.outlets=new _(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return V(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new H(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class R{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new x(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:n}=e;return this.parseValueForElementAndIdentifier(t,n)}parseValueForElementAndIdentifier(e,t){const n=this.fetchScopesByIdentifierForElement(e);let i=n.get(t);return i||(i=this.delegate.createScopeForElementAndIdentifier(e,t),n.set(t,i)),i}elementMatchedValue(e,t){const n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class U{constructor(e){this.application=e,this.scopeObserver=new R(this.element,this.schema,this),this.scopesByIdentifier=new w,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce(((e,t)=>e.concat(t.contexts)),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new I(this.application,e);this.connectModule(t);const n=e.controllerConstructor.afterLoad;n&&n.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find((t=>t.element==e))}proposeToConnectScopeForElementAndIdentifier(e,t){const n=this.scopeObserver.parseValueForElementAndIdentifier(e,t);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,n){this.application.handleError(e,t,n)}createScopeForElementAndIdentifier(e,t){return new H(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.connectContextForScope(t)))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.disconnectContextForScope(t)))}}const W={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},q("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),q("0123456789".split("").map((e=>[e,e]))))};function q(e){return e.reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})}class z{constructor(e=document.documentElement,t=W){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new i(this),this.router=new U(this),this.actionDescriptorFilters=Object.assign({},s)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()})),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)}))}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>this.router.unloadIdentifier(e)))}get controllers(){return this.router.contexts.map((e=>e.controller))}getControllerForElementAndIdentifier(e,t){const n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var i;this.logger.error("%s\n\n%o\n\n%o",t,e,n),null===(i=window.onerror)||void 0===i||i.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}}function J(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function X(e,t,n){let i=J(e,t,n);return i||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),i=J(e,t,n),i||void 0)}function Y([e,t],n){return function(e){const{token:t,typeDefinition:n}=e,i=`${c(t)}-value`,s=function(e){const{controller:t,token:n,typeDefinition:i}=e,s=function(e){const{controller:t,token:n,typeObject:i}=e,s=h(i.type),r=h(i.default),o=s&&r,a=s&&!r,l=!s&&r,c=Z(i.type),d=G(e.typeObject.default);if(a)return c;if(l)return d;if(c!==d)throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${n}`:n}" must match the defined type "${c}". The provided default value of "${i.default}" is of type "${d}".`);return o?c:void 0}({controller:t,token:n,typeObject:i}),r=G(i),o=Z(i),a=s||r||o;if(a)return a;throw new Error(`Unknown value type "${t?`${t}.${i}`:n}" for "${n}" value`)}(e);return{type:s,key:i,name:o(i),get defaultValue(){return function(e){const t=Z(e);if(t)return Q[t];const n=d(e,"default"),i=d(e,"type"),s=e;if(n)return s.default;if(i){const{type:e}=s,t=Z(e);if(t)return Q[t]}return e}(n)},get hasCustomDefaultValue(){return void 0!==G(n)},reader:ee[s],writer:te[s]||te.default}}({controller:n,token:e,typeDefinition:t})}function Z(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function G(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const Q={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},ee={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${G(t)}"`);return t},boolean:e=>!("0"==e||"false"==String(e).toLowerCase()),number:e=>Number(e.replace(/_/g,"")),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${G(t)}"`);return t},string:e=>e},te={default:function(e){return`${e}`},array:ne,object:ne};function ne(e){return JSON.stringify(e)}class ie{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:i=this.identifier,bubbles:s=!0,cancelable:r=!0}={}){const o=new CustomEvent(i?`${i}:${e}`:e,{detail:n,bubbles:s,cancelable:r});return t.dispatchEvent(o),o}}ie.blessings=[function(e){return L(e,"classes").reduce(((e,t)=>{return Object.assign(e,(n=t,{[`${n}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${l(n)}Class`]:{get(){return this.classes.has(n)}}}));var n}),{})},function(e){return L(e,"targets").reduce(((e,t)=>{return Object.assign(e,(n=t,{[`${n}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${l(n)}Target`]:{get(){return this.targets.has(n)}}}));var n}),{})},function(e){const t=function(e,t){return F(e).reduce(((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map((e=>[e,n[e]])):[]}(n,t)),e)),[])}(e,"values"),n={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const n=Y(t,this.identifier),i=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[i]:n})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,function(e){const t=Y(e,void 0),{key:n,name:i,reader:s,writer:r}=t;return{[i]:{get(){const e=this.data.get(n);return null!==e?s(e):t.defaultValue},set(e){void 0===e?this.data.delete(n):this.data.set(n,r(e))}},[`has${l(i)}`]:{get(){return this.data.has(n)||t.hasCustomDefaultValue}}}}(t))),n)},function(e){return L(e,"outlets").reduce(((e,t)=>Object.assign(e,function(e){const t=a(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=X(this,t,e);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map((t=>{const n=X(this,t,e);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)})).filter((e=>e)):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${l(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t))),{})}],ie.targets=[],ie.outlets=[],ie.values={};class se extends z{load(e,...t){const n=Array.isArray(e)?e:[e,...t];for(const e of n){const t=/^s-/.test(e.identifier);if(se._initializing&&!t)throw'Stacks-created Stimulus controller names must start with "s-".';if(!se._initializing&&t)throw'The "s-" prefix on Stimulus controller names is reserved for Stacks-created controllers.'}super.load(n)}static start(e,t){const n=new se(e,t);return n.start(),n}static finalize(){se._initializing=!1}}se._initializing=!0;const re=se.start();class oe extends ie{getElementData(e,t){return e.getAttribute("data-"+this.identifier+"-"+t)}setElementData(e,t,n){e.setAttribute("data-"+this.identifier+"-"+t,n)}removeElementData(e,t){e.removeAttribute("data-"+this.identifier+"-"+t)}triggerEvent(e,t,n){const i=this.identifier+":"+e;let s;try{s=new CustomEvent(i,{bubbles:!0,cancelable:!0,detail:t})}catch(e){s=document.createEvent("CustomEvent"),s.initCustomEvent(i,!0,!0,t)}return(n||this.element).dispatchEvent(s),s}}function ae(e){var t,n;const i=e.hasOwnProperty("targets")?((n=class extends oe{}).targets=null!==(t=e.targets)&&void 0!==t?t:[],n):class extends oe{};for(const t in e){const n=e.hasOwnProperty(t)&&Object.getOwnPropertyDescriptor(e,t);"targets"!==t&&n&&Object.defineProperty(i.prototype,t,n)}return i}function le(e,t){re.register(e,ae(t))}class ce extends oe{toggle(e=null){this._toggle(void 0,e)}show(e=null){this._toggle(!0,e)}hide(e=null){this._toggle(!1,e)}_toggle(e,t=null){let n=e;const i="false"===this.bannerTarget.getAttribute("aria-hidden");if(void 0===n&&(n=!i),n&&i||!n&&!i)return;const s=this.getDispatcher(t);this.triggerEvent(n?"show":"hide",{dispatcher:this.getDispatcher(s)},this.bannerTarget).defaultPrevented||(this.bannerTarget.setAttribute("aria-hidden",n?"false":"true"),n||this.removeBannerOnHide(),this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.bannerTarget))}removeBannerOnHide(){"true"===this.data.get("remove-when-hidden")&&this.bannerTarget.addEventListener("s-banner:hidden",(()=>{this.element.remove()}),{once:!0})}getDispatcher(e=null){return e instanceof Event?e.target:e instanceof Element?e:this.element}}function he(e){ue(e,!0)}function de(e){ue(e,!1)}function ue(e,t){const n=re.getControllerForElementAndIdentifier(e,"s-banner");if(!n)throw"Unable to get s-banner controller from element";t?n.show():n.hide()}ce.targets=["banner"];const pe="s-expandable-control:radio-off";function me(e){const t=e.target;t instanceof HTMLInputElement&&"INPUT"===t.nodeName&&"radio"===t.type&&document.querySelectorAll('input[type="radio"][name="'+t.name+'"]').forEach((function(t){if(t===e.target)return;let n;try{n=new Event(pe)}catch(e){n=document.createEvent("Event"),n.initEvent(pe,!0,!0)}t.dispatchEvent(n)}))}let fe=0;function ge(e){e?(fe++,1===fe&&document.body.addEventListener("change",me)):(fe--,0===fe&&document.body.removeEventListener("change",me))}class ve extends oe{constructor(){super(...arguments),this.lastKeydownClickTimestamp=0}initialize(){"INPUT"===this.element.nodeName&&["radio","checkbox"].indexOf(this.element.type)>=0?(this.isCollapsed=this._isCollapsedForCheckable.bind(this),this.events=["change",pe],this.isCheckable=!0,this.isRadio="radio"===this.element.type):(this.isCollapsed=this._isCollapsedForClickable.bind(this),this.events=["click","keydown"]),this.listener=this.listener.bind(this)}_isCollapsedForClickable(){const e=this.controlledExpandables;return e.length>0?!e.every((e=>e.classList.contains("is-expanded"))):"false"===this.element.getAttribute("aria-expanded")}_isCollapsedForCheckable(){return!this.element.checked}get controlledExpandables(){const e=this.element.getAttribute("aria-controls");if(!e)throw'[aria-controls="targetId1 ... targetIdN"] attribute required';const t=e.split(/\s+/g).map((e=>document.getElementById(e))).filter((e=>!!e));if(!t.length)throw"couldn't find controls";return t}_dispatchShowHideEvent(e){this.triggerEvent(e?"show":"hide")}_toggleClass(e){if(!this.data.has("toggle-class"))return;const t=this.element.classList,n=this.data.get("toggle-class");if(!n)throw"couldn't find toggle class";n.split(/\s+/).forEach((function(n){t.toggle(n,!!e)}))}listener(e){let t;if(this.isCheckable)t=!this.element.checked;else{if("keydown"==e.type&&e instanceof KeyboardEvent&&13!=e.keyCode&&32!=e.keyCode)return;if(e.target!==e.currentTarget&&["A","BUTTON"].indexOf(e.target.nodeName)>=0)return;if(e.preventDefault(),"keydown"==e.type)this.lastKeydownClickTimestamp=Date.now();else if("click"==e.type&&Date.now()-this.lastKeydownClickTimestamp<300)return;t="true"===this.element.getAttribute("aria-expanded"),"click"===e.type&&this.element.blur()}this.element.setAttribute("aria-expanded",t?"false":"true");for(const e of this.controlledExpandables)e.classList.toggle("is-expanded",!t);this._dispatchShowHideEvent(!t),this._toggleClass(!t)}connect(){if(this.events.forEach((e=>{this.element.addEventListener(e,this.listener.bind(this))}),this),this.isRadio&&ge(!0),this.isRadio||this.element.setAttribute("aria-expanded",this.isCollapsed()?"false":"true"),this.isCheckable){const e=this.controlledExpandables;if(e.length){const t=!this.isCollapsed();if(e.some((e=>e.classList.contains("is-expanded")!==t))){for(const e of this.controlledExpandables)e.classList.toggle("is-expanded",t);this._dispatchShowHideEvent(t),this._toggleClass(t)}}}}disconnect(){this.events.forEach((e=>{this.element.removeEventListener(e,this.listener.bind(this))}),this),this.isRadio&&ge(!1)}}class be extends oe{connect(){this.validate()}disconnect(){this.unbindDocumentEvents()}toggle(e=null){this._toggle(void 0,e)}show(e=null){this._toggle(!0,e)}hide(e=null){this._toggle(!1,e)}validate(){const e=this.data.get("return-element");if(e&&(this.returnElement=document.querySelector(e),!this.returnElement))throw"Unable to find element by return-element selector: "+e}_toggle(e,t=null){let n=e;const i="false"===this.modalTarget.getAttribute("aria-hidden");if(void 0===n&&(n=!i),n&&i||!n&&!i)return;const s=this.getDispatcher(t),r=this.triggerEvent(n?"show":"hide",{returnElement:this.returnElement,dispatcher:this.getDispatcher(s)},this.modalTarget);r.defaultPrevented||(this.returnElement=r.detail.returnElement,this.modalTarget.setAttribute("aria-hidden",n?"false":"true"),n?(this.bindDocumentEvents(),this.focusInsideModal()):(this.unbindDocumentEvents(),this.focusReturnElement(),this.removeModalOnHide()),void 0!==this.modalTarget.ontransitionend?this.modalTarget.addEventListener("transitionend",(()=>{this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.modalTarget)}),{once:!0}):this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.modalTarget))}focusReturnElement(){this.returnElement&&this.modalTarget.addEventListener("s-modal:hidden",(()=>{this.returnElement&&document.body.contains(this.returnElement)&&this.returnElement.focus()}),{once:!0})}removeModalOnHide(){"true"===this.data.get("remove-when-hidden")&&this.modalTarget.addEventListener("s-modal:hidden",(()=>{this.element.remove()}),{once:!0})}getAllTabbables(){return Array.from(this.modalTarget.querySelectorAll("[href], input, select, textarea, button, [tabindex]")).filter((e=>e.matches(":not([disabled]):not([tabindex='-1'])")))}firstVisible(e){return e.find((e=>null!==e.offsetParent))}lastVisible(e){return this.firstVisible([...e].reverse())}focusInsideModal(){this.modalTarget.addEventListener("s-modal:shown",(()=>{var e,t;this.modalTarget.contains(document.activeElement)||(null!==(t=null!==(e=this.firstVisible(this.initialFocusTargets))&&void 0!==e?e:this.firstVisible(this.getAllTabbables()))&&void 0!==t?t:this.modalTarget).focus()}),{once:!0})}keepFocusWithinModal(e){if("Tab"!==e.key)return;const t=this.getAllTabbables();if(0===t.length)return void e.preventDefault();if(!this.modalTarget.contains(e.target)){const n=this.firstVisible(t);return void(n&&(e.preventDefault(),n.focus()))}const n=this.firstVisible(t),i=this.lastVisible(t);n&&i&&(n===i?(e.preventDefault(),n.focus()):e.shiftKey&&e.target===n?(e.preventDefault(),i.focus()):e.shiftKey||e.target!==i||(e.preventDefault(),n.focus()))}bindDocumentEvents(){this._boundClickFn=this._boundClickFn||this.hideOnOutsideClick.bind(this),this._boundKeypressFn=this._boundKeypressFn||this.hideOnEscapePress.bind(this),this._boundTabTrap=this._boundTabTrap||this.keepFocusWithinModal.bind(this),document.addEventListener("mousedown",this._boundClickFn),document.addEventListener("keyup",this._boundKeypressFn),document.addEventListener("keydown",this._boundTabTrap)}unbindDocumentEvents(){document.removeEventListener("mousedown",this._boundClickFn),document.removeEventListener("keyup",this._boundKeypressFn),document.removeEventListener("keydown",this._boundTabTrap)}hideOnOutsideClick(e){var t;const n=e.target;!(null===(t=this.modalTarget.querySelector(".s-modal--dialog"))||void 0===t?void 0:t.contains(n))&&document.body.contains(n)&&this._toggle(!1,e)}hideOnEscapePress(e){27===e.which&&"true"!==this.modalTarget.getAttribute("aria-hidden")&&this._toggle(!1,e)}getDispatcher(e=null){return e instanceof Event?e.target:e instanceof Element?e:this.element}}function ye(e){we(e,!0)}function Ee(e){we(e,!1)}function we(e,t){const n=re.getControllerForElementAndIdentifier(e,"s-modal");if(!n)throw"Unable to get s-modal controller from element";t?n.show():n.hide()}be.targets=["modal","initialFocus"];class Oe extends oe{connect(){super.connect(),this.boundSelectTab=this.selectTab.bind(this),this.boundHandleKeydown=this.handleKeydown.bind(this);for(const e of this.tabTargets)e.addEventListener("click",this.boundSelectTab),e.addEventListener("keydown",this.boundHandleKeydown)}disconnect(){super.disconnect();for(const e of this.tabTargets)e.removeEventListener("click",this.boundSelectTab),e.removeEventListener("keydown",this.boundHandleKeydown)}get tabTargets(){return Array.from(this.element.querySelectorAll("[role=tab]"))}selectTab(e){this.switchToTab(e.currentTarget)}handleKeydown(e){var t;let n=e.currentTarget;const i=this.tabTargets;let s=i.indexOf(n);if("ArrowRight"===e.key)s++;else{if("ArrowLeft"!==e.key)return;s--}s<0&&(s=i.length-1),s>=i.length&&(s=0),n=i[s],this.switchToTab(n),null===(t=this.selectedTab)||void 0===t||t.focus()}switchToTab(e){const t=this.selectedTab;t!==e&&(this.triggerEvent("select",{oldTab:t,newTab:e}).defaultPrevented||(this.selectedTab=e,this.triggerEvent("selected",{oldTab:t,newTab:e})))}get selectedTab(){return this.tabTargets.find((e=>"true"===e.getAttribute("aria-selected")))||null}set selectedTab(e){for(const t of this.tabTargets){const n=t.getAttribute("aria-controls"),i=n?document.getElementById(n):null;t===e?(t.classList.add("is-selected"),t.setAttribute("aria-selected","true"),t.removeAttribute("tabindex"),null==i||i.classList.remove("d-none")):(t.classList.remove("is-selected"),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1"),null==i||i.classList.add("d-none"))}}}function Ae(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Te(e){return e instanceof Ae(e).Element||e instanceof Element}function xe(e){return e instanceof Ae(e).HTMLElement||e instanceof HTMLElement}function ke(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Ae(e).ShadowRoot||e instanceof ShadowRoot)}var Ce=Math.max,Me=Math.min,Le=Math.round;function Fe(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Se(){return!/^((?!chrome|android).)*safari/i.test(Fe())}function De(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),s=1,r=1;t&&xe(e)&&(s=e.offsetWidth>0&&Le(i.width)/e.offsetWidth||1,r=e.offsetHeight>0&&Le(i.height)/e.offsetHeight||1);var o=(Te(e)?Ae(e):window).visualViewport,a=!Se()&&n,l=(i.left+(a&&o?o.offsetLeft:0))/s,c=(i.top+(a&&o?o.offsetTop:0))/r,h=i.width/s,d=i.height/r;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ne(e){var t=Ae(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Be(e){return e?(e.nodeName||"").toLowerCase():null}function Ie(e){return((Te(e)?e.ownerDocument:e.document)||window.document).documentElement}function $e(e){return De(Ie(e)).left+Ne(e).scrollLeft}function je(e){return Ae(e).getComputedStyle(e)}function Pe(e){var t=je(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function Ve(e,t,n){void 0===n&&(n=!1);var i,s,r=xe(t),o=xe(t)&&function(e){var t=e.getBoundingClientRect(),n=Le(t.width)/e.offsetWidth||1,i=Le(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),a=Ie(t),l=De(e,o,n),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(r||!r&&!n)&&(("body"!==Be(t)||Pe(a))&&(c=(i=t)!==Ae(i)&&xe(i)?{scrollLeft:(s=i).scrollLeft,scrollTop:s.scrollTop}:Ne(i)),xe(t)?((h=De(t,!0)).x+=t.clientLeft,h.y+=t.clientTop):a&&(h.x=$e(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Ke(e){var t=De(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function _e(e){return"html"===Be(e)?e:e.assignedSlot||e.parentNode||(ke(e)?e.host:null)||Ie(e)}function He(e){return["html","body","#document"].indexOf(Be(e))>=0?e.ownerDocument.body:xe(e)&&Pe(e)?e:He(_e(e))}function Re(e,t){var n;void 0===t&&(t=[]);var i=He(e),s=i===(null==(n=e.ownerDocument)?void 0:n.body),r=Ae(i),o=s?[r].concat(r.visualViewport||[],Pe(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(Re(_e(o)))}function Ue(e){return["table","td","th"].indexOf(Be(e))>=0}function We(e){return xe(e)&&"fixed"!==je(e).position?e.offsetParent:null}function qe(e){for(var t=Ae(e),n=We(e);n&&Ue(n)&&"static"===je(n).position;)n=We(n);return n&&("html"===Be(n)||"body"===Be(n)&&"static"===je(n).position)?t:n||function(e){var t=/firefox/i.test(Fe());if(/Trident/i.test(Fe())&&xe(e)&&"fixed"===je(e).position)return null;var n=_e(e);for(ke(n)&&(n=n.host);xe(n)&&["html","body"].indexOf(Be(n))<0;){var i=je(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}var ze="top",Je="bottom",Xe="right",Ye="left",Ze="auto",Ge=[ze,Je,Xe,Ye],Qe="start",et="end",tt="viewport",nt="popper",it=Ge.reduce((function(e,t){return e.concat([t+"-"+Qe,t+"-"+et])}),[]),st=[].concat(Ge,[Ze]).reduce((function(e,t){return e.concat([t,t+"-"+Qe,t+"-"+et])}),[]),rt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ot(e){var t=new Map,n=new Set,i=[];function s(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&s(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||s(e)})),i}var at={placement:"bottom",modifiers:[],strategy:"absolute"};function lt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function ct(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,s=t.defaultOptions,r=void 0===s?at:s;return function(e,t,n){void 0===n&&(n=r);var s,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},at,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,h={state:a,setOptions:function(n){var s="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},r,a.options,s),a.scrollParents={reference:Te(e)?Re(e):e.contextElement?Re(e.contextElement):[],popper:Re(t)};var o,c,u=function(e){var t=ot(e);return rt.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((o=[].concat(i,a.options.modifiers),c=o.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(c).map((function(e){return c[e]}))));return a.orderedModifiers=u.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,s=e.effect;if("function"==typeof s){var r=s({state:a,name:t,instance:h,options:i});l.push(r||function(){})}})),h.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(lt(t,n)){a.rects={reference:Ve(t,qe(n),"fixed"===a.options.strategy),popper:Ke(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var s=a.orderedModifiers[i],r=s.fn,o=s.options,l=void 0===o?{}:o,d=s.name;"function"==typeof r&&(a=r({state:a,options:l,name:d,instance:h})||a)}else a.reset=!1,i=-1}}},update:(s=function(){return new Promise((function(e){h.forceUpdate(),e(a)}))},function(){return o||(o=new Promise((function(e){Promise.resolve().then((function(){o=void 0,e(s())}))}))),o}),destroy:function(){d(),c=!0}};if(!lt(e,t))return h;function d(){l.forEach((function(e){return e()})),l=[]}return h.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),h}}var ht={passive:!0};function dt(e){return e.split("-")[0]}function ut(e){return e.split("-")[1]}function pt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function mt(e){var t,n=e.reference,i=e.element,s=e.placement,r=s?dt(s):null,o=s?ut(s):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(r){case ze:t={x:a,y:n.y-i.height};break;case Je:t={x:a,y:n.y+n.height};break;case Xe:t={x:n.x+n.width,y:l};break;case Ye:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var c=r?pt(r):null;if(null!=c){var h="y"===c?"height":"width";switch(o){case Qe:t[c]=t[c]-(n[h]/2-i[h]/2);break;case et:t[c]=t[c]+(n[h]/2-i[h]/2)}}return t}var ft={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gt(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,h=e.roundOffsets,d=e.isFixed,u=o.x,p=void 0===u?0:u,m=o.y,f=void 0===m?0:m,g="function"==typeof h?h({x:p,y:f}):{x:p,y:f};p=g.x,f=g.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=Ye,E=ze,w=window;if(c){var O=qe(n),A="clientHeight",T="clientWidth";O===Ae(n)&&"static"!==je(O=Ie(n)).position&&"absolute"===a&&(A="scrollHeight",T="scrollWidth"),(s===ze||(s===Ye||s===Xe)&&r===et)&&(E=Je,f-=(d&&O===w&&w.visualViewport?w.visualViewport.height:O[A])-i.height,f*=l?1:-1),s!==Ye&&(s!==ze&&s!==Je||r!==et)||(y=Xe,p-=(d&&O===w&&w.visualViewport?w.visualViewport.width:O[T])-i.width,p*=l?1:-1)}var x,k=Object.assign({position:a},c&&ft),C=!0===h?function(e,t){var n=e.x,i=e.y,s=t.devicePixelRatio||1;return{x:Le(n*s)/s||0,y:Le(i*s)/s||0}}({x:p,y:f},Ae(n)):{x:p,y:f};return p=C.x,f=C.y,l?Object.assign({},k,((x={})[E]=b?"0":"",x[y]=v?"0":"",x.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+f+"px)":"translate3d("+p+"px, "+f+"px, 0)",x)):Object.assign({},k,((t={})[E]=b?f+"px":"",t[y]=v?p+"px":"",t.transform="",t))}var vt={left:"right",right:"left",bottom:"top",top:"bottom"};function bt(e){return e.replace(/left|right|bottom|top/g,(function(e){return vt[e]}))}var yt={start:"end",end:"start"};function Et(e){return e.replace(/start|end/g,(function(e){return yt[e]}))}function wt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ke(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ot(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function At(e,t,n){return t===tt?Ot(function(e,t){var n=Ae(e),i=Ie(e),s=n.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=Se();(c||!c&&"fixed"===t)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+$e(e),y:l}}(e,n)):Te(t)?function(e,t){var n=De(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Ot(function(e){var t,n=Ie(e),i=Ne(e),s=null==(t=e.ownerDocument)?void 0:t.body,r=Ce(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Ce(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+$e(e),l=-i.scrollTop;return"rtl"===je(s||n).direction&&(a+=Ce(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}(Ie(e)))}function Tt(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function xt(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function kt(e,t){void 0===t&&(t={});var n=t,i=n.placement,s=void 0===i?e.placement:i,r=n.strategy,o=void 0===r?e.strategy:r,a=n.boundary,l=void 0===a?"clippingParents":a,c=n.rootBoundary,h=void 0===c?tt:c,d=n.elementContext,u=void 0===d?nt:d,p=n.altBoundary,m=void 0!==p&&p,f=n.padding,g=void 0===f?0:f,v=Tt("number"!=typeof g?g:xt(g,Ge)),b=u===nt?"reference":nt,y=e.rects.popper,E=e.elements[m?b:u],w=function(e,t,n,i){var s="clippingParents"===t?function(e){var t=Re(_e(e)),n=["absolute","fixed"].indexOf(je(e).position)>=0&&xe(e)?qe(e):e;return Te(n)?t.filter((function(e){return Te(e)&&wt(e,n)&&"body"!==Be(e)})):[]}(e):[].concat(t),r=[].concat(s,[n]),o=r[0],a=r.reduce((function(t,n){var s=At(e,n,i);return t.top=Ce(s.top,t.top),t.right=Me(s.right,t.right),t.bottom=Me(s.bottom,t.bottom),t.left=Ce(s.left,t.left),t}),At(e,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(Te(E)?E:E.contextElement||Ie(e.elements.popper),l,h,o),O=De(e.elements.reference),A=mt({reference:O,element:y,strategy:"absolute",placement:s}),T=Ot(Object.assign({},y,A)),x=u===nt?T:O,k={top:w.top-x.top+v.top,bottom:x.bottom-w.bottom+v.bottom,left:w.left-x.left+v.left,right:x.right-w.right+v.right},C=e.modifiersData.offset;if(u===nt&&C){var M=C[s];Object.keys(k).forEach((function(e){var t=[Xe,Je].indexOf(e)>=0?1:-1,n=[ze,Je].indexOf(e)>=0?"y":"x";k[e]+=M[n]*t}))}return k}function Ct(e,t,n){return Ce(e,Me(t,n))}function Mt(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Lt(e){return[ze,Xe,Je,Ye].some((function(t){return e[t]>=0}))}var Ft,St=ct({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=void 0===s||s,o=i.resize,a=void 0===o||o,l=Ae(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach((function(e){e.addEventListener("scroll",n.update,ht)})),a&&l.addEventListener("resize",n.update,ht),function(){r&&c.forEach((function(e){e.removeEventListener("scroll",n.update,ht)})),a&&l.removeEventListener("resize",n.update,ht)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=mt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=void 0===i||i,r=n.adaptive,o=void 0===r||r,a=n.roundOffsets,l=void 0===a||a,c={placement:dt(t.placement),variation:ut(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,gt(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,gt(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},s=t.elements[e];xe(s)&&Be(s)&&(Object.assign(s.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],s=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});xe(i)&&Be(i)&&(Object.assign(i.style,r),Object.keys(s).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=void 0===s?[0,0]:s,o=st.reduce((function(e,n){return e[n]=function(e,t,n){var i=dt(e),s=[Ye,ze].indexOf(i)>=0?-1:1,r="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[Ye,Xe].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}(n,t.rects,r),e}),{}),a=o[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=void 0===s||s,o=n.altAxis,a=void 0===o||o,l=n.fallbackPlacements,c=n.padding,h=n.boundary,d=n.rootBoundary,u=n.altBoundary,p=n.flipVariations,m=void 0===p||p,f=n.allowedAutoPlacements,g=t.options.placement,v=dt(g),b=l||(v!==g&&m?function(e){if(dt(e)===Ze)return[];var t=bt(e);return[Et(e),t,Et(t)]}(g):[bt(g)]),y=[g].concat(b).reduce((function(e,n){return e.concat(dt(n)===Ze?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?st:l,h=ut(i),d=h?a?it:it.filter((function(e){return ut(e)===h})):Ge,u=d.filter((function(e){return c.indexOf(e)>=0}));0===u.length&&(u=d);var p=u.reduce((function(t,n){return t[n]=kt(e,{placement:n,boundary:s,rootBoundary:r,padding:o})[dt(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:h,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:f}):n)}),[]),E=t.rects.reference,w=t.rects.popper,O=new Map,A=!0,T=y[0],x=0;x<y.length;x++){var k=y[x],C=dt(k),M=ut(k)===Qe,L=[ze,Je].indexOf(C)>=0,F=L?"width":"height",S=kt(t,{placement:k,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),D=L?M?Xe:Ye:M?Je:ze;E[F]>w[F]&&(D=bt(D));var N=bt(D),B=[];if(r&&B.push(S[C]<=0),a&&B.push(S[D]<=0,S[N]<=0),B.every((function(e){return e}))){T=k,A=!1;break}O.set(k,B)}if(A)for(var I=function(e){var t=y.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return T=t,"break"},$=m?3:1;$>0&&"break"!==I($);$--);t.placement!==T&&(t.modifiersData[i]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=void 0===s||s,o=n.altAxis,a=void 0!==o&&o,l=n.boundary,c=n.rootBoundary,h=n.altBoundary,d=n.padding,u=n.tether,p=void 0===u||u,m=n.tetherOffset,f=void 0===m?0:m,g=kt(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),v=dt(t.placement),b=ut(t.placement),y=!b,E=pt(v),w="x"===E?"y":"x",O=t.modifiersData.popperOffsets,A=t.rects.reference,T=t.rects.popper,x="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,k="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(O){if(r){var L,F="y"===E?ze:Ye,S="y"===E?Je:Xe,D="y"===E?"height":"width",N=O[E],B=N+g[F],I=N-g[S],$=p?-T[D]/2:0,j=b===Qe?A[D]:T[D],P=b===Qe?-T[D]:-A[D],V=t.elements.arrow,K=p&&V?Ke(V):{width:0,height:0},_=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=_[F],R=_[S],U=Ct(0,A[D],K[D]),W=y?A[D]/2-$-U-H-k.mainAxis:j-U-H-k.mainAxis,q=y?-A[D]/2+$+U+R+k.mainAxis:P+U+R+k.mainAxis,z=t.elements.arrow&&qe(t.elements.arrow),J=z?"y"===E?z.clientTop||0:z.clientLeft||0:0,X=null!=(L=null==C?void 0:C[E])?L:0,Y=N+q-X,Z=Ct(p?Me(B,N+W-X-J):B,N,p?Ce(I,Y):I);O[E]=Z,M[E]=Z-N}if(a){var G,Q="x"===E?ze:Ye,ee="x"===E?Je:Xe,te=O[w],ne="y"===w?"height":"width",ie=te+g[Q],se=te-g[ee],re=-1!==[ze,Ye].indexOf(v),oe=null!=(G=null==C?void 0:C[w])?G:0,ae=re?ie:te-A[ne]-T[ne]-oe+k.altAxis,le=re?te+A[ne]+T[ne]-oe-k.altAxis:se,ce=p&&re?function(e,t,n){var i=Ct(e,t,n);return i>n?n:i}(ae,te,le):Ct(p?ae:ie,te,p?le:se);O[w]=ce,M[w]=ce-te}t.modifiersData[i]=M}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=dt(n.placement),l=pt(a),c=[Ye,Xe].indexOf(a)>=0?"height":"width";if(r&&o){var h=function(e,t){return Tt("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:xt(e,Ge))}(s.padding,n),d=Ke(r),u="y"===l?ze:Ye,p="y"===l?Je:Xe,m=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],f=o[l]-n.rects.reference[l],g=qe(r),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=m/2-f/2,y=h[u],E=v-d[c]-h[p],w=v/2-d[c]/2+b,O=Ct(y,w,E),A=l;n.modifiersData[i]=((t={})[A]=O,t.centerOffset=O-w,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&wt(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=kt(t,{elementContext:"reference"}),a=kt(t,{altBoundary:!0}),l=Mt(o,i),c=Mt(a,s,r),h=Lt(l),d=Lt(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}}]});class Dt extends oe{get isVisible(){const e=this.popoverElement;return!!e&&e.classList.contains("is-visible")}get isInViewport(){const e=this.popoverElement;if(!this.isVisible||!e)return!1;const t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight),i=Math.max(document.documentElement.clientWidth,window.innerWidth);return t.bottom>0&&t.top<n&&t.right>0&&t.left<i}get shouldHideOnOutsideClick(){switch(this.data.get("hide-on-outside-click")){case"after-dismissal":case"never":return!1;case"if-in-viewport":return this.isInViewport;default:return!0}}connect(){super.connect(),this.validate(),this.isVisible?this.initializePopper():"true"===this.data.get("auto-show")&&this.show(null),this.data.delete("auto-show")}disconnect(){this.hide(),this.popper&&(this.popper.destroy(),delete this.popper),super.disconnect()}toggle(e=null){this.isVisible?this.hide(e):this.show(e)}show(e=null){if(this.isVisible)return;const t=this.getDispatcher(e);this.triggerEvent("show",{dispatcher:t}).defaultPrevented||(this.popper||this.initializePopper(),this.popoverElement.classList.add("is-visible"),this.scheduleUpdate(),this.shown(t))}hide(e=null){if(!this.isVisible)return;const t=this.getDispatcher(e);this.triggerEvent("hide",{dispatcher:t}).defaultPrevented||(this.popoverElement.classList.remove("is-visible"),this.popper&&(this.popper.destroy(),delete this.popper),"after-dismissal"===this.data.get("hide-on-outside-click")&&this.data.delete("hide-on-outside-click"),this.hidden(t))}shown(e=null){this.bindDocumentEvents(),this.triggerEvent("shown",{dispatcher:e})}hidden(e=null){this.unbindDocumentEvents(),this.triggerEvent("hidden",{dispatcher:e})}generatePopover(){return null}initializePopper(){this.popper=St(this.referenceElement,this.popoverElement,{placement:this.data.get("placement")||"bottom",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"arrow",options:{element:".s-popover--arrow"}}]})}validate(){const e=this.data.get("reference-selector");if(this.referenceElement=this.element,e&&(this.referenceElement=this.element.querySelector(e),!this.referenceElement))throw"Unable to find element by reference selector: "+e;const t=this.referenceElement.getAttribute(this.popoverSelectorAttribute);let n=null;if(t){if(n=document.getElementById(t),!n)throw`[${this.popoverSelectorAttribute}="{POPOVER_ID}"] required`}else n=this.generatePopover();if(!n)throw"unable to find or generate popover element";this.popoverElement=n}getDispatcher(e=null){return e instanceof Event?e.target:e instanceof Element?e:this.element}scheduleUpdate(){this.popper&&this.isVisible&&this.popper.update()}}class Nt extends Dt{constructor(){super(...arguments),this.popoverSelectorAttribute="aria-controls"}shown(e=null){this.toggleOptionalClasses(!0),this.toggleAccessibilityAttributes(!0),super.shown(e)}hidden(e=null){this.toggleOptionalClasses(!1),this.toggleAccessibilityAttributes(!1),super.hidden(e)}connect(){super.connect(),this.toggleAccessibilityAttributes()}bindDocumentEvents(){this.boundHideOnOutsideClick=this.boundHideOnOutsideClick||this.hideOnOutsideClick.bind(this),this.boundHideOnEscapePress=this.boundHideOnEscapePress||this.hideOnEscapePress.bind(this),document.addEventListener("mousedown",this.boundHideOnOutsideClick),document.addEventListener("keyup",this.boundHideOnEscapePress)}unbindDocumentEvents(){document.removeEventListener("mousedown",this.boundHideOnOutsideClick),document.removeEventListener("keyup",this.boundHideOnEscapePress)}hideOnOutsideClick(e){const t=e.target;this.shouldHideOnOutsideClick&&!this.referenceElement.contains(t)&&!this.popoverElement.contains(t)&&document.body.contains(t)&&this.hide(e)}hideOnEscapePress(e){27===e.which&&this.isVisible&&(this.popoverElement.contains(e.target)&&this.referenceElement.focus(),this.hide(e))}toggleOptionalClasses(e){if(!this.data.has("toggle-class"))return;const t=this.data.get("toggle-class")||"",n=this.referenceElement.classList;t.split(/\s+/).forEach((function(t){n.toggle(t,e)}))}toggleAccessibilityAttributes(e){const t=(null==e?void 0:e.toString())||this.referenceElement.ariaExpanded||"false";this.referenceElement.ariaExpanded=t,this.referenceElement.setAttribute("aria-expanded",t)}}function Bt(e){const{isPopover:t,controller:n}=Pt(e);if(n)n.show();else{if(!t)throw'element does not have data-controller="s-popover"';e.setAttribute("data-s-popover-auto-show","true")}}function It(e){const{isPopover:t,controller:n,popover:i}=Pt(e);if(n)n.hide();else{if(!t)throw'element does not have data-controller="s-popover"';e.removeAttribute("data-s-popover-auto-show"),i&&i.classList.remove("is-visible")}}function $t(e,t,n){const{referenceElement:i,popover:s}=Pt(e);if(s)throw`element already has popover with id="${s.id}"`;if(!i)throw"element has invalid data-s-popover-reference-selector attribute";if("string"==typeof t){const e=document.createRange().createContextualFragment(t).children;if(1!==e.length)throw"popover should contain a single element";t=e[0]}const r=i.getAttribute("aria-controls");let o=t.id;if(!t.classList.contains("s-popover"))throw`popover should have the "s-popover" class but had class="${t.className}"`;if(r&&r!==o)throw`element has aria-controls="${r}" but popover has id="${o}"`;o||(o="--stacks-s-popover-"+Math.random().toString(36).substring(2,10),t.id=o),r||i.setAttribute("aria-controls",o),!t.parentElement&&e.parentElement&&i.insertAdjacentElement("afterend",t),Vt(e,"s-popover",!0),n&&(n.toggleOnClick&&i.setAttribute("data-action","click->s-popover#toggle"),n.placement&&e.setAttribute("data-s-popover-placement",n.placement),n.autoShow&&e.setAttribute("data-s-popover-auto-show","true"))}function jt(e){const{isPopover:t,controller:n,referenceElement:i,popover:s}=Pt(e);return null==n||n.hide(),null==s||s.remove(),t&&(Vt(e,"s-popover",!1),i&&i.removeAttribute("aria-controls")),s}function Pt(e){var t;const n=(null===(t=e.getAttribute("data-controller"))||void 0===t?void 0:t.includes("s-popover"))||!1,i=re.getControllerForElementAndIdentifier(e,"s-popover"),s=e.getAttribute("data-s-popover-reference-selector"),r=s?e.querySelector(s):e,o=r?r.getAttribute("aria-controls"):null;return{isPopover:n,controller:i,referenceElement:r,popover:o?document.getElementById(o):null}}function Vt(e,t,n){var i;const s=new Set(null===(i=e.getAttribute("data-controller"))||void 0===i?void 0:i.split(/\s+/));n?s.add(t):s.delete(t),e.setAttribute("data-controller",Array.from(s).join(" "))}Nt.targets=[],function(e){e.Ascending="ascending",e.Descending="descending",e.None="none"}(Ft||(Ft={}));class Kt extends oe{constructor(){super(...arguments),this.updateSortedColumnStyles=(e,t)=>{this.columnTargets.forEach((n=>{const i=n===e,s=i?t===Ft.Ascending?"asc":"desc":Ft.None;n.classList.toggle("is-sorted",i&&t!==Ft.None),n.querySelectorAll(".js-sorting-indicator").forEach((e=>{e.classList.toggle("d-none",!e.classList.contains("js-sorting-indicator-"+s))})),i?n.setAttribute("aria-sort",t):n.removeAttribute("aria-sort")}))}}sort(e){const t=this,n=e.currentTarget,i=n instanceof HTMLButtonElement?n.parentElement:n,s=this.element,r=s.tBodies[0],o=function(e){var t;const n=null===(t=e.parentElement)||void 0===t?void 0:t.parentElement;if(!(n instanceof HTMLTableSectionElement))throw"invalid table";const i=_t(n,e);if("number"!=typeof i)throw"shouldn't happen";return i}(i);if(o<0)return;const a=function(e){const t=_t(e);if(!Array.isArray(t))throw"shouldn't happen";return t}(r),l=i.getAttribute("aria-sort")===Ft.Ascending?-1:1,c=Array.from(s.tBodies[0].rows);let h=!1;const d=[];let u;c.forEach((function(e,n){var i,s;const r=t.getElementData(e,"sort-to");if("top"===r)return;if("bottom"===r)return void(u||(u=e));const l=a[n][o];if(!l)return void d.push(["",n]);const c=t.getElementData(l,"sort-val"),p=null!==(s=null!=c?c:null===(i=l.textContent)||void 0===i?void 0:i.trim())&&void 0!==s?s:"";""!==p&&`${parseInt(p,10)}`!==p&&(h=!0),d.push([p,n])})),h||d.forEach((function(e){e[0]=""===e[0]?Number.MIN_VALUE:parseInt(e[0],10)})),d.sort((function(e,t){return e[0]>t[0]?1*l:e[0]<t[0]?-1*l:e[1]>t[1]?1:-1})),d.forEach((([e,t])=>{var n;const i=c[t];null===(n=i.parentElement)||void 0===n||n.removeChild(i),u?r.insertBefore(i,u):r.appendChild(i)})),this.updateSortedColumnStyles(i,1===l?Ft.Ascending:Ft.Descending)}}function _t(e,t){const n=[];let i=e.children[0];const s=[],r=[];for(;i||r.some((e=>0!==e));){const e=[];n.push(e);let o=0;if(i)for(let n=0;n<i.children.length;n++){for(;r[o];)r[o]--,e[o]=s[o],o++;const a=i.children[n];if(!(a instanceof HTMLTableCellElement))throw"invalid table";if("none"===getComputedStyle(a).display)continue;if(a===t)return o;const l=o+a.colSpan;for(;o<l;o++)r[o]=a.rowSpan-1,s[o]=a,e[o]=a}for(;o<s.length;)r[o]&&(r[o]--,e[o]=s[o]),o++;i&&(i=i.nextElementSibling)}return t?-1:n}Kt.targets=["column"];class Ht extends oe{connect(){this.validate()}disconnect(){this.unbindDocumentEvents()}toggle(e=null){this._toggle(void 0,e)}show(e=null){this._toggle(!0,e)}hide(e=null){this._toggle(!1,e)}validate(){const e=this.data.get("return-element");if(e&&(this.returnElement=document.querySelector(e),!this.returnElement))throw"Unable to find element by return-element selector: "+e}_toggle(e,t=null){let n=e;const i="false"===this.toastTarget.getAttribute("aria-hidden");if(void 0===n&&(n=!i),n&&i||!n&&!i)return;const s=this.getDispatcher(t),r=this.triggerEvent(n?"show":"hide",{returnElement:this.returnElement,dispatcher:this.getDispatcher(s)},this.toastTarget);r.defaultPrevented||(this.returnElement=r.detail.returnElement,this.toastTarget.setAttribute("aria-hidden",n?"false":"true"),n?(this.bindDocumentEvents(),this.hideAfterTimeout(),"true"!==this.data.get("prevent-focus-capture")&&this.focusInsideToast()):(this.unbindDocumentEvents(),this.focusReturnElement(),this.removeToastOnHide(),this.clearActiveTimeout()),void 0!==this.toastTarget.ontransitionend?this.toastTarget.addEventListener("transitionend",(()=>{this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.toastTarget)}),{once:!0}):this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.toastTarget))}focusReturnElement(){this.returnElement&&this.toastTarget.addEventListener("s-toast:hidden",(()=>{this.returnElement&&document.body.contains(this.returnElement)&&this.returnElement.focus()}),{once:!0})}removeToastOnHide(){"true"===this.data.get("remove-when-hidden")&&this.toastTarget.addEventListener("s-toast:hidden",(()=>{this.element.remove()}),{once:!0})}hideAfterTimeout(){if("true"===this.data.get("prevent-auto-hide")||"0"===this.data.get("hide-after-timeout"))return;const e=parseInt(this.data.get("hide-after-timeout"),10)||3e3;this.activeTimeout=window.setTimeout((()=>this.hide()),e)}clearActiveTimeout(){clearTimeout(this.activeTimeout)}getAllTabbables(){return Array.from(this.toastTarget.querySelectorAll("[href], input, select, textarea, button, [tabindex]")).filter((e=>e.matches(":not([disabled]):not([tabindex='-1'])")))}firstVisible(e){return null==e?void 0:e.find((e=>null!==e.offsetParent))}focusInsideToast(){this.toastTarget.addEventListener("s-toast:shown",(()=>{var e;const t=null!==(e=this.firstVisible(this.initialFocusTargets))&&void 0!==e?e:this.firstVisible(this.getAllTabbables());null==t||t.focus()}),{once:!0})}bindDocumentEvents(){this._boundClickFn=this._boundClickFn||this.hideOnOutsideClick.bind(this),this._boundKeypressFn=this._boundKeypressFn||this.hideOnEscapePress.bind(this),document.addEventListener("mousedown",this._boundClickFn),document.addEventListener("keyup",this._boundKeypressFn)}unbindDocumentEvents(){document.removeEventListener("mousedown",this._boundClickFn),document.removeEventListener("keyup",this._boundKeypressFn)}hideOnOutsideClick(e){var t;const n=e.target;!(null===(t=this.toastTarget)||void 0===t?void 0:t.contains(n))&&document.body.contains(n)&&"false"!==this.data.get("hide-on-outside-click")&&this._toggle(!1,e)}hideOnEscapePress(e){27===e.which&&"true"!==this.toastTarget.getAttribute("aria-hidden")&&this._toggle(!1,e)}getDispatcher(e=null){return e instanceof Event?e.target:e instanceof Element?e:this.element}}function Rt(e){Wt(e,!0)}function Ut(e){Wt(e,!1)}function Wt(e,t){const n=re.getControllerForElementAndIdentifier(e,"s-toast");if(!n)throw"Unable to get s-toast controller from element";t?n.show():n.hide()}Ht.targets=["toast","initialFocus"];class qt extends Dt{constructor(){super(...arguments),this.popoverSelectorAttribute="aria-describedby"}connect(){super.connect(),window.matchMedia("(hover: hover)").matches&&this.bindMouseEvents(),this.bindKeyboardEvents()}disconnect(){this.unbindKeyboardEvents(),this.unbindMouseEvents(),super.disconnect()}show(e=null){const t=re.getControllerForElementAndIdentifier(this.element,"s-popover");t&&t.isVisible||super.show(e)}scheduleShow(e=null){window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout((()=>this.show(e)),300)}scheduleHide(e=null){window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout((()=>super.hide(e)),100)}clearActiveTimeout(){clearTimeout(this.activeTimeout)}applyTitleAttributes(){let e;const t=this.data.get("html-title");if(t)e=document.createRange().createContextualFragment(t);else{const t=this.element.getAttribute("title");if(!t)return null;e=document.createTextNode(t)}this.data.delete("html-title"),this.element.removeAttribute("title");let n=this.element.getAttribute("aria-describedby");n||(n=qt.generateId(),this.element.setAttribute("aria-describedby",n));let i=document.getElementById(n);if(!i){i=document.createElement("div"),i.id=n,i.className="s-popover s-popover__tooltip",i.setAttribute("role","tooltip");const e=this.element.parentNode;e?e.insertBefore(i,this.element.nextSibling):document.body.appendChild(i)}const s=i.querySelector(".s-popover--arrow");return i.innerHTML="",i.appendChild(e),s?i.appendChild(s):i.insertAdjacentHTML("beforeend",'<div class="s-popover--arrow"></div>'),this.scheduleUpdate(),i}bindDocumentEvents(){this.boundHideIfWithin=this.boundHideIfWithin||this.hideIfWithin.bind(this),document.addEventListener("s-popover:shown",this.boundHideIfWithin)}unbindDocumentEvents(){document.removeEventListener("s-popover:shown",this.boundHideIfWithin)}generatePopover(){return this.applyTitleAttributes()}hideIfWithin(e){e.target.contains(this.referenceElement)&&this.scheduleHide()}hideIfNotFocused(e){this.referenceElement.contains(e.relatedTarget)||this.popoverElement.contains(e.relatedTarget)||this.scheduleHide()}hideOnEscapeKeyEvent(e){"Escape"===e.key&&this.scheduleHide()}bindKeyboardEvents(){this.boundScheduleShow=this.boundScheduleShow||this.scheduleShow.bind(this),this.boundHideOnEscapeKeyEvent=this.boundHideOnEscapeKeyEvent||this.hideOnEscapeKeyEvent.bind(this),this.boundHideIfNotFocused=this.boundHideIfNotFocused||this.hideIfNotFocused.bind(this),this.referenceElement.addEventListener("focus",this.boundScheduleShow),this.referenceElement.addEventListener("focusout",this.boundHideIfNotFocused.bind(this)),this.popoverElement.addEventListener("focusout",this.boundHideIfNotFocused.bind(this)),document.addEventListener("keyup",this.boundHideOnEscapeKeyEvent)}unbindKeyboardEvents(){this.referenceElement.removeEventListener("focus",this.boundScheduleShow),this.referenceElement.removeEventListener("focusout",this.boundHideIfNotFocused),this.referenceElement.removeEventListener("focusout",this.boundHideIfNotFocused),document.removeEventListener("keyup",this.boundHideOnEscapeKeyEvent)}bindMouseEvents(){this.boundScheduleShow=this.boundScheduleShow||this.scheduleShow.bind(this),this.boundHide=this.boundHide||this.scheduleHide.bind(this),this.boundClearActiveTimeout=this.boundClearActiveTimeout||this.clearActiveTimeout.bind(this),this.referenceElement.addEventListener("mouseover",this.boundScheduleShow),this.referenceElement.addEventListener("mouseout",this.boundHide),this.popoverElement.addEventListener("mouseover",this.boundClearActiveTimeout),this.popoverElement.addEventListener("mouseout",this.boundHide)}unbindMouseEvents(){this.referenceElement.removeEventListener("mouseover",this.boundScheduleShow),this.referenceElement.removeEventListener("mouseout",this.boundHide),this.popoverElement.removeEventListener("mouseover",this.boundClearActiveTimeout),this.popoverElement.removeEventListener("mouseout",this.boundHide)}static generateId(){return"--stacks-s-tooltip-"+Math.random().toString(36).substring(2,10)}}function zt(e,t,n){e.setAttribute("data-s-tooltip-html-title",t),e.removeAttribute("title"),Xt(e,n)}function Jt(e,t,n){e.setAttribute("title",t),e.removeAttribute("data-s-tooltip-html-title"),Xt(e,n)}function Xt(e,t){t&&t.placement&&e.setAttribute("data-s-tooltip-placement",t.placement);const n=re.getControllerForElementAndIdentifier(e,"s-tooltip");if(n)n.applyTitleAttributes();else{const t=e.getAttribute("data-controller");e.setAttribute("data-controller",`${t||""} s-tooltip`)}}qt.targets=[];class Yt extends oe{connect(){super.connect(),this.boundDragEnter=this.handleUploaderActive.bind(this,!0),this.boundDragLeave=this.handleUploaderActive.bind(this,!1),this.inputTarget.addEventListener("dragenter",this.boundDragEnter),this.inputTarget.addEventListener("dragleave",this.boundDragLeave)}disconnect(){this.inputTarget.removeEventListener("dragenter",this.boundDragEnter),this.inputTarget.removeEventListener("dragleave",this.boundDragLeave),super.disconnect()}handleInput(){if(this.previewsTarget.innerHTML="",!this.inputTarget.files)return;const e=this.inputTarget.files.length;this.getDataURLs(this.inputTarget.files,Yt.FILE_DISPLAY_LIMIT).then((t=>{if(this.handleVisible(!0),t.length>1){const n=document.createElement("div");n.classList.add("s-uploader--previews-heading"),n.innerText=t.length<e?`Showing ${t.length} of ${e} files`:`${e} items`,this.previewsTarget.appendChild(n),this.previewsTarget.classList.add("has-multiple")}else this.previewsTarget.classList.remove("has-multiple");t.forEach((e=>this.addFilePreview(e))),this.handleUploaderActive(!0)})).catch((()=>null))}reset(){this.inputTarget.value="",this.previewsTarget.innerHTML="",this.handleVisible(!1)}handleVisible(e){const{scope:t}=this.targets,n=t.findAllElements("[data-s-uploader-hide-on-input]"),i=t.findAllElements("[data-s-uploader-show-on-input]"),s=t.findAllElements("[data-s-uploader-enable-on-input]");e?(n.forEach((e=>{e.classList.add("d-none")})),i.forEach((e=>{e.classList.remove("d-none")})),s.forEach((e=>{e.removeAttribute("disabled")}))):(n.forEach((e=>{e.classList.remove("d-none")})),i.forEach((e=>{e.classList.add("d-none")})),s.forEach((e=>{e.setAttribute("disabled","true")})),this.handleUploaderActive(!1))}addFilePreview(e){if(!e)return;const t=document.createElement("div");let n;e.type.match("image/*")&&e.data?(n=document.createElement("img"),n.src=e.data.toString(),n.alt=e.name):(n=document.createElement("div"),n.innerText=e.name),n.classList.add("s-uploader--preview-thumbnail"),t.appendChild(n),t.classList.add("s-uploader--preview"),t.setAttribute("data-filename",e.name),this.previewsTarget.appendChild(t)}handleUploaderActive(e){this.uploaderTarget.classList.toggle("is-active",e)}fileToDataURL(e){const t=new FileReader,{name:n,size:i,type:s}=e;return i<Yt.MAX_FILE_SIZE&&s.indexOf("image")>-1?new Promise(((i,r)=>{t.onload=e=>{var t;const o=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.result;o?i({data:o,name:n,type:s}):r()},t.readAsDataURL(e)})):Promise.resolve({name:n,type:s})}getDataURLs(e,t){const n=Array.from(e).slice(0,Math.min(t,e.length)).map((e=>this.fileToDataURL(e)));return Promise.all(n)}}return Yt.targets=["input","previews","uploader"],Yt.FILE_DISPLAY_LIMIT=10,Yt.MAX_FILE_SIZE=10485760,re.register("s-banner",ce),re.register("s-expandable-control",ve),re.register("s-modal",be),re.register("s-toast",Ht),re.register("s-navigation-tablist",Oe),re.register("s-popover",Nt),re.register("s-table",Kt),re.register("s-tooltip",qt),re.register("s-uploader",Yt),se.finalize(),t})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Stacks=t():e.Stacks=t()}(globalThis,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{BannerController:()=>ce,BasePopoverController:()=>Dt,ExpandableController:()=>ve,ModalController:()=>be,PopoverController:()=>Nt,StacksApplication:()=>se,StacksController:()=>oe,TabListController:()=>Oe,TableController:()=>Kt,ToastController:()=>Ht,TooltipController:()=>qt,UploaderController:()=>Yt,addController:()=>le,application:()=>re,attachPopover:()=>$t,createController:()=>ae,detachPopover:()=>jt,hideBanner:()=>de,hideModal:()=>Ee,hidePopover:()=>It,hideToast:()=>Ut,setTooltipHtml:()=>zt,setTooltipText:()=>Jt,showBanner:()=>he,showModal:()=>ye,showPopover:()=>Bt,showToast:()=>Rt});class n{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{const n=e.index,i=t.index;return n<i?-1:n>i?1:0})}}class i{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:n,eventOptions:i}=e,s=this.fetchEventListenerMapForEventTarget(t),r=this.cacheKey(n,i);s.delete(r),0==s.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:n,eventOptions:i}=e;return this.fetchEventListener(t,n,i)}fetchEventListener(e,t,n){const i=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,n);let r=i.get(s);return r||(r=this.createEventListener(e,t,n),i.set(s,r)),r}createEventListener(e,t,i){const s=new n(e,t,i);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const n=[e];return Object.keys(t).sort().forEach(e=>{n.push(`${t[e]?"":"!"}${e}`)}),n.join(":")}}const s={stop:({event:e,value:t})=>(t&&e.stopPropagation(),!0),prevent:({event:e,value:t})=>(t&&e.preventDefault(),!0),self:({event:e,value:t,element:n})=>!t||n===e.target},r=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function o(e){return e.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function a(e){return o(e.replace(/--/g,"-").replace(/__/g,"_"))}function l(e){return e.charAt(0).toUpperCase()+e.slice(1)}function c(e){return e.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function h(e){return null!=e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const u=["meta","ctrl","alt","shift"];class p{constructor(e,t,n,i){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){const t=e.tagName.toLowerCase();if(t in m)return m[t](e)}(e)||f("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||f("missing identifier"),this.methodName=n.methodName||f("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=i}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(r)||[];let n=t[2],i=t[3];return i&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${i}`,i=""),{eventTarget:(s=t[4],"window"==s?window:"document"==s?document:void 0),eventName:n,eventOptions:t[7]?(o=t[7],o.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||i};var s,o}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const n=t.filter(e=>!u.includes(e))[0];return!!n&&(d(this.keyMappings,n)||f(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:i}of Array.from(this.element.attributes)){const s=n.match(t),r=s&&s[1];r&&(e[o(r)]=g(i))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,i,s,r]=u.map(e=>t.includes(e));return e.metaKey!==n||e.ctrlKey!==i||e.altKey!==s||e.shiftKey!==r}}const m={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function f(e){throw new Error(e)}function g(e){try{return JSON.parse(e)}catch(t){return e}}class v{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:i}=this.context;let s=!0;for(const[r,o]of Object.entries(this.eventOptions))if(r in n){const a=n[r];s=s&&a({name:r,value:o,event:e,element:t,controller:i})}return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:n}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){const{identifier:n,controller:i,element:s,index:r}=this,o={identifier:n,controller:i,element:s,index:r,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class b{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class y{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new b(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function E(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}class w{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e.concat(Array.from(t)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e+t.size,0)}add(e,t){!function(e,t,n){E(e,t).add(n)}(this.valuesByKey,e,t)}delete(e,t){!function(e,t,n){E(e,t).delete(n),function(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}(e,t)}(this.valuesByKey,e,t)}has(e,t){const n=this.valuesByKey.get(e);return null!=n&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(t=>t.has(e))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,n])=>n.has(e)).map(([e,t])=>e)}}class O{constructor(e,t,n,i){this._selector=t,this.details=i,this.elementObserver=new b(e,this),this.delegate=n,this.matchesByElement=new w}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const n=e.matches(t);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(e,this.details):n}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const n=this.matchElement(e)?[e]:[],i=Array.from(e.querySelectorAll(t)).filter(e=>this.matchElement(e));return n.concat(i)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const n of t)this.selectorUnmatched(e,n)}elementAttributeChanged(e,t){const{selector:n}=this;if(n){const t=this.matchElement(e),i=this.matchesByElement.has(n,e);t&&!i?this.selectorMatched(e,n):!t&&i&&this.selectorUnmatched(e,n)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class A{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const n=this.delegate.getStringMapKeyForAttribute(e);if(null!=n){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);const i=this.element.getAttribute(e);if(this.stringMap.get(e)!=i&&this.stringMapValueChanged(i,n,t),null==i){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,i)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class T{constructor(e,t,n){this.attributeObserver=new y(e,t,this),this.delegate=n,this.tokensByElement=new w}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(e=>this.tokenMatched(e))}tokensUnmatched(e){e.forEach(e=>this.tokenUnmatched(e))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),i=function(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},(n,i)=>[e[i],t[i]])}(t,n).findIndex(([e,t])=>!function(e,t){return e&&t&&e.index==t.index&&e.content==t.content}(e,t));return-1==i?[[],[]]:[t.slice(i),n.slice(i)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,n){return e.trim().split(/\s+/).filter(e=>e.length).map((e,i)=>({element:t,attributeName:n,content:e,index:i}))}(e.getAttribute(t)||"",e,t)}}class x{constructor(e,t,n){this.tokenListObserver=new T(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class k{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new x(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new v(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){const t=p.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class C{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new A(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){const i=this.valueDescriptorNameMap[t];null!==e&&(null===n&&(n=i.writer(i.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){const i=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,i.writer(this.receiver[e]),n):this.invokeChangedCallback(e,i.writer(i.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:n,writer:i}of this.valueDescriptors)null==n||this.controller.data.has(e)||this.invokeChangedCallback(t,i(n),void 0)}invokeChangedCallback(e,t,n){const i=`${e}Changed`,s=this.receiver[i];if("function"==typeof s){const i=this.valueDescriptorNameMap[e];try{const e=i.reader(t);let r=n;n&&(r=i.reader(n)),s.call(this.receiver,e,r)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${i.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{const n=this.valueDescriptorMap[t];e[n.name]=n}),e}hasValue(e){const t=`has${l(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class M{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new w}start(){this.tokenListObserver||(this.tokenListObserver=new T(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function L(e,t){const n=F(e);return Array.from(n.reduce((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach(t=>e.add(t)),e),new Set))}function F(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class S{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new w,this.outletElementsByName=new w,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:n}){const i=this.getOutlet(e,n);i&&this.connectOutlet(i,e,n)}selectorUnmatched(e,t,{outletName:n}){const i=this.getOutletFromMap(e,n);i&&this.disconnectOutlet(i,e,n)}selectorMatchElement(e,{outletName:t}){const n=this.selector(t),i=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&i&&s&&e.matches(n)}elementMatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(e,t,n){var i;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause(()=>this.delegate.outletConnected(e,t,n)))}disconnectOutlet(e,t,n){var i;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause(()=>this.delegate.outletDisconnected(e,t,n)))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),n=new O(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new y(this.scope.element,t,this);this.attributeObserverMap.set(e,n),n.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){const e=new w;return this.router.modules.forEach(t=>{L(t.definition.controllerConstructor,"outlets").forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(t=>t.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class D{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:i,element:s}=this;t=Object.assign({identifier:n,controller:i,element:s},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new k(this,this.dispatcher),this.valueObserver=new C(this,this.controller),this.targetObserver=new M(this,this),this.outletObserver=new S(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){const{identifier:i,controller:s,element:r}=this;n=Object.assign({identifier:i,controller:s,element:r},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${a(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${a(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}const N="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,B=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e(function(){this.a.call(this)});t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class I{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:(t=e.controllerConstructor,function(e,t){const n=B(e),i=function(e,t){return N(t).reduce((n,i)=>{const s=function(e,t,n){const i=Object.getOwnPropertyDescriptor(e,n);if(!i||!("value"in i)){const e=Object.getOwnPropertyDescriptor(t,n).value;return i&&(e.get=i.get||e.get,e.set=i.set||e.set),e}}(e,t,i);return s&&Object.assign(n,{[i]:s}),n},{})}(e.prototype,t);return Object.defineProperties(n.prototype,i),n}(t,function(e){return L(e,"blessings").reduce((t,n)=>{const i=n(e);for(const e in i){const n=t[e]||{};t[e]=Object.assign(n,i[e])}return t},{})}(t)))};var t}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new D(this,e),this.contextsByScope.set(e,t)),t}}class ${constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){return(this.data.get(this.getDataKey(e))||"").match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class j{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${c(e)}`}}class P{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let i=this.warnedKeysByObject.get(e);i||(i=new Set,this.warnedKeysByObject.set(e,i)),i.has(t)||(i.add(t),this.logger.warn(n,e))}}function V(e,t){return`[${e}~="${t}"]`}class K{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)],[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return V(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(t=>this.deprecate(t,e))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return V(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,i=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${i}="${n}.${t}" with ${s}="${t}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class _{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce((e,t)=>e||this.findOutlet(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllOutlets(t)],[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))}matchesElement(e,t,n){const i=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&i.split(" ").includes(n)}}class H{constructor(e,t,n,i){this.targets=new K(this),this.classes=new $(this),this.data=new j(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new P(i),this.outlets=new _(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return V(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new H(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class R{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new x(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:n}=e;return this.parseValueForElementAndIdentifier(t,n)}parseValueForElementAndIdentifier(e,t){const n=this.fetchScopesByIdentifierForElement(e);let i=n.get(t);return i||(i=this.delegate.createScopeForElementAndIdentifier(e,t),n.set(t,i)),i}elementMatchedValue(e,t){const n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class U{constructor(e){this.application=e,this.scopeObserver=new R(this.element,this.schema,this),this.scopesByIdentifier=new w,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new I(this.application,e);this.connectModule(t);const n=e.controllerConstructor.afterLoad;n&&n.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find(t=>t.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){const n=this.scopeObserver.parseValueForElementAndIdentifier(e,t);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,n){this.application.handleError(e,t,n)}createScopeForElementAndIdentifier(e,t){return new H(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.connectContextForScope(t))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.disconnectContextForScope(t))}}const W={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},q("abcdefghijklmnopqrstuvwxyz".split("").map(e=>[e,e]))),q("0123456789".split("").map(e=>[e,e])))};function q(e){return e.reduce((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n}),{})}class z{constructor(e=document.documentElement,t=W){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new i(this),this.router=new U(this),this.actionDescriptorFilters=Object.assign({},s)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await new Promise(e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",()=>e()):e()}),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>this.router.unloadIdentifier(e))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){const n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var i;this.logger.error("%s\n\n%o\n\n%o",t,e,n),null===(i=window.onerror)||void 0===i||i.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}}function J(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function X(e,t,n){let i=J(e,t,n);return i||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),i=J(e,t,n),i||void 0)}function Y([e,t],n){return function(e){const{token:t,typeDefinition:n}=e,i=`${c(t)}-value`,s=function(e){const{controller:t,token:n,typeDefinition:i}=e,s=function(e){const{controller:t,token:n,typeObject:i}=e,s=h(i.type),r=h(i.default),o=s&&r,a=s&&!r,l=!s&&r,c=Z(i.type),d=G(e.typeObject.default);if(a)return c;if(l)return d;if(c!==d)throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${n}`:n}" must match the defined type "${c}". The provided default value of "${i.default}" is of type "${d}".`);return o?c:void 0}({controller:t,token:n,typeObject:i}),r=G(i),o=Z(i),a=s||r||o;if(a)return a;throw new Error(`Unknown value type "${t?`${t}.${i}`:n}" for "${n}" value`)}(e);return{type:s,key:i,name:o(i),get defaultValue(){return function(e){const t=Z(e);if(t)return Q[t];const n=d(e,"default"),i=d(e,"type"),s=e;if(n)return s.default;if(i){const{type:e}=s,t=Z(e);if(t)return Q[t]}return e}(n)},get hasCustomDefaultValue(){return void 0!==G(n)},reader:ee[s],writer:te[s]||te.default}}({controller:n,token:e,typeDefinition:t})}function Z(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function G(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const Q={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},ee={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${G(t)}"`);return t},boolean:e=>!("0"==e||"false"==String(e).toLowerCase()),number:e=>Number(e.replace(/_/g,"")),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${G(t)}"`);return t},string:e=>e},te={default:function(e){return`${e}`},array:ne,object:ne};function ne(e){return JSON.stringify(e)}class ie{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:i=this.identifier,bubbles:s=!0,cancelable:r=!0}={}){const o=new CustomEvent(i?`${i}:${e}`:e,{detail:n,bubbles:s,cancelable:r});return t.dispatchEvent(o),o}}ie.blessings=[function(e){return L(e,"classes").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${l(n)}Class`]:{get(){return this.classes.has(n)}}}));var n},{})},function(e){return L(e,"targets").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${l(n)}Target`]:{get(){return this.targets.has(n)}}}));var n},{})},function(e){const t=function(e,t){return F(e).reduce((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map(e=>[e,n[e]]):[]}(n,t)),e),[])}(e,"values"),n={valueDescriptorMap:{get(){return t.reduce((e,t)=>{const n=Y(t,this.identifier),i=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[i]:n})},{})}}};return t.reduce((e,t)=>Object.assign(e,function(e){const t=Y(e,void 0),{key:n,name:i,reader:s,writer:r}=t;return{[i]:{get(){const e=this.data.get(n);return null!==e?s(e):t.defaultValue},set(e){void 0===e?this.data.delete(n):this.data.set(n,r(e))}},[`has${l(i)}`]:{get(){return this.data.has(n)||t.hasCustomDefaultValue}}}}(t)),n)},function(e){return L(e,"outlets").reduce((e,t)=>Object.assign(e,function(e){const t=a(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=X(this,t,e);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map(t=>{const n=X(this,t,e);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)}).filter(e=>e):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${l(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t)),{})}],ie.targets=[],ie.outlets=[],ie.values={};class se extends z{load(e,...t){const n=Array.isArray(e)?e:[e,...t];for(const e of n){const t=/^s-/.test(e.identifier);if(se._initializing&&!t)throw'Stacks-created Stimulus controller names must start with "s-".';if(!se._initializing&&t)throw'The "s-" prefix on Stimulus controller names is reserved for Stacks-created controllers.'}super.load(n)}static start(e,t){const n=new se(e,t);return n.start(),n}static finalize(){se._initializing=!1}}se._initializing=!0;const re=se.start();class oe extends ie{getElementData(e,t){return e.getAttribute("data-"+this.identifier+"-"+t)}setElementData(e,t,n){e.setAttribute("data-"+this.identifier+"-"+t,n)}removeElementData(e,t){e.removeAttribute("data-"+this.identifier+"-"+t)}triggerEvent(e,t,n){const i=this.identifier+":"+e;let s;try{s=new CustomEvent(i,{bubbles:!0,cancelable:!0,detail:t})}catch(e){s=document.createEvent("CustomEvent"),s.initCustomEvent(i,!0,!0,t)}return(n||this.element).dispatchEvent(s),s}}function ae(e){var t,n;const i=e.hasOwnProperty("targets")?((n=class extends oe{}).targets=null!==(t=e.targets)&&void 0!==t?t:[],n):class extends oe{};for(const t in e){const n=e.hasOwnProperty(t)&&Object.getOwnPropertyDescriptor(e,t);"targets"!==t&&n&&Object.defineProperty(i.prototype,t,n)}return i}function le(e,t){re.register(e,ae(t))}class ce extends oe{toggle(e=null){this._toggle(void 0,e)}show(e=null){this._toggle(!0,e)}hide(e=null){this._toggle(!1,e)}_toggle(e,t=null){let n=e;const i="false"===this.bannerTarget.getAttribute("aria-hidden");if(void 0===n&&(n=!i),n&&i||!n&&!i)return;const s=this.getDispatcher(t);this.triggerEvent(n?"show":"hide",{dispatcher:this.getDispatcher(s)},this.bannerTarget).defaultPrevented||(this.bannerTarget.setAttribute("aria-hidden",n?"false":"true"),n||this.removeBannerOnHide(),this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.bannerTarget))}removeBannerOnHide(){"true"===this.data.get("remove-when-hidden")&&this.bannerTarget.addEventListener("s-banner:hidden",()=>{this.element.remove()},{once:!0})}getDispatcher(e=null){return e instanceof Event?e.target:e instanceof Element?e:this.element}}function he(e){ue(e,!0)}function de(e){ue(e,!1)}function ue(e,t){const n=re.getControllerForElementAndIdentifier(e,"s-banner");if(!n)throw"Unable to get s-banner controller from element";t?n.show():n.hide()}ce.targets=["banner"];const pe="s-expandable-control:radio-off";function me(e){const t=e.target;t instanceof HTMLInputElement&&"INPUT"===t.nodeName&&"radio"===t.type&&document.querySelectorAll('input[type="radio"][name="'+t.name+'"]').forEach(function(t){if(t===e.target)return;let n;try{n=new Event(pe)}catch(e){n=document.createEvent("Event"),n.initEvent(pe,!0,!0)}t.dispatchEvent(n)})}let fe=0;function ge(e){e?(fe++,1===fe&&document.body.addEventListener("change",me)):(fe--,0===fe&&document.body.removeEventListener("change",me))}class ve extends oe{constructor(){super(...arguments),this.lastKeydownClickTimestamp=0}initialize(){"INPUT"===this.element.nodeName&&["radio","checkbox"].indexOf(this.element.type)>=0?(this.isCollapsed=this._isCollapsedForCheckable.bind(this),this.events=["change",pe],this.isCheckable=!0,this.isRadio="radio"===this.element.type):(this.isCollapsed=this._isCollapsedForClickable.bind(this),this.events=["click","keydown"]),this.listener=this.listener.bind(this)}_isCollapsedForClickable(){const e=this.controlledExpandables;return e.length>0?!e.every(e=>e.classList.contains("is-expanded")):"false"===this.element.getAttribute("aria-expanded")}_isCollapsedForCheckable(){return!this.element.checked}get controlledExpandables(){const e=this.element.getAttribute("aria-controls");if(!e)throw'[aria-controls="targetId1 ... targetIdN"] attribute required';const t=e.split(/\s+/g).map(e=>document.getElementById(e)).filter(e=>!!e);if(!t.length)throw"couldn't find controls";return t}_dispatchShowHideEvent(e){this.triggerEvent(e?"show":"hide")}_toggleClass(e){if(!this.data.has("toggle-class"))return;const t=this.element.classList,n=this.data.get("toggle-class");if(!n)throw"couldn't find toggle class";n.split(/\s+/).forEach(function(n){t.toggle(n,!!e)})}listener(e){let t;if(this.isCheckable)t=!this.element.checked;else{if("keydown"==e.type&&e instanceof KeyboardEvent&&13!=e.keyCode&&32!=e.keyCode)return;if(e.target!==e.currentTarget&&["A","BUTTON"].indexOf(e.target.nodeName)>=0)return;if(e.preventDefault(),"keydown"==e.type)this.lastKeydownClickTimestamp=Date.now();else if("click"==e.type&&Date.now()-this.lastKeydownClickTimestamp<300)return;t="true"===this.element.getAttribute("aria-expanded"),"click"===e.type&&this.element.blur()}this.element.setAttribute("aria-expanded",t?"false":"true");for(const e of this.controlledExpandables)e.classList.toggle("is-expanded",!t);this._dispatchShowHideEvent(!t),this._toggleClass(!t)}connect(){if(this.events.forEach(e=>{this.element.addEventListener(e,this.listener.bind(this))},this),this.isRadio&&ge(!0),this.isRadio||this.element.setAttribute("aria-expanded",this.isCollapsed()?"false":"true"),this.isCheckable){const e=this.controlledExpandables;if(e.length){const t=!this.isCollapsed();if(e.some(e=>e.classList.contains("is-expanded")!==t)){for(const e of this.controlledExpandables)e.classList.toggle("is-expanded",t);this._dispatchShowHideEvent(t),this._toggleClass(t)}}}}disconnect(){this.events.forEach(e=>{this.element.removeEventListener(e,this.listener.bind(this))},this),this.isRadio&&ge(!1)}}class be extends oe{connect(){this.validate()}disconnect(){this.unbindDocumentEvents()}toggle(e=null){this._toggle(void 0,e)}show(e=null){this._toggle(!0,e)}hide(e=null){this._toggle(!1,e)}validate(){const e=this.data.get("return-element");if(e&&(this.returnElement=document.querySelector(e),!this.returnElement))throw"Unable to find element by return-element selector: "+e}_toggle(e,t=null){let n=e;const i="false"===this.modalTarget.getAttribute("aria-hidden");if(void 0===n&&(n=!i),n&&i||!n&&!i)return;const s=this.getDispatcher(t),r=this.triggerEvent(n?"show":"hide",{returnElement:this.returnElement,dispatcher:this.getDispatcher(s)},this.modalTarget);r.defaultPrevented||(this.returnElement=r.detail.returnElement,this.modalTarget.setAttribute("aria-hidden",n?"false":"true"),n?(this.bindDocumentEvents(),this.focusInsideModal()):(this.unbindDocumentEvents(),this.focusReturnElement(),this.removeModalOnHide()),void 0!==this.modalTarget.ontransitionend?this.modalTarget.addEventListener("transitionend",()=>{this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.modalTarget)},{once:!0}):this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.modalTarget))}focusReturnElement(){this.returnElement&&this.modalTarget.addEventListener("s-modal:hidden",()=>{this.returnElement&&document.body.contains(this.returnElement)&&this.returnElement.focus()},{once:!0})}removeModalOnHide(){"true"===this.data.get("remove-when-hidden")&&this.modalTarget.addEventListener("s-modal:hidden",()=>{this.element.remove()},{once:!0})}getAllTabbables(){return Array.from(this.modalTarget.querySelectorAll("[href], input, select, textarea, button, [tabindex]")).filter(e=>e.matches(":not([disabled]):not([tabindex='-1'])"))}firstVisible(e){return e.find(e=>null!==e.offsetParent)}lastVisible(e){return this.firstVisible([...e].reverse())}focusInsideModal(){this.modalTarget.addEventListener("s-modal:shown",()=>{var e,t;this.modalTarget.contains(document.activeElement)||(null!==(t=null!==(e=this.firstVisible(this.initialFocusTargets))&&void 0!==e?e:this.firstVisible(this.getAllTabbables()))&&void 0!==t?t:this.modalTarget).focus()},{once:!0})}keepFocusWithinModal(e){if("Tab"!==e.key)return;const t=this.getAllTabbables();if(0===t.length)return void e.preventDefault();if(!this.modalTarget.contains(e.target)){const n=this.firstVisible(t);return void(n&&(e.preventDefault(),n.focus()))}const n=this.firstVisible(t),i=this.lastVisible(t);n&&i&&(n===i?(e.preventDefault(),n.focus()):e.shiftKey&&e.target===n?(e.preventDefault(),i.focus()):e.shiftKey||e.target!==i||(e.preventDefault(),n.focus()))}bindDocumentEvents(){this._boundClickFn=this._boundClickFn||this.hideOnOutsideClick.bind(this),this._boundKeypressFn=this._boundKeypressFn||this.hideOnEscapePress.bind(this),this._boundTabTrap=this._boundTabTrap||this.keepFocusWithinModal.bind(this),document.addEventListener("mousedown",this._boundClickFn),document.addEventListener("keyup",this._boundKeypressFn),document.addEventListener("keydown",this._boundTabTrap)}unbindDocumentEvents(){document.removeEventListener("mousedown",this._boundClickFn),document.removeEventListener("keyup",this._boundKeypressFn),document.removeEventListener("keydown",this._boundTabTrap)}hideOnOutsideClick(e){var t;const n=e.target;!(null===(t=this.modalTarget.querySelector(".s-modal--dialog"))||void 0===t?void 0:t.contains(n))&&document.body.contains(n)&&this._toggle(!1,e)}hideOnEscapePress(e){27===e.which&&"true"!==this.modalTarget.getAttribute("aria-hidden")&&this._toggle(!1,e)}getDispatcher(e=null){return e instanceof Event?e.target:e instanceof Element?e:this.element}}function ye(e){we(e,!0)}function Ee(e){we(e,!1)}function we(e,t){const n=re.getControllerForElementAndIdentifier(e,"s-modal");if(!n)throw"Unable to get s-modal controller from element";t?n.show():n.hide()}be.targets=["modal","initialFocus"];class Oe extends oe{connect(){super.connect(),this.boundSelectTab=this.selectTab.bind(this),this.boundHandleKeydown=this.handleKeydown.bind(this);for(const e of this.tabTargets)e.addEventListener("click",this.boundSelectTab),e.addEventListener("keydown",this.boundHandleKeydown)}disconnect(){super.disconnect();for(const e of this.tabTargets)e.removeEventListener("click",this.boundSelectTab),e.removeEventListener("keydown",this.boundHandleKeydown)}get tabTargets(){return Array.from(this.element.querySelectorAll("[role=tab]"))}selectTab(e){this.switchToTab(e.currentTarget)}handleKeydown(e){var t;let n=e.currentTarget;const i=this.tabTargets;let s=i.indexOf(n);if("ArrowRight"===e.key)s++;else{if("ArrowLeft"!==e.key)return;s--}s<0&&(s=i.length-1),s>=i.length&&(s=0),n=i[s],this.switchToTab(n),null===(t=this.selectedTab)||void 0===t||t.focus()}switchToTab(e){const t=this.selectedTab;t!==e&&(this.triggerEvent("select",{oldTab:t,newTab:e}).defaultPrevented||(this.selectedTab=e,this.triggerEvent("selected",{oldTab:t,newTab:e})))}get selectedTab(){return this.tabTargets.find(e=>"true"===e.getAttribute("aria-selected"))||null}set selectedTab(e){for(const t of this.tabTargets){const n=t.getAttribute("aria-controls"),i=n?document.getElementById(n):null;t===e?(t.classList.add("is-selected"),t.setAttribute("aria-selected","true"),t.removeAttribute("tabindex"),null==i||i.classList.remove("d-none")):(t.classList.remove("is-selected"),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1"),null==i||i.classList.add("d-none"))}}}function Ae(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Te(e){return e instanceof Ae(e).Element||e instanceof Element}function xe(e){return e instanceof Ae(e).HTMLElement||e instanceof HTMLElement}function ke(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Ae(e).ShadowRoot||e instanceof ShadowRoot)}var Ce=Math.max,Me=Math.min,Le=Math.round;function Fe(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Se(){return!/^((?!chrome|android).)*safari/i.test(Fe())}function De(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),s=1,r=1;t&&xe(e)&&(s=e.offsetWidth>0&&Le(i.width)/e.offsetWidth||1,r=e.offsetHeight>0&&Le(i.height)/e.offsetHeight||1);var o=(Te(e)?Ae(e):window).visualViewport,a=!Se()&&n,l=(i.left+(a&&o?o.offsetLeft:0))/s,c=(i.top+(a&&o?o.offsetTop:0))/r,h=i.width/s,d=i.height/r;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ne(e){var t=Ae(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Be(e){return e?(e.nodeName||"").toLowerCase():null}function Ie(e){return((Te(e)?e.ownerDocument:e.document)||window.document).documentElement}function $e(e){return De(Ie(e)).left+Ne(e).scrollLeft}function je(e){return Ae(e).getComputedStyle(e)}function Pe(e){var t=je(e),n=t.overflow,i=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function Ve(e,t,n){void 0===n&&(n=!1);var i,s,r=xe(t),o=xe(t)&&function(e){var t=e.getBoundingClientRect(),n=Le(t.width)/e.offsetWidth||1,i=Le(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),a=Ie(t),l=De(e,o,n),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(r||!r&&!n)&&(("body"!==Be(t)||Pe(a))&&(c=(i=t)!==Ae(i)&&xe(i)?{scrollLeft:(s=i).scrollLeft,scrollTop:s.scrollTop}:Ne(i)),xe(t)?((h=De(t,!0)).x+=t.clientLeft,h.y+=t.clientTop):a&&(h.x=$e(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Ke(e){var t=De(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function _e(e){return"html"===Be(e)?e:e.assignedSlot||e.parentNode||(ke(e)?e.host:null)||Ie(e)}function He(e){return["html","body","#document"].indexOf(Be(e))>=0?e.ownerDocument.body:xe(e)&&Pe(e)?e:He(_e(e))}function Re(e,t){var n;void 0===t&&(t=[]);var i=He(e),s=i===(null==(n=e.ownerDocument)?void 0:n.body),r=Ae(i),o=s?[r].concat(r.visualViewport||[],Pe(i)?i:[]):i,a=t.concat(o);return s?a:a.concat(Re(_e(o)))}function Ue(e){return["table","td","th"].indexOf(Be(e))>=0}function We(e){return xe(e)&&"fixed"!==je(e).position?e.offsetParent:null}function qe(e){for(var t=Ae(e),n=We(e);n&&Ue(n)&&"static"===je(n).position;)n=We(n);return n&&("html"===Be(n)||"body"===Be(n)&&"static"===je(n).position)?t:n||function(e){var t=/firefox/i.test(Fe());if(/Trident/i.test(Fe())&&xe(e)&&"fixed"===je(e).position)return null;var n=_e(e);for(ke(n)&&(n=n.host);xe(n)&&["html","body"].indexOf(Be(n))<0;){var i=je(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}var ze="top",Je="bottom",Xe="right",Ye="left",Ze="auto",Ge=[ze,Je,Xe,Ye],Qe="start",et="end",tt="viewport",nt="popper",it=Ge.reduce(function(e,t){return e.concat([t+"-"+Qe,t+"-"+et])},[]),st=[].concat(Ge,[Ze]).reduce(function(e,t){return e.concat([t,t+"-"+Qe,t+"-"+et])},[]),rt=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ot(e){var t=new Map,n=new Set,i=[];function s(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var i=t.get(e);i&&s(i)}}),i.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||s(e)}),i}var at={placement:"bottom",modifiers:[],strategy:"absolute"};function lt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function ct(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,s=t.defaultOptions,r=void 0===s?at:s;return function(e,t,n){void 0===n&&(n=r);var s,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},at,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,h={state:a,setOptions:function(n){var s="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},r,a.options,s),a.scrollParents={reference:Te(e)?Re(e):e.contextElement?Re(e.contextElement):[],popper:Re(t)};var o,c,u=function(e){var t=ot(e);return rt.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}((o=[].concat(i,a.options.modifiers),c=o.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return a.orderedModifiers=u.filter(function(e){return e.enabled}),a.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,s=e.effect;if("function"==typeof s){var r=s({state:a,name:t,instance:h,options:i});l.push(r||function(){})}}),h.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(lt(t,n)){a.rects={reference:Ve(t,qe(n),"fixed"===a.options.strategy),popper:Ke(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(e){return a.modifiersData[e.name]=Object.assign({},e.data)});for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var s=a.orderedModifiers[i],r=s.fn,o=s.options,l=void 0===o?{}:o,d=s.name;"function"==typeof r&&(a=r({state:a,options:l,name:d,instance:h})||a)}else a.reset=!1,i=-1}}},update:(s=function(){return new Promise(function(e){h.forceUpdate(),e(a)})},function(){return o||(o=new Promise(function(e){Promise.resolve().then(function(){o=void 0,e(s())})})),o}),destroy:function(){d(),c=!0}};if(!lt(e,t))return h;function d(){l.forEach(function(e){return e()}),l=[]}return h.setOptions(n).then(function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)}),h}}var ht={passive:!0};function dt(e){return e.split("-")[0]}function ut(e){return e.split("-")[1]}function pt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function mt(e){var t,n=e.reference,i=e.element,s=e.placement,r=s?dt(s):null,o=s?ut(s):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(r){case ze:t={x:a,y:n.y-i.height};break;case Je:t={x:a,y:n.y+n.height};break;case Xe:t={x:n.x+n.width,y:l};break;case Ye:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var c=r?pt(r):null;if(null!=c){var h="y"===c?"height":"width";switch(o){case Qe:t[c]=t[c]-(n[h]/2-i[h]/2);break;case et:t[c]=t[c]+(n[h]/2-i[h]/2)}}return t}var ft={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gt(e){var t,n=e.popper,i=e.popperRect,s=e.placement,r=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,h=e.roundOffsets,d=e.isFixed,u=o.x,p=void 0===u?0:u,m=o.y,f=void 0===m?0:m,g="function"==typeof h?h({x:p,y:f}):{x:p,y:f};p=g.x,f=g.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=Ye,E=ze,w=window;if(c){var O=qe(n),A="clientHeight",T="clientWidth";O===Ae(n)&&"static"!==je(O=Ie(n)).position&&"absolute"===a&&(A="scrollHeight",T="scrollWidth"),(s===ze||(s===Ye||s===Xe)&&r===et)&&(E=Je,f-=(d&&O===w&&w.visualViewport?w.visualViewport.height:O[A])-i.height,f*=l?1:-1),s!==Ye&&(s!==ze&&s!==Je||r!==et)||(y=Xe,p-=(d&&O===w&&w.visualViewport?w.visualViewport.width:O[T])-i.width,p*=l?1:-1)}var x,k=Object.assign({position:a},c&&ft),C=!0===h?function(e,t){var n=e.x,i=e.y,s=t.devicePixelRatio||1;return{x:Le(n*s)/s||0,y:Le(i*s)/s||0}}({x:p,y:f},Ae(n)):{x:p,y:f};return p=C.x,f=C.y,l?Object.assign({},k,((x={})[E]=b?"0":"",x[y]=v?"0":"",x.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+f+"px)":"translate3d("+p+"px, "+f+"px, 0)",x)):Object.assign({},k,((t={})[E]=b?f+"px":"",t[y]=v?p+"px":"",t.transform="",t))}var vt={left:"right",right:"left",bottom:"top",top:"bottom"};function bt(e){return e.replace(/left|right|bottom|top/g,function(e){return vt[e]})}var yt={start:"end",end:"start"};function Et(e){return e.replace(/start|end/g,function(e){return yt[e]})}function wt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ke(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ot(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function At(e,t,n){return t===tt?Ot(function(e,t){var n=Ae(e),i=Ie(e),s=n.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=Se();(c||!c&&"fixed"===t)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+$e(e),y:l}}(e,n)):Te(t)?function(e,t){var n=De(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Ot(function(e){var t,n=Ie(e),i=Ne(e),s=null==(t=e.ownerDocument)?void 0:t.body,r=Ce(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Ce(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+$e(e),l=-i.scrollTop;return"rtl"===je(s||n).direction&&(a+=Ce(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}(Ie(e)))}function Tt(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function xt(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function kt(e,t){void 0===t&&(t={});var n=t,i=n.placement,s=void 0===i?e.placement:i,r=n.strategy,o=void 0===r?e.strategy:r,a=n.boundary,l=void 0===a?"clippingParents":a,c=n.rootBoundary,h=void 0===c?tt:c,d=n.elementContext,u=void 0===d?nt:d,p=n.altBoundary,m=void 0!==p&&p,f=n.padding,g=void 0===f?0:f,v=Tt("number"!=typeof g?g:xt(g,Ge)),b=u===nt?"reference":nt,y=e.rects.popper,E=e.elements[m?b:u],w=function(e,t,n,i){var s="clippingParents"===t?function(e){var t=Re(_e(e)),n=["absolute","fixed"].indexOf(je(e).position)>=0&&xe(e)?qe(e):e;return Te(n)?t.filter(function(e){return Te(e)&&wt(e,n)&&"body"!==Be(e)}):[]}(e):[].concat(t),r=[].concat(s,[n]),o=r[0],a=r.reduce(function(t,n){var s=At(e,n,i);return t.top=Ce(s.top,t.top),t.right=Me(s.right,t.right),t.bottom=Me(s.bottom,t.bottom),t.left=Ce(s.left,t.left),t},At(e,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(Te(E)?E:E.contextElement||Ie(e.elements.popper),l,h,o),O=De(e.elements.reference),A=mt({reference:O,element:y,strategy:"absolute",placement:s}),T=Ot(Object.assign({},y,A)),x=u===nt?T:O,k={top:w.top-x.top+v.top,bottom:x.bottom-w.bottom+v.bottom,left:w.left-x.left+v.left,right:x.right-w.right+v.right},C=e.modifiersData.offset;if(u===nt&&C){var M=C[s];Object.keys(k).forEach(function(e){var t=[Xe,Je].indexOf(e)>=0?1:-1,n=[ze,Je].indexOf(e)>=0?"y":"x";k[e]+=M[n]*t})}return k}function Ct(e,t,n){return Ce(e,Me(t,n))}function Mt(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Lt(e){return[ze,Xe,Je,Ye].some(function(t){return e[t]>=0})}var Ft,St=ct({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,s=i.scroll,r=void 0===s||s,o=i.resize,a=void 0===o||o,l=Ae(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&c.forEach(function(e){e.addEventListener("scroll",n.update,ht)}),a&&l.addEventListener("resize",n.update,ht),function(){r&&c.forEach(function(e){e.removeEventListener("scroll",n.update,ht)}),a&&l.removeEventListener("resize",n.update,ht)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=mt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,s=void 0===i||i,r=n.adaptive,o=void 0===r||r,a=n.roundOffsets,l=void 0===a||a,c={placement:dt(t.placement),variation:ut(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,gt(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,gt(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},s=t.elements[e];xe(s)&&Be(s)&&(Object.assign(s.style,n),Object.keys(i).forEach(function(e){var t=i[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var i=t.elements[e],s=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});xe(i)&&Be(i)&&(Object.assign(i.style,r),Object.keys(s).forEach(function(e){i.removeAttribute(e)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.offset,r=void 0===s?[0,0]:s,o=st.reduce(function(e,n){return e[n]=function(e,t,n){var i=dt(e),s=[Ye,ze].indexOf(i)>=0?-1:1,r="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=r[0],a=r[1];return o=o||0,a=(a||0)*s,[Ye,Xe].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}(n,t.rects,r),e},{}),a=o[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var s=n.mainAxis,r=void 0===s||s,o=n.altAxis,a=void 0===o||o,l=n.fallbackPlacements,c=n.padding,h=n.boundary,d=n.rootBoundary,u=n.altBoundary,p=n.flipVariations,m=void 0===p||p,f=n.allowedAutoPlacements,g=t.options.placement,v=dt(g),b=l||(v!==g&&m?function(e){if(dt(e)===Ze)return[];var t=bt(e);return[Et(e),t,Et(t)]}(g):[bt(g)]),y=[g].concat(b).reduce(function(e,n){return e.concat(dt(n)===Ze?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?st:l,h=ut(i),d=h?a?it:it.filter(function(e){return ut(e)===h}):Ge,u=d.filter(function(e){return c.indexOf(e)>=0});0===u.length&&(u=d);var p=u.reduce(function(t,n){return t[n]=kt(e,{placement:n,boundary:s,rootBoundary:r,padding:o})[dt(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}(t,{placement:n,boundary:h,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:f}):n)},[]),E=t.rects.reference,w=t.rects.popper,O=new Map,A=!0,T=y[0],x=0;x<y.length;x++){var k=y[x],C=dt(k),M=ut(k)===Qe,L=[ze,Je].indexOf(C)>=0,F=L?"width":"height",S=kt(t,{placement:k,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),D=L?M?Xe:Ye:M?Je:ze;E[F]>w[F]&&(D=bt(D));var N=bt(D),B=[];if(r&&B.push(S[C]<=0),a&&B.push(S[D]<=0,S[N]<=0),B.every(function(e){return e})){T=k,A=!1;break}O.set(k,B)}if(A)for(var I=function(e){var t=y.find(function(t){var n=O.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return T=t,"break"},$=m?3:1;$>0&&"break"!==I($);$--);t.placement!==T&&(t.modifiersData[i]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,s=n.mainAxis,r=void 0===s||s,o=n.altAxis,a=void 0!==o&&o,l=n.boundary,c=n.rootBoundary,h=n.altBoundary,d=n.padding,u=n.tether,p=void 0===u||u,m=n.tetherOffset,f=void 0===m?0:m,g=kt(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),v=dt(t.placement),b=ut(t.placement),y=!b,E=pt(v),w="x"===E?"y":"x",O=t.modifiersData.popperOffsets,A=t.rects.reference,T=t.rects.popper,x="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,k="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(O){if(r){var L,F="y"===E?ze:Ye,S="y"===E?Je:Xe,D="y"===E?"height":"width",N=O[E],B=N+g[F],I=N-g[S],$=p?-T[D]/2:0,j=b===Qe?A[D]:T[D],P=b===Qe?-T[D]:-A[D],V=t.elements.arrow,K=p&&V?Ke(V):{width:0,height:0},_=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=_[F],R=_[S],U=Ct(0,A[D],K[D]),W=y?A[D]/2-$-U-H-k.mainAxis:j-U-H-k.mainAxis,q=y?-A[D]/2+$+U+R+k.mainAxis:P+U+R+k.mainAxis,z=t.elements.arrow&&qe(t.elements.arrow),J=z?"y"===E?z.clientTop||0:z.clientLeft||0:0,X=null!=(L=null==C?void 0:C[E])?L:0,Y=N+q-X,Z=Ct(p?Me(B,N+W-X-J):B,N,p?Ce(I,Y):I);O[E]=Z,M[E]=Z-N}if(a){var G,Q="x"===E?ze:Ye,ee="x"===E?Je:Xe,te=O[w],ne="y"===w?"height":"width",ie=te+g[Q],se=te-g[ee],re=-1!==[ze,Ye].indexOf(v),oe=null!=(G=null==C?void 0:C[w])?G:0,ae=re?ie:te-A[ne]-T[ne]-oe+k.altAxis,le=re?te+A[ne]+T[ne]-oe-k.altAxis:se,ce=p&&re?function(e,t,n){var i=Ct(e,t,n);return i>n?n:i}(ae,te,le):Ct(p?ae:ie,te,p?le:se);O[w]=ce,M[w]=ce-te}t.modifiersData[i]=M}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,s=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,a=dt(n.placement),l=pt(a),c=[Ye,Xe].indexOf(a)>=0?"height":"width";if(r&&o){var h=function(e,t){return Tt("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:xt(e,Ge))}(s.padding,n),d=Ke(r),u="y"===l?ze:Ye,p="y"===l?Je:Xe,m=n.rects.reference[c]+n.rects.reference[l]-o[l]-n.rects.popper[c],f=o[l]-n.rects.reference[l],g=qe(r),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=m/2-f/2,y=h[u],E=v-d[c]-h[p],w=v/2-d[c]/2+b,O=Ct(y,w,E),A=l;n.modifiersData[i]=((t={})[A]=O,t.centerOffset=O-w,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&wt(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,s=t.rects.popper,r=t.modifiersData.preventOverflow,o=kt(t,{elementContext:"reference"}),a=kt(t,{altBoundary:!0}),l=Mt(o,i),c=Mt(a,s,r),h=Lt(l),d=Lt(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}}]});class Dt extends oe{get isVisible(){const e=this.popoverElement;return!!e&&e.classList.contains("is-visible")}get isInViewport(){const e=this.popoverElement;if(!this.isVisible||!e)return!1;const t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight),i=Math.max(document.documentElement.clientWidth,window.innerWidth);return t.bottom>0&&t.top<n&&t.right>0&&t.left<i}get shouldHideOnOutsideClick(){switch(this.data.get("hide-on-outside-click")){case"after-dismissal":case"never":return!1;case"if-in-viewport":return this.isInViewport;default:return!0}}connect(){super.connect(),this.validate(),this.isVisible?this.initializePopper():"true"===this.data.get("auto-show")&&this.show(null),this.data.delete("auto-show")}disconnect(){this.hide(),this.popper&&(this.popper.destroy(),delete this.popper),super.disconnect()}toggle(e=null){this.isVisible?this.hide(e):this.show(e)}show(e=null){if(this.isVisible)return;const t=this.getDispatcher(e);this.triggerEvent("show",{dispatcher:t}).defaultPrevented||(this.popper||this.initializePopper(),this.popoverElement.classList.add("is-visible"),this.scheduleUpdate(),this.shown(t))}hide(e=null){if(!this.isVisible)return;const t=this.getDispatcher(e);this.triggerEvent("hide",{dispatcher:t}).defaultPrevented||(this.popoverElement.classList.remove("is-visible"),this.popper&&(this.popper.destroy(),delete this.popper),"after-dismissal"===this.data.get("hide-on-outside-click")&&this.data.delete("hide-on-outside-click"),this.hidden(t))}shown(e=null){this.bindDocumentEvents(),this.triggerEvent("shown",{dispatcher:e})}hidden(e=null){this.unbindDocumentEvents(),this.triggerEvent("hidden",{dispatcher:e})}generatePopover(){return null}initializePopper(){this.popper=St(this.referenceElement,this.popoverElement,{placement:this.data.get("placement")||"bottom",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"arrow",options:{element:".s-popover--arrow"}}]})}validate(){const e=this.data.get("reference-selector");if(this.referenceElement=this.element,e&&(this.referenceElement=this.element.querySelector(e),!this.referenceElement))throw"Unable to find element by reference selector: "+e;const t=this.referenceElement.getAttribute(this.popoverSelectorAttribute);let n=null;if(t){if(n=document.getElementById(t),!n)throw`[${this.popoverSelectorAttribute}="{POPOVER_ID}"] required`}else n=this.generatePopover();if(!n)throw"unable to find or generate popover element";this.popoverElement=n}getDispatcher(e=null){return e instanceof Event?e.target:e instanceof Element?e:this.element}scheduleUpdate(){this.popper&&this.isVisible&&this.popper.update()}}class Nt extends Dt{constructor(){super(...arguments),this.popoverSelectorAttribute="aria-controls"}shown(e=null){this.toggleOptionalClasses(!0),this.toggleAccessibilityAttributes(!0),super.shown(e)}hidden(e=null){this.toggleOptionalClasses(!1),this.toggleAccessibilityAttributes(!1),super.hidden(e)}connect(){super.connect(),this.toggleAccessibilityAttributes()}bindDocumentEvents(){this.boundHideOnOutsideClick=this.boundHideOnOutsideClick||this.hideOnOutsideClick.bind(this),this.boundHideOnEscapePress=this.boundHideOnEscapePress||this.hideOnEscapePress.bind(this),document.addEventListener("mousedown",this.boundHideOnOutsideClick),document.addEventListener("keyup",this.boundHideOnEscapePress)}unbindDocumentEvents(){document.removeEventListener("mousedown",this.boundHideOnOutsideClick),document.removeEventListener("keyup",this.boundHideOnEscapePress)}hideOnOutsideClick(e){const t=e.target;this.shouldHideOnOutsideClick&&!this.referenceElement.contains(t)&&!this.popoverElement.contains(t)&&document.body.contains(t)&&this.hide(e)}hideOnEscapePress(e){27===e.which&&this.isVisible&&(this.popoverElement.contains(e.target)&&this.referenceElement.focus(),this.hide(e))}toggleOptionalClasses(e){if(!this.data.has("toggle-class"))return;const t=this.data.get("toggle-class")||"",n=this.referenceElement.classList;t.split(/\s+/).forEach(function(t){n.toggle(t,e)})}toggleAccessibilityAttributes(e){const t=(null==e?void 0:e.toString())||this.referenceElement.ariaExpanded||"false";this.referenceElement.ariaExpanded=t,this.referenceElement.setAttribute("aria-expanded",t)}}function Bt(e){const{isPopover:t,controller:n}=Pt(e);if(n)n.show();else{if(!t)throw'element does not have data-controller="s-popover"';e.setAttribute("data-s-popover-auto-show","true")}}function It(e){const{isPopover:t,controller:n,popover:i}=Pt(e);if(n)n.hide();else{if(!t)throw'element does not have data-controller="s-popover"';e.removeAttribute("data-s-popover-auto-show"),i&&i.classList.remove("is-visible")}}function $t(e,t,n){const{referenceElement:i,popover:s}=Pt(e);if(s)throw`element already has popover with id="${s.id}"`;if(!i)throw"element has invalid data-s-popover-reference-selector attribute";if("string"==typeof t){const e=document.createRange().createContextualFragment(t).children;if(1!==e.length)throw"popover should contain a single element";t=e[0]}const r=i.getAttribute("aria-controls");let o=t.id;if(!t.classList.contains("s-popover"))throw`popover should have the "s-popover" class but had class="${t.className}"`;if(r&&r!==o)throw`element has aria-controls="${r}" but popover has id="${o}"`;o||(o="--stacks-s-popover-"+Math.random().toString(36).substring(2,10),t.id=o),r||i.setAttribute("aria-controls",o),!t.parentElement&&e.parentElement&&i.insertAdjacentElement("afterend",t),Vt(e,"s-popover",!0),n&&(n.toggleOnClick&&i.setAttribute("data-action","click->s-popover#toggle"),n.placement&&e.setAttribute("data-s-popover-placement",n.placement),n.autoShow&&e.setAttribute("data-s-popover-auto-show","true"))}function jt(e){const{isPopover:t,controller:n,referenceElement:i,popover:s}=Pt(e);return null==n||n.hide(),null==s||s.remove(),t&&(Vt(e,"s-popover",!1),i&&i.removeAttribute("aria-controls")),s}function Pt(e){var t;const n=(null===(t=e.getAttribute("data-controller"))||void 0===t?void 0:t.includes("s-popover"))||!1,i=re.getControllerForElementAndIdentifier(e,"s-popover"),s=e.getAttribute("data-s-popover-reference-selector"),r=s?e.querySelector(s):e,o=r?r.getAttribute("aria-controls"):null;return{isPopover:n,controller:i,referenceElement:r,popover:o?document.getElementById(o):null}}function Vt(e,t,n){var i;const s=new Set(null===(i=e.getAttribute("data-controller"))||void 0===i?void 0:i.split(/\s+/));n?s.add(t):s.delete(t),e.setAttribute("data-controller",Array.from(s).join(" "))}Nt.targets=[],function(e){e.Ascending="ascending",e.Descending="descending",e.None="none"}(Ft||(Ft={}));class Kt extends oe{constructor(){super(...arguments),this.updateSortedColumnStyles=(e,t)=>{this.columnTargets.forEach(n=>{const i=n===e,s=i?t===Ft.Ascending?"asc":"desc":Ft.None;n.classList.toggle("is-sorted",i&&t!==Ft.None),n.querySelectorAll(".js-sorting-indicator").forEach(e=>{e.classList.toggle("d-none",!e.classList.contains("js-sorting-indicator-"+s))}),i?n.setAttribute("aria-sort",t):n.removeAttribute("aria-sort")})}}sort(e){const t=this,n=e.currentTarget,i=n instanceof HTMLButtonElement?n.parentElement:n,s=this.element,r=s.tBodies[0],o=function(e){var t;const n=null===(t=e.parentElement)||void 0===t?void 0:t.parentElement;if(!(n instanceof HTMLTableSectionElement))throw"invalid table";const i=_t(n,e);if("number"!=typeof i)throw"shouldn't happen";return i}(i);if(o<0)return;const a=function(e){const t=_t(e);if(!Array.isArray(t))throw"shouldn't happen";return t}(r),l=i.getAttribute("aria-sort")===Ft.Ascending?-1:1,c=Array.from(s.tBodies[0].rows);let h=!1;const d=[];let u;c.forEach(function(e,n){var i,s;const r=t.getElementData(e,"sort-to");if("top"===r)return;if("bottom"===r)return void(u||(u=e));const l=a[n][o];if(!l)return void d.push(["",n]);const c=t.getElementData(l,"sort-val"),p=null!==(s=null!=c?c:null===(i=l.textContent)||void 0===i?void 0:i.trim())&&void 0!==s?s:"";""!==p&&`${parseInt(p,10)}`!==p&&(h=!0),d.push([p,n])}),h||d.forEach(function(e){e[0]=""===e[0]?Number.MIN_VALUE:parseInt(e[0],10)}),d.sort(function(e,t){return e[0]>t[0]?1*l:e[0]<t[0]?-1*l:e[1]>t[1]?1:-1}),d.forEach(([e,t])=>{var n;const i=c[t];null===(n=i.parentElement)||void 0===n||n.removeChild(i),u?r.insertBefore(i,u):r.appendChild(i)}),this.updateSortedColumnStyles(i,1===l?Ft.Ascending:Ft.Descending)}}function _t(e,t){const n=[];let i=e.children[0];const s=[],r=[];for(;i||r.some(e=>0!==e);){const e=[];n.push(e);let o=0;if(i)for(let n=0;n<i.children.length;n++){for(;r[o];)r[o]--,e[o]=s[o],o++;const a=i.children[n];if(!(a instanceof HTMLTableCellElement))throw"invalid table";if("none"===getComputedStyle(a).display)continue;if(a===t)return o;const l=o+a.colSpan;for(;o<l;o++)r[o]=a.rowSpan-1,s[o]=a,e[o]=a}for(;o<s.length;)r[o]&&(r[o]--,e[o]=s[o]),o++;i&&(i=i.nextElementSibling)}return t?-1:n}Kt.targets=["column"];class Ht extends oe{connect(){this.validate()}disconnect(){this.unbindDocumentEvents()}toggle(e=null){this._toggle(void 0,e)}show(e=null){this._toggle(!0,e)}hide(e=null){this._toggle(!1,e)}validate(){const e=this.data.get("return-element");if(e&&(this.returnElement=document.querySelector(e),!this.returnElement))throw"Unable to find element by return-element selector: "+e}_toggle(e,t=null){let n=e;const i="false"===this.toastTarget.getAttribute("aria-hidden");if(void 0===n&&(n=!i),n&&i||!n&&!i)return;const s=this.getDispatcher(t),r=this.triggerEvent(n?"show":"hide",{returnElement:this.returnElement,dispatcher:this.getDispatcher(s)},this.toastTarget);r.defaultPrevented||(this.returnElement=r.detail.returnElement,this.toastTarget.setAttribute("aria-hidden",n?"false":"true"),n?(this.bindDocumentEvents(),this.hideAfterTimeout(),"true"!==this.data.get("prevent-focus-capture")&&this.focusInsideToast()):(this.unbindDocumentEvents(),this.focusReturnElement(),this.removeToastOnHide(),this.clearActiveTimeout()),void 0!==this.toastTarget.ontransitionend?this.toastTarget.addEventListener("transitionend",()=>{this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.toastTarget)},{once:!0}):this.triggerEvent(n?"shown":"hidden",{dispatcher:s},this.toastTarget))}focusReturnElement(){this.returnElement&&this.toastTarget.addEventListener("s-toast:hidden",()=>{this.returnElement&&document.body.contains(this.returnElement)&&this.returnElement.focus()},{once:!0})}removeToastOnHide(){"true"===this.data.get("remove-when-hidden")&&this.toastTarget.addEventListener("s-toast:hidden",()=>{this.element.remove()},{once:!0})}hideAfterTimeout(){if("true"===this.data.get("prevent-auto-hide")||"0"===this.data.get("hide-after-timeout"))return;const e=parseInt(this.data.get("hide-after-timeout"),10)||3e3;this.activeTimeout=window.setTimeout(()=>this.hide(),e)}clearActiveTimeout(){clearTimeout(this.activeTimeout)}getAllTabbables(){return Array.from(this.toastTarget.querySelectorAll("[href], input, select, textarea, button, [tabindex]")).filter(e=>e.matches(":not([disabled]):not([tabindex='-1'])"))}firstVisible(e){return null==e?void 0:e.find(e=>null!==e.offsetParent)}focusInsideToast(){this.toastTarget.addEventListener("s-toast:shown",()=>{var e;const t=null!==(e=this.firstVisible(this.initialFocusTargets))&&void 0!==e?e:this.firstVisible(this.getAllTabbables());null==t||t.focus()},{once:!0})}bindDocumentEvents(){this._boundClickFn=this._boundClickFn||this.hideOnOutsideClick.bind(this),this._boundKeypressFn=this._boundKeypressFn||this.hideOnEscapePress.bind(this),document.addEventListener("mousedown",this._boundClickFn),document.addEventListener("keyup",this._boundKeypressFn)}unbindDocumentEvents(){document.removeEventListener("mousedown",this._boundClickFn),document.removeEventListener("keyup",this._boundKeypressFn)}hideOnOutsideClick(e){var t;const n=e.target;!(null===(t=this.toastTarget)||void 0===t?void 0:t.contains(n))&&document.body.contains(n)&&"false"!==this.data.get("hide-on-outside-click")&&this._toggle(!1,e)}hideOnEscapePress(e){27===e.which&&"true"!==this.toastTarget.getAttribute("aria-hidden")&&this._toggle(!1,e)}getDispatcher(e=null){return e instanceof Event?e.target:e instanceof Element?e:this.element}}function Rt(e){Wt(e,!0)}function Ut(e){Wt(e,!1)}function Wt(e,t){const n=re.getControllerForElementAndIdentifier(e,"s-toast");if(!n)throw"Unable to get s-toast controller from element";t?n.show():n.hide()}Ht.targets=["toast","initialFocus"];class qt extends Dt{constructor(){super(...arguments),this.popoverSelectorAttribute="aria-describedby"}connect(){super.connect(),window.matchMedia("(hover: hover)").matches&&this.bindMouseEvents(),this.bindKeyboardEvents()}disconnect(){this.unbindKeyboardEvents(),this.unbindMouseEvents(),super.disconnect()}show(e=null){const t=re.getControllerForElementAndIdentifier(this.element,"s-popover");t&&t.isVisible||super.show(e)}scheduleShow(e=null){window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout(()=>this.show(e),300)}scheduleHide(e=null){window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout(()=>super.hide(e),100)}clearActiveTimeout(){clearTimeout(this.activeTimeout)}applyTitleAttributes(){let e;const t=this.data.get("html-title");if(t)e=document.createRange().createContextualFragment(t);else{const t=this.element.getAttribute("title");if(!t)return null;e=document.createTextNode(t)}this.data.delete("html-title"),this.element.removeAttribute("title");let n=this.element.getAttribute("aria-describedby");n||(n=qt.generateId(),this.element.setAttribute("aria-describedby",n));let i=document.getElementById(n);if(!i){i=document.createElement("div"),i.id=n,i.className="s-popover s-popover__tooltip",i.setAttribute("role","tooltip");const e=this.element.parentNode;e?e.insertBefore(i,this.element.nextSibling):document.body.appendChild(i)}const s=i.querySelector(".s-popover--arrow");return i.innerHTML="",i.appendChild(e),s?i.appendChild(s):i.insertAdjacentHTML("beforeend",'<div class="s-popover--arrow"></div>'),this.scheduleUpdate(),i}bindDocumentEvents(){this.boundHideIfWithin=this.boundHideIfWithin||this.hideIfWithin.bind(this),document.addEventListener("s-popover:shown",this.boundHideIfWithin)}unbindDocumentEvents(){document.removeEventListener("s-popover:shown",this.boundHideIfWithin)}generatePopover(){return this.applyTitleAttributes()}hideIfWithin(e){e.target.contains(this.referenceElement)&&this.scheduleHide()}hideIfNotFocused(e){this.referenceElement.contains(e.relatedTarget)||this.popoverElement.contains(e.relatedTarget)||this.scheduleHide()}hideOnEscapeKeyEvent(e){"Escape"===e.key&&this.scheduleHide()}bindKeyboardEvents(){this.boundScheduleShow=this.boundScheduleShow||this.scheduleShow.bind(this),this.boundHideOnEscapeKeyEvent=this.boundHideOnEscapeKeyEvent||this.hideOnEscapeKeyEvent.bind(this),this.boundHideIfNotFocused=this.boundHideIfNotFocused||this.hideIfNotFocused.bind(this),this.referenceElement.addEventListener("focus",this.boundScheduleShow),this.referenceElement.addEventListener("focusout",this.boundHideIfNotFocused.bind(this)),this.popoverElement.addEventListener("focusout",this.boundHideIfNotFocused.bind(this)),document.addEventListener("keyup",this.boundHideOnEscapeKeyEvent)}unbindKeyboardEvents(){this.referenceElement.removeEventListener("focus",this.boundScheduleShow),this.referenceElement.removeEventListener("focusout",this.boundHideIfNotFocused),this.referenceElement.removeEventListener("focusout",this.boundHideIfNotFocused),document.removeEventListener("keyup",this.boundHideOnEscapeKeyEvent)}bindMouseEvents(){this.boundScheduleShow=this.boundScheduleShow||this.scheduleShow.bind(this),this.boundHide=this.boundHide||this.scheduleHide.bind(this),this.boundClearActiveTimeout=this.boundClearActiveTimeout||this.clearActiveTimeout.bind(this),this.referenceElement.addEventListener("mouseover",this.boundScheduleShow),this.referenceElement.addEventListener("mouseout",this.boundHide),this.popoverElement.addEventListener("mouseover",this.boundClearActiveTimeout),this.popoverElement.addEventListener("mouseout",this.boundHide)}unbindMouseEvents(){this.referenceElement.removeEventListener("mouseover",this.boundScheduleShow),this.referenceElement.removeEventListener("mouseout",this.boundHide),this.popoverElement.removeEventListener("mouseover",this.boundClearActiveTimeout),this.popoverElement.removeEventListener("mouseout",this.boundHide)}static generateId(){return"--stacks-s-tooltip-"+Math.random().toString(36).substring(2,10)}}function zt(e,t,n){e.setAttribute("data-s-tooltip-html-title",t),e.removeAttribute("title"),Xt(e,n)}function Jt(e,t,n){e.setAttribute("title",t),e.removeAttribute("data-s-tooltip-html-title"),Xt(e,n)}function Xt(e,t){t&&t.placement&&e.setAttribute("data-s-tooltip-placement",t.placement);const n=re.getControllerForElementAndIdentifier(e,"s-tooltip");if(n)n.applyTitleAttributes();else{const t=e.getAttribute("data-controller");e.setAttribute("data-controller",`${t||""} s-tooltip`)}}qt.targets=[];class Yt extends oe{connect(){super.connect(),this.boundDragEnter=this.handleUploaderActive.bind(this,!0),this.boundDragLeave=this.handleUploaderActive.bind(this,!1),this.inputTarget.addEventListener("dragenter",this.boundDragEnter),this.inputTarget.addEventListener("dragleave",this.boundDragLeave)}disconnect(){this.inputTarget.removeEventListener("dragenter",this.boundDragEnter),this.inputTarget.removeEventListener("dragleave",this.boundDragLeave),super.disconnect()}handleInput(){if(this.previewsTarget.innerHTML="",!this.inputTarget.files)return;const e=this.inputTarget.files.length;this.getDataURLs(this.inputTarget.files,Yt.FILE_DISPLAY_LIMIT).then(t=>{if(this.handleVisible(!0),t.length>1){const n=document.createElement("div");n.classList.add("s-uploader--previews-heading"),n.innerText=t.length<e?`Showing ${t.length} of ${e} files`:`${e} items`,this.previewsTarget.appendChild(n),this.previewsTarget.classList.add("has-multiple")}else this.previewsTarget.classList.remove("has-multiple");t.forEach(e=>this.addFilePreview(e)),this.handleUploaderActive(!0)}).catch(()=>null)}reset(){this.inputTarget.value="",this.previewsTarget.innerHTML="",this.handleVisible(!1)}handleVisible(e){const{scope:t}=this.targets,n=t.findAllElements("[data-s-uploader-hide-on-input]"),i=t.findAllElements("[data-s-uploader-show-on-input]"),s=t.findAllElements("[data-s-uploader-enable-on-input]");e?(n.forEach(e=>{e.classList.add("d-none")}),i.forEach(e=>{e.classList.remove("d-none")}),s.forEach(e=>{e.removeAttribute("disabled")})):(n.forEach(e=>{e.classList.remove("d-none")}),i.forEach(e=>{e.classList.add("d-none")}),s.forEach(e=>{e.setAttribute("disabled","true")}),this.handleUploaderActive(!1))}addFilePreview(e){if(!e)return;const t=document.createElement("div");let n;e.type.match("image/*")&&e.data?(n=document.createElement("img"),n.src=e.data.toString(),n.alt=e.name):(n=document.createElement("div"),n.innerText=e.name),n.classList.add("s-uploader--preview-thumbnail"),t.appendChild(n),t.classList.add("s-uploader--preview"),t.setAttribute("data-filename",e.name),this.previewsTarget.appendChild(t)}handleUploaderActive(e){this.uploaderTarget.classList.toggle("is-active",e)}fileToDataURL(e){const t=new FileReader,{name:n,size:i,type:s}=e;return i<Yt.MAX_FILE_SIZE&&s.indexOf("image")>-1?new Promise((i,r)=>{t.onload=e=>{var t;const o=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.result;o?i({data:o,name:n,type:s}):r()},t.readAsDataURL(e)}):Promise.resolve({name:n,type:s})}getDataURLs(e,t){const n=Array.from(e).slice(0,Math.min(t,e.length)).map(e=>this.fileToDataURL(e));return Promise.all(n)}}return Yt.targets=["input","previews","uploader"],Yt.FILE_DISPLAY_LIMIT=10,Yt.MAX_FILE_SIZE=10485760,re.register("s-banner",ce),re.register("s-expandable-control",ve),re.register("s-modal",be),re.register("s-toast",Ht),re.register("s-navigation-tablist",Oe),re.register("s-popover",Nt),re.register("s-table",Kt),re.register("s-tooltip",qt),re.register("s-uploader",Yt),se.finalize(),t})());
package/package.json CHANGED
@@ -1,11 +1,7 @@
1
1
  {
2
2
  "name": "@stackoverflow/stacks",
3
3
  "description": "Stack Overflow’s CSS and Design Pattern Library. Stacks is an atomic CSS library with classes and components for rapidly building Stack Overflow.",
4
- "repository": {
5
- "type": "git",
6
- "url": "https://github.com/StackExchange/Stacks.git"
7
- },
8
- "version": "2.8.4",
4
+ "version": "2.8.6",
9
5
  "files": [
10
6
  "dist",
11
7
  "lib",
@@ -17,105 +13,23 @@
17
13
  "less": "./lib/stacks.less",
18
14
  "unpkg": "dist/css/stacks.min.css",
19
15
  "scripts": {
20
- "start": "concurrently -n w: npm:start:*",
21
- "build": "concurrently -n w: npm:build:*",
22
- "build:bundle": "webpack --mode=production",
23
- "build:docs": "webpack --mode=production --config ./docs/webpack.config.js && cd ./docs && eleventy",
24
- "start:webpack": "webpack --watch --config ./docs/webpack.config.js",
25
- "start:eleventy": "cd ./docs && eleventy --serve",
16
+ "build": "webpack --mode=production",
26
17
  "test": "npm run test:less && npm run test:unit && npm run test:a11y && npm run test:visual",
27
18
  "test:a11y": "web-test-runner --group=a11y",
28
19
  "test:unit": "web-test-runner --group=unit",
29
20
  "test:unit:watch": "web-test-runner --group=unit --watch",
30
- "test:visual": "pwsh run-test-visual.ps1 npx web-test-runner --group=visual",
21
+ "test:visual:ci": "pwsh run-test-visual.ps1 npx web-test-runner --group=visual",
22
+ "test:visual": "npm run test:visual:ci -- --config ./visual-runner/stacks-classic-runner-config/web-test-runner.config.mjs",
31
23
  "test:less": "vitest run .less.test.ts",
32
24
  "test:less:update": "npm run test:less -- -u",
33
- "prepublishOnly": "npm run build",
34
- "version": "changeset version && npm install --package-lock-only",
35
- "release": "npm run build && changeset publish",
36
- "format": "prettier --write ./lib",
25
+ "format": "prettier ./lib --write --config ../../.prettierrc --ignore-path ../../.prettierignore",
37
26
  "lint": "concurrently -n w: npm:lint:*",
38
27
  "lint:ts": "eslint ./lib",
39
- "lint:css": "stylelint ./lib",
40
- "lint:format": "prettier --check ./lib"
28
+ "lint:css": "stylelint ./lib --config ../../.stylelintrc --ignore-path ../../.stylelintignore",
29
+ "lint:format": "prettier ./lib --check --config ../../.prettierrc --ignore-path ../../.prettierignore"
41
30
  },
42
- "license": "MIT",
43
31
  "dependencies": {
44
- "@hotwired/stimulus": "^3.2.2",
45
- "@popperjs/core": "^2.11.8"
46
- },
47
- "devDependencies": {
48
- "@11ty/eleventy": "^3.1.0",
49
- "@changesets/changelog-github": "^0.5.1",
50
- "@changesets/cli": "^2.29.5",
51
- "@eslint/js": "^9.30.0",
52
- "@highlightjs/cdn-assets": "^11.11.1",
53
- "@open-wc/testing": "^4.0.0",
54
- "@rollup/plugin-commonjs": "^26.0.1",
55
- "@rollup/plugin-replace": "^6.0.2",
56
- "@stackoverflow/stacks-editor": "^0.15.2",
57
- "@stackoverflow/stacks-icons": "^6.6.1",
58
- "@testing-library/dom": "^10.4.0",
59
- "@testing-library/user-event": "^14.6.1",
60
- "@types/cssbeautify": "^0.3.5",
61
- "@types/less": "^3.0.8",
62
- "@types/mocha": "^10.0.10",
63
- "@web/dev-server-esbuild": "^1.0.4",
64
- "@web/dev-server-rollup": "^0.6.4",
65
- "@web/test-runner": "^0.20.1",
66
- "@web/test-runner-playwright": "^0.11.0",
67
- "@web/test-runner-visual-regression": "^0.10.0",
68
- "apca-check": "^0.1.1",
69
- "colorjs.io": "^0.5.2",
70
- "concurrently": "^9.2.0",
71
- "css-loader": "^7.1.2",
72
- "cssbeautify": "^0.3.1",
73
- "cssnano": "^7.0.7",
74
- "docsearch.js": "^2.6.3",
75
- "eleventy-plugin-highlightjs": "^1.1.0",
76
- "eleventy-plugin-llms-txt": "^1.2.0",
77
- "eleventy-plugin-nesting-toc": "^1.3.0",
78
- "eslint": "^9.31.0",
79
- "eslint-config-prettier": "^10.1.5",
80
- "eslint-plugin-no-unsanitized": "^4.1.2",
81
- "jquery": "^3.7.1",
82
- "less-loader": "^12.3.0",
83
- "list.js": "^2.3.1",
84
- "markdown-it": "^14.1.0",
85
- "mini-css-extract-plugin": "^2.9.2",
86
- "postcss-less": "^6.0.0",
87
- "postcss-loader": "^8.1.1",
88
- "prettier": "^3.6.2",
89
- "rollup-plugin-postcss": "^4.0.2",
90
- "stylelint": "^16.21.1",
91
- "stylelint-config-recommended": "^16.0.0",
92
- "stylelint-config-standard": "^38.0.0",
93
- "terser-webpack-plugin": "^5.3.14",
94
- "ts-loader": "^9.5.2",
95
- "typescript": "^5.8.3",
96
- "typescript-eslint": "^8.35.1",
97
- "vitest": "^3.1.3",
98
- "webpack": "^5.99.9",
99
- "webpack-cli": "^6.0.1",
100
- "webpack-merge": "^6.0.1"
101
- },
102
- "browserslist": [
103
- "last 2 versions",
104
- "not dead",
105
- "not ie > 0",
106
- "not op_mini all",
107
- "not baidu > 0",
108
- "not and_ff > 0",
109
- "not and_qq > 0",
110
- "not kaios > 0",
111
- "not op_mob > 0",
112
- "not ie_mob > 0",
113
- "not and_uc > 0",
114
- "not Samsung > 0",
115
- "not Android > 0"
116
- ],
117
- "overrides": {
118
- "aria-query": "~5.0.0",
119
- "@web/dev-server-core": "0.7.1"
32
+ "@popperjs/core": "^2.11.8",
33
+ "@hotwired/stimulus": "^3.2.2"
120
34
  }
121
- }
35
+ }
package/LICENSE.MD DELETED
@@ -1,9 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright 2017-2024 Stack Exchange Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.