@easypost/easy-ui 1.0.0-alpha.4 → 1.0.0-alpha.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.
Files changed (133) hide show
  1. package/Badge/index.js +32 -26
  2. package/Badge/index.mjs +32 -26
  3. package/Banner/index.js +15 -16
  4. package/Banner/index.mjs +15 -16
  5. package/Button/Button.d.ts +61 -0
  6. package/Button/Button.d.ts.map +1 -1
  7. package/Button/index.js +34 -69
  8. package/Button/index.mjs +33 -68
  9. package/CHANGELOG.md +21 -0
  10. package/Card/index.js +84 -5
  11. package/Card/index.mjs +84 -5
  12. package/Checkbox/index.js +84 -72
  13. package/Checkbox/index.mjs +84 -72
  14. package/CodeBlock/index.js +43 -49
  15. package/CodeBlock/index.mjs +43 -49
  16. package/DropdownButton/DropdownButton.d.ts +48 -0
  17. package/DropdownButton/DropdownButton.d.ts.map +1 -1
  18. package/DropdownButton/index.js +29 -101
  19. package/DropdownButton/index.mjs +29 -85
  20. package/HorizontalGrid/index.js +11 -31
  21. package/HorizontalGrid/index.mjs +11 -31
  22. package/HorizontalStack/index.js +48 -4
  23. package/HorizontalStack/index.mjs +48 -4
  24. package/Icon/Icon.d.ts +51 -0
  25. package/Icon/Icon.d.ts.map +1 -1
  26. package/Icon/index.js +38 -4
  27. package/Icon/index.mjs +38 -4
  28. package/IconButton/IconButton.d.ts +62 -0
  29. package/IconButton/IconButton.d.ts.map +1 -1
  30. package/IconButton/index.js +26 -43
  31. package/IconButton/index.mjs +25 -42
  32. package/InputField/Label.d.ts +2 -2
  33. package/InputField/index.js +282 -10
  34. package/InputField/index.mjs +266 -10
  35. package/InputField/utilities.d.ts +1 -1
  36. package/InputField/utilities.d.ts.map +1 -1
  37. package/Menu/MenuOverlay.d.ts.map +1 -1
  38. package/Menu/index.js +178 -1958
  39. package/Menu/index.mjs +168 -1948
  40. package/Menu/utilities.d.ts +11 -0
  41. package/Menu/utilities.d.ts.map +1 -0
  42. package/Notification/index.js +1534 -14
  43. package/Notification/index.mjs +1518 -14
  44. package/Provider/index.js +15 -15
  45. package/Provider/index.mjs +15 -15
  46. package/RadioGroup/index.js +63 -63
  47. package/RadioGroup/index.mjs +63 -63
  48. package/Select/Select.d.ts +88 -0
  49. package/Select/Select.d.ts.map +1 -0
  50. package/Select/Select.stories.d.ts +17 -0
  51. package/Select/Select.stories.d.ts.map +1 -0
  52. package/Select/Select.test.d.ts +2 -0
  53. package/Select/Select.test.d.ts.map +1 -0
  54. package/Select/SelectContext.d.ts +14 -0
  55. package/Select/SelectContext.d.ts.map +1 -0
  56. package/Select/SelectField.d.ts +62 -0
  57. package/Select/SelectField.d.ts.map +1 -0
  58. package/Select/SelectOption.d.ts +23 -0
  59. package/Select/SelectOption.d.ts.map +1 -0
  60. package/Select/SelectOverlay.d.ts +3 -0
  61. package/Select/SelectOverlay.d.ts.map +1 -0
  62. package/Select/SelectSection.d.ts +22 -0
  63. package/Select/SelectSection.d.ts.map +1 -0
  64. package/Select/SelectTrigger.d.ts +30 -0
  65. package/Select/SelectTrigger.d.ts.map +1 -0
  66. package/Select/index.d.ts +2 -0
  67. package/Select/index.d.ts.map +1 -0
  68. package/Select/index.js +816 -0
  69. package/Select/index.mjs +816 -0
  70. package/SelectorErrorTooltip/index.js +102 -11
  71. package/SelectorErrorTooltip/index.mjs +86 -11
  72. package/Text/index.js +85 -4
  73. package/Text/index.mjs +85 -4
  74. package/TextField/index.js +19 -38
  75. package/TextField/index.mjs +19 -38
  76. package/Textarea/index.js +20 -37
  77. package/Textarea/index.mjs +20 -37
  78. package/Theme/index.js +145 -9
  79. package/Theme/index.mjs +145 -9
  80. package/Toggle/index.js +51 -50
  81. package/Toggle/index.mjs +51 -50
  82. package/Tooltip/index.js +299 -10
  83. package/Tooltip/index.mjs +299 -10
  84. package/UnstyledButton/index.js +4 -4
  85. package/UnstyledButton/index.mjs +3 -3
  86. package/VerticalStack/index.js +13 -47
  87. package/VerticalStack/index.mjs +13 -47
  88. package/__chunks__/ExpandMore400-7c5263a4.mjs +49 -0
  89. package/__chunks__/ExpandMore400-92646971.js +65 -0
  90. package/__chunks__/InputIcon-2317befd.mjs +148 -0
  91. package/__chunks__/InputIcon-d3963cf8.js +147 -0
  92. package/__chunks__/{import-e7f45c7e.mjs → import-0561e1ba.mjs} +3 -3
  93. package/__chunks__/{import-b7971a11.mjs → import-19bc38ac.mjs} +72 -34
  94. package/__chunks__/{import-01299af6.js → import-24a482e1.js} +3 -2
  95. package/__chunks__/{import-baa3cd0c.mjs → import-29af6941.mjs} +4 -3
  96. package/__chunks__/{import-0d1b4d93.js → import-2b302763.js} +193 -141
  97. package/__chunks__/{import-ab878fb6.mjs → import-3d962a94.mjs} +205 -153
  98. package/__chunks__/{import-86330a7c.mjs → import-6a831ca1.mjs} +16 -15
  99. package/__chunks__/{import-7545401a.js → import-8b6c0bc7.js} +3 -3
  100. package/__chunks__/{import-63bf0645.js → import-a1e0f814.js} +47 -9
  101. package/__chunks__/{import-3ab42f86.js → import-a2023d8f.js} +35 -22
  102. package/__chunks__/{import-76076ca6.js → import-dea5a24d.js} +15 -14
  103. package/__chunks__/{import-856e0385.mjs → import-f1f4792a.mjs} +36 -23
  104. package/__chunks__/{UnstyledButton-883f0c6c.mjs → index-29d7bca9.mjs} +17 -42
  105. package/__chunks__/{UnstyledButton-96172ec0.js → index-3985350a.js} +17 -42
  106. package/__chunks__/{overlayscrollbars-react.es-c8369a03.mjs → overlayscrollbars-react.es-7f332a3b.mjs} +4 -4
  107. package/__chunks__/{overlayscrollbars-react.es-20563393.js → overlayscrollbars-react.es-f2a0bcff.js} +4 -4
  108. package/__chunks__/{real-module-e4cd2301.mjs → real-module-515df21d.mjs} +1 -1
  109. package/__chunks__/{real-module-ae2a4342.js → real-module-e36b1436.js} +1 -1
  110. package/__chunks__/useTriggerWidth-156b038a.js +2030 -0
  111. package/__chunks__/useTriggerWidth-addcd1d6.mjs +2031 -0
  112. package/package.json +11 -11
  113. package/style.css +1423 -1196
  114. package/utilities/css.js +14 -58
  115. package/utilities/css.mjs +14 -58
  116. package/__chunks__/Card-7bbd41e0.mjs +0 -110
  117. package/__chunks__/Card-dac53c75.js +0 -109
  118. package/__chunks__/HorizontalStack-a441c63f.mjs +0 -80
  119. package/__chunks__/HorizontalStack-a862839b.js +0 -79
  120. package/__chunks__/Icon-3d00481a.js +0 -44
  121. package/__chunks__/Icon-a75b5201.mjs +0 -45
  122. package/__chunks__/InputField-4fbaae06.js +0 -487
  123. package/__chunks__/InputField-a272f602.mjs +0 -472
  124. package/__chunks__/Notification-b8eafec6.mjs +0 -1456
  125. package/__chunks__/Notification-c5b34eb3.js +0 -1471
  126. package/__chunks__/SelectorErrorTooltip-43c5e29e.js +0 -84
  127. package/__chunks__/SelectorErrorTooltip-b6204987.mjs +0 -69
  128. package/__chunks__/Text-1ae70c19.js +0 -102
  129. package/__chunks__/Text-4ae50d5c.mjs +0 -103
  130. package/__chunks__/Theme-4e498252.mjs +0 -132
  131. package/__chunks__/Theme-751e5575.js +0 -131
  132. package/__chunks__/Tooltip-bd55165e.js +0 -317
  133. package/__chunks__/Tooltip-f7e67b21.mjs +0 -318
@@ -1,1456 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import * as React from "react";
21
- import React__default, { useState, useCallback, useEffect, useRef, useMemo, createContext, useContext } from "react";
22
- import { c as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, b as $bdb11010cef70236$export$f680877a34711e37, d as $bdb11010cef70236$export$b4cc09c592e8fdb8, e as $7215afc6de606d6b$export$de79e2c695e052f3, $ as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./import-b7971a11.mjs";
23
- import { _ as _defineProperty, a as $6179b936705e76d3$export$ae780daf29e6d456, d as $9ab94262bd0047c7$export$420e68273165f4ec, f as $507fabe10e71c6fb$export$630ff653c5ada6a9 } from "./import-ab878fb6.mjs";
24
- import { a as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./real-module-e4cd2301.mjs";
25
- import { createPortal } from "react-dom";
26
- import { I as Icon } from "./Icon-a75b5201.mjs";
27
- import { T as Text } from "./Text-4ae50d5c.mjs";
28
- import { classNames, variationName } from "../utilities/css.mjs";
29
- import { U as UnstyledButton } from "./UnstyledButton-883f0c6c.mjs";
30
- var __defProp$5 = Object.defineProperty;
31
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
32
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
33
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
34
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
35
- var __spreadValues$5 = (a, b) => {
36
- for (var prop in b || (b = {}))
37
- if (__hasOwnProp$5.call(b, prop))
38
- __defNormalProp$5(a, prop, b[prop]);
39
- if (__getOwnPropSymbols$5)
40
- for (var prop of __getOwnPropSymbols$5(b)) {
41
- if (__propIsEnum$5.call(b, prop))
42
- __defNormalProp$5(a, prop, b[prop]);
43
- }
44
- return a;
45
- };
46
- var __objRest$5 = (source, exclude) => {
47
- var target = {};
48
- for (var prop in source)
49
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
50
- target[prop] = source[prop];
51
- if (source != null && __getOwnPropSymbols$5)
52
- for (var prop of __getOwnPropSymbols$5(source)) {
53
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
54
- target[prop] = source[prop];
55
- }
56
- return target;
57
- };
58
- const Close = (_a) => {
59
- var _b = _a, {
60
- title,
61
- titleId
62
- } = _b, props = __objRest$5(_b, [
63
- "title",
64
- "titleId"
65
- ]);
66
- return /* @__PURE__ */ React.createElement("svg", __spreadValues$5({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", "aria-labelledby": titleId }, props), title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("path", { d: "m250.923-218.924-31.999-31.999L448.001-480 218.924-709.077l31.999-31.999L480-511.999l229.077-229.077 31.999 31.999L511.999-480l229.077 229.077-31.999 31.999L480-448.001 250.923-218.924Z" }));
67
- };
68
- var __defProp$4 = Object.defineProperty;
69
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
70
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
71
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
72
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
73
- var __spreadValues$4 = (a, b) => {
74
- for (var prop in b || (b = {}))
75
- if (__hasOwnProp$4.call(b, prop))
76
- __defNormalProp$4(a, prop, b[prop]);
77
- if (__getOwnPropSymbols$4)
78
- for (var prop of __getOwnPropSymbols$4(b)) {
79
- if (__propIsEnum$4.call(b, prop))
80
- __defNormalProp$4(a, prop, b[prop]);
81
- }
82
- return a;
83
- };
84
- var __objRest$4 = (source, exclude) => {
85
- var target = {};
86
- for (var prop in source)
87
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
88
- target[prop] = source[prop];
89
- if (source != null && __getOwnPropSymbols$4)
90
- for (var prop of __getOwnPropSymbols$4(source)) {
91
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
92
- target[prop] = source[prop];
93
- }
94
- return target;
95
- };
96
- const Error2 = (_a) => {
97
- var _b = _a, {
98
- title,
99
- titleId
100
- } = _b, props = __objRest$4(_b, [
101
- "title",
102
- "titleId"
103
- ]);
104
- return /* @__PURE__ */ React.createElement("svg", __spreadValues$4({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", "aria-labelledby": titleId }, props), title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("path", { d: "M479.982-290.77q11.902 0 19.575-7.655 7.673-7.656 7.673-19.558 0-11.902-7.655-19.575t-19.557-7.673q-11.902 0-19.575 7.656-7.673 7.655-7.673 19.557 0 11.902 7.655 19.575t19.557 7.673Zm-20.443-141.076h45.383v-249.538h-45.383v249.538Zm20.794 331.845q-78.955 0-147.897-29.92t-120.755-81.71q-51.814-51.791-81.747-120.777t-29.933-148.025q0-78.655 29.92-147.864t81.71-120.522q51.791-51.314 120.777-81.247t148.025-29.933q78.655 0 147.864 29.92t120.522 81.21q51.314 51.291 81.247 120.629 29.933 69.337 29.933 147.907 0 78.955-29.92 147.897t-81.21 120.571q-51.291 51.629-120.629 81.746-69.337 30.118-147.907 30.118Zm.167-45.384q139.192 0 236.654-97.769 97.461-97.769 97.461-237.346 0-139.192-97.274-236.654Q620.067-814.615 480-814.615q-139.077 0-236.846 97.274T145.385-480q0 139.077 97.769 236.846T480.5-145.385ZM480-480Z" }));
105
- };
106
- var __defProp$3 = Object.defineProperty;
107
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
108
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
109
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
110
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
111
- var __spreadValues$3 = (a, b) => {
112
- for (var prop in b || (b = {}))
113
- if (__hasOwnProp$3.call(b, prop))
114
- __defNormalProp$3(a, prop, b[prop]);
115
- if (__getOwnPropSymbols$3)
116
- for (var prop of __getOwnPropSymbols$3(b)) {
117
- if (__propIsEnum$3.call(b, prop))
118
- __defNormalProp$3(a, prop, b[prop]);
119
- }
120
- return a;
121
- };
122
- var __objRest$3 = (source, exclude) => {
123
- var target = {};
124
- for (var prop in source)
125
- if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
126
- target[prop] = source[prop];
127
- if (source != null && __getOwnPropSymbols$3)
128
- for (var prop of __getOwnPropSymbols$3(source)) {
129
- if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
130
- target[prop] = source[prop];
131
- }
132
- return target;
133
- };
134
- const CheckCircle = (_a) => {
135
- var _b = _a, {
136
- title,
137
- titleId
138
- } = _b, props = __objRest$3(_b, [
139
- "title",
140
- "titleId"
141
- ]);
142
- return /* @__PURE__ */ React.createElement("svg", __spreadValues$3({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", "aria-labelledby": titleId }, props), title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("path", { d: "M421-311.463 690.537-581l-34.845-34.23L421-380.153 302.539-498.615l-33.846 34.23L421-311.463Zm59.067 211.462q-78.221 0-147.397-29.92-69.176-29.92-120.989-81.71-51.814-51.791-81.747-120.936-29.933-69.146-29.933-147.366 0-78.836 29.92-148.204 29.92-69.369 81.71-120.682 51.791-51.314 120.936-81.247 69.146-29.933 147.366-29.933 78.836 0 148.204 29.92 69.369 29.92 120.682 81.21 51.314 51.291 81.247 120.629 29.933 69.337 29.933 148.173 0 78.221-29.92 147.397-29.92 69.176-81.21 120.989-51.291 51.814-120.629 81.747-69.337 29.933-148.173 29.933ZM480-145.385q139.692 0 237.154-97.769Q814.615-340.923 814.615-480q0-139.692-97.461-237.154Q619.692-814.615 480-814.615q-139.077 0-236.846 97.461Q145.385-619.692 145.385-480q0 139.077 97.769 236.846T480-145.385ZM480-480Z" }));
143
- };
144
- var __defProp$2 = Object.defineProperty;
145
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
146
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
147
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
148
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
149
- var __spreadValues$2 = (a, b) => {
150
- for (var prop in b || (b = {}))
151
- if (__hasOwnProp$2.call(b, prop))
152
- __defNormalProp$2(a, prop, b[prop]);
153
- if (__getOwnPropSymbols$2)
154
- for (var prop of __getOwnPropSymbols$2(b)) {
155
- if (__propIsEnum$2.call(b, prop))
156
- __defNormalProp$2(a, prop, b[prop]);
157
- }
158
- return a;
159
- };
160
- var __objRest$2 = (source, exclude) => {
161
- var target = {};
162
- for (var prop in source)
163
- if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
164
- target[prop] = source[prop];
165
- if (source != null && __getOwnPropSymbols$2)
166
- for (var prop of __getOwnPropSymbols$2(source)) {
167
- if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
168
- target[prop] = source[prop];
169
- }
170
- return target;
171
- };
172
- const Warning = (_a) => {
173
- var _b = _a, {
174
- title,
175
- titleId
176
- } = _b, props = __objRest$2(_b, [
177
- "title",
178
- "titleId"
179
- ]);
180
- return /* @__PURE__ */ React.createElement("svg", __spreadValues$2({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", "aria-labelledby": titleId }, props), title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("path", { d: "M74.618-140.001 480-839.997l405.382 699.996H74.618Zm78.613-45.384h653.538L480-749.23 153.231-185.385Zm329.797-60.077q10.703 0 17.76-7.24 7.058-7.24 7.058-17.942t-7.24-17.76q-7.24-7.057-17.942-7.057t-17.76 7.239q-7.058 7.24-7.058 17.942 0 10.703 7.24 17.76 7.24 7.058 17.942 7.058Zm-22.874-97.922h45.384V-561.23h-45.384v217.846ZM480-467.307Z" }));
181
- };
182
- var __defProp$1 = Object.defineProperty;
183
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
184
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
185
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
186
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
187
- var __spreadValues$1 = (a, b) => {
188
- for (var prop in b || (b = {}))
189
- if (__hasOwnProp$1.call(b, prop))
190
- __defNormalProp$1(a, prop, b[prop]);
191
- if (__getOwnPropSymbols$1)
192
- for (var prop of __getOwnPropSymbols$1(b)) {
193
- if (__propIsEnum$1.call(b, prop))
194
- __defNormalProp$1(a, prop, b[prop]);
195
- }
196
- return a;
197
- };
198
- var __objRest$1 = (source, exclude) => {
199
- var target = {};
200
- for (var prop in source)
201
- if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
202
- target[prop] = source[prop];
203
- if (source != null && __getOwnPropSymbols$1)
204
- for (var prop of __getOwnPropSymbols$1(source)) {
205
- if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
206
- target[prop] = source[prop];
207
- }
208
- return target;
209
- };
210
- const DocumentScanner = (_a) => {
211
- var _b = _a, {
212
- title,
213
- titleId
214
- } = _b, props = __objRest$1(_b, [
215
- "title",
216
- "titleId"
217
- ]);
218
- return /* @__PURE__ */ React.createElement("svg", __spreadValues$1({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", "aria-labelledby": titleId }, props), title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("path", { d: "M90-748.462v-161.537h161.923v45.383H135.384v116.154H90.001Zm734.616 0v-116.154H708.462v-45.383h161.537v161.537h-45.383ZM90.001-50.001v-161.922h45.383v116.539h116.539v45.383H90.001Zm618.461 0v-45.383h116.154v-116.539h45.383v161.922H708.462ZM255.384-227.693q0 4.616 3.847 8.462 3.846 3.847 8.462 3.847h424.614q4.616 0 8.462-3.847 3.847-3.846 3.847-8.462v-504.614q0-4.616-3.847-8.462-3.846-3.847-8.462-3.847H267.693q-4.616 0-8.462 3.847-3.847 3.846-3.847 8.462v504.614Zm12.309 57.692q-23.529 0-40.611-17.081-17.081-17.082-17.081-40.611v-504.614q0-23.529 17.081-40.611 17.082-17.081 40.611-17.081h424.614q23.529 0 40.611 17.081 17.081 17.082 17.081 40.611v504.614q0 23.529-17.081 40.611-17.082 17.081-40.611 17.081H267.693Zm109.615-407.307h205.384v-45.384H377.308v45.384Zm0 120h205.384v-45.384H377.308v45.384Zm0 120h205.384v-45.384H377.308v45.384ZM255.384-227.693v-516.923 529.232-12.309Z" }));
219
- };
220
- var __defProp2 = Object.defineProperty;
221
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
222
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
223
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
224
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
225
- var __spreadValues2 = (a, b) => {
226
- for (var prop in b || (b = {}))
227
- if (__hasOwnProp2.call(b, prop))
228
- __defNormalProp2(a, prop, b[prop]);
229
- if (__getOwnPropSymbols2)
230
- for (var prop of __getOwnPropSymbols2(b)) {
231
- if (__propIsEnum2.call(b, prop))
232
- __defNormalProp2(a, prop, b[prop]);
233
- }
234
- return a;
235
- };
236
- var __objRest = (source, exclude) => {
237
- var target = {};
238
- for (var prop in source)
239
- if (__hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0)
240
- target[prop] = source[prop];
241
- if (source != null && __getOwnPropSymbols2)
242
- for (var prop of __getOwnPropSymbols2(source)) {
243
- if (exclude.indexOf(prop) < 0 && __propIsEnum2.call(source, prop))
244
- target[prop] = source[prop];
245
- }
246
- return target;
247
- };
248
- const CurrencyExchange = (_a) => {
249
- var _b = _a, {
250
- title,
251
- titleId
252
- } = _b, props = __objRest(_b, [
253
- "title",
254
- "titleId"
255
- ]);
256
- return /* @__PURE__ */ React.createElement("svg", __spreadValues2({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -960 960 960", "aria-labelledby": titleId }, props), title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("path", { d: "M480-60.002q-117 0-219.654-68.884-102.654-68.885-156.884-166.194v141.231H58.078v-219.998h219.999v45.383H136.846q45.615 91.232 142.038 157.156Q375.307-105.385 480-105.385q75.692 0 142.884-28.269t117.731-77.461q50.538-49.192 80.923-116 30.384-66.807 32.692-142.884h45.384q-1.923 85.23-35.654 159.845T773.499-179.77q-56.731 55.769-132.307 87.769-75.577 32-161.192 32Zm-23.23-142.614v-52.077q-42.308-10.846-72.231-34.846-29.923-24-50.538-66.922l39.845-14.308q14.308 37.231 44.616 58.462 30.307 21.23 68.153 21.23 39.616 0 68.808-19.884 29.193-19.885 29.193-56.885 0-34.154-23.654-55.885-23.654-21.731-90.269-48.962-62.693-25-91.731-52.461-29.038-27.461-29.038-74.153 0-40.923 28.846-71.154 28.846-30.231 80-37.231v-49.077h43.845v49.077q34.923 3.231 62.154 21.692 27.23 18.462 44.23 50.385L571.385-618Q556-643.693 534-657.308q-22-13.615-52-13.615-40.154 0-64.385 19.923t-24.231 51.693q0 32.769 22.923 51.384 22.923 18.616 84.769 43 69.77 28.231 98.193 58.308 28.423 30.076 28.423 78.769 0 26.153-9.962 46.769-9.961 20.615-26.846 35.038-16.885 14.423-40.115 22.962-23.231 8.538-50.154 10.384v50.077H456.77ZM60.386-490.001q2.693-87.153 36.808-161.961 34.115-74.807 91.23-130.191 57.116-55.384 132.115-86.615 75-31.231 159.461-31.231 115.846 0 219.654 69.078 103.808 69.077 156.884 167.539v-142.769h45.384v219.998H681.923v-45.383h141.231q-44.461-89.309-140.576-156.194Q586.462-854.615 480-854.615q-74.154 0-141.346 27.884-67.192 27.885-117.923 76.692-50.73 48.808-81.692 115.615-30.961 66.808-33.269 144.423H60.386Z" }));
257
- };
258
- var shim = { exports: {} };
259
- var useSyncExternalStoreShim_production_min = {};
260
- /**
261
- * @license React
262
- * use-sync-external-store-shim.production.min.js
263
- *
264
- * Copyright (c) Facebook, Inc. and its affiliates.
265
- *
266
- * This source code is licensed under the MIT license found in the
267
- * LICENSE file in the root directory of this source tree.
268
- */
269
- var hasRequiredUseSyncExternalStoreShim_production_min;
270
- function requireUseSyncExternalStoreShim_production_min() {
271
- if (hasRequiredUseSyncExternalStoreShim_production_min)
272
- return useSyncExternalStoreShim_production_min;
273
- hasRequiredUseSyncExternalStoreShim_production_min = 1;
274
- var e = React__default;
275
- function h(a, b) {
276
- return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
277
- }
278
- var k = "function" === typeof Object.is ? Object.is : h, l = e.useState, m = e.useEffect, n = e.useLayoutEffect, p = e.useDebugValue;
279
- function q(a, b) {
280
- var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
281
- n(function() {
282
- c.value = d;
283
- c.getSnapshot = b;
284
- r(c) && g({ inst: c });
285
- }, [a, d, b]);
286
- m(function() {
287
- r(c) && g({ inst: c });
288
- return a(function() {
289
- r(c) && g({ inst: c });
290
- });
291
- }, [a]);
292
- p(d);
293
- return d;
294
- }
295
- function r(a) {
296
- var b = a.getSnapshot;
297
- a = a.value;
298
- try {
299
- var d = b();
300
- return !k(a, d);
301
- } catch (f) {
302
- return true;
303
- }
304
- }
305
- function t(a, b) {
306
- return b();
307
- }
308
- var u = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t : q;
309
- useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u;
310
- return useSyncExternalStoreShim_production_min;
311
- }
312
- var useSyncExternalStoreShim_development = {};
313
- /**
314
- * @license React
315
- * use-sync-external-store-shim.development.js
316
- *
317
- * Copyright (c) Facebook, Inc. and its affiliates.
318
- *
319
- * This source code is licensed under the MIT license found in the
320
- * LICENSE file in the root directory of this source tree.
321
- */
322
- var hasRequiredUseSyncExternalStoreShim_development;
323
- function requireUseSyncExternalStoreShim_development() {
324
- if (hasRequiredUseSyncExternalStoreShim_development)
325
- return useSyncExternalStoreShim_development;
326
- hasRequiredUseSyncExternalStoreShim_development = 1;
327
- if (process.env.NODE_ENV !== "production") {
328
- (function() {
329
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
330
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
331
- }
332
- var React2 = React__default;
333
- var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
334
- function error(format) {
335
- {
336
- {
337
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
338
- args[_key2 - 1] = arguments[_key2];
339
- }
340
- printWarning("error", format, args);
341
- }
342
- }
343
- }
344
- function printWarning(level, format, args) {
345
- {
346
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
347
- var stack = ReactDebugCurrentFrame.getStackAddendum();
348
- if (stack !== "") {
349
- format += "%s";
350
- args = args.concat([stack]);
351
- }
352
- var argsWithFormat = args.map(function(item) {
353
- return String(item);
354
- });
355
- argsWithFormat.unshift("Warning: " + format);
356
- Function.prototype.apply.call(console[level], console, argsWithFormat);
357
- }
358
- }
359
- function is(x, y) {
360
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
361
- }
362
- var objectIs = typeof Object.is === "function" ? Object.is : is;
363
- var useState2 = React2.useState, useEffect2 = React2.useEffect, useLayoutEffect = React2.useLayoutEffect, useDebugValue = React2.useDebugValue;
364
- var didWarnOld18Alpha = false;
365
- var didWarnUncachedGetSnapshot = false;
366
- function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
367
- {
368
- if (!didWarnOld18Alpha) {
369
- if (React2.startTransition !== void 0) {
370
- didWarnOld18Alpha = true;
371
- error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
372
- }
373
- }
374
- }
375
- var value = getSnapshot();
376
- {
377
- if (!didWarnUncachedGetSnapshot) {
378
- var cachedValue = getSnapshot();
379
- if (!objectIs(value, cachedValue)) {
380
- error("The result of getSnapshot should be cached to avoid an infinite loop");
381
- didWarnUncachedGetSnapshot = true;
382
- }
383
- }
384
- }
385
- var _useState = useState2({
386
- inst: {
387
- value,
388
- getSnapshot
389
- }
390
- }), inst = _useState[0].inst, forceUpdate = _useState[1];
391
- useLayoutEffect(function() {
392
- inst.value = value;
393
- inst.getSnapshot = getSnapshot;
394
- if (checkIfSnapshotChanged(inst)) {
395
- forceUpdate({
396
- inst
397
- });
398
- }
399
- }, [subscribe, value, getSnapshot]);
400
- useEffect2(function() {
401
- if (checkIfSnapshotChanged(inst)) {
402
- forceUpdate({
403
- inst
404
- });
405
- }
406
- var handleStoreChange = function() {
407
- if (checkIfSnapshotChanged(inst)) {
408
- forceUpdate({
409
- inst
410
- });
411
- }
412
- };
413
- return subscribe(handleStoreChange);
414
- }, [subscribe]);
415
- useDebugValue(value);
416
- return value;
417
- }
418
- function checkIfSnapshotChanged(inst) {
419
- var latestGetSnapshot = inst.getSnapshot;
420
- var prevValue = inst.value;
421
- try {
422
- var nextValue = latestGetSnapshot();
423
- return !objectIs(prevValue, nextValue);
424
- } catch (error2) {
425
- return true;
426
- }
427
- }
428
- function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
429
- return getSnapshot();
430
- }
431
- var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
432
- var isServerEnvironment = !canUseDOM;
433
- var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
434
- var useSyncExternalStore$2 = React2.useSyncExternalStore !== void 0 ? React2.useSyncExternalStore : shim2;
435
- useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
436
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
437
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
438
- }
439
- })();
440
- }
441
- return useSyncExternalStoreShim_development;
442
- }
443
- if (process.env.NODE_ENV === "production") {
444
- shim.exports = requireUseSyncExternalStoreShim_production_min();
445
- } else {
446
- shim.exports = requireUseSyncExternalStoreShim_development();
447
- }
448
- var shimExports = shim.exports;
449
- const $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION = 1;
450
- const $a86207c5d7f7e1fb$var$landmarkSymbol = Symbol.for("react-aria-landmark-manager");
451
- function $a86207c5d7f7e1fb$var$subscribe(fn) {
452
- document.addEventListener("react-aria-landmark-manager-change", fn);
453
- return () => document.removeEventListener("react-aria-landmark-manager-change", fn);
454
- }
455
- function $a86207c5d7f7e1fb$var$getLandmarkManager() {
456
- if (typeof document === "undefined")
457
- return null;
458
- let instance = document[$a86207c5d7f7e1fb$var$landmarkSymbol];
459
- if (instance && instance.version >= $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION)
460
- return instance;
461
- document[$a86207c5d7f7e1fb$var$landmarkSymbol] = new $a86207c5d7f7e1fb$var$LandmarkManager();
462
- document.dispatchEvent(new CustomEvent("react-aria-landmark-manager-change"));
463
- return document[$a86207c5d7f7e1fb$var$landmarkSymbol];
464
- }
465
- function $a86207c5d7f7e1fb$var$useLandmarkManager() {
466
- return shimExports.useSyncExternalStore($a86207c5d7f7e1fb$var$subscribe, $a86207c5d7f7e1fb$var$getLandmarkManager, $a86207c5d7f7e1fb$var$getLandmarkManager);
467
- }
468
- class $a86207c5d7f7e1fb$var$LandmarkManager {
469
- setupIfNeeded() {
470
- if (this.isListening)
471
- return;
472
- document.addEventListener("keydown", this.f6Handler, {
473
- capture: true
474
- });
475
- document.addEventListener("focusin", this.focusinHandler, {
476
- capture: true
477
- });
478
- document.addEventListener("focusout", this.focusoutHandler, {
479
- capture: true
480
- });
481
- this.isListening = true;
482
- }
483
- teardownIfNeeded() {
484
- if (!this.isListening || this.landmarks.length > 0 || this.refCount > 0)
485
- return;
486
- document.removeEventListener("keydown", this.f6Handler, {
487
- capture: true
488
- });
489
- document.removeEventListener("focusin", this.focusinHandler, {
490
- capture: true
491
- });
492
- document.removeEventListener("focusout", this.focusoutHandler, {
493
- capture: true
494
- });
495
- this.isListening = false;
496
- }
497
- focusLandmark(landmark, direction) {
498
- var _this_landmarks_find, _this_landmarks_find_focus;
499
- (_this_landmarks_find = this.landmarks.find((l) => l.ref.current === landmark)) === null || _this_landmarks_find === void 0 ? void 0 : (_this_landmarks_find_focus = _this_landmarks_find.focus) === null || _this_landmarks_find_focus === void 0 ? void 0 : _this_landmarks_find_focus.call(_this_landmarks_find, direction);
500
- }
501
- /**
502
- * Return set of landmarks with a specific role.
503
- */
504
- getLandmarksByRole(role) {
505
- return new Set(this.landmarks.filter((l) => l.role === role));
506
- }
507
- /**
508
- * Return first landmark with a specific role.
509
- */
510
- getLandmarkByRole(role) {
511
- return this.landmarks.find((l) => l.role === role);
512
- }
513
- addLandmark(newLandmark) {
514
- this.setupIfNeeded();
515
- if (this.landmarks.find((landmark) => landmark.ref === newLandmark.ref) || !newLandmark.ref.current)
516
- return;
517
- if (this.landmarks.filter((landmark) => landmark.role === "main").length > 1)
518
- console.error('Page can contain no more than one landmark with the role "main".');
519
- if (this.landmarks.length === 0) {
520
- this.landmarks = [
521
- newLandmark
522
- ];
523
- this.checkLabels(newLandmark.role);
524
- return;
525
- }
526
- let start = 0;
527
- let end = this.landmarks.length - 1;
528
- while (start <= end) {
529
- let mid = Math.floor((start + end) / 2);
530
- let comparedPosition = newLandmark.ref.current.compareDocumentPosition(this.landmarks[mid].ref.current);
531
- let isNewAfterExisting = Boolean(comparedPosition & Node.DOCUMENT_POSITION_PRECEDING || comparedPosition & Node.DOCUMENT_POSITION_CONTAINS);
532
- if (isNewAfterExisting)
533
- start = mid + 1;
534
- else
535
- end = mid - 1;
536
- }
537
- this.landmarks.splice(start, 0, newLandmark);
538
- this.checkLabels(newLandmark.role);
539
- }
540
- updateLandmark(landmark) {
541
- let index = this.landmarks.findIndex((l) => l.ref === landmark.ref);
542
- if (index >= 0) {
543
- this.landmarks[index] = __spreadValues(__spreadValues({}, this.landmarks[index]), landmark);
544
- this.checkLabels(this.landmarks[index].role);
545
- }
546
- }
547
- removeLandmark(ref) {
548
- this.landmarks = this.landmarks.filter((landmark) => landmark.ref !== ref);
549
- this.teardownIfNeeded();
550
- }
551
- /**
552
- * Warn if there are 2+ landmarks with the same role but no label.
553
- * Labels for landmarks with the same role must also be unique.
554
- *
555
- * See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.
556
- */
557
- checkLabels(role) {
558
- let landmarksWithRole = this.getLandmarksByRole(role);
559
- if (landmarksWithRole.size > 1) {
560
- let duplicatesWithoutLabel = [
561
- ...landmarksWithRole
562
- ].filter((landmark) => !landmark.label);
563
- if (duplicatesWithoutLabel.length > 0)
564
- console.warn(`Page contains more than one landmark with the '${role}' role. If two or more landmarks on a page share the same role, all must be labeled with an aria-label or aria-labelledby attribute: `, duplicatesWithoutLabel.map((landmark) => landmark.ref.current));
565
- else {
566
- let labels = [
567
- ...landmarksWithRole
568
- ].map((landmark) => landmark.label);
569
- let duplicateLabels = labels.filter((item, index) => labels.indexOf(item) !== index);
570
- duplicateLabels.forEach((label) => {
571
- console.warn(`Page contains more than one landmark with the '${role}' role and '${label}' label. If two or more landmarks on a page share the same role, they must have unique labels: `, [
572
- ...landmarksWithRole
573
- ].filter((landmark) => landmark.label === label).map((landmark) => landmark.ref.current));
574
- });
575
- }
576
- }
577
- }
578
- /**
579
- * Get the landmark that is the closest parent in the DOM.
580
- * Returns undefined if no parent is a landmark.
581
- */
582
- closestLandmark(element) {
583
- let landmarkMap = new Map(this.landmarks.map((l) => [
584
- l.ref.current,
585
- l
586
- ]));
587
- let currentElement = element;
588
- while (currentElement && !landmarkMap.has(currentElement) && currentElement !== document.body && currentElement.parentElement)
589
- currentElement = currentElement.parentElement;
590
- return landmarkMap.get(currentElement);
591
- }
592
- /**
593
- * Gets the next landmark, in DOM focus order, or previous if backwards is specified.
594
- * If last landmark, next should be the first landmark.
595
- * If not inside a landmark, will return first landmark.
596
- * Returns undefined if there are no landmarks.
597
- */
598
- getNextLandmark(element, { backward }) {
599
- var _this_landmarks_nextLandmarkIndex_ref_current;
600
- let currentLandmark = this.closestLandmark(element);
601
- let nextLandmarkIndex = backward ? this.landmarks.length - 1 : 0;
602
- if (currentLandmark)
603
- nextLandmarkIndex = this.landmarks.indexOf(currentLandmark) + (backward ? -1 : 1);
604
- let wrapIfNeeded = () => {
605
- if (nextLandmarkIndex < 0) {
606
- if (!element.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
607
- detail: {
608
- direction: "backward"
609
- },
610
- bubbles: true,
611
- cancelable: true
612
- })))
613
- return true;
614
- nextLandmarkIndex = this.landmarks.length - 1;
615
- } else if (nextLandmarkIndex >= this.landmarks.length) {
616
- if (!element.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
617
- detail: {
618
- direction: "forward"
619
- },
620
- bubbles: true,
621
- cancelable: true
622
- })))
623
- return true;
624
- nextLandmarkIndex = 0;
625
- }
626
- if (nextLandmarkIndex < 0 || nextLandmarkIndex >= this.landmarks.length)
627
- return true;
628
- return false;
629
- };
630
- if (wrapIfNeeded())
631
- return void 0;
632
- let i = nextLandmarkIndex;
633
- while ((_this_landmarks_nextLandmarkIndex_ref_current = this.landmarks[nextLandmarkIndex].ref.current) === null || _this_landmarks_nextLandmarkIndex_ref_current === void 0 ? void 0 : _this_landmarks_nextLandmarkIndex_ref_current.closest("[aria-hidden=true]")) {
634
- nextLandmarkIndex += backward ? -1 : 1;
635
- if (wrapIfNeeded())
636
- return void 0;
637
- if (nextLandmarkIndex === i)
638
- break;
639
- }
640
- return this.landmarks[nextLandmarkIndex];
641
- }
642
- /**
643
- * Look at next landmark. If an element was previously focused inside, restore focus there.
644
- * If not, focus the landmark itself.
645
- * If no landmarks at all, or none with focusable elements, don't move focus.
646
- */
647
- f6Handler(e) {
648
- if (e.key === "F6") {
649
- let handled = e.altKey ? this.focusMain() : this.navigate(e.target, e.shiftKey);
650
- if (handled) {
651
- e.preventDefault();
652
- e.stopPropagation();
653
- }
654
- }
655
- }
656
- focusMain() {
657
- let main = this.getLandmarkByRole("main");
658
- if (main && main.ref.current && document.contains(main.ref.current)) {
659
- this.focusLandmark(main.ref.current, "forward");
660
- return true;
661
- }
662
- return false;
663
- }
664
- navigate(from, backward) {
665
- let nextLandmark = this.getNextLandmark(from, {
666
- backward
667
- });
668
- if (!nextLandmark)
669
- return false;
670
- if (nextLandmark.lastFocused) {
671
- let lastFocused = nextLandmark.lastFocused;
672
- if (document.body.contains(lastFocused)) {
673
- lastFocused.focus();
674
- return true;
675
- }
676
- }
677
- if (nextLandmark.ref.current && document.contains(nextLandmark.ref.current)) {
678
- this.focusLandmark(nextLandmark.ref.current, backward ? "backward" : "forward");
679
- return true;
680
- }
681
- return false;
682
- }
683
- /**
684
- * Sets lastFocused for a landmark, if focus is moved within that landmark.
685
- * Lets the last focused landmark know it was blurred if something else is focused.
686
- */
687
- focusinHandler(e) {
688
- let currentLandmark = this.closestLandmark(e.target);
689
- if (currentLandmark && currentLandmark.ref.current !== e.target)
690
- this.updateLandmark({
691
- ref: currentLandmark.ref,
692
- lastFocused: e.target
693
- });
694
- let previousFocusedElement = e.relatedTarget;
695
- if (previousFocusedElement) {
696
- let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);
697
- if (closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement)
698
- closestPreviousLandmark.blur();
699
- }
700
- }
701
- /**
702
- * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had focus.
703
- */
704
- focusoutHandler(e) {
705
- let previousFocusedElement = e.target;
706
- let nextFocusedElement = e.relatedTarget;
707
- if (!nextFocusedElement || nextFocusedElement === document) {
708
- let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);
709
- if (closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement)
710
- closestPreviousLandmark.blur();
711
- }
712
- }
713
- createLandmarkController() {
714
- let instance = this;
715
- instance.refCount++;
716
- instance.setupIfNeeded();
717
- return {
718
- navigate(direction, opts) {
719
- let element = (opts === null || opts === void 0 ? void 0 : opts.from) || document.activeElement;
720
- return instance.navigate(element, direction === "backward");
721
- },
722
- focusNext(opts) {
723
- let element = (opts === null || opts === void 0 ? void 0 : opts.from) || document.activeElement;
724
- return instance.navigate(element, false);
725
- },
726
- focusPrevious(opts) {
727
- let element = (opts === null || opts === void 0 ? void 0 : opts.from) || document.activeElement;
728
- return instance.navigate(element, true);
729
- },
730
- focusMain() {
731
- return instance.focusMain();
732
- },
733
- dispose() {
734
- if (instance) {
735
- instance.refCount--;
736
- instance.teardownIfNeeded();
737
- instance = null;
738
- }
739
- }
740
- };
741
- }
742
- registerLandmark(landmark) {
743
- if (this.landmarks.find((l) => l.ref === landmark.ref))
744
- this.updateLandmark(landmark);
745
- else
746
- this.addLandmark(landmark);
747
- return () => this.removeLandmark(landmark.ref);
748
- }
749
- constructor() {
750
- _defineProperty(this, "landmarks", []);
751
- _defineProperty(this, "isListening", false);
752
- _defineProperty(this, "refCount", 0);
753
- _defineProperty(this, "version", $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION);
754
- this.f6Handler = this.f6Handler.bind(this);
755
- this.focusinHandler = this.focusinHandler.bind(this);
756
- this.focusoutHandler = this.focusoutHandler.bind(this);
757
- }
758
- }
759
- function $a86207c5d7f7e1fb$export$4cc632584fd87fae(props, ref) {
760
- const { role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, focus } = props;
761
- let manager = $a86207c5d7f7e1fb$var$useLandmarkManager();
762
- let label = ariaLabel || ariaLabelledby;
763
- let [isLandmarkFocused, setIsLandmarkFocused] = useState(false);
764
- let defaultFocus = useCallback(() => {
765
- setIsLandmarkFocused(true);
766
- }, [
767
- setIsLandmarkFocused
768
- ]);
769
- let blur = useCallback(() => {
770
- setIsLandmarkFocused(false);
771
- }, [
772
- setIsLandmarkFocused
773
- ]);
774
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
775
- if (manager)
776
- return manager.registerLandmark({
777
- ref,
778
- label,
779
- role,
780
- focus: focus || defaultFocus,
781
- blur
782
- });
783
- }, [
784
- manager,
785
- label,
786
- ref,
787
- role,
788
- focus,
789
- defaultFocus,
790
- blur
791
- ]);
792
- useEffect(() => {
793
- var _ref_current;
794
- if (isLandmarkFocused)
795
- (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.focus();
796
- }, [
797
- isLandmarkFocused,
798
- ref
799
- ]);
800
- return {
801
- landmarkProps: {
802
- role,
803
- tabIndex: isLandmarkFocused ? -1 : void 0,
804
- "aria-label": ariaLabel,
805
- "aria-labelledby": ariaLabelledby
806
- }
807
- };
808
- }
809
- function $parcel$interopDefault(a) {
810
- return a && a.__esModule ? a.default : a;
811
- }
812
- var $ebf9e0ddd819695a$exports = {};
813
- var $ff9177efc58547ad$exports = {};
814
- $ff9177efc58547ad$exports = {
815
- "close": `إغلاق`,
816
- "notifications": `إشعارات`
817
- };
818
- var $25eb7c0c0c45e544$exports = {};
819
- $25eb7c0c0c45e544$exports = {
820
- "close": `Затвори`,
821
- "notifications": `Известия`
822
- };
823
- var $28feffc3d61a8691$exports = {};
824
- $28feffc3d61a8691$exports = {
825
- "close": `Zavřít`,
826
- "notifications": `Upozornění`
827
- };
828
- var $390d441203d25ff4$exports = {};
829
- $390d441203d25ff4$exports = {
830
- "close": `Luk`,
831
- "notifications": `Påmindelser`
832
- };
833
- var $7063c2d0f14f979a$exports = {};
834
- $7063c2d0f14f979a$exports = {
835
- "close": `Schließen`,
836
- "notifications": `Benachrichtigungen`
837
- };
838
- var $2dfc1dbb6590af88$exports = {};
839
- $2dfc1dbb6590af88$exports = {
840
- "close": `Κλείσιμο`,
841
- "notifications": `Ειδοποιήσεις`
842
- };
843
- var $9a12ff1caae5a7a5$exports = {};
844
- $9a12ff1caae5a7a5$exports = {
845
- "close": `Close`,
846
- "notifications": `Notifications`
847
- };
848
- var $f4095fb5a72adbe6$exports = {};
849
- $f4095fb5a72adbe6$exports = {
850
- "close": `Cerrar`,
851
- "notifications": `Notificaciones`
852
- };
853
- var $75bc5191b9d7826a$exports = {};
854
- $75bc5191b9d7826a$exports = {
855
- "close": `Sule`,
856
- "notifications": `Teated`
857
- };
858
- var $e4b9aef18b0db8dc$exports = {};
859
- $e4b9aef18b0db8dc$exports = {
860
- "close": `Sulje`,
861
- "notifications": `Ilmoitukset`
862
- };
863
- var $888756784d832bd7$exports = {};
864
- $888756784d832bd7$exports = {
865
- "close": `Fermer`,
866
- "notifications": `Notifications`
867
- };
868
- var $6835949b68a1fabf$exports = {};
869
- $6835949b68a1fabf$exports = {
870
- "close": `סגור`,
871
- "notifications": `התראות`
872
- };
873
- var $87ffcbc0b651e40b$exports = {};
874
- $87ffcbc0b651e40b$exports = {
875
- "close": `Zatvori`,
876
- "notifications": `Obavijesti`
877
- };
878
- var $dc6e3b2813600d69$exports = {};
879
- $dc6e3b2813600d69$exports = {
880
- "close": `Bezárás`,
881
- "notifications": `Értesítések`
882
- };
883
- var $fe136bcbacfcfa14$exports = {};
884
- $fe136bcbacfcfa14$exports = {
885
- "close": `Chiudi`,
886
- "notifications": `Notifiche`
887
- };
888
- var $8fb53a929b46df83$exports = {};
889
- $8fb53a929b46df83$exports = {
890
- "close": `閉じる`,
891
- "notifications": `通知`
892
- };
893
- var $2c38dbfaf041a865$exports = {};
894
- $2c38dbfaf041a865$exports = {
895
- "close": `닫기`,
896
- "notifications": `알림`
897
- };
898
- var $48f3f33a29908d4c$exports = {};
899
- $48f3f33a29908d4c$exports = {
900
- "close": `Uždaryti`,
901
- "notifications": `Pranešimai`
902
- };
903
- var $9867160d996455a0$exports = {};
904
- $9867160d996455a0$exports = {
905
- "close": `Aizvērt`,
906
- "notifications": `Paziņojumi`
907
- };
908
- var $196258ea25c96487$exports = {};
909
- $196258ea25c96487$exports = {
910
- "close": `Lukk`,
911
- "notifications": `Varsler`
912
- };
913
- var $949061cb954e8000$exports = {};
914
- $949061cb954e8000$exports = {
915
- "close": `Sluiten`,
916
- "notifications": `Meldingen`
917
- };
918
- var $8189bed27add1ad3$exports = {};
919
- $8189bed27add1ad3$exports = {
920
- "close": `Zamknij`,
921
- "notifications": `Powiadomienia`
922
- };
923
- var $a361756a93b6e28c$exports = {};
924
- $a361756a93b6e28c$exports = {
925
- "close": `Fechar`,
926
- "notifications": `Notificações`
927
- };
928
- var $034c7393857c8db0$exports = {};
929
- $034c7393857c8db0$exports = {
930
- "close": `Fechar`,
931
- "notifications": `Notificações`
932
- };
933
- var $e33d3b3868478b04$exports = {};
934
- $e33d3b3868478b04$exports = {
935
- "close": `Închideţi`,
936
- "notifications": `Notificări`
937
- };
938
- var $9a7dcb914b29cd9f$exports = {};
939
- $9a7dcb914b29cd9f$exports = {
940
- "close": `Закрыть`,
941
- "notifications": `Уведомления`
942
- };
943
- var $e43d964a0c7f1266$exports = {};
944
- $e43d964a0c7f1266$exports = {
945
- "close": `Zatvoriť`,
946
- "notifications": `Oznámenia`
947
- };
948
- var $0bc56cee3275bcaa$exports = {};
949
- $0bc56cee3275bcaa$exports = {
950
- "close": `Zapri`,
951
- "notifications": `Obvestila`
952
- };
953
- var $7dbdd7289c10d2ba$exports = {};
954
- $7dbdd7289c10d2ba$exports = {
955
- "close": `Zatvori`,
956
- "notifications": `Obaveštenja`
957
- };
958
- var $ccbe6066c10b1e53$exports = {};
959
- $ccbe6066c10b1e53$exports = {
960
- "close": `Stäng`,
961
- "notifications": `Aviseringar`
962
- };
963
- var $9d503476b9d858b7$exports = {};
964
- $9d503476b9d858b7$exports = {
965
- "close": `Kapat`,
966
- "notifications": `Bildirimler`
967
- };
968
- var $32ee419c7b9b7a83$exports = {};
969
- $32ee419c7b9b7a83$exports = {
970
- "close": `Закрити`,
971
- "notifications": `Сповіщення`
972
- };
973
- var $122525af1cb737c7$exports = {};
974
- $122525af1cb737c7$exports = {
975
- "close": `关闭`,
976
- "notifications": `通知`
977
- };
978
- var $52e8b1b00094e5a3$exports = {};
979
- $52e8b1b00094e5a3$exports = {
980
- "close": `關閉`,
981
- "notifications": `通知`
982
- };
983
- $ebf9e0ddd819695a$exports = {
984
- "ar-AE": $ff9177efc58547ad$exports,
985
- "bg-BG": $25eb7c0c0c45e544$exports,
986
- "cs-CZ": $28feffc3d61a8691$exports,
987
- "da-DK": $390d441203d25ff4$exports,
988
- "de-DE": $7063c2d0f14f979a$exports,
989
- "el-GR": $2dfc1dbb6590af88$exports,
990
- "en-US": $9a12ff1caae5a7a5$exports,
991
- "es-ES": $f4095fb5a72adbe6$exports,
992
- "et-EE": $75bc5191b9d7826a$exports,
993
- "fi-FI": $e4b9aef18b0db8dc$exports,
994
- "fr-FR": $888756784d832bd7$exports,
995
- "he-IL": $6835949b68a1fabf$exports,
996
- "hr-HR": $87ffcbc0b651e40b$exports,
997
- "hu-HU": $dc6e3b2813600d69$exports,
998
- "it-IT": $fe136bcbacfcfa14$exports,
999
- "ja-JP": $8fb53a929b46df83$exports,
1000
- "ko-KR": $2c38dbfaf041a865$exports,
1001
- "lt-LT": $48f3f33a29908d4c$exports,
1002
- "lv-LV": $9867160d996455a0$exports,
1003
- "nb-NO": $196258ea25c96487$exports,
1004
- "nl-NL": $949061cb954e8000$exports,
1005
- "pl-PL": $8189bed27add1ad3$exports,
1006
- "pt-BR": $a361756a93b6e28c$exports,
1007
- "pt-PT": $034c7393857c8db0$exports,
1008
- "ro-RO": $e33d3b3868478b04$exports,
1009
- "ru-RU": $9a7dcb914b29cd9f$exports,
1010
- "sk-SK": $e43d964a0c7f1266$exports,
1011
- "sl-SI": $0bc56cee3275bcaa$exports,
1012
- "sr-SP": $7dbdd7289c10d2ba$exports,
1013
- "sv-SE": $ccbe6066c10b1e53$exports,
1014
- "tr-TR": $9d503476b9d858b7$exports,
1015
- "uk-UA": $32ee419c7b9b7a83$exports,
1016
- "zh-CN": $122525af1cb737c7$exports,
1017
- "zh-TW": $52e8b1b00094e5a3$exports
1018
- };
1019
- function $d6542812f0669241$export$a407b657d3044108(props, state, ref) {
1020
- let { key, timer, timeout, animation } = props.toast;
1021
- useEffect(() => {
1022
- if (!timer)
1023
- return;
1024
- timer.reset(timeout);
1025
- return () => {
1026
- timer.pause();
1027
- };
1028
- }, [
1029
- timer,
1030
- timeout
1031
- ]);
1032
- let focusOnUnmount = useRef(null);
1033
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
1034
- let container2 = ref.current.closest("[role=region]");
1035
- return () => {
1036
- if (container2 && container2.contains(document.activeElement))
1037
- focusOnUnmount.current = container2;
1038
- };
1039
- }, [
1040
- ref
1041
- ]);
1042
- useEffect(() => {
1043
- return () => {
1044
- if (focusOnUnmount.current)
1045
- focusOnUnmount.current.focus();
1046
- };
1047
- }, [
1048
- ref
1049
- ]);
1050
- let titleId = $bdb11010cef70236$export$f680877a34711e37();
1051
- let descriptionId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
1052
- let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1(/* @__PURE__ */ $parcel$interopDefault($ebf9e0ddd819695a$exports));
1053
- return {
1054
- toastProps: {
1055
- role: "alert",
1056
- "aria-label": props["aria-label"],
1057
- "aria-labelledby": props["aria-labelledby"] || titleId,
1058
- "aria-describedby": props["aria-describedby"] || descriptionId,
1059
- "aria-details": props["aria-details"],
1060
- // Hide toasts that are animating out so VoiceOver doesn't announce them.
1061
- "aria-hidden": animation === "exiting" ? "true" : void 0
1062
- },
1063
- titleProps: {
1064
- id: titleId
1065
- },
1066
- descriptionProps: {
1067
- id: descriptionId
1068
- },
1069
- closeButtonProps: {
1070
- "aria-label": stringFormatter.format("close"),
1071
- onPress: () => state.close(key)
1072
- }
1073
- };
1074
- }
1075
- function $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref) {
1076
- let stringFormatter = $fca6afa0e843324b$export$f12b703ca79dfbb1(/* @__PURE__ */ $parcel$interopDefault($ebf9e0ddd819695a$exports));
1077
- let { landmarkProps } = $a86207c5d7f7e1fb$export$4cc632584fd87fae({
1078
- role: "region",
1079
- "aria-label": props["aria-label"] || stringFormatter.format("notifications")
1080
- }, ref);
1081
- let { hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({
1082
- onHoverStart: state.pauseAll,
1083
- onHoverEnd: state.resumeAll
1084
- });
1085
- let lastFocused = useRef(null);
1086
- let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
1087
- onFocusWithin: (e) => {
1088
- state.pauseAll();
1089
- lastFocused.current = e.relatedTarget;
1090
- },
1091
- onBlurWithin: () => {
1092
- state.resumeAll();
1093
- lastFocused.current = null;
1094
- }
1095
- });
1096
- useEffect(() => {
1097
- return () => {
1098
- if (lastFocused.current && document.body.contains(lastFocused.current)) {
1099
- if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "pointer")
1100
- $7215afc6de606d6b$export$de79e2c695e052f3(lastFocused.current);
1101
- else
1102
- lastFocused.current.focus();
1103
- }
1104
- };
1105
- }, [
1106
- ref
1107
- ]);
1108
- return {
1109
- regionProps: $3ef42575df84b30b$export$9d1611c77c2fe928(landmarkProps, hoverProps, focusWithinProps, {
1110
- tabIndex: -1,
1111
- // Mark the toast region as a "top layer", so that it:
1112
- // - is not aria-hidden when opening an overlay
1113
- // - allows focus even outside a containing focus scope
1114
- // - doesn’t dismiss overlays when clicking on it, even though it is outside
1115
- // @ts-ignore
1116
- "data-react-aria-top-layer": true
1117
- })
1118
- };
1119
- }
1120
- const statusPromotional = "_statusPromotional_1nbb2_5";
1121
- const statusSuccess = "_statusSuccess_1nbb2_10";
1122
- const statusNeutral = "_statusNeutral_1nbb2_15";
1123
- const statusWarning = "_statusWarning_1nbb2_20";
1124
- const statusError = "_statusError_1nbb2_25";
1125
- const typeToast = "_typeToast_1nbb2_30";
1126
- const typeAlert = "_typeAlert_1nbb2_34";
1127
- const Notification$1 = "_Notification_1nbb2_39";
1128
- const iconText = "_iconText_1nbb2_55";
1129
- const closeButton = "_closeButton_1nbb2_61";
1130
- const region = "_region_1nbb2_71";
1131
- const container = "_container_1nbb2_77";
1132
- const styles = {
1133
- statusPromotional,
1134
- statusSuccess,
1135
- statusNeutral,
1136
- statusWarning,
1137
- statusError,
1138
- typeToast,
1139
- typeAlert,
1140
- Notification: Notification$1,
1141
- iconText,
1142
- closeButton,
1143
- region,
1144
- container
1145
- };
1146
- function NotificationRegion(props) {
1147
- const { state } = props;
1148
- const ref = React__default.useRef(null);
1149
- const { regionProps } = $6cc546b19ee7130a$export$b8cbbb20a51697de(props, state, ref);
1150
- return /* @__PURE__ */ React__default.createElement("div", __spreadProps(__spreadValues({}, regionProps), { ref, className: styles.region }), state.visibleToasts.map((toast) => /* @__PURE__ */ React__default.createElement(Notification, { key: toast.key, toast, state })));
1151
- }
1152
- function NotificationContainer(props) {
1153
- const { getContainer = null, position = "fixed", offset, state } = props;
1154
- const showNotifications = state.visibleToasts.length > 0;
1155
- let requestFailed = false;
1156
- let container2 = null;
1157
- if (showNotifications && getContainer) {
1158
- container2 = getContainer();
1159
- requestFailed = container2 === null;
1160
- }
1161
- const positionStyleProps = offset && !requestFailed ? {
1162
- top: offset == null ? void 0 : offset.top,
1163
- right: offset == null ? void 0 : offset.right,
1164
- bottom: offset == null ? void 0 : offset.bottom,
1165
- left: offset == null ? void 0 : offset.left
1166
- } : {
1167
- top: 0,
1168
- left: 0
1169
- };
1170
- const positionProps = {
1171
- position: !requestFailed ? position : "fixed"
1172
- };
1173
- const containerStyles = __spreadValues(__spreadValues({}, positionStyleProps), positionProps);
1174
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, showNotifications ? createPortal(
1175
- /* @__PURE__ */ React__default.createElement("div", { className: styles.container, style: containerStyles }, /* @__PURE__ */ React__default.createElement(NotificationRegion, { state })),
1176
- container2 != null ? container2 : document.body
1177
- ) : null);
1178
- }
1179
- function $77b352cf12efcf73$export$84726ef35ca2129a(queue) {
1180
- let subscribe = useCallback((fn) => queue.subscribe(fn), [
1181
- queue
1182
- ]);
1183
- let getSnapshot = useCallback(() => queue.visibleToasts, [
1184
- queue
1185
- ]);
1186
- let visibleToasts = shimExports.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
1187
- return {
1188
- visibleToasts,
1189
- add: (content, options) => queue.add(content, options),
1190
- close: (key) => queue.close(key),
1191
- remove: (key) => queue.remove(key),
1192
- pauseAll: () => queue.pauseAll(),
1193
- resumeAll: () => queue.resumeAll()
1194
- };
1195
- }
1196
- class $77b352cf12efcf73$export$f1f8569633bbbec4 {
1197
- /** Subscribes to updates to the visible toasts. */
1198
- subscribe(fn) {
1199
- this.subscriptions.add(fn);
1200
- return () => this.subscriptions.delete(fn);
1201
- }
1202
- /** Adds a new toast to the queue. */
1203
- add(content, options = {}) {
1204
- let toastKey = Math.random().toString(36);
1205
- let toast = __spreadProps(__spreadValues({}, options), {
1206
- content,
1207
- key: toastKey,
1208
- timer: options.timeout ? new $77b352cf12efcf73$var$Timer(() => this.close(toastKey), options.timeout) : null
1209
- });
1210
- let low = 0;
1211
- let high = this.queue.length;
1212
- while (low < high) {
1213
- let mid = Math.floor((low + high) / 2);
1214
- if ((toast.priority || 0) > (this.queue[mid].priority || 0))
1215
- high = mid;
1216
- else
1217
- low = mid + 1;
1218
- }
1219
- this.queue.splice(low, 0, toast);
1220
- toast.animation = low < this.maxVisibleToasts ? "entering" : "queued";
1221
- let i = this.maxVisibleToasts;
1222
- while (i < this.queue.length)
1223
- this.queue[i++].animation = "queued";
1224
- this.updateVisibleToasts();
1225
- return toastKey;
1226
- }
1227
- /**
1228
- * Closes a toast. If `hasExitAnimation` is true, the toast
1229
- * transitions to an "exiting" state instead of being removed immediately.
1230
- */
1231
- close(key) {
1232
- let index = this.queue.findIndex((t) => t.key === key);
1233
- if (index >= 0) {
1234
- var _this_queue_index, _this_queue_index_onClose;
1235
- (_this_queue_index_onClose = (_this_queue_index = this.queue[index]).onClose) === null || _this_queue_index_onClose === void 0 ? void 0 : _this_queue_index_onClose.call(_this_queue_index);
1236
- this.queue.splice(index, 1);
1237
- }
1238
- this.updateVisibleToasts();
1239
- }
1240
- /** Removes a toast from the visible toasts after an exiting animation. */
1241
- remove(key) {
1242
- this.visibleToasts = this.visibleToasts.filter((t) => t.key !== key);
1243
- this.updateVisibleToasts();
1244
- }
1245
- updateVisibleToasts() {
1246
- let toasts = this.queue.slice(0, this.maxVisibleToasts);
1247
- if (this.hasExitAnimation) {
1248
- let prevToasts = this.visibleToasts.filter((t) => !toasts.some((t2) => t.key === t2.key)).map((t) => __spreadProps(__spreadValues({}, t), {
1249
- animation: "exiting"
1250
- }));
1251
- this.visibleToasts = prevToasts.concat(toasts).sort((a, b) => b.priority - a.priority);
1252
- } else
1253
- this.visibleToasts = toasts;
1254
- for (let fn of this.subscriptions)
1255
- fn();
1256
- }
1257
- /** Pauses the timers for all visible toasts. */
1258
- pauseAll() {
1259
- for (let toast of this.visibleToasts)
1260
- if (toast.timer)
1261
- toast.timer.pause();
1262
- }
1263
- /** Resumes the timers for all visible toasts. */
1264
- resumeAll() {
1265
- for (let toast of this.visibleToasts)
1266
- if (toast.timer)
1267
- toast.timer.resume();
1268
- }
1269
- constructor(options) {
1270
- _defineProperty(this, "queue", []);
1271
- _defineProperty(this, "subscriptions", /* @__PURE__ */ new Set());
1272
- _defineProperty(this, "visibleToasts", []);
1273
- var _options_maxVisibleToasts;
1274
- this.maxVisibleToasts = (_options_maxVisibleToasts = options === null || options === void 0 ? void 0 : options.maxVisibleToasts) !== null && _options_maxVisibleToasts !== void 0 ? _options_maxVisibleToasts : 1;
1275
- var _options_hasExitAnimation;
1276
- this.hasExitAnimation = (_options_hasExitAnimation = options === null || options === void 0 ? void 0 : options.hasExitAnimation) !== null && _options_hasExitAnimation !== void 0 ? _options_hasExitAnimation : false;
1277
- }
1278
- }
1279
- class $77b352cf12efcf73$var$Timer {
1280
- reset(delay) {
1281
- this.remaining = delay;
1282
- this.resume();
1283
- }
1284
- pause() {
1285
- if (this.timerId == null)
1286
- return;
1287
- clearTimeout(this.timerId);
1288
- this.timerId = null;
1289
- this.remaining -= Date.now() - this.startTime;
1290
- }
1291
- resume() {
1292
- if (this.remaining <= 0)
1293
- return;
1294
- this.startTime = Date.now();
1295
- this.timerId = setTimeout(() => {
1296
- this.timerId = null;
1297
- this.remaining = 0;
1298
- this.callback();
1299
- }, this.remaining);
1300
- }
1301
- constructor(callback, delay) {
1302
- this.remaining = delay;
1303
- this.callback = callback;
1304
- }
1305
- }
1306
- const TOAST_TIMEOUT_DURATION = 4e3;
1307
- class EasyUINotificationQueue extends $77b352cf12efcf73$export$f1f8569633bbbec4 {
1308
- constructor(options) {
1309
- super(options);
1310
- this.activeNotificationKey = "";
1311
- }
1312
- closeActiveNotification() {
1313
- if (this.activeNotificationKey) {
1314
- super.close(this.activeNotificationKey);
1315
- }
1316
- }
1317
- alert(content) {
1318
- this.closeActiveNotification();
1319
- this.activeNotificationKey = super.add(content);
1320
- }
1321
- toast(content) {
1322
- this.closeActiveNotification();
1323
- this.activeNotificationKey = super.add(content, {
1324
- timeout: TOAST_TIMEOUT_DURATION
1325
- });
1326
- }
1327
- }
1328
- function useNotificationState() {
1329
- const queue = useMemo(
1330
- () => new EasyUINotificationQueue(),
1331
- []
1332
- );
1333
- const state = $77b352cf12efcf73$export$84726ef35ca2129a(queue);
1334
- return __spreadProps(__spreadValues({}, state), {
1335
- showPromotionalAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), { status: "promotional", type: "alert" })),
1336
- showNeutralAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), { status: "neutral", type: "alert" })),
1337
- showSuccessAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), { status: "success", type: "alert" })),
1338
- showWarningAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), { status: "warning", type: "alert" })),
1339
- showErrorAlert: (content) => queue.alert(__spreadProps(__spreadValues({}, content), { status: "error", type: "alert" })),
1340
- showPromotionalToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), { status: "promotional", type: "toast" })),
1341
- showNeutralToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), { status: "neutral", type: "toast" })),
1342
- showSuccessToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), { status: "success", type: "toast" })),
1343
- showWarningToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), { status: "warning", type: "toast" })),
1344
- showErrorToast: (content) => queue.toast(__spreadProps(__spreadValues({}, content), { status: "error", type: "toast" })),
1345
- closeActiveNotification: () => queue.closeActiveNotification()
1346
- });
1347
- }
1348
- function Notification(props) {
1349
- const ref = useRef(null);
1350
- const { state, toast: notification } = props;
1351
- const {
1352
- type = "toast",
1353
- message,
1354
- status = "success",
1355
- hasIcon = true,
1356
- onDismiss
1357
- } = notification.content;
1358
- const {
1359
- toastProps: notificationProps,
1360
- titleProps,
1361
- closeButtonProps
1362
- } = $d6542812f0669241$export$a407b657d3044108(props, state, ref);
1363
- const notificationPropsWithAdjustedAriaRole = type === "toast" ? __spreadProps(__spreadValues({}, notificationProps), { role: "status" }) : notificationProps;
1364
- const handleDismiss = () => {
1365
- if (onDismiss) {
1366
- onDismiss();
1367
- }
1368
- state.close(notification.key);
1369
- };
1370
- const closeButtonPropsWithDismiss = __spreadProps(__spreadValues({}, closeButtonProps), {
1371
- onPress: handleDismiss
1372
- });
1373
- return /* @__PURE__ */ React__default.createElement(
1374
- "div",
1375
- __spreadProps(__spreadValues({}, notificationPropsWithAdjustedAriaRole), {
1376
- ref,
1377
- className: classNames(
1378
- styles.Notification,
1379
- styles[variationName("status", status)],
1380
- styles[variationName("type", type)]
1381
- )
1382
- }),
1383
- /* @__PURE__ */ React__default.createElement("div", { className: styles.iconText }, hasIcon && /* @__PURE__ */ React__default.createElement(Icon, { size: "lg", symbol: getStatusIcon(status) }), /* @__PURE__ */ React__default.createElement("div", __spreadValues({}, titleProps), /* @__PURE__ */ React__default.createElement(Text, { weight: "semibold" }, message))),
1384
- type === "alert" && /* @__PURE__ */ React__default.createElement(
1385
- UnstyledButton,
1386
- __spreadProps(__spreadValues({}, closeButtonPropsWithDismiss), {
1387
- className: classNames(styles.closeButton)
1388
- }),
1389
- /* @__PURE__ */ React__default.createElement(Icon, { size: "md", symbol: Close })
1390
- )
1391
- );
1392
- }
1393
- function getStatusIcon(status) {
1394
- switch (status) {
1395
- case "promotional":
1396
- return CurrencyExchange;
1397
- case "success":
1398
- return CheckCircle;
1399
- case "neutral":
1400
- return DocumentScanner;
1401
- case "error":
1402
- return Error2;
1403
- case "warning":
1404
- return Warning;
1405
- }
1406
- }
1407
- const NotificationContext = createContext(null);
1408
- function useNotification() {
1409
- const notification = useContext(NotificationContext);
1410
- if (!notification) {
1411
- throw new Error(
1412
- "useNotification() must be used within a NotificationProvider, which is bundled with EasyUIProvider"
1413
- );
1414
- }
1415
- return notification;
1416
- }
1417
- function NotificationProvider(props) {
1418
- const { children, notificationPlacement } = props;
1419
- const combinedState = useNotificationState();
1420
- const state = {
1421
- close: combinedState.close,
1422
- add: combinedState.add,
1423
- remove: combinedState.remove,
1424
- pauseAll: combinedState.pauseAll,
1425
- resumeAll: combinedState.resumeAll,
1426
- visibleToasts: combinedState.visibleToasts
1427
- };
1428
- const notification = {
1429
- showErrorAlert: combinedState.showErrorAlert,
1430
- showErrorToast: combinedState.showErrorToast,
1431
- showPromotionalToast: combinedState.showPromotionalToast,
1432
- showPromotionalAlert: combinedState.showPromotionalAlert,
1433
- showNeutralToast: combinedState.showNeutralToast,
1434
- showNeutralAlert: combinedState.showNeutralAlert,
1435
- showSuccessToast: combinedState.showSuccessToast,
1436
- showSuccessAlert: combinedState.showSuccessAlert,
1437
- showWarningToast: combinedState.showWarningToast,
1438
- showWarningAlert: combinedState.showWarningAlert,
1439
- closeActiveNotification: combinedState.closeActiveNotification
1440
- };
1441
- return /* @__PURE__ */ React__default.createElement(NotificationContext.Provider, { value: notification }, /* @__PURE__ */ React__default.createElement(
1442
- NotificationContainer,
1443
- {
1444
- getContainer: notificationPlacement == null ? void 0 : notificationPlacement.getContainer,
1445
- offset: notificationPlacement == null ? void 0 : notificationPlacement.offset,
1446
- position: notificationPlacement == null ? void 0 : notificationPlacement.position,
1447
- state
1448
- }
1449
- ), children);
1450
- }
1451
- export {
1452
- NotificationProvider as N,
1453
- Notification as a,
1454
- NotificationContext as b,
1455
- useNotification as u
1456
- };