PageSourceSearch

https://ids-angular.netlify.app/sb-manager/runtime.js

js ids-angular.netlify.app collected 2026-10-03 10:54:05 UTC 1,198,595 bytes, 27,463 lines download raw bytes

1var __create = Object.create;
2var __defProp = Object.defineProperty;
3var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4var __getOwnPropNames = Object.getOwnPropertyNames;
5var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6var __require = /* @__PURE__ */ ((x2) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(x2, {
7  get: (a2, b2) => (typeof require < "u" ? require : a2)[b2]
8}) : x2)(function(x2) {
9  if (typeof require < "u") return require.apply(this, arguments);
10  throw Error('Dynamic require of "' + x2 + '" is not supported');
11});
12var __esm = (fn, res) => function() {
13  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14};
15var __commonJS = (cb, mod) => function() {
16  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17};
18var __export = (target, all) => {
19  for (var name in all)
20    __defProp(target, name, { get: all[name], enumerable: !0 });
21}, __copyProps = (to, from, except, desc) => {
22  if (from && typeof from == "object" || typeof from == "function")
23    for (let key of __getOwnPropNames(from))
24      !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25  return to;
26};
27var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28  // If the importer is in node compatibility mode or this is not an ESM
29  // file that has been converted to a CommonJS file using a Babel-
30  // compatible transform (i.e. "__esModule" has not been set), then set
31  // "default" to the CommonJS "module.exports" for node compatibility.
32  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
33  mod
34)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
35
36// global-externals:react
37var react_exports = {};
38__export(react_exports, {
39  Children: () => Children,
40  Component: () => Component,
41  Fragment: () => Fragment,
42  Profiler: () => Profiler,
43  PureComponent: () => PureComponent,
44  StrictMode: () => StrictMode,
45  Suspense: () => Suspense,
46  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: () => __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
47  act: () => act,
48  cloneElement: () => cloneElement,
49  createContext: () => createContext,
50  createElement: () => createElement,
51  createFactory: () => createFactory,
52  createRef: () => createRef,
53  default: () => react_default,
54  forwardRef: () => forwardRef,
55  isValidElement: () => isValidElement,
56  lazy: () => lazy,
57  memo: () => memo,
58  startTransition: () => startTransition,
59  unstable_act: () => unstable_act,
60  useCallback: () => useCallback,
61  useContext: () => useContext,
62  useDebugValue: () => useDebugValue,
63  useDeferredValue: () => useDeferredValue,
64  useEffect: () => useEffect,
65  useId: () => useId,
66  useImperativeHandle: () => useImperativeHandle,
67  useInsertionEffect: () => useInsertionEffect,
68  useLayoutEffect: () => useLayoutEffect,
69  useMemo: () => useMemo,
70  useReducer: () => useReducer,
71  useRef: () => useRef,
72  useState: () => useState,
73  useSyncExternalStore: () => useSyncExternalStore,
74  useTransition: () => useTransition,
75  version: () => version
76});
77var react_default, Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, act, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, startTransition, unstable_act, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, version, init_react = __esm({
78  "global-externals:react"() {
79    react_default = __REACT__, { Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, act, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, startTransition, unstable_act, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, version } = __REACT__;
80  }
81});
82
vendor: 339 bytes, lines 83-91
83// ../../node_modules/prop-types/lib/ReactPropTypesSecret.js
84var require_ReactPropTypesSecret = __commonJS({
85  "../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
86    "use strict";
87    var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
88    module.exports = ReactPropTypesSecret;
89  }
90});
91
vendor: 1,638 bytes, lines 92-142
92// ../../node_modules/prop-types/factoryWithThrowingShims.js
93var require_factoryWithThrowingShims = __commonJS({
94  "../../node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) {
95    "use strict";
96    var ReactPropTypesSecret = require_ReactPropTypesSecret();
97    function emptyFunction() {
98    }
99    function emptyFunctionWithReset() {
100    }
101    emptyFunctionWithReset.resetWarningCache = emptyFunction;
102    module.exports = function() {
103      function shim(props, propName, componentName, location2, propFullName, secret) {
104        if (secret !== ReactPropTypesSecret) {
105          var err = new Error(
106            "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
107          );
108          throw err.name = "Invariant Violation", err;
109        }
110      }
111      shim.isRequired = shim;
112      function getShim() {
113        return shim;
114      }
115      var ReactPropTypes = {
116        array: shim,
117        bigint: shim,
118        bool: shim,
119        func: shim,
120        number: shim,
121        object: shim,
122        string: shim,
123        symbol: shim,
124        any: shim,
125        arrayOf: getShim,
126        element: shim,
127        elementType: shim,
128        instanceOf: getShim,
129        node: shim,
130        objectOf: getShim,
131        oneOf: getShim,
132        oneOfType: getShim,
133        shape: getShim,
134        exact: getShim,
135        checkPropTypes: emptyFunctionWithReset,
136        resetWarningCache: emptyFunction
137      };
138      return ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes;
139    };
140  }
141});
142
vendor: 248 bytes, lines 143-150
143// ../../node_modules/prop-types/index.js
144var require_prop_types = __commonJS({
145  "../../node_modules/prop-types/index.js"(exports, module) {
146    module.exports = require_factoryWithThrowingShims()();
147    var ReactIs, throwOnDirectAccess;
148  }
149});
150
vendor: 2,998 bytes, lines 151-212
151// ../../node_modules/react-fast-compare/index.js
152var require_react_fast_compare = __commonJS({
153  "../../node_modules/react-fast-compare/index.js"(exports, module) {
154    var hasElementType = typeof Element < "u", hasMap = typeof Map == "function", hasSet = typeof Set == "function", hasArrayBuffer = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
155    function equal3(a2, b2) {
156      if (a2 === b2) return !0;
157      if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
158        if (a2.constructor !== b2.constructor) return !1;
159        var length, i2, keys;
160        if (Array.isArray(a2)) {
161          if (length = a2.length, length != b2.length) return !1;
162          for (i2 = length; i2-- !== 0; )
163            if (!equal3(a2[i2], b2[i2])) return !1;
164          return !0;
165        }
166        var it;
167        if (hasMap && a2 instanceof Map && b2 instanceof Map) {
168          if (a2.size !== b2.size) return !1;
169          for (it = a2.entries(); !(i2 = it.next()).done; )
170            if (!b2.has(i2.value[0])) return !1;
171          for (it = a2.entries(); !(i2 = it.next()).done; )
172            if (!equal3(i2.value[1], b2.get(i2.value[0]))) return !1;
173          return !0;
174        }
175        if (hasSet && a2 instanceof Set && b2 instanceof Set) {
176          if (a2.size !== b2.size) return !1;
177          for (it = a2.entries(); !(i2 = it.next()).done; )
178            if (!b2.has(i2.value[0])) return !1;
179          return !0;
180        }
181        if (hasArrayBuffer && ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
182          if (length = a2.length, length != b2.length) return !1;
183          for (i2 = length; i2-- !== 0; )
184            if (a2[i2] !== b2[i2]) return !1;
185          return !0;
186        }
187        if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags;
188        if (a2.valueOf !== Object.prototype.valueOf && typeof a2.valueOf == "function" && typeof b2.valueOf == "function") return a2.valueOf() === b2.valueOf();
189        if (a2.toString !== Object.prototype.toString && typeof a2.toString == "function" && typeof b2.toString == "function") return a2.toString() === b2.toString();
190        if (keys = Object.keys(a2), length = keys.length, length !== Object.keys(b2).length) return !1;
191        for (i2 = length; i2-- !== 0; )
192          if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return !1;
193        if (hasElementType && a2 instanceof Element) return !1;
194        for (i2 = length; i2-- !== 0; )
195          if (!((keys[i2] === "_owner" || keys[i2] === "__v" || keys[i2] === "__o") && a2.$$typeof) && !equal3(a2[keys[i2]], b2[keys[i2]]))
196            return !1;
197        return !0;
198      }
199      return a2 !== a2 && b2 !== b2;
200    }
201    module.exports = function(a2, b2) {
202      try {
203        return equal3(a2, b2);
204      } catch (error) {
205        if ((error.message || "").match(/stack|recursion/i))
206          return console.warn("react-fast-compare cannot handle circular refs"), !1;
207        throw error;
208      }
209    };
210  }
211});
212
vendor: 854 bytes, lines 213-238
213// ../../node_modules/invariant/browser.js
214var require_browser = __commonJS({
215  "../../node_modules/invariant/browser.js"(exports, module) {
216    "use strict";
217    var invariant = function(condition, format, a2, b2, c2, d2, e2, f2) {
218      if (!condition) {
219        var error;
220        if (format === void 0)
221          error = new Error(
222            "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
223          );
224        else {
225          var args = [a2, b2, c2, d2, e2, f2], argIndex = 0;
226          error = new Error(
227            format.replace(/%s/g, function() {
228              return args[argIndex++];
229            })
230          ), error.name = "Invariant Violation";
231        }
232        throw error.framesToPop = 1, error;
233      }
234    };
235    module.exports = invariant;
236  }
237});
238
vendor: 1,063 bytes, lines 239-265
239// ../../node_modules/shallowequal/index.js
240var require_shallowequal = __commonJS({
241  "../../node_modules/shallowequal/index.js"(exports, module) {
242    module.exports = function(objA, objB, compare, compareContext) {
243      var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
244      if (ret !== void 0)
245        return !!ret;
246      if (objA === objB)
247        return !0;
248      if (typeof objA != "object" || !objA || typeof objB != "object" || !objB)
249        return !1;
250      var keysA = Object.keys(objA), keysB = Object.keys(objB);
251      if (keysA.length !== keysB.length)
252        return !1;
253      for (var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB), idx = 0; idx < keysA.length; idx++) {
254        var key = keysA[idx];
255        if (!bHasOwnProperty(key))
256          return !1;
257        var valueA = objA[key], valueB = objB[key];
258        if (ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0, ret === !1 || ret === void 0 && valueA !== valueB)
259          return !1;
260      }
261      return !0;
262    };
263  }
264});
265
vendor: 2,034 bytes, lines 266-308
266// ../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
267var require_use_sync_external_store_shim_production = __commonJS({
268  "../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports) {
269    "use strict";
270    var React = (init_react(), __toCommonJS(react_exports));
271    function is4(x2, y2) {
272      return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
273    }
274    var objectIs = typeof Object.is == "function" ? Object.is : is4, useState2 = React.useState, useEffect2 = React.useEffect, useLayoutEffect2 = React.useLayoutEffect, useDebugValue2 = React.useDebugValue;
275    function useSyncExternalStore$2(subscribe, getSnapshot) {
276      var value = getSnapshot(), _useState = useState2({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
277      return useLayoutEffect2(
278        function() {
279          inst.value = value, inst.getSnapshot = getSnapshot, checkIfSnapshotChanged(inst) && forceUpdate({ inst });
280        },
281        [subscribe, value, getSnapshot]
282      ), useEffect2(
283        function() {
284          return checkIfSnapshotChanged(inst) && forceUpdate({ inst }), subscribe(function() {
285            checkIfSnapshotChanged(inst) && forceUpdate({ inst });
286          });
287        },
288        [subscribe]
289      ), useDebugValue2(value), value;
290    }
291    function checkIfSnapshotChanged(inst) {
292      var latestGetSnapshot = inst.getSnapshot;
293      inst = inst.value;
294      try {
295        var nextValue = latestGetSnapshot();
296        return !objectIs(inst, nextValue);
297      } catch {
298        return !0;
299      }
300    }
301    function useSyncExternalStore$1(subscribe, getSnapshot) {
302      return getSnapshot();
303    }
304    var shim = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? useSyncExternalStore$1 : useSyncExternalStore$2;
305    exports.useSyncExternalStore = React.useSyncExternalStore !== void 0 ? React.useSyncExternalStore : shim;
306  }
307});
308
vendor: 271 bytes, lines 309-316
309// ../../node_modules/use-sync-external-store/shim/index.js
310var require_shim = __commonJS({
311  "../../node_modules/use-sync-external-store/shim/index.js"(exports, module) {
312    "use strict";
313    module.exports = require_use_sync_external_store_shim_production();
314  }
315});
316
vendor: 6,832 bytes, lines 317-444
317// ../../node_modules/memoizerific/memoizerific.js
318var require_memoizerific = __commonJS({
319  "../../node_modules/memoizerific/memoizerific.js"(exports, module) {
320    (function(f2) {
321      if (typeof exports == "object" && typeof module < "u")
322        module.exports = f2();
323      else if (typeof define == "function" && define.amd)
324        define([], f2);
325      else {
326        var g2;
327        typeof window < "u" ? g2 = window : typeof global < "u" ? g2 = global : typeof self < "u" ? g2 = self : g2 = this, g2.memoizerific = f2();
328      }
329    })(function() {
330      var define2, module2, exports2;
331      return (function e2(t2, n3, r4) {
332        function s2(o4, u2) {
333          if (!n3[o4]) {
334            if (!t2[o4]) {
335              var a2 = typeof __require == "function" && __require;
336              if (!u2 && a2) return a2(o4, !0);
337              if (i2) return i2(o4, !0);
338              var f2 = new Error("Cannot find module '" + o4 + "'");
339              throw f2.code = "MODULE_NOT_FOUND", f2;
340            }
341            var l3 = n3[o4] = { exports: {} };
342            t2[o4][0].call(l3.exports, function(e3) {
343              var n4 = t2[o4][1][e3];
344              return s2(n4 || e3);
345            }, l3, l3.exports, e2, t2, n3, r4);
346          }
347          return n3[o4].exports;
348        }
349        for (var i2 = typeof __require == "function" && __require, o3 = 0; o3 < r4.length; o3++) s2(r4[o3]);
350        return s2;
351      })({ 1: [function(_dereq_, module3, exports3) {
352        module3.exports = function(forceSimilar) {
353          if (typeof Map != "function" || forceSimilar) {
354            var Similar = _dereq_("./similar");
355            return new Similar();
356          } else
357            return /* @__PURE__ */ new Map();
358        };
359      }, { "./similar": 2 }], 2: [function(_dereq_, module3, exports3) {
360        function Similar() {
361          return this.list = [], this.lastItem = void 0, this.size = 0, this;
362        }
363        Similar.prototype.get = function(key) {
364          var index;
365          if (this.lastItem && this.isEqual(this.lastItem.key, key))
366            return this.lastItem.val;
367          if (index = this.indexOf(key), index >= 0)
368            return this.lastItem = this.list[index], this.list[index].val;
369        }, Similar.prototype.set = function(key, val) {
370          var index;
371          return this.lastItem && this.isEqual(this.lastItem.key, key) ? (this.lastItem.val = val, this) : (index = this.indexOf(key), index >= 0 ? (this.lastItem = this.list[index], this.list[index].val = val, this) : (this.lastItem = { key, val }, this.list.push(this.lastItem), this.size++, this));
372        }, Similar.prototype.delete = function(key) {
373          var index;
374          if (this.lastItem && this.isEqual(this.lastItem.key, key) && (this.lastItem = void 0), index = this.indexOf(key), index >= 0)
375            return this.size--, this.list.splice(index, 1)[0];
376        }, Similar.prototype.has = function(key) {
377          var index;
378          return this.lastItem && this.isEqual(this.lastItem.key, key) ? !0 : (index = this.indexOf(key), index >= 0 ? (this.lastItem = this.list[index], !0) : !1);
379        }, Similar.prototype.forEach = function(callback, thisArg) {
380          var i2;
381          for (i2 = 0; i2 < this.size; i2++)
382            callback.call(thisArg || this, this.list[i2].val, this.list[i2].key, this);
383        }, Similar.prototype.indexOf = function(key) {
384          var i2;
385          for (i2 = 0; i2 < this.size; i2++)
386            if (this.isEqual(this.list[i2].key, key))
387              return i2;
388          return -1;
389        }, Similar.prototype.isEqual = function(val1, val2) {
390          return val1 === val2 || val1 !== val1 && val2 !== val2;
391        }, module3.exports = Similar;
392      }, {}], 3: [function(_dereq_, module3, exports3) {
393        var MapOrSimilar = _dereq_("map-or-similar");
394        module3.exports = function(limit) {
395          var cache = new MapOrSimilar(!1), lru = [];
396          return function(fn) {
397            var memoizerific3 = function() {
398              var currentCache = cache, newMap, fnResult, argsLengthMinusOne = arguments.length - 1, lruPath = Array(argsLengthMinusOne + 1), isMemoized = !0, i2;
399              if ((memoizerific3.numArgs || memoizerific3.numArgs === 0) && memoizerific3.numArgs !== argsLengthMinusOne + 1)
400                throw new Error("Memoizerific functions should always be called with the same number of arguments");
401              for (i2 = 0; i2 < argsLengthMinusOne; i2++) {
402                if (lruPath[i2] = {
403                  cacheItem: currentCache,
404                  arg: arguments[i2]
405                }, currentCache.has(arguments[i2])) {
406                  currentCache = currentCache.get(arguments[i2]);
407                  continue;
408                }
409                isMemoized = !1, newMap = new MapOrSimilar(!1), currentCache.set(arguments[i2], newMap), currentCache = newMap;
410              }
411              return isMemoized && (currentCache.has(arguments[argsLengthMinusOne]) ? fnResult = currentCache.get(arguments[argsLengthMinusOne]) : isMemoized = !1), isMemoized || (fnResult = fn.apply(null, arguments), currentCache.set(arguments[argsLengthMinusOne], fnResult)), limit > 0 && (lruPath[argsLengthMinusOne] = {
412                cacheItem: currentCache,
413                arg: arguments[argsLengthMinusOne]
414              }, isMemoized ? moveToMostRecentLru(lru, lruPath) : lru.push(lruPath), lru.length > limit && removeCachedResult(lru.shift())), memoizerific3.wasMemoized = isMemoized, memoizerific3.numArgs = argsLengthMinusOne + 1, fnResult;
415            };
416            return memoizerific3.limit = limit, memoizerific3.wasMemoized = !1, memoizerific3.cache = cache, memoizerific3.lru = lru, memoizerific3;
417          };
418        };
419        function moveToMostRecentLru(lru, lruPath) {
420          var lruLen = lru.length, lruPathLen = lruPath.length, isMatch, i2, ii;
421          for (i2 = 0; i2 < lruLen; i2++) {
422            for (isMatch = !0, ii = 0; ii < lruPathLen; ii++)
423              if (!isEqual2(lru[i2][ii].arg, lruPath[ii].arg)) {
424                isMatch = !1;
425                break;
426              }
427            if (isMatch)
428              break;
429          }
430          lru.push(lru.splice(i2, 1)[0]);
431        }
432        function removeCachedResult(removedLru) {
433          var removedLruLen = removedLru.length, currentLru = removedLru[removedLruLen - 1], tmp, i2;
434          for (currentLru.cacheItem.delete(currentLru.arg), i2 = removedLruLen - 2; i2 >= 0 && (currentLru = removedLru[i2], tmp = currentLru.cacheItem.get(currentLru.arg), !tmp || !tmp.size); i2--)
435            currentLru.cacheItem.delete(currentLru.arg);
436        }
437        function isEqual2(val1, val2) {
438          return val1 === val2 || val1 !== val1 && val2 !== val2;
439        }
440      }, { "map-or-similar": 1 }] }, {}, [3])(3);
441    });
442  }
443});
444
vendor: 937 bytes, lines 445-455
445// ../../node_modules/picocolors/picocolors.browser.js
446var require_picocolors_browser = __commonJS({
447  "../../node_modules/picocolors/picocolors.browser.js"(exports, module) {
448    var x2 = String, create4 = function() {
449      return { isColorSupported: !1, reset: x2, bold: x2, dim: x2, italic: x2, underline: x2, inverse: x2, hidden: x2, strikethrough: x2, black: x2, red: x2, green: x2, yellow: x2, blue: x2, magenta: x2, cyan: x2, white: x2, gray: x2, bgBlack: x2, bgRed: x2, bgGreen: x2, bgYellow: x2, bgBlue: x2, bgMagenta: x2, bgCyan: x2, bgWhite: x2, blackBright: x2, redBright: x2, greenBright: x2, yellowBright: x2, blueBright: x2, magentaBright: x2, cyanBright: x2, whiteBright: x2, bgBlackBright: x2, bgRedBright: x2, bgGreenBright: x2, bgYellowBright: x2, bgBlueBright: x2, bgMagentaBright: x2, bgCyanBright: x2, bgWhiteBright: x2 };
450    };
451    module.exports = create4();
452    module.exports.createColors = create4;
453  }
454});
455
vendor: 1,374 bytes, lines 456-488
456// ../../node_modules/scroll/index.js
457var require_scroll = __commonJS({
458  "../../node_modules/scroll/index.js"(exports, module) {
459    var E_NOSCROLL = new Error("Element already at target scroll position"), E_CANCELLED = new Error("Scroll cancelled"), min = Math.min, ms = Date.now;
460    module.exports = {
461      left: make("scrollLeft"),
462      top: make("scrollTop")
463    };
464    function make(prop) {
465      return function(el, to, opts, cb) {
466        opts = opts || {}, typeof opts == "function" && (cb = opts, opts = {}), typeof cb != "function" && (cb = noop5);
467        var start = ms(), from = el[prop], ease = opts.ease || inOutSine, duration = isNaN(opts.duration) ? 350 : +opts.duration, cancelled = !1;
468        return from === to ? cb(E_NOSCROLL, el[prop]) : requestAnimationFrame(animate), cancel;
469        function cancel() {
470          cancelled = !0;
471        }
472        function animate(timestamp) {
473          if (cancelled) return cb(E_CANCELLED, el[prop]);
474          var now = ms(), time = min(1, (now - start) / duration), eased = ease(time);
475          el[prop] = eased * (to - from) + from, time < 1 ? requestAnimationFrame(animate) : requestAnimationFrame(function() {
476            cb(null, el[prop]);
477          });
478        }
479      };
480    }
481    function inOutSine(n3) {
482      return 0.5 * (1 - Math.cos(Math.PI * n3));
483    }
484    function noop5() {
485    }
486  }
487});
488
vendor: 1,045 bytes, lines 489-513
489// ../../node_modules/scrollparent/scrollparent.js
490var require_scrollparent = __commonJS({
491  "../../node_modules/scrollparent/scrollparent.js"(exports, module) {
492    (function(root2, factory) {
493      typeof define == "function" && define.amd ? define([], factory) : typeof module == "object" && module.exports ? module.exports = factory() : root2.Scrollparent = factory();
494    })(exports, function() {
495      function isScrolling(node) {
496        var overflow = getComputedStyle(node, null).getPropertyValue("overflow");
497        return overflow.indexOf("scroll") > -1 || overflow.indexOf("auto") > -1;
498      }
499      function scrollParent2(node) {
500        if (node instanceof HTMLElement || node instanceof SVGElement) {
501          for (var current = node.parentNode; current.parentNode; ) {
502            if (isScrolling(current))
503              return current;
504            current = current.parentNode;
505          }
506          return document.scrollingElement || document.documentElement;
507        }
508      }
509      return scrollParent2;
510    });
511  }
512});
513
vendor: 840 bytes, lines 514-529
514// ../../node_modules/react-innertext/index.js
515var require_react_innertext = __commonJS({
516  "../../node_modules/react-innertext/index.js"(exports, module) {
517    "use strict";
518    var hasProps = function(jsx2) {
519      return Object.prototype.hasOwnProperty.call(jsx2, "props");
520    }, reduceJsxToString = function(previous, current) {
521      return previous + innerText2(current);
522    }, innerText2 = function(jsx2) {
523      return jsx2 === null || typeof jsx2 == "boolean" || typeof jsx2 > "u" ? "" : typeof jsx2 == "number" ? jsx2.toString() : typeof jsx2 == "string" ? jsx2 : Array.isArray(jsx2) ? jsx2.reduce(reduceJsxToString, "") : hasProps(jsx2) && Object.prototype.hasOwnProperty.call(jsx2.props, "children") ? innerText2(jsx2.props.children) : "";
524    };
525    innerText2.default = innerText2;
526    module.exports = innerText2;
527  }
528});
529
vendor: 3,831 bytes, lines 530-607
530// ../../node_modules/deepmerge/dist/cjs.js
531var require_cjs = __commonJS({
532  "../../node_modules/deepmerge/dist/cjs.js"(exports, module) {
533    "use strict";
534    var isMergeableObject = function(value) {
535      return isNonNullObject(value) && !isSpecial(value);
536    };
537    function isNonNullObject(value) {
538      return !!value && typeof value == "object";
539    }
540    function isSpecial(value) {
541      var stringValue = Object.prototype.toString.call(value);
542      return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
543    }
544    var canUseSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
545    function isReactElement(value) {
546      return value.$$typeof === REACT_ELEMENT_TYPE;
547    }
548    function emptyTarget(val) {
549      return Array.isArray(val) ? [] : {};
550    }
551    function cloneUnlessOtherwiseSpecified(value, options2) {
552      return options2.clone !== !1 && options2.isMergeableObject(value) ? deepmerge4(emptyTarget(value), value, options2) : value;
553    }
554    function defaultArrayMerge(target, source, options2) {
555      return target.concat(source).map(function(element) {
556        return cloneUnlessOtherwiseSpecified(element, options2);
557      });
558    }
559    function getMergeFunction(key, options2) {
560      if (!options2.customMerge)
561        return deepmerge4;
562      var customMerge = options2.customMerge(key);
563      return typeof customMerge == "function" ? customMerge : deepmerge4;
564    }
565    function getEnumerableOwnPropertySymbols(target) {
566      return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
567        return Object.propertyIsEnumerable.call(target, symbol);
568      }) : [];
569    }
570    function getKeys(target) {
571      return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
572    }
573    function propertyIsOnObject(object, property) {
574      try {
575        return property in object;
576      } catch {
577        return !1;
578      }
579    }
580    function propertyIsUnsafe(target, key) {
581      return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
582    }
583    function mergeObject(target, source, options2) {
584      var destination = {};
585      return options2.isMergeableObject(target) && getKeys(target).forEach(function(key) {
586        destination[key] = cloneUnlessOtherwiseSpecified(target[key], options2);
587      }), getKeys(source).forEach(function(key) {
588        propertyIsUnsafe(target, key) || (propertyIsOnObject(target, key) && options2.isMergeableObject(source[key]) ? destination[key] = getMergeFunction(key, options2)(target[key], source[key], options2) : destination[key] = cloneUnlessOtherwiseSpecified(source[key], options2));
589      }), destination;
590    }
591    function deepmerge4(target, source, options2) {
592      options2 = options2 || {}, options2.arrayMerge = options2.arrayMerge || defaultArrayMerge, options2.isMergeableObject = options2.isMergeableObject || isMergeableObject, options2.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
593      var sourceIsArray = Array.isArray(source), targetIsArray = Array.isArray(target), sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
594      return sourceAndTargetTypesMatch ? sourceIsArray ? options2.arrayMerge(target, source, options2) : mergeObject(target, source, options2) : cloneUnlessOtherwiseSpecified(source, options2);
595    }
596    deepmerge4.all = function(array, options2) {
597      if (!Array.isArray(array))
598        throw new Error("first argument should be an array");
599      return array.reduce(function(prev, next) {
600        return deepmerge4(prev, next, options2);
601      }, {});
602    };
603    var deepmerge_1 = deepmerge4;
604    module.exports = deepmerge_1;
605  }
606});
607
vendor: 3,412 bytes, lines 608-704
608// ../../node_modules/downshift/node_modules/react-is/cjs/react-is.production.min.js
609var require_react_is_production_min = __commonJS({
610  "../../node_modules/downshift/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
611    "use strict";
612    var b2 = Symbol.for("react.element"), c2 = Symbol.for("react.portal"), d2 = Symbol.for("react.fragment"), e2 = Symbol.for("react.strict_mode"), f2 = Symbol.for("react.profiler"), g2 = Symbol.for("react.provider"), h2 = Symbol.for("react.context"), k2 = Symbol.for("react.server_context"), l3 = Symbol.for("react.forward_ref"), m2 = Symbol.for("react.suspense"), n3 = Symbol.for("react.suspense_list"), p2 = Symbol.for("react.memo"), q2 = Symbol.for("react.lazy"), t2 = Symbol.for("react.offscreen"), u2;
613    u2 = Symbol.for("react.module.reference");
614    function v2(a2) {
615      if (typeof a2 == "object" && a2 !== null) {
616        var r4 = a2.$$typeof;
617        switch (r4) {
618          case b2:
619            switch (a2 = a2.type, a2) {
620              case d2:
621              case f2:
622              case e2:
623              case m2:
624              case n3:
625                return a2;
626              default:
627                switch (a2 = a2 && a2.$$typeof, a2) {
628                  case k2:
629                  case h2:
630                  case l3:
631                  case q2:
632                  case p2:
633                  case g2:
634                    return a2;
635                  default:
636                    return r4;
637                }
638            }
639          case c2:
640            return r4;
641        }
642      }
643    }
644    exports.ContextConsumer = h2;
645    exports.ContextProvider = g2;
646    exports.Element = b2;
647    exports.ForwardRef = l3;
648    exports.Fragment = d2;
649    exports.Lazy = q2;
650    exports.Memo = p2;
651    exports.Portal = c2;
652    exports.Profiler = f2;
653    exports.StrictMode = e2;
654    exports.Suspense = m2;
655    exports.SuspenseList = n3;
656    exports.isAsyncMode = function() {
657      return !1;
658    };
659    exports.isConcurrentMode = function() {
660      return !1;
661    };
662    exports.isContextConsumer = function(a2) {
663      return v2(a2) === h2;
664    };
665    exports.isContextProvider = function(a2) {
666      return v2(a2) === g2;
667    };
668    exports.isElement = function(a2) {
669      return typeof a2 == "object" && a2 !== null && a2.$$typeof === b2;
670    };
671    exports.isForwardRef = function(a2) {
672      return v2(a2) === l3;
673    };
674    exports.isFragment = function(a2) {
675      return v2(a2) === d2;
676    };
677    exports.isLazy = function(a2) {
678      return v2(a2) === q2;
679    };
680    exports.isMemo = function(a2) {
681      return v2(a2) === p2;
682    };
683    exports.isPortal = function(a2) {
684      return v2(a2) === c2;
685    };
686    exports.isProfiler = function(a2) {
687      return v2(a2) === f2;
688    };
689    exports.isStrictMode = function(a2) {
690      return v2(a2) === e2;
691    };
692    exports.isSuspense = function(a2) {
693      return v2(a2) === m2;
694    };
695    exports.isSuspenseList = function(a2) {
696      return v2(a2) === n3;
697    };
698    exports.isValidElementType = function(a2) {
699      return typeof a2 == "string" || typeof a2 == "function" || a2 === d2 || a2 === f2 || a2 === e2 || a2 === m2 || a2 === n3 || a2 === t2 || typeof a2 == "object" && a2 !== null && (a2.$$typeof === q2 || a2.$$typeof === p2 || a2.$$typeof === g2 || a2.$$typeof === h2 || a2.$$typeof === l3 || a2.$$typeof === u2 || a2.getModuleId !== void 0);
700    };
701    exports.typeOf = v2;
702  }
703});
704
vendor: 265 bytes, lines 705-712
705// ../../node_modules/downshift/node_modules/react-is/index.js
706var require_react_is = __commonJS({
707  "../../node_modules/downshift/node_modules/react-is/index.js"(exports, module) {
708    "use strict";
709    module.exports = require_react_is_production_min();
710  }
711});
712
vendor: 19,821 bytes, lines 713-1027
713// ../../node_modules/fuse.js/dist/fuse.js
714var require_fuse = __commonJS({
715  "../../node_modules/fuse.js/dist/fuse.js"(exports, module) {
716    (function(e2, t2) {
717      typeof exports == "object" && typeof module == "object" ? module.exports = t2() : typeof define == "function" && define.amd ? define("Fuse", [], t2) : typeof exports == "object" ? exports.Fuse = t2() : e2.Fuse = t2();
718    })(exports, function() {
719      return (function(e2) {
720        var t2 = {};
721        function r4(n3) {
722          if (t2[n3]) return t2[n3].exports;
723          var o3 = t2[n3] = { i: n3, l: !1, exports: {} };
724          return e2[n3].call(o3.exports, o3, o3.exports, r4), o3.l = !0, o3.exports;
725        }
726        return r4.m = e2, r4.c = t2, r4.d = function(e3, t3, n3) {
727          r4.o(e3, t3) || Object.defineProperty(e3, t3, { enumerable: !0, get: n3 });
728        }, r4.r = function(e3) {
729          typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e3, "__esModule", { value: !0 });
730        }, r4.t = function(e3, t3) {
731          if (1 & t3 && (e3 = r4(e3)), 8 & t3 || 4 & t3 && typeof e3 == "object" && e3 && e3.__esModule) return e3;
732          var n3 = /* @__PURE__ */ Object.create(null);
733          if (r4.r(n3), Object.defineProperty(n3, "default", { enumerable: !0, value: e3 }), 2 & t3 && typeof e3 != "string") for (var o3 in e3) r4.d(n3, o3, function(t4) {
734            return e3[t4];
735          }.bind(null, o3));
736          return n3;
737        }, r4.n = function(e3) {
738          var t3 = e3 && e3.__esModule ? function() {
739            return e3.default;
740          } : function() {
741            return e3;
742          };
743          return r4.d(t3, "a", t3), t3;
744        }, r4.o = function(e3, t3) {
745          return Object.prototype.hasOwnProperty.call(e3, t3);
746        }, r4.p = "", r4(r4.s = 0);
747      })([function(e2, t2, r4) {
748        function n3(e3) {
749          return (n3 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e4) {
750            return typeof e4;
751          } : function(e4) {
752            return e4 && typeof Symbol == "function" && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
753          })(e3);
754        }
755        function o3(e3, t3) {
756          for (var r5 = 0; r5 < t3.length; r5++) {
757            var n4 = t3[r5];
758            n4.enumerable = n4.enumerable || !1, n4.configurable = !0, "value" in n4 && (n4.writable = !0), Object.defineProperty(e3, n4.key, n4);
759          }
760        }
761        var i2 = r4(1), a2 = r4(7), s2 = a2.get, c2 = (a2.deepValue, a2.isArray), h2 = (function() {
762          function e3(t4, r6) {
763            var n4 = r6.location, o4 = n4 === void 0 ? 0 : n4, i3 = r6.distance, a4 = i3 === void 0 ? 100 : i3, c3 = r6.threshold, h3 = c3 === void 0 ? 0.6 : c3, l3 = r6.maxPatternLength, u2 = l3 === void 0 ? 32 : l3, f2 = r6.caseSensitive, v2 = f2 !== void 0 && f2, p2 = r6.tokenSeparator, d2 = p2 === void 0 ? / +/g : p2, g2 = r6.findAllMatches, y2 = g2 !== void 0 && g2, m2 = r6.minMatchCharLength, k2 = m2 === void 0 ? 1 : m2, b2 = r6.id, S2 = b2 === void 0 ? null : b2, x2 = r6.keys, M2 = x2 === void 0 ? [] : x2, _2 = r6.shouldSort, w2 = _2 === void 0 || _2, L3 = r6.getFn, A3 = L3 === void 0 ? s2 : L3, O2 = r6.sortFn, C2 = O2 === void 0 ? function(e4, t5) {
764              return e4.score - t5.score;
765            } : O2, j2 = r6.tokenize, P3 = j2 !== void 0 && j2, I2 = r6.matchAllTokens, F2 = I2 !== void 0 && I2, T3 = r6.includeMatches, N2 = T3 !== void 0 && T3, z2 = r6.includeScore, E2 = z2 !== void 0 && z2, W2 = r6.verbose, K2 = W2 !== void 0 && W2;
766            (function(e4, t5) {
767              if (!(e4 instanceof t5)) throw new TypeError("Cannot call a class as a function");
768            })(this, e3), this.options = { location: o4, distance: a4, threshold: h3, maxPatternLength: u2, isCaseSensitive: v2, tokenSeparator: d2, findAllMatches: y2, minMatchCharLength: k2, id: S2, keys: M2, includeMatches: N2, includeScore: E2, shouldSort: w2, getFn: A3, sortFn: C2, verbose: K2, tokenize: P3, matchAllTokens: F2 }, this.setCollection(t4), this._processKeys(M2);
769          }
770          var t3, r5, a3;
771          return t3 = e3, (r5 = [{ key: "setCollection", value: function(e4) {
772            return this.list = e4, e4;
773          } }, { key: "_processKeys", value: function(e4) {
774            if (this._keyWeights = {}, this._keyNames = [], e4.length && typeof e4[0] == "string") for (var t4 = 0, r6 = e4.length; t4 < r6; t4 += 1) {
775              var n4 = e4[t4];
776              this._keyWeights[n4] = 1, this._keyNames.push(n4);
777            }
778            else {
779              for (var o4 = null, i3 = null, a4 = 0, s3 = 0, c3 = e4.length; s3 < c3; s3 += 1) {
780                var h3 = e4[s3];
781                if (!h3.hasOwnProperty("name")) throw new Error('Missing "name" property in key object');
782                var l3 = h3.name;
783                if (this._keyNames.push(l3), !h3.hasOwnProperty("weight")) throw new Error('Missing "weight" property in key object');
784                var u2 = h3.weight;
785                if (u2 < 0 || u2 > 1) throw new Error('"weight" property in key must bein the range of [0, 1)');
786                i3 = i3 == null ? u2 : Math.max(i3, u2), o4 = o4 == null ? u2 : Math.min(o4, u2), this._keyWeights[l3] = u2, a4 += u2;
787              }
788              if (a4 > 1) throw new Error("Total of weights cannot exceed 1");
789            }
790          } }, { key: "search", value: function(e4) {
791            var t4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { limit: !1 };
792            this._log(`---------
793Search pattern: "`.concat(e4, '"'));
794            var r6 = this._prepareSearchers(e4), n4 = r6.tokenSearchers, o4 = r6.fullSearcher, i3 = this._search(n4, o4);
795            return this._computeScore(i3), this.options.shouldSort && this._sort(i3), t4.limit && typeof t4.limit == "number" && (i3 = i3.slice(0, t4.limit)), this._format(i3);
796          } }, { key: "_prepareSearchers", value: function() {
797            var e4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", t4 = [];
798            if (this.options.tokenize) for (var r6 = e4.split(this.options.tokenSeparator), n4 = 0, o4 = r6.length; n4 < o4; n4 += 1) t4.push(new i2(r6[n4], this.options));
799            return { tokenSearchers: t4, fullSearcher: new i2(e4, this.options) };
800          } }, { key: "_search", value: function() {
801            var e4 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t4 = arguments.length > 1 ? arguments[1] : void 0, r6 = this.list, n4 = {}, o4 = [];
802            if (typeof r6[0] == "string") {
803              for (var i3 = 0, a4 = r6.length; i3 < a4; i3 += 1) this._analyze({ key: "", value: r6[i3], record: i3, index: i3 }, { resultMap: n4, results: o4, tokenSearchers: e4, fullSearcher: t4 });
804              return o4;
805            }
806            for (var s3 = 0, c3 = r6.length; s3 < c3; s3 += 1) for (var h3 = r6[s3], l3 = 0, u2 = this._keyNames.length; l3 < u2; l3 += 1) {
807              var f2 = this._keyNames[l3];
808              this._analyze({ key: f2, value: this.options.getFn(h3, f2), record: h3, index: s3 }, { resultMap: n4, results: o4, tokenSearchers: e4, fullSearcher: t4 });
809            }
810            return o4;
811          } }, { key: "_analyze", value: function(e4, t4) {
812            var r6 = this, n4 = e4.key, o4 = e4.arrayIndex, i3 = o4 === void 0 ? -1 : o4, a4 = e4.value, s3 = e4.record, h3 = e4.index, l3 = t4.tokenSearchers, u2 = l3 === void 0 ? [] : l3, f2 = t4.fullSearcher, v2 = t4.resultMap, p2 = v2 === void 0 ? {} : v2, d2 = t4.results, g2 = d2 === void 0 ? [] : d2;
813            (function e5(t5, o5, i4, a5) {
814              if (o5 != null) {
815                if (typeof o5 == "string") {
816                  var s4 = !1, h4 = -1, l4 = 0;
817                  r6._log(`
818Key: `.concat(n4 === "" ? "--" : n4));
819                  var v3 = f2.search(o5);
820                  if (r6._log('Full text: "'.concat(o5, '", score: ').concat(v3.score)), r6.options.tokenize) {
821                    for (var d3 = o5.split(r6.options.tokenSeparator), y2 = d3.length, m2 = [], k2 = 0, b2 = u2.length; k2 < b2; k2 += 1) {
822                      var S2 = u2[k2];
823                      r6._log(`
824Pattern: "`.concat(S2.pattern, '"'));
825                      for (var x2 = !1, M2 = 0; M2 < y2; M2 += 1) {
826                        var _2 = d3[M2], w2 = S2.search(_2), L3 = {};
827                        w2.isMatch ? (L3[_2] = w2.score, s4 = !0, x2 = !0, m2.push(w2.score)) : (L3[_2] = 1, r6.options.matchAllTokens || m2.push(1)), r6._log('Token: "'.concat(_2, '", score: ').concat(L3[_2]));
828                      }
829                      x2 && (l4 += 1);
830                    }
831                    h4 = m2[0];
832                    for (var A3 = m2.length, O2 = 1; O2 < A3; O2 += 1) h4 += m2[O2];
833                    h4 /= A3, r6._log("Token score average:", h4);
834                  }
835                  var C2 = v3.score;
836                  h4 > -1 && (C2 = (C2 + h4) / 2), r6._log("Score average:", C2);
837                  var j2 = !r6.options.tokenize || !r6.options.matchAllTokens || l4 >= u2.length;
838                  if (r6._log(`
839Check Matches: `.concat(j2)), (s4 || v3.isMatch) && j2) {
840                    var P3 = { key: n4, arrayIndex: t5, value: o5, score: C2 };
841                    r6.options.includeMatches && (P3.matchedIndices = v3.matchedIndices);
842                    var I2 = p2[a5];
843                    I2 ? I2.output.push(P3) : (p2[a5] = { item: i4, output: [P3] }, g2.push(p2[a5]));
844                  }
845                } else if (c2(o5)) for (var F2 = 0, T3 = o5.length; F2 < T3; F2 += 1) e5(F2, o5[F2], i4, a5);
846              }
847            })(i3, a4, s3, h3);
848          } }, { key: "_computeScore", value: function(e4) {
849            this._log(`
850
851Computing score:
852`);
853            for (var t4 = this._keyWeights, r6 = !!Object.keys(t4).length, n4 = 0, o4 = e4.length; n4 < o4; n4 += 1) {
854              for (var i3 = e4[n4], a4 = i3.output, s3 = a4.length, c3 = 1, h3 = 0; h3 < s3; h3 += 1) {
855                var l3 = a4[h3], u2 = l3.key, f2 = r6 ? t4[u2] : 1, v2 = l3.score === 0 && t4 && t4[u2] > 0 ? Number.EPSILON : l3.score;
856                c3 *= Math.pow(v2, f2);
857              }
858              i3.score = c3, this._log(i3);
859            }
860          } }, { key: "_sort", value: function(e4) {
861            this._log(`
862
863Sorting....`), e4.sort(this.options.sortFn);
864          } }, { key: "_format", value: function(e4) {
865            var t4 = [];
866            if (this.options.verbose) {
867              var r6 = [];
868              this._log(`
869
870Output:
871
872`, JSON.stringify(e4, function(e5, t5) {
873                if (n3(t5) === "object" && t5 !== null) {
874                  if (r6.indexOf(t5) !== -1) return;
875                  r6.push(t5);
876                }
877                return t5;
878              }, 2)), r6 = null;
879            }
880            var o4 = [];
881            this.options.includeMatches && o4.push(function(e5, t5) {
882              var r7 = e5.output;
883              t5.matches = [];
884              for (var n4 = 0, o5 = r7.length; n4 < o5; n4 += 1) {
885                var i4 = r7[n4];
886                if (i4.matchedIndices.length !== 0) {
887                  var a5 = { indices: i4.matchedIndices, value: i4.value };
888                  i4.key && (a5.key = i4.key), i4.hasOwnProperty("arrayIndex") && i4.arrayIndex > -1 && (a5.arrayIndex = i4.arrayIndex), t5.matches.push(a5);
889                }
890              }
891            }), this.options.includeScore && o4.push(function(e5, t5) {
892              t5.score = e5.score;
893            });
894            for (var i3 = 0, a4 = e4.length; i3 < a4; i3 += 1) {
895              var s3 = e4[i3];
896              if (this.options.id && (s3.item = this.options.getFn(s3.item, this.options.id)[0]), o4.length) {
897                for (var c3 = { item: s3.item }, h3 = 0, l3 = o4.length; h3 < l3; h3 += 1) o4[h3](s3, c3);
898                t4.push(c3);
899              } else t4.push(s3.item);
900            }
901            return t4;
902          } }, { key: "_log", value: function() {
903            var e4;
904            this.options.verbose && (e4 = console).log.apply(e4, arguments);
905          } }]) && o3(t3.prototype, r5), a3 && o3(t3, a3), e3;
906        })();
907        e2.exports = h2;
908      }, function(e2, t2, r4) {
909        function n3(e3, t3) {
910          for (var r5 = 0; r5 < t3.length; r5++) {
911            var n4 = t3[r5];
912            n4.enumerable = n4.enumerable || !1, n4.configurable = !0, "value" in n4 && (n4.writable = !0), Object.defineProperty(e3, n4.key, n4);
913          }
914        }
915        var o3 = r4(2), i2 = r4(3), a2 = r4(6), s2 = (function() {
916          function e3(t4, r6) {
917            var n4 = r6.location, o4 = n4 === void 0 ? 0 : n4, i3 = r6.distance, s4 = i3 === void 0 ? 100 : i3, c2 = r6.threshold, h2 = c2 === void 0 ? 0.6 : c2, l3 = r6.maxPatternLength, u2 = l3 === void 0 ? 32 : l3, f2 = r6.isCaseSensitive, v2 = f2 !== void 0 && f2, p2 = r6.tokenSeparator, d2 = p2 === void 0 ? / +/g : p2, g2 = r6.findAllMatches, y2 = g2 !== void 0 && g2, m2 = r6.minMatchCharLength, k2 = m2 === void 0 ? 1 : m2, b2 = r6.includeMatches, S2 = b2 !== void 0 && b2;
918            (function(e4, t5) {
919              if (!(e4 instanceof t5)) throw new TypeError("Cannot call a class as a function");
920            })(this, e3), this.options = { location: o4, distance: s4, threshold: h2, maxPatternLength: u2, isCaseSensitive: v2, tokenSeparator: d2, findAllMatches: y2, includeMatches: S2, minMatchCharLength: k2 }, this.pattern = v2 ? t4 : t4.toLowerCase(), this.pattern.length <= u2 && (this.patternAlphabet = a2(this.pattern));
921          }
922          var t3, r5, s3;
923          return t3 = e3, (r5 = [{ key: "search", value: function(e4) {
924            var t4 = this.options, r6 = t4.isCaseSensitive, n4 = t4.includeMatches;
925            if (r6 || (e4 = e4.toLowerCase()), this.pattern === e4) {
926              var a3 = { isMatch: !0, score: 0 };
927              return n4 && (a3.matchedIndices = [[0, e4.length - 1]]), a3;
928            }
929            var s4 = this.options, c2 = s4.maxPatternLength, h2 = s4.tokenSeparator;
930            if (this.pattern.length > c2) return o3(e4, this.pattern, h2);
931            var l3 = this.options, u2 = l3.location, f2 = l3.distance, v2 = l3.threshold, p2 = l3.findAllMatches, d2 = l3.minMatchCharLength;
932            return i2(e4, this.pattern, this.patternAlphabet, { location: u2, distance: f2, threshold: v2, findAllMatches: p2, minMatchCharLength: d2, includeMatches: n4 });
933          } }]) && n3(t3.prototype, r5), s3 && n3(t3, s3), e3;
934        })();
935        e2.exports = s2;
936      }, function(e2, t2) {
937        var r4 = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;
938        e2.exports = function(e3, t3) {
939          var n3 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : / +/g, o3 = new RegExp(t3.replace(r4, "\\$&").replace(n3, "|")), i2 = e3.match(o3), a2 = !!i2, s2 = [];
940          if (a2) for (var c2 = 0, h2 = i2.length; c2 < h2; c2 += 1) {
941            var l3 = i2[c2];
942            s2.push([e3.indexOf(l3), l3.length - 1]);
943          }
944          return { score: a2 ? 0.5 : 1, isMatch: a2, matchedIndices: s2 };
945        };
946      }, function(e2, t2, r4) {
947        var n3 = r4(4), o3 = r4(5);
948        e2.exports = function(e3, t3, r5, i2) {
949          for (var a2 = i2.location, s2 = a2 === void 0 ? 0 : a2, c2 = i2.distance, h2 = c2 === void 0 ? 100 : c2, l3 = i2.threshold, u2 = l3 === void 0 ? 0.6 : l3, f2 = i2.findAllMatches, v2 = f2 !== void 0 && f2, p2 = i2.minMatchCharLength, d2 = p2 === void 0 ? 1 : p2, g2 = i2.includeMatches, y2 = g2 !== void 0 && g2, m2 = s2, k2 = e3.length, b2 = u2, S2 = e3.indexOf(t3, m2), x2 = t3.length, M2 = [], _2 = 0; _2 < k2; _2 += 1) M2[_2] = 0;
950          if (S2 !== -1) {
951            var w2 = n3(t3, { errors: 0, currentLocation: S2, expectedLocation: m2, distance: h2 });
952            if (b2 = Math.min(w2, b2), (S2 = e3.lastIndexOf(t3, m2 + x2)) !== -1) {
953              var L3 = n3(t3, { errors: 0, currentLocation: S2, expectedLocation: m2, distance: h2 });
954              b2 = Math.min(L3, b2);
955            }
956          }
957          S2 = -1;
958          for (var A3 = [], O2 = 1, C2 = x2 + k2, j2 = 1 << (x2 <= 31 ? x2 - 1 : 30), P3 = 0; P3 < x2; P3 += 1) {
959            for (var I2 = 0, F2 = C2; I2 < F2; )
960              n3(t3, { errors: P3, currentLocation: m2 + F2, expectedLocation: m2, distance: h2 }) <= b2 ? I2 = F2 : C2 = F2, F2 = Math.floor((C2 - I2) / 2 + I2);
961            C2 = F2;
962            var T3 = Math.max(1, m2 - F2 + 1), N2 = v2 ? k2 : Math.min(m2 + F2, k2) + x2, z2 = Array(N2 + 2);
963            z2[N2 + 1] = (1 << P3) - 1;
964            for (var E2 = N2; E2 >= T3; E2 -= 1) {
965              var W2 = E2 - 1, K2 = r5[e3.charAt(W2)];
966              if (K2 && (M2[W2] = 1), z2[E2] = (z2[E2 + 1] << 1 | 1) & K2, P3 !== 0 && (z2[E2] |= (A3[E2 + 1] | A3[E2]) << 1 | 1 | A3[E2 + 1]), z2[E2] & j2 && (O2 = n3(t3, { errors: P3, currentLocation: W2, expectedLocation: m2, distance: h2 })) <= b2) {
967                if (b2 = O2, (S2 = W2) <= m2) break;
968                T3 = Math.max(1, 2 * m2 - S2);
969              }
970            }
971            if (n3(t3, { errors: P3 + 1, currentLocation: m2, expectedLocation: m2, distance: h2 }) > b2) break;
972            A3 = z2;
973          }
974          var $ = { isMatch: S2 >= 0, score: O2 === 0 ? 1e-3 : O2 };
975          return y2 && ($.matchedIndices = o3(M2, d2)), $;
976        };
977      }, function(e2, t2) {
978        e2.exports = function(e3, t3) {
979          var r4 = t3.errors, n3 = r4 === void 0 ? 0 : r4, o3 = t3.currentLocation, i2 = o3 === void 0 ? 0 : o3, a2 = t3.expectedLocation, s2 = a2 === void 0 ? 0 : a2, c2 = t3.distance, h2 = c2 === void 0 ? 100 : c2, l3 = n3 / e3.length, u2 = Math.abs(s2 - i2);
980          return h2 ? l3 + u2 / h2 : u2 ? 1 : l3;
981        };
982      }, function(e2, t2) {
983        e2.exports = function() {
984          for (var e3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, r4 = [], n3 = -1, o3 = -1, i2 = 0, a2 = e3.length; i2 < a2; i2 += 1) {
985            var s2 = e3[i2];
986            s2 && n3 === -1 ? n3 = i2 : s2 || n3 === -1 || ((o3 = i2 - 1) - n3 + 1 >= t3 && r4.push([n3, o3]), n3 = -1);
987          }
988          return e3[i2 - 1] && i2 - n3 >= t3 && r4.push([n3, i2 - 1]), r4;
989        };
990      }, function(e2, t2) {
991        e2.exports = function(e3) {
992          for (var t3 = {}, r4 = e3.length, n3 = 0; n3 < r4; n3 += 1) t3[e3.charAt(n3)] = 0;
993          for (var o3 = 0; o3 < r4; o3 += 1) t3[e3.charAt(o3)] |= 1 << r4 - o3 - 1;
994          return t3;
995        };
996      }, function(e2, t2) {
997        var r4 = function(e3) {
998          return Array.isArray ? Array.isArray(e3) : Object.prototype.toString.call(e3) === "[object Array]";
999        }, n3 = function(e3) {
1000          return e3 == null ? "" : (function(e4) {
1001            if (typeof e4 == "string") return e4;
1002            var t3 = e4 + "";
1003            return t3 == "0" && 1 / e4 == -1 / 0 ? "-0" : t3;
1004          })(e3);
1005        }, o3 = function(e3) {
1006          return typeof e3 == "string";
1007        }, i2 = function(e3) {
1008          return typeof e3 == "number";
1009        };
1010        e2.exports = { get: function(e3, t3) {
1011          var a2 = [];
1012          return (function e4(t4, s2) {
1013            if (s2) {
1014              var c2 = s2.indexOf("."), h2 = s2, l3 = null;
1015              c2 !== -1 && (h2 = s2.slice(0, c2), l3 = s2.slice(c2 + 1));
1016              var u2 = t4[h2];
1017              if (u2 != null) if (l3 || !o3(u2) && !i2(u2)) if (r4(u2)) for (var f2 = 0, v2 = u2.length; f2 < v2; f2 += 1) e4(u2[f2], l3);
1018              else l3 && e4(u2, l3);
1019              else a2.push(n3(u2));
1020            } else a2.push(t4);
1021          })(e3, t3), a2;
1022        }, isArray: r4, isString: o3, isNum: i2, toString: n3 };
1023      }]);
1024    });
1025  }
1026});
1027
vendor: 8,913 bytes, lines 1028-1247
1028// ../../node_modules/store2/dist/store2.js
1029var require_store2 = __commonJS({
1030  "../../node_modules/store2/dist/store2.js"(exports, module) {
1031    (function(window2, define2) {
1032      var _2 = {
1033        version: "2.14.4",
1034        areas: {},
1035        apis: {},
1036        nsdelim: ".",
1037        // utilities
1038        inherit: function(api, o3) {
1039          for (var p2 in api)
1040            o3.hasOwnProperty(p2) || Object.defineProperty(o3, p2, Object.getOwnPropertyDescriptor(api, p2));
1041          return o3;
1042        },
1043        stringify: function(d2, fn) {
1044          return d2 === void 0 || typeof d2 == "function" ? d2 + "" : JSON.stringify(d2, fn || _2.replace);
1045        },
1046        parse: function(s2, fn) {
1047          try {
1048            return JSON.parse(s2, fn || _2.revive);
1049          } catch {
1050            return s2;
1051          }
1052        },
1053        // extension hooks
1054        fn: function(name, fn) {
1055          _2.storeAPI[name] = fn;
1056          for (var api in _2.apis)
1057            _2.apis[api][name] = fn;
1058        },
1059        get: function(area, key) {
1060          return area.getItem(key);
1061        },
1062        set: function(area, key, string) {
1063          area.setItem(key, string);
1064        },
1065        remove: function(area, key) {
1066          area.removeItem(key);
1067        },
1068        key: function(area, i2) {
1069          return area.key(i2);
1070        },
1071        length: function(area) {
1072          return area.length;
1073        },
1074        clear: function(area) {
1075          area.clear();
1076        },
1077        // core functions
1078        Store: function(id, area, namespace) {
1079          var store3 = _2.inherit(_2.storeAPI, function(key, data, overwrite) {
1080            return arguments.length === 0 ? store3.getAll() : typeof data == "function" ? store3.transact(key, data, overwrite) : data !== void 0 ? store3.set(key, data, overwrite) : typeof key == "string" || typeof key == "number" ? store3.get(key) : typeof key == "function" ? store3.each(key) : key ? store3.setAll(key, data) : store3.clear();
1081          });
1082          store3._id = id;
1083          try {
1084            var testKey = "__store2_test";
1085            area.setItem(testKey, "ok"), store3._area = area, area.removeItem(testKey);
1086          } catch {
1087            store3._area = _2.storage("fake");
1088          }
1089          return store3._ns = namespace || "", _2.areas[id] || (_2.areas[id] = store3._area), _2.apis[store3._ns + store3._id] || (_2.apis[store3._ns + store3._id] = store3), store3;
1090        },
1091        storeAPI: {
1092          // admin functions
1093          area: function(id, area) {
1094            var store3 = this[id];
1095            return (!store3 || !store3.area) && (store3 = _2.Store(id, area, this._ns), this[id] || (this[id] = store3)), store3;
1096          },
1097          namespace: function(namespace, singleArea, delim) {
1098            if (delim = delim || this._delim || _2.nsdelim, !namespace)
1099              return this._ns ? this._ns.substring(0, this._ns.length - delim.length) : "";
1100            var ns = namespace, store3 = this[ns];
1101            if ((!store3 || !store3.namespace) && (store3 = _2.Store(this._id, this._area, this._ns + ns + delim), store3._delim = delim, this[ns] || (this[ns] = store3), !singleArea))
1102              for (var name in _2.areas)
1103                store3.area(name, _2.areas[name]);
1104            return store3;
1105          },
1106          isFake: function(force) {
1107            return force ? (this._real = this._area, this._area = _2.storage("fake")) : force === !1 && (this._area = this._real || this._area), this._area.name === "fake";
1108          },
1109          toString: function() {
1110            return "store" + (this._ns ? "." + this.namespace() : "") + "[" + this._id + "]";
1111          },
1112          // storage functions
1113          has: function(key) {
1114            return this._area.has ? this._area.has(this._in(key)) : this._in(key) in this._area;
1115          },
1116          size: function() {
1117            return this.keys().length;
1118          },
1119          each: function(fn, fill) {
1120            for (var i2 = 0, m2 = _2.length(this._area); i2 < m2; i2++) {
1121              var key = this._out(_2.key(this._area, i2));
1122              if (key !== void 0 && fn.call(this, key, this.get(key), fill) === !1)
1123                break;
1124              m2 > _2.length(this._area) && (m2--, i2--);
1125            }
1126            return fill || this;
1127          },
1128          keys: function(fillList) {
1129            return this.each(function(k2, v2, list) {
1130              list.push(k2);
1131            }, fillList || []);
1132          },
1133          get: function(key, alt) {
1134            var s2 = _2.get(this._area, this._in(key)), fn;
1135            return typeof alt == "function" && (fn = alt, alt = null), s2 !== null ? _2.parse(s2, fn) : alt ?? s2;
1136          },
1137          getAll: function(fillObj) {
1138            return this.each(function(k2, v2, all) {
1139              all[k2] = v2;
1140            }, fillObj || {});
1141          },
1142          transact: function(key, fn, alt) {
1143            var val = this.get(key, alt), ret = fn(val);
1144            return this.set(key, ret === void 0 ? val : ret), this;
1145          },
1146          set: function(key, data, overwrite) {
1147            var d2 = this.get(key), replacer;
1148            return d2 != null && overwrite === !1 ? data : (typeof overwrite == "function" && (replacer = overwrite, overwrite = void 0), _2.set(this._area, this._in(key), _2.stringify(data, replacer), overwrite) || d2);
1149          },
1150          setAll: function(data, overwrite) {
1151            var changed, val;
1152            for (var key in data)
1153              val = data[key], this.set(key, val, overwrite) !== val && (changed = !0);
1154            return changed;
1155          },
1156          add: function(key, data, replacer) {
1157            var d2 = this.get(key);
1158            if (d2 instanceof Array)
1159              data = d2.concat(data);
1160            else if (d2 !== null) {
1161              var type = typeof d2;
1162              if (type === typeof data && type === "object") {
1163                for (var k2 in data)
1164                  d2[k2] = data[k2];
1165                data = d2;
1166              } else
1167                data = d2 + data;
1168            }
1169            return _2.set(this._area, this._in(key), _2.stringify(data, replacer)), data;
1170          },
1171          remove: function(key, alt) {
1172            var d2 = this.get(key, alt);
1173            return _2.remove(this._area, this._in(key)), d2;
1174          },
1175          clear: function() {
1176            return this._ns ? this.each(function(k2) {
1177              _2.remove(this._area, this._in(k2));
1178            }, 1) : _2.clear(this._area), this;
1179          },
1180          clearAll: function() {
1181            var area = this._area;
1182            for (var id in _2.areas)
1183              _2.areas.hasOwnProperty(id) && (this._area = _2.areas[id], this.clear());
1184            return this._area = area, this;
1185          },
1186          // internal use functions
1187          _in: function(k2) {
1188            return typeof k2 != "string" && (k2 = _2.stringify(k2)), this._ns ? this._ns + k2 : k2;
1189          },
1190          _out: function(k2) {
1191            return this._ns ? k2 && k2.indexOf(this._ns) === 0 ? k2.substring(this._ns.length) : void 0 : (
1192              // so each() knows to skip it
1193              k2
1194            );
1195          }
1196        },
1197        // end _.storeAPI
1198        storage: function(name) {
1199          return _2.inherit(_2.storageAPI, { items: {}, name });
1200        },
1201        storageAPI: {
1202          length: 0,
1203          has: function(k2) {
1204            return this.items.hasOwnProperty(k2);
1205          },
1206          key: function(i2) {
1207            var c2 = 0;
1208            for (var k2 in this.items)
1209              if (this.has(k2) && i2 === c2++)
1210                return k2;
1211          },
1212          setItem: function(k2, v2) {
1213            this.has(k2) || this.length++, this.items[k2] = v2;
1214          },
1215          removeItem: function(k2) {
1216            this.has(k2) && (delete this.items[k2], this.length--);
1217          },
1218          getItem: function(k2) {
1219            return this.has(k2) ? this.items[k2] : null;
1220          },
1221          clear: function() {
1222            for (var k2 in this.items)
1223              this.removeItem(k2);
1224          }
1225        }
1226        // end _.storageAPI
1227      }, store2 = (
1228        // safely set this up (throws error in IE10/32bit mode for local files)
1229        _2.Store("local", (function() {
1230          try {
1231            return localStorage;
1232          } catch {
1233          }
1234        })())
1235      );
1236      store2.local = store2, store2._ = _2, store2.area("session", (function() {
1237        try {
1238          return sessionStorage;
1239        } catch {
1240        }
1241      })()), store2.area("page", _2.storage("page")), typeof define2 == "function" && define2.amd !== void 0 ? define2("store2", [], function() {
1242        return store2;
1243      }) : typeof module < "u" && module.exports ? module.exports = store2 : (window2.store && (_2.conflict = window2.store), window2.store = store2);
1244    })(exports, exports && exports.define);
1245  }
1246});
1247
1248// src/manager/runtime.tsx
1249init_react();
1250
1251// global-externals:storybook/internal/channels
1252var channels_default = __STORYBOOK_CHANNELS__, { Channel, HEARTBEAT_INTERVAL, HEARTBEAT_MAX_LATENCY, PostMessageTransport, WebsocketTransport, createBrowserChannel } = __STORYBOOK_CHANNELS__;
1253
1254// global-externals:storybook/internal/core-events
1255var core_events_default = __STORYBOOK_CORE_EVENTS__, { AI_PROMPT_NUDGE, AI_SETUP_ANALYTICS_REQUEST, AI_SETUP_ANALYTICS_RESPONSE, ARGTYPES_INFO_REQUEST, ARGTYPES_INFO_RESPONSE, CHANNEL_CREATED, CHANNEL_WS_DISCONNECT, CONFIG_ERROR, CREATE_NEW_STORYFILE_REQUEST, CREATE_NEW_STORYFILE_RESPONSE, CURRENT_STORY_WAS_SET, DOCS_PREPARED, DOCS_RENDERED, FILE_COMPONENT_SEARCH_REQUEST, FILE_COMPONENT_SEARCH_RESPONSE, FORCE_REMOUNT, FORCE_RE_RENDER, GHOST_STORIES_REQUEST, GHOST_STORIES_RESPONSE, GLOBALS_UPDATED, MANAGER_INERT_ATTRIBUTE_CHANGED, NAVIGATE_URL, OPEN_IN_EDITOR_REQUEST, OPEN_IN_EDITOR_RESPONSE, PLAY_FUNCTION_THREW_EXCEPTION, PRELOAD_ENTRIES, PREVIEW_BUILDER_PROGRESS, PREVIEW_INITIALIZED, PREVIEW_KEYDOWN, REGISTER_SUBSCRIPTION, REQUEST_WHATS_NEW_DATA, RESET_STORY_ARGS, RESULT_WHATS_NEW_DATA, SAVE_STORY_REQUEST, SAVE_STORY_RESPONSE, SELECT_STORY, SET_CONFIG, SET_CURRENT_STORY, SET_FILTER, SET_GLOBALS, SET_INDEX, SET_STORIES, SET_WHATS_NEW_CACHE, SHARED_STATE_CHANGED, SHARED_STATE_SET, SHARE_ISOLATE_MODE, SIDEBAR_FILTER_CHANGED, STORIES_COLLAPSE_ALL, STORIES_EXPAND_ALL, STORY_ARGS_UPDATED, STORY_CHANGED, STORY_ERRORED, STORY_FINISHED, STORY_HOT_UPDATED, STORY_INDEX_INVALIDATED, STORY_MISSING, STORY_PREPARED, STORY_RENDERED, STORY_RENDER_PHASE_CHANGED, STORY_SPECIFIED, STORY_THREW_EXCEPTION, STORY_UNCHANGED, TELEMETRY_ERROR, TOGGLE_WHATS_NEW_NOTIFICATIONS, UNHANDLED_ERRORS_WHILE_PLAYING, UPDATE_GLOBALS, UPDATE_QUERY_PARAMS, UPDATE_STORY_ARGS } = __STORYBOOK_CORE_EVENTS__;
1256
vendor: 14,388 bytes, lines 1257-1531
1257// ../../node_modules/@storybook/global/dist/index.mjs
1258var scope = (() => {
1259  let win;
1260  return typeof window < "u" ? win = window : typeof globalThis < "u" ? win = globalThis : typeof global < "u" ? win = global : typeof self < "u" ? win = self : win = {}, win;
1261})();
1262
1263// global-externals:@storybook/icons
1264var icons_exports = {};
1265__export(icons_exports, {
1266  AccessibilityAltIcon: () => AccessibilityAltIcon,
1267  AccessibilityIcon: () => AccessibilityIcon,
1268  AccessibilityIgnoredIcon: () => AccessibilityIgnoredIcon,
1269  AddIcon: () => AddIcon,
1270  AdminIcon: () => AdminIcon,
1271  AlertAltIcon: () => AlertAltIcon,
1272  AlertIcon: () => AlertIcon,
1273  AlignLeftIcon: () => AlignLeftIcon,
1274  AlignRightIcon: () => AlignRightIcon,
1275  AppleIcon: () => AppleIcon,
1276  ArrowBottomLeftIcon: () => ArrowBottomLeftIcon,
1277  ArrowBottomRightIcon: () => ArrowBottomRightIcon,
1278  ArrowDownIcon: () => ArrowDownIcon,
1279  ArrowLeftIcon: () => ArrowLeftIcon,
1280  ArrowRightIcon: () => ArrowRightIcon,
1281  ArrowSolidDownIcon: () => ArrowSolidDownIcon,
1282  ArrowSolidLeftIcon: () => ArrowSolidLeftIcon,
1283  ArrowSolidRightIcon: () => ArrowSolidRightIcon,
1284  ArrowSolidUpIcon: () => ArrowSolidUpIcon,
1285  ArrowTopLeftIcon: () => ArrowTopLeftIcon,
1286  ArrowTopRightIcon: () => ArrowTopRightIcon,
1287  ArrowUpIcon: () => ArrowUpIcon,
1288  AzureDevOpsIcon: () => AzureDevOpsIcon,
1289  BackIcon: () => BackIcon,
1290  BasketIcon: () => BasketIcon,
1291  BatchAcceptIcon: () => BatchAcceptIcon,
1292  BatchDenyIcon: () => BatchDenyIcon,
1293  BeakerIcon: () => BeakerIcon,
1294  BellIcon: () => BellIcon,
1295  BitbucketIcon: () => BitbucketIcon,
1296  BoldIcon: () => BoldIcon,
1297  BookIcon: () => BookIcon,
1298  BookmarkHollowIcon: () => BookmarkHollowIcon,
1299  BookmarkIcon: () => BookmarkIcon,
1300  BottomBarIcon: () => BottomBarIcon,
1301  BottomBarToggleIcon: () => BottomBarToggleIcon,
1302  BoxIcon: () => BoxIcon,
1303  BranchIcon: () => BranchIcon,
1304  BrowserIcon: () => BrowserIcon,
1305  BugIcon: () => BugIcon,
1306  ButtonIcon: () => ButtonIcon,
1307  CPUIcon: () => CPUIcon,
1308  CalendarIcon: () => CalendarIcon,
1309  CameraIcon: () => CameraIcon,
1310  CameraStabilizeIcon: () => CameraStabilizeIcon,
1311  CategoryIcon: () => CategoryIcon,
1312  CertificateIcon: () => CertificateIcon,
1313  ChangedIcon: () => ChangedIcon,
1314  ChatIcon: () => ChatIcon,
1315  CheckIcon: () => CheckIcon,
1316  ChecklistIcon: () => ChecklistIcon,
1317  ChevronDownIcon: () => ChevronDownIcon,
1318  ChevronLeftIcon: () => ChevronLeftIcon,
1319  ChevronRightIcon: () => ChevronRightIcon,
1320  ChevronSmallDownIcon: () => ChevronSmallDownIcon,
1321  ChevronSmallLeftIcon: () => ChevronSmallLeftIcon,
1322  ChevronSmallRightIcon: () => ChevronSmallRightIcon,
1323  ChevronSmallUpIcon: () => ChevronSmallUpIcon,
1324  ChevronUpIcon: () => ChevronUpIcon,
1325  ChromaticIcon: () => ChromaticIcon,
1326  ChromeIcon: () => ChromeIcon,
1327  CircleHollowIcon: () => CircleHollowIcon,
1328  CircleIcon: () => CircleIcon,
1329  ClearIcon: () => ClearIcon,
1330  CloseAltIcon: () => CloseAltIcon,
1331  CloseIcon: () => CloseIcon,
1332  CloudHollowIcon: () => CloudHollowIcon,
1333  CloudIcon: () => CloudIcon,
1334  CogIcon: () => CogIcon,
1335  CollapseIcon: () => CollapseIcon,
1336  CommandIcon: () => CommandIcon,
1337  CommentAddIcon: () => CommentAddIcon,
1338  CommentIcon: () => CommentIcon,
1339  CommentsIcon: () => CommentsIcon,
1340  CommitIcon: () => CommitIcon,
1341  CompassIcon: () => CompassIcon,
1342  ComponentDrivenIcon: () => ComponentDrivenIcon,
1343  ComponentIcon: () => ComponentIcon,
1344  ContrastIcon: () => ContrastIcon,
1345  ContrastIgnoredIcon: () => ContrastIgnoredIcon,
1346  ControlsIcon: () => ControlsIcon,
1347  CopyIcon: () => CopyIcon,
1348  CreditIcon: () => CreditIcon,
1349  CrossIcon: () => CrossIcon,
1350  DashboardIcon: () => DashboardIcon,
1351  DatabaseIcon: () => DatabaseIcon,
1352  DeleteIcon: () => DeleteIcon,
1353  DiamondIcon: () => DiamondIcon,
1354  DirectionIcon: () => DirectionIcon,
1355  DiscordIcon: () => DiscordIcon,
1356  DocChartIcon: () => DocChartIcon,
1357  DocListIcon: () => DocListIcon,
1358  DocumentIcon: () => DocumentIcon,
1359  DownloadIcon: () => DownloadIcon,
1360  DragIcon: () => DragIcon,
1361  EditIcon: () => EditIcon,
1362  EditorIcon: () => EditorIcon,
1363  EllipsisIcon: () => EllipsisIcon,
1364  EmailIcon: () => EmailIcon,
1365  ExpandAltIcon: () => ExpandAltIcon,
1366  ExpandIcon: () => ExpandIcon,
1367  EyeCloseIcon: () => EyeCloseIcon,
1368  EyeIcon: () => EyeIcon,
1369  FaceHappyIcon: () => FaceHappyIcon,
1370  FaceNeutralIcon: () => FaceNeutralIcon,
1371  FaceSadIcon: () => FaceSadIcon,
1372  FacebookIcon: () => FacebookIcon,
1373  FailedIcon: () => FailedIcon,
1374  FastForwardIcon: () => FastForwardIcon,
1375  FigmaIcon: () => FigmaIcon,
1376  FilesIcon: () => FilesIcon,
1377  FilterIcon: () => FilterIcon,
1378  FlagIcon: () => FlagIcon,
1379  FolderIcon: () => FolderIcon,
1380  FormIcon: () => FormIcon,
1381  GDriveIcon: () => GDriveIcon,
1382  GiftIcon: () => GiftIcon,
1383  GithubIcon: () => GithubIcon,
1384  GitlabIcon: () => GitlabIcon,
1385  GlobeIcon: () => GlobeIcon,
1386  GoogleIcon: () => GoogleIcon,
1387  GraphBarIcon: () => GraphBarIcon,
1388  GraphLineIcon: () => GraphLineIcon,
1389  GraphqlIcon: () => GraphqlIcon,
1390  GridAltIcon: () => GridAltIcon,
1391  GridIcon: () => GridIcon,
1392  GrowIcon: () => GrowIcon,
1393  HeartHollowIcon: () => HeartHollowIcon,
1394  HeartIcon: () => HeartIcon,
1395  HomeIcon: () => HomeIcon,
1396  HourglassIcon: () => HourglassIcon,
1397  InfoIcon: () => InfoIcon,
1398  ItalicIcon: () => ItalicIcon,
1399  JumpToIcon: () => JumpToIcon,
1400  KeyIcon: () => KeyIcon,
1401  LightningIcon: () => LightningIcon,
1402  LightningOffIcon: () => LightningOffIcon,
1403  LinkBrokenIcon: () => LinkBrokenIcon,
1404  LinkIcon: () => LinkIcon,
1405  LinkedinIcon: () => LinkedinIcon,
1406  LinuxIcon: () => LinuxIcon,
1407  ListOrderedIcon: () => ListOrderedIcon,
1408  ListUnorderedIcon: () => ListUnorderedIcon,
1409  LocationIcon: () => LocationIcon,
1410  LockIcon: () => LockIcon,
1411  MarkdownIcon: () => MarkdownIcon,
1412  MarkupIcon: () => MarkupIcon,
1413  MediumIcon: () => MediumIcon,
1414  MemoryIcon: () => MemoryIcon,
1415  MenuIcon: () => MenuIcon,
1416  MergeIcon: () => MergeIcon,
1417  MirrorIcon: () => MirrorIcon,
1418  MobileIcon: () => MobileIcon,
1419  MoonIcon: () => MoonIcon,
1420  NutIcon: () => NutIcon,
1421  OutboxIcon: () => OutboxIcon,
1422  OutlineIcon: () => OutlineIcon,
1423  PaintBrushAltIcon: () => PaintBrushAltIcon,
1424  PaintBrushIcon: () => PaintBrushIcon,
1425  PaperClipIcon: () => PaperClipIcon,
1426  ParagraphIcon: () => ParagraphIcon,
1427  PassedIcon: () => PassedIcon,
1428  PhoneIcon: () => PhoneIcon,
1429  PhotoDragIcon: () => PhotoDragIcon,
1430  PhotoIcon: () => PhotoIcon,
1431  PhotoStabilizeIcon: () => PhotoStabilizeIcon,
1432  PinAltIcon: () => PinAltIcon,
1433  PinIcon: () => PinIcon,
1434  PlayAllHollowIcon: () => PlayAllHollowIcon,
1435  PlayBackIcon: () => PlayBackIcon,
1436  PlayHollowIcon: () => PlayHollowIcon,
1437  PlayIcon: () => PlayIcon,
1438  PlayNextIcon: () => PlayNextIcon,
1439  PlusIcon: () => PlusIcon,
1440  PointerDefaultIcon: () => PointerDefaultIcon,
1441  PointerHandIcon: () => PointerHandIcon,
1442  PopOutIcon: () => PopOutIcon,
1443  PowerIcon: () => PowerIcon,
1444  PrintIcon: () => PrintIcon,
1445  ProceedIcon: () => ProceedIcon,
1446  ProfileIcon: () => ProfileIcon,
1447  PullRequestIcon: () => PullRequestIcon,
1448  QuestionIcon: () => QuestionIcon,
1449  RSSIcon: () => RSSIcon,
1450  RedirectIcon: () => RedirectIcon,
1451  ReduxIcon: () => ReduxIcon,
1452  RefreshIcon: () => RefreshIcon,
1453  ReplyIcon: () => ReplyIcon,
1454  RepoIcon: () => RepoIcon,
1455  RequestChangeIcon: () => RequestChangeIcon,
1456  RewindIcon: () => RewindIcon,
1457  RulerIcon: () => RulerIcon,
1458  SaveIcon: () => SaveIcon,
1459  SearchIcon: () => SearchIcon,
1460  ShareAltIcon: () => ShareAltIcon,
1461  ShareIcon: () => ShareIcon,
1462  ShieldIcon: () => ShieldIcon,
1463  SideBySideIcon: () => SideBySideIcon,
1464  SidebarAltIcon: () => SidebarAltIcon,
1465  SidebarAltToggleIcon: () => SidebarAltToggleIcon,
1466  SidebarIcon: () => SidebarIcon,
1467  SidebarToggleIcon: () => SidebarToggleIcon,
1468  SortDownIcon: () => SortDownIcon,
1469  SortUpIcon: () => SortUpIcon,
1470  SpeakerIcon: () => SpeakerIcon,
1471  StackedIcon: () => StackedIcon,
1472  StarHollowIcon: () => StarHollowIcon,
1473  StarIcon: () => StarIcon,
1474  StatusFailIcon: () => StatusFailIcon,
1475  StatusIcon: () => StatusIcon,
1476  StatusNewIcon: () => StatusNewIcon,
1477  StatusPassIcon: () => StatusPassIcon,
1478  StatusWarnIcon: () => StatusWarnIcon,
1479  StickerIcon: () => StickerIcon,
1480  StopAltHollowIcon: () => StopAltHollowIcon,
1481  StopAltIcon: () => StopAltIcon,
1482  StopIcon: () => StopIcon,
1483  StorybookIcon: () => StorybookIcon,
1484  StructureIcon: () => StructureIcon,
1485  SubtractIcon: () => SubtractIcon,
1486  SunIcon: () => SunIcon,
1487  SupportIcon: () => SupportIcon,
1488  SweepIcon: () => SweepIcon,
1489  SwitchAltIcon: () => SwitchAltIcon,
1490  SyncIcon: () => SyncIcon,
1491  TabletIcon: () => TabletIcon,
1492  ThumbsUpIcon: () => ThumbsUpIcon,
1493  TimeIcon: () => TimeIcon,
1494  TimerIcon: () => TimerIcon,
1495  TransferIcon: () => TransferIcon,
1496  TrashIcon: () => TrashIcon,
1497  TwitterIcon: () => TwitterIcon,
1498  TypeIcon: () => TypeIcon,
1499  UbuntuIcon: () => UbuntuIcon,
1500  UndoIcon: () => UndoIcon,
1501  UnfoldIcon: () => UnfoldIcon,
1502  UnlockIcon: () => UnlockIcon,
1503  UnpinIcon: () => UnpinIcon,
1504  UploadIcon: () => UploadIcon,
1505  UserAddIcon: () => UserAddIcon,
1506  UserAltIcon: () => UserAltIcon,
1507  UserIcon: () => UserIcon,
1508  UsersIcon: () => UsersIcon,
1509  VSCodeIcon: () => VSCodeIcon,
1510  VerifiedIcon: () => VerifiedIcon,
1511  VideoIcon: () => VideoIcon,
1512  WandIcon: () => WandIcon,
1513  WatchIcon: () => WatchIcon,
1514  WindowsIcon: () => WindowsIcon,
1515  WrenchIcon: () => WrenchIcon,
1516  XIcon: () => XIcon,
1517  YoutubeIcon: () => YoutubeIcon,
1518  ZoomIcon: () => ZoomIcon,
1519  ZoomOutIcon: () => ZoomOutIcon,
1520  ZoomResetIcon: () => ZoomResetIcon,
1521  default: () => icons_default,
1522  iconList: () => iconList
1523});
1524var icons_default = __STORYBOOK_ICONS__, { AccessibilityAltIcon, AccessibilityIcon, AccessibilityIgnoredIcon, AddIcon, AdminIcon, AlertAltIcon, AlertIcon, AlignLeftIcon, AlignRightIcon, AppleIcon, ArrowBottomLeftIcon, ArrowBottomRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowSolidDownIcon, ArrowSolidLeftIcon, ArrowSolidRightIcon, ArrowSolidUpIcon, ArrowTopLeftIcon, ArrowTopRightIcon, ArrowUpIcon, AzureDevOpsIcon, BackIcon, BasketIcon, BatchAcceptIcon, BatchDenyIcon, BeakerIcon, BellIcon, BitbucketIcon, BoldIcon, BookIcon, BookmarkHollowIcon, BookmarkIcon, BottomBarIcon, BottomBarToggleIcon, BoxIcon, BranchIcon, BrowserIcon, BugIcon, ButtonIcon, CPUIcon, CalendarIcon, CameraIcon, CameraStabilizeIcon, CategoryIcon, CertificateIcon, ChangedIcon, ChatIcon, CheckIcon, ChecklistIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronSmallDownIcon, ChevronSmallLeftIcon, ChevronSmallRightIcon, ChevronSmallUpIcon, ChevronUpIcon, ChromaticIcon, ChromeIcon, CircleHollowIcon, CircleIcon, ClearIcon, CloseAltIcon, CloseIcon, CloudHollowIcon, CloudIcon, CogIcon, CollapseIcon, CommandIcon, CommentAddIcon, CommentIcon, CommentsIcon, CommitIcon, CompassIcon, ComponentDrivenIcon, ComponentIcon, ContrastIcon, ContrastIgnoredIcon, ControlsIcon, CopyIcon, CreditIcon, CrossIcon, DashboardIcon, DatabaseIcon, DeleteIcon, DiamondIcon, DirectionIcon, DiscordIcon, DocChartIcon, DocListIcon, DocumentIcon, DownloadIcon, DragIcon, EditIcon, EditorIcon, EllipsisIcon, EmailIcon, ExpandAltIcon, ExpandIcon, EyeCloseIcon, EyeIcon, FaceHappyIcon, FaceNeutralIcon, FaceSadIcon, FacebookIcon, FailedIcon, FastForwardIcon, FigmaIcon, FilesIcon, FilterIcon, FlagIcon, FolderIcon, FormIcon, GDriveIcon, GiftIcon, GithubIcon, GitlabIcon, GlobeIcon, GoogleIcon, GraphBarIcon, GraphLineIcon, GraphqlIcon, GridAltIcon, GridIcon, GrowIcon, HeartHollowIcon, HeartIcon, HomeIcon, HourglassIcon, InfoIcon, ItalicIcon, JumpToIcon, KeyIcon, LightningIcon, LightningOffIcon, LinkBrokenIcon, LinkIcon, LinkedinIcon, LinuxIcon, ListOrderedIcon, ListUnorderedIcon, LocationIcon, LockIcon, MarkdownIcon, MarkupIcon, MediumIcon, MemoryIcon, MenuIcon, MergeIcon, MirrorIcon, MobileIcon, MoonIcon, NutIcon, OutboxIcon, OutlineIcon, PaintBrushAltIcon, PaintBrushIcon, PaperClipIcon, ParagraphIcon, PassedIcon, PhoneIcon, PhotoDragIcon, PhotoIcon, PhotoStabilizeIcon, PinAltIcon, PinIcon, PlayAllHollowIcon, PlayBackIcon, PlayHollowIcon, PlayIcon, PlayNextIcon, PlusIcon, PointerDefaultIcon, PointerHandIcon, PopOutIcon, PowerIcon, PrintIcon, ProceedIcon, ProfileIcon, PullRequestIcon, QuestionIcon, RSSIcon, RedirectIcon, ReduxIcon, RefreshIcon, ReplyIcon, RepoIcon, RequestChangeIcon, RewindIcon, RulerIcon, SaveIcon, SearchIcon, ShareAltIcon, ShareIcon, ShieldIcon, SideBySideIcon, SidebarAltIcon, SidebarAltToggleIcon, SidebarIcon, SidebarToggleIcon, SortDownIcon, SortUpIcon, SpeakerIcon, StackedIcon, StarHollowIcon, StarIcon, StatusFailIcon, StatusIcon, StatusNewIcon, StatusPassIcon, StatusWarnIcon, StickerIcon, StopAltHollowIcon, StopAltIcon, StopIcon, StorybookIcon, StructureIcon, SubtractIcon, SunIcon, SupportIcon, SweepIcon, SwitchAltIcon, SyncIcon, TabletIcon, ThumbsUpIcon, TimeIcon, TimerIcon, TransferIcon, TrashIcon, TwitterIcon, TypeIcon, UbuntuIcon, UndoIcon, UnfoldIcon, UnlockIcon, UnpinIcon, UploadIcon, UserAddIcon, UserAltIcon, UserIcon, UsersIcon, VSCodeIcon, VerifiedIcon, VideoIcon, WandIcon, WatchIcon, WindowsIcon, WrenchIcon, XIcon, YoutubeIcon, ZoomIcon, ZoomOutIcon, ZoomResetIcon, iconList } = __STORYBOOK_ICONS__;
1525
1526// global-externals:storybook/manager-api
1527var manager_api_default = __STORYBOOK_API__, { ActiveTabs, Consumer, ManagerContext, Provider, RequestResponseError, Tag, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, experimental_MockUniversalStore, experimental_UniversalStore, experimental_getStatusStore, experimental_getTestProviderStore, experimental_requestResponse, experimental_useStatusStore, experimental_useTestProviderStore, experimental_useUniversalStore, internal_checklistStore, internal_fullStatusStore, internal_fullTestProviderStore, internal_universalChecklistStore, internal_universalStatusStore, internal_universalTestProviderStore, isMacLike, isShortcutTaken, keyToSymbol, merge, mockChannel, optionOrAltSymbol, shortcutMatchesShortcut, shortcutToAriaKeyshortcuts, shortcutToHumanString, types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState } = __STORYBOOK_API__;
1528
1529// global-externals:storybook/theming
1530var theming_default = __STORYBOOK_THEMING__, { CacheProvider, ClassNames, Global, ThemeProvider, background, color, convert, create, createCache, createGlobal, createReset, css, darken, ensure, getPreferredColorScheme, ignoreSsrWarning, isPropValid, jsx, keyframes, lighten, srOnlyStyles, styled, themes, tokens, typography, useTheme, withTheme } = __STORYBOOK_THEMING__;
1531
1532// src/toolbar/components/ToolbarManager.tsx
1533init_react();
1534
1535// global-externals:storybook/internal/components
1536var components_default = __STORYBOOK_COMPONENTS__, { A, AbstractToolbar, ActionBar, ActionList, AddonPanel, Badge, Bar, Blockquote, Button, Card, ClipboardCode, Code, Collapsible, DL, Div, DocumentWrapper, EmptyTabContent, ErrorFormatter, FlexBar, Form, H1, H2, H3, H4, H5, H6, HR, IconButton, Img, LI, Link, ListItem, Loader, Modal, ModalDecorator, OL, P, Placeholder, Popover, PopoverProvider, Pre, ProgressSpinner, ResetWrapper, ScrollArea, Select, Separator, Spaced, Span, StatelessTab, StatelessTabList, StatelessTabPanel, StatelessTabsView, StorybookIcon: StorybookIcon2, StorybookLogo, SyntaxHighlighter, TT, TabBar, TabButton, TabList, TabPanel, TabWrapper, Table, Tabs, TabsState, TabsView, ToggleButton, Toolbar, Tooltip, TooltipLinkList, TooltipMessage, TooltipNote, TooltipProvider, UL, WithTooltip, WithTooltipPure, Zoom, codeCommon, components, convertToReactAriaPlacement, createCopyToClipboardFunction, getStoryHref, interleaveSeparators, nameSpaceClassNames, resetComponents
vendor: 2,794 bytes, lines 1536-1613
1536, useTabsState, withReset } = __STORYBOOK_COMPONENTS__;
1537
1538// src/toolbar/utils/normalize-toolbar-arg-type.ts
1539var defaultItemValues = {
1540  type: "item",
1541  value: ""
1542}, normalizeArgType = (key, argType) => {
1543  let toolbar = argType.toolbar;
1544  return toolbar ? {
1545    ...argType,
1546    name: argType.name || key,
1547    description: argType.description || key,
1548    toolbar: {
1549      ...argType.toolbar,
1550      items: toolbar.items.map((_item) => {
1551        let item = typeof _item == "string" ? { value: _item, title: _item } : _item;
1552        return item.type === "reset" && toolbar.icon && (item.icon = toolbar.icon, item.hideIcon = !0, item.value = void 0), { ...defaultItemValues, ...item };
1553      })
1554    }
1555  } : null;
1556};
1557
1558// src/toolbar/components/ToolbarMenuSelect.tsx
1559init_react();
1560
1561// src/components/components/icon/icon.tsx
1562init_react();
1563
1564// global-externals:storybook/internal/client-logger
1565var client_logger_default = __STORYBOOK_CLIENT_LOGGER__, { deprecate, logger, once, pretty } = __STORYBOOK_CLIENT_LOGGER__;
1566
1567// src/components/components/icon/icon.tsx
1568var NEW_ICON_MAP = icons_exports, Svg = styled.svg`
1569  display: inline-block;
1570  shape-rendering: inherit;
1571  vertical-align: middle;
1572  fill: currentColor;
1573  path {
1574    fill: currentColor;
1575  }
1576`, Icons = ({
1577  icon,
1578  useSymbol,
1579  __suppressDeprecationWarning = !1,
1580  ...props
1581}) => {
1582  __suppressDeprecationWarning || deprecate(
1583    `Use of the deprecated Icons ${`(${icon})` || ""} component detected. Please use the @storybook/icons component directly. For more informations, see the migration notes at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#icons-is-deprecated`
1584  );
1585  let findIcon = icons[icon] || null;
1586  if (!findIcon)
1587    return logger.warn(
1588      `Use of an unknown prop ${`(${icon})` || ""} in the Icons component. The Icons component is deprecated. Please use the @storybook/icons component directly. For more informations, see the migration notes at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#icons-is-deprecated`
1589    ), null;
1590  let Icon = NEW_ICON_MAP[findIcon];
1591  return react_default.createElement(Icon, { ...props });
1592}, Symbols = memo(function({ icons: keys = Object.keys(icons) }) {
1593  return react_default.createElement(
1594    Svg,
1595    {
1596      viewBox: "0 0 14 14",
1597      style: { position: "absolute", width: 0, height: 0 },
1598      "data-chromatic": "ignore"
1599    },
1600    keys.map((key) => react_default.createElement("symbol", { id: `icon--${key}`, key }, icons[key]))
1601  );
1602}), icons = {
1603  user: "UserIcon",
1604  useralt: "UserAltIcon",
1605  useradd: "UserAddIcon",
1606  users: "UsersIcon",
1607  profile: "ProfileIcon",
1608  facehappy: "FaceHappyIcon",
1609  faceneutral: "FaceNeutralIcon",
1610  facesad: "FaceSadIcon",
1611  accessibility: "AccessibilityIcon",
1612  accessibilityalt: "AccessibilityAltIcon",
1613  a
vendor: 5,069 bytes, lines 1613-1809
1613rrowup: "ChevronUpIcon",
1614  arrowdown: "ChevronDownIcon",
1615  arrowleft: "ChevronLeftIcon",
1616  arrowright: "ChevronRightIcon",
1617  arrowupalt: "ArrowUpIcon",
1618  arrowdownalt: "ArrowDownIcon",
1619  arrowleftalt: "ArrowLeftIcon",
1620  arrowrightalt: "ArrowRightIcon",
1621  expandalt: "ExpandAltIcon",
1622  collapse: "CollapseIcon",
1623  expand: "ExpandIcon",
1624  unfold: "UnfoldIcon",
1625  transfer: "TransferIcon",
1626  redirect: "RedirectIcon",
1627  undo: "UndoIcon",
1628  reply: "ReplyIcon",
1629  sync: "SyncIcon",
1630  upload: "UploadIcon",
1631  download: "DownloadIcon",
1632  back: "BackIcon",
1633  proceed: "ProceedIcon",
1634  refresh: "RefreshIcon",
1635  globe: "GlobeIcon",
1636  compass: "CompassIcon",
1637  location: "LocationIcon",
1638  pin: "PinIcon",
1639  time: "TimeIcon",
1640  dashboard: "DashboardIcon",
1641  timer: "TimerIcon",
1642  home: "HomeIcon",
1643  admin: "AdminIcon",
1644  info: "InfoIcon",
1645  question: "QuestionIcon",
1646  support: "SupportIcon",
1647  alert: "AlertIcon",
1648  email: "EmailIcon",
1649  phone: "PhoneIcon",
1650  link: "LinkIcon",
1651  unlink: "LinkBrokenIcon",
1652  bell: "BellIcon",
1653  rss: "RSSIcon",
1654  sharealt: "ShareAltIcon",
1655  share: "ShareIcon",
1656  circle: "CircleIcon",
1657  circlehollow: "CircleHollowIcon",
1658  bookmarkhollow: "BookmarkHollowIcon",
1659  bookmark: "BookmarkIcon",
1660  hearthollow: "HeartHollowIcon",
1661  heart: "HeartIcon",
1662  starhollow: "StarHollowIcon",
1663  star: "StarIcon",
1664  certificate: "CertificateIcon",
1665  verified: "VerifiedIcon",
1666  thumbsup: "ThumbsUpIcon",
1667  shield: "ShieldIcon",
1668  basket: "BasketIcon",
1669  beaker: "BeakerIcon",
1670  hourglass: "HourglassIcon",
1671  flag: "FlagIcon",
1672  cloudhollow: "CloudHollowIcon",
1673  edit: "EditIcon",
1674  cog: "CogIcon",
1675  nut: "NutIcon",
1676  wrench: "WrenchIcon",
1677  ellipsis: "EllipsisIcon",
1678  check: "CheckIcon",
1679  form: "FormIcon",
1680  batchdeny: "BatchDenyIcon",
1681  batchaccept: "BatchAcceptIcon",
1682  controls: "ControlsIcon",
1683  plus: "PlusIcon",
1684  closeAlt: "CloseAltIcon",
1685  cross: "CrossIcon",
1686  trash: "TrashIcon",
1687  pinalt: "PinAltIcon",
1688  unpin: "UnpinIcon",
1689  add: "AddIcon",
1690  subtract: "SubtractIcon",
1691  close: "CloseIcon",
1692  delete: "DeleteIcon",
1693  passed: "PassedIcon",
1694  changed: "ChangedIcon",
1695  failed: "FailedIcon",
1696  clear: "ClearIcon",
1697  comment: "CommentIcon",
1698  commentadd: "CommentAddIcon",
1699  requestchange: "RequestChangeIcon",
1700  comments: "CommentsIcon",
1701  lock: "LockIcon",
1702  unlock: "UnlockIcon",
1703  key: "KeyIcon",
1704  outbox: "OutboxIcon",
1705  credit: "CreditIcon",
1706  button: "ButtonIcon",
1707  type: "TypeIcon",
1708  pointerdefault: "PointerDefaultIcon",
1709  pointerhand: "PointerHandIcon",
1710  browser: "BrowserIcon",
1711  tablet: "TabletIcon",
1712  mobile: "MobileIcon",
1713  watch: "WatchIcon",
1714  sidebar: "SidebarIcon",
1715  sidebaralt: "SidebarAltIcon",
1716  sidebaralttoggle: "SidebarAltToggleIcon",
1717  sidebartoggle: "SidebarToggleIcon",
1718  bottombar: "BottomBarIcon",
1719  bottombartoggle: "BottomBarToggleIcon",
1720  cpu: "CPUIcon",
1721  database: "DatabaseIcon",
1722  memory: "MemoryIcon",
1723  structure: "StructureIcon",
1724  box: "BoxIcon",
1725  power: "PowerIcon",
1726  photo: "PhotoIcon",
1727  component: "ComponentIcon",
1728  grid: "GridIcon",
1729  outline: "OutlineIcon",
1730  photodrag: "PhotoDragIcon",
1731  search: "SearchIcon",
1732  zoom: "ZoomIcon",
1733  zoomout: "ZoomOutIcon",
1734  zoomreset: "ZoomResetIcon",
1735  eye: "EyeIcon",
1736  eyeclose: "EyeCloseIcon",
1737  lightning: "LightningIcon",
1738  lightningoff: "LightningOffIcon",
1739  contrast: "ContrastIcon",
1740  switchalt: "SwitchAltIcon",
1741  mirror: "MirrorIcon",
1742  grow: "GrowIcon",
1743  paintbrush: "PaintBrushIcon",
1744  ruler: "RulerIcon",
1745  stop: "StopIcon",
1746  camera: "CameraIcon",
1747  video: "VideoIcon",
1748  speaker: "SpeakerIcon",
1749  play: "PlayIcon",
1750  playback: "PlayBackIcon",
1751  playnext: "PlayNextIcon",
1752  rewind: "RewindIcon",
1753  fastforward: "FastForwardIcon",
1754  stopalt: "StopAltIcon",
1755  sidebyside: "SideBySideIcon",
1756  stacked: "StackedIcon",
1757  sun: "SunIcon",
1758  moon: "MoonIcon",
1759  book: "BookIcon",
1760  document: "DocumentIcon",
1761  copy: "CopyIcon",
1762  category: "CategoryIcon",
1763  folder: "FolderIcon",
1764  print: "PrintIcon",
1765  graphline: "GraphLineIcon",
1766  calendar: "CalendarIcon",
1767  graphbar: "GraphBarIcon",
1768  menu: "MenuIcon",
1769  menualt: "MenuIcon",
1770  filter: "FilterIcon",
1771  docchart: "DocChartIcon",
1772  doclist: "DocListIcon",
1773  markup: "MarkupIcon",
1774  bold: "BoldIcon",
1775  paperclip: "PaperClipIcon",
1776  listordered: "ListOrderedIcon",
1777  listunordered: "ListUnorderedIcon",
1778  paragraph: "ParagraphIcon",
1779  markdown: "MarkdownIcon",
1780  repository: "RepoIcon",
1781  commit: "CommitIcon",
1782  branch: "BranchIcon",
1783  pullrequest: "PullRequestIcon",
1784  merge: "MergeIcon",
1785  apple: "AppleIcon",
1786  linux: "LinuxIcon",
1787  ubuntu: "UbuntuIcon",
1788  windows: "WindowsIcon",
1789  storybook: "StorybookIcon",
1790  azuredevops: "AzureDevOpsIcon",
1791  bitbucket: "BitbucketIcon",
1792  chrome: "ChromeIcon",
1793  chromatic: "ChromaticIcon",
1794  componentdriven: "ComponentDrivenIcon",
1795  discord: "DiscordIcon",
1796  facebook: "FacebookIcon",
1797  figma: "FigmaIcon",
1798  gdrive: "GDriveIcon",
1799  github: "GithubIcon",
1800  gitlab: "GitlabIcon",
1801  google: "GoogleIcon",
1802  graphql: "GraphqlIcon",
1803  medium: "MediumIcon",
1804  redux: "ReduxIcon",
1805  twitter: "TwitterIcon",
1806  youtube: "YoutubeIcon",
1807  vscode: "VSCodeIcon"
1808};
1809
vendor: 4,967 bytes, lines 1810-1936
1810// src/toolbar/utils/get-selected.ts
1811var getSelectedItem = ({ currentValue, items }) => items.find((item) => item.value === currentValue && item.type !== "reset");
1812
1813// src/toolbar/constants.ts
1814var TOOLBAR_ID = "toolbar";
1815
1816// src/toolbar/utils/register-shortcuts.ts
1817var registerShortcuts = async (api, id, shortcuts) => {
1818  shortcuts.next && await api.setAddonShortcut(TOOLBAR_ID, {
1819    label: shortcuts.next.label,
1820    defaultShortcut: shortcuts.next.keys,
1821    actionName: `${id}:next`,
1822    action: shortcuts.next.action
1823  }), shortcuts.previous && await api.setAddonShortcut(TOOLBAR_ID, {
1824    label: shortcuts.previous.label,
1825    defaultShortcut: shortcuts.previous.keys,
1826    actionName: `${id}:previous`,
1827    action: shortcuts.previous.action
1828  }), shortcuts.reset && await api.setAddonShortcut(TOOLBAR_ID, {
1829    label: shortcuts.reset.label,
1830    defaultShortcut: shortcuts.reset.keys,
1831    actionName: `${id}:reset`,
1832    action: shortcuts.reset.action
1833  });
1834};
1835
1836// src/toolbar/components/ToolbarMenuSelect.tsx
1837var ToolbarMenuItemContainer = styled("div")({
1838  width: "100%",
1839  display: "flex",
1840  alignItems: "center",
1841  gap: 8
1842}), ToolbarMenuItemMiddle = styled("div")({
1843  flex: 1
1844}), ToolbarMenuSelect = ({
1845  id,
1846  name,
1847  description,
1848  toolbar: {
1849    icon: _icon,
1850    items,
1851    title: _title,
1852    preventDynamicIcon,
1853    dynamicTitle = !0,
1854    shortcuts
1855  }
1856}) => {
1857  let api = useStorybookApi(), [globals, updateGlobals, storyGlobals] = useGlobals(), currentValue = globals[id], isOverridden = id in storyGlobals, icon = _icon, title2 = _title;
1858  preventDynamicIcon || (icon = getSelectedItem({ currentValue, items })?.icon || icon), dynamicTitle && (title2 = getSelectedItem({ currentValue, items })?.title || title2), !title2 && !icon && console.warn(`Toolbar '${name}' has no title or icon`);
1859  let resetItem = items.find((item) => item.type === "reset"), resetLabel = resetItem?.title, options2 = react_default.useMemo(
1860    () => items.filter((item) => item.type === "item").map((item) => {
1861      let itemTitle = item.title ?? item.value ?? "Untitled", iconComponent = !item.hideIcon && item.icon ? react_default.createElement(Icons, { icon: item.icon, __suppressDeprecationWarning: !0 }) : void 0;
1862      return item.right ? {
1863        title: itemTitle,
1864        value: item.value,
1865        children: react_default.createElement(ToolbarMenuItemContainer, null, iconComponent, react_default.createElement(ToolbarMenuItemMiddle, null, item.title ?? item.value), item.right)
1866      } : {
1867        title: itemTitle,
1868        value: item.value,
1869        icon: iconComponent
1870      };
1871    }),
1872    [items]
1873  );
1874  react_default.useEffect(() => {
1875    if (shortcuts) {
1876      let length = options2.length;
1877      registerShortcuts(api, id, {
1878        next: {
1879          ...shortcuts.next,
1880          action: () => {
1881            let idx = options2.findIndex((i2) => i2.value === globals[id]), nextIdx = idx < 0 ? 0 : (idx + 1) % length;
1882            updateGlobals({ [id]: options2[nextIdx].value });
1883          }
1884        },
1885        previous: {
1886          ...shortcuts.previous,
1887          action: () => {
1888            let idx = options2.findIndex((i2) => i2.value === globals[id]), previousIdx = idx < 0 ? length - 1 : (idx + length - 1) % length;
1889            updateGlobals({ [id]: options2[previousIdx].value });
1890          }
1891        },
1892        reset: {
1893          ...shortcuts.reset,
1894          action: () => {
1895            updateGlobals({ [id]: void 0 });
1896          }
1897        }
1898      });
1899    }
1900  }, [api, id, shortcuts, globals, options2, updateGlobals]);
1901  let ariaLabel = description || title2 || name || id;
1902  return react_default.createElement(
1903    Select,
1904    {
1905      defaultOptions: [currentValue],
1906      options: options2,
1907      disabled: isOverridden,
1908      ariaLabel,
1909      tooltip: ariaLabel,
1910      resetLabel,
1911      onReset: resetItem ? () => updateGlobals({ [id]: resetItem?.value }) : void 0,
1912      onSelect: (selected) => updateGlobals({ [id]: selected }),
1913      icon: icon && react_default.createElement(Icons, { icon, __suppressDeprecationWarning: !0 }),
1914      showSelectedOptionTitle: dynamicTitle
1915    },
1916    title2
1917  );
1918};
1919
1920// src/toolbar/components/ToolbarManager.tsx
1921var ToolbarManager = () => {
1922  let globalTypes = useGlobalTypes();
1923  return Object.keys(globalTypes).some((id) => !!globalTypes[id].toolbar) ? react_default.createElement(react_default.Fragment, null, react_default.createElement(Separator, null), Object.keys(globalTypes).map((id) => {
1924    let normalizedArgType = normalizeArgType(id, globalTypes[id]);
1925    return normalizedArgType && react_default.createElement(ToolbarMenuSelect, { key: id, id, ...normalizedArgType });
1926  })) : null;
1927};
1928
1929// src/manager/index.tsx
1930init_react();
1931
1932// global-externals:react-dom/client
1933var client_default = __REACT_DOM_CLIENT__, { createRoot, hydrateRoot } = __REACT_DOM_CLIENT__;
1934
1935// global-externals:storybook/internal/manager-errors
1936var manager_errors_default = __STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__, { Category, 
1936ProviderDoesNotExtendBaseProviderError, StatusTypeIdMismatchError, UncaughtManagerError } = __STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__;
1937
1938// global-externals:storybook/internal/router
1939var router_default = __STORYBOOK_ROUTER__, { BaseLocationProvider, DEEPLY_EQUAL, Link: Link2, Location, LocationProvider, Match, MemoryRouter, Route, buildArgsParam, deepDiff, getMatch, parsePath, queryFromLocation, stringifyQuery, useNavigate } = __STORYBOOK_ROUTER__;
1940
vendor: 20,097 bytes, lines 1941-2285
1941// ../../node_modules/react-helmet-async/lib/index.module.js
1942init_react();
1943var import_prop_types = __toESM(require_prop_types()), import_react_fast_compare = __toESM(require_react_fast_compare()), import_invariant = __toESM(require_browser()), import_shallowequal = __toESM(require_shallowequal());
1944function a() {
1945  return a = Object.assign || function(t2) {
1946    for (var e2 = 1; e2 < arguments.length; e2++) {
1947      var r4 = arguments[e2];
1948      for (var n3 in r4) Object.prototype.hasOwnProperty.call(r4, n3) && (t2[n3] = r4[n3]);
1949    }
1950    return t2;
1951  }, a.apply(this, arguments);
1952}
1953function s(t2, e2) {
1954  t2.prototype = Object.create(e2.prototype), t2.prototype.constructor = t2, c(t2, e2);
1955}
1956function c(t2, e2) {
1957  return c = Object.setPrototypeOf || function(t3, e3) {
1958    return t3.__proto__ = e3, t3;
1959  }, c(t2, e2);
1960}
1961function u(t2, e2) {
1962  if (t2 == null) return {};
1963  var r4, n3, i2 = {}, o3 = Object.keys(t2);
1964  for (n3 = 0; n3 < o3.length; n3++) e2.indexOf(r4 = o3[n3]) >= 0 || (i2[r4] = t2[r4]);
1965  return i2;
1966}
1967var l = { BASE: "base", BODY: "body", HEAD: "head", HTML: "html", LINK: "link", META: "meta", NOSCRIPT: "noscript", SCRIPT: "script", STYLE: "style", TITLE: "title", FRAGMENT: "Symbol(react.fragment)" }, p = { rel: ["amphtml", "canonical", "alternate"] }, f = { type: ["application/ld+json"] }, d = { charset: "", name: ["robots", "description"], property: ["og:type", "og:title", "og:url", "og:image", "og:image:alt", "og:description", "twitter:url", "twitter:title", "twitter:description", "twitter:image", "twitter:image:alt", "twitter:card", "twitter:site"] }, h = Object.keys(l).map(function(t2) {
1968  return l[t2];
1969}), m = { accesskey: "accessKey", charset: "charSet", class: "className", contenteditable: "contentEditable", contextmenu: "contextMenu", "http-equiv": "httpEquiv", itemprop: "itemProp", tabindex: "tabIndex" }, y = Object.keys(m).reduce(function(t2, e2) {
1970  return t2[m[e2]] = e2, t2;
1971}, {}), T = function(t2, e2) {
1972  for (var r4 = t2.length - 1; r4 >= 0; r4 -= 1) {
1973    var n3 = t2[r4];
1974    if (Object.prototype.hasOwnProperty.call(n3, e2)) return n3[e2];
1975  }
1976  return null;
1977}, g = function(t2) {
1978  var e2 = T(t2, l.TITLE), r4 = T(t2, "titleTemplate");
1979  if (Array.isArray(e2) && (e2 = e2.join("")), r4 && e2) return r4.replace(/%s/g, function() {
1980    return e2;
1981  });
1982  var n3 = T(t2, "defaultTitle");
1983  return e2 || n3 || void 0;
1984}, b = function(t2) {
1985  return T(t2, "onChangeClientState") || function() {
1986  };
1987}, v = function(t2, e2) {
1988  return e2.filter(function(e3) {
1989    return e3[t2] !== void 0;
1990  }).map(function(e3) {
1991    return e3[t2];
1992  }).reduce(function(t3, e3) {
1993    return a({}, t3, e3);
1994  }, {});
1995}, A2 = function(t2, e2) {
1996  return e2.filter(function(t3) {
1997    return t3[l.BASE] !== void 0;
1998  }).map(function(t3) {
1999    return t3[l.BASE];
2000  }).reverse().reduce(function(e3, r4) {
2001    if (!e3.length) for (var n3 = Object.keys(r4), i2 = 0; i2 < n3.length; i2 += 1) {
2002      var o3 = n3[i2].toLowerCase();
2003      if (t2.indexOf(o3) !== -1 && r4[o3]) return e3.concat(r4);
2004    }
2005    return e3;
2006  }, []);
2007}, C = function(t2, e2, r4) {
2008  var n3 = {};
2009  return r4.filter(function(e3) {
2010    return !!Array.isArray(e3[t2]) || (e3[t2] !== void 0 && console && typeof console.warn == "function" && console.warn("Helmet: " + t2 + ' should be of type "Array". Instead found type "' + typeof e3[t2] + '"'), !1);
2011  }).map(function(e3) {
2012    return e3[t2];
2013  }).reverse().reduce(function(t3, r5) {
2014    var i2 = {};
2015    r5.filter(function(t4) {
2016      for (var r6, o4 = Object.keys(t4), a2 = 0; a2 < o4.length; a2 += 1) {
2017        var s3 = o4[a2], c3 = s3.toLowerCase();
2018        e2.indexOf(c3) === -1 || r6 === "rel" && t4[r6].toLowerCase() === "canonical" || c3 === "rel" && t4[c3].toLowerCase() === "stylesheet" || (r6 = c3), e2.indexOf(s3) === -1 || s3 !== "innerHTML" && s3 !== "cssText" && s3 !== "itemprop" || (r6 = s3);
2019      }
2020      if (!r6 || !t4[r6]) return !1;
2021      var u3 = t4[r6].toLowerCase();
2022      return n3[r6] || (n3[r6] = {}), i2[r6] || (i2[r6] = {}), !n3[r6][u3] && (i2[r6][u3] = !0, !0);
2023    }).reverse().forEach(function(e3) {
2024      return t3.push(e3);
2025    });
2026    for (var o3 = Object.keys(i2), s2 = 0; s2 < o3.length; s2 += 1) {
2027      var c2 = o3[s2], u2 = a({}, n3[c2], i2[c2]);
2028      n3[c2] = u2;
2029    }
2030    return t3;
2031  }, []).reverse();
2032}, O = function(t2, e2) {
2033  if (Array.isArray(t2) && t2.length) {
2034    for (var r4 = 0; r4 < t2.length; r4 += 1) if (t2[r4][e2]) return !0;
2035  }
2036  return !1;
2037}, S = function(t2) {
2038  return Array.isArray(t2) ? t2.join("") : t2;
2039}, E = function(t2, e2) {
2040  return Array.isArray(t2) ? t2.reduce(function(t3, r4) {
2041    return (function(t4, e3) {
2042      for (var r5 = Object.keys(t4), n3 = 0; n3 < r5.length; n3 += 1) if (e3[r5[n3]] && e3[r5[n3]].includes(t4[r5[n3]])) return !0;
2043      return !1;
2044    })(r4, e2) ? t3.priority.push(r4) : t3.default.push(r4), t3;
2045  }, { priority: [], default: [] }) : { default: t2 };
2046}, I = function(t2, e2) {
2047  var r4;
2048  return a({}, t2, ((r4 = {})[e2] = void 0, r4));
2049}, P2 = [l.NOSCRIPT, l.SCRIPT, l.STYLE], w = function(t2, e2) {
2050  return e2 === void 0 && (e2 = !0), e2 === !1 ? String(t2) : String(t2).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
2051}, x = function(t2) {
2052  return Object.keys(t2).reduce(function(e2, r4) {
2053    var n3 = t2[r4] !== void 0 ? r4 + '="' + t2[r4] + '"' : "" + r4;
2054    return e2 ? e2 + " " + n3 : n3;
2055  }, "");
2056}, L = function(t2, e2) {
2057  return e2 === void 0 && (e2 = {}), Object.keys(t2).reduce(function(e3, r4) {
2058    return e3[m[r4] || r4] = t2[r4], e3;
2059  }, e2);
2060}, j = function(e2, r4) {
2061  return r4.map(function(r5, n3) {
2062    var i2, o3 = ((i2 = { key: n3 })["data-rh"] = !0, i2);
2063    return Object.keys(r5).forEach(function(t2) {
2064      var e3 = m[t2] || t2;
2065      e3 === "innerHTML" || e3 === "cssText" ? o3.dangerouslySetInnerHTML = { __html: r5.innerHTML || r5.cssText } : o3[e3] = r5[t2];
2066    }), react_default.createElement(e2, o3);
2067  });
2068}, M = function(e2, r4, n3) {
2069  switch (e2) {
2070    case l.TITLE:
2071      return { toComponent: function() {
2072        return n4 = r4.titleAttributes, (i2 = { key: e3 = r4.title })["data-rh"] = !0, o3 = L(n4, i2), [react_default.createElement(l.TITLE, o3, e3)];
2073        var e3, n4, i2, o3;
2074      }, toString: function() {
2075        return (function(t2, e3, r5, n4) {
2076          var i2 = x(r5), o3 = S(e3);
2077          return i2 ? "<" + t2 + ' data-rh="true" ' + i2 + ">" + w(o3, n4) + "</" + t2 + ">" : "<" + t2 + ' data-rh="true">' + w(o3, n4) + "</" + t2 + ">";
2078        })(e2, r4.title, r4.titleAttributes, n3);
2079      } };
2080    case "bodyAttributes":
2081    case "htmlAttributes":
2082      return { toComponent: function() {
2083        return L(r4);
2084      }, toString: function() {
2085        return x(r4);
2086      } };
2087    default:
2088      return { toComponent: function() {
2089        return j(e2, r4);
2090      }, toString: function() {
2091        return (function(t2, e3, r5) {
2092          return e3.reduce(function(e4, n4) {
2093            var i2 = Object.keys(n4).filter(function(t3) {
2094              return !(t3 === "innerHTML" || t3 === "cssText");
2095            }).reduce(function(t3, e5) {
2096              var i3 = n4[e5] === void 0 ? e5 : e5 + '="' + w(n4[e5], r5) + '"';
2097              return t3 ? t3 + " " + i3 : i3;
2098            }, ""), o3 = n4.innerHTML || n4.cssText || "", a2 = P2.indexOf(t2) === -1;
2099            return e4 + "<" + t2 + ' data-rh="true" ' + i2 + (a2 ? "/>" : ">" + o3 + "</" + t2 + ">");
2100          }, "");
2101        })(e2, r4, n3);
2102      } };
2103  }
2104}, k = function(t2) {
2105  var e2 = t2.baseTag, r4 = t2.bodyAttributes, n3 = t2.encode, i2 = t2.htmlAttributes, o3 = t2.noscriptTags, a2 = t2.styleTags, s2 = t2.title, c2 = s2 === void 0 ? "" : s2, u2 = t2.titleAttributes, h2 = t2.linkTags, m2 = t2.metaTags, y2 = t2.scriptTags, T3 = { toComponent: function() {
2106  }, toString: function() {
2107    return "";
2108  } };
2109  if (t2.prioritizeSeoTags) {
2110    var g2 = (function(t3) {
2111      var e3 = t3.linkTags, r5 = t3.scriptTags, n4 = t3.encode, i3 = E(t3.metaTags, d), o4 = E(e3, p), a3 = E(r5, f);
2112      return { priorityMethods: { toComponent: function() {
2113        return [].concat(j(l.META, i3.priority), j(l.LINK, o4.priority), j(l.SCRIPT, a3.priority));
2114      }, toString: function() {
2115        return M(l.META, i3.priority, n4) + " " + M(l.LINK, o4.priority, n4) + " " + M(l.SCRIPT, a3.priority, n4);
2116      } }, metaTags: i3.default, linkTags: o4.default, scriptTags: a3.default };
2117    })(t2);
2118    T3 = g2.priorityMethods, h2 = g2.linkTags, m2 = g2.metaTags, y2 = g2.scriptTags;
2119  }
2120  return { priority: T3, base: M(l.BASE, e2, n3), bodyAttributes: M("bodyAttributes", r4, n3), htmlAttributes: M("htmlAttributes", i2, n3), link: M(l.LINK, h2, n3), meta: M(l.META, m2, n3), noscript: M(l.NOSCRIPT, o3, n3), script: M(l.SCRIPT, y2, n3), style: M(l.STYLE, a2, n3), title: M(l.TITLE, { title: c2, titleAttributes: u2 }, n3) };
2121}, H = [], N = function(t2, e2) {
2122  var r4 = this;
2123  e2 === void 0 && (e2 = typeof document < "u"), this.instances = [], this.value = { setHelmet: function(t3) {
2124    r4.context.helmet = t3;
2125  }, helmetInstances: { get: function() {
2126    return r4.canUseDOM ? H : r4.instances;
2127  }, add: function(t3) {
2128    (r4.canUseDOM ? H : r4.instances).push(t3);
2129  }, remove: function(t3) {
2130    var e3 = (r4.canUseDOM ? H : r4.instances).indexOf(t3);
2131    (r4.canUseDOM ? H : r4.instances).splice(e3, 1);
2132  } } }, this.context = t2, this.canUseDOM = e2, e2 || (t2.helmet = k({ baseTag: [], bodyAttributes: {}, encodeSpecialCharacters: !0, htmlAttributes: {}, linkTags: [], metaTags: [], noscriptTags: [], scriptTags: [], styleTags: [], title: "", titleAttributes: {} }));
2133}, R = react_default.createContext({}), D = import_prop_types.default.shape({ setHelmet: import_prop_types.default.func, helmetInstances: import_prop_types.default.shape({ get: import_prop_types.default.func, add: import_prop_types.default.func, remove: import_prop_types.default.func }) }), U = typeof document < "u", q = (function(e2) {
2134  function r4(t2) {
2135    var n3;
2136    return (n3 = e2.call(this, t2) || this).helmetData = new N(n3.props.context, r4.canUseDOM), n3;
2137  }
2138  return s(r4, e2), r4.prototype.render = function() {
2139    return react_default.createElement(R.Provider, { value: this.helmetData.value }, this.props.children);
2140  }, r4;
2141})(Component);
2142q.canUseDOM = U, q.propTypes = { context: import_prop_types.default.shape({ helmet: import_prop_types.default.shape() }), children: import_prop_types.default.node.isRequired }, q.defaultProps = { context: {} }, q.displayName = "HelmetProvider";
2143var Y = function(t2, e2) {
2144  var r4, n3 = document.head || document.querySelector(l.HEAD), i2 = n3.querySelectorAll(t2 + "[data-rh]"), o3 = [].slice.call(i2), a2 = [];
2145  return e2 && e2.length && e2.forEach(function(e3) {
2146    var n4 = document.createElement(t2);
2147    for (var i3 in e3) Object.prototype.hasOwnProperty.call(e3, i3) && (i3 === "innerHTML" ? n4.innerHTML = e3.innerHTML : i3 === "cssText" ? n4.styleSheet ? n4.styleSheet.cssText = e3.cssText : n4.appendChild(document.createTextNode(e3.cssText)) : n4.setAttribute(i3, e3[i3] === void 0 ? "" : e3[i3]));
2148    n4.setAttribute("data-rh", "true"), o3.some(function(t3, e4) {
2149      return r4 = e4, n4.isEqualNode(t3);
2150    }) ? o3.splice(r4, 1) : a2.push(n4);
2151  }), o3.forEach(function(t3) {
2152    return t3.parentNode.removeChild(t3);
2153  }), a2.forEach(function(t3) {
2154    return n3.appendChild(t3);
2155  }), { oldTags: o3, newTags: a2 };
2156}, B = function(t2, e2) {
2157  var r4 = document.getElementsByTagName(t2)[0];
2158  if (r4) {
2159    for (var n3 = r4.getAttribute("data-rh"), i2 = n3 ? n3.split(",") : [], o3 = [].concat(i2), a2 = Object.keys(e2), s2 = 0; s2 < a2.length; s2 += 1) {
2160      var c2 = a2[s2], u2 = e2[c2] || "";
2161      r4.getAttribute(c2) !== u2 && r4.setAttribute(c2, u2), i2.indexOf(c2) === -1 && i2.push(c2);
2162      var l3 = o3.indexOf(c2);
2163      l3 !== -1 && o3.splice(l3, 1);
2164    }
2165    for (var p2 = o3.length - 1; p2 >= 0; p2 -= 1) r4.removeAttribute(o3[p2]);
2166    i2.length === o3.length ? r4.removeAttribute("data-rh") : r4.getAttribute("data-rh") !== a2.join(",") && r4.setAttribute("data-rh", a2.join(","));
2167  }
2168}, K = function(t2, e2) {
2169  var r4 = t2.baseTag, n3 = t2.htmlAttributes, i2 = t2.linkTags, o3 = t2.metaTags, a2 = t2.noscriptTags, s2 = t2.onChangeClientState, c2 = t2.scriptTags, u2 = t2.styleTags, p2 = t2.title, f2 = t2.titleAttributes;
2170  B(l.BODY, t2.bodyAttributes), B(l.HTML, n3), (function(t3, e3) {
2171    t3 !== void 0 && document.title !== t3 && (document.title = S(t3)), B(l.TITLE, e3);
2172  })(p2, f2);
2173  var d2 = { baseTag: Y(l.BASE, r4), linkTags: Y(l.LINK, i2), metaTags: Y(l.META, o3), noscriptTags: Y(l.NOSCRIPT, a2), scriptTags: Y(l.SCRIPT, c2), styleTags: Y(l.STYLE, u2) }, h2 = {}, m2 = {};
2174  Object.keys(d2).forEach(function(t3) {
2175    var e3 = d2[t3], r5 = e3.newTags, n4 = e3.oldTags;
2176    r5.length && (h2[t3] = r5), n4.length && (m2[t3] = d2[t3].oldTags);
2177  }), e2 && e2(), s2(t2, h2, m2);
2178}, _ = null, z = (function(t2) {
2179  function e2() {
2180    for (var e3, r5 = arguments.length, n3 = new Array(r5), i2 = 0; i2 < r5; i2++) n3[i2] = arguments[i2];
2181    return (e3 = t2.call.apply(t2, [this].concat(n3)) || this).rendered = !1, e3;
2182  }
2183  s(e2, t2);
2184  var r4 = e2.prototype;
2185  return r4.shouldComponentUpdate = function(t3) {
2186    return !(0, import_shallowequal.default)(t3, this.props);
2187  }, r4.componentDidUpdate = function() {
2188    this.emitChange();
2189  }, r4.componentWillUnmount = function() {
2190    this.props.context.helmetInstances.remove(this), this.emitChange();
2191  }, r4.emitChange = function() {
2192    var t3, e3, r5 = this.props.context, n3 = r5.setHelmet, i2 = null, o3 = (t3 = r5.helmetInstances.get().map(function(t4) {
2193      var e4 = a({}, t4.props);
2194      return delete e4.context, e4;
2195    }), { baseTag: A2(["href"], t3), bodyAttributes: v("bodyAttributes", t3), defer: T(t3, "defer"), encode: T(t3, "encodeSpecialCharacters"), htmlAttributes: v("htmlAttributes", t3), linkTags: C(l.LINK, ["rel", "href"], t3), metaTags: C(l.META, ["name", "charset", "http-equiv", "property", "itemprop"], t3), noscriptTags: C(l.NOSCRIPT, ["innerHTML"], t3), onChangeClientState: b(t3), scriptTags: C(l.SCRIPT, ["src", "innerHTML"], t3), styleTags: C(l.STYLE, ["cssText"], t3), title: g(t3), titleAttributes: v("titleAttributes", t3), prioritizeSeoTags: O(t3, "prioritizeSeoTags") });
2196    q.canUseDOM ? (e3 = o3, _ && cancelAnimationFrame(_), e3.defer ? _ = requestAnimationFrame(function() {
2197      K(e3, function() {
2198        _ = null;
2199      });
2200    }) : (K(e3), _ = null)) : k && (i2 = k(o3)), n3(i2);
2201  }, r4.init = function() {
2202    this.rendered || (this.rendered = !0, this.props.context.helmetInstances.add(this), this.emitChange());
2203  }, r4.render = function() {
2204    return this.init(), null;
2205  }, e2;
2206})(Component);
2207z.propTypes = { context: D.isRequired }, z.displayName = "HelmetDispatcher";
2208var F = ["children"], G = ["children"], W = (function(e2) {
2209  function r4() {
2210    return e2.apply(this, arguments) || this;
2211  }
2212  s(r4, e2);
2213  var o3 = r4.prototype;
2214  return o3.shouldComponentUpdate = function(t2) {
2215    return !(0, import_react_fast_compare.default)(I(this.props, "helmetData"), I(t2, "helmetData"));
2216  }, o3.mapNestedChildrenToProps = function(t2, e3) {
2217    if (!e3) return null;
2218    switch (t2.type) {
2219      case l.SCRIPT:
2220      case l.NOSCRIPT:
2221        return { innerHTML: e3 };
2222      case l.STYLE:
2223        return { cssText: e3 };
2224      default:
2225        throw new Error("<" + t2.type + " /> elements are self-closing and can not contain children. Refer to our API for more information.");
2226    }
2227  }, o3.flattenArrayTypeChildren = function(t2) {
2228    var e3, r5 = t2.child, n3 = t2.arrayTypeChildren;
2229    return a({}, n3, ((e3 = {})[r5.type] = [].concat(n3[r5.type] || [], [a({}, t2.newChildProps, this.mapNestedChildrenToProps(r5, t2.nestedChildren))]), e3));
2230  }, o3.mapObjectTypeChildren = function(t2) {
2231    var e3, r5, n3 = t2.child, i2 = t2.newProps, o4 = t2.newChildProps, s2 = t2.nestedChildren;
2232    switch (n3.type) {
2233      case l.TITLE:
2234        return a({}, i2, ((e3 = {})[n3.type] = s2, e3.titleAttributes = a({}, o4), e3));
2235      case l.BODY:
2236        return a({}, i2, { bodyAttributes: a({}, o4) });
2237      case l.HTML:
2238        return a({}, i2, { htmlAttributes: a({}, o4) });
2239      default:
2240        return a({}, i2, ((r5 = {})[n3.type] = a({}, o4), r5));
2241    }
2242  }, o3.mapArrayTypeChildrenToProps = function(t2, e3) {
2243    var r5 = a({}, e3);
2244    return Object.keys(t2).forEach(function(e4) {
2245      var n3;
2246      r5 = a({}, r5, ((n3 = {})[e4] = t2[e4], n3));
2247    }), r5;
2248  }, o3.warnOnInvalidChildren = function(t2, e3) {
2249    return (0, import_invariant.default)(h.some(function(e4) {
2250      return t2.type === e4;
2251    }), typeof t2.type == "function" ? "You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information." : "Only elements types " + h.join(", ") + " are allowed. Helmet does not support rendering <" + t2.type + "> elements. Refer to our API for more information."), (0, import_invariant.default)(!e3 || typeof e3 == "string" || Array.isArray(e3) && !e3.some(function(t3) {
2252      return typeof t3 != "string";
2253    }), "Helmet expects a string as a child of <" + t2.type + ">. Did you forget to wrap your children in braces? ( <" + t2.type + ">{``}</" + t2.type + "> ) Refer to our API for more information."), !0;
2254  }, o3.mapChildrenToProps = function(e3, r5) {
2255    var n3 = this, i2 = {};
2256    return react_default.Children.forEach(e3, function(t2) {
2257      if (t2 && t2.props) {
2258        var e4 = t2.props, o4 = e4.children, a2 = u(e4, F), s2 = Object.keys(a2).reduce(function(t3, e5) {
2259          return t3[y[e5] || e5] = a2[e5], t3;
2260        }, {}), c2 = t2.type;
2261        switch (typeof c2 == "symbol" ? c2 = c2.toString() : n3.warnOnInvalidChildren(t2, o4), c2) {
2262          case l.FRAGMENT:
2263            r5 = n3.mapChildrenToProps(o4, r5);
2264            break;
2265          case l.LINK:
2266          case l.META:
2267          case l.NOSCRIPT:
2268          case l.SCRIPT:
2269          case l.STYLE:
2270            i2 = n3.flattenArrayTypeChildren({ child: t2, arrayTypeChildren: i2, newChildProps: s2, nestedChildren: o4 });
2271            break;
2272          default:
2273            r5 = n3.mapObjectTypeChildren({ child: t2, newProps: r5, newChildProps: s2, nestedChildren: o4 });
2274        }
2275      }
2276    }), this.mapArrayTypeChildrenToProps(i2, r5);
2277  }, o3.render = function() {
2278    var e3 = this.props, r5 = e3.children, n3 = u(e3, G), i2 = a({}, n3), o4 = n3.helmetData;
2279    return r5 && (i2 = this.mapChildrenToProps(r5, i2)), !o4 || o4 instanceof N || (o4 = new N(o4.context, o4.instances)), o4 ? react_default.createElement(z, a({}, i2, { context: o4.value, helmetData: void 0 })) : react_default.createElement(R.Consumer, null, function(e4) {
2280      return react_default.createElement(z, a({}, i2, { context: e4 }));
2281    });
2282  }, r4;
2283})(Component);
2284W.propTypes = { base: import_prop_types.default.object, bodyAttributes: import_prop_types.default.object, children: import_prop_types.default.oneOfType([import_prop_types.default.arrayOf(import_prop_types.default.node), import_prop_types.default.node]), defaultTitle: import_prop_types.default.string, defer: import_prop_types.default.bool, encodeSpecialCharacters: import_prop_types.default.bool, htmlAttributes: import_prop_types.default.object, link: import_prop_types.default.arrayOf(import_prop_types.default.object), meta: import_prop_types.default.arrayOf(import_prop_types.default.object), noscript: import_prop_types.default.arrayOf(import_prop_types.default.object), onChangeClientState: import_prop_types.default.func, script: import_prop_types.default.arrayOf(import_prop_types.default.object), style: import_prop_types.default.arrayOf(import_prop_types.default.object), title: import_prop_types.default.string, titleAttributes: import_prop_types.default.object, titleTemplate: import_prop_types.default.string, prioritizeSeoTags: import_prop_types.default.bool, helmetData: import_prop_types.default.object }, W.defaultProps = { defer: !0, encodeSpecialCharacters: !0, prioritizeSeoTags: !1 }, W.displayName = "Helmet";
2285
vendor: 119 bytes, lines 2286-2291
2286// src/manager/App.tsx
2287init_react();
2288
2289// src/manager/components/error-boundary/ManagerErrorBoundary.tsx
2290init_react();
2291
vendor: 380 bytes, lines 2292-2302
2292// ../../node_modules/@babel/runtime/helpers/esm/extends.js
2293function _extends() {
2294  return _extends = Object.assign ? Object.assign.bind() : function(n3) {
2295    for (var e2 = 1; e2 < arguments.length; e2++) {
2296      var t2 = arguments[e2];
2297      for (var r4 in t2) ({}).hasOwnProperty.call(t2, r4) && (n3[r4] = t2[r4]);
2298    }
2299    return n3;
2300  }, _extends.apply(null, arguments);
2301}
2302
vendor: 236 bytes, lines 2303-2308
2303// ../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
2304function _assertThisInitialized(e2) {
2305  if (e2 === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2306  return e2;
2307}
2308
vendor: 270 bytes, lines 2309-2315
2309// ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
2310function _setPrototypeOf(t2, e2) {
2311  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
2312    return t3.__proto__ = e3, t3;
2313  }, _setPrototypeOf(t2, e2);
2314}
2315
vendor: 205 bytes, lines 2316-2320
2316// ../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
2317function _inheritsLoose(t2, o3) {
2318  t2.prototype = Object.create(o3.prototype), t2.prototype.constructor = t2, _setPrototypeOf(t2, o3);
2319}
2320
vendor: 278 bytes, lines 2321-2327
2321// ../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
2322function _getPrototypeOf(t2) {
2323  return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
2324    return t3.__proto__ || Object.getPrototypeOf(t3);
2325  }, _getPrototypeOf(t2);
2326}
2327
vendor: 236 bytes, lines 2328-2336
2328// ../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
2329function _isNativeFunction(t2) {
2330  try {
2331    return Function.toString.call(t2).indexOf("[native code]") !== -1;
2332  } catch {
2333    return typeof t2 == "function";
2334  }
2335}
2336
vendor: 317 bytes, lines 2337-2348
2337// ../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
2338function _isNativeReflectConstruct() {
2339  try {
2340    var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
2341    }));
2342  } catch {
2343  }
2344  return (_isNativeReflectConstruct = function() {
2345    return !!t2;
2346  })();
2347}
2348
vendor: 323 bytes, lines 2349-2357
2349// ../../node_modules/@babel/runtime/helpers/esm/construct.js
2350function _construct(t2, e2, r4) {
2351  if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
2352  var o3 = [null];
2353  o3.push.apply(o3, e2);
2354  var p2 = new (t2.bind.apply(t2, o3))();
2355  return r4 && _setPrototypeOf(p2, r4.prototype), p2;
2356}
2357
vendor: 846 bytes, lines 2358-2381
2358// ../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
2359function _wrapNativeSuper(t2) {
2360  var r4 = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
2361  return _wrapNativeSuper = function(t3) {
2362    if (t3 === null || !_isNativeFunction(t3)) return t3;
2363    if (typeof t3 != "function") throw new TypeError("Super expression must either be null or a function");
2364    if (r4 !== void 0) {
2365      if (r4.has(t3)) return r4.get(t3);
2366      r4.set(t3, Wrapper9);
2367    }
2368    function Wrapper9() {
2369      return _construct(t3, arguments, _getPrototypeOf(this).constructor);
2370    }
2371    return Wrapper9.prototype = Object.create(t3.prototype, {
2372      constructor: {
2373        value: Wrapper9,
2374        enumerable: !1,
2375        writable: !0,
2376        configurable: !0
2377      }
2378    }), _setPrototypeOf(Wrapper9, t3);
2379  }, _wrapNativeSuper(t2);
2380}
2381
vendor: 20,617 bytes, lines 2382-2887
2382// ../../node_modules/polished/dist/polished.esm.js
2383var PolishedError = (function(_Error) {
2384  _inheritsLoose(PolishedError2, _Error);
2385  function PolishedError2(code) {
2386    var _this;
2387    if (1)
2388      _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this;
2389    else
2390      for (var _len2, args, _key2; _key2 < _len2; _key2++)
2391        ;
2392    return _assertThisInitialized(_this);
2393  }
2394  return PolishedError2;
2395})(_wrapNativeSuper(Error));
2396function endsWith(string, suffix) {
2397  return string.substr(-suffix.length) === suffix;
2398}
2399var cssRegex$1 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
2400function stripUnit(value) {
2401  if (typeof value != "string") return value;
2402  var matchedValue = value.match(cssRegex$1);
2403  return matchedValue ? parseFloat(value) : value;
2404}
2405var pxtoFactory = function(to) {
2406  return function(pxval, base) {
2407    base === void 0 && (base = "16px");
2408    var newPxval = pxval, newBase = base;
2409    if (typeof pxval == "string") {
2410      if (!endsWith(pxval, "px"))
2411        throw new PolishedError(69, to, pxval);
2412      newPxval = stripUnit(pxval);
2413    }
2414    if (typeof base == "string") {
2415      if (!endsWith(base, "px"))
2416        throw new PolishedError(70, to, base);
2417      newBase = stripUnit(base);
2418    }
2419    if (typeof newPxval == "string")
2420      throw new PolishedError(71, pxval, to);
2421    if (typeof newBase == "string")
2422      throw new PolishedError(72, base, to);
2423    return "" + newPxval / newBase + to;
2424  };
2425}, pixelsto = pxtoFactory, em = pixelsto("em");
2426var rem = pixelsto("rem");
2427function colorToInt(color2) {
2428  return Math.round(color2 * 255);
2429}
2430function convertToInt(red, green, blue) {
2431  return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
2432}
2433function hslToRgb(hue, saturation, lightness, convert2) {
2434  if (convert2 === void 0 && (convert2 = convertToInt), saturation === 0)
2435    return convert2(lightness, lightness, lightness);
2436  var huePrime = (hue % 360 + 360) % 360 / 60, chroma = (1 - Math.abs(2 * lightness - 1)) * saturation, secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1)), red = 0, green = 0, blue = 0;
2437  huePrime >= 0 && huePrime < 1 ? (red = chroma, green = secondComponent) : huePrime >= 1 && huePrime < 2 ? (red = secondComponent, green = chroma) : huePrime >= 2 && huePrime < 3 ? (green = chroma, blue = secondComponent) : huePrime >= 3 && huePrime < 4 ? (green = secondComponent, blue = chroma) : huePrime >= 4 && huePrime < 5 ? (red = secondComponent, blue = chroma) : huePrime >= 5 && huePrime < 6 && (red = chroma, blue = secondComponent);
2438  var lightnessModification = lightness - chroma / 2, finalRed = red + lightnessModification, finalGreen = green + lightnessModification, finalBlue = blue + lightnessModification;
2439  return convert2(finalRed, finalGreen, finalBlue);
2440}
2441var namedColorMap = {
2442  aliceblue: "f0f8ff",
2443  antiquewhite: "faebd7",
2444  aqua: "00ffff",
2445  aquamarine: "7fffd4",
2446  azure: "f0ffff",
2447  beige: "f5f5dc",
2448  bisque: "ffe4c4",
2449  black: "000",
2450  blanchedalmond: "ffebcd",
2451  blue: "0000ff",
2452  blueviolet: "8a2be2",
2453  brown: "a52a2a",
2454  burlywood: "deb887",
2455  cadetblue: "5f9ea0",
2456  chartreuse: "7fff00",
2457  chocolate: "d2691e",
2458  coral: "ff7f50",
2459  cornflowerblue: "6495ed",
2460  cornsilk: "fff8dc",
2461  crimson: "dc143c",
2462  cyan: "00ffff",
2463  darkblue: "00008b",
2464  darkcyan: "008b8b",
2465  darkgoldenrod: "b8860b",
2466  darkgray: "a9a9a9",
2467  darkgreen: "006400",
2468  darkgrey: "a9a9a9",
2469  darkkhaki: "bdb76b",
2470  darkmagenta: "8b008b",
2471  darkolivegreen: "556b2f",
2472  darkorange: "ff8c00",
2473  darkorchid: "9932cc",
2474  darkred: "8b0000",
2475  darksalmon: "e9967a",
2476  darkseagreen: "8fbc8f",
2477  darkslateblue: "483d8b",
2478  darkslategray: "2f4f4f",
2479  darkslategrey: "2f4f4f",
2480  darkturquoise: "00ced1",
2481  darkviolet: "9400d3",
2482  deeppink: "ff1493",
2483  deepskyblue: "00bfff",
2484  dimgray: "696969",
2485  dimgrey: "696969",
2486  dodgerblue: "1e90ff",
2487  firebrick: "b22222",
2488  floralwhite: "fffaf0",
2489  forestgreen: "228b22",
2490  fuchsia: "ff00ff",
2491  gainsboro: "dcdcdc",
2492  ghostwhite: "f8f8ff",
2493  gold: "ffd700",
2494  goldenrod: "daa520",
2495  gray: "808080",
2496  green: "008000",
2497  greenyellow: "adff2f",
2498  grey: "808080",
2499  honeydew: "f0fff0",
2500  hotpink: "ff69b4",
2501  indianred: "cd5c5c",
2502  indigo: "4b0082",
2503  ivory: "fffff0",
2504  khaki: "f0e68c",
2505  lavender: "e6e6fa",
2506  lavenderblush: "fff0f5",
2507  lawngreen: "7cfc00",
2508  lemonchiffon: "fffacd",
2509  lightblue: "add8e6",
2510  lightcoral: "f08080",
2511  lightcyan: "e0ffff",
2512  lightgoldenrodyellow: "fafad2",
2513  lightgray: "d3d3d3",
2514  lightgreen: "90ee90",
2515  lightgrey: "d3d3d3",
2516  lightpink: "ffb6c1",
2517  lightsalmon: "ffa07a",
2518  lightseagreen: "20b2aa",
2519  lightskyblue: "87cefa",
2520  lightslategray: "789",
2521  lightslategrey: "789",
2522  lightsteelblue: "b0c4de",
2523  lightyellow: "ffffe0",
2524  lime: "0f0",
2525  limegreen: "32cd32",
2526  linen: "faf0e6",
2527  magenta: "f0f",
2528  maroon: "800000",
2529  mediumaquamarine: "66cdaa",
2530  mediumblue: "0000cd",
2531  mediumorchid: "ba55d3",
2532  mediumpurple: "9370db",
2533  mediumseagreen: "3cb371",
2534  mediumslateblue: "7b68ee",
2535  mediumspringgreen: "00fa9a",
2536  mediumturquoise: "48d1cc",
2537  mediumvioletred: "c71585",
2538  midnightblue: "191970",
2539  mintcream: "f5fffa",
2540  mistyrose: "ffe4e1",
2541  moccasin: "ffe4b5",
2542  navajowhite: "ffdead",
2543  navy: "000080",
2544  oldlace: "fdf5e6",
2545  olive: "808000",
2546  olivedrab: "6b8e23",
2547  orange: "ffa500",
2548  orangered: "ff4500",
2549  orchid: "da70d6",
2550  palegoldenrod: "eee8aa",
2551  palegreen: "98fb98",
2552  paleturquoise: "afeeee",
2553  palevioletred: "db7093",
2554  papayawhip: "ffefd5",
2555  peachpuff: "ffdab9",
2556  peru: "cd853f",
2557  pink: "ffc0cb",
2558  plum: "dda0dd",
2559  powderblue: "b0e0e6",
2560  purple: "800080",
2561  rebeccapurple: "639",
2562  red: "f00",
2563  rosybrown: "bc8f8f",
2564  royalblue: "4169e1",
2565  saddlebrown: "8b4513",
2566  salmon: "fa8072",
2567  sandybrown: "f4a460",
2568  seagreen: "2e8b57",
2569  seashell: "fff5ee",
2570  sienna: "a0522d",
2571  silver: "c0c0c0",
2572  skyblue: "87ceeb",
2573  slateblue: "6a5acd",
2574  slategray: "708090",
2575  slategrey: "708090",
2576  snow: "fffafa",
2577  springgreen: "00ff7f",
2578  steelblue: "4682b4",
2579  tan: "d2b48c",
2580  teal: "008080",
2581  thistle: "d8bfd8",
2582  tomato: "ff6347",
2583  turquoise: "40e0d0",
2584  violet: "ee82ee",
2585  wheat: "f5deb3",
2586  white: "fff",
2587  whitesmoke: "f5f5f5",
2588  yellow: "ff0",
2589  yellowgreen: "9acd32"
2590};
2591function nameToHex(color2) {
2592  if (typeof color2 != "string") return color2;
2593  var normalizedColorName = color2.toLowerCase();
2594  return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color2;
2595}
2596var hexRegex = /^#[a-fA-F0-9]{6}$/, hexRgbaRegex = /^#[a-fA-F0-9]{8}$/, reducedHexRegex = /^#[a-fA-F0-9]{3}$/, reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/, rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i, rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i, hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
2597function parseToRgb(color2) {
2598  if (typeof color2 != "string")
2599    throw new PolishedError(3);
2600  var normalizedColor = nameToHex(color2);
2601  if (normalizedColor.match(hexRegex))
2602    return {
2603      red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
2604      green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
2605      blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
2606    };
2607  if (normalizedColor.match(hexRgbaRegex)) {
2608    var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
2609    return {
2610      red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
2611      green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
2612      blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
2613      alpha
2614    };
2615  }
2616  if (normalizedColor.match(reducedHexRegex))
2617    return {
2618      red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
2619      green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
2620      blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
2621    };
2622  if (normalizedColor.match(reducedRgbaHexRegex)) {
2623    var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
2624    return {
2625      red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
2626      green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
2627      blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
2628      alpha: _alpha
2629    };
2630  }
2631  var rgbMatched = rgbRegex.exec(normalizedColor);
2632  if (rgbMatched)
2633    return {
2634      red: parseInt("" + rgbMatched[1], 10),
2635      green: parseInt("" + rgbMatched[2], 10),
2636      blue: parseInt("" + rgbMatched[3], 10)
2637    };
2638  var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
2639  if (rgbaMatched)
2640    return {
2641      red: parseInt("" + rgbaMatched[1], 10),
2642      green: parseInt("" + rgbaMatched[2], 10),
2643      blue: parseInt("" + rgbaMatched[3], 10),
2644      alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
2645    };
2646  var hslMatched = hslRegex.exec(normalizedColor);
2647  if (hslMatched) {
2648    var hue = parseInt("" + hslMatched[1], 10), saturation = parseInt("" + hslMatched[2], 10) / 100, lightness = parseInt("" + hslMatched[3], 10) / 100, rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")", hslRgbMatched = rgbRegex.exec(rgbColorString);
2649    if (!hslRgbMatched)
2650      throw new PolishedError(4, normalizedColor, rgbColorString);
2651    return {
2652      red: parseInt("" + hslRgbMatched[1], 10),
2653      green: parseInt("" + hslRgbMatched[2], 10),
2654      blue: parseInt("" + hslRgbMatched[3], 10)
2655    };
2656  }
2657  var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
2658  if (hslaMatched) {
2659    var _hue = parseInt("" + hslaMatched[1], 10), _saturation = parseInt("" + hslaMatched[2], 10) / 100, _lightness = parseInt("" + hslaMatched[3], 10) / 100, _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")", _hslRgbMatched = rgbRegex.exec(_rgbColorString);
2660    if (!_hslRgbMatched)
2661      throw new PolishedError(4, normalizedColor, _rgbColorString);
2662    return {
2663      red: parseInt("" + _hslRgbMatched[1], 10),
2664      green: parseInt("" + _hslRgbMatched[2], 10),
2665      blue: parseInt("" + _hslRgbMatched[3], 10),
2666      alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
2667    };
2668  }
2669  throw new PolishedError(5);
2670}
2671function rgbToHsl(color2) {
2672  var red = color2.red / 255, green = color2.green / 255, blue = color2.blue / 255, max = Math.max(red, green, blue), min = Math.min(red, green, blue), lightness = (max + min) / 2;
2673  if (max === min)
2674    return color2.alpha !== void 0 ? {
2675      hue: 0,
2676      saturation: 0,
2677      lightness,
2678      alpha: color2.alpha
2679    } : {
2680      hue: 0,
2681      saturation: 0,
2682      lightness
2683    };
2684  var hue, delta = max - min, saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
2685  switch (max) {
2686    case red:
2687      hue = (green - blue) / delta + (green < blue ? 6 : 0);
2688      break;
2689    case green:
2690      hue = (blue - red) / delta + 2;
2691      break;
2692    default:
2693      hue = (red - green) / delta + 4;
2694      break;
2695  }
2696  return hue *= 60, color2.alpha !== void 0 ? {
2697    hue,
2698    saturation,
2699    lightness,
2700    alpha: color2.alpha
2701  } : {
2702    hue,
2703    saturation,
2704    lightness
2705  };
2706}
2707function parseToHsl(color2) {
2708  return rgbToHsl(parseToRgb(color2));
2709}
2710var reduceHexValue = function(value) {
2711  return value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6] ? "#" + value[1] + value[3] + value[5] : value;
2712}, reduceHexValue$1 = reduceHexValue;
2713function numberToHex(value) {
2714  var hex = value.toString(16);
2715  return hex.length === 1 ? "0" + hex : hex;
2716}
2717function colorToHex(color2) {
2718  return numberToHex(Math.round(color2 * 255));
2719}
2720function convertToHex(red, green, blue) {
2721  return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
2722}
2723function hslToHex(hue, saturation, lightness) {
2724  return hslToRgb(hue, saturation, lightness, convertToHex);
2725}
2726function hsl(value, saturation, lightness) {
2727  if (typeof value == "number" && typeof saturation == "number" && typeof lightness == "number")
2728    return hslToHex(value, saturation, lightness);
2729  if (typeof value == "object" && saturation === void 0 && lightness === void 0)
2730    return hslToHex(value.hue, value.saturation, value.lightness);
2731  throw new PolishedError(1);
2732}
2733function hsla(value, saturation, lightness, alpha) {
2734  if (typeof value == "number" && typeof saturation == "number" && typeof lightness == "number" && typeof alpha == "number")
2735    return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
2736  if (typeof value == "object" && saturation === void 0 && lightness === void 0 && alpha === void 0)
2737    return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
2738  throw new PolishedError(2);
2739}
2740function rgb(value, green, blue) {
2741  if (typeof value == "number" && typeof green == "number" && typeof blue == "number")
2742    return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
2743  if (typeof value == "object" && green === void 0 && blue === void 0)
2744    return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
2745  throw new PolishedError(6);
2746}
2747function rgba(firstValue, secondValue, thirdValue, fourthValue) {
2748  if (typeof firstValue == "string" && typeof secondValue == "number") {
2749    var rgbValue = parseToRgb(firstValue);
2750    return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
2751  } else {
2752    if (typeof firstValue == "number" && typeof secondValue == "number" && typeof thirdValue == "number" && typeof fourthValue == "number")
2753      return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
2754    if (typeof firstValue == "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0)
2755      return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
2756  }
2757  throw new PolishedError(7);
2758}
2759var isRgb = function(color2) {
2760  return typeof color2.red == "number" && typeof color2.green == "number" && typeof color2.blue == "number" && (typeof color2.alpha != "number" || typeof color2.alpha > "u");
2761}, isRgba = function(color2) {
2762  return typeof color2.red == "number" && typeof color2.green == "number" && typeof color2.blue == "number" && typeof color2.alpha == "number";
2763}, isHsl = function(color2) {
2764  return typeof color2.hue == "number" && typeof color2.saturation == "number" && typeof color2.lightness == "number" && (typeof color2.alpha != "number" || typeof color2.alpha > "u");
2765}, isHsla = function(color2) {
2766  return typeof color2.hue == "number" && typeof color2.saturation == "number" && typeof color2.lightness == "number" && typeof color2.alpha == "number";
2767};
2768function toColorString(color2) {
2769  if (typeof color2 != "object") throw new PolishedError(8);
2770  if (isRgba(color2)) return rgba(color2);
2771  if (isRgb(color2)) return rgb(color2);
2772  if (isHsla(color2)) return hsla(color2);
2773  if (isHsl(color2)) return hsl(color2);
2774  throw new PolishedError(8);
2775}
2776function curried(f2, length, acc) {
2777  return function() {
2778    var combined = acc.concat(Array.prototype.slice.call(arguments));
2779    return combined.length >= length ? f2.apply(this, combined) : curried(f2, length, combined);
2780  };
2781}
2782function curry(f2) {
2783  return curried(f2, f2.length, []);
2784}
2785function adjustHue(degree, color2) {
2786  if (color2 === "transparent") return color2;
2787  var hslColor = parseToHsl(color2);
2788  return toColorString(_extends({}, hslColor, {
2789    hue: hslColor.hue + parseFloat(degree)
2790  }));
2791}
2792var curriedAdjustHue = curry(adjustHue);
2793function guard(lowerBoundary, upperBoundary, value) {
2794  return Math.max(lowerBoundary, Math.min(upperBoundary, value));
2795}
2796function darken2(amount, color2) {
2797  if (color2 === "transparent") return color2;
2798  var hslColor = parseToHsl(color2);
2799  return toColorString(_extends({}, hslColor, {
2800    lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
2801  }));
2802}
2803var curriedDarken = curry(darken2), curriedDarken$1 = curriedDarken;
2804function desaturate(amount, color2) {
2805  if (color2 === "transparent") return color2;
2806  var hslColor = parseToHsl(color2);
2807  return toColorString(_extends({}, hslColor, {
2808    saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
2809  }));
2810}
2811var curriedDesaturate = curry(desaturate);
2812function lighten2(amount, color2) {
2813  if (color2 === "transparent") return color2;
2814  var hslColor = parseToHsl(color2);
2815  return toColorString(_extends({}, hslColor, {
2816    lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
2817  }));
2818}
2819var curriedLighten = curry(lighten2), curriedLighten$1 = curriedLighten;
2820function mix(weight, color2, otherColor) {
2821  if (color2 === "transparent") return otherColor;
2822  if (otherColor === "transparent") return color2;
2823  if (weight === 0) return otherColor;
2824  var parsedColor1 = parseToRgb(color2), color1 = _extends({}, parsedColor1, {
2825    alpha: typeof parsedColor1.alpha == "number" ? parsedColor1.alpha : 1
2826  }), parsedColor2 = parseToRgb(otherColor), color22 = _extends({}, parsedColor2, {
2827    alpha: typeof parsedColor2.alpha == "number" ? parsedColor2.alpha : 1
2828  }), alphaDelta = color1.alpha - color22.alpha, x2 = parseFloat(weight) * 2 - 1, y2 = x2 * alphaDelta === -1 ? x2 : x2 + alphaDelta, z2 = 1 + x2 * alphaDelta, weight1 = (y2 / z2 + 1) / 2, weight2 = 1 - weight1, mixedColor = {
2829    red: Math.floor(color1.red * weight1 + color22.red * weight2),
2830    green: Math.floor(color1.green * weight1 + color22.green * weight2),
2831    blue: Math.floor(color1.blue * weight1 + color22.blue * weight2),
2832    alpha: color1.alpha * parseFloat(weight) + color22.alpha * (1 - parseFloat(weight))
2833  };
2834  return rgba(mixedColor);
2835}
2836var curriedMix = curry(mix), mix$1 = curriedMix;
2837function opacify(amount, color2) {
2838  if (color2 === "transparent") return color2;
2839  var parsedColor = parseToRgb(color2), alpha = typeof parsedColor.alpha == "number" ? parsedColor.alpha : 1, colorWithAlpha = _extends({}, parsedColor, {
2840    alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
2841  });
2842  return rgba(colorWithAlpha);
2843}
2844var curriedOpacify = curry(opacify);
2845function saturate(amount, color2) {
2846  if (color2 === "transparent") return color2;
2847  var hslColor = parseToHsl(color2);
2848  return toColorString(_extends({}, hslColor, {
2849    saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
2850  }));
2851}
2852var curriedSaturate = curry(saturate);
2853function setHue(hue, color2) {
2854  return color2 === "transparent" ? color2 : toColorString(_extends({}, parseToHsl(color2), {
2855    hue: parseFloat(hue)
2856  }));
2857}
2858var curriedSetHue = curry(setHue);
2859function setLightness(lightness, color2) {
2860  return color2 === "transparent" ? color2 : toColorString(_extends({}, parseToHsl(color2), {
2861    lightness: parseFloat(lightness)
2862  }));
2863}
2864var curriedSetLightness = curry(setLightness);
2865function setSaturation(saturation, color2) {
2866  return color2 === "transparent" ? color2 : toColorString(_extends({}, parseToHsl(color2), {
2867    saturation: parseFloat(saturation)
2868  }));
2869}
2870var curriedSetSaturation = curry(setSaturation);
2871function shade(percentage, color2) {
2872  return color2 === "transparent" ? color2 : mix$1(parseFloat(percentage), "rgb(0, 0, 0)", color2);
2873}
2874var curriedShade = curry(shade);
2875function tint(percentage, color2) {
2876  return color2 === "transparent" ? color2 : mix$1(parseFloat(percentage), "rgb(255, 255, 255)", color2);
2877}
2878var curriedTint = curry(tint);
2879function transparentize(amount, color2) {
2880  if (color2 === "transparent") return color2;
2881  var parsedColor = parseToRgb(color2), alpha = typeof parsedColor.alpha == "number" ? parsedColor.alpha : 1, colorWithAlpha = _extends({}, parsedColor, {
2882    alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
2883  });
2884  return rgba(colorWithAlpha);
2885}
2886var curriedTransparentize = curry(transparentize), curriedTransparentize$1 = curriedTransparentize;
2887
vendor: 6,015 bytes, lines 2888-3038
2888// src/manager/components/error-boundary/ManagerErrorBoundary.tsx
2889var Container = styled.div(({ theme }) => ({
2890  display: "flex",
2891  justifyContent: "center",
2892  alignItems: "center",
2893  width: "100vw",
2894  height: "100vh",
2895  backgroundColor: theme.background.app,
2896  color: theme.color.defaultText,
2897  fontFamily: theme.typography.fonts.base
2898})), Content = styled.div(({ theme }) => ({
2899  display: "flex",
2900  flexDirection: "column",
2901  justifyContent: "space-between",
2902  width: "80%",
2903  height: "80%",
2904  padding: 20,
2905  gap: 20,
2906  backgroundColor: theme.background.content,
2907  borderRadius: theme.appBorderRadius,
2908  border: `1px solid ${theme.color.negative}`,
2909  boxShadow: "0 0 64px rgba(0, 0, 0, 0.1)",
2910  overflow: "auto"
2911})), Info = styled.div(({ theme }) => ({
2912  display: "flex",
2913  flexDirection: "column",
2914  alignItems: "start",
2915  gap: 15
2916})), Heading = styled.h1(({ theme }) => ({
2917  display: "flex",
2918  alignItems: "center",
2919  margin: 0,
2920  gap: 10,
2921  fontSize: theme.typography.size.s2,
2922  fontWeight: theme.typography.weight.bold,
2923  color: theme.color.defaultText
2924})), SubHeading = styled.p(({ theme }) => ({
2925  fontSize: theme.typography.size.s2,
2926  color: theme.textMutedColor,
2927  margin: 0,
2928  lineHeight: 1.4,
2929  textWrap: "balance"
2930})), ErrorWrapper = styled.div(({ theme }) => ({
2931  display: "flex",
2932  flexDirection: "column-reverse",
2933  width: "100%",
2934  flex: "0 0 auto",
2935  border: `1px solid ${theme.appBorderColor}`,
2936  borderRadius: theme.appBorderRadius,
2937  pre: {
2938    borderRadius: 0
2939  }
2940})), CollapseToggle = styled.div(({ theme }) => ({
2941  flex: "0 0 auto",
2942  display: "flex",
2943  alignItems: "center",
2944  gap: 10,
2945  height: 40,
2946  width: "100%",
2947  padding: "0 10px",
2948  cursor: "pointer",
2949  fontSize: theme.typography.size.s2,
2950  fontWeight: theme.typography.weight.bold,
2951  color: theme.color.defaultText,
2952  userSelect: "none",
2953  "&:hover": {
2954    backgroundColor: theme.base === "light" ? "rgba(0, 0, 0, 0.02)" : "rgba(255, 255, 255, 0.03)"
2955  },
2956  svg: {
2957    color: theme.textMutedColor
2958  }
2959})), ErrorMessage = styled.pre(({ theme }) => ({
2960  order: 1,
2961  padding: "11px 15px",
2962  margin: 0,
2963  fontSize: theme.typography.size.s1,
2964  color: theme.color.negativeText,
2965  backgroundColor: curriedTransparentize$1(theme.base === "light" ? 0.95 : 0.9, theme.color.negative),
2966  borderBottom: `1px solid ${theme.appBorderColor}`,
2967  whiteSpace: "pre-wrap",
2968  wordBreak: "break-word",
2969  fontFamily: theme.typography.fonts.mono,
2970  lineHeight: "18px"
2971})), ErrorStack = styled.pre(({ theme }) => ({
2972  padding: 15,
2973  margin: 0,
2974  fontSize: theme.typography.size.s1,
2975  color: theme.textMutedColor,
2976  borderBottom: `1px solid ${theme.appBorderColor}`,
2977  borderRadius: 0,
2978  whiteSpace: "pre-wrap",
2979  wordBreak: "break-word",
2980  fontFamily: theme.typography.fonts.mono
2981})), ErrorFallback = ({ error, errorInfo }) => react_default.createElement(Container, { "data-testid": "manager-error-boundary" }, react_default.createElement(Content, null, react_default.createElement(Info, null, react_default.createElement(Heading, null, react_default.createElement(Badge, { status: "negative" }, "Error"), react_default.createElement("span", null, "Something went wrong")), react_default.createElement(SubHeading, null, "The Storybook Manager UI encountered an error. This is usually caused by custom addon code or configuration. Please check your browser console for more details. Try clearing browser storage if the issue persists."), react_default.createElement(Button, { asChild: !0, size: "medium" }, react_default.createElement("a", { href: window.location.origin + window.location.pathname.replace("iframe.html", "") }, react_default.createElement(SyncIcon, { size: 14 }), "Reload Storybook"))), react_default.createElement(ErrorWrapper, null, react_default.createElement(ErrorMessage, null, error.message || "Unknown error"), react_default.createElement(
2982  Collapsible,
2983  {
2984    collapsed: !0,
2985    summary: ({ isCollapsed, toggleCollapsed }) => react_default.createElement(CollapseToggle, { onClick: toggleCollapsed }, react_default.createElement(UnfoldIcon, null), isCollapsed ? "Expand error" : "Collapse error")
2986  },
2987  (error.stack || errorInfo?.componentStack) && react_default.createElement(ErrorStack, null, error.stack, errorInfo?.componentStack && `
2988
2989Component Stack:${errorInfo.componentStack}`)
2990)))), ManagerErrorBoundary = class extends Component {
2991  constructor(props) {
2992    super(props), this.state = { hasError: !1, error: null, errorInfo: null };
2993  }
2994  static getDerivedStateFromError(error) {
2995    return { hasError: !0, error };
2996  }
2997  componentDidCatch(error, errorInfo) {
2998    console.error("Storybook Manager UI Error:", error), console.error("Component Stack:", errorInfo.componentStack), this.setState({ errorInfo }), typeof globalThis.sendTelemetryError == "function" && globalThis.sendTelemetryError(error);
2999  }
3000  render() {
3001    let { hasError, error, errorInfo } = this.state, { children } = this.props;
3002    return hasError && error ? react_default.createElement(ErrorFallback, { error, errorInfo }) : children;
3003  }
3004};
3005
3006// src/manager/components/layout/Layout.tsx
3007init_react();
3008
3009// src/manager/constants.ts
3010var MEDIA_DESKTOP_BREAKPOINT = "@media (min-width: 600px)";
3011
3012// src/manager/container/Notifications.tsx
3013init_react();
3014
3015// src/manager/components/notifications/NotificationList.tsx
3016init_react();
3017
3018// src/manager/components/layout/LayoutProvider.tsx
3019init_react();
3020
3021// src/manager/hooks/useMedia.tsx
3022init_react();
3023function useMediaQuery(query) {
3024  let getMatches = (queryMatch) => typeof window < "u" ? window.matchMedia(queryMatch).matches : !1, [matches, setMatches] = useState(getMatches(query));
3025  function handleChange() {
3026    setMatches(getMatches(query));
3027  }
3028  return useEffect(() => {
3029    let matchMedia = window.matchMedia(query);
3030    return handleChange(), matchMedia.addEventListener("change", handleChange), () => {
3031      matchMedia.removeEventListener("change", handleChange);
3032    };
3033  }, [query]), matches;
3034}
3035
3036// src/manager/components/layout/LayoutProvider.tsx
3037var LayoutContext = createContext({
3038  isMobile
vendor: 952 bytes, lines 3038-3070
3038MenuOpen: !1,
3039  setMobileMenuOpen: () => {
3040  },
3041  isMobileAboutOpen: !1,
3042  setMobileAboutOpen: () => {
3043  },
3044  isMobilePanelOpen: !1,
3045  setMobilePanelOpen: () => {
3046  },
3047  isDesktop: !1,
3048  isMobile: !1
3049}), LayoutProvider = ({ children, forceDesktop }) => {
3050  let [isMobileMenuOpen, setMobileMenuOpen] = useState(!1), [isMobileAboutOpen, setMobileAboutOpen] = useState(!1), [isMobilePanelOpen, setMobilePanelOpen] = useState(!1), isDesktop = forceDesktop ?? useMediaQuery(`(min-width: ${600}px)`), isMobile2 = !isDesktop, contextValue = useMemo(
3051    () => ({
3052      isMobileMenuOpen,
3053      setMobileMenuOpen,
3054      isMobileAboutOpen,
3055      setMobileAboutOpen,
3056      isMobilePanelOpen,
3057      setMobilePanelOpen,
3058      isDesktop,
3059      isMobile: isMobile2
3060    }),
3061    [
3062      isMobileMenuOpen,
3063      setMobileMenuOpen,
3064      isMobileAboutOpen,
3065      setMobileAboutOpen,
3066      isMobilePanelOpen,
3067      setMobilePanelOpen,
3068      isDesktop,
3069      isMobile2
3070    
vendor: 6,794 bytes, lines 3070-3257
3070]
3071  );
3072  return react_default.createElement(LayoutContext.Provider, { value: contextValue }, children);
3073}, useLayout = () => useContext(LayoutContext);
3074
3075// src/manager/components/notifications/NotificationItem.tsx
3076init_react();
3077var slideIn = keyframes({
3078  "0%": {
3079    opacity: 0,
3080    transform: "translateY(30px)"
3081  },
3082  "100%": {
3083    opacity: 1,
3084    transform: "translateY(0)"
3085  }
3086}), grow = keyframes({
3087  "0%": {
3088    width: "0%"
3089  },
3090  "100%": {
3091    width: "100%"
3092  }
3093}), Notification = styled.div(
3094  ({ theme }) => ({
3095    position: "relative",
3096    display: "flex",
3097    border: `1px solid ${theme.appBorderColor}`,
3098    padding: "12px 6px 12px 12px",
3099    borderRadius: theme.appBorderRadius + 1,
3100    alignItems: "center",
3101    animation: `${slideIn} 500ms`,
3102    background: theme.base === "light" ? "hsla(203, 50%, 20%, .97)" : "hsla(203, 30%, 95%, .97)",
3103    boxShadow: "0 2px 5px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.1)",
3104    color: theme.color.inverseText,
3105    textDecoration: "none",
3106    overflow: "hidden",
3107    [MEDIA_DESKTOP_BREAKPOINT]: {
3108      boxShadow: `0 1px 2px 0 rgba(0, 0, 0, 0.05), 0px -5px 20px 10px ${theme.background.app}`
3109    }
3110  }),
3111  ({ duration, theme }) => duration && {
3112    "&::after": {
3113      content: '""',
3114      display: "block",
3115      position: "absolute",
3116      bottom: 0,
3117      left: 0,
3118      height: 3,
3119      background: theme.color.secondary,
3120      animation: `${grow} ${duration}ms linear forwards reverse`
3121    }
3122  }
3123), NotificationWithInteractiveStates = styled(Notification)({
3124  cursor: "pointer",
3125  border: "none",
3126  outline: "none",
3127  textAlign: "left",
3128  transition: "all 150ms ease-out",
3129  transform: "translate3d(0, 0, 0)",
3130  "&:hover": {
3131    transform: "translate3d(0, -3px, 0)",
3132    boxShadow: "0 1px 3px 0 rgba(30,167,253,0.5), 0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)"
3133  },
3134  "&:active": {
3135    transform: "translate3d(0, 0, 0)",
3136    boxShadow: "0 1px 3px 0 rgba(30,167,253,0.5), 0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)"
3137  },
3138  "&:focus": {
3139    boxShadow: "rgba(2,156,253,1) 0 0 0 1px inset, 0 1px 3px 0 rgba(30,167,253,0.5), 0 2px 5px 0 rgba(0,0,0,0.05), 0 5px 15px 0 rgba(0,0,0,0.1)"
3140  }
3141}), NotificationButton = NotificationWithInteractiveStates.withComponent("div"), NotificationLink = NotificationWithInteractiveStates.withComponent(Link2), NotificationIconWrapper = styled.div({
3142  display: "flex",
3143  marginRight: 10,
3144  alignItems: "center",
3145  svg: {
3146    width: 16,
3147    height: 16
3148  }
3149}), NotificationTextWrapper = styled.div(({ theme }) => ({
3150  width: "100%",
3151  display: "flex",
3152  flexDirection: "column",
3153  color: theme.color.inverseText
3154})), Headline = styled.div(({ theme }) => ({
3155  height: "100%",
3156  alignItems: "center",
3157  whiteSpace: "balance",
3158  overflow: "hidden",
3159  textOverflow: "ellipsis",
3160  fontSize: theme.typography.size.s1,
3161  lineHeight: "16px",
3162  fontWeight: theme.typography.weight.bold
3163})), SubHeadline = styled.div(({ theme }) => ({
3164  color: curriedTransparentize$1(0.25, theme.color.inverseText),
3165  fontSize: theme.typography.size.s1 - 1,
3166  lineHeight: "14px",
3167  marginTop: 2,
3168  whiteSpace: "balance"
3169})), ItemContent = ({
3170  icon,
3171  content: { headline, subHeadline }
3172}) => react_default.createElement(react_default.Fragment, null, !icon || react_default.createElement(NotificationIconWrapper, null, icon), react_default.createElement(NotificationTextWrapper, null, react_default.createElement(Headline, { title: headline }, headline), subHeadline && react_default.createElement(SubHeadline, null, subHeadline))), DismissButtonWrapper = styled(Button)(({ theme }) => ({
3173  width: 28,
3174  alignSelf: "center",
3175  marginTop: 0,
3176  color: theme.base === "light" ? "rgba(255,255,255,0.7)" : " #999999"
3177})), DismissNotificationItem = ({ onDismiss }) => react_default.createElement(
3178  DismissButtonWrapper,
3179  {
3180    padding: "small",
3181    variant: "ghost",
3182    ariaLabel: "Dismiss notification",
3183    onClick: (e2) => {
3184      e2.preventDefault(), e2.stopPropagation(), onDismiss();
3185    }
3186  },
3187  react_default.createElement(CloseAltIcon, { size: 12 })
3188), NotificationItemSpacer = styled.div({
3189  height: 48
3190}), NotificationItem = ({
3191  notification: { content, duration, link, onClear, onClick, id, icon },
3192  onDismissNotification,
3193  zIndex
3194}) => {
3195  let onTimeout = useCallback(() => {
3196    onDismissNotification(id), onClear && onClear({ dismissed: !1, timeout: !0 });
3197  }, [id, onDismissNotification, onClear]), timer = useRef(null);
3198  useEffect(() => {
3199    if (duration)
3200      return timer.current = setTimeout(onTimeout, duration), () => clearTimeout(timer.current);
3201  }, [duration, onTimeout]);
3202  let onDismiss = useCallback(() => {
3203    clearTimeout(timer.current), onDismissNotification(id), onClear && onClear({ dismissed: !0, timeout: !1 });
3204  }, [id, onDismissNotification, onClear]);
3205  return link ? react_default.createElement(NotificationLink, { to: link, duration, style: { zIndex } }, react_default.createElement(ItemContent, { icon, content }), react_default.createElement(DismissNotificationItem, { onDismiss })) : onClick ? react_default.createElement(
3206    NotificationButton,
3207    {
3208      duration,
3209      onClick: () => onClick({ onDismiss }),
3210      style: { zIndex }
3211    },
3212    react_default.createElement(ItemContent, { icon, content }),
3213    react_default.createElement(DismissNotificationItem, { onDismiss })
3214  ) : react_default.createElement(Notification, { duration, style: { zIndex } }, react_default.createElement(ItemContent, { icon, content }), react_default.createElement(DismissNotificationItem, { onDismiss }));
3215}, NotificationItem_default = NotificationItem;
3216
3217// src/manager/components/notifications/NotificationList.tsx
3218var NotificationList = ({
3219  notifications,
3220  clearNotification
3221}) => {
3222  let { isMobile: isMobile2 } = useLayout();
3223  return react_default.createElement(List, { isMobile: isMobile2 }, notifications && notifications.map((notification, index) => react_default.createElement(
3224    NotificationItem_default,
3225    {
3226      key: notification.id,
3227      onDismissNotification: (id) => clearNotification(id),
3228      notification,
3229      zIndex: notifications.length - index
3230    }
3231  )));
3232}, List = styled.div(
3233  {
3234    zIndex: 200,
3235    "> * + *": {
3236      marginTop: 12
3237    },
3238    "&:empty": {
3239      display: "none"
3240    }
3241  },
3242  ({ isMobile: isMobile2 }) => isMobile2 && {
3243    position: "fixed",
3244    bottom: 40,
3245    margin: 20
3246  }
3247);
3248
3249// src/manager/container/Notifications.tsx
3250var mapper = ({ state, api }) => ({
3251  notifications: state.notifications,
3252  clearNotification: api.clearNotification
3253}), Notifications = (props) => react_default.createElement(Consumer, { filter: mapper }, (fromState) => react_default.createElement(NotificationList, { ...props, ...fromState }));
3254
3255// src/manager/components/mobile/navigation/MobileNavigation.tsx
3256init_react();
3257
vendor: 195 bytes, lines 3258-3262
3258// ../../node_modules/@react-aria/utils/dist/useLayoutEffect.mjs
3259init_react();
3260var $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document < "u" ? react_default.useLayoutEffect : () => {
3261};
3262
vendor: 79 bytes, lines 3263-3265
3263// ../../node_modules/@react-aria/utils/dist/useValueEffect.mjs
3264init_react();
3265
vendor: 70 bytes, lines 3266-3268
3266// ../../node_modules/@react-aria/utils/dist/useId.mjs
3267init_react();
3268
vendor: 3,221 bytes, lines 3269-3314
3269// ../../node_modules/@react-aria/ssr/dist/SSRProvider.mjs
3270init_react();
3271var $b5e257d569688ac6$var$defaultContext = {
3272  prefix: String(Math.round(Math.random() * 1e10)),
3273  current: 0
3274}, $b5e257d569688ac6$var$SSRContext = react_default.createContext($b5e257d569688ac6$var$defaultContext), $b5e257d569688ac6$var$IsSSRContext = react_default.createContext(!1);
3275var $b5e257d569688ac6$var$canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
3276function $b5e257d569688ac6$var$useCounter(isDisabled = !1) {
3277  let ctx = useContext($b5e257d569688ac6$var$SSRContext), ref = useRef(null);
3278  if (ref.current === null && !isDisabled) {
3279    var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3280    let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = react_default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 || (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
3281    if (currentOwner) {
3282      let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
3283      prevComponentValue == null ? $b5e257d569688ac6$var$componentIds.set(currentOwner, {
3284        id: ctx.current,
3285        state: currentOwner.memoizedState
3286      }) : currentOwner.memoizedState !== prevComponentValue.state && (ctx.current = prevComponentValue.id, $b5e257d569688ac6$var$componentIds.delete(currentOwner));
3287    }
3288    ref.current = ++ctx.current;
3289  }
3290  return ref.current;
3291}
3292function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
3293  let ctx = useContext($b5e257d569688ac6$var$SSRContext), counter = $b5e257d569688ac6$var$useCounter(!!defaultId), prefix = `react-aria${ctx.prefix}`;
3294  return defaultId || `${prefix}-${counter}`;
3295}
3296function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
3297  let id = react_default.useId(), [didSSR] = useState($b5e257d569688ac6$export$535bd6ca7f90a273()), prefix = didSSR ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
3298  return defaultId || `${prefix}-${id}`;
3299}
3300var $b5e257d569688ac6$export$619500959fc48b26 = typeof react_default.useId == "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
3301function $b5e257d569688ac6$var$getSnapshot() {
3302  return !1;
3303}
3304function $b5e257d569688ac6$var$getServerSnapshot() {
3305  return !0;
3306}
3307function $b5e257d569688ac6$var$subscribe(onStoreChange) {
3308  return () => {
3309  };
3310}
3311function $b5e257d569688ac6$export$535bd6ca7f90a273() {
3312  return typeof react_default.useSyncExternalStore == "function" ? react_default.useSyncExternalStore($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot) : useContext($b5e257d569688ac6$var$IsSSRContext);
3313}
3314
vendor: 1,844 bytes, lines 3315-3350
3315// ../../node_modules/@react-aria/utils/dist/useId.mjs
3316var $bdb11010cef70236$var$canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), $bdb11010cef70236$export$d41a04c74483c6ef = /* @__PURE__ */ new Map(), $bdb11010cef70236$var$registry;
3317typeof FinalizationRegistry < "u" && ($bdb11010cef70236$var$registry = new FinalizationRegistry((heldValue) => {
3318  $bdb11010cef70236$export$d41a04c74483c6ef.delete(heldValue);
3319}));
3320function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
3321  let [value, setValue] = useState(defaultId), nextId = useRef(null), res = $b5e257d569688ac6$export$619500959fc48b26(value), cleanupRef = useRef(null);
3322  if ($bdb11010cef70236$var$registry && $bdb11010cef70236$var$registry.register(cleanupRef, res), $bdb11010cef70236$var$canUseDOM) {
3323    let cacheIdRef = $bdb11010cef70236$export$d41a04c74483c6ef.get(res);
3324    cacheIdRef && !cacheIdRef.includes(nextId) ? cacheIdRef.push(nextId) : $bdb11010cef70236$export$d41a04c74483c6ef.set(res, [
3325      nextId
3326    ]);
3327  }
3328  return $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
3329    let r4 = res;
3330    return () => {
3331      $bdb11010cef70236$var$registry && $bdb11010cef70236$var$registry.unregister(cleanupRef), $bdb11010cef70236$export$d41a04c74483c6ef.delete(r4);
3332    };
3333  }, [
3334    res
3335  ]), useEffect(() => {
3336    let newId = nextId.current;
3337    return newId && setValue(newId), () => {
3338      newId && (nextId.current = null);
3339    };
3340  }), res;
3341}
3342function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
3343  if (idA === idB) return idA;
3344  let setIdsA = $bdb11010cef70236$export$d41a04c74483c6ef.get(idA);
3345  if (setIdsA)
3346    return setIdsA.forEach((ref) => ref.current = idB), idB;
3347  let setIdsB = $bdb11010cef70236$export$d41a04c74483c6ef.get(idB);
3348  return setIdsB ? (setIdsB.forEach((ref) => ref.current = idA), idA) : idB;
3349}
3350
vendor: 242 bytes, lines 3351-3357
3351// ../../node_modules/@react-aria/utils/dist/chain.mjs
3352function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
3353  return (...args) => {
3354    for (let callback of callbacks) typeof callback == "function" && callback(...args);
3355  };
3356}
3357
vendor: 773 bytes, lines 3358-3369
3358// ../../node_modules/@react-aria/utils/dist/domHelpers.mjs
3359var $431fbd86ca7dc216$export$b204af158042fbac = (el) => {
3360  var _el_ownerDocument;
3361  return (_el_ownerDocument = el?.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
3362}, $431fbd86ca7dc216$export$f21a1ffae260145a = (el) => el && "window" in el && el.window === el ? el : $431fbd86ca7dc216$export$b204af158042fbac(el).defaultView || window;
3363function $431fbd86ca7dc216$var$isNode(value) {
3364  return value !== null && typeof value == "object" && "nodeType" in value && typeof value.nodeType == "number";
3365}
3366function $431fbd86ca7dc216$export$af51f0f06c0f328a(node) {
3367  return $431fbd86ca7dc216$var$isNode(node) && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in node;
3368}
3369
vendor: 203 bytes, lines 3370-3375
3370// ../../node_modules/@react-stately/flags/dist/import.mjs
3371var $f4e2df6bd15f8569$var$_shadowDOM = !1;
3372function $f4e2df6bd15f8569$export$98658e8c59125e6a() {
3373  return $f4e2df6bd15f8569$var$_shadowDOM;
3374}
3375
vendor: 1,377 bytes, lines 3376-3397
3376// ../../node_modules/@react-aria/utils/dist/DOMFunctions.mjs
3377function $d4ee10de306f2510$export$4282f70798064fe0(node, otherNode) {
3378  if (!$f4e2df6bd15f8569$export$98658e8c59125e6a()) return otherNode && node ? node.contains(otherNode) : !1;
3379  if (!node || !otherNode) return !1;
3380  let currentNode = otherNode;
3381  for (; currentNode !== null; ) {
3382    if (currentNode === node) return !0;
3383    currentNode.tagName === "SLOT" && currentNode.assignedSlot ? currentNode = currentNode.assignedSlot.parentNode : $431fbd86ca7dc216$export$af51f0f06c0f328a(currentNode) ? currentNode = currentNode.host : currentNode = currentNode.parentNode;
3384  }
3385  return !1;
3386}
3387var $d4ee10de306f2510$export$cd4e5573fbe2b576 = (doc = document) => {
3388  var _activeElement_shadowRoot;
3389  if (!$f4e2df6bd15f8569$export$98658e8c59125e6a()) return doc.activeElement;
3390  let activeElement = doc.activeElement;
3391  for (; activeElement && "shadowRoot" in activeElement && (!((_activeElement_shadowRoot = activeElement.shadowRoot) === null || _activeElement_shadowRoot === void 0) && _activeElement_shadowRoot.activeElement); ) activeElement = activeElement.shadowRoot.activeElement;
3392  return activeElement;
3393};
3394function $d4ee10de306f2510$export$e58f029f0fbfdb29(event) {
3395  return $f4e2df6bd15f8569$export$98658e8c59125e6a() && event.target.shadowRoot && event.composedPath ? event.composedPath()[0] : event.target;
3396}
3397
vendor: 608 bytes, lines 3398-3413
3398// ../../node_modules/clsx/dist/clsx.mjs
3399function r2(e2) {
3400  var t2, f2, n3 = "";
3401  if (typeof e2 == "string" || typeof e2 == "number") n3 += e2;
3402  else if (typeof e2 == "object") if (Array.isArray(e2)) {
3403    var o3 = e2.length;
3404    for (t2 = 0; t2 < o3; t2++) e2[t2] && (f2 = r2(e2[t2])) && (n3 && (n3 += " "), n3 += f2);
3405  } else for (f2 in e2) e2[f2] && (n3 && (n3 += " "), n3 += f2);
3406  return n3;
3407}
3408function clsx() {
3409  for (var e2, t2, f2 = 0, n3 = "", o3 = arguments.length; f2 < o3; f2++) (e2 = arguments[f2]) && (t2 = r2(e2)) && (n3 && (n3 += " "), n3 += t2);
3410  return n3;
3411}
3412var clsx_default = clsx;
3413
vendor: 896 bytes, lines 3414-3431
3414// ../../node_modules/@react-aria/utils/dist/mergeProps.mjs
3415function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
3416  let result = {
3417    ...args[0]
3418  };
3419  for (let i2 = 1; i2 < args.length; i2++) {
3420    let props = args[i2];
3421    for (let key in props) {
3422      let a2 = result[key], b2 = props[key];
3423      typeof a2 == "function" && typeof b2 == "function" && // This is a lot faster than a regex.
3424      key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
3425      65 && key.charCodeAt(2) <= /* 'Z' */
3426      90 ? result[key] = $ff5963eb1fccf552$export$e08e3b67e392101e(a2, b2) : (key === "className" || key === "UNSAFE_className") && typeof a2 == "string" && typeof b2 == "string" ? result[key] = clsx_default(a2, b2) : key === "id" && a2 && b2 ? result.id = $bdb11010cef70236$export$cd8c9cb68f842629(a2, b2) : result[key] = b2 !== void 0 ? b2 : a2;
3427    }
3428  }
3429  return result;
3430}
3431
vendor: 735 bytes, lines 3432-3450
3432// ../../node_modules/@react-aria/utils/dist/mergeRefs.mjs
3433function $5dc95899b306f630$export$c9058316764c140e(...refs) {
3434  return refs.length === 1 && refs[0] ? refs[0] : (value) => {
3435    let hasCleanup = !1, cleanups = refs.map((ref) => {
3436      let cleanup = $5dc95899b306f630$var$setRef(ref, value);
3437      return hasCleanup || (hasCleanup = typeof cleanup == "function"), cleanup;
3438    });
3439    if (hasCleanup) return () => {
3440      cleanups.forEach((cleanup, i2) => {
3441        typeof cleanup == "function" ? cleanup() : $5dc95899b306f630$var$setRef(refs[i2], null);
3442      });
3443    };
3444  };
3445}
3446function $5dc95899b306f630$var$setRef(ref, value) {
3447  if (typeof ref == "function") return ref(value);
3448  ref != null && (ref.current = value);
3449}
3450
vendor: 2,100 bytes, lines 3451-3514
3451// ../../node_modules/@react-aria/utils/dist/filterDOMProps.mjs
3452var $65484d02dcb7eb3e$var$DOMPropNames = /* @__PURE__ */ new Set([
3453  "id"
3454]), $65484d02dcb7eb3e$var$labelablePropNames = /* @__PURE__ */ new Set([
3455  "aria-label",
3456  "aria-labelledby",
3457  "aria-describedby",
3458  "aria-details"
3459]), $65484d02dcb7eb3e$var$linkPropNames = /* @__PURE__ */ new Set([
3460  "href",
3461  "hrefLang",
3462  "target",
3463  "rel",
3464  "download",
3465  "ping",
3466  "referrerPolicy"
3467]), $65484d02dcb7eb3e$var$globalAttrs = /* @__PURE__ */ new Set([
3468  "dir",
3469  "lang",
3470  "hidden",
3471  "inert",
3472  "translate"
3473]), $65484d02dcb7eb3e$var$globalEvents = /* @__PURE__ */ new Set([
3474  "onClick",
3475  "onAuxClick",
3476  "onContextMenu",
3477  "onDoubleClick",
3478  "onMouseDown",
3479  "onMouseEnter",
3480  "onMouseLeave",
3481  "onMouseMove",
3482  "onMouseOut",
3483  "onMouseOver",
3484  "onMouseUp",
3485  "onTouchCancel",
3486  "onTouchEnd",
3487  "onTouchMove",
3488  "onTouchStart",
3489  "onPointerDown",
3490  "onPointerMove",
3491  "onPointerUp",
3492  "onPointerCancel",
3493  "onPointerEnter",
3494  "onPointerLeave",
3495  "onPointerOver",
3496  "onPointerOut",
3497  "onGotPointerCapture",
3498  "onLostPointerCapture",
3499  "onScroll",
3500  "onWheel",
3501  "onAnimationStart",
3502  "onAnimationEnd",
3503  "onAnimationIteration",
3504  "onTransitionCancel",
3505  "onTransitionEnd",
3506  "onTransitionRun",
3507  "onTransitionStart"
3508]), $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
3509function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
3510  let { labelable, isLink, global: global2, events: events2 = global2, propNames } = opts, filteredProps = {};
3511  for (let prop in props) Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global2 && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events2 && ($65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith("Capture") && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7))) || propNames?.has(prop) || $65484d02dcb7eb3e$var$propRe.test(prop)) && (filteredProps[prop] = props[prop]);
3512  return filteredProps;
3513}
3514
vendor: 1,911 bytes, lines 3515-3558
3515// ../../node_modules/@react-aria/utils/dist/focusWithoutScrolling.mjs
3516function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
3517  if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
3518    preventScroll: !0
3519  });
3520  else {
3521    let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
3522    element.focus(), $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
3523  }
3524}
3525var $7215afc6de606d6b$var$supportsPreventScrollCached = null;
3526function $7215afc6de606d6b$var$supportsPreventScroll() {
3527  if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
3528    $7215afc6de606d6b$var$supportsPreventScrollCached = !1;
3529    try {
3530      document.createElement("div").focus({
3531        get preventScroll() {
3532          return $7215afc6de606d6b$var$supportsPreventScrollCached = !0, !0;
3533        }
3534      });
3535    } catch {
3536    }
3537  }
3538  return $7215afc6de606d6b$var$supportsPreventScrollCached;
3539}
3540function $7215afc6de606d6b$var$getScrollableElements(element) {
3541  let parent = element.parentNode, scrollableElements = [], rootScrollingElement = document.scrollingElement || document.documentElement;
3542  for (; parent instanceof HTMLElement && parent !== rootScrollingElement; )
3543    (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) && scrollableElements.push({
3544      element: parent,
3545      scrollTop: parent.scrollTop,
3546      scrollLeft: parent.scrollLeft
3547    }), parent = parent.parentNode;
3548  return rootScrollingElement instanceof HTMLElement && scrollableElements.push({
3549    element: rootScrollingElement,
3550    scrollTop: rootScrollingElement.scrollTop,
3551    scrollLeft: rootScrollingElement.scrollLeft
3552  }), scrollableElements;
3553}
3554function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
3555  for (let { element, scrollTop, scrollLeft } of scrollableElements)
3556    element.scrollTop = scrollTop, element.scrollLeft = scrollLeft;
3557}
3558
vendor: 2,643 bytes, lines 3559-3594
3559// ../../node_modules/@react-aria/utils/dist/platform.mjs
3560function $c87311424ea30a05$var$testUserAgent(re) {
3561  var _window_navigator_userAgentData;
3562  if (typeof window > "u" || window.navigator == null) return !1;
3563  let brands = (_window_navigator_userAgentData = window.navigator.userAgentData) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands;
3564  return Array.isArray(brands) && brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
3565}
3566function $c87311424ea30a05$var$testPlatform(re) {
3567  var _window_navigator_userAgentData;
3568  return typeof window < "u" && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator.userAgentData) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : !1;
3569}
3570function $c87311424ea30a05$var$cached(fn) {
3571  let res = null;
3572  return () => (res == null && (res = fn()), res);
3573}
3574var $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
3575  return $c87311424ea30a05$var$testPlatform(/^Mac/i);
3576}), $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
3577  return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
3578}), $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
3579  return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
3580  $c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
3581}), $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
3582  return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
3583}), $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() {
3584  return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
3585}), $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
3586  return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
3587}), $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
3588  return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
3589}), $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
3590  return $c87311424ea30a05$var$testUserAgent(/Android/i);
3591}), $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
3592  return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
3593});
3594
vendor: 2,441 bytes, lines 3595-3634
3595// ../../node_modules/@react-aria/utils/dist/openLink.mjs
3596init_react();
3597var $ea8dcbcb9ea1b556$var$RouterContext = createContext({
3598  isNative: !0,
3599  open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
3600  useHref: (href) => href
3601});
3602function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers2, setOpening = !0) {
3603  var _window_event_type, _window_event;
3604  let { metaKey, ctrlKey, altKey, shiftKey } = modifiers2;
3605  $c87311424ea30a05$export$b7d78993b74f766d() && (!((_window_event = window.event) === null || _window_event === void 0 || (_window_event_type = _window_event.type) === null || _window_event_type === void 0) && _window_event_type.startsWith("key")) && target.target === "_blank" && ($c87311424ea30a05$export$9ac100e40613ea10() ? metaKey = !0 : ctrlKey = !0);
3606  let event = $c87311424ea30a05$export$78551043582a6a98() && $c87311424ea30a05$export$9ac100e40613ea10() && !$c87311424ea30a05$export$7bef049ce92e4224() ? new KeyboardEvent("keydown", {
3607    keyIdentifier: "Enter",
3608    metaKey,
3609    ctrlKey,
3610    altKey,
3611    shiftKey
3612  }) : new MouseEvent("click", {
3613    metaKey,
3614    ctrlKey,
3615    altKey,
3616    shiftKey,
3617    detail: 1,
3618    bubbles: !0,
3619    cancelable: !0
3620  });
3621  $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening, $7215afc6de606d6b$export$de79e2c695e052f3(target), target.dispatchEvent(event), $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = !1;
3622}
3623$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = !1;
3624function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
3625  if (target instanceof HTMLAnchorElement) open(target);
3626  else if (target.hasAttribute("data-href")) {
3627    let link = document.createElement("a");
3628    link.href = target.getAttribute("data-href"), target.hasAttribute("data-target") && (link.target = target.getAttribute("data-target")), target.hasAttribute("data-rel") && (link.rel = target.getAttribute("data-rel")), target.hasAttribute("data-download") && (link.download = target.getAttribute("data-download")), target.hasAttribute("data-ping") && (link.ping = target.getAttribute("data-ping")), target.hasAttribute("data-referrer-policy") && (link.referrerPolicy = target.getAttribute("data-referrer-policy")), target.appendChild(link), open(link), target.removeChild(link);
3629  }
3630}
3631function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers2) {
3632  $ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link) => $ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers2));
3633}
3634
vendor: 2,247 bytes, lines 3635-3668
3635// ../../node_modules/@react-aria/utils/dist/runAfterTransition.mjs
3636var $bbed8b41f857bcc0$var$transitionsByElement = /* @__PURE__ */ new Map(), $bbed8b41f857bcc0$var$transitionCallbacks = /* @__PURE__ */ new Set();
3637function $bbed8b41f857bcc0$var$setupGlobalEvents() {
3638  if (typeof window > "u") return;
3639  function isTransitionEvent(event) {
3640    return "propertyName" in event;
3641  }
3642  let onTransitionStart = (e2) => {
3643    if (!isTransitionEvent(e2) || !e2.target) return;
3644    let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target);
3645    transitions || (transitions = /* @__PURE__ */ new Set(), $bbed8b41f857bcc0$var$transitionsByElement.set(e2.target, transitions), e2.target.addEventListener("transitioncancel", onTransitionEnd, {
3646      once: !0
3647    })), transitions.add(e2.propertyName);
3648  }, onTransitionEnd = (e2) => {
3649    if (!isTransitionEvent(e2) || !e2.target) return;
3650    let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target);
3651    if (properties && (properties.delete(e2.propertyName), properties.size === 0 && (e2.target.removeEventListener("transitioncancel", onTransitionEnd), $bbed8b41f857bcc0$var$transitionsByElement.delete(e2.target)), $bbed8b41f857bcc0$var$transitionsByElement.size === 0)) {
3652      for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks) cb();
3653      $bbed8b41f857bcc0$var$transitionCallbacks.clear();
3654    }
3655  };
3656  document.body.addEventListener("transitionrun", onTransitionStart), document.body.addEventListener("transitionend", onTransitionEnd);
3657}
3658typeof document < "u" && (document.readyState !== "loading" ? $bbed8b41f857bcc0$var$setupGlobalEvents() : document.addEventListener("DOMContentLoaded", $bbed8b41f857bcc0$var$setupGlobalEvents));
3659function $bbed8b41f857bcc0$var$cleanupDetachedElements() {
3660  for (let [eventTarget] of $bbed8b41f857bcc0$var$transitionsByElement)
3661    "isConnected" in eventTarget && !eventTarget.isConnected && $bbed8b41f857bcc0$var$transitionsByElement.delete(eventTarget);
3662}
3663function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
3664  requestAnimationFrame(() => {
3665    $bbed8b41f857bcc0$var$cleanupDetachedElements(), $bbed8b41f857bcc0$var$transitionsByElement.size === 0 ? fn() : $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
3666  });
3667}
3668
vendor: 74 bytes, lines 3669-3671
3669// ../../node_modules/@react-aria/utils/dist/useDrag1D.mjs
3670init_react();
3671
vendor: 1,403 bytes, lines 3672-3704
3672// ../../node_modules/@react-aria/utils/dist/useGlobalListeners.mjs
3673init_react();
3674function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
3675  let globalListeners = useRef(/* @__PURE__ */ new Map()), addGlobalListener = useCallback((eventTarget, type, listener, options2) => {
3676    let fn = options2?.once ? (...args) => {
3677      globalListeners.current.delete(listener), listener(...args);
3678    } : listener;
3679    globalListeners.current.set(listener, {
3680      type,
3681      eventTarget,
3682      fn,
3683      options: options2
3684    }), eventTarget.addEventListener(type, fn, options2);
3685  }, []), removeGlobalListener = useCallback((eventTarget, type, listener, options2) => {
3686    var _globalListeners_current_get;
3687    let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
3688    eventTarget.removeEventListener(type, fn, options2), globalListeners.current.delete(listener);
3689  }, []), removeAllGlobalListeners = useCallback(() => {
3690    globalListeners.current.forEach((value, key) => {
3691      removeGlobalListener(value.eventTarget, value.type, key, value.options);
3692    });
3693  }, [
3694    removeGlobalListener
3695  ]);
3696  return useEffect(() => removeAllGlobalListeners, [
3697    removeAllGlobalListeners
3698  ]), {
3699    addGlobalListener,
3700    removeGlobalListener,
3701    removeAllGlobalListeners
3702  };
3703}
3704
vendor: 869 bytes, lines 3705-3732
3705// ../../node_modules/@react-aria/utils/dist/useObjectRef.mjs
3706init_react();
3707function $df56164dff5785e2$export$4338b53315abf666(ref) {
3708  let objRef = useRef(null), cleanupRef = useRef(void 0), refEffect = useCallback((instance) => {
3709    if (typeof ref == "function") {
3710      let refCallback = ref, refCleanup = refCallback(instance);
3711      return () => {
3712        typeof refCleanup == "function" ? refCleanup() : refCallback(null);
3713      };
3714    } else if (ref)
3715      return ref.current = instance, () => {
3716        ref.current = null;
3717      };
3718  }, [
3719    ref
3720  ]);
3721  return useMemo(() => ({
3722    get current() {
3723      return objRef.current;
3724    },
3725    set current(value) {
3726      objRef.current = value, cleanupRef.current && (cleanupRef.current(), cleanupRef.current = void 0), value != null && (cleanupRef.current = refEffect(value));
3727    }
3728  }), [
3729    refEffect
3730  ]);
3731}
3732
vendor: 692 bytes, lines 3733-3747
3733// ../../node_modules/@react-aria/utils/dist/useEffectEvent.mjs
3734init_react();
3735var $8ae05eaa5c114e9c$var$_React_useInsertionEffect, $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = react_default.useInsertionEffect) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c;
3736function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
3737  let ref = useRef(null);
3738  return $8ae05eaa5c114e9c$var$useEarlyEffect(() => {
3739    ref.current = fn;
3740  }, [
3741    fn
3742  ]), useCallback((...args) => {
3743    let f2 = ref.current;
3744    return f2?.(...args);
3745  }, []);
3746}
3747
vendor: 80 bytes, lines 3748-3750
3748// ../../node_modules/@react-aria/utils/dist/useUpdateEffect.mjs
3749init_react();
3750
vendor: 86 bytes, lines 3751-3753
3751// ../../node_modules/@react-aria/utils/dist/useUpdateLayoutEffect.mjs
3752init_react();
3753
vendor: 980 bytes, lines 3754-3782
3754// ../../node_modules/@react-aria/utils/dist/useResizeObserver.mjs
3755init_react();
3756function $9daab02d461809db$var$hasResizeObserver() {
3757  return typeof window.ResizeObserver < "u";
3758}
3759function $9daab02d461809db$export$683480f191c0e3ea(options2) {
3760  let { ref, box, onResize } = options2, onResizeEvent = $8ae05eaa5c114e9c$export$7f54fc3180508a52(onResize);
3761  useEffect(() => {
3762    let element = ref?.current;
3763    if (element)
3764      if ($9daab02d461809db$var$hasResizeObserver()) {
3765        let resizeObserverInstance = new window.ResizeObserver((entries) => {
3766          entries.length && onResizeEvent();
3767        });
3768        return resizeObserverInstance.observe(element, {
3769          box
3770        }), () => {
3771          element && resizeObserverInstance.unobserve(element);
3772        };
3773      } else
3774        return window.addEventListener("resize", onResizeEvent, !1), () => {
3775          window.removeEventListener("resize", onResizeEvent, !1);
3776        };
3777  }, [
3778    ref,
3779    box
3780  ]);
3781}
3782
vendor: 345 bytes, lines 3783-3792
3783// ../../node_modules/@react-aria/utils/dist/useSyncRef.mjs
3784function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
3785  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
3786    if (context && context.ref && ref)
3787      return context.ref.current = ref.current, () => {
3788        context.ref && (context.ref.current = null);
3789      };
3790  });
3791}
3792
vendor: 171 bytes, lines 3793-3796
3793// ../../node_modules/@react-aria/utils/dist/useViewportSize.mjs
3794init_react();
3795var $5df64b3807dc15ee$var$visualViewport = typeof document < "u" && window.visualViewport;
3796
vendor: 79 bytes, lines 3797-3799
3797// ../../node_modules/@react-aria/utils/dist/useDescription.mjs
3798init_react();
3799
vendor: 73 bytes, lines 3800-3802
3800// ../../node_modules/@react-aria/utils/dist/useEvent.mjs
3801init_react();
3802
vendor: 626 bytes, lines 3803-3810
3803// ../../node_modules/@react-aria/utils/dist/isVirtualEvent.mjs
3804function $6a7db85432448f7f$export$60278871457622de(event) {
3805  return event.pointerType === "" && event.isTrusted ? !0 : $c87311424ea30a05$export$a11b0059900ceec8() && event.pointerType ? event.type === "click" && event.buttons === 1 : event.detail === 0 && !event.pointerType;
3806}
3807function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
3808  return !$c87311424ea30a05$export$a11b0059900ceec8() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse";
3809}
3810
vendor: 76 bytes, lines 3811-3813
3811// ../../node_modules/@react-aria/utils/dist/useDeepMemo.mjs
3812init_react();
3813
vendor: 77 bytes, lines 3814-3816
3814// ../../node_modules/@react-aria/utils/dist/useFormReset.mjs
3815init_react();
3816
vendor: 76 bytes, lines 3817-3819
3817// ../../node_modules/@react-aria/utils/dist/useLoadMore.mjs
3818init_react();
3819
vendor: 84 bytes, lines 3820-3822
3820// ../../node_modules/@react-aria/utils/dist/useLoadMoreSentinel.mjs
3821init_react();
3822
vendor: 482 bytes, lines 3823-3828
3823// ../../node_modules/@react-aria/utils/dist/inertValue.mjs
3824init_react();
3825
3826// global-externals:react-dom
3827var react_dom_default = __REACT_DOM__, { __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED2, createPortal, createRoot: createRoot2, findDOMNode, flushSync, hydrate, hydrateRoot: hydrateRoot2, render, unmountComponentAtNode, unstable_batchedUpdates, unstable_renderSubtreeIntoContainer, version: version2 } = __REACT_DOM__;
3828
vendor: 1,858 bytes, lines 3829-3885
3829// ../../node_modules/@react-aria/utils/dist/animation.mjs
3830init_react();
3831function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = !0) {
3832  let [isEntering, setEntering] = useState(!0), isAnimationReady = isEntering && isReady;
3833  return $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
3834    if (isAnimationReady && ref.current && "getAnimations" in ref.current)
3835      for (let animation of ref.current.getAnimations()) animation instanceof CSSTransition && animation.cancel();
3836  }, [
3837    ref,
3838    isAnimationReady
3839  ]), $d3f049242431219c$var$useAnimation(ref, isAnimationReady, useCallback(() => setEntering(!1), [])), isAnimationReady;
3840}
3841function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) {
3842  let [exitState, setExitState] = useState(isOpen ? "open" : "closed");
3843  switch (exitState) {
3844    case "open":
3845      isOpen || setExitState("exiting");
3846      break;
3847    case "closed":
3848    case "exiting":
3849      isOpen && setExitState("open");
3850      break;
3851  }
3852  let isExiting = exitState === "exiting";
3853  return $d3f049242431219c$var$useAnimation(ref, isExiting, useCallback(() => {
3854    setExitState((state) => state === "exiting" ? "closed" : state);
3855  }, [])), isExiting;
3856}
3857function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) {
3858  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
3859    if (isActive && ref.current) {
3860      if (!("getAnimations" in ref.current)) {
3861        onEnd();
3862        return;
3863      }
3864      let animations = ref.current.getAnimations();
3865      if (animations.length === 0) {
3866        onEnd();
3867        return;
3868      }
3869      let canceled = !1;
3870      return Promise.all(animations.map((a2) => a2.finished)).then(() => {
3871        canceled || flushSync(() => {
3872          onEnd();
3873        });
3874      }).catch(() => {
3875      }), () => {
3876        canceled = !0;
3877      };
3878    }
3879  }, [
3880    ref,
3881    isActive,
3882    onEnd
3883  ]);
3884}
3885
vendor: 1,751 bytes, lines 3886-3907
3886// ../../node_modules/@react-aria/utils/dist/isElementVisible.mjs
3887var $7d2416ea0959daaa$var$supportsCheckVisibility = typeof Element < "u" && "checkVisibility" in Element.prototype;
3888function $7d2416ea0959daaa$var$isStyleVisible(element) {
3889  let windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element);
3890  if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return !1;
3891  let { display, visibility } = element.style, isVisible = display !== "none" && visibility !== "hidden" && visibility !== "collapse";
3892  if (isVisible) {
3893    let { getComputedStyle: getComputedStyle2 } = element.ownerDocument.defaultView, { display: computedDisplay, visibility: computedVisibility } = getComputedStyle2(element);
3894    isVisible = computedDisplay !== "none" && computedVisibility !== "hidden" && computedVisibility !== "collapse";
3895  }
3896  return isVisible;
3897}
3898function $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) {
3899  return !element.hasAttribute("hidden") && // Ignore HiddenSelect when tree walking.
3900  !element.hasAttribute("data-react-aria-prevent-focus") && (element.nodeName === "DETAILS" && childElement && childElement.nodeName !== "SUMMARY" ? element.hasAttribute("open") : !0);
3901}
3902function $7d2416ea0959daaa$export$e989c0fffaa6b27a(element, childElement) {
3903  return $7d2416ea0959daaa$var$supportsCheckVisibility ? element.checkVisibility({
3904    visibilityProperty: !0
3905  }) && !element.closest("[data-react-aria-prevent-focus]") : element.nodeName !== "#comment" && $7d2416ea0959daaa$var$isStyleVisible(element) && $7d2416ea0959daaa$var$isAttributeVisible(element, childElement) && (!element.parentElement || $7d2416ea0959daaa$export$e989c0fffaa6b27a(element.parentElement, element));
3906}
3907
vendor: 1,312 bytes, lines 3908-3938
3908// ../../node_modules/@react-aria/utils/dist/isFocusable.mjs
3909var $b4b717babfbb907b$var$focusableElements = [
3910  "input:not([disabled]):not([type=hidden])",
3911  "select:not([disabled])",
3912  "textarea:not([disabled])",
3913  "button:not([disabled])",
3914  "a[href]",
3915  "area[href]",
3916  "summary",
3917  "iframe",
3918  "object",
3919  "embed",
3920  "audio[controls]",
3921  "video[controls]",
3922  '[contenteditable]:not([contenteditable^="false"])',
3923  "permission"
3924], $b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
3925$b4b717babfbb907b$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
3926var $b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
3927function $b4b717babfbb907b$export$4c063cf1350e6fed(element) {
3928  return element.matches($b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR) && $7d2416ea0959daaa$export$e989c0fffaa6b27a(element) && !$b4b717babfbb907b$var$isInert(element);
3929}
3930function $b4b717babfbb907b$var$isInert(element) {
3931  let node = element;
3932  for (; node != null; ) {
3933    if (node instanceof node.ownerDocument.defaultView.HTMLElement && node.inert) return !0;
3934    node = node.parentElement;
3935  }
3936  return !1;
3937}
3938
vendor: 1,407 bytes, lines 3939-3966
3939// ../../node_modules/@react-stately/utils/dist/useControlledState.mjs
3940init_react();
3941var $458b0a5536c1a7cf$var$_React_useInsertionEffect, $458b0a5536c1a7cf$var$useEarlyEffect = typeof document < "u" ? ($458b0a5536c1a7cf$var$_React_useInsertionEffect = react_default.useInsertionEffect) !== null && $458b0a5536c1a7cf$var$_React_useInsertionEffect !== void 0 ? $458b0a5536c1a7cf$var$_React_useInsertionEffect : react_default.useLayoutEffect : () => {
3942};
3943function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
3944  let [stateValue, setStateValue] = useState(value || defaultValue), valueRef = useRef(stateValue), isControlledRef = useRef(value !== void 0), isControlled = value !== void 0;
3945  useEffect(() => {
3946    let wasControlled = isControlledRef.current;
3947    isControlledRef.current = isControlled;
3948  }, [
3949    isControlled
3950  ]);
3951  let currentValue = isControlled ? value : stateValue;
3952  $458b0a5536c1a7cf$var$useEarlyEffect(() => {
3953    valueRef.current = currentValue;
3954  });
3955  let [, forceUpdate] = useReducer(() => ({}), {}), setValue = useCallback((value2, ...args) => {
3956    let newValue = typeof value2 == "function" ? value2(valueRef.current) : value2;
3957    Object.is(valueRef.current, newValue) || (valueRef.current = newValue, setStateValue(newValue), forceUpdate(), onChange?.(newValue, ...args));
3958  }, [
3959    onChange
3960  ]);
3961  return [
3962    currentValue,
3963    setValue
3964  ];
3965}
3966
vendor: 195 bytes, lines 3967-3971
3967// ../../node_modules/@react-stately/utils/dist/number.mjs
3968function $9446cca9a3875146$export$7d15b64cf5a3a4c4(value, min = -1 / 0, max = 1 / 0) {
3969  return Math.min(Math.max(value, min), max);
3970}
3971
vendor: 11,442 bytes, lines 3972-4231
3972// ../../node_modules/@react-aria/landmark/dist/useLandmark.mjs
3973init_react();
3974var import_shim = __toESM(require_shim(), 1), $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION = 1, $a86207c5d7f7e1fb$var$landmarkSymbol = Symbol.for("react-aria-landmark-manager");
3975function $a86207c5d7f7e1fb$var$subscribe(fn) {
3976  return document.addEventListener("react-aria-landmark-manager-change", fn), () => document.removeEventListener("react-aria-landmark-manager-change", fn);
3977}
3978function $a86207c5d7f7e1fb$var$getLandmarkManager() {
3979  if (typeof document > "u") return null;
3980  let instance = document[$a86207c5d7f7e1fb$var$landmarkSymbol];
3981  return instance && instance.version >= $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION ? instance : (document[$a86207c5d7f7e1fb$var$landmarkSymbol] = new $a86207c5d7f7e1fb$var$LandmarkManager(), document.dispatchEvent(new CustomEvent("react-aria-landmark-manager-change")), document[$a86207c5d7f7e1fb$var$landmarkSymbol]);
3982}
3983function $a86207c5d7f7e1fb$var$useLandmarkManager() {
3984  return (0, import_shim.useSyncExternalStore)($a86207c5d7f7e1fb$var$subscribe, $a86207c5d7f7e1fb$var$getLandmarkManager, $a86207c5d7f7e1fb$var$getLandmarkManager);
3985}
3986var $a86207c5d7f7e1fb$var$LandmarkManager = class {
3987  setupIfNeeded() {
3988    this.isListening || (document.addEventListener("keydown", this.f6Handler, {
3989      capture: !0
3990    }), document.addEventListener("focusin", this.focusinHandler, {
3991      capture: !0
3992    }), document.addEventListener("focusout", this.focusoutHandler, {
3993      capture: !0
3994    }), this.isListening = !0);
3995  }
3996  teardownIfNeeded() {
3997    !this.isListening || this.landmarks.length > 0 || this.refCount > 0 || (document.removeEventListener("keydown", this.f6Handler, {
3998      capture: !0
3999    }), document.removeEventListener("focusin", this.focusinHandler, {
4000      capture: !0
4001    }), document.removeEventListener("focusout", this.focusoutHandler, {
4002      capture: !0
4003    }), this.isListening = !1);
4004  }
4005  focusLandmark(landmark, direction) {
4006    var _this_landmarks_find_focus, _this_landmarks_find;
4007    (_this_landmarks_find = this.landmarks.find((l3) => l3.ref.current === landmark)) === null || _this_landmarks_find === void 0 || (_this_landmarks_find_focus = _this_landmarks_find.focus) === null || _this_landmarks_find_focus === void 0 || _this_landmarks_find_focus.call(_this_landmarks_find, direction);
4008  }
4009  /**
4010  * Return set of landmarks with a specific role.
4011  */
4012  getLandmarksByRole(role) {
4013    return new Set(this.landmarks.filter((l3) => l3.role === role));
4014  }
4015  /**
4016  * Return first landmark with a specific role.
4017  */
4018  getLandmarkByRole(role) {
4019    return this.landmarks.find((l3) => l3.role === role);
4020  }
4021  addLandmark(newLandmark) {
4022    if (this.setupIfNeeded(), this.landmarks.find((landmark) => landmark.ref === newLandmark.ref) || !newLandmark.ref.current) return;
4023    if (this.landmarks.filter((landmark) => landmark.role === "main").length > 1, this.landmarks.length === 0) {
4024      this.landmarks = [
4025        newLandmark
4026      ], this.checkLabels(newLandmark.role);
4027      return;
4028    }
4029    let start = 0, end = this.landmarks.length - 1;
4030    for (; start <= end; ) {
4031      let mid = Math.floor((start + end) / 2), comparedPosition = newLandmark.ref.current.compareDocumentPosition(this.landmarks[mid].ref.current);
4032      !!(comparedPosition & Node.DOCUMENT_POSITION_PRECEDING || comparedPosition & Node.DOCUMENT_POSITION_CONTAINS) ? start = mid + 1 : end = mid - 1;
4033    }
4034    this.landmarks.splice(start, 0, newLandmark), this.checkLabels(newLandmark.role);
4035  }
4036  updateLandmark(landmark) {
4037    let index = this.landmarks.findIndex((l3) => l3.ref === landmark.ref);
4038    index >= 0 && (this.landmarks[index] = {
4039      ...this.landmarks[index],
4040      ...landmark
4041    }, this.checkLabels(this.landmarks[index].role));
4042  }
4043  removeLandmark(ref) {
4044    this.landmarks = this.landmarks.filter((landmark) => landmark.ref !== ref), this.teardownIfNeeded();
4045  }
4046  /**
4047  * Warn if there are 2+ landmarks with the same role but no label.
4048  * Labels for landmarks with the same role must also be unique.
4049  *
4050  * See https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.
4051  */
4052  checkLabels(role) {
4053    let landmarksWithRole = this.getLandmarksByRole(role);
4054    landmarksWithRole.size > 1 && [
4055      ...landmarksWithRole
4056    ].filter((landmark) => !landmark.label).length > 0;
4057  }
4058  /**
4059  * Get the landmark that is the closest parent in the DOM.
4060  * Returns undefined if no parent is a landmark.
4061  */
4062  closestLandmark(element) {
4063    let landmarkMap = new Map(this.landmarks.map((l3) => [
4064      l3.ref.current,
4065      l3
4066    ])), currentElement = element;
4067    for (; currentElement && !landmarkMap.has(currentElement) && currentElement !== document.body && currentElement.parentElement; ) currentElement = currentElement.parentElement;
4068    return landmarkMap.get(currentElement);
4069  }
4070  /**
4071  * Gets the next landmark, in DOM focus order, or previous if backwards is specified.
4072  * If last landmark, next should be the first landmark.
4073  * If not inside a landmark, will return first landmark.
4074  * Returns undefined if there are no landmarks.
4075  */
4076  getNextLandmark(element, { backward }) {
4077    var _this_landmarks_nextLandmarkIndex_ref_current;
4078    let currentLandmark = this.closestLandmark(element), nextLandmarkIndex = backward ? this.landmarks.length - 1 : 0;
4079    currentLandmark && (nextLandmarkIndex = this.landmarks.indexOf(currentLandmark) + (backward ? -1 : 1));
4080    let wrapIfNeeded = () => {
4081      if (nextLandmarkIndex < 0) {
4082        if (!element.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
4083          detail: {
4084            direction: "backward"
4085          },
4086          bubbles: !0,
4087          cancelable: !0
4088        }))) return !0;
4089        nextLandmarkIndex = this.landmarks.length - 1;
4090      } else if (nextLandmarkIndex >= this.landmarks.length) {
4091        if (!element.dispatchEvent(new CustomEvent("react-aria-landmark-navigation", {
4092          detail: {
4093            direction: "forward"
4094          },
4095          bubbles: !0,
4096          cancelable: !0
4097        }))) return !0;
4098        nextLandmarkIndex = 0;
4099      }
4100      return nextLandmarkIndex < 0 || nextLandmarkIndex >= this.landmarks.length;
4101    };
4102    if (wrapIfNeeded()) return;
4103    let i2 = nextLandmarkIndex;
4104    for (; !((_this_landmarks_nextLandmarkIndex_ref_current = this.landmarks[nextLandmarkIndex].ref.current) === null || _this_landmarks_nextLandmarkIndex_ref_current === void 0) && _this_landmarks_nextLandmarkIndex_ref_current.closest("[aria-hidden=true]"); ) {
4105      if (nextLandmarkIndex += backward ? -1 : 1, wrapIfNeeded()) return;
4106      if (nextLandmarkIndex === i2) break;
4107    }
4108    return this.landmarks[nextLandmarkIndex];
4109  }
4110  /**
4111  * Look at next landmark. If an element was previously focused inside, restore focus there.
4112  * If not, focus the landmark itself.
4113  * If no landmarks at all, or none with focusable elements, don't move focus.
4114  */
4115  f6Handler(e2) {
4116    e2.key === "F6" && (e2.altKey ? this.focusMain() : this.navigate(e2.target, e2.shiftKey)) && (e2.preventDefault(), e2.stopPropagation());
4117  }
4118  focusMain() {
4119    let main = this.getLandmarkByRole("main");
4120    return main && main.ref.current && document.contains(main.ref.current) ? (this.focusLandmark(main.ref.current, "forward"), !0) : !1;
4121  }
4122  navigate(from, backward) {
4123    let nextLandmark = this.getNextLandmark(from, {
4124      backward
4125    });
4126    if (!nextLandmark) return !1;
4127    if (nextLandmark.lastFocused) {
4128      let lastFocused = nextLandmark.lastFocused;
4129      if (document.body.contains(lastFocused))
4130        return lastFocused.focus(), !0;
4131    }
4132    return nextLandmark.ref.current && document.contains(nextLandmark.ref.current) ? (this.focusLandmark(nextLandmark.ref.current, backward ? "backward" : "forward"), !0) : !1;
4133  }
4134  /**
4135  * Sets lastFocused for a landmark, if focus is moved within that landmark.
4136  * Lets the last focused landmark know it was blurred if something else is focused.
4137  */
4138  focusinHandler(e2) {
4139    let currentLandmark = this.closestLandmark(e2.target);
4140    currentLandmark && currentLandmark.ref.current !== e2.target && this.updateLandmark({
4141      ref: currentLandmark.ref,
4142      lastFocused: e2.target
4143    });
4144    let previousFocusedElement = e2.relatedTarget;
4145    if (previousFocusedElement) {
4146      let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);
4147      closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement && closestPreviousLandmark.blur();
4148    }
4149  }
4150  /**
4151  * Track if the focus is lost to the body. If it is, do cleanup on the landmark that last had focus.
4152  */
4153  focusoutHandler(e2) {
4154    let previousFocusedElement = e2.target, nextFocusedElement = e2.relatedTarget;
4155    if (!nextFocusedElement || nextFocusedElement === document) {
4156      let closestPreviousLandmark = this.closestLandmark(previousFocusedElement);
4157      closestPreviousLandmark && closestPreviousLandmark.ref.current === previousFocusedElement && closestPreviousLandmark.blur();
4158    }
4159  }
4160  createLandmarkController() {
4161    let instance = this;
4162    return instance.refCount++, instance.setupIfNeeded(), {
4163      navigate(direction, opts) {
4164        let element = opts?.from || document.activeElement;
4165        return instance.navigate(element, direction === "backward");
4166      },
4167      focusNext(opts) {
4168        let element = opts?.from || document.activeElement;
4169        return instance.navigate(element, !1);
4170      },
4171      focusPrevious(opts) {
4172        let element = opts?.from || document.activeElement;
4173        return instance.navigate(element, !0);
4174      },
4175      focusMain() {
4176        return instance.focusMain();
4177      },
4178      dispose() {
4179        instance && (instance.refCount--, instance.teardownIfNeeded(), instance = null);
4180      }
4181    };
4182  }
4183  registerLandmark(landmark) {
4184    return this.landmarks.find((l3) => l3.ref === landmark.ref) ? this.updateLandmark(landmark) : this.addLandmark(landmark), () => this.removeLandmark(landmark.ref);
4185  }
4186  constructor() {
4187    this.landmarks = [], this.isListening = !1, this.refCount = 0, this.version = $a86207c5d7f7e1fb$var$LANDMARK_API_VERSION, this.f6Handler = this.f6Handler.bind(this), this.focusinHandler = this.focusinHandler.bind(this), this.focusoutHandler = this.focusoutHandler.bind(this);
4188  }
4189};
4190function $a86207c5d7f7e1fb$export$4cc632584fd87fae(props, ref) {
4191  let { role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, focus } = props, manager = $a86207c5d7f7e1fb$var$useLandmarkManager(), label = ariaLabel || ariaLabelledby, [isLandmarkFocused, setIsLandmarkFocused] = useState(!1), defaultFocus = useCallback(() => {
4192    setIsLandmarkFocused(!0);
4193  }, [
4194    setIsLandmarkFocused
4195  ]), blur = useCallback(() => {
4196    setIsLandmarkFocused(!1);
4197  }, [
4198    setIsLandmarkFocused
4199  ]);
4200  return $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
4201    if (manager) return manager.registerLandmark({
4202      ref,
4203      label,
4204      role,
4205      focus: focus || defaultFocus,
4206      blur
4207    });
4208  }, [
4209    manager,
4210    label,
4211    ref,
4212    role,
4213    focus,
4214    defaultFocus,
4215    blur
4216  ]), useEffect(() => {
4217    var _ref_current;
4218    isLandmarkFocused && ((_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.focus());
4219  }, [
4220    isLandmarkFocused,
4221    ref
4222  ]), {
4223    landmarkProps: {
4224      role,
4225      tabIndex: isLandmarkFocused ? -1 : void 0,
4226      "aria-label": ariaLabel,
4227      "aria-labelledby": ariaLabelledby
4228    }
4229  };
4230}
4231
vendor: 773 bytes, lines 4232-4269
4232// src/manager/hooks/useLandmark.ts
4233function useLandmark(props, ref) {
4234  let { landmarkProps } = $a86207c5d7f7e1fb$export$4cc632584fd87fae(props, ref);
4235  return {
4236    landmarkProps: {
4237      ...landmarkProps,
4238      "data-sb-landmark": !0
4239    }
4240  };
4241}
4242
4243// src/manager/components/mobile/navigation/MobileAddonsDrawer.tsx
4244init_react();
4245var MobileAddonsDrawer = ({
4246  children,
4247  id,
4248  isOpen,
4249  onOpenChange
4250}) => react_default.createElement(
4251  Modal,
4252  {
4253    ariaLabel: "Addon panel",
4254    transitionDuration: 300,
4255    variant: "bottom-drawer",
4256    height: "42vh",
4257    id,
4258    open: isOpen,
4259    onOpenChange
4260  },
4261  children
4262);
4263
4264// src/manager/components/mobile/navigation/MobileMenuDrawer.tsx
4265init_react();
4266
4267// src/manager/components/mobile/about/MobileAbout.tsx
4268init_react();
4269
vendor: 98 bytes, lines 4270-4272
4270// ../../node_modules/react-transition-state/dist/esm/hooks/useTransitionState.mjs
4271init_react();
4272
vendor: 781 bytes, lines 4273-4292
4273// ../../node_modules/react-transition-state/dist/esm/hooks/utils.mjs
4274var STATUS = ["preEnter", "entering", "entered", "preExit", "exiting", "exited", "unmounted"], getState = (status) => ({
4275  _s: status,
4276  status: STATUS[status],
4277  isEnter: status < 3,
4278  isMounted: status !== 6,
4279  isResolved: status === 2 || status > 4
4280}), startOrEnd = (unmounted) => unmounted ? 6 : 5, getEndStatus = (status, unmountOnExit) => {
4281  switch (status) {
4282    case 1:
4283    case 0:
4284      return 2;
4285    case 4:
4286    case 3:
4287      return startOrEnd(unmountOnExit);
4288  }
4289}, getTimeout = (timeout) => typeof timeout == "object" ? [timeout.enter, timeout.exit] : [timeout, timeout], nextTick = (transitState, status) => setTimeout(() => {
4290  isNaN(document.body.offsetTop) || transitState(status + 1);
4291}, 0);
4292
vendor: 1,863 bytes, lines 4293-4333
4293// ../../node_modules/react-transition-state/dist/esm/hooks/useTransitionState.mjs
4294var updateState = (status, setState, latestState, timeoutId, onChange) => {
4295  clearTimeout(timeoutId.current);
4296  let state = getState(status);
4297  setState(state), latestState.current = state, onChange && onChange({
4298    current: state
4299  });
4300}, useTransitionState = ({
4301  enter = !0,
4302  exit = !0,
4303  preEnter,
4304  preExit,
4305  timeout,
4306  initialEntered,
4307  mountOnEnter,
4308  unmountOnExit,
4309  onStateChange: onChange
4310} = {}) => {
4311  let [state, setState] = useState(() => getState(initialEntered ? 2 : startOrEnd(mountOnEnter))), latestState = useRef(state), timeoutId = useRef(), [enterTimeout, exitTimeout] = getTimeout(timeout), endTransition = useCallback(() => {
4312    let status = getEndStatus(latestState.current._s, unmountOnExit);
4313    status && updateState(status, setState, latestState, timeoutId, onChange);
4314  }, [onChange, unmountOnExit]), toggle = useCallback((toEnter) => {
4315    let transitState = (status) => {
4316      switch (updateState(status, setState, latestState, timeoutId, onChange), status) {
4317        case 1:
4318          enterTimeout >= 0 && (timeoutId.current = setTimeout(endTransition, enterTimeout));
4319          break;
4320        case 4:
4321          exitTimeout >= 0 && (timeoutId.current = setTimeout(endTransition, exitTimeout));
4322          break;
4323        case 0:
4324        case 3:
4325          timeoutId.current = nextTick(transitState, status);
4326          break;
4327      }
4328    }, enterStage = latestState.current.isEnter;
4329    typeof toEnter != "boolean" && (toEnter = !enterStage), toEnter ? !enterStage && transitState(enter ? preEnter ? 0 : 1 : 2) : enterStage && transitState(exit ? preExit ? 3 : 4 : startOrEnd(unmountOnExit));
4330  }, [endTransition, onChange, enter, exit, preEnter, preExit, enterTimeout, exitTimeout, unmountOnExit]);
4331  return [state, toggle, endTransition];
4332};
4333
vendor: 3,209 bytes, lines 4334-4403
4334// ../../node_modules/react-transition-state/dist/esm/hooks/useTransitionMap.mjs
4335init_react();
4336var updateState2 = (key, status, setStateMap, latestStateMap, timeoutId, onChange) => {
4337  clearTimeout(timeoutId);
4338  let state = getState(status), stateMap = new Map(latestStateMap.current);
4339  stateMap.set(key, state), setStateMap(stateMap), latestStateMap.current = stateMap, onChange && onChange({
4340    key,
4341    current: state
4342  });
4343}, useTransitionMap = ({
4344  allowMultiple,
4345  enter = !0,
4346  exit = !0,
4347  preEnter,
4348  preExit,
4349  timeout,
4350  initialEntered,
4351  mountOnEnter,
4352  unmountOnExit,
4353  onStateChange: onChange
4354} = {}) => {
4355  let [stateMap, setStateMap] = useState(/* @__PURE__ */ new Map()), latestStateMap = useRef(stateMap), configMap = useRef(/* @__PURE__ */ new Map()), [enterTimeout, exitTimeout] = getTimeout(timeout), setItem = useCallback((key, config) => {
4356    let {
4357      initialEntered: _initialEntered = initialEntered
4358    } = config || {}, status = _initialEntered ? 2 : startOrEnd(mountOnEnter);
4359    updateState2(key, status, setStateMap, latestStateMap), configMap.current.set(key, {});
4360  }, [initialEntered, mountOnEnter]), deleteItem = useCallback((key) => {
4361    let newStateMap = new Map(latestStateMap.current);
4362    return newStateMap.delete(key) ? (setStateMap(newStateMap), latestStateMap.current = newStateMap, configMap.current.delete(key), !0) : !1;
4363  }, []), endTransition = useCallback((key) => {
4364    let stateObj = latestStateMap.current.get(key);
4365    if (!stateObj)
4366      return;
4367    let {
4368      timeoutId
4369    } = configMap.current.get(key), status = getEndStatus(stateObj._s, unmountOnExit);
4370    status && updateState2(key, status, setStateMap, latestStateMap, timeoutId, onChange);
4371  }, [onChange, unmountOnExit]), toggle = useCallback((key, toEnter) => {
4372    let stateObj = latestStateMap.current.get(key);
4373    if (!stateObj)
4374      return;
4375    let config = configMap.current.get(key), transitState = (status) => {
4376      switch (updateState2(key, status, setStateMap, latestStateMap, config.timeoutId, onChange), status) {
4377        case 1:
4378          enterTimeout >= 0 && (config.timeoutId = setTimeout(() => endTransition(key), enterTimeout));
4379          break;
4380        case 4:
4381          exitTimeout >= 0 && (config.timeoutId = setTimeout(() => endTransition(key), exitTimeout));
4382          break;
4383        case 0:
4384        case 3:
4385          config.timeoutId = nextTick(transitState, status);
4386          break;
4387      }
4388    }, enterStage = stateObj.isEnter;
4389    typeof toEnter != "boolean" && (toEnter = !enterStage), toEnter ? enterStage || (transitState(enter ? preEnter ? 0 : 1 : 2), !allowMultiple && latestStateMap.current.forEach((_2, _key) => _key !== key && toggle(_key, !1))) : enterStage && transitState(exit ? preExit ? 3 : 4 : startOrEnd(unmountOnExit));
4390  }, [onChange, endTransition, allowMultiple, enter, exit, preEnter, preExit, enterTimeout, exitTimeout, unmountOnExit]), toggleAll = useCallback((toEnter) => {
4391    if (!(!allowMultiple && toEnter !== !1))
4392      for (let key of latestStateMap.current.keys()) toggle(key, toEnter);
4393  }, [allowMultiple, toggle]);
4394  return {
4395    stateMap,
4396    toggle,
4397    toggleAll,
4398    endTransition,
4399    setItem,
4400    deleteItem
4401  };
4402};
4403
vendor: 6,192 bytes, lines 4404-4567
4404// src/manager/components/upgrade/UpgradeBlock.tsx
4405init_react();
4406var UpgradeBlock = ({ onNavigateToWhatsNew }) => {
4407  let api = useStorybookApi(), [activeTab, setActiveTab] = useState("npm");
4408  return react_default.createElement(Container2, null, react_default.createElement("strong", null, "You are on Storybook ", api.getCurrentVersion().version), react_default.createElement("p", null, "Run the following script to check for updates and upgrade to the latest version."), react_default.createElement(Tabs2, null, react_default.createElement(ButtonTab, { active: activeTab === "npm", onClick: () => setActiveTab("npm") }, "npm"), react_default.createElement(ButtonTab, { active: activeTab === "yarn", onClick: () => setActiveTab("yarn") }, "yarn"), react_default.createElement(ButtonTab, { active: activeTab === "pnpm", onClick: () => setActiveTab("pnpm") }, "pnpm")), react_default.createElement(Code2, null, activeTab === "npm" ? "npx storybook@latest upgrade" : `${activeTab} dlx storybook@latest upgrade`), onNavigateToWhatsNew && react_default.createElement(Link, { onClick: onNavigateToWhatsNew }, "See what's new in Storybook"));
4409}, Container2 = styled.div(({ theme }) => ({
4410  border: "1px solid",
4411  borderRadius: 5,
4412  padding: 20,
4413  marginTop: 0,
4414  borderColor: theme.appBorderColor,
4415  fontSize: theme.typography.size.s2,
4416  width: "100%",
4417  [MEDIA_DESKTOP_BREAKPOINT]: {
4418    maxWidth: 400
4419  }
4420})), Tabs2 = styled.div({
4421  display: "flex",
4422  gap: 2
4423}), Code2 = styled.pre(({ theme }) => ({
4424  background: theme.base === "light" ? "rgba(0, 0, 0, 0.05)" : theme.appBorderColor,
4425  fontSize: theme.typography.size.s2 - 1,
4426  margin: "4px 0 16px"
4427})), ButtonTab = styled.button(({ theme, active }) => ({
4428  all: "unset",
4429  alignItems: "center",
4430  gap: 10,
4431  color: theme.color.defaultText,
4432  fontSize: theme.typography.size.s2 - 1,
4433  borderBottom: "2px solid transparent",
4434  borderBottomColor: active ? theme.color.secondary : "none",
4435  padding: "0 10px 5px",
4436  marginBottom: "5px",
4437  cursor: "pointer"
4438}));
4439
4440// src/manager/components/mobile/about/MobileAbout.tsx
4441var MobileAbout = () => {
4442  let { isMobileAboutOpen, setMobileAboutOpen } = useLayout(), aboutRef = useRef(null), [state, toggle] = useTransitionState({
4443    timeout: 300,
4444    mountOnEnter: !0,
4445    unmountOnExit: !0
4446  });
4447  return useEffect(() => {
4448    toggle(isMobileAboutOpen);
4449  }, [isMobileAboutOpen, toggle]), state.isMounted ? react_default.createElement(
4450    Container3,
4451    {
4452      ref: aboutRef,
4453      $status: state.status,
4454      $transitionDuration: 300
4455    },
4456    react_default.createElement(ScrollArea, { vertical: !0, offset: 3, scrollbarSize: 6 }, react_default.createElement(InnerArea, null, react_default.createElement(
4457      CloseButton,
4458      {
4459        onClick: () => setMobileAboutOpen(!1),
4460        ariaLabel: "Close about section",
4461        tooltip: "Close about section",
4462        variant: "ghost"
4463      },
4464      react_default.createElement(ArrowLeftIcon, null),
4465      "Back"
4466    ), react_default.createElement(LinkContainer, null, react_default.createElement(
4467      LinkLine,
4468      {
4469        href: "https://github.com/storybookjs/storybook",
4470        target: "_blank",
4471        rel: "noopener noreferrer"
4472      },
4473      react_default.createElement(LinkLeft, null, react_default.createElement(GithubIcon, null), react_default.createElement("span", null, "Github")),
4474      react_default.createElement(ShareAltIcon, { width: 12 })
4475    ), react_default.createElement(
4476      LinkLine,
4477      {
4478        href: "https://storybook.js.org/docs/get-started/install?ref=ui",
4479        target: "_blank",
4480        rel: "noopener noreferrer"
4481      },
4482      react_default.createElement(LinkLeft, null, react_default.createElement(StorybookIcon, null), react_default.createElement("span", null, "Documentation")),
4483      react_default.createElement(ShareAltIcon, { width: 12 })
4484    )), react_default.createElement(UpgradeBlock, null), react_default.createElement(BottomText, null, "Open source software maintained by", " ", react_default.createElement(Link, { href: "https://chromatic.com", target: "_blank", rel: "noopener noreferrer" }, "Chromatic"), " ", "and the", " ", react_default.createElement(
4485      Link,
4486      {
4487        href: "https://github.com/storybookjs/storybook/graphs/contributors",
4488        rel: "noopener noreferrer"
4489      },
4490      "Storybook Community"
4491    ))))
4492  ) : null;
4493}, slideFromRight = keyframes({
4494  from: {
4495    opacity: 0,
4496    transform: "translate(20px, 0)"
4497  },
4498  to: {
4499    opacity: 1,
4500    transform: "translate(0, 0)"
4501  }
4502}), slideToRight = keyframes({
4503  from: {
4504    opacity: 1,
4505    transform: "translate(0, 0)"
4506  },
4507  to: {
4508    opacity: 0,
4509    transform: "translate(20px, 0)"
4510  }
4511}), Container3 = styled.div(
4512  ({ theme, $status, $transitionDuration }) => ({
4513    position: "absolute",
4514    width: "100%",
4515    height: "100%",
4516    borderRadius: "10px 10px 0 0",
4517    top: 0,
4518    left: 0,
4519    zIndex: 11,
4520    overflow: "auto",
4521    color: theme.color.defaultText,
4522    background: theme.background.content,
4523    animation: $status === "exiting" ? `${slideToRight} ${$transitionDuration}ms` : `${slideFromRight} ${$transitionDuration}ms`
4524  })
4525), InnerArea = styled.div({
4526  display: "flex",
4527  flexDirection: "column",
4528  gap: 20,
4529  padding: "25px 12px 20px"
4530}), LinkContainer = styled.div({}), LinkLine = styled.a(({ theme }) => ({
4531  all: "unset",
4532  display: "flex",
4533  alignItems: "center",
4534  justifyContent: "space-between",
4535  fontSize: theme.typography.size.s2 - 1,
4536  borderBottom: `1px solid ${theme.appBorderColor}`,
4537  cursor: "pointer",
4538  padding: "0 10px",
4539  "&:last-child": {
4540    borderBottom: "none"
4541  }
4542})), LinkLeft = styled.div(({ theme }) => ({
4543  display: "flex",
4544  alignItems: "center",
4545  fontSize: theme.typography.size.s2 - 1,
4546  height: 40,
4547  gap: 5
4548})), BottomText = styled.div(({ theme }) => ({
4549  fontSize: theme.typography.size.s2 - 1,
4550  marginTop: 30
4551})), CloseButton = styled(Button)({
4552  alignSelf: "start"
4553});
4554
4555// src/manager/components/mobile/navigation/MobileMenuDrawer.tsx
4556var MobileMenuDrawer = ({
4557  children,
4558  id,
4559  isOpen,
4560  onOpenChange
4561}) => react_default.createElement(
4562  Modal,
4563  {
4564    ariaLabel: "Menu",
4565    transitionDuration: 300,
4566    variant: "bottom-drawer",
4567    height: "80
4567vh",
4568    id,
4569    open: isOpen,
4570    onOpenChange
4571  },
4572  children,
4573  react_default.createElement(MobileAbout, null)
4574);
4575
vendor: 2,983 bytes, lines 4576-4643
4576// src/manager/components/mobile/navigation/MobileNavigation.tsx
4577function combineIndexes(rootIndex, refs) {
4578  let combinedIndex = { ...rootIndex || {} };
4579  return Object.values(refs).forEach((ref) => {
4580    ref.index && Object.assign(combinedIndex, ref.index);
4581  }), combinedIndex;
4582}
4583var useFullStoryName = () => {
4584  let { index, refs } = useStorybookState(), api = useStorybookApi(), currentStory = api.getCurrentStoryData();
4585  if (!currentStory)
4586    return "";
4587  let combinedIndex = combineIndexes(index, refs || {}), storyLabel = currentStory.renderLabel?.(currentStory, api), fullStoryName = typeof storyLabel == "string" ? storyLabel : currentStory.name, node = combinedIndex[currentStory.id];
4588  for (; node && "parent" in node && node.parent && combinedIndex[node.parent] && fullStoryName.length < 24; ) {
4589    node = combinedIndex[node.parent];
4590    let parentLabel = node.renderLabel?.(node, api);
4591    fullStoryName = `${typeof parentLabel == "string" ? parentLabel : node.name}/${fullStoryName}`;
4592  }
4593  return fullStoryName;
4594}, MobileNavigation = ({
4595  menu,
4596  panel,
4597  showPanel,
4598  ...props
4599}) => {
4600  let { isMobileMenuOpen, isMobilePanelOpen, setMobileMenuOpen, setMobilePanelOpen } = useLayout(), fullStoryName = useFullStoryName(), headingId = $bdb11010cef70236$export$f680877a34711e37(), sectionRef = useRef(null), { landmarkProps } = useLandmark(
4601    { "aria-labelledby": headingId, role: "banner" },
4602    sectionRef
4603  );
4604  return react_default.createElement(Container4, { ...props }, react_default.createElement(
4605    MobileMenuDrawer,
4606    {
4607      id: "storybook-mobile-menu",
4608      isOpen: isMobileMenuOpen,
4609      onOpenChange: setMobileMenuOpen
4610    },
4611    menu
4612  ), react_default.createElement(
4613    MobileAddonsDrawer,
4614    {
4615      id: "storybook-mobile-addon-panel",
4616      isOpen: isMobilePanelOpen,
4617      onOpenChange: setMobilePanelOpen
4618    },
4619    panel
4620  ), !isMobilePanelOpen && react_default.createElement(MobileBottomBar, { className: "sb-bar", ...landmarkProps, ref: sectionRef }, react_default.createElement("h2", { id: headingId, className: "sb-sr-only" }, "Navigation controls"), react_default.createElement(
4621    BottomBarButton,
4622    {
4623      padding: "small",
4624      variant: "ghost",
4625      onClick: () => setMobileMenuOpen(!isMobileMenuOpen),
4626      ariaLabel: "Open navigation menu",
4627      "aria-expanded": isMobileMenuOpen,
4628      "aria-controls": "storybook-mobile-menu"
4629    },
4630    react_default.createElement(MenuIcon, null),
4631    react_default.createElement(Text, null, fullStoryName)
4632  ), react_default.createElement("span", { className: "sb-sr-only", "aria-current": "page" }, fullStoryName), showPanel && react_default.createElement(
4633    BottomBarButton,
4634    {
4635      padding: "small",
4636      variant: "ghost",
4637      onClick: () => setMobilePanelOpen(!0),
4638      ariaLabel: "Open addon panel",
4639      "aria-expanded": isMobilePanelOpen,
4640      "aria-controls": "storybook-mobile-addon-panel"
4641    },
4642    react_default.createElement(BottomBarToggleIcon, null)
4643  )
vendor: 2,745 bytes, lines 4643-4727
4643));
4644}, Container4 = styled.section(({ theme }) => ({
4645  bottom: 0,
4646  left: 0,
4647  width: "100%",
4648  zIndex: 10,
4649  background: theme.barBg,
4650  borderTop: `1px solid ${theme.appBorderColor}`
4651})), MobileBottomBar = styled.header({
4652  display: "flex",
4653  alignItems: "center",
4654  justifyContent: "space-between",
4655  width: "100%",
4656  height: 40,
4657  padding: "0 6px",
4658  /* Because Popper.js's tooltip is creating extra div layers, we have to
4659   * punch through them to configure the button to ellipsize. */
4660  "& > *:first-child": {
4661    /* 6px padding * 2 + 28px for the orientation button */
4662    maxWidth: "calc(100% - 40px)",
4663    "& > button": {
4664      maxWidth: "100%"
4665    },
4666    "& > button p": {
4667      textOverflow: "ellipsis"
4668    }
4669  }
4670}), BottomBarButton = styled(Button)({
4671  WebkitLineClamp: 1,
4672  flexShrink: 1,
4673  p: {
4674    textOverflow: "ellipsis"
4675  }
4676}), Text = styled.p({
4677  display: "-webkit-box",
4678  WebkitLineClamp: 1,
4679  WebkitBoxOrient: "vertical",
4680  overflow: "hidden"
4681});
4682
4683// src/manager/components/layout/MainAreaContainer.tsx
4684init_react();
4685var PagesInnerContainer = styled.main(({ theme }) => ({
4686  display: "flex",
4687  flexDirection: "column",
4688  gridRowStart: "sidebar-start",
4689  gridRowEnd: "-1",
4690  gridColumnStart: "sidebar-end",
4691  gridColumnEnd: "-1",
4692  backgroundColor: theme.appContentBg,
4693  zIndex: 1
4694})), PagesContainer = react_default.memo(function(props) {
4695  let { children } = props, mainRef = useRef(null), { landmarkProps } = useLandmark(
4696    { "aria-labelledby": "main-content-heading", role: "main" },
4697    mainRef
4698  );
4699  return react_default.createElement(PagesInnerContainer, { id: "main-content-wrapper", ref: mainRef, ...landmarkProps }, react_default.createElement("h2", { id: "main-content-heading", className: "sb-sr-only" }, "Main content"), children);
4700}), MainInnerContainer = styled.div(({ theme, shown }) => ({
4701  flex: 1,
4702  position: "relative",
4703  backgroundColor: theme.appContentBg,
4704  display: shown ? "grid" : "none",
4705  // This is needed to make the content container fill the available space
4706  overflow: "auto",
4707  [MEDIA_DESKTOP_BREAKPOINT]: {
4708    flex: "auto",
4709    gridArea: "content"
4710  }
4711})), MainAreaContainer = react_default.memo(function({
4712  showPages,
4713  slotMain,
4714  slotPages
4715}) {
4716  return react_default.createElement(react_default.Fragment, null, showPages ? react_default.createElement(PagesContainer, null, slotPages) : react_default.createElement(Match, { path: /(^\/story|docs|onboarding\/|^\/$)/, startsWith: !1 }, ({ match }) => react_default.createElement(MainInnerContainer, { shown: !!match }, slotMain)));
4717});
4718
4719// src/manager/components/layout/PanelContainer.tsx
4720init_react();
4721
4722// src/manager/components/layout/Drag.tsx
4723init_react();
4724
4725// src/components/components/tooltip/TooltipNote.tsx
4726init_react();
4727var 
4727Note = styled.div(({ theme }) => ({
4728  padding: "2px 6px",
4729  lineHeight: "16px",
4730  fontSize: 10,
4731  fontWeight: theme.typography.weight.bold,
4732  color: theme.color.lightest,
4733  boxShadow: "0 0 5px 0 rgba(0, 0, 0, 0.3)",
4734  borderRadius: 4,
4735  whiteSpace: "nowrap",
4736  pointerEvents: "none",
4737  zIndex: -1,
4738  background: theme.base === "light" ? "rgba(60, 60, 60, 0.9)" : "rgba(0, 0, 0, 0.95)"
4739})), TooltipNote2 = ({ note, ...props }) => react_default.createElement(Note, {
vendor: 93 bytes, lines 4739-4743
4739 ...props }, note);
4740
4741// src/components/components/tooltip/TooltipProvider.tsx
4742init_react();
4743
vendor: 4,261 bytes, lines 4744-4828
4744// ../../node_modules/@react-aria/interactions/dist/utils.mjs
4745init_react();
4746function $8a9cb279dc87e130$export$525bc4921d56d4a(nativeEvent) {
4747  let event = nativeEvent;
4748  return event.nativeEvent = nativeEvent, event.isDefaultPrevented = () => event.defaultPrevented, event.isPropagationStopped = () => event.cancelBubble, event.persist = () => {
4749  }, event;
4750}
4751function $8a9cb279dc87e130$export$c2b7abe5d61ec696(event, target) {
4752  Object.defineProperty(event, "target", {
4753    value: target
4754  }), Object.defineProperty(event, "currentTarget", {
4755    value: target
4756  });
4757}
4758function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
4759  let stateRef = useRef({
4760    isFocused: !1,
4761    observer: null
4762  });
4763  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
4764    let state = stateRef.current;
4765    return () => {
4766      state.observer && (state.observer.disconnect(), state.observer = null);
4767    };
4768  }, []);
4769  let dispatchBlur = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => {
4770    onBlur?.(e2);
4771  });
4772  return useCallback((e2) => {
4773    if (e2.target instanceof HTMLButtonElement || e2.target instanceof HTMLInputElement || e2.target instanceof HTMLTextAreaElement || e2.target instanceof HTMLSelectElement) {
4774      stateRef.current.isFocused = !0;
4775      let target = e2.target, onBlurHandler = (e3) => {
4776        if (stateRef.current.isFocused = !1, target.disabled) {
4777          let event = $8a9cb279dc87e130$export$525bc4921d56d4a(e3);
4778          dispatchBlur(event);
4779        }
4780        stateRef.current.observer && (stateRef.current.observer.disconnect(), stateRef.current.observer = null);
4781      };
4782      target.addEventListener("focusout", onBlurHandler, {
4783        once: !0
4784      }), stateRef.current.observer = new MutationObserver(() => {
4785        if (stateRef.current.isFocused && target.disabled) {
4786          var _stateRef_current_observer;
4787          (_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer === void 0 || _stateRef_current_observer.disconnect();
4788          let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
4789          target.dispatchEvent(new FocusEvent("blur", {
4790            relatedTarget: relatedTargetEl
4791          })), target.dispatchEvent(new FocusEvent("focusout", {
4792            bubbles: !0,
4793            relatedTarget: relatedTargetEl
4794          }));
4795        }
4796      }), stateRef.current.observer.observe(target, {
4797        attributes: !0,
4798        attributeFilter: [
4799          "disabled"
4800        ]
4801      });
4802    }
4803  }, [
4804    dispatchBlur
4805  ]);
4806}
4807var $8a9cb279dc87e130$export$fda7da73ab5d4c48 = !1;
4808function $8a9cb279dc87e130$export$cabe61c495ee3649(target) {
4809  for (; target && !$b4b717babfbb907b$export$4c063cf1350e6fed(target); ) target = target.parentElement;
4810  let window2 = $431fbd86ca7dc216$export$f21a1ffae260145a(target), activeElement = window2.document.activeElement;
4811  if (!activeElement || activeElement === target) return;
4812  $8a9cb279dc87e130$export$fda7da73ab5d4c48 = !0;
4813  let isRefocusing = !1, onBlur = (e2) => {
4814    (e2.target === activeElement || isRefocusing) && e2.stopImmediatePropagation();
4815  }, onFocusOut = (e2) => {
4816    (e2.target === activeElement || isRefocusing) && (e2.stopImmediatePropagation(), !target && !isRefocusing && (isRefocusing = !0, $7215afc6de606d6b$export$de79e2c695e052f3(activeElement), cleanup()));
4817  }, onFocus = (e2) => {
4818    (e2.target === target || isRefocusing) && e2.stopImmediatePropagation();
4819  }, onFocusIn = (e2) => {
4820    (e2.target === target || isRefocusing) && (e2.stopImmediatePropagation(), isRefocusing || (isRefocusing = !0, $7215afc6de606d6b$export$de79e2c695e052f3(activeElement), cleanup()));
4821  };
4822  window2.addEventListener("blur", onBlur, !0), window2.addEventListener("focusout", onFocusOut, !0), window2.addEventListener("focusin", onFocusIn, !0), window2.addEventListener("focus", onFocus, !0);
4823  let cleanup = () => {
4824    cancelAnimationFrame(raf), window2.removeEventListener("blur", onBlur, !0), window2.removeEventListener("focusout", onFocusOut, !0), window2.removeEventListener("focusin", onFocusIn, !0), window2.removeEventListener("focus", onFocus, !0), $8a9cb279dc87e130$export$fda7da73ab5d4c48 = !1, isRefocusing = !1;
4825  }, raf = requestAnimationFrame(cleanup);
4826  return cleanup;
4827}
4828
vendor: 2,247 bytes, lines 4829-4859
4829// ../../node_modules/@react-aria/interactions/dist/textSelection.mjs
4830var $14c0b72509d70225$var$state = "default", $14c0b72509d70225$var$savedUserSelect = "", $14c0b72509d70225$var$modifiedElementMap = /* @__PURE__ */ new WeakMap();
4831function $14c0b72509d70225$export$16a4697467175487(target) {
4832  if ($c87311424ea30a05$export$fedb369cb70207f1()) {
4833    if ($14c0b72509d70225$var$state === "default") {
4834      let documentObject = $431fbd86ca7dc216$export$b204af158042fbac(target);
4835      $14c0b72509d70225$var$savedUserSelect = documentObject.documentElement.style.webkitUserSelect, documentObject.documentElement.style.webkitUserSelect = "none";
4836    }
4837    $14c0b72509d70225$var$state = "disabled";
4838  } else if (target instanceof HTMLElement || target instanceof SVGElement) {
4839    let property = "userSelect" in target.style ? "userSelect" : "webkitUserSelect";
4840    $14c0b72509d70225$var$modifiedElementMap.set(target, target.style[property]), target.style[property] = "none";
4841  }
4842}
4843function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
4844  if ($c87311424ea30a05$export$fedb369cb70207f1()) {
4845    if ($14c0b72509d70225$var$state !== "disabled") return;
4846    $14c0b72509d70225$var$state = "restoring", setTimeout(() => {
4847      $bbed8b41f857bcc0$export$24490316f764c430(() => {
4848        if ($14c0b72509d70225$var$state === "restoring") {
4849          let documentObject = $431fbd86ca7dc216$export$b204af158042fbac(target);
4850          documentObject.documentElement.style.webkitUserSelect === "none" && (documentObject.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || ""), $14c0b72509d70225$var$savedUserSelect = "", $14c0b72509d70225$var$state = "default";
4851        }
4852      });
4853    }, 300);
4854  } else if ((target instanceof HTMLElement || target instanceof SVGElement) && target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
4855    let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target), property = "userSelect" in target.style ? "userSelect" : "webkitUserSelect";
4856    target.style[property] === "none" && (target.style[property] = targetOldUserSelect), target.getAttribute("style") === "" && target.removeAttribute("style"), $14c0b72509d70225$var$modifiedElementMap.delete(target);
4857  }
4858}
4859
vendor: 266 bytes, lines 4860-4867
4860// ../../node_modules/@react-aria/interactions/dist/context.mjs
4861init_react();
4862var $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = react_default.createContext({
4863  register: () => {
4864  }
4865});
4866$ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = "PressResponderContext";
4867
vendor: 210 bytes, lines 4868-4872
4868// ../../node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js
4869function _class_apply_descriptor_get(receiver, descriptor) {
4870  return descriptor.get ? descriptor.get.call(receiver) : descriptor.value;
4871}
4872
vendor: 300 bytes, lines 4873-4878
4873// ../../node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js
4874function _class_extract_field_descriptor(receiver, privateMap, action) {
4875  if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
4876  return privateMap.get(receiver);
4877}
4878
vendor: 269 bytes, lines 4879-4884
4879// ../../node_modules/@swc/helpers/esm/_class_private_field_get.js
4880function _class_private_field_get(receiver, privateMap) {
4881  var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
4882  return _class_apply_descriptor_get(receiver, descriptor);
4883}
4884
vendor: 263 bytes, lines 4885-4890
4885// ../../node_modules/@swc/helpers/esm/_check_private_redeclaration.js
4886function _check_private_redeclaration(obj, privateCollection) {
4887  if (privateCollection.has(obj))
4888    throw new TypeError("Cannot initialize the same private elements twice on an object");
4889}
4890
vendor: 209 bytes, lines 4891-4895
4891// ../../node_modules/@swc/helpers/esm/_class_private_field_init.js
4892function _class_private_field_init(obj, privateMap, value) {
4893  _check_private_redeclaration(obj, privateMap), privateMap.set(obj, value);
4894}
4895
vendor: 345 bytes, lines 4896-4905
4896// ../../node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js
4897function _class_apply_descriptor_set(receiver, descriptor, value) {
4898  if (descriptor.set) descriptor.set.call(receiver, value);
4899  else {
4900    if (!descriptor.writable)
4901      throw new TypeError("attempted to set read only private field");
4902    descriptor.value = value;
4903  }
4904}
4905
vendor: 290 bytes, lines 4906-4911
4906// ../../node_modules/@swc/helpers/esm/_class_private_field_set.js
4907function _class_private_field_set(receiver, privateMap, value) {
4908  var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
4909  return _class_apply_descriptor_set(receiver, descriptor, value), value;
4910}
4911
vendor: 17,527 bytes, lines 4912-5175
4912// ../../node_modules/@react-aria/interactions/dist/usePress.mjs
4913init_react();
4914function $f6c31cce2adf654f$var$usePressResponderContext(props) {
4915  let context = useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5);
4916  if (context) {
4917    let { register, ...contextProps } = context;
4918    props = $3ef42575df84b30b$export$9d1611c77c2fe928(contextProps, props), register();
4919  }
4920  return $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, props.ref), props;
4921}
4922var $f6c31cce2adf654f$var$_shouldStopPropagation = /* @__PURE__ */ new WeakMap(), $f6c31cce2adf654f$var$PressEvent = class {
4923  continuePropagation() {
4924    _class_private_field_set(this, $f6c31cce2adf654f$var$_shouldStopPropagation, !1);
4925  }
4926  get shouldStopPropagation() {
4927    return _class_private_field_get(this, $f6c31cce2adf654f$var$_shouldStopPropagation);
4928  }
4929  constructor(type, pointerType, originalEvent, state) {
4930    _class_private_field_init(this, $f6c31cce2adf654f$var$_shouldStopPropagation, {
4931      writable: !0,
4932      value: void 0
4933    }), _class_private_field_set(this, $f6c31cce2adf654f$var$_shouldStopPropagation, !0);
4934    var _state_target;
4935    let currentTarget = (_state_target = state?.target) !== null && _state_target !== void 0 ? _state_target : originalEvent.currentTarget, rect = currentTarget?.getBoundingClientRect(), x2, y2 = 0, clientX, clientY = null;
4936    originalEvent.clientX != null && originalEvent.clientY != null && (clientX = originalEvent.clientX, clientY = originalEvent.clientY), rect && (clientX != null && clientY != null ? (x2 = clientX - rect.left, y2 = clientY - rect.top) : (x2 = rect.width / 2, y2 = rect.height / 2)), this.type = type, this.pointerType = pointerType, this.target = originalEvent.currentTarget, this.shiftKey = originalEvent.shiftKey, this.metaKey = originalEvent.metaKey, this.ctrlKey = originalEvent.ctrlKey, this.altKey = originalEvent.altKey, this.x = x2, this.y = y2;
4937  }
4938}, $f6c31cce2adf654f$var$LINK_CLICKED = Symbol("linkClicked"), $f6c31cce2adf654f$var$STYLE_ID = "react-aria-pressable-style", $f6c31cce2adf654f$var$PRESSABLE_ATTRIBUTE = "data-react-aria-pressable";
4939function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
4940  let { onPress, onPressChange, onPressStart, onPressEnd, onPressUp, onClick, isDisabled, isPressed: isPressedProp, preventFocusOnPress, shouldCancelOnPointerExit, allowTextSelectionOnPress, ref: domRef, ...domProps } = $f6c31cce2adf654f$var$usePressResponderContext(props), [isPressed, setPressed] = useState(!1), ref = useRef({
4941    isPressed: !1,
4942    ignoreEmulatedMouseEvents: !1,
4943    didFirePressStart: !1,
4944    isTriggeringEvent: !1,
4945    activePointerId: null,
4946    target: null,
4947    isOverTarget: !1,
4948    pointerType: null,
4949    disposables: []
4950  }), { addGlobalListener, removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6(), triggerPressStart = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType) => {
4951    let state = ref.current;
4952    if (isDisabled || state.didFirePressStart) return !1;
4953    let shouldStopPropagation = !0;
4954    if (state.isTriggeringEvent = !0, onPressStart) {
4955      let event = new $f6c31cce2adf654f$var$PressEvent("pressstart", pointerType, originalEvent);
4956      onPressStart(event), shouldStopPropagation = event.shouldStopPropagation;
4957    }
4958    return onPressChange && onPressChange(!0), state.isTriggeringEvent = !1, state.didFirePressStart = !0, setPressed(!0), shouldStopPropagation;
4959  }), triggerPressEnd = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType, wasPressed = !0) => {
4960    let state = ref.current;
4961    if (!state.didFirePressStart) return !1;
4962    state.didFirePressStart = !1, state.isTriggeringEvent = !0;
4963    let shouldStopPropagation = !0;
4964    if (onPressEnd) {
4965      let event = new $f6c31cce2adf654f$var$PressEvent("pressend", pointerType, originalEvent);
4966      onPressEnd(event), shouldStopPropagation = event.shouldStopPropagation;
4967    }
4968    if (onPressChange && onPressChange(!1), setPressed(!1), onPress && wasPressed && !isDisabled) {
4969      let event = new $f6c31cce2adf654f$var$PressEvent("press", pointerType, originalEvent);
4970      onPress(event), shouldStopPropagation && (shouldStopPropagation = event.shouldStopPropagation);
4971    }
4972    return state.isTriggeringEvent = !1, shouldStopPropagation;
4973  }), triggerPressUp = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType) => {
4974    let state = ref.current;
4975    if (isDisabled) return !1;
4976    if (onPressUp) {
4977      state.isTriggeringEvent = !0;
4978      let event = new $f6c31cce2adf654f$var$PressEvent("pressup", pointerType, originalEvent);
4979      return onPressUp(event), state.isTriggeringEvent = !1, event.shouldStopPropagation;
4980    }
4981    return !0;
4982  }), cancel = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => {
4983    let state = ref.current;
4984    if (state.isPressed && state.target) {
4985      state.didFirePressStart && state.pointerType != null && triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e2), state.pointerType, !1), state.isPressed = !1, state.isOverTarget = !1, state.activePointerId = null, state.pointerType = null, removeAllGlobalListeners(), allowTextSelectionOnPress || $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
4986      for (let dispose of state.disposables) dispose();
4987      state.disposables = [];
4988    }
4989  }), cancelOnPointerExit = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => {
4990    shouldCancelOnPointerExit && cancel(e2);
4991  }), triggerClick = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => {
4992    isDisabled || onClick?.(e2);
4993  }), triggerSyntheticClick = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2, target) => {
4994    if (!isDisabled && onClick) {
4995      let event = new MouseEvent("click", e2);
4996      $8a9cb279dc87e130$export$c2b7abe5d61ec696(event, target), onClick($8a9cb279dc87e130$export$525bc4921d56d4a(event));
4997    }
4998  }), pressProps = useMemo(() => {
4999    let state = ref.current, pressProps2 = {
5000      onKeyDown(e2) {
5001        if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e2.nativeEvent, e2.currentTarget) && $d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent))) {
5002          var _state_metaKeyEvents;
5003          $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard($d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent), e2.key) && e2.preventDefault();
5004          let shouldStopPropagation = !0;
5005          if (!state.isPressed && !e2.repeat) {
5006            state.target = e2.currentTarget, state.isPressed = !0, state.pointerType = "keyboard", shouldStopPropagation = triggerPressStart(e2, "keyboard");
5007            let originalTarget = e2.currentTarget, pressUp = (e3) => {
5008              $f6c31cce2adf654f$var$isValidKeyboardEvent(e3, originalTarget) && !e3.repeat && $d4ee10de306f2510$export$4282f70798064fe0(originalTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e3)) && state.target && triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e3), "keyboard");
5009            };
5010            addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(e2.currentTarget), "keyup", $ff5963eb1fccf552$export$e08e3b67e392101e(pressUp, onKeyUp), !0);
5011          }
5012          shouldStopPropagation && e2.stopPropagation(), e2.metaKey && $c87311424ea30a05$export$9ac100e40613ea10() && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 || _state_metaKeyEvents.set(e2.key, e2.nativeEvent));
5013        } else e2.key === "Meta" && (state.metaKeyEvents = /* @__PURE__ */ new Map());
5014      },
5015      onClick(e2) {
5016        if (!(e2 && !$d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent))) && e2 && e2.button === 0 && !state.isTriggeringEvent && !$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening) {
5017          let shouldStopPropagation = !0;
5018          if (isDisabled && e2.preventDefault(), !state.ignoreEmulatedMouseEvents && !state.isPressed && (state.pointerType === "virtual" || $6a7db85432448f7f$export$60278871457622de(e2.nativeEvent))) {
5019            let stopPressStart = triggerPressStart(e2, "virtual"), stopPressUp = triggerPressUp(e2, "virtual"), stopPressEnd = triggerPressEnd(e2, "virtual");
5020            triggerClick(e2), shouldStopPropagation = stopPressStart && stopPressUp && stopPressEnd;
5021          } else if (state.isPressed && state.pointerType !== "keyboard") {
5022            let pointerType = state.pointerType || e2.nativeEvent.pointerType || "virtual", stopPressUp = triggerPressUp($f6c31cce2adf654f$var$createEvent(e2.currentTarget, e2), pointerType), stopPressEnd = triggerPressEnd($f6c31cce2adf654f$var$createEvent(e2.currentTarget, e2), pointerType, !0);
5023            shouldStopPropagation = stopPressUp && stopPressEnd, state.isOverTarget = !1, triggerClick(e2), cancel(e2);
5024          }
5025          state.ignoreEmulatedMouseEvents = !1, shouldStopPropagation && e2.stopPropagation();
5026        }
5027      }
5028    }, onKeyUp = (e2) => {
5029      var _state_metaKeyEvents;
5030      if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e2, state.target)) {
5031        var _state_metaKeyEvents1;
5032        $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard($d4ee10de306f2510$export$e58f029f0fbfdb29(e2), e2.key) && e2.preventDefault();
5033        let target = $d4ee10de306f2510$export$e58f029f0fbfdb29(e2), wasPressed = $d4ee10de306f2510$export$4282f70798064fe0(state.target, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2));
5034        triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e2), "keyboard", wasPressed), wasPressed && triggerSyntheticClick(e2, state.target), removeAllGlobalListeners(), e2.key !== "Enter" && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && $d4ee10de306f2510$export$4282f70798064fe0(state.target, target) && !e2[$f6c31cce2adf654f$var$LINK_CLICKED] && (e2[$f6c31cce2adf654f$var$LINK_CLICKED] = !0, $ea8dcbcb9ea1b556$export$95185d699e05d4d7(state.target, e2, !1)), state.isPressed = !1, (_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 || _state_metaKeyEvents1.delete(e2.key);
5035      } else if (e2.key === "Meta" && (!((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0) && _state_metaKeyEvents.size)) {
5036        var _state_target;
5037        let events2 = state.metaKeyEvents;
5038        state.metaKeyEvents = void 0;
5039        for (let event of events2.values()) (_state_target = state.target) === null || _state_target === void 0 || _state_target.dispatchEvent(new KeyboardEvent("keyup", event));
5040      }
5041    };
5042    if (typeof PointerEvent < "u") {
5043      pressProps2.onPointerDown = (e2) => {
5044        if (e2.button !== 0 || !$d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent))) return;
5045        if ($6a7db85432448f7f$export$29bf1b5f2c56cf63(e2.nativeEvent)) {
5046          state.pointerType = "virtual";
5047          return;
5048        }
5049        state.pointerType = e2.pointerType;
5050        let shouldStopPropagation = !0;
5051        if (!state.isPressed) {
5052          state.isPressed = !0, state.isOverTarget = !0, state.activePointerId = e2.pointerId, state.target = e2.currentTarget, allowTextSelectionOnPress || $14c0b72509d70225$export$16a4697467175487(state.target), shouldStopPropagation = triggerPressStart(e2, state.pointerType);
5053          let target = $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent);
5054          "releasePointerCapture" in target && target.releasePointerCapture(e2.pointerId), addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(e2.currentTarget), "pointerup", onPointerUp, !1), addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(e2.currentTarget), "pointercancel", onPointerCancel, !1);
5055        }
5056        shouldStopPropagation && e2.stopPropagation();
5057      }, pressProps2.onMouseDown = (e2) => {
5058        if ($d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent)) && e2.button === 0) {
5059          if (preventFocusOnPress) {
5060            let dispose = $8a9cb279dc87e130$export$cabe61c495ee3649(e2.target);
5061            dispose && state.disposables.push(dispose);
5062          }
5063          e2.stopPropagation();
5064        }
5065      }, pressProps2.onPointerUp = (e2) => {
5066        !$d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent)) || state.pointerType === "virtual" || e2.button === 0 && !state.isPressed && triggerPressUp(e2, state.pointerType || e2.pointerType);
5067      }, pressProps2.onPointerEnter = (e2) => {
5068        e2.pointerId === state.activePointerId && state.target && !state.isOverTarget && state.pointerType != null && (state.isOverTarget = !0, triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e2), state.pointerType));
5069      }, pressProps2.onPointerLeave = (e2) => {
5070        e2.pointerId === state.activePointerId && state.target && state.isOverTarget && state.pointerType != null && (state.isOverTarget = !1, triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e2), state.pointerType, !1), cancelOnPointerExit(e2));
5071      };
5072      let onPointerUp = (e2) => {
5073        if (e2.pointerId === state.activePointerId && state.isPressed && e2.button === 0 && state.target) {
5074          if ($d4ee10de306f2510$export$4282f70798064fe0(state.target, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2)) && state.pointerType != null) {
5075            let clicked = !1, timeout = setTimeout(() => {
5076              state.isPressed && state.target instanceof HTMLElement && (clicked ? cancel(e2) : ($7215afc6de606d6b$export$de79e2c695e052f3(state.target), state.target.click()));
5077            }, 80);
5078            addGlobalListener(e2.currentTarget, "click", () => clicked = !0, !0), state.disposables.push(() => clearTimeout(timeout));
5079          } else cancel(e2);
5080          state.isOverTarget = !1;
5081        }
5082      }, onPointerCancel = (e2) => {
5083        cancel(e2);
5084      };
5085      pressProps2.onDragStart = (e2) => {
5086        $d4ee10de306f2510$export$4282f70798064fe0(e2.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent)) && cancel(e2);
5087      };
5088    }
5089    return pressProps2;
5090  }, [
5091    addGlobalListener,
5092    isDisabled,
5093    preventFocusOnPress,
5094    removeAllGlobalListeners,
5095    allowTextSelectionOnPress,
5096    cancel,
5097    cancelOnPointerExit,
5098    triggerPressEnd,
5099    triggerPressStart,
5100    triggerPressUp,
5101    triggerClick,
5102    triggerSyntheticClick
5103  ]);
5104  return useEffect(() => {
5105    if (!domRef) return;
5106    let ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(domRef.current);
5107    if (!ownerDocument || !ownerDocument.head || ownerDocument.getElementById($f6c31cce2adf654f$var$STYLE_ID)) return;
5108    let style = ownerDocument.createElement("style");
5109    style.id = $f6c31cce2adf654f$var$STYLE_ID, style.textContent = `
5110@layer {
5111  [${$f6c31cce2adf654f$var$PRESSABLE_ATTRIBUTE}] {
5112    touch-action: pan-x pan-y pinch-zoom;
5113  }
5114}
5115    `.trim(), ownerDocument.head.prepend(style);
5116  }, [
5117    domRef
5118  ]), useEffect(() => {
5119    let state = ref.current;
5120    return () => {
5121      var _state_target;
5122      allowTextSelectionOnPress || $14c0b72509d70225$export$b0d6fa1ab32e3295((_state_target = state.target) !== null && _state_target !== void 0 ? _state_target : void 0);
5123      for (let dispose of state.disposables) dispose();
5124      state.disposables = [];
5125    };
5126  }, [
5127    allowTextSelectionOnPress
5128  ]), {
5129    isPressed: isPressedProp || isPressed,
5130    pressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, pressProps, {
5131      [$f6c31cce2adf654f$var$PRESSABLE_ATTRIBUTE]: !0
5132    })
5133  };
5134}
5135function $f6c31cce2adf654f$var$isHTMLAnchorLink(target) {
5136  return target.tagName === "A" && target.hasAttribute("href");
5137}
5138function $f6c31cce2adf654f$var$isValidKeyboardEvent(event, currentTarget) {
5139  let { key, code } = event, element = currentTarget, role = element.getAttribute("role");
5140  return (key === "Enter" || key === " " || key === "Spacebar" || code === "Space") && !(element instanceof $431fbd86ca7dc216$export$f21a1ffae260145a(element).HTMLInputElement && !$f6c31cce2adf654f$var$isValidInputKey(element, key) || element instanceof $431fbd86ca7dc216$export$f21a1ffae260145a(element).HTMLTextAreaElement || element.isContentEditable) && // Links should only trigger with Enter key
5141  !((role === "link" || !role && $f6c31cce2adf654f$var$isHTMLAnchorLink(element)) && key !== "Enter");
5142}
5143function $f6c31cce2adf654f$var$createEvent(target, e2) {
5144  let clientX = e2.clientX, clientY = e2.clientY;
5145  return {
5146    currentTarget: target,
5147    shiftKey: e2.shiftKey,
5148    ctrlKey: e2.ctrlKey,
5149    metaKey: e2.metaKey,
5150    altKey: e2.altKey,
5151    clientX,
5152    clientY
5153  };
5154}
5155function $f6c31cce2adf654f$var$shouldPreventDefaultUp(target) {
5156  return target instanceof HTMLInputElement ? !1 : target instanceof HTMLButtonElement ? target.type !== "submit" && target.type !== "reset" : !$f6c31cce2adf654f$var$isHTMLAnchorLink(target);
5157}
5158function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target, key) {
5159  return target instanceof HTMLInputElement ? !$f6c31cce2adf654f$var$isValidInputKey(target, key) : $f6c31cce2adf654f$var$shouldPreventDefaultUp(target);
5160}
5161var $f6c31cce2adf654f$var$nonTextInputTypes = /* @__PURE__ */ new Set([
5162  "checkbox",
5163  "radio",
5164  "range",
5165  "color",
5166  "file",
5167  "image",
5168  "button",
5169  "submit",
5170  "reset"
5171]);
5172function $f6c31cce2adf654f$var$isValidInputKey(target, key) {
5173  return target.type === "checkbox" || target.type === "radio" ? key === " " : $f6c31cce2adf654f$var$nonTextInputTypes.has(target.type);
5174}
5175
vendor: 5,829 bytes, lines 5176-5230
5176// ../../node_modules/@react-aria/interactions/dist/useFocusVisible.mjs
5177init_react();
5178var $507fabe10e71c6fb$var$currentModality = null, $507fabe10e71c6fb$var$changeHandlers = /* @__PURE__ */ new Set(), $507fabe10e71c6fb$export$d90243b58daecda7 = /* @__PURE__ */ new Map(), $507fabe10e71c6fb$var$hasEventBeforeFocus = !1, $507fabe10e71c6fb$var$hasBlurredWindowRecently = !1;
5179function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e2) {
5180  for (let handler of $507fabe10e71c6fb$var$changeHandlers) handler(modality, e2);
5181}
5182function $507fabe10e71c6fb$var$isValidKey(e2) {
5183  return !(e2.metaKey || !$c87311424ea30a05$export$9ac100e40613ea10() && e2.altKey || e2.ctrlKey || e2.key === "Control" || e2.key === "Shift" || e2.key === "Meta");
5184}
5185function $507fabe10e71c6fb$var$handleKeyboardEvent(e2) {
5186  $507fabe10e71c6fb$var$hasEventBeforeFocus = !0, $507fabe10e71c6fb$var$isValidKey(e2) && ($507fabe10e71c6fb$var$currentModality = "keyboard", $507fabe10e71c6fb$var$triggerChangeHandlers("keyboard", e2));
5187}
5188function $507fabe10e71c6fb$var$handlePointerEvent(e2) {
5189  $507fabe10e71c6fb$var$currentModality = "pointer", (e2.type === "mousedown" || e2.type === "pointerdown") && ($507fabe10e71c6fb$var$hasEventBeforeFocus = !0, $507fabe10e71c6fb$var$triggerChangeHandlers("pointer", e2));
5190}
5191function $507fabe10e71c6fb$var$handleClickEvent(e2) {
5192  $6a7db85432448f7f$export$60278871457622de(e2) && ($507fabe10e71c6fb$var$hasEventBeforeFocus = !0, $507fabe10e71c6fb$var$currentModality = "virtual");
5193}
5194function $507fabe10e71c6fb$var$handleFocusEvent(e2) {
5195  e2.target === window || e2.target === document || $8a9cb279dc87e130$export$fda7da73ab5d4c48 || !e2.isTrusted || (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently && ($507fabe10e71c6fb$var$currentModality = "virtual", $507fabe10e71c6fb$var$triggerChangeHandlers("virtual", e2)), $507fabe10e71c6fb$var$hasEventBeforeFocus = !1, $507fabe10e71c6fb$var$hasBlurredWindowRecently = !1);
5196}
5197function $507fabe10e71c6fb$var$handleWindowBlur() {
5198  $8a9cb279dc87e130$export$fda7da73ab5d4c48 || ($507fabe10e71c6fb$var$hasEventBeforeFocus = !1, $507fabe10e71c6fb$var$hasBlurredWindowRecently = !0);
5199}
5200function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
5201  if (typeof window > "u" || typeof document > "u" || $507fabe10e71c6fb$export$d90243b58daecda7.get($431fbd86ca7dc216$export$f21a1ffae260145a(element))) return;
5202  let windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element), documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element), focus = windowObject.HTMLElement.prototype.focus;
5203  windowObject.HTMLElement.prototype.focus = function() {
5204    $507fabe10e71c6fb$var$hasEventBeforeFocus = !0, focus.apply(this, arguments);
5205  }, documentObject.addEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, !0), documentObject.addEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, !0), documentObject.addEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, !0), windowObject.addEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, !0), windowObject.addEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, !1), typeof PointerEvent < "u" && (documentObject.addEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, !0), documentObject.addEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, !0), documentObject.addEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, !0)), windowObject.addEventListener("beforeunload", () => {
5206    $507fabe10e71c6fb$var$tearDownWindowFocusTracking(element);
5207  }, {
5208    once: !0
5209  }), $507fabe10e71c6fb$export$d90243b58daecda7.set(windowObject, {
5210    focus
5211  });
5212}
5213var $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener) => {
5214  let windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element), documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element);
5215  loadListener && documentObject.removeEventListener("DOMContentLoaded", loadListener), $507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject) && (windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus, documentObject.removeEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, !0), documentObject.removeEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, !0), documentObject.removeEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, !0), windowObject.removeEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, !0), windowObject.removeEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, !1), typeof PointerEvent < "u" && (documentObject.removeEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, !0), documentObject.removeEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, !0), documentObject.removeEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, !0)), $507fabe10e71c6fb$export$d90243b58daecda7.delete(windowObject));
5216};
5217function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
5218  let documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element), loadListener;
5219  return documentObject.readyState !== "loading" ? $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) : (loadListener = () => {
5220    $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
5221  }, documentObject.addEventListener("DOMContentLoaded", loadListener)), () => $507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener);
5222}
5223typeof document < "u" && $507fabe10e71c6fb$export$2f1888112f558a7d();
5224function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
5225  return $507fabe10e71c6fb$var$currentModality !== "pointer";
5226}
5227function $507fabe10e71c6fb$export$630ff653c5ada6a9() {
5228  return $507fabe10e71c6fb$var$currentModality;
5229}
5230
vendor: 679 bytes, lines 5231-5241
5231// ../../node_modules/@react-aria/interactions/dist/focusSafely.mjs
5232function $3ad3f6e1647bc98d$export$80f3e147d781571c(element) {
5233  let ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(element), activeElement = $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument);
5234  if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "virtual") {
5235    let lastFocusedElement = activeElement;
5236    $bbed8b41f857bcc0$export$24490316f764c430(() => {
5237      $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument) === lastFocusedElement && element.isConnected && $7215afc6de606d6b$export$de79e2c695e052f3(element);
5238    });
5239  } else $7215afc6de606d6b$export$de79e2c695e052f3(element);
5240}
5241
vendor: 1,237 bytes, lines 5242-5266
5242// ../../node_modules/@react-aria/interactions/dist/useFocus.mjs
5243init_react();
5244function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
5245  let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props, onBlur = useCallback((e2) => {
5246    if (e2.target === e2.currentTarget)
5247      return onBlurProp && onBlurProp(e2), onFocusChange && onFocusChange(!1), !0;
5248  }, [
5249    onBlurProp,
5250    onFocusChange
5251  ]), onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur), onFocus = useCallback((e2) => {
5252    let ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(e2.target), activeElement = ownerDocument ? $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument) : $d4ee10de306f2510$export$cd4e5573fbe2b576();
5253    e2.target === e2.currentTarget && activeElement === $d4ee10de306f2510$export$e58f029f0fbfdb29(e2.nativeEvent) && (onFocusProp && onFocusProp(e2), onFocusChange && onFocusChange(!0), onSyntheticFocus(e2));
5254  }, [
5255    onFocusChange,
5256    onFocusProp,
5257    onSyntheticFocus
5258  ]);
5259  return {
5260    focusProps: {
5261      onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
5262      onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
5263    }
5264  };
5265}
5266
vendor: 691 bytes, lines 5267-5293
5267// ../../node_modules/@react-aria/interactions/dist/createEventHandler.mjs
5268function $93925083ecbb358c$export$48d1ea6320830260(handler) {
5269  if (!handler) return;
5270  let shouldStopPropagation = !0;
5271  return (e2) => {
5272    let event = {
5273      ...e2,
5274      preventDefault() {
5275        e2.preventDefault();
5276      },
5277      isDefaultPrevented() {
5278        return e2.isDefaultPrevented();
5279      },
5280      stopPropagation() {
5281        shouldStopPropagation = !0;
5282      },
5283      continuePropagation() {
5284        shouldStopPropagation = !1;
5285      },
5286      isPropagationStopped() {
5287        return shouldStopPropagation;
5288      }
5289    };
5290    handler(event), shouldStopPropagation && e2.stopPropagation();
5291  };
5292}
5293
vendor: 347 bytes, lines 5294-5303
5294// ../../node_modules/@react-aria/interactions/dist/useKeyboard.mjs
5295function $46d819fcbaf35654$export$8f71654801c2f7cd(props) {
5296  return {
5297    keyboardProps: props.isDisabled ? {} : {
5298      onKeyDown: $93925083ecbb358c$export$48d1ea6320830260(props.onKeyDown),
5299      onKeyUp: $93925083ecbb358c$export$48d1ea6320830260(props.onKeyUp)
5300    }
5301  };
5302}
5303
vendor: 2,320 bytes, lines 5304-5352
5304// ../../node_modules/@react-aria/interactions/dist/useFocusable.mjs
5305init_react();
5306var $f645667febf57a63$export$f9762fab77588ecb = react_default.createContext(null);
5307function $f645667febf57a63$var$useFocusableContext(ref) {
5308  let context = useContext($f645667febf57a63$export$f9762fab77588ecb) || {};
5309  $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref);
5310  let { ref: _2, ...otherProps } = context;
5311  return otherProps;
5312}
5313var $f645667febf57a63$export$13f3202a3e5ddd5 = react_default.forwardRef(function(props, ref) {
5314  let { children, ...otherProps } = props, objRef = $df56164dff5785e2$export$4338b53315abf666(ref), context = {
5315    ...otherProps,
5316    ref: objRef
5317  };
5318  return react_default.createElement($f645667febf57a63$export$f9762fab77588ecb.Provider, {
5319    value: context
5320  }, children);
5321});
5322function $f645667febf57a63$export$4c014de7c8940b4c(props, domRef) {
5323  let { focusProps } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props), { keyboardProps } = $46d819fcbaf35654$export$8f71654801c2f7cd(props), interactions = $3ef42575df84b30b$export$9d1611c77c2fe928(focusProps, keyboardProps), domProps = $f645667febf57a63$var$useFocusableContext(domRef), interactionProps = props.isDisabled ? {} : domProps, autoFocusRef = useRef(props.autoFocus);
5324  useEffect(() => {
5325    autoFocusRef.current && domRef.current && $3ad3f6e1647bc98d$export$80f3e147d781571c(domRef.current), autoFocusRef.current = !1;
5326  }, [
5327    domRef
5328  ]);
5329  let tabIndex = props.excludeFromTabOrder ? -1 : 0;
5330  return props.isDisabled && (tabIndex = void 0), {
5331    focusableProps: $3ef42575df84b30b$export$9d1611c77c2fe928({
5332      ...interactions,
5333      tabIndex
5334    }, interactionProps)
5335  };
5336}
5337var $f645667febf57a63$export$35a3bebf7ef2d934 = forwardRef(({ children, ...props }, ref) => {
5338  ref = $df56164dff5785e2$export$4338b53315abf666(ref);
5339  let { focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c(props, ref), child = react_default.Children.only(children);
5340  useEffect(() => {
5341  }, [
5342    ref,
5343    props.isDisabled
5344  ]);
5345  let childRef = parseInt(react_default.version, 10) < 19 ? child.ref : child.props.ref;
5346  return react_default.cloneElement(child, {
5347    ...$3ef42575df84b30b$export$9d1611c77c2fe928(focusableProps, child.props),
5348    // @ts-ignore
5349    ref: $5dc95899b306f630$export$c9058316764c140e(childRef, ref)
5350  });
5351});
5352
vendor: 845 bytes, lines 5353-5373
5353// ../../node_modules/@react-aria/interactions/dist/Pressable.mjs
5354init_react();
5355var $3b117e43dc0ca95d$export$27c701ed9e449e99 = react_default.forwardRef(({ children, ...props }, ref) => {
5356  ref = $df56164dff5785e2$export$4338b53315abf666(ref);
5357  let { pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({
5358    ...props,
5359    ref
5360  }), { focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c(props, ref), child = react_default.Children.only(children);
5361  useEffect(() => {
5362  }, [
5363    ref,
5364    props.isDisabled
5365  ]);
5366  let childRef = parseInt(react_default.version, 10) < 19 ? child.ref : child.props.ref;
5367  return react_default.cloneElement(child, {
5368    ...$3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, focusableProps, child.props),
5369    // @ts-ignore
5370    ref: $5dc95899b306f630$export$c9058316764c140e(childRef, ref)
5371  });
5372});
5373
vendor: 851 bytes, lines 5374-5392
5374// ../../node_modules/@react-aria/interactions/dist/PressResponder.mjs
5375init_react();
5376var $f1ab8c75478c6f73$export$3351871ee4b288b8 = react_default.forwardRef(({ children, ...props }, ref) => {
5377  let isRegistered = useRef(!1), prevContext = useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5);
5378  ref = $df56164dff5785e2$export$4338b53315abf666(ref || prevContext?.ref);
5379  let context = $3ef42575df84b30b$export$9d1611c77c2fe928(prevContext || {}, {
5380    ...props,
5381    ref,
5382    register() {
5383      isRegistered.current = !0, prevContext && prevContext.register();
5384    }
5385  });
5386  return $e7801be82b4b2a53$export$4debdb1a3f0fa79e(prevContext, ref), useEffect(() => {
5387    isRegistered.current || (isRegistered.current = !0);
5388  }, []), react_default.createElement($ae1eeba8b9eafd08$export$5165eccb35aaadb5.Provider, {
5389    value: context
5390  }, children);
5391});
5392
vendor: 86 bytes, lines 5393-5395
5393// ../../node_modules/@react-aria/interactions/dist/useFocusWithin.mjs
5394init_react();
5395
vendor: 3,554 bytes, lines 5396-5471
5396// ../../node_modules/@react-aria/interactions/dist/useHover.mjs
5397init_react();
5398var $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = !1, $6179b936705e76d3$var$hoverCount = 0;
5399function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
5400  $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = !0, setTimeout(() => {
5401    $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = !1;
5402  }, 50);
5403}
5404function $6179b936705e76d3$var$handleGlobalPointerEvent(e2) {
5405  e2.pointerType === "touch" && $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
5406}
5407function $6179b936705e76d3$var$setupGlobalTouchEvents() {
5408  if (!(typeof document > "u"))
5409    return $6179b936705e76d3$var$hoverCount === 0 && typeof PointerEvent < "u" && document.addEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent), $6179b936705e76d3$var$hoverCount++, () => {
5410      $6179b936705e76d3$var$hoverCount--, !($6179b936705e76d3$var$hoverCount > 0) && typeof PointerEvent < "u" && document.removeEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
5411    };
5412}
5413function $6179b936705e76d3$export$ae780daf29e6d456(props) {
5414  let { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props, [isHovered, setHovered] = useState(!1), state = useRef({
5415    isHovered: !1,
5416    ignoreEmulatedMouseEvents: !1,
5417    pointerType: "",
5418    target: null
5419  }).current;
5420  useEffect($6179b936705e76d3$var$setupGlobalTouchEvents, []);
5421  let { addGlobalListener, removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6(), { hoverProps, triggerHoverEnd } = useMemo(() => {
5422    let triggerHoverStart = (event, pointerType) => {
5423      if (state.pointerType = pointerType, isDisabled || pointerType === "touch" || state.isHovered || !event.currentTarget.contains(event.target)) return;
5424      state.isHovered = !0;
5425      let target = event.currentTarget;
5426      state.target = target, addGlobalListener($431fbd86ca7dc216$export$b204af158042fbac(event.target), "pointerover", (e2) => {
5427        state.isHovered && state.target && !$d4ee10de306f2510$export$4282f70798064fe0(state.target, e2.target) && triggerHoverEnd2(e2, e2.pointerType);
5428      }, {
5429        capture: !0
5430      }), onHoverStart && onHoverStart({
5431        type: "hoverstart",
5432        target,
5433        pointerType
5434      }), onHoverChange && onHoverChange(!0), setHovered(!0);
5435    }, triggerHoverEnd2 = (event, pointerType) => {
5436      let target = state.target;
5437      state.pointerType = "", state.target = null, !(pointerType === "touch" || !state.isHovered || !target) && (state.isHovered = !1, removeAllGlobalListeners(), onHoverEnd && onHoverEnd({
5438        type: "hoverend",
5439        target,
5440        pointerType
5441      }), onHoverChange && onHoverChange(!1), setHovered(!1));
5442    }, hoverProps2 = {};
5443    return typeof PointerEvent < "u" && (hoverProps2.onPointerEnter = (e2) => {
5444      $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e2.pointerType === "mouse" || triggerHoverStart(e2, e2.pointerType);
5445    }, hoverProps2.onPointerLeave = (e2) => {
5446      !isDisabled && e2.currentTarget.contains(e2.target) && triggerHoverEnd2(e2, e2.pointerType);
5447    }), {
5448      hoverProps: hoverProps2,
5449      triggerHoverEnd: triggerHoverEnd2
5450    };
5451  }, [
5452    onHoverStart,
5453    onHoverChange,
5454    onHoverEnd,
5455    isDisabled,
5456    state,
5457    addGlobalListener,
5458    removeAllGlobalListeners
5459  ]);
5460  return useEffect(() => {
5461    isDisabled && triggerHoverEnd({
5462      currentTarget: state.target
5463    }, state.pointerType);
5464  }, [
5465    isDisabled
5466  ]), {
5467    hoverProps,
5468    isHovered
5469  };
5470}
5471
vendor: 90 bytes, lines 5472-5474
5472// ../../node_modules/@react-aria/interactions/dist/useInteractOutside.mjs
5473init_react();
5474
vendor: 79 bytes, lines 5475-5477
5475// ../../node_modules/@react-aria/interactions/dist/useMove.mjs
5476init_react();
5477
vendor: 86 bytes, lines 5478-5480
5478// ../../node_modules/@react-aria/interactions/dist/useScrollWheel.mjs
5479init_react();
5480
vendor: 84 bytes, lines 5481-5483
5481// ../../node_modules/@react-aria/interactions/dist/useLongPress.mjs
5482init_react();
5483
vendor: 3,268 bytes, lines 5484-5565
5484// ../../node_modules/react-aria-components/dist/utils.mjs
5485init_react();
5486var $64fa3d84918910a7$export$c62b8e45d58ddad9 = Symbol("default");
5487function $64fa3d84918910a7$export$2881499e37b75b9a({ values, children }) {
5488  for (let [Context2, value] of values)
5489    children = react_default.createElement(Context2.Provider, {
5490      value
5491    }, children);
5492  return children;
5493}
5494function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
5495  let { className, style, children, defaultClassName, defaultChildren, defaultStyle, values } = props;
5496  return useMemo(() => {
5497    let computedClassName, computedStyle, computedChildren;
5498    return typeof className == "function" ? computedClassName = className({
5499      ...values,
5500      defaultClassName
5501    }) : computedClassName = className, typeof style == "function" ? computedStyle = style({
5502      ...values,
5503      defaultStyle: defaultStyle || {}
5504    }) : computedStyle = style, typeof children == "function" ? computedChildren = children({
5505      ...values,
5506      defaultChildren
5507    }) : children == null ? computedChildren = defaultChildren : computedChildren = children, {
5508      className: computedClassName ?? defaultClassName,
5509      style: computedStyle || defaultStyle ? {
5510        ...defaultStyle,
5511        ...computedStyle
5512      } : void 0,
5513      children: computedChildren ?? defaultChildren,
5514      "data-rac": ""
5515    };
5516  }, [
5517    className,
5518    style,
5519    children,
5520    defaultClassName,
5521    defaultChildren,
5522    defaultStyle,
5523    values
5524  ]);
5525}
5526function $64fa3d84918910a7$export$fabf2dc03a41866e(context, slot) {
5527  let ctx = useContext(context);
5528  if (slot === null)
5529    return null;
5530  if (ctx && typeof ctx == "object" && "slots" in ctx && ctx.slots) {
5531    let slotKey = slot || $64fa3d84918910a7$export$c62b8e45d58ddad9;
5532    if (!ctx.slots[slotKey]) {
5533      let availableSlots = new Intl.ListFormat().format(Object.keys(ctx.slots).map((p2) => `"${p2}"`)), errorMessage = slot ? `Invalid slot "${slot}".` : "A slot prop is required.";
5534      throw new Error(`${errorMessage} Valid slot names are ${availableSlots}.`);
5535    }
5536    return ctx.slots[slotKey];
5537  }
5538  return ctx;
5539}
5540function $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, context) {
5541  let ctx = $64fa3d84918910a7$export$fabf2dc03a41866e(context, props.slot) || {}, { ref: contextRef, ...contextProps } = ctx, mergedRef = $df56164dff5785e2$export$4338b53315abf666(useMemo(() => $5dc95899b306f630$export$c9058316764c140e(ref, contextRef), [
5542    ref,
5543    contextRef
5544  ])), mergedProps = $3ef42575df84b30b$export$9d1611c77c2fe928(contextProps, props);
5545  return "style" in contextProps && contextProps.style && "style" in props && props.style && (typeof contextProps.style == "function" || typeof props.style == "function" ? mergedProps.style = (renderProps) => {
5546    let contextStyle = typeof contextProps.style == "function" ? contextProps.style(renderProps) : contextProps.style, defaultStyle = {
5547      ...renderProps.defaultStyle,
5548      ...contextStyle
5549    }, style = typeof props.style == "function" ? props.style({
5550      ...renderProps,
5551      defaultStyle
5552    }) : props.style;
5553    return {
5554      ...defaultStyle,
5555      ...style
5556    };
5557  } : mergedProps.style = {
5558    ...contextProps.style,
5559    ...props.style
5560  }), [
5561    mergedProps,
5562    mergedRef
5563  ];
5564}
5565
vendor: 1,165 bytes, lines 5566-5597
5566// ../../node_modules/react-aria-components/dist/OverlayArrow.mjs
5567init_react();
5568var $44f671af83e7d9e0$export$2de4954e8ae13b9f = createContext({
5569  placement: "bottom"
5570}), $44f671af83e7d9e0$export$746d02f47f4d381 = forwardRef(function(props, ref) {
5571  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $44f671af83e7d9e0$export$2de4954e8ae13b9f);
5572  let placement = props.placement, style = {
5573    position: "absolute",
5574    transform: placement === "top" || placement === "bottom" ? "translateX(-50%)" : "translateY(-50%)"
5575  };
5576  placement != null && (style[placement] = "100%");
5577  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
5578    ...props,
5579    defaultClassName: "react-aria-OverlayArrow",
5580    values: {
5581      placement
5582    }
5583  });
5584  renderProps.style && Object.keys(renderProps.style).forEach((key) => renderProps.style[key] === void 0 && delete renderProps.style[key]);
5585  let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
5586  return react_default.createElement("div", {
5587    ...DOMProps,
5588    ...renderProps,
5589    style: {
5590      ...style,
5591      ...renderProps.style
5592    },
5593    ref,
5594    "data-placement": placement
5595  });
5596});
5597
vendor: 498 bytes, lines 5598-5612
5598// ../../node_modules/@react-aria/tooltip/dist/useTooltip.mjs
5599function $326e436e94273fe1$export$1c4b08e0eca38426(props, state) {
5600  let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
5601    labelable: !0
5602  }), { hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({
5603    onHoverStart: () => state?.open(!0),
5604    onHoverEnd: () => state?.close()
5605  });
5606  return {
5607    tooltipProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, hoverProps, {
5608      role: "tooltip"
5609    })
5610  };
5611}
5612
vendor: 2,032 bytes, lines 5613-5666
5613// ../../node_modules/@react-aria/tooltip/dist/useTooltipTrigger.mjs
5614init_react();
5615function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
5616  let { isDisabled, trigger } = props, tooltipId = $bdb11010cef70236$export$f680877a34711e37(), isHovered = useRef(!1), isFocused = useRef(!1), handleShow = () => {
5617    (isHovered.current || isFocused.current) && state.open(isFocused.current);
5618  }, handleHide = (immediate) => {
5619    !isHovered.current && !isFocused.current && state.close(immediate);
5620  };
5621  useEffect(() => {
5622    let onKeyDown = (e2) => {
5623      ref && ref.current && e2.key === "Escape" && (e2.stopPropagation(), state.close(!0));
5624    };
5625    if (state.isOpen)
5626      return document.addEventListener("keydown", onKeyDown, !0), () => {
5627        document.removeEventListener("keydown", onKeyDown, !0);
5628      };
5629  }, [
5630    ref,
5631    state
5632  ]);
5633  let onHoverStart = () => {
5634    trigger !== "focus" && ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "pointer" ? isHovered.current = !0 : isHovered.current = !1, handleShow());
5635  }, onHoverEnd = () => {
5636    trigger !== "focus" && (isFocused.current = !1, isHovered.current = !1, handleHide());
5637  }, onPressStart = () => {
5638    isFocused.current = !1, isHovered.current = !1, handleHide(!0);
5639  }, onFocus = () => {
5640    $507fabe10e71c6fb$export$b9b3dfddab17db27() && (isFocused.current = !0, handleShow());
5641  }, onBlur = () => {
5642    isFocused.current = !1, isHovered.current = !1, handleHide(!0);
5643  }, { hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({
5644    isDisabled,
5645    onHoverStart,
5646    onHoverEnd
5647  }), { focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c({
5648    isDisabled,
5649    onFocus,
5650    onBlur
5651  }, ref);
5652  return {
5653    triggerProps: {
5654      "aria-describedby": state.isOpen ? tooltipId : void 0,
5655      ...$3ef42575df84b30b$export$9d1611c77c2fe928(focusableProps, hoverProps, {
5656        onPointerDown: onPressStart,
5657        onKeyDown: onPressStart
5658      }),
5659      tabIndex: void 0
5660    },
5661    tooltipProps: {
5662      id: tooltipId
5663    }
5664  };
5665}
5666
vendor: 20,007 bytes, lines 5667-5866
5667// ../../node_modules/@react-aria/overlays/dist/calculatePosition.mjs
5668var $edcf132a9284368a$var$AXIS = {
5669  top: "top",
5670  bottom: "top",
5671  left: "left",
5672  right: "left"
5673}, $edcf132a9284368a$var$FLIPPED_DIRECTION = {
5674  top: "bottom",
5675  bottom: "top",
5676  left: "right",
5677  right: "left"
5678}, $edcf132a9284368a$var$CROSS_AXIS = {
5679  top: "left",
5680  left: "top"
5681}, $edcf132a9284368a$var$AXIS_SIZE = {
5682  top: "height",
5683  left: "width"
5684}, $edcf132a9284368a$var$TOTAL_SIZE = {
5685  width: "totalWidth",
5686  height: "totalHeight"
5687}, $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {}, $edcf132a9284368a$var$visualViewport = typeof document < "u" ? window.visualViewport : null;
5688function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
5689  let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0, scroll2 = {};
5690  var _visualViewport_scale;
5691  let isPinchZoomedIn = ((_visualViewport_scale = $edcf132a9284368a$var$visualViewport?.scale) !== null && _visualViewport_scale !== void 0 ? _visualViewport_scale : 1) > 1;
5692  if (containerNode.tagName === "BODY") {
5693    let documentElement = document.documentElement;
5694    totalWidth = documentElement.clientWidth, totalHeight = documentElement.clientHeight;
5695    var _visualViewport_width;
5696    width = (_visualViewport_width = $edcf132a9284368a$var$visualViewport?.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth;
5697    var _visualViewport_height;
5698    height = (_visualViewport_height = $edcf132a9284368a$var$visualViewport?.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight, scroll2.top = documentElement.scrollTop || containerNode.scrollTop, scroll2.left = documentElement.scrollLeft || containerNode.scrollLeft, $edcf132a9284368a$var$visualViewport && (top = $edcf132a9284368a$var$visualViewport.offsetTop, left = $edcf132a9284368a$var$visualViewport.offsetLeft);
5699  } else
5700    ({ width, height, top, left } = $edcf132a9284368a$var$getOffset(containerNode, !1)), scroll2.top = containerNode.scrollTop, scroll2.left = containerNode.scrollLeft, totalWidth = width, totalHeight = height;
5701  if ($c87311424ea30a05$export$78551043582a6a98() && (containerNode.tagName === "BODY" || containerNode.tagName === "HTML") && isPinchZoomedIn) {
5702    scroll2.top = 0, scroll2.left = 0;
5703    var _visualViewport_pageTop;
5704    top = (_visualViewport_pageTop = $edcf132a9284368a$var$visualViewport?.pageTop) !== null && _visualViewport_pageTop !== void 0 ? _visualViewport_pageTop : 0;
5705    var _visualViewport_pageLeft;
5706    left = (_visualViewport_pageLeft = $edcf132a9284368a$var$visualViewport?.pageLeft) !== null && _visualViewport_pageLeft !== void 0 ? _visualViewport_pageLeft : 0;
5707  }
5708  return {
5709    width,
5710    height,
5711    totalWidth,
5712    totalHeight,
5713    scroll: scroll2,
5714    top,
5715    left
5716  };
5717}
5718function $edcf132a9284368a$var$getScroll(node) {
5719  return {
5720    top: node.scrollTop,
5721    left: node.scrollLeft,
5722    width: node.scrollWidth,
5723    height: node.scrollHeight
5724  };
5725}
5726function $edcf132a9284368a$var$getDelta(axis, offset2, size, boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary) {
5727  var _containerDimensions_scroll_axis;
5728  let containerScroll = (_containerDimensions_scroll_axis = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis !== void 0 ? _containerDimensions_scroll_axis : 0, boundarySize = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]], boundaryStartEdge = boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding, boundaryEndEdge = boundarySize + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] - padding, startEdgeOffset = offset2 - containerScroll + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]], endEdgeOffset = offset2 - containerScroll + size + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
5729  return startEdgeOffset < boundaryStartEdge ? boundaryStartEdge - startEdgeOffset : endEdgeOffset > boundaryEndEdge ? Math.max(boundaryEndEdge - endEdgeOffset, boundaryStartEdge - startEdgeOffset) : 0;
5730}
5731function $edcf132a9284368a$var$getMargins(node) {
5732  let style = window.getComputedStyle(node);
5733  return {
5734    top: parseInt(style.marginTop, 10) || 0,
5735    bottom: parseInt(style.marginBottom, 10) || 0,
5736    left: parseInt(style.marginLeft, 10) || 0,
5737    right: parseInt(style.marginRight, 10) || 0
5738  };
5739}
5740function $edcf132a9284368a$var$parsePlacement(input) {
5741  if ($edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input]) return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
5742  let [placement, crossPlacement] = input.split(" "), axis = $edcf132a9284368a$var$AXIS[placement] || "right", crossAxis = $edcf132a9284368a$var$CROSS_AXIS[axis];
5743  $edcf132a9284368a$var$AXIS[crossPlacement] || (crossPlacement = "center");
5744  let size = $edcf132a9284368a$var$AXIS_SIZE[axis], crossSize = $edcf132a9284368a$var$AXIS_SIZE[crossAxis];
5745  return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input] = {
5746    placement,
5747    crossPlacement,
5748    axis,
5749    crossAxis,
5750    size,
5751    crossSize
5752  }, $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
5753}
5754function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset2, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
5755  let { placement, crossPlacement, axis, crossAxis, size, crossSize } = placementInfo, position = {};
5756  var _childOffset_crossAxis;
5757  position[crossAxis] = (_childOffset_crossAxis = childOffset[crossAxis]) !== null && _childOffset_crossAxis !== void 0 ? _childOffset_crossAxis : 0;
5758  var _childOffset_crossSize, _overlaySize_crossSize, _childOffset_crossSize1, _overlaySize_crossSize1;
5759  crossPlacement === "center" ? position[crossAxis] += (((_childOffset_crossSize = childOffset[crossSize]) !== null && _childOffset_crossSize !== void 0 ? _childOffset_crossSize : 0) - ((_overlaySize_crossSize = overlaySize[crossSize]) !== null && _overlaySize_crossSize !== void 0 ? _overlaySize_crossSize : 0)) / 2 : crossPlacement !== crossAxis && (position[crossAxis] += ((_childOffset_crossSize1 = childOffset[crossSize]) !== null && _childOffset_crossSize1 !== void 0 ? _childOffset_crossSize1 : 0) - ((_overlaySize_crossSize1 = overlaySize[crossSize]) !== null && _overlaySize_crossSize1 !== void 0 ? _overlaySize_crossSize1 : 0)), position[crossAxis] += crossOffset;
5760  let minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset, maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
5761  if (position[crossAxis] = $9446cca9a3875146$export$7d15b64cf5a3a4c4(position[crossAxis], minPosition, maxPosition), placement === axis) {
5762    let containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]];
5763    position[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset2);
5764  } else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset2);
5765  return position;
5766}
5767function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection) {
5768  let containerHeight = isContainerPositioned ? containerOffsetWithBoundary.height : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE.height];
5769  var _position_bottom;
5770  let overlayTop = position.top != null ? containerOffsetWithBoundary.top + position.top : containerOffsetWithBoundary.top + (containerHeight - ((_position_bottom = position.bottom) !== null && _position_bottom !== void 0 ? _position_bottom : 0) - overlayHeight);
5771  var _boundaryDimensions_scroll_top, _margins_top, _margins_bottom, _boundaryDimensions_scroll_top1, _margins_top1, _margins_bottom1;
5772  let maxHeight = heightGrowthDirection !== "top" ? (
5773    // We want the distance between the top of the overlay to the bottom of the boundary
5774    Math.max(0, boundaryDimensions.height + boundaryDimensions.top + ((_boundaryDimensions_scroll_top = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top !== void 0 ? _boundaryDimensions_scroll_top : 0) - overlayTop - (((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0) + padding))
5775  ) : Math.max(0, overlayTop + overlayHeight - (boundaryDimensions.top + ((_boundaryDimensions_scroll_top1 = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top1 !== void 0 ? _boundaryDimensions_scroll_top1 : 0)) - (((_margins_top1 = margins.top) !== null && _margins_top1 !== void 0 ? _margins_top1 : 0) + ((_margins_bottom1 = margins.bottom) !== null && _margins_bottom1 !== void 0 ? _margins_bottom1 : 0) + padding));
5776  return Math.min(boundaryDimensions.height - padding * 2, maxHeight);
5777}
5778function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
5779  let { placement, axis, size } = placementInfo;
5780  var _boundaryDimensions_scroll_axis, _margins_axis;
5781  if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - ((_boundaryDimensions_scroll_axis = boundaryDimensions.scroll[axis]) !== null && _boundaryDimensions_scroll_axis !== void 0 ? _boundaryDimensions_scroll_axis : 0) + containerOffsetWithBoundary[axis] - ((_margins_axis = margins[axis]) !== null && _margins_axis !== void 0 ? _margins_axis : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
5782  var _margins_axis1;
5783  return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - ((_margins_axis1 = margins[axis]) !== null && _margins_axis1 !== void 0 ? _margins_axis1 : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
5784}
5785function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip2, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset2, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
5786  let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput), { size, crossAxis, crossSize, placement, crossPlacement } = placementInfo, position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset2, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset), normalizedOffset = offset2, space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset2, placementInfo);
5787  if (flip2 && scrollSize[size] > space) {
5788    let flippedPlacementInfo = $edcf132a9284368a$var$parsePlacement(`${$edcf132a9284368a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`), flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset2, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
5789    $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset2, flippedPlacementInfo) > space && (placementInfo = flippedPlacementInfo, position = flippedPosition, normalizedOffset = offset2);
5790  }
5791  let heightGrowthDirection = "bottom";
5792  placementInfo.axis === "top" ? placementInfo.placement === "top" ? heightGrowthDirection = "top" : placementInfo.placement === "bottom" && (heightGrowthDirection = "bottom") : placementInfo.crossAxis === "top" && (placementInfo.crossPlacement === "top" ? heightGrowthDirection = "bottom" : placementInfo.crossPlacement === "bottom" && (heightGrowthDirection = "top"));
5793  let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
5794  position[crossAxis] += delta;
5795  let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection);
5796  userSetMaxHeight && userSetMaxHeight < maxHeight && (maxHeight = userSetMaxHeight), overlaySize.height = Math.min(overlaySize.height, maxHeight), position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset), delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary), position[crossAxis] += delta;
5797  let arrowPosition = {}, origin = childOffset[crossAxis] - position[crossAxis] - margins[$edcf132a9284368a$var$AXIS[crossAxis]], preferredArrowPosition = origin + 0.5 * childOffset[crossSize], arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset;
5798  var _margins_left, _margins_right, _margins_top, _margins_bottom;
5799  let overlayMargin = $edcf132a9284368a$var$AXIS[crossAxis] === "left" ? ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0) : ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0), arrowMaxPosition = overlaySize[crossSize] - overlayMargin - arrowSize / 2 - arrowBoundaryOffset, arrowOverlappingChildMinEdge = childOffset[crossAxis] + arrowSize / 2 - (position[crossAxis] + margins[$edcf132a9284368a$var$AXIS[crossAxis]]), arrowOverlappingChildMaxEdge = childOffset[crossAxis] + childOffset[crossSize] - arrowSize / 2 - (position[crossAxis] + margins[$edcf132a9284368a$var$AXIS[crossAxis]]), arrowPositionOverlappingChild = $9446cca9a3875146$export$7d15b64cf5a3a4c4(preferredArrowPosition, arrowOverlappingChildMinEdge, arrowOverlappingChildMaxEdge);
5800  arrowPosition[crossAxis] = $9446cca9a3875146$export$7d15b64cf5a3a4c4(arrowPositionOverlappingChild, arrowMinPosition, arrowMaxPosition), { placement, crossPlacement } = placementInfo, arrowSize ? origin = arrowPosition[crossAxis] : crossPlacement === "right" ? origin += childOffset[crossSize] : crossPlacement === "center" && (origin += childOffset[crossSize] / 2);
5801  let crossOrigin = placement === "left" || placement === "top" ? overlaySize[size] : 0, triggerAnchorPoint = {
5802    x: placement === "top" || placement === "bottom" ? origin : crossOrigin,
5803    y: placement === "left" || placement === "right" ? origin : crossOrigin
5804  };
5805  return {
5806    position,
5807    maxHeight,
5808    arrowOffsetLeft: arrowPosition.left,
5809    arrowOffsetTop: arrowPosition.top,
5810    placement,
5811    triggerAnchorPoint
5812  };
5813}
5814function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
5815  let { placement, targetNode, overlayNode, scrollNode, padding, shouldFlip, boundaryElement, offset: offset2, crossOffset, maxHeight, arrowSize = 0, arrowBoundaryOffset = 0 } = opts, container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement, isViewportContainer = container === document.documentElement, containerPositionStyle = window.getComputedStyle(container).position, isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static", childOffset = isViewportContainer ? $edcf132a9284368a$var$getOffset(targetNode, !1) : $edcf132a9284368a$var$getPosition(targetNode, container, !1);
5816  if (!isViewportContainer) {
5817    let { marginTop, marginLeft } = window.getComputedStyle(targetNode);
5818    childOffset.top += parseInt(marginTop, 10) || 0, childOffset.left += parseInt(marginLeft, 10) || 0;
5819  }
5820  let overlaySize = $edcf132a9284368a$var$getOffset(overlayNode, !0), margins = $edcf132a9284368a$var$getMargins(overlayNode);
5821  var _margins_left, _margins_right;
5822  overlaySize.width += ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0);
5823  var _margins_top, _margins_bottom;
5824  overlaySize.height += ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0);
5825  let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode), boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement), containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container), containerOffsetWithBoundary = boundaryElement.tagName === "BODY" ? $edcf132a9284368a$var$getOffset(container, !1) : $edcf132a9284368a$var$getPosition(container, boundaryElement, !1);
5826  return container.tagName === "HTML" && boundaryElement.tagName === "BODY" && (containerDimensions.scroll.top = 0, containerDimensions.scroll.left = 0), $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset2, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
5827}
5828function $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale) {
5829  let { top, left, width, height } = node.getBoundingClientRect();
5830  return ignoreScale && node instanceof node.ownerDocument.defaultView.HTMLElement && (width = node.offsetWidth, height = node.offsetHeight), {
5831    top,
5832    left,
5833    width,
5834    height
5835  };
5836}
5837function $edcf132a9284368a$var$getOffset(node, ignoreScale) {
5838  let { top, left, width, height } = $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale), { scrollTop, scrollLeft, clientTop, clientLeft } = document.documentElement;
5839  return {
5840    top: top + scrollTop - clientTop,
5841    left: left + scrollLeft - clientLeft,
5842    width,
5843    height
5844  };
5845}
5846function $edcf132a9284368a$var$getPosition(node, parent, ignoreScale) {
5847  let style = window.getComputedStyle(node), offset2;
5848  if (style.position === "fixed") offset2 = $edcf132a9284368a$export$4b834cebd9e5cebe(node, ignoreScale);
5849  else {
5850    offset2 = $edcf132a9284368a$var$getOffset(node, ignoreScale);
5851    let parentOffset = $edcf132a9284368a$var$getOffset(parent, ignoreScale), parentStyle = window.getComputedStyle(parent);
5852    parentOffset.top += (parseInt(parentStyle.borderTopWidth, 10) || 0) - parent.scrollTop, parentOffset.left += (parseInt(parentStyle.borderLeftWidth, 10) || 0) - parent.scrollLeft, offset2.top -= parentOffset.top, offset2.left -= parentOffset.left;
5853  }
5854  return offset2.top -= parseInt(style.marginTop, 10) || 0, offset2.left -= parseInt(style.marginLeft, 10) || 0, offset2;
5855}
5856function $edcf132a9284368a$var$getContainingBlock(node) {
5857  let offsetParent = node.offsetParent;
5858  if (offsetParent && offsetParent === document.body && window.getComputedStyle(offsetParent).position === "static" && !$edcf132a9284368a$var$isContainingBlock(offsetParent) && (offsetParent = document.documentElement), offsetParent == null)
5859    for (offsetParent = node.parentElement; offsetParent && !$edcf132a9284368a$var$isContainingBlock(offsetParent); ) offsetParent = offsetParent.parentElement;
5860  return offsetParent || document.documentElement;
5861}
5862function $edcf132a9284368a$var$isContainingBlock(node) {
5863  let style = window.getComputedStyle(node);
5864  return style.transform !== "none" || /transform|perspective/.test(style.willChange) || style.filter !== "none" || style.contain === "paint" || "backdropFilter" in style && style.backdropFilter !== "none" || "WebkitBackdropFilter" in style && style.WebkitBackdropFilter !== "none";
5865}
5866
vendor: 924 bytes, lines 5867-5889
5867// ../../node_modules/@react-aria/overlays/dist/useCloseOnScroll.mjs
5868init_react();
5869var $dd149f63282afbbf$export$f6211563215e3b37 = /* @__PURE__ */ new WeakMap();
5870function $dd149f63282afbbf$export$18fc8428861184da(opts) {
5871  let { triggerRef, isOpen, onClose } = opts;
5872  useEffect(() => {
5873    if (!isOpen || onClose === null) return;
5874    let onScroll = (e2) => {
5875      let target = e2.target;
5876      if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current) || e2.target instanceof HTMLInputElement || e2.target instanceof HTMLTextAreaElement) return;
5877      let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current);
5878      onCloseHandler && onCloseHandler();
5879    };
5880    return window.addEventListener("scroll", onScroll, !0), () => {
5881      window.removeEventListener("scroll", onScroll, !0);
5882    };
5883  }, [
5884    isOpen,
5885    onClose,
5886    triggerRef
5887  ]);
5888}
5889
vendor: 86 bytes, lines 5890-5892
5890// ../../node_modules/@react-aria/overlays/dist/useOverlayPosition.mjs
5891init_react();
5892
vendor: 925 bytes, lines 5893-5935
5893// ../../node_modules/@react-aria/i18n/dist/utils.mjs
5894var $148a7a147e38ea7f$var$RTL_SCRIPTS = /* @__PURE__ */ new Set([
5895  "Arab",
5896  "Syrc",
5897  "Samr",
5898  "Mand",
5899  "Thaa",
5900  "Mend",
5901  "Nkoo",
5902  "Adlm",
5903  "Rohg",
5904  "Hebr"
5905]), $148a7a147e38ea7f$var$RTL_LANGS = /* @__PURE__ */ new Set([
5906  "ae",
5907  "ar",
5908  "arc",
5909  "bcc",
5910  "bqi",
5911  "ckb",
5912  "dv",
5913  "fa",
5914  "glk",
5915  "he",
5916  "ku",
5917  "mzn",
5918  "nqo",
5919  "pnb",
5920  "ps",
5921  "sd",
5922  "ug",
5923  "ur",
5924  "yi"
5925]);
5926function $148a7a147e38ea7f$export$702d680b21cbd764(localeString) {
5927  if (Intl.Locale) {
5928    let locale = new Intl.Locale(localeString).maximize(), textInfo = typeof locale.getTextInfo == "function" ? locale.getTextInfo() : locale.textInfo;
5929    if (textInfo) return textInfo.direction === "rtl";
5930    if (locale.script) return $148a7a147e38ea7f$var$RTL_SCRIPTS.has(locale.script);
5931  }
5932  let lang = localeString.split("-")[0];
5933  return $148a7a147e38ea7f$var$RTL_LANGS.has(lang);
5934}
5935
vendor: 1,681 bytes, lines 5936-5967
5936// ../../node_modules/@react-aria/i18n/dist/useDefaultLocale.mjs
5937init_react();
5938var $1e5a04cdaf7d1af8$var$localeSymbol = Symbol.for("react-aria.i18n.locale");
5939function $1e5a04cdaf7d1af8$export$f09106e7c6677ec5() {
5940  let locale = typeof window < "u" && window[$1e5a04cdaf7d1af8$var$localeSymbol] || typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US";
5941  try {
5942    Intl.DateTimeFormat.supportedLocalesOf([
5943      locale
5944    ]);
5945  } catch {
5946    locale = "en-US";
5947  }
5948  return {
5949    locale,
5950    direction: $148a7a147e38ea7f$export$702d680b21cbd764(locale) ? "rtl" : "ltr"
5951  };
5952}
5953var $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5(), $1e5a04cdaf7d1af8$var$listeners = /* @__PURE__ */ new Set();
5954function $1e5a04cdaf7d1af8$var$updateLocale() {
5955  $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
5956  for (let listener of $1e5a04cdaf7d1af8$var$listeners) listener($1e5a04cdaf7d1af8$var$currentLocale);
5957}
5958function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() {
5959  let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273(), [defaultLocale2, setDefaultLocale] = useState($1e5a04cdaf7d1af8$var$currentLocale);
5960  return useEffect(() => ($1e5a04cdaf7d1af8$var$listeners.size === 0 && window.addEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale), $1e5a04cdaf7d1af8$var$listeners.add(setDefaultLocale), () => {
5961    $1e5a04cdaf7d1af8$var$listeners.delete(setDefaultLocale), $1e5a04cdaf7d1af8$var$listeners.size === 0 && window.removeEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale);
5962  }), []), isSSR ? {
5963    locale: "en-US",
5964    direction: "ltr"
5965  } : defaultLocale2;
5966}
5967
vendor: 345 bytes, lines 5968-5975
5968// ../../node_modules/@react-aria/i18n/dist/context.mjs
5969init_react();
5970var $18f2051aff69b9bf$var$I18nContext = react_default.createContext(null);
5971function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() {
5972  let defaultLocale2 = $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a();
5973  return useContext($18f2051aff69b9bf$var$I18nContext) || defaultLocale2;
5974}
5975
vendor: 1,758 bytes, lines 5976-6015
5976// ../../node_modules/tslib/tslib.es6.mjs
5977var extendStatics = function(d2, b2) {
5978  return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
5979    d3.__proto__ = b3;
5980  } || function(d3, b3) {
5981    for (var p2 in b3) Object.prototype.hasOwnProperty.call(b3, p2) && (d3[p2] = b3[p2]);
5982  }, extendStatics(d2, b2);
5983};
5984function __extends(d2, b2) {
5985  if (typeof b2 != "function" && b2 !== null)
5986    throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
5987  extendStatics(d2, b2);
5988  function __() {
5989    this.constructor = d2;
5990  }
5991  d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
5992}
5993var __assign = function() {
5994  return __assign = Object.assign || function(t2) {
5995    for (var s2, i2 = 1, n3 = arguments.length; i2 < n3; i2++) {
5996      s2 = arguments[i2];
5997      for (var p2 in s2) Object.prototype.hasOwnProperty.call(s2, p2) && (t2[p2] = s2[p2]);
5998    }
5999    return t2;
6000  }, __assign.apply(this, arguments);
6001};
6002function __rest(s2, e2) {
6003  var t2 = {};
6004  for (var p2 in s2) Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0 && (t2[p2] = s2[p2]);
6005  if (s2 != null && typeof Object.getOwnPropertySymbols == "function")
6006    for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++)
6007      e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2]) && (t2[p2[i2]] = s2[p2[i2]]);
6008  return t2;
6009}
6010function __spreadArray(to, from, pack) {
6011  if (pack || arguments.length === 2) for (var i2 = 0, l3 = from.length, ar; i2 < l3; i2++)
6012    (ar || !(i2 in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i2)), ar[i2] = from[i2]);
6013  return to.concat(ar || Array.prototype.slice.call(from));
6014}
6015
vendor: 2,302 bytes, lines 6016-6070
6016// ../../node_modules/@formatjs/fast-memoize/lib/index.js
6017function memoize(fn, options2) {
6018  var cache = options2 && options2.cache ? options2.cache : cacheDefault, serializer = options2 && options2.serializer ? options2.serializer : serializerDefault, strategy = options2 && options2.strategy ? options2.strategy : strategyDefault;
6019  return strategy(fn, {
6020    cache,
6021    serializer
6022  });
6023}
6024function isPrimitive(value) {
6025  return value == null || typeof value == "number" || typeof value == "boolean";
6026}
6027function monadic(fn, cache, serializer, arg) {
6028  var cacheKey = isPrimitive(arg) ? arg : serializer(arg), computedValue = cache.get(cacheKey);
6029  return typeof computedValue > "u" && (computedValue = fn.call(this, arg), cache.set(cacheKey, computedValue)), computedValue;
6030}
6031function variadic(fn, cache, serializer) {
6032  var args = Array.prototype.slice.call(arguments, 3), cacheKey = serializer(args), computedValue = cache.get(cacheKey);
6033  return typeof computedValue > "u" && (computedValue = fn.apply(this, args), cache.set(cacheKey, computedValue)), computedValue;
6034}
6035function assemble(fn, context, strategy, cache, serialize) {
6036  return strategy.bind(context, fn, cache, serialize);
6037}
6038function strategyDefault(fn, options2) {
6039  var strategy = fn.length === 1 ? monadic : variadic;
6040  return assemble(fn, this, strategy, options2.cache.create(), options2.serializer);
6041}
6042function strategyVariadic(fn, options2) {
6043  return assemble(fn, this, variadic, options2.cache.create(), options2.serializer);
6044}
6045function strategyMonadic(fn, options2) {
6046  return assemble(fn, this, monadic, options2.cache.create(), options2.serializer);
6047}
6048var serializerDefault = function() {
6049  return JSON.stringify(arguments);
6050}, ObjectWithoutPrototypeCache = (
6051  /** @class */
6052  (function() {
6053    function ObjectWithoutPrototypeCache2() {
6054      this.cache = /* @__PURE__ */ Object.create(null);
6055    }
6056    return ObjectWithoutPrototypeCache2.prototype.get = function(key) {
6057      return this.cache[key];
6058    }, ObjectWithoutPrototypeCache2.prototype.set = function(key, value) {
6059      this.cache[key] = value;
6060    }, ObjectWithoutPrototypeCache2;
6061  })()
6062), cacheDefault = {
6063  create: function() {
6064    return new ObjectWithoutPrototypeCache();
6065  }
6066}, strategies = {
6067  variadic: strategyVariadic,
6068  monadic: strategyMonadic
6069};
6070
vendor: 2,396 bytes, lines 6071-6076
6071// ../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js
6072var ErrorKind;
6073(function(ErrorKind2) {
6074  ErrorKind2[ErrorKind2.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", ErrorKind2[ErrorKind2.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", ErrorKind2[ErrorKind2.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", ErrorKind2[ErrorKind2.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", ErrorKind2[ErrorKind2.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", ErrorKind2[ErrorKind2.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", ErrorKind2[ErrorKind2.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", ErrorKind2[ErrorKind2.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", ErrorKind2[ErrorKind2.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", ErrorKind2[ErrorKind2.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", ErrorKind2[ErrorKind2.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", ErrorKind2[ErrorKind2.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", ErrorKind2[ErrorKind2.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", ErrorKind2[ErrorKind2.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", ErrorKind2[ErrorKind2.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", ErrorKind2[ErrorKind2.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", ErrorKind2[ErrorKind2.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", ErrorKind2[ErrorKind2.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", ErrorKind2[ErrorKind2.INVALID_TAG = 23] = "INVALID_TAG", ErrorKind2[ErrorKind2.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", ErrorKind2[ErrorKind2.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", ErrorKind2[ErrorKind2.UNCLOSED_TAG = 27] = "UNCLOSED_TAG";
6075})(ErrorKind || (ErrorKind = {}));
6076
vendor: 1,466 bytes, lines 6077-6119
6077// ../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js
6078var TYPE;
6079(function(TYPE2) {
6080  TYPE2[TYPE2.literal = 0] = "literal", TYPE2[TYPE2.argument = 1] = "argument", TYPE2[TYPE2.number = 2] = "number", TYPE2[TYPE2.date = 3] = "date", TYPE2[TYPE2.time = 4] = "time", TYPE2[TYPE2.select = 5] = "select", TYPE2[TYPE2.plural = 6] = "plural", TYPE2[TYPE2.pound = 7] = "pound", TYPE2[TYPE2.tag = 8] = "tag";
6081})(TYPE || (TYPE = {}));
6082var SKELETON_TYPE;
6083(function(SKELETON_TYPE2) {
6084  SKELETON_TYPE2[SKELETON_TYPE2.number = 0] = "number", SKELETON_TYPE2[SKELETON_TYPE2.dateTime = 1] = "dateTime";
6085})(SKELETON_TYPE || (SKELETON_TYPE = {}));
6086function isLiteralElement(el) {
6087  return el.type === TYPE.literal;
6088}
6089function isArgumentElement(el) {
6090  return el.type === TYPE.argument;
6091}
6092function isNumberElement(el) {
6093  return el.type === TYPE.number;
6094}
6095function isDateElement(el) {
6096  return el.type === TYPE.date;
6097}
6098function isTimeElement(el) {
6099  return el.type === TYPE.time;
6100}
6101function isSelectElement(el) {
6102  return el.type === TYPE.select;
6103}
6104function isPluralElement(el) {
6105  return el.type === TYPE.plural;
6106}
6107function isPoundElement(el) {
6108  return el.type === TYPE.pound;
6109}
6110function isTagElement(el) {
6111  return el.type === TYPE.tag;
6112}
6113function isNumberSkeleton(el) {
6114  return !!(el && typeof el == "object" && el.type === SKELETON_TYPE.number);
6115}
6116function isDateTimeSkeleton(el) {
6117  return !!(el && typeof el == "object" && el.type === SKELETON_TYPE.dateTime);
6118}
6119
vendor: 157 bytes, lines 6120-6122
6120// ../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js
6121var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
6122
vendor: 3,704 bytes, lines 6123-6233
6123// ../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js
6124var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
6125function parseDateTimeSkeleton(skeleton) {
6126  var result = {};
6127  return skeleton.replace(DATE_TIME_REGEX, function(match) {
6128    var len = match.length;
6129    switch (match[0]) {
6130      // Era
6131      case "G":
6132        result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
6133        break;
6134      // Year
6135      case "y":
6136        result.year = len === 2 ? "2-digit" : "numeric";
6137        break;
6138      case "Y":
6139      case "u":
6140      case "U":
6141      case "r":
6142        throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
6143      // Quarter
6144      case "q":
6145      case "Q":
6146        throw new RangeError("`q/Q` (quarter) patterns are not supported");
6147      // Month
6148      case "M":
6149      case "L":
6150        result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
6151        break;
6152      // Week
6153      case "w":
6154      case "W":
6155        throw new RangeError("`w/W` (week) patterns are not supported");
6156      case "d":
6157        result.day = ["numeric", "2-digit"][len - 1];
6158        break;
6159      case "D":
6160      case "F":
6161      case "g":
6162        throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
6163      // Weekday
6164      case "E":
6165        result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short";
6166        break;
6167      case "e":
6168        if (len < 4)
6169          throw new RangeError("`e..eee` (weekday) patterns are not supported");
6170        result.weekday = ["short", "long", "narrow", "short"][len - 4];
6171        break;
6172      case "c":
6173        if (len < 4)
6174          throw new RangeError("`c..ccc` (weekday) patterns are not supported");
6175        result.weekday = ["short", "long", "narrow", "short"][len - 4];
6176        break;
6177      // Period
6178      case "a":
6179        result.hour12 = !0;
6180        break;
6181      case "b":
6182      // am, pm, noon, midnight
6183      case "B":
6184        throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
6185      // Hour
6186      case "h":
6187        result.hourCycle = "h12", result.hour = ["numeric", "2-digit"][len - 1];
6188        break;
6189      case "H":
6190        result.hourCycle = "h23", result.hour = ["numeric", "2-digit"][len - 1];
6191        break;
6192      case "K":
6193        result.hourCycle = "h11", result.hour = ["numeric", "2-digit"][len - 1];
6194        break;
6195      case "k":
6196        result.hourCycle = "h24", result.hour = ["numeric", "2-digit"][len - 1];
6197        break;
6198      case "j":
6199      case "J":
6200      case "C":
6201        throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
6202      // Minute
6203      case "m":
6204        result.minute = ["numeric", "2-digit"][len - 1];
6205        break;
6206      // Second
6207      case "s":
6208        result.second = ["numeric", "2-digit"][len - 1];
6209        break;
6210      case "S":
6211      case "A":
6212        throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
6213      // Zone
6214      case "z":
6215        result.timeZoneName = len < 4 ? "short" : "long";
6216        break;
6217      case "Z":
6218      // 1..3, 4, 5: The ISO8601 varios formats
6219      case "O":
6220      // 1, 4: milliseconds in day short, long
6221      case "v":
6222      // 1, 4: generic non-location format
6223      case "V":
6224      // 1, 2, 3, 4: time zone ID or city
6225      case "X":
6226      // 1, 2, 3, 4: The ISO8601 varios formats
6227      case "x":
6228        throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
6229    }
6230    return "";
6231  }), result;
6232}
6233
vendor: 141 bytes, lines 6234-6236
6234// ../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js
6235var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
6236
vendor: 8,706 bytes, lines 6237-6450
6237// ../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js
6238function parseNumberSkeletonFromString(skeleton) {
6239  if (skeleton.length === 0)
6240    throw new Error("Number skeleton cannot be empty");
6241  for (var stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter(function(x2) {
6242    return x2.length > 0;
6243  }), tokens2 = [], _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {
6244    var stringToken = stringTokens_1[_i], stemAndOptions = stringToken.split("/");
6245    if (stemAndOptions.length === 0)
6246      throw new Error("Invalid number skeleton");
6247    for (var stem = stemAndOptions[0], options2 = stemAndOptions.slice(1), _a2 = 0, options_1 = options2; _a2 < options_1.length; _a2++) {
6248      var option = options_1[_a2];
6249      if (option.length === 0)
6250        throw new Error("Invalid number skeleton");
6251    }
6252    tokens2.push({ stem, options: options2 });
6253  }
6254  return tokens2;
6255}
6256function icuUnitToEcma(unit) {
6257  return unit.replace(/^(.*?)-/, "");
6258}
6259var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g, INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g, CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
6260function parseSignificantPrecision(str) {
6261  var result = {};
6262  return str[str.length - 1] === "r" ? result.roundingPriority = "morePrecision" : str[str.length - 1] === "s" && (result.roundingPriority = "lessPrecision"), str.replace(SIGNIFICANT_PRECISION_REGEX, function(_2, g1, g2) {
6263    return typeof g2 != "string" ? (result.minimumSignificantDigits = g1.length, result.maximumSignificantDigits = g1.length) : g2 === "+" ? result.minimumSignificantDigits = g1.length : g1[0] === "#" ? result.maximumSignificantDigits = g1.length : (result.minimumSignificantDigits = g1.length, result.maximumSignificantDigits = g1.length + (typeof g2 == "string" ? g2.length : 0)), "";
6264  }), result;
6265}
6266function parseSign(str) {
6267  switch (str) {
6268    case "sign-auto":
6269      return {
6270        signDisplay: "auto"
6271      };
6272    case "sign-accounting":
6273    case "()":
6274      return {
6275        currencySign: "accounting"
6276      };
6277    case "sign-always":
6278    case "+!":
6279      return {
6280        signDisplay: "always"
6281      };
6282    case "sign-accounting-always":
6283    case "()!":
6284      return {
6285        signDisplay: "always",
6286        currencySign: "accounting"
6287      };
6288    case "sign-except-zero":
6289    case "+?":
6290      return {
6291        signDisplay: "exceptZero"
6292      };
6293    case "sign-accounting-except-zero":
6294    case "()?":
6295      return {
6296        signDisplay: "exceptZero",
6297        currencySign: "accounting"
6298      };
6299    case "sign-never":
6300    case "+_":
6301      return {
6302        signDisplay: "never"
6303      };
6304  }
6305}
6306function parseConciseScientificAndEngineeringStem(stem) {
6307  var result;
6308  if (stem[0] === "E" && stem[1] === "E" ? (result = {
6309    notation: "engineering"
6310  }, stem = stem.slice(2)) : stem[0] === "E" && (result = {
6311    notation: "scientific"
6312  }, stem = stem.slice(1)), result) {
6313    var signDisplay = stem.slice(0, 2);
6314    if (signDisplay === "+!" ? (result.signDisplay = "always", stem = stem.slice(2)) : signDisplay === "+?" && (result.signDisplay = "exceptZero", stem = stem.slice(2)), !CONCISE_INTEGER_WIDTH_REGEX.test(stem))
6315      throw new Error("Malformed concise eng/scientific notation");
6316    result.minimumIntegerDigits = stem.length;
6317  }
6318  return result;
6319}
6320function parseNotationOptions(opt) {
6321  var result = {}, signOpts = parseSign(opt);
6322  return signOpts || result;
6323}
6324function parseNumberSkeleton(tokens2) {
6325  for (var result = {}, _i = 0, tokens_1 = tokens2; _i < tokens_1.length; _i++) {
6326    var token = tokens_1[_i];
6327    switch (token.stem) {
6328      case "percent":
6329      case "%":
6330        result.style = "percent";
6331        continue;
6332      case "%x100":
6333        result.style = "percent", result.scale = 100;
6334        continue;
6335      case "currency":
6336        result.style = "currency", result.currency = token.options[0];
6337        continue;
6338      case "group-off":
6339      case ",_":
6340        result.useGrouping = !1;
6341        continue;
6342      case "precision-integer":
6343      case ".":
6344        result.maximumFractionDigits = 0;
6345        continue;
6346      case "measure-unit":
6347      case "unit":
6348        result.style = "unit", result.unit = icuUnitToEcma(token.options[0]);
6349        continue;
6350      case "compact-short":
6351      case "K":
6352        result.notation = "compact", result.compactDisplay = "short";
6353        continue;
6354      case "compact-long":
6355      case "KK":
6356        result.notation = "compact", result.compactDisplay = "long";
6357        continue;
6358      case "scientific":
6359        result = __assign(__assign(__assign({}, result), { notation: "scientific" }), token.options.reduce(function(all, opt2) {
6360          return __assign(__assign({}, all), parseNotationOptions(opt2));
6361        }, {}));
6362        continue;
6363      case "engineering":
6364        result = __assign(__assign(__assign({}, result), { notation: "engineering" }), token.options.reduce(function(all, opt2) {
6365          return __assign(__assign({}, all), parseNotationOptions(opt2));
6366        }, {}));
6367        continue;
6368      case "notation-simple":
6369        result.notation = "standard";
6370        continue;
6371      // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
6372      case "unit-width-narrow":
6373        result.currencyDisplay = "narrowSymbol", result.unitDisplay = "narrow";
6374        continue;
6375      case "unit-width-short":
6376        result.currencyDisplay = "code", result.unitDisplay = "short";
6377        continue;
6378      case "unit-width-full-name":
6379        result.currencyDisplay = "name", result.unitDisplay = "long";
6380        continue;
6381      case "unit-width-iso-code":
6382        result.currencyDisplay = "symbol";
6383        continue;
6384      case "scale":
6385        result.scale = parseFloat(token.options[0]);
6386        continue;
6387      case "rounding-mode-floor":
6388        result.roundingMode = "floor";
6389        continue;
6390      case "rounding-mode-ceiling":
6391        result.roundingMode = "ceil";
6392        continue;
6393      case "rounding-mode-down":
6394        result.roundingMode = "trunc";
6395        continue;
6396      case "rounding-mode-up":
6397        result.roundingMode = "expand";
6398        continue;
6399      case "rounding-mode-half-even":
6400        result.roundingMode = "halfEven";
6401        continue;
6402      case "rounding-mode-half-down":
6403        result.roundingMode = "halfTrunc";
6404        continue;
6405      case "rounding-mode-half-up":
6406        result.roundingMode = "halfExpand";
6407        continue;
6408      // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
6409      case "integer-width":
6410        if (token.options.length > 1)
6411          throw new RangeError("integer-width stems only accept a single optional option");
6412        token.options[0].replace(INTEGER_WIDTH_REGEX, function(_2, g1, g2, g3, g4, g5) {
6413          if (g1)
6414            result.minimumIntegerDigits = g2.length;
6415          else {
6416            if (g3 && g4)
6417              throw new Error("We currently do not support maximum integer digits");
6418            if (g5)
6419              throw new Error("We currently do not support exact integer digits");
6420          }
6421          return "";
6422        });
6423        continue;
6424    }
6425    if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {
6426      result.minimumIntegerDigits = token.stem.length;
6427      continue;
6428    }
6429    if (FRACTION_PRECISION_REGEX.test(token.stem)) {
6430      if (token.options.length > 1)
6431        throw new RangeError("Fraction-precision stems only accept a single optional option");
6432      token.stem.replace(FRACTION_PRECISION_REGEX, function(_2, g1, g2, g3, g4, g5) {
6433        return g2 === "*" ? result.minimumFractionDigits = g1.length : g3 && g3[0] === "#" ? result.maximumFractionDigits = g3.length : g4 && g5 ? (result.minimumFractionDigits = g4.length, result.maximumFractionDigits = g4.length + g5.length) : (result.minimumFractionDigits = g1.length, result.maximumFractionDigits = g1.length), "";
6434      });
6435      var opt = token.options[0];
6436      opt === "w" ? result = __assign(__assign({}, result), { trailingZeroDisplay: "stripIfInteger" }) : opt && (result = __assign(__assign({}, result), parseSignificantPrecision(opt)));
6437      continue;
6438    }
6439    if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
6440      result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));
6441      continue;
6442    }
6443    var signOpts = parseSign(token.stem);
6444    signOpts && (result = __assign(__assign({}, result), signOpts));
6445    var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);
6446    conciseScientificAndEngineeringOpts && (result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts));
6447  }
6448  return result;
6449}
6450
vendor: 11,674 bytes, lines 6451-7867
6451// ../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js
6452var timeData = {
6453  "001": [
6454    "H",
6455    "h"
6456  ],
6457  419: [
6458    "h",
6459    "H",
6460    "hB",
6461    "hb"
6462  ],
6463  AC: [
6464    "H",
6465    "h",
6466    "hb",
6467    "hB"
6468  ],
6469  AD: [
6470    "H",
6471    "hB"
6472  ],
6473  AE: [
6474    "h",
6475    "hB",
6476    "hb",
6477    "H"
6478  ],
6479  AF: [
6480    "H",
6481    "hb",
6482    "hB",
6483    "h"
6484  ],
6485  AG: [
6486    "h",
6487    "hb",
6488    "H",
6489    "hB"
6490  ],
6491  AI: [
6492    "H",
6493    "h",
6494    "hb",
6495    "hB"
6496  ],
6497  AL: [
6498    "h",
6499    "H",
6500    "hB"
6501  ],
6502  AM: [
6503    "H",
6504    "hB"
6505  ],
6506  AO: [
6507    "H",
6508    "hB"
6509  ],
6510  AR: [
6511    "h",
6512    "H",
6513    "hB",
6514    "hb"
6515  ],
6516  AS: [
6517    "h",
6518    "H"
6519  ],
6520  AT: [
6521    "H",
6522    "hB"
6523  ],
6524  AU: [
6525    "h",
6526    "hb",
6527    "H",
6528    "hB"
6529  ],
6530  AW: [
6531    "H",
6532    "hB"
6533  ],
6534  AX: [
6535    "H"
6536  ],
6537  AZ: [
6538    "H",
6539    "hB",
6540    "h"
6541  ],
6542  BA: [
6543    "H",
6544    "hB",
6545    "h"
6546  ],
6547  BB: [
6548    "h",
6549    "hb",
6550    "H",
6551    "hB"
6552  ],
6553  BD: [
6554    "h",
6555    "hB",
6556    "H"
6557  ],
6558  BE: [
6559    "H",
6560    "hB"
6561  ],
6562  BF: [
6563    "H",
6564    "hB"
6565  ],
6566  BG: [
6567    "H",
6568    "hB",
6569    "h"
6570  ],
6571  BH: [
6572    "h",
6573    "hB",
6574    "hb",
6575    "H"
6576  ],
6577  BI: [
6578    "H",
6579    "h"
6580  ],
6581  BJ: [
6582    "H",
6583    "hB"
6584  ],
6585  BL: [
6586    "H",
6587    "hB"
6588  ],
6589  BM: [
6590    "h",
6591    "hb",
6592    "H",
6593    "hB"
6594  ],
6595  BN: [
6596    "hb",
6597    "hB",
6598    "h",
6599    "H"
6600  ],
6601  BO: [
6602    "h",
6603    "H",
6604    "hB",
6605    "hb"
6606  ],
6607  BQ: [
6608    "H"
6609  ],
6610  BR: [
6611    "H",
6612    "hB"
6613  ],
6614  BS: [
6615    "h",
6616    "hb",
6617    "H",
6618    "hB"
6619  ],
6620  BT: [
6621    "h",
6622    "H"
6623  ],
6624  BW: [
6625    "H",
6626    "h",
6627    "hb",
6628    "hB"
6629  ],
6630  BY: [
6631    "H",
6632    "h"
6633  ],
6634  BZ: [
6635    "H",
6636    "h",
6637    "hb",
6638    "hB"
6639  ],
6640  CA: [
6641    "h",
6642    "hb",
6643    "H",
6644    "hB"
6645  ],
6646  CC: [
6647    "H",
6648    "h",
6649    "hb",
6650    "hB"
6651  ],
6652  CD: [
6653    "hB",
6654    "H"
6655  ],
6656  CF: [
6657    "H",
6658    "h",
6659    "hB"
6660  ],
6661  CG: [
6662    "H",
6663    "hB"
6664  ],
6665  CH: [
6666    "H",
6667    "hB",
6668    "h"
6669  ],
6670  CI: [
6671    "H",
6672    "hB"
6673  ],
6674  CK: [
6675    "H",
6676    "h",
6677    "hb",
6678    "hB"
6679  ],
6680  CL: [
6681    "h",
6682    "H",
6683    "hB",
6684    "hb"
6685  ],
6686  CM: [
6687    "H",
6688    "h",
6689    "hB"
6690  ],
6691  CN: [
6692    "H",
6693    "hB",
6694    "hb",
6695    "h"
6696  ],
6697  CO: [
6698    "h",
6699    "H",
6700    "hB",
6701    "hb"
6702  ],
6703  CP: [
6704    "H"
6705  ],
6706  CR: [
6707    "h",
6708    "H",
6709    "hB",
6710    "hb"
6711  ],
6712  CU: [
6713    "h",
6714    "H",
6715    "hB",
6716    "hb"
6717  ],
6718  CV: [
6719    "H",
6720    "hB"
6721  ],
6722  CW: [
6723    "H",
6724    "hB"
6725  ],
6726  CX: [
6727    "H",
6728    "h",
6729    "hb",
6730    "hB"
6731  ],
6732  CY: [
6733    "h",
6734    "H",
6735    "hb",
6736    "hB"
6737  ],
6738  CZ: [
6739    "H"
6740  ],
6741  DE: [
6742    "H",
6743    "hB"
6744  ],
6745  DG: [
6746    "H",
6747    "h",
6748    "hb",
6749    "hB"
6750  ],
6751  DJ: [
6752    "h",
6753    "H"
6754  ],
6755  DK: [
6756    "H"
6757  ],
6758  DM: [
6759    "h",
6760    "hb",
6761    "H",
6762    "hB"
6763  ],
6764  DO: [
6765    "h",
6766    "H",
6767    "hB",
6768    "hb"
6769  ],
6770  DZ: [
6771    "h",
6772    "hB",
6773    "hb",
6774    "H"
6775  ],
6776  EA: [
6777    "H",
6778    "h",
6779    "hB",
6780    "hb"
6781  ],
6782  EC: [
6783    "h",
6784    "H",
6785    "hB",
6786    "hb"
6787  ],
6788  EE: [
6789    "H",
6790    "hB"
6791  ],
6792  EG: [
6793    "h",
6794    "hB",
6795    "hb",
6796    "H"
6797  ],
6798  EH: [
6799    "h",
6800    "hB",
6801    "hb",
6802    "H"
6803  ],
6804  ER: [
6805    "h",
6806    "H"
6807  ],
6808  ES: [
6809    "H",
6810    "hB",
6811    "h",
6812    "hb"
6813  ],
6814  ET: [
6815    "hB",
6816    "hb",
6817    "h",
6818    "H"
6819  ],
6820  FI: [
6821    "H"
6822  ],
6823  FJ: [
6824    "h",
6825    "hb",
6826    "H",
6827    "hB"
6828  ],
6829  FK: [
6830    "H",
6831    "h",
6832    "hb",
6833    "hB"
6834  ],
6835  FM: [
6836    "h",
6837    "hb",
6838    "H",
6839    "hB"
6840  ],
6841  FO: [
6842    "H",
6843    "h"
6844  ],
6845  FR: [
6846    "H",
6847    "hB"
6848  ],
6849  GA: [
6850    "H",
6851    "hB"
6852  ],
6853  GB: [
6854    "H",
6855    "h",
6856    "hb",
6857    "hB"
6858  ],
6859  GD: [
6860    "h",
6861    "hb",
6862    "H",
6863    "hB"
6864  ],
6865  GE: [
6866    "H",
6867    "hB",
6868    "h"
6869  ],
6870  GF: [
6871    "H",
6872    "hB"
6873  ],
6874  GG: [
6875    "H",
6876    "h",
6877    "hb",
6878    "hB"
6879  ],
6880  GH: [
6881    "h",
6882    "H"
6883  ],
6884  GI: [
6885    "H",
6886    "h",
6887    "hb",
6888    "hB"
6889  ],
6890  GL: [
6891    "H",
6892    "h"
6893  ],
6894  GM: [
6895    "h",
6896    "hb",
6897    "H",
6898    "hB"
6899  ],
6900  GN: [
6901    "H",
6902    "hB"
6903  ],
6904  GP: [
6905    "H",
6906    "hB"
6907  ],
6908  GQ: [
6909    "H",
6910    "hB",
6911    "h",
6912    "hb"
6913  ],
6914  GR: [
6915    "h",
6916    "H",
6917    "hb",
6918    "hB"
6919  ],
6920  GT: [
6921    "h",
6922    "H",
6923    "hB",
6924    "hb"
6925  ],
6926  GU: [
6927    "h",
6928    "hb",
6929    "H",
6930    "hB"
6931  ],
6932  GW: [
6933    "H",
6934    "hB"
6935  ],
6936  GY: [
6937    "h",
6938    "hb",
6939    "H",
6940    "hB"
6941  ],
6942  HK: [
6943    "h",
6944    "hB",
6945    "hb",
6946    "H"
6947  ],
6948  HN: [
6949    "h",
6950    "H",
6951    "hB",
6952    "hb"
6953  ],
6954  HR: [
6955    "H",
6956    "hB"
6957  ],
6958  HU: [
6959    "H",
6960    "h"
6961  ],
6962  IC: [
6963    "H",
6964    "h",
6965    "hB",
6966    "hb"
6967  ],
6968  ID: [
6969    "H"
6970  ],
6971  IE: [
6972    "H",
6973    "h",
6974    "hb",
6975    "hB"
6976  ],
6977  IL: [
6978    "H",
6979    "hB"
6980  ],
6981  IM: [
6982    "H",
6983    "h",
6984    "hb",
6985    "hB"
6986  ],
6987  IN: [
6988    "h",
6989    "H"
6990  ],
6991  IO: [
6992    "H",
6993    "h",
6994    "hb",
6995    "hB"
6996  ],
6997  IQ: [
6998    "h",
6999    "hB",
7000    "hb",
7001    "H"
7002  ],
7003  IR: [
7004    "hB",
7005    "H"
7006  ],
7007  IS: [
7008    "H"
7009  ],
7010  IT: [
7011    "H",
7012    "hB"
7013  ],
7014  JE: [
7015    "H",
7016    "h",
7017    "hb",
7018    "hB"
7019  ],
7020  JM: [
7021    "h",
7022    "hb",
7023    "H",
7024    "hB"
7025  ],
7026  JO: [
7027    "h",
7028    "hB",
7029    "hb",
7030    "H"
7031  ],
7032  JP: [
7033    "H",
7034    "K",
7035    "h"
7036  ],
7037  KE: [
7038    "hB",
7039    "hb",
7040    "H",
7041    "h"
7042  ],
7043  KG: [
7044    "H",
7045    "h",
7046    "hB",
7047    "hb"
7048  ],
7049  KH: [
7050    "hB",
7051    "h",
7052    "H",
7053    "hb"
7054  ],
7055  KI: [
7056    "h",
7057    "hb",
7058    "H",
7059    "hB"
7060  ],
7061  KM: [
7062    "H",
7063    "h",
7064    "hB",
7065    "hb"
7066  ],
7067  KN: [
7068    "h",
7069    "hb",
7070    "H",
7071    "hB"
7072  ],
7073  KP: [
7074    "h",
7075    "H",
7076    "hB",
7077    "hb"
7078  ],
7079  KR: [
7080    "h",
7081    "H",
7082    "hB",
7083    "hb"
7084  ],
7085  KW: [
7086    "h",
7087    "hB",
7088    "hb",
7089    "H"
7090  ],
7091  KY: [
7092    "h",
7093    "hb",
7094    "H",
7095    "hB"
7096  ],
7097  KZ: [
7098    "H",
7099    "hB"
7100  ],
7101  LA: [
7102    "H",
7103    "hb",
7104    "hB",
7105    "h"
7106  ],
7107  LB: [
7108    "h",
7109    "hB",
7110    "hb",
7111    "H"
7112  ],
7113  LC: [
7114    "h",
7115    "hb",
7116    "H",
7117    "hB"
7118  ],
7119  LI: [
7120    "H",
7121    "hB",
7122    "h"
7123  ],
7124  LK: [
7125    "H",
7126    "h",
7127    "hB",
7128    "hb"
7129  ],
7130  LR: [
7131    "h",
7132    "hb",
7133    "H",
7134    "hB"
7135  ],
7136  LS: [
7137    "h",
7138    "H"
7139  ],
7140  LT: [
7141    "H",
7142    "h",
7143    "hb",
7144    "hB"
7145  ],
7146  LU: [
7147    "H",
7148    "h",
7149    "hB"
7150  ],
7151  LV: [
7152    "H",
7153    "hB",
7154    "hb",
7155    "h"
7156  ],
7157  LY: [
7158    "h",
7159    "hB",
7160    "hb",
7161    "H"
7162  ],
7163  MA: [
7164    "H",
7165    "h",
7166    "hB",
7167    "hb"
7168  ],
7169  MC: [
7170    "H",
7171    "hB"
7172  ],
7173  MD: [
7174    "H",
7175    "hB"
7176  ],
7177  ME: [
7178    "H",
7179    "hB",
7180    "h"
7181  ],
7182  MF: [
7183    "H",
7184    "hB"
7185  ],
7186  MG: [
7187    "H",
7188    "h"
7189  ],
7190  MH: [
7191    "h",
7192    "hb",
7193    "H",
7194    "hB"
7195  ],
7196  MK: [
7197    "H",
7198    "h",
7199    "hb",
7200    "hB"
7201  ],
7202  ML: [
7203    "H"
7204  ],
7205  MM: [
7206    "hB",
7207    "hb",
7208    "H",
7209    "h"
7210  ],
7211  MN: [
7212    "H",
7213    "h",
7214    "hb",
7215    "hB"
7216  ],
7217  MO: [
7218    "h",
7219    "hB",
7220    "hb",
7221    "H"
7222  ],
7223  MP: [
7224    "h",
7225    "hb",
7226    "H",
7227    "hB"
7228  ],
7229  MQ: [
7230    "H",
7231    "hB"
7232  ],
7233  MR: [
7234    "h",
7235    "hB",
7236    "hb",
7237    "H"
7238  ],
7239  MS: [
7240    "H",
7241    "h",
7242    "hb",
7243    "hB"
7244  ],
7245  MT: [
7246    "H",
7247    "h"
7248  ],
7249  MU: [
7250    "H",
7251    "h"
7252  ],
7253  MV: [
7254    "H",
7255    "h"
7256  ],
7257  MW: [
7258    "h",
7259    "hb",
7260    "H",
7261    "hB"
7262  ],
7263  MX: [
7264    "h",
7265    "H",
7266    "hB",
7267    "hb"
7268  ],
7269  MY: [
7270    "hb",
7271    "hB",
7272    "h",
7273    "H"
7274  ],
7275  MZ: [
7276    "H",
7277    "hB"
7278  ],
7279  NA: [
7280    "h",
7281    "H",
7282    "hB",
7283    "hb"
7284  ],
7285  NC: [
7286    "H",
7287    "hB"
7288  ],
7289  NE: [
7290    "H"
7291  ],
7292  NF: [
7293    "H",
7294    "h",
7295    "hb",
7296    "hB"
7297  ],
7298  NG: [
7299    "H",
7300    "h",
7301    "hb",
7302    "hB"
7303  ],
7304  NI: [
7305    "h",
7306    "H",
7307    "hB",
7308    "hb"
7309  ],
7310  NL: [
7311    "H",
7312    "hB"
7313  ],
7314  NO: [
7315    "H",
7316    "h"
7317  ],
7318  NP: [
7319    "H",
7320    "h",
7321    "hB"
7322  ],
7323  NR: [
7324    "H",
7325    "h",
7326    "hb",
7327    "hB"
7328  ],
7329  NU: [
7330    "H",
7331    "h",
7332    "hb",
7333    "hB"
7334  ],
7335  NZ: [
7336    "h",
7337    "hb",
7338    "H",
7339    "hB"
7340  ],
7341  OM: [
7342    "h",
7343    "hB",
7344    "hb",
7345    "H"
7346  ],
7347  PA: [
7348    "h",
7349    "H",
7350    "hB",
7351    "hb"
7352  ],
7353  PE: [
7354    "h",
7355    "H",
7356    "hB",
7357    "hb"
7358  ],
7359  PF: [
7360    "H",
7361    "h",
7362    "hB"
7363  ],
7364  PG: [
7365    "h",
7366    "H"
7367  ],
7368  PH: [
7369    "h",
7370    "hB",
7371    "hb",
7372    "H"
7373  ],
7374  PK: [
7375    "h",
7376    "hB",
7377    "H"
7378  ],
7379  PL: [
7380    "H",
7381    "h"
7382  ],
7383  PM: [
7384    "H",
7385    "hB"
7386  ],
7387  PN: [
7388    "H",
7389    "h",
7390    "hb",
7391    "hB"
7392  ],
7393  PR: [
7394    "h",
7395    "H",
7396    "hB",
7397    "hb"
7398  ],
7399  PS: [
7400    "h",
7401    "hB",
7402    "hb",
7403    "H"
7404  ],
7405  PT: [
7406    "H",
7407    "hB"
7408  ],
7409  PW: [
7410    "h",
7411    "H"
7412  ],
7413  PY: [
7414    "h",
7415    "H",
7416    "hB",
7417    "hb"
7418  ],
7419  QA: [
7420    "h",
7421    "hB",
7422    "hb",
7423    "H"
7424  ],
7425  RE: [
7426    "H",
7427    "hB"
7428  ],
7429  RO: [
7430    "H",
7431    "hB"
7432  ],
7433  RS: [
7434    "H",
7435    "hB",
7436    "h"
7437  ],
7438  RU: [
7439    "H"
7440  ],
7441  RW: [
7442    "H",
7443    "h"
7444  ],
7445  SA: [
7446    "h",
7447    "hB",
7448    "hb",
7449    "H"
7450  ],
7451  SB: [
7452    "h",
7453    "hb",
7454    "H",
7455    "hB"
7456  ],
7457  SC: [
7458    "H",
7459    "h",
7460    "hB"
7461  ],
7462  SD: [
7463    "h",
7464    "hB",
7465    "hb",
7466    "H"
7467  ],
7468  SE: [
7469    "H"
7470  ],
7471  SG: [
7472    "h",
7473    "hb",
7474    "H",
7475    "hB"
7476  ],
7477  SH: [
7478    "H",
7479    "h",
7480    "hb",
7481    "hB"
7482  ],
7483  SI: [
7484    "H",
7485    "hB"
7486  ],
7487  SJ: [
7488    "H"
7489  ],
7490  SK: [
7491    "H"
7492  ],
7493  SL: [
7494    "h",
7495    "hb",
7496    "H",
7497    "hB"
7498  ],
7499  SM: [
7500    "H",
7501    "h",
7502    "hB"
7503  ],
7504  SN: [
7505    "H",
7506    "h",
7507    "hB"
7508  ],
7509  SO: [
7510    "h",
7511    "H"
7512  ],
7513  SR: [
7514    "H",
7515    "hB"
7516  ],
7517  SS: [
7518    "h",
7519    "hb",
7520    "H",
7521    "hB"
7522  ],
7523  ST: [
7524    "H",
7525    "hB"
7526  ],
7527  SV: [
7528    "h",
7529    "H",
7530    "hB",
7531    "hb"
7532  ],
7533  SX: [
7534    "H",
7535    "h",
7536    "hb",
7537    "hB"
7538  ],
7539  SY: [
7540    "h",
7541    "hB",
7542    "hb",
7543    "H"
7544  ],
7545  SZ: [
7546    "h",
7547    "hb",
7548    "H",
7549    "hB"
7550  ],
7551  TA: [
7552    "H",
7553    "h",
7554    "hb",
7555    "hB"
7556  ],
7557  TC: [
7558    "h",
7559    "hb",
7560    "H",
7561    "hB"
7562  ],
7563  TD: [
7564    "h",
7565    "H",
7566    "hB"
7567  ],
7568  TF: [
7569    "H",
7570    "h",
7571    "hB"
7572  ],
7573  TG: [
7574    "H",
7575    "hB"
7576  ],
7577  TH: [
7578    "H",
7579    "h"
7580  ],
7581  TJ: [
7582    "H",
7583    "h"
7584  ],
7585  TL: [
7586    "H",
7587    "hB",
7588    "hb",
7589    "h"
7590  ],
7591  TM: [
7592    "H",
7593    "h"
7594  ],
7595  TN: [
7596    "h",
7597    "hB",
7598    "hb",
7599    "H"
7600  ],
7601  TO: [
7602    "h",
7603    "H"
7604  ],
7605  TR: [
7606    "H",
7607    "hB"
7608  ],
7609  TT: [
7610    "h",
7611    "hb",
7612    "H",
7613    "hB"
7614  ],
7615  TW: [
7616    "hB",
7617    "hb",
7618    "h",
7619    "H"
7620  ],
7621  TZ: [
7622    "hB",
7623    "hb",
7624    "H",
7625    "h"
7626  ],
7627  UA: [
7628    "H",
7629    "hB",
7630    "h"
7631  ],
7632  UG: [
7633    "hB",
7634    "hb",
7635    "H",
7636    "h"
7637  ],
7638  UM: [
7639    "h",
7640    "hb",
7641    "H",
7642    "hB"
7643  ],
7644  US: [
7645    "h",
7646    "hb",
7647    "H",
7648    "hB"
7649  ],
7650  UY: [
7651    "h",
7652    "H",
7653    "hB",
7654    "hb"
7655  ],
7656  UZ: [
7657    "H",
7658    "hB",
7659    "h"
7660  ],
7661  VA: [
7662    "H",
7663    "h",
7664    "hB"
7665  ],
7666  VC: [
7667    "h",
7668    "hb",
7669    "H",
7670    "hB"
7671  ],
7672  VE: [
7673    "h",
7674    "H",
7675    "hB",
7676    "hb"
7677  ],
7678  VG: [
7679    "h",
7680    "hb",
7681    "H",
7682    "hB"
7683  ],
7684  VI: [
7685    "h",
7686    "hb",
7687    "H",
7688    "hB"
7689  ],
7690  VN: [
7691    "H",
7692    "h"
7693  ],
7694  VU: [
7695    "h",
7696    "H"
7697  ],
7698  WF: [
7699    "H",
7700    "hB"
7701  ],
7702  WS: [
7703    "h",
7704    "H"
7705  ],
7706  XK: [
7707    "H",
7708    "hB",
7709    "h"
7710  ],
7711  YE: [
7712    "h",
7713    "hB",
7714    "hb",
7715    "H"
7716  ],
7717  YT: [
7718    "H",
7719    "hB"
7720  ],
7721  ZA: [
7722    "H",
7723    "h",
7724    "hb",
7725    "hB"
7726  ],
7727  ZM: [
7728    "h",
7729    "hb",
7730    "H",
7731    "hB"
7732  ],
7733  ZW: [
7734    "H",
7735    "h"
7736  ],
7737  "af-ZA": [
7738    "H",
7739    "h",
7740    "hB",
7741    "hb"
7742  ],
7743  "ar-001": [
7744    "h",
7745    "hB",
7746    "hb",
7747    "H"
7748  ],
7749  "ca-ES": [
7750    "H",
7751    "h",
7752    "hB"
7753  ],
7754  "en-001": [
7755    "h",
7756    "hb",
7757    "H",
7758    "hB"
7759  ],
7760  "en-HK": [
7761    "h",
7762    "hb",
7763    "H",
7764    "hB"
7765  ],
7766  "en-IL": [
7767    "H",
7768    "h",
7769    "hb",
7770    "hB"
7771  ],
7772  "en-MY": [
7773    "h",
7774    "hb",
7775    "H",
7776    "hB"
7777  ],
7778  "es-BR": [
7779    "H",
7780    "h",
7781    "hB",
7782    "hb"
7783  ],
7784  "es-ES": [
7785    "H",
7786    "h",
7787    "hB",
7788    "hb"
7789  ],
7790  "es-GQ": [
7791    "H",
7792    "h",
7793    "hB",
7794    "hb"
7795  ],
7796  "fr-CA": [
7797    "H",
7798    "h",
7799    "hB"
7800  ],
7801  "gl-ES": [
7802    "H",
7803    "h",
7804    "hB"
7805  ],
7806  "gu-IN": [
7807    "hB",
7808    "hb",
7809    "h",
7810    "H"
7811  ],
7812  "hi-IN": [
7813    "hB",
7814    "h",
7815    "H"
7816  ],
7817  "it-CH": [
7818    "H",
7819    "h",
7820    "hB"
7821  ],
7822  "it-IT": [
7823    "H",
7824    "h",
7825    "hB"
7826  ],
7827  "kn-IN": [
7828    "hB",
7829    "h",
7830    "H"
7831  ],
7832  "ml-IN": [
7833    "hB",
7834    "h",
7835    "H"
7836  ],
7837  "mr-IN": [
7838    "hB",
7839    "hb",
7840    "h",
7841    "H"
7842  ],
7843  "pa-IN": [
7844    "hB",
7845    "hb",
7846    "h",
7847    "H"
7848  ],
7849  "ta-IN": [
7850    "hB",
7851    "h",
7852    "hb",
7853    "H"
7854  ],
7855  "te-IN": [
7856    "hB",
7857    "h",
7858    "H"
7859  ],
7860  "zu-ZA": [
7861    "H",
7862    "hB",
7863    "hb",
7864    "h"
7865  ]
7866};
7867
vendor: 1,771 bytes, lines 7868-7906
7868// ../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js
7869function getBestPattern(skeleton, locale) {
7870  for (var skeletonCopy = "", patternPos = 0; patternPos < skeleton.length; patternPos++) {
7871    var patternChar = skeleton.charAt(patternPos);
7872    if (patternChar === "j") {
7873      for (var extraLength = 0; patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar; )
7874        extraLength++, patternPos++;
7875      var hourLen = 1 + (extraLength & 1), dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1), dayPeriodChar = "a", hourChar = getDefaultHourSymbolFromLocale(locale);
7876      for ((hourChar == "H" || hourChar == "k") && (dayPeriodLen = 0); dayPeriodLen-- > 0; )
7877        skeletonCopy += dayPeriodChar;
7878      for (; hourLen-- > 0; )
7879        skeletonCopy = hourChar + skeletonCopy;
7880    } else patternChar === "J" ? skeletonCopy += "H" : skeletonCopy += patternChar;
7881  }
7882  return skeletonCopy;
7883}
7884function getDefaultHourSymbolFromLocale(locale) {
7885  var hourCycle = locale.hourCycle;
7886  if (hourCycle === void 0 && // @ts-ignore hourCycle(s) is not identified yet
7887  locale.hourCycles && // @ts-ignore
7888  locale.hourCycles.length && (hourCycle = locale.hourCycles[0]), hourCycle)
7889    switch (hourCycle) {
7890      case "h24":
7891        return "k";
7892      case "h23":
7893        return "H";
7894      case "h12":
7895        return "h";
7896      case "h11":
7897        return "K";
7898      default:
7899        throw new Error("Invalid hourCycle");
7900    }
7901  var languageTag = locale.language, regionTag;
7902  languageTag !== "root" && (regionTag = locale.maximize().region);
7903  var hourCycles = timeData[regionTag || ""] || timeData[languageTag || ""] || timeData["".concat(languageTag, "-001")] || timeData["001"];
7904  return hourCycles[0];
7905}
7906
vendor: 31,535 bytes, lines 7907-8478
7907// ../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js
7908var _a, SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*")), SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
7909function createLocation(start, end) {
7910  return { start, end };
7911}
7912var hasNativeStartsWith = !!String.prototype.startsWith && "_a".startsWith("a", 1), hasNativeFromCodePoint = !!String.fromCodePoint, hasNativeFromEntries = !!Object.fromEntries, hasNativeCodePointAt = !!String.prototype.codePointAt, hasTrimStart = !!String.prototype.trimStart, hasTrimEnd = !!String.prototype.trimEnd, hasNativeIsSafeInteger = !!Number.isSafeInteger, isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(n3) {
7913  return typeof n3 == "number" && isFinite(n3) && Math.floor(n3) === n3 && Math.abs(n3) <= 9007199254740991;
7914}, REGEX_SUPPORTS_U_AND_Y = !0;
7915try {
7916  re = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"), REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec("a")) === null || _a === void 0 ? void 0 : _a[0]) === "a";
7917} catch {
7918  REGEX_SUPPORTS_U_AND_Y = !1;
7919}
7920var re, startsWith = hasNativeStartsWith ? (
7921  // Native
7922  function(s2, search, position) {
7923    return s2.startsWith(search, position);
7924  }
7925) : (
7926  // For IE11
7927  function(s2, search, position) {
7928    return s2.slice(position, position + search.length) === search;
7929  }
7930), fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : (
7931  // IE11
7932  function() {
7933    for (var codePoints = [], _i = 0; _i < arguments.length; _i++)
7934      codePoints[_i] = arguments[_i];
7935    for (var elements = "", length = codePoints.length, i2 = 0, code; length > i2; ) {
7936      if (code = codePoints[i2++], code > 1114111)
7937        throw RangeError(code + " is not a valid code point");
7938      elements += code < 65536 ? String.fromCharCode(code) : String.fromCharCode(((code -= 65536) >> 10) + 55296, code % 1024 + 56320);
7939    }
7940    return elements;
7941  }
7942), fromEntries = (
7943  // native
7944  hasNativeFromEntries ? Object.fromEntries : (
7945    // Ponyfill
7946    function(entries) {
7947      for (var obj = {}, _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
7948        var _a2 = entries_1[_i], k2 = _a2[0], v2 = _a2[1];
7949        obj[k2] = v2;
7950      }
7951      return obj;
7952    }
7953  )
7954), codePointAt = hasNativeCodePointAt ? (
7955  // Native
7956  function(s2, index) {
7957    return s2.codePointAt(index);
7958  }
7959) : (
7960  // IE 11
7961  function(s2, index) {
7962    var size = s2.length;
7963    if (!(index < 0 || index >= size)) {
7964      var first = s2.charCodeAt(index), second;
7965      return first < 55296 || first > 56319 || index + 1 === size || (second = s2.charCodeAt(index + 1)) < 56320 || second > 57343 ? first : (first - 55296 << 10) + (second - 56320) + 65536;
7966    }
7967  }
7968), trimStart = hasTrimStart ? (
7969  // Native
7970  function(s2) {
7971    return s2.trimStart();
7972  }
7973) : (
7974  // Ponyfill
7975  function(s2) {
7976    return s2.replace(SPACE_SEPARATOR_START_REGEX, "");
7977  }
7978), trimEnd = hasTrimEnd ? (
7979  // Native
7980  function(s2) {
7981    return s2.trimEnd();
7982  }
7983) : (
7984  // Ponyfill
7985  function(s2) {
7986    return s2.replace(SPACE_SEPARATOR_END_REGEX, "");
7987  }
7988);
7989function RE(s2, flag) {
7990  return new RegExp(s2, flag);
7991}
7992var matchIdentifierAtIndex;
7993REGEX_SUPPORTS_U_AND_Y ? (IDENTIFIER_PREFIX_RE_1 = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"), matchIdentifierAtIndex = function(s2, index) {
7994  var _a2;
7995  IDENTIFIER_PREFIX_RE_1.lastIndex = index;
7996  var match = IDENTIFIER_PREFIX_RE_1.exec(s2);
7997  return (_a2 = match[1]) !== null && _a2 !== void 0 ? _a2 : "";
7998}) : matchIdentifierAtIndex = function(s2, index) {
7999  for (var match = []; ; ) {
8000    var c2 = codePointAt(s2, index);
8001    if (c2 === void 0 || _isWhiteSpace(c2) || _isPatternSyntax(c2))
8002      break;
8003    match.push(c2), index += c2 >= 65536 ? 2 : 1;
8004  }
8005  return fromCodePoint.apply(void 0, match);
8006};
8007var IDENTIFIER_PREFIX_RE_1, Parser = (
8008  /** @class */
8009  (function() {
8010    function Parser2(message, options2) {
8011      options2 === void 0 && (options2 = {}), this.message = message, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!options2.ignoreTag, this.locale = options2.locale, this.requiresOtherClause = !!options2.requiresOtherClause, this.shouldParseSkeletons = !!options2.shouldParseSkeletons;
8012    }
8013    return Parser2.prototype.parse = function() {
8014      if (this.offset() !== 0)
8015        throw Error("parser can only be used once");
8016      return this.parseMessage(0, "", !1);
8017    }, Parser2.prototype.parseMessage = function(nestingLevel, parentArgType, expectingCloseTag) {
8018      for (var elements = []; !this.isEOF(); ) {
8019        var char = this.char();
8020        if (char === 123) {
8021          var result = this.parseArgument(nestingLevel, expectingCloseTag);
8022          if (result.err)
8023            return result;
8024          elements.push(result.val);
8025        } else {
8026          if (char === 125 && nestingLevel > 0)
8027            break;
8028          if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
8029            var position = this.clonePosition();
8030            this.bump(), elements.push({
8031              type: TYPE.pound,
8032              location: createLocation(position, this.clonePosition())
8033            });
8034          } else if (char === 60 && !this.ignoreTag && this.peek() === 47) {
8035            if (expectingCloseTag)
8036              break;
8037            return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));
8038          } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
8039            var result = this.parseTag(nestingLevel, parentArgType);
8040            if (result.err)
8041              return result;
8042            elements.push(result.val);
8043          } else {
8044            var result = this.parseLiteral(nestingLevel, parentArgType);
8045            if (result.err)
8046              return result;
8047            elements.push(result.val);
8048          }
8049        }
8050      }
8051      return { val: elements, err: null };
8052    }, Parser2.prototype.parseTag = function(nestingLevel, parentArgType) {
8053      var startPosition = this.clonePosition();
8054      this.bump();
8055      var tagName = this.parseTagName();
8056      if (this.bumpSpace(), this.bumpIf("/>"))
8057        return {
8058          val: {
8059            type: TYPE.literal,
8060            value: "<".concat(tagName, "/>"),
8061            location: createLocation(startPosition, this.clonePosition())
8062          },
8063          err: null
8064        };
8065      if (this.bumpIf(">")) {
8066        var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, !0);
8067        if (childrenResult.err)
8068          return childrenResult;
8069        var children = childrenResult.val, endTagStartPosition = this.clonePosition();
8070        if (this.bumpIf("</")) {
8071          if (this.isEOF() || !_isAlpha(this.char()))
8072            return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));
8073          var closingTagNameStartPosition = this.clonePosition(), closingTagName = this.parseTagName();
8074          return tagName !== closingTagName ? this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? {
8075            val: {
8076              type: TYPE.tag,
8077              value: tagName,
8078              children,
8079              location: createLocation(startPosition, this.clonePosition())
8080            },
8081            err: null
8082          } : this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition())));
8083        } else
8084          return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));
8085      } else
8086        return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));
8087    }, Parser2.prototype.parseTagName = function() {
8088      var startOffset = this.offset();
8089      for (this.bump(); !this.isEOF() && _isPotentialElementNameChar(this.char()); )
8090        this.bump();
8091      return this.message.slice(startOffset, this.offset());
8092    }, Parser2.prototype.parseLiteral = function(nestingLevel, parentArgType) {
8093      for (var start = this.clonePosition(), value = ""; ; ) {
8094        var parseQuoteResult = this.tryParseQuote(parentArgType);
8095        if (parseQuoteResult) {
8096          value += parseQuoteResult;
8097          continue;
8098        }
8099        var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);
8100        if (parseUnquotedResult) {
8101          value += parseUnquotedResult;
8102          continue;
8103        }
8104        var parseLeftAngleResult = this.tryParseLeftAngleBracket();
8105        if (parseLeftAngleResult) {
8106          value += parseLeftAngleResult;
8107          continue;
8108        }
8109        break;
8110      }
8111      var location2 = createLocation(start, this.clonePosition());
8112      return {
8113        val: { type: TYPE.literal, value, location: location2 },
8114        err: null
8115      };
8116    }, Parser2.prototype.tryParseLeftAngleBracket = function() {
8117      return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.
8118      !_isAlphaOrSlash(this.peek() || 0)) ? (this.bump(), "<") : null;
8119    }, Parser2.prototype.tryParseQuote = function(parentArgType) {
8120      if (this.isEOF() || this.char() !== 39)
8121        return null;
8122      switch (this.peek()) {
8123        case 39:
8124          return this.bump(), this.bump(), "'";
8125        // '{', '<', '>', '}'
8126        case 123:
8127        case 60:
8128        case 62:
8129        case 125:
8130          break;
8131        case 35:
8132          if (parentArgType === "plural" || parentArgType === "selectordinal")
8133            break;
8134          return null;
8135        default:
8136          return null;
8137      }
8138      this.bump();
8139      var codePoints = [this.char()];
8140      for (this.bump(); !this.isEOF(); ) {
8141        var ch = this.char();
8142        if (ch === 39)
8143          if (this.peek() === 39)
8144            codePoints.push(39), this.bump();
8145          else {
8146            this.bump();
8147            break;
8148          }
8149        else
8150          codePoints.push(ch);
8151        this.bump();
8152      }
8153      return fromCodePoint.apply(void 0, codePoints);
8154    }, Parser2.prototype.tryParseUnquoted = function(nestingLevel, parentArgType) {
8155      if (this.isEOF())
8156        return null;
8157      var ch = this.char();
8158      return ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0 ? null : (this.bump(), fromCodePoint(ch));
8159    }, Parser2.prototype.parseArgument = function(nestingLevel, expectingCloseTag) {
8160      var openingBracePosition = this.clonePosition();
8161      if (this.bump(), this.bumpSpace(), this.isEOF())
8162        return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
8163      if (this.char() === 125)
8164        return this.bump(), this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
8165      var value = this.parseIdentifierIfPossible().value;
8166      if (!value)
8167        return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
8168      if (this.bumpSpace(), this.isEOF())
8169        return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
8170      switch (this.char()) {
8171        // Simple argument: `{name}`
8172        case 125:
8173          return this.bump(), {
8174            val: {
8175              type: TYPE.argument,
8176              // value does not include the opening and closing braces.
8177              value,
8178              location: createLocation(openingBracePosition, this.clonePosition())
8179            },
8180            err: null
8181          };
8182        // Argument with options: `{name, format, ...}`
8183        case 44:
8184          return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())) : this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);
8185        default:
8186          return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
8187      }
8188    }, Parser2.prototype.parseIdentifierIfPossible = function() {
8189      var startingPosition = this.clonePosition(), startOffset = this.offset(), value = matchIdentifierAtIndex(this.message, startOffset), endOffset = startOffset + value.length;
8190      this.bumpTo(endOffset);
8191      var endPosition = this.clonePosition(), location2 = createLocation(startingPosition, endPosition);
8192      return { value, location: location2 };
8193    }, Parser2.prototype.parseArgumentOptions = function(nestingLevel, expectingCloseTag, value, openingBracePosition) {
8194      var _a2, typeStartPosition = this.clonePosition(), argType = this.parseIdentifierIfPossible().value, typeEndPosition = this.clonePosition();
8195      switch (argType) {
8196        case "":
8197          return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
8198        case "number":
8199        case "date":
8200        case "time": {
8201          this.bumpSpace();
8202          var styleAndLocation = null;
8203          if (this.bumpIf(",")) {
8204            this.bumpSpace();
8205            var styleStartPosition = this.clonePosition(), result = this.parseSimpleArgStyleIfPossible();
8206            if (result.err)
8207              return result;
8208            var style = trimEnd(result.val);
8209            if (style.length === 0)
8210              return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));
8211            var styleLocation = createLocation(styleStartPosition, this.clonePosition());
8212            styleAndLocation = { style, styleLocation };
8213          }
8214          var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
8215          if (argCloseResult.err)
8216            return argCloseResult;
8217          var location_1 = createLocation(openingBracePosition, this.clonePosition());
8218          if (styleAndLocation && startsWith(styleAndLocation?.style, "::", 0)) {
8219            var skeleton = trimStart(styleAndLocation.style.slice(2));
8220            if (argType === "number") {
8221              var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
8222              return result.err ? result : {
8223                val: { type: TYPE.number, value, location: location_1, style: result.val },
8224                err: null
8225              };
8226            } else {
8227              if (skeleton.length === 0)
8228                return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);
8229              var dateTimePattern = skeleton;
8230              this.locale && (dateTimePattern = getBestPattern(skeleton, this.locale));
8231              var style = {
8232                type: SKELETON_TYPE.dateTime,
8233                pattern: dateTimePattern,
8234                location: styleAndLocation.styleLocation,
8235                parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {}
8236              }, type = argType === "date" ? TYPE.date : TYPE.time;
8237              return {
8238                val: { type, value, location: location_1, style },
8239                err: null
8240              };
8241            }
8242          }
8243          return {
8244            val: {
8245              type: argType === "number" ? TYPE.number : argType === "date" ? TYPE.date : TYPE.time,
8246              value,
8247              location: location_1,
8248              style: (_a2 = styleAndLocation?.style) !== null && _a2 !== void 0 ? _a2 : null
8249            },
8250            err: null
8251          };
8252        }
8253        case "plural":
8254        case "selectordinal":
8255        case "select": {
8256          var typeEndPosition_1 = this.clonePosition();
8257          if (this.bumpSpace(), !this.bumpIf(","))
8258            return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));
8259          this.bumpSpace();
8260          var identifierAndLocation = this.parseIdentifierIfPossible(), pluralOffset = 0;
8261          if (argType !== "select" && identifierAndLocation.value === "offset") {
8262            if (!this.bumpIf(":"))
8263              return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));
8264            this.bumpSpace();
8265            var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
8266            if (result.err)
8267              return result;
8268            this.bumpSpace(), identifierAndLocation = this.parseIdentifierIfPossible(), pluralOffset = result.val;
8269          }
8270          var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);
8271          if (optionsResult.err)
8272            return optionsResult;
8273          var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
8274          if (argCloseResult.err)
8275            return argCloseResult;
8276          var location_2 = createLocation(openingBracePosition, this.clonePosition());
8277          return argType === "select" ? {
8278            val: {
8279              type: TYPE.select,
8280              value,
8281              options: fromEntries(optionsResult.val),
8282              location: location_2
8283            },
8284            err: null
8285          } : {
8286            val: {
8287              type: TYPE.plural,
8288              value,
8289              options: fromEntries(optionsResult.val),
8290              offset: pluralOffset,
8291              pluralType: argType === "plural" ? "cardinal" : "ordinal",
8292              location: location_2
8293            },
8294            err: null
8295          };
8296        }
8297        default:
8298          return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
8299      }
8300    }, Parser2.prototype.tryParseArgumentClose = function(openingBracePosition) {
8301      return this.isEOF() || this.char() !== 125 ? this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())) : (this.bump(), { val: !0, err: null });
8302    }, Parser2.prototype.parseSimpleArgStyleIfPossible = function() {
8303      for (var nestedBraces = 0, startPosition = this.clonePosition(); !this.isEOF(); ) {
8304        var ch = this.char();
8305        switch (ch) {
8306          case 39: {
8307            this.bump();
8308            var apostrophePosition = this.clonePosition();
8309            if (!this.bumpUntil("'"))
8310              return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));
8311            this.bump();
8312            break;
8313          }
8314          case 123: {
8315            nestedBraces += 1, this.bump();
8316            break;
8317          }
8318          case 125: {
8319            if (nestedBraces > 0)
8320              nestedBraces -= 1;
8321            else
8322              return {
8323                val: this.message.slice(startPosition.offset, this.offset()),
8324                err: null
8325              };
8326            break;
8327          }
8328          default:
8329            this.bump();
8330            break;
8331        }
8332      }
8333      return {
8334        val: this.message.slice(startPosition.offset, this.offset()),
8335        err: null
8336      };
8337    }, Parser2.prototype.parseNumberSkeletonFromString = function(skeleton, location2) {
8338      var tokens2 = [];
8339      try {
8340        tokens2 = parseNumberSkeletonFromString(skeleton);
8341      } catch {
8342        return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location2);
8343      }
8344      return {
8345        val: {
8346          type: SKELETON_TYPE.number,
8347          tokens: tokens2,
8348          location: location2,
8349          parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens2) : {}
8350        },
8351        err: null
8352      };
8353    }, Parser2.prototype.tryParsePluralOrSelectOptions = function(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
8354      for (var _a2, hasOtherClause = !1, options2 = [], parsedSelectors = /* @__PURE__ */ new Set(), selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location; ; ) {
8355        if (selector.length === 0) {
8356          var startPosition = this.clonePosition();
8357          if (parentArgType !== "select" && this.bumpIf("=")) {
8358            var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);
8359            if (result.err)
8360              return result;
8361            selectorLocation = createLocation(startPosition, this.clonePosition()), selector = this.message.slice(startPosition.offset, this.offset());
8362          } else
8363            break;
8364        }
8365        if (parsedSelectors.has(selector))
8366          return this.error(parentArgType === "select" ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);
8367        selector === "other" && (hasOtherClause = !0), this.bumpSpace();
8368        var openingBracePosition = this.clonePosition();
8369        if (!this.bumpIf("{"))
8370          return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));
8371        var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);
8372        if (fragmentResult.err)
8373          return fragmentResult;
8374        var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
8375        if (argCloseResult.err)
8376          return argCloseResult;
8377        options2.push([
8378          selector,
8379          {
8380            value: fragmentResult.val,
8381            location: createLocation(openingBracePosition, this.clonePosition())
8382          }
8383        ]), parsedSelectors.add(selector), this.bumpSpace(), _a2 = this.parseIdentifierIfPossible(), selector = _a2.value, selectorLocation = _a2.location;
8384      }
8385      return options2.length === 0 ? this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !hasOtherClause ? this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition())) : { val: options2, err: null };
8386    }, Parser2.prototype.tryParseDecimalInteger = function(expectNumberError, invalidNumberError) {
8387      var sign = 1, startingPosition = this.clonePosition();
8388      this.bumpIf("+") || this.bumpIf("-") && (sign = -1);
8389      for (var hasDigits = !1, decimal = 0; !this.isEOF(); ) {
8390        var ch = this.char();
8391        if (ch >= 48 && ch <= 57)
8392          hasDigits = !0, decimal = decimal * 10 + (ch - 48), this.bump();
8393        else
8394          break;
8395      }
8396      var location2 = createLocation(startingPosition, this.clonePosition());
8397      return hasDigits ? (decimal *= sign, isSafeInteger(decimal) ? { val: decimal, err: null } : this.error(invalidNumberError, location2)) : this.error(expectNumberError, location2);
8398    }, Parser2.prototype.offset = function() {
8399      return this.position.offset;
8400    }, Parser2.prototype.isEOF = function() {
8401      return this.offset() === this.message.length;
8402    }, Parser2.prototype.clonePosition = function() {
8403      return {
8404        offset: this.position.offset,
8405        line: this.position.line,
8406        column: this.position.column
8407      };
8408    }, Parser2.prototype.char = function() {
8409      var offset2 = this.position.offset;
8410      if (offset2 >= this.message.length)
8411        throw Error("out of bound");
8412      var code = codePointAt(this.message, offset2);
8413      if (code === void 0)
8414        throw Error("Offset ".concat(offset2, " is at invalid UTF-16 code unit boundary"));
8415      return code;
8416    }, Parser2.prototype.error = function(kind, location2) {
8417      return {
8418        val: null,
8419        err: {
8420          kind,
8421          message: this.message,
8422          location: location2
8423        }
8424      };
8425    }, Parser2.prototype.bump = function() {
8426      if (!this.isEOF()) {
8427        var code = this.char();
8428        code === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += code < 65536 ? 1 : 2);
8429      }
8430    }, Parser2.prototype.bumpIf = function(prefix) {
8431      if (startsWith(this.message, prefix, this.offset())) {
8432        for (var i2 = 0; i2 < prefix.length; i2++)
8433          this.bump();
8434        return !0;
8435      }
8436      return !1;
8437    }, Parser2.prototype.bumpUntil = function(pattern) {
8438      var currentOffset = this.offset(), index = this.message.indexOf(pattern, currentOffset);
8439      return index >= 0 ? (this.bumpTo(index), !0) : (this.bumpTo(this.message.length), !1);
8440    }, Parser2.prototype.bumpTo = function(targetOffset) {
8441      if (this.offset() > targetOffset)
8442        throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
8443      for (targetOffset = Math.min(targetOffset, this.message.length); ; ) {
8444        var offset2 = this.offset();
8445        if (offset2 === targetOffset)
8446          break;
8447        if (offset2 > targetOffset)
8448          throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
8449        if (this.bump(), this.isEOF())
8450          break;
8451      }
8452    }, Parser2.prototype.bumpSpace = function() {
8453      for (; !this.isEOF() && _isWhiteSpace(this.char()); )
8454        this.bump();
8455    }, Parser2.prototype.peek = function() {
8456      if (this.isEOF())
8457        return null;
8458      var code = this.char(), offset2 = this.offset(), nextCode = this.message.charCodeAt(offset2 + (code >= 65536 ? 2 : 1));
8459      return nextCode ?? null;
8460    }, Parser2;
8461  })()
8462);
8463function _isAlpha(codepoint) {
8464  return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90;
8465}
8466function _isAlphaOrSlash(codepoint) {
8467  return _isAlpha(codepoint) || codepoint === 47;
8468}
8469function _isPotentialElementNameChar(c2) {
8470  return c2 === 45 || c2 === 46 || c2 >= 48 && c2 <= 57 || c2 === 95 || c2 >= 97 && c2 <= 122 || c2 >= 65 && c2 <= 90 || c2 == 183 || c2 >= 192 && c2 <= 214 || c2 >= 216 && c2 <= 246 || c2 >= 248 && c2 <= 893 || c2 >= 895 && c2 <= 8191 || c2 >= 8204 && c2 <= 8205 || c2 >= 8255 && c2 <= 8256 || c2 >= 8304 && c2 <= 8591 || c2 >= 11264 && c2 <= 12271 || c2 >= 12289 && c2 <= 55295 || c2 >= 63744 && c2 <= 64975 || c2 >= 65008 && c2 <= 65533 || c2 >= 65536 && c2 <= 983039;
8471}
8472function _isWhiteSpace(c2) {
8473  return c2 >= 9 && c2 <= 13 || c2 === 32 || c2 === 133 || c2 >= 8206 && c2 <= 8207 || c2 === 8232 || c2 === 8233;
8474}
8475function _isPatternSyntax(c2) {
8476  return c2 >= 33 && c2 <= 35 || c2 === 36 || c2 >= 37 && c2 <= 39 || c2 === 40 || c2 === 41 || c2 === 42 || c2 === 43 || c2 === 44 || c2 === 45 || c2 >= 46 && c2 <= 47 || c2 >= 58 && c2 <= 59 || c2 >= 60 && c2 <= 62 || c2 >= 63 && c2 <= 64 || c2 === 91 || c2 === 92 || c2 === 93 || c2 === 94 || c2 === 96 || c2 === 123 || c2 === 124 || c2 === 125 || c2 === 126 || c2 === 161 || c2 >= 162 && c2 <= 165 || c2 === 166 || c2 === 167 || c2 === 169 || c2 === 171 || c2 === 172 || c2 === 174 || c2 === 176 || c2 === 177 || c2 === 182 || c2 === 187 || c2 === 191 || c2 === 215 || c2 === 247 || c2 >= 8208 && c2 <= 8213 || c2 >= 8214 && c2 <= 8215 || c2 === 8216 || c2 === 8217 || c2 === 8218 || c2 >= 8219 && c2 <= 8220 || c2 === 8221 || c2 === 8222 || c2 === 8223 || c2 >= 8224 && c2 <= 8231 || c2 >= 8240 && c2 <= 8248 || c2 === 8249 || c2 === 8250 || c2 >= 8251 && c2 <= 8254 || c2 >= 8257 && c2 <= 8259 || c2 === 8260 || c2 === 8261 || c2 === 8262 || c2 >= 8263 && c2 <= 8273 || c2 === 8274 || c2 === 8275 || c2 >= 8277 && c2 <= 8286 || c2 >= 8592 && c2 <= 8596 || c2 >= 8597 && c2 <= 8601 || c2 >= 8602 && c2 <= 8603 || c2 >= 8604 && c2 <= 8607 || c2 === 8608 || c2 >= 8609 && c2 <= 8610 || c2 === 8611 || c2 >= 8612 && c2 <= 8613 || c2 === 8614 || c2 >= 8615 && c2 <= 8621 || c2 === 8622 || c2 >= 8623 && c2 <= 8653 || c2 >= 8654 && c2 <= 8655 || c2 >= 8656 && c2 <= 8657 || c2 === 8658 || c2 === 8659 || c2 === 8660 || c2 >= 8661 && c2 <= 8691 || c2 >= 8692 && c2 <= 8959 || c2 >= 8960 && c2 <= 8967 || c2 === 8968 || c2 === 8969 || c2 === 8970 || c2 === 8971 || c2 >= 8972 && c2 <= 8991 || c2 >= 8992 && c2 <= 8993 || c2 >= 8994 && c2 <= 9e3 || c2 === 9001 || c2 === 9002 || c2 >= 9003 && c2 <= 9083 || c2 === 9084 || c2 >= 9085 && c2 <= 9114 || c2 >= 9115 && c2 <= 9139 || c2 >= 9140 && c2 <= 9179 || c2 >= 9180 && c2 <= 9185 || c2 >= 9186 && c2 <= 9254 || c2 >= 9255 && c2 <= 9279 || c2 >= 9280 && c2 <= 9290 || c2 >= 9291 && c2 <= 9311 || c2 >= 9472 && c2 <= 9654 || c2 === 9655 || c2 >= 9656 && c2 <= 9664 || c2 === 9665 || c2 >= 9666 && c2 <= 9719 || c2 >= 9720 && c2 <= 9727 || c2 >= 9728 && c2 <= 9838 || c2 === 9839 || c2 >= 9840 && c2 <= 10087 || c2 === 10088 || c2 === 10089 || c2 === 10090 || c2 === 10091 || c2 === 10092 || c2 === 10093 || c2 === 10094 || c2 === 10095 || c2 === 10096 || c2 === 10097 || c2 === 10098 || c2 === 10099 || c2 === 10100 || c2 === 10101 || c2 >= 10132 && c2 <= 10175 || c2 >= 10176 && c2 <= 10180 || c2 === 10181 || c2 === 10182 || c2 >= 10183 && c2 <= 10213 || c2 === 10214 || c2 === 10215 || c2 === 10216 || c2 === 10217 || c2 === 10218 || c2 === 10219 || c2 === 10220 || c2 === 10221 || c2 === 10222 || c2 === 10223 || c2 >= 10224 && c2 <= 10239 || c2 >= 10240 && c2 <= 10495 || c2 >= 10496 && c2 <= 10626 || c2 === 10627 || c2 === 10628 || c2 === 10629 || c2 === 10630 || c2 === 10631 || c2 === 10632 || c2 === 10633 || c2 === 10634 || c2 === 10635 || c2 === 10636 || c2 === 10637 || c2 === 10638 || c2 === 10639 || c2 === 10640 || c2 === 10641 || c2 === 10642 || c2 === 10643 || c2 === 10644 || c2 === 10645 || c2 === 10646 || c2 === 10647 || c2 === 10648 || c2 >= 10649 && c2 <= 10711 || c2 === 10712 || c2 === 10713 || c2 === 10714 || c2 === 10715 || c2 >= 10716 && c2 <= 10747 || c2 === 10748 || c2 === 10749 || c2 >= 10750 && c2 <= 11007 || c2 >= 11008 && c2 <= 11055 || c2 >= 11056 && c2 <= 11076 || c2 >= 11077 && c2 <= 11078 || c2 >= 11079 && c2 <= 11084 || c2 >= 11085 && c2 <= 11123 || c2 >= 11124 && c2 <= 11125 || c2 >= 11126 && c2 <= 11157 || c2 === 11158 || c2 >= 11159 && c2 <= 11263 || c2 >= 11776 && c2 <= 11777 || c2 === 11778 || c2 === 11779 || c2 === 11780 || c2 === 11781 || c2 >= 11782 && c2 <= 11784 || c2 === 11785 || c2 === 11786 || c2 === 11787 || c2 === 11788 || c2 === 11789 || c2 >= 11790 && c2 <= 11798 || c2 === 11799 || c2 >= 11800 && c2 <= 11801 || c2 === 11802 || c2 === 11803 || c2 === 11804 || c2 === 11805 || c2 >= 11806 && c2 <= 11807 || c2 === 11808 || c2 === 11809 || c2 === 11810 || c2 === 11811 || c2 === 11812 || c2 === 11813 || c2 === 11814 || c2 === 11815 || c2 === 11816 || c2 === 11817 || c2 >= 11818 && c2 <= 11822 || c2 === 11823 || c2 >= 11824 && c2 <= 11833 || c2 >= 11834 && c2 <= 11835 || c2 >= 11836 && c2 <= 11839 || c2 === 11840 || c2 === 11841 || c2 === 11842 || c2 >= 11843 && c2 <= 11855 || c2 >= 11856 && c2 <= 11857 || c2 === 11858 || c2 >= 11859 && c2 <= 11903 || c2 >= 12289 && c2 <= 12291 || c2 === 12296 || c2 === 12297 || c2 === 12298 || c2 === 12299 || c2 === 12300 || c2 === 12301 || c2 === 12302 || c2 === 12303 || c2 === 12304 || c2 === 12305 || c2 >= 12306 && c2 <= 12307 || c2 === 12308 || c2 === 12309 || c2 === 12310 || c2 === 12311 || c2 === 12312 || c2 === 12313 || c2 === 12314 || c2 === 12315 || c2 === 12316 || c2 === 12317 || c2 >= 12318 && c2 <= 12319 || c2 === 12320 || c2 === 12336 || c2 === 64830 || c2 === 64831 || c2 >= 65093 && c2 <= 65094;
8477}
8478
vendor: 981 bytes, lines 8479-8497
8479// ../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js
8480function pruneLocation(els) {
8481  els.forEach(function(el) {
8482    if (delete el.location, isSelectElement(el) || isPluralElement(el))
8483      for (var k2 in el.options)
8484        delete el.options[k2].location, pruneLocation(el.options[k2].value);
8485    else isNumberElement(el) && isNumberSkeleton(el.style) || (isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style) ? delete el.style.location : isTagElement(el) && pruneLocation(el.children);
8486  });
8487}
8488function parse(message, opts) {
8489  opts === void 0 && (opts = {}), opts = __assign({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, opts);
8490  var result = new Parser(message, opts).parse();
8491  if (result.err) {
8492    var error = SyntaxError(ErrorKind[result.err.kind]);
8493    throw error.location = result.err.location, error.originalMessage = result.err.message, error;
8494  }
8495  return opts?.captureLocation || pruneLocation(result.val), result.val;
8496}
8497
vendor: 2,018 bytes, lines 8498-8546
8498// ../../node_modules/intl-messageformat/lib/src/error.js
8499var ErrorCode;
8500(function(ErrorCode2) {
8501  ErrorCode2.MISSING_VALUE = "MISSING_VALUE", ErrorCode2.INVALID_VALUE = "INVALID_VALUE", ErrorCode2.MISSING_INTL_API = "MISSING_INTL_API";
8502})(ErrorCode || (ErrorCode = {}));
8503var FormatError = (
8504  /** @class */
8505  (function(_super) {
8506    __extends(FormatError2, _super);
8507    function FormatError2(msg, code, originalMessage) {
8508      var _this = _super.call(this, msg) || this;
8509      return _this.code = code, _this.originalMessage = originalMessage, _this;
8510    }
8511    return FormatError2.prototype.toString = function() {
8512      return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
8513    }, FormatError2;
8514  })(Error)
8515);
8516var InvalidValueError = (
8517  /** @class */
8518  (function(_super) {
8519    __extends(InvalidValueError2, _super);
8520    function InvalidValueError2(variableId, value, options2, originalMessage) {
8521      return _super.call(this, 'Invalid values for "'.concat(variableId, '": "').concat(value, '". Options are "').concat(Object.keys(options2).join('", "'), '"'), ErrorCode.INVALID_VALUE, originalMessage) || this;
8522    }
8523    return InvalidValueError2;
8524  })(FormatError)
8525);
8526var InvalidValueTypeError = (
8527  /** @class */
8528  (function(_super) {
8529    __extends(InvalidValueTypeError2, _super);
8530    function InvalidValueTypeError2(value, type, originalMessage) {
8531      return _super.call(this, 'Value for "'.concat(value, '" must be of type ').concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;
8532    }
8533    return InvalidValueTypeError2;
8534  })(FormatError)
8535);
8536var MissingValueError = (
8537  /** @class */
8538  (function(_super) {
8539    __extends(MissingValueError2, _super);
8540    function MissingValueError2(variableId, originalMessage) {
8541      return _super.call(this, 'The intl string context variable "'.concat(variableId, '" was not provided to the string "').concat(originalMessage, '"'), ErrorCode.MISSING_VALUE, originalMessage) || this;
8542    }
8543    return MissingValueError2;
8544  })(FormatError)
8545);
8546
vendor: 4,638 bytes, lines 8547-8659
8547// ../../node_modules/intl-messageformat/lib/src/formatters.js
8548var PART_TYPE;
8549(function(PART_TYPE2) {
8550  PART_TYPE2[PART_TYPE2.literal = 0] = "literal", PART_TYPE2[PART_TYPE2.object = 1] = "object";
8551})(PART_TYPE || (PART_TYPE = {}));
8552function mergeLiteral(parts) {
8553  return parts.length < 2 ? parts : parts.reduce(function(all, part) {
8554    var lastPart = all[all.length - 1];
8555    return !lastPart || lastPart.type !== PART_TYPE.literal || part.type !== PART_TYPE.literal ? all.push(part) : lastPart.value += part.value, all;
8556  }, []);
8557}
8558function isFormatXMLElementFn(el) {
8559  return typeof el == "function";
8560}
8561function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) {
8562  if (els.length === 1 && isLiteralElement(els[0]))
8563    return [
8564      {
8565        type: PART_TYPE.literal,
8566        value: els[0].value
8567      }
8568    ];
8569  for (var result = [], _i = 0, els_1 = els; _i < els_1.length; _i++) {
8570    var el = els_1[_i];
8571    if (isLiteralElement(el)) {
8572      result.push({
8573        type: PART_TYPE.literal,
8574        value: el.value
8575      });
8576      continue;
8577    }
8578    if (isPoundElement(el)) {
8579      typeof currentPluralValue == "number" && result.push({
8580        type: PART_TYPE.literal,
8581        value: formatters.getNumberFormat(locales).format(currentPluralValue)
8582      });
8583      continue;
8584    }
8585    var varName = el.value;
8586    if (!(values && varName in values))
8587      throw new MissingValueError(varName, originalMessage);
8588    var value = values[varName];
8589    if (isArgumentElement(el)) {
8590      (!value || typeof value == "string" || typeof value == "number") && (value = typeof value == "string" || typeof value == "number" ? String(value) : ""), result.push({
8591        type: typeof value == "string" ? PART_TYPE.literal : PART_TYPE.object,
8592        value
8593      });
8594      continue;
8595    }
8596    if (isDateElement(el)) {
8597      var style = typeof el.style == "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
8598      result.push({
8599        type: PART_TYPE.literal,
8600        value: formatters.getDateTimeFormat(locales, style).format(value)
8601      });
8602      continue;
8603    }
8604    if (isTimeElement(el)) {
8605      var style = typeof el.style == "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium;
8606      result.push({
8607        type: PART_TYPE.literal,
8608        value: formatters.getDateTimeFormat(locales, style).format(value)
8609      });
8610      continue;
8611    }
8612    if (isNumberElement(el)) {
8613      var style = typeof el.style == "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0;
8614      style && style.scale && (value = value * (style.scale || 1)), result.push({
8615        type: PART_TYPE.literal,
8616        value: formatters.getNumberFormat(locales, style).format(value)
8617      });
8618      continue;
8619    }
8620    if (isTagElement(el)) {
8621      var children = el.children, value_1 = el.value, formatFn = values[value_1];
8622      if (!isFormatXMLElementFn(formatFn))
8623        throw new InvalidValueTypeError(value_1, "function", originalMessage);
8624      var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue), chunks = formatFn(parts.map(function(p2) {
8625        return p2.value;
8626      }));
8627      Array.isArray(chunks) || (chunks = [chunks]), result.push.apply(result, chunks.map(function(c2) {
8628        return {
8629          type: typeof c2 == "string" ? PART_TYPE.literal : PART_TYPE.object,
8630          value: c2
8631        };
8632      }));
8633    }
8634    if (isSelectElement(el)) {
8635      var opt = el.options[value] || el.options.other;
8636      if (!opt)
8637        throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
8638      result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));
8639      continue;
8640    }
8641    if (isPluralElement(el)) {
8642      var opt = el.options["=".concat(value)];
8643      if (!opt) {
8644        if (!Intl.PluralRules)
8645          throw new FormatError(`Intl.PluralRules is not available in this environment.
8646Try polyfilling it using "@formatjs/intl-pluralrules"
8647`, ErrorCode.MISSING_INTL_API, originalMessage);
8648        var rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(value - (el.offset || 0));
8649        opt = el.options[rule] || el.options.other;
8650      }
8651      if (!opt)
8652        throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
8653      result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));
8654      continue;
8655    }
8656  }
8657  return mergeLiteral(result);
8658}
8659
vendor: 6,159 bytes, lines 8660-8827
8660// ../../node_modules/intl-messageformat/lib/src/core.js
8661function mergeConfig(c1, c2) {
8662  return c2 ? __assign(__assign(__assign({}, c1 || {}), c2 || {}), Object.keys(c1).reduce(function(all, k2) {
8663    return all[k2] = __assign(__assign({}, c1[k2]), c2[k2] || {}), all;
8664  }, {})) : c1;
8665}
8666function mergeConfigs(defaultConfig, configs) {
8667  return configs ? Object.keys(defaultConfig).reduce(function(all, k2) {
8668    return all[k2] = mergeConfig(defaultConfig[k2], configs[k2]), all;
8669  }, __assign({}, defaultConfig)) : defaultConfig;
8670}
8671function createFastMemoizeCache(store2) {
8672  return {
8673    create: function() {
8674      return {
8675        get: function(key) {
8676          return store2[key];
8677        },
8678        set: function(key, value) {
8679          store2[key] = value;
8680        }
8681      };
8682    }
8683  };
8684}
8685function createDefaultFormatters(cache) {
8686  return cache === void 0 && (cache = {
8687    number: {},
8688    dateTime: {},
8689    pluralRules: {}
8690  }), {
8691    getNumberFormat: memoize(function() {
8692      for (var _a2, args = [], _i = 0; _i < arguments.length; _i++)
8693        args[_i] = arguments[_i];
8694      return new ((_a2 = Intl.NumberFormat).bind.apply(_a2, __spreadArray([void 0], args, !1)))();
8695    }, {
8696      cache: createFastMemoizeCache(cache.number),
8697      strategy: strategies.variadic
8698    }),
8699    getDateTimeFormat: memoize(function() {
8700      for (var _a2, args = [], _i = 0; _i < arguments.length; _i++)
8701        args[_i] = arguments[_i];
8702      return new ((_a2 = Intl.DateTimeFormat).bind.apply(_a2, __spreadArray([void 0], args, !1)))();
8703    }, {
8704      cache: createFastMemoizeCache(cache.dateTime),
8705      strategy: strategies.variadic
8706    }),
8707    getPluralRules: memoize(function() {
8708      for (var _a2, args = [], _i = 0; _i < arguments.length; _i++)
8709        args[_i] = arguments[_i];
8710      return new ((_a2 = Intl.PluralRules).bind.apply(_a2, __spreadArray([void 0], args, !1)))();
8711    }, {
8712      cache: createFastMemoizeCache(cache.pluralRules),
8713      strategy: strategies.variadic
8714    })
8715  };
8716}
8717var IntlMessageFormat = (
8718  /** @class */
8719  (function() {
8720    function IntlMessageFormat2(message, locales, overrideFormats, opts) {
8721      locales === void 0 && (locales = IntlMessageFormat2.defaultLocale);
8722      var _this = this;
8723      if (this.formatterCache = {
8724        number: {},
8725        dateTime: {},
8726        pluralRules: {}
8727      }, this.format = function(values) {
8728        var parts = _this.formatToParts(values);
8729        if (parts.length === 1)
8730          return parts[0].value;
8731        var result = parts.reduce(function(all, part) {
8732          return !all.length || part.type !== PART_TYPE.literal || typeof all[all.length - 1] != "string" ? all.push(part.value) : all[all.length - 1] += part.value, all;
8733        }, []);
8734        return result.length <= 1 ? result[0] || "" : result;
8735      }, this.formatToParts = function(values) {
8736        return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, void 0, _this.message);
8737      }, this.resolvedOptions = function() {
8738        var _a3;
8739        return {
8740          locale: ((_a3 = _this.resolvedLocale) === null || _a3 === void 0 ? void 0 : _a3.toString()) || Intl.NumberFormat.supportedLocalesOf(_this.locales)[0]
8741        };
8742      }, this.getAst = function() {
8743        return _this.ast;
8744      }, this.locales = locales, this.resolvedLocale = IntlMessageFormat2.resolveLocale(locales), typeof message == "string") {
8745        if (this.message = message, !IntlMessageFormat2.__parse)
8746          throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
8747        var _a2 = opts || {}, formatters = _a2.formatters, parseOpts = __rest(_a2, ["formatters"]);
8748        this.ast = IntlMessageFormat2.__parse(message, __assign(__assign({}, parseOpts), { locale: this.resolvedLocale }));
8749      } else
8750        this.ast = message;
8751      if (!Array.isArray(this.ast))
8752        throw new TypeError("A message must be provided as a String or AST.");
8753      this.formats = mergeConfigs(IntlMessageFormat2.formats, overrideFormats), this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
8754    }
8755    return Object.defineProperty(IntlMessageFormat2, "defaultLocale", {
8756      get: function() {
8757        return IntlMessageFormat2.memoizedDefaultLocale || (IntlMessageFormat2.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), IntlMessageFormat2.memoizedDefaultLocale;
8758      },
8759      enumerable: !1,
8760      configurable: !0
8761    }), IntlMessageFormat2.memoizedDefaultLocale = null, IntlMessageFormat2.resolveLocale = function(locales) {
8762      if (!(typeof Intl.Locale > "u")) {
8763        var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
8764        return supportedLocales.length > 0 ? new Intl.Locale(supportedLocales[0]) : new Intl.Locale(typeof locales == "string" ? locales : locales[0]);
8765      }
8766    }, IntlMessageFormat2.__parse = parse, IntlMessageFormat2.formats = {
8767      number: {
8768        integer: {
8769          maximumFractionDigits: 0
8770        },
8771        currency: {
8772          style: "currency"
8773        },
8774        percent: {
8775          style: "percent"
8776        }
8777      },
8778      date: {
8779        short: {
8780          month: "numeric",
8781          day: "numeric",
8782          year: "2-digit"
8783        },
8784        medium: {
8785          month: "short",
8786          day: "numeric",
8787          year: "numeric"
8788        },
8789        long: {
8790          month: "long",
8791          day: "numeric",
8792          year: "numeric"
8793        },
8794        full: {
8795          weekday: "long",
8796          month: "long",
8797          day: "numeric",
8798          year: "numeric"
8799        }
8800      },
8801      time: {
8802        short: {
8803          hour: "numeric",
8804          minute: "numeric"
8805        },
8806        medium: {
8807          hour: "numeric",
8808          minute: "numeric",
8809          second: "numeric"
8810        },
8811        long: {
8812          hour: "numeric",
8813          minute: "numeric",
8814          second: "numeric",
8815          timeZoneName: "short"
8816        },
8817        full: {
8818          hour: "numeric",
8819          minute: "numeric",
8820          second: "numeric",
8821          timeZoneName: "short"
8822        }
8823      }
8824    }, IntlMessageFormat2;
8825  })()
8826);
8827
vendor: 83 bytes, lines 8828-8830
8828// ../../node_modules/@react-aria/i18n/dist/useMessageFormatter.mjs
8829init_react();
8830
vendor: 240 bytes, lines 8831-8833
8831// ../../node_modules/@internationalized/string/dist/LocalizedStringDictionary.mjs
8832var $5b160d28a433310d$var$localeSymbol = Symbol.for("react-aria.i18n.locale"), $5b160d28a433310d$var$stringsSymbol = Symbol.for("react-aria.i18n.strings");
8833
vendor: 91 bytes, lines 8834-8836
8834// ../../node_modules/@react-aria/i18n/dist/useLocalizedStringFormatter.mjs
8835init_react();
8836
vendor: 80 bytes, lines 8837-8839
8837// ../../node_modules/@react-aria/i18n/dist/useListFormatter.mjs
8838init_react();
8839
vendor: 309 bytes, lines 8840-8852
8840// ../../node_modules/@internationalized/date/dist/string.mjs
8841var $fae977aafc393c5c$var$requiredDurationTimeGroups = [
8842  "hours",
8843  "minutes",
8844  "seconds"
8845], $fae977aafc393c5c$var$requiredDurationGroups = [
8846  "years",
8847  "months",
8848  "weeks",
8849  "days",
8850  ...$fae977aafc393c5c$var$requiredDurationTimeGroups
8851];
8852
vendor: 449 bytes, lines 8853-8855
8853// ../../node_modules/@internationalized/date/dist/HebrewCalendar.mjs
8854var $7c5f6fbf42389787$var$HOUR_PARTS = 1080, $7c5f6fbf42389787$var$DAY_PARTS = 24 * $7c5f6fbf42389787$var$HOUR_PARTS, $7c5f6fbf42389787$var$MONTH_DAYS = 29, $7c5f6fbf42389787$var$MONTH_FRACT = 12 * $7c5f6fbf42389787$var$HOUR_PARTS + 793, $7c5f6fbf42389787$var$MONTH_PARTS = $7c5f6fbf42389787$var$MONTH_DAYS * $7c5f6fbf42389787$var$DAY_PARTS + $7c5f6fbf42389787$var$MONTH_FRACT;
8855
vendor: 80 bytes, lines 8856-8858
8856// ../../node_modules/@react-aria/i18n/dist/useDateFormatter.mjs
8857init_react();
8858
vendor: 520 bytes, lines 8859-8875
8859// ../../node_modules/@internationalized/number/dist/NumberFormatter.mjs
8860var $488c6ddbf4ef74c2$var$supportsSignDisplay = !1;
8861try {
8862  $488c6ddbf4ef74c2$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", {
8863    signDisplay: "exceptZero"
8864  }).resolvedOptions().signDisplay === "exceptZero";
8865} catch {
8866}
8867var $488c6ddbf4ef74c2$var$supportsUnit = !1;
8868try {
8869  $488c6ddbf4ef74c2$var$supportsUnit = new Intl.NumberFormat("de-DE", {
8870    style: "unit",
8871    unit: "degree"
8872  }).resolvedOptions().style === "unit";
8873} catch {
8874}
8875
vendor: 149 bytes, lines 8876-8878
8876// ../../node_modules/@internationalized/number/dist/NumberParser.mjs
8877var $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX = new RegExp("^.*\\(.*\\).*$");
8878
vendor: 82 bytes, lines 8879-8881
8879// ../../node_modules/@react-aria/i18n/dist/useNumberFormatter.mjs
8880init_react();
8881
vendor: 73 bytes, lines 8882-8884
8882// ../../node_modules/@react-aria/i18n/dist/useFilter.mjs
8883init_react();
8884
vendor: 6,787 bytes, lines 8885-9024
8885// ../../node_modules/@react-aria/overlays/dist/useOverlayPosition.mjs
8886var $2a41e45df1593e64$var$visualViewport = typeof document < "u" ? window.visualViewport : null;
8887function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
8888  let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), { arrowSize, targetRef, overlayRef, arrowRef, scrollRef = overlayRef, placement = "bottom", containerPadding = 12, shouldFlip = !0, boundaryElement = typeof document < "u" ? document.body : null, offset: offset2 = 0, crossOffset = 0, shouldUpdatePosition = !0, isOpen = !0, onClose, maxHeight, arrowBoundaryOffset = 0 } = props, [position, setPosition] = useState(null), deps = [
8889    shouldUpdatePosition,
8890    placement,
8891    overlayRef.current,
8892    targetRef.current,
8893    arrowRef?.current,
8894    scrollRef.current,
8895    containerPadding,
8896    shouldFlip,
8897    boundaryElement,
8898    offset2,
8899    crossOffset,
8900    isOpen,
8901    direction,
8902    maxHeight,
8903    arrowBoundaryOffset,
8904    arrowSize
8905  ], lastScale = useRef($2a41e45df1593e64$var$visualViewport?.scale);
8906  useEffect(() => {
8907    isOpen && (lastScale.current = $2a41e45df1593e64$var$visualViewport?.scale);
8908  }, [
8909    isOpen
8910  ]);
8911  let updatePosition = useCallback(() => {
8912    if (shouldUpdatePosition === !1 || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement || $2a41e45df1593e64$var$visualViewport?.scale !== lastScale.current) return;
8913    let anchor = null;
8914    if (scrollRef.current && scrollRef.current.contains(document.activeElement)) {
8915      var _document_activeElement;
8916      let anchorRect = (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.getBoundingClientRect(), scrollRect = scrollRef.current.getBoundingClientRect();
8917      var _anchorRect_top;
8918      if (anchor = {
8919        type: "top",
8920        offset: ((_anchorRect_top = anchorRect?.top) !== null && _anchorRect_top !== void 0 ? _anchorRect_top : 0) - scrollRect.top
8921      }, anchor.offset > scrollRect.height / 2) {
8922        anchor.type = "bottom";
8923        var _anchorRect_bottom;
8924        anchor.offset = ((_anchorRect_bottom = anchorRect?.bottom) !== null && _anchorRect_bottom !== void 0 ? _anchorRect_bottom : 0) - scrollRect.bottom;
8925      }
8926    }
8927    let overlay = overlayRef.current;
8928    if (!maxHeight && overlayRef.current) {
8929      var _window_visualViewport;
8930      overlay.style.top = "0px", overlay.style.bottom = "";
8931      var _window_visualViewport_height;
8932      overlay.style.maxHeight = ((_window_visualViewport_height = (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.height) !== null && _window_visualViewport_height !== void 0 ? _window_visualViewport_height : window.innerHeight) + "px";
8933    }
8934    let position2 = $edcf132a9284368a$export$b3ceb0cbf1056d98({
8935      placement: $2a41e45df1593e64$var$translateRTL(placement, direction),
8936      overlayNode: overlayRef.current,
8937      targetNode: targetRef.current,
8938      scrollNode: scrollRef.current || overlayRef.current,
8939      padding: containerPadding,
8940      shouldFlip,
8941      boundaryElement,
8942      offset: offset2,
8943      crossOffset,
8944      maxHeight,
8945      arrowSize: arrowSize ?? (arrowRef?.current ? $edcf132a9284368a$export$4b834cebd9e5cebe(arrowRef.current, !0).width : 0),
8946      arrowBoundaryOffset
8947    });
8948    if (position2.position) {
8949      if (overlay.style.top = "", overlay.style.bottom = "", overlay.style.left = "", overlay.style.right = "", Object.keys(position2.position).forEach((key) => overlay.style[key] = position2.position[key] + "px"), overlay.style.maxHeight = position2.maxHeight != null ? position2.maxHeight + "px" : "", anchor && document.activeElement && scrollRef.current) {
8950        let anchorRect = document.activeElement.getBoundingClientRect(), scrollRect = scrollRef.current.getBoundingClientRect(), newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
8951        scrollRef.current.scrollTop += newOffset - anchor.offset;
8952      }
8953      setPosition(position2);
8954    }
8955  }, deps);
8956  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(updatePosition, deps), $2a41e45df1593e64$var$useResize(updatePosition), $9daab02d461809db$export$683480f191c0e3ea({
8957    ref: overlayRef,
8958    onResize: updatePosition
8959  }), $9daab02d461809db$export$683480f191c0e3ea({
8960    ref: targetRef,
8961    onResize: updatePosition
8962  });
8963  let isResizing = useRef(!1);
8964  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
8965    let timeout, onResize = () => {
8966      isResizing.current = !0, clearTimeout(timeout), timeout = setTimeout(() => {
8967        isResizing.current = !1;
8968      }, 500), updatePosition();
8969    }, onScroll = () => {
8970      isResizing.current && onResize();
8971    };
8972    return $2a41e45df1593e64$var$visualViewport?.addEventListener("resize", onResize), $2a41e45df1593e64$var$visualViewport?.addEventListener("scroll", onScroll), () => {
8973      $2a41e45df1593e64$var$visualViewport?.removeEventListener("resize", onResize), $2a41e45df1593e64$var$visualViewport?.removeEventListener("scroll", onScroll);
8974    };
8975  }, [
8976    updatePosition
8977  ]);
8978  let close = useCallback(() => {
8979    isResizing.current || onClose?.();
8980  }, [
8981    onClose,
8982    isResizing
8983  ]);
8984  $dd149f63282afbbf$export$18fc8428861184da({
8985    triggerRef: targetRef,
8986    isOpen,
8987    onClose: onClose && close
8988  });
8989  var _position_maxHeight, _position_placement, _position_triggerAnchorPoint;
8990  return {
8991    overlayProps: {
8992      style: {
8993        position: position ? "absolute" : "fixed",
8994        top: position ? void 0 : 0,
8995        left: position ? void 0 : 0,
8996        zIndex: 1e5,
8997        ...position?.position,
8998        maxHeight: (_position_maxHeight = position?.maxHeight) !== null && _position_maxHeight !== void 0 ? _position_maxHeight : "100vh"
8999      }
9000    },
9001    placement: (_position_placement = position?.placement) !== null && _position_placement !== void 0 ? _position_placement : null,
9002    triggerAnchorPoint: (_position_triggerAnchorPoint = position?.triggerAnchorPoint) !== null && _position_triggerAnchorPoint !== void 0 ? _position_triggerAnchorPoint : null,
9003    arrowProps: {
9004      "aria-hidden": "true",
9005      role: "presentation",
9006      style: {
9007        left: position?.arrowOffsetLeft,
9008        top: position?.arrowOffsetTop
9009      }
9010    },
9011    updatePosition
9012  };
9013}
9014function $2a41e45df1593e64$var$useResize(onResize) {
9015  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => (window.addEventListener("resize", onResize, !1), () => {
9016    window.removeEventListener("resize", onResize, !1);
9017  }), [
9018    onResize
9019  ]);
9020}
9021function $2a41e45df1593e64$var$translateRTL(position, direction) {
9022  return direction === "rtl" ? position.replace("start", "right").replace("end", "left") : position.replace("start", "left").replace("end", "right");
9023}
9024
vendor: 2,785 bytes, lines 9025-9085
9025// ../../node_modules/@react-aria/focus/dist/FocusScope.mjs
9026init_react();
9027var $9bf71ea28793e738$var$FocusContext = react_default.createContext(null);
9028function $9bf71ea28793e738$var$isElementInScope(element, scope2) {
9029  return !element || !scope2 ? !1 : scope2.some((node) => node.contains(element));
9030}
9031var $9bf71ea28793e738$var$Tree = class _$9bf71ea28793e738$var$Tree {
9032  get size() {
9033    return this.fastMap.size;
9034  }
9035  getTreeNode(data) {
9036    return this.fastMap.get(data);
9037  }
9038  addTreeNode(scopeRef, parent, nodeToRestore) {
9039    let parentNode = this.fastMap.get(parent ?? null);
9040    if (!parentNode) return;
9041    let node = new $9bf71ea28793e738$var$TreeNode({
9042      scopeRef
9043    });
9044    parentNode.addChild(node), node.parent = parentNode, this.fastMap.set(scopeRef, node), nodeToRestore && (node.nodeToRestore = nodeToRestore);
9045  }
9046  addNode(node) {
9047    this.fastMap.set(node.scopeRef, node);
9048  }
9049  removeTreeNode(scopeRef) {
9050    if (scopeRef === null) return;
9051    let node = this.fastMap.get(scopeRef);
9052    if (!node) return;
9053    let parentNode = node.parent;
9054    for (let current of this.traverse()) current !== node && node.nodeToRestore && current.nodeToRestore && node.scopeRef && node.scopeRef.current && $9bf71ea28793e738$var$isElementInScope(current.nodeToRestore, node.scopeRef.current) && (current.nodeToRestore = node.nodeToRestore);
9055    let children = node.children;
9056    parentNode && (parentNode.removeChild(node), children.size > 0 && children.forEach((child) => parentNode && parentNode.addChild(child))), this.fastMap.delete(node.scopeRef);
9057  }
9058  // Pre Order Depth First
9059  *traverse(node = this.root) {
9060    if (node.scopeRef != null && (yield node), node.children.size > 0) for (let child of node.children) yield* this.traverse(child);
9061  }
9062  clone() {
9063    var _node_parent;
9064    let newTree = new _$9bf71ea28793e738$var$Tree();
9065    var _node_parent_scopeRef;
9066    for (let node of this.traverse()) newTree.addTreeNode(node.scopeRef, (_node_parent_scopeRef = (_node_parent = node.parent) === null || _node_parent === void 0 ? void 0 : _node_parent.scopeRef) !== null && _node_parent_scopeRef !== void 0 ? _node_parent_scopeRef : null, node.nodeToRestore);
9067    return newTree;
9068  }
9069  constructor() {
9070    this.fastMap = /* @__PURE__ */ new Map(), this.root = new $9bf71ea28793e738$var$TreeNode({
9071      scopeRef: null
9072    }), this.fastMap.set(null, this.root);
9073  }
9074}, $9bf71ea28793e738$var$TreeNode = class {
9075  addChild(node) {
9076    this.children.add(node), node.parent = this;
9077  }
9078  removeChild(node) {
9079    this.children.delete(node), node.parent = void 0;
9080  }
9081  constructor(props) {
9082    this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = props.scopeRef;
9083  }
9084}, $9bf71ea28793e738$export$d06fae2ee68b101e = new $9bf71ea28793e738$var$Tree();
9085
vendor: 77 bytes, lines 9086-9088
9086// ../../node_modules/@react-aria/focus/dist/useFocusRing.mjs
9087init_react();
9088
vendor: 74 bytes, lines 9089-9091
9089// ../../node_modules/@react-aria/focus/dist/FocusRing.mjs
9090init_react();
9091
vendor: 84 bytes, lines 9092-9094
9092// ../../node_modules/@react-aria/focus/dist/useHasTabbableChild.mjs
9093init_react();
9094
vendor: 78 bytes, lines 9095-9097
9095// ../../node_modules/@react-aria/overlays/dist/useOverlay.mjs
9096init_react();
9097
vendor: 85 bytes, lines 9098-9100
9098// ../../node_modules/@react-aria/overlays/dist/useOverlayTrigger.mjs
9099init_react();
9100
vendor: 161 bytes, lines 9101-9103
9101// ../../node_modules/@react-aria/overlays/dist/usePreventScroll.mjs
9102var $49c51c25361d4cd2$var$visualViewport = typeof document < "u" && window.visualViewport;
9103
vendor: 359 bytes, lines 9104-9111
9104// ../../node_modules/@react-aria/overlays/dist/PortalProvider.mjs
9105init_react();
9106var $96b38030c423d352$export$60d741e20e0aa309 = createContext({});
9107function $96b38030c423d352$export$9fc1347d4195ccb3() {
9108  var _useContext;
9109  return (_useContext = useContext($96b38030c423d352$export$60d741e20e0aa309)) !== null && _useContext !== void 0 ? _useContext : {};
9110}
9111
vendor: 2,241 bytes, lines 9112-9162
9112// ../../node_modules/@react-aria/overlays/dist/useModal.mjs
9113init_react();
9114var $f57aed4a881a3485$var$Context = react_default.createContext(null);
9115function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
9116  let { children } = props, parent = useContext($f57aed4a881a3485$var$Context), [modalCount, setModalCount] = useState(0), context = useMemo(() => ({
9117    parent,
9118    modalCount,
9119    addModal() {
9120      setModalCount((count) => count + 1), parent && parent.addModal();
9121    },
9122    removeModal() {
9123      setModalCount((count) => count - 1), parent && parent.removeModal();
9124    }
9125  }), [
9126    parent,
9127    modalCount
9128  ]);
9129  return react_default.createElement($f57aed4a881a3485$var$Context.Provider, {
9130    value: context
9131  }, children);
9132}
9133function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
9134  let context = useContext($f57aed4a881a3485$var$Context);
9135  return {
9136    modalProviderProps: {
9137      "aria-hidden": context && context.modalCount > 0 ? !0 : void 0
9138    }
9139  };
9140}
9141function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
9142  let { modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
9143  return react_default.createElement("div", {
9144    "data-overlay-container": !0,
9145    ...props,
9146    ...modalProviderProps
9147  });
9148}
9149function $f57aed4a881a3485$export$bf688221f59024e5(props) {
9150  return react_default.createElement($f57aed4a881a3485$export$178405afcd8c5eb, null, react_default.createElement($f57aed4a881a3485$var$OverlayContainerDOM, props));
9151}
9152function $f57aed4a881a3485$export$b47c3594eab58386(props) {
9153  let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273(), { portalContainer = isSSR ? null : document.body, ...rest2 } = props, { getContainer } = $96b38030c423d352$export$9fc1347d4195ccb3();
9154  if (!props.portalContainer && getContainer && (portalContainer = getContainer()), react_default.useEffect(() => {
9155    if (portalContainer?.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
9156  }, [
9157    portalContainer
9158  ]), !portalContainer) return null;
9159  let contents = react_default.createElement($f57aed4a881a3485$export$bf688221f59024e5, rest2);
9160  return react_dom_default.createPortal(contents, portalContainer);
9161}
9162
vendor: 172 bytes, lines 9163-9168
9163// ../../node_modules/@react-aria/overlays/dist/ar-AE.mjs
9164var $773d5888b972f1cf$exports = {};
9165$773d5888b972f1cf$exports = {
9166  dismiss: "\u062A\u062C\u0627\u0647\u0644"
9167};
9168
vendor: 202 bytes, lines 9169-9174
9169// ../../node_modules/@react-aria/overlays/dist/bg-BG.mjs
9170var $d11f19852b941573$exports = {};
9171$d11f19852b941573$exports = {
9172  dismiss: "\u041E\u0442\u0445\u0432\u044A\u0440\u043B\u044F\u043D\u0435"
9173};
9174
vendor: 151 bytes, lines 9175-9180
9175// ../../node_modules/@react-aria/overlays/dist/cs-CZ.mjs
9176var $b983974c2ee1efb3$exports = {};
9177$b983974c2ee1efb3$exports = {
9178  dismiss: "Odstranit"
9179};
9180
vendor: 145 bytes, lines 9181-9186
9181// ../../node_modules/@react-aria/overlays/dist/da-DK.mjs
9182var $5809cc9d4e92de73$exports = {};
9183$5809cc9d4e92de73$exports = {
9184  dismiss: "Luk"
9185};
9186
vendor: 154 bytes, lines 9187-9192
9187// ../../node_modules/@react-aria/overlays/dist/de-DE.mjs
9188var $c68c2e4fc74398d1$exports = {};
9189$c68c2e4fc74398d1$exports = {
9190  dismiss: "Schlie\xDFen"
9191};
9192
vendor: 190 bytes, lines 9193-9198
9193// ../../node_modules/@react-aria/overlays/dist/el-GR.mjs
9194var $0898b4c153db2b77$exports = {};
9195$0898b4c153db2b77$exports = {
9196  dismiss: "\u0391\u03C0\u03CC\u03C1\u03C1\u03B9\u03C8\u03B7"
9197};
9198
vendor: 149 bytes, lines 9199-9204
9199// ../../node_modules/@react-aria/overlays/dist/en-US.mjs
9200var $6d74810286a15183$exports = {};
9201$6d74810286a15183$exports = {
9202  dismiss: "Dismiss"
9203};
9204
vendor: 151 bytes, lines 9205-9210
9205// ../../node_modules/@react-aria/overlays/dist/es-ES.mjs
9206var $309d73dc65f78055$exports = {};
9207$309d73dc65f78055$exports = {
9208  dismiss: "Descartar"
9209};
9210
vendor: 151 bytes, lines 9211-9216
9211// ../../node_modules/@react-aria/overlays/dist/et-EE.mjs
9212var $44ad94f7205cf593$exports = {};
9213$44ad94f7205cf593$exports = {
9214  dismiss: "L\xF5peta"
9215};
9216
vendor: 154 bytes, lines 9217-9222
9217// ../../node_modules/@react-aria/overlays/dist/fi-FI.mjs
9218var $7c28f5687f0779a9$exports = {};
9219$7c28f5687f0779a9$exports = {
9220  dismiss: "Hylk\xE4\xE4"
9221};
9222
vendor: 149 bytes, lines 9223-9228
9223// ../../node_modules/@react-aria/overlays/dist/fr-FR.mjs
9224var $e6d75df4b68bd73a$exports = {};
9225$e6d75df4b68bd73a$exports = {
9226  dismiss: "Rejeter"
9227};
9228
vendor: 172 bytes, lines 9229-9234
9229// ../../node_modules/@react-aria/overlays/dist/he-IL.mjs
9230var $87505c9dab186d0f$exports = {};
9231$87505c9dab186d0f$exports = {
9232  dismiss: "\u05D4\u05EA\u05E2\u05DC\u05DD"
9233};
9234
vendor: 148 bytes, lines 9235-9240
9235// ../../node_modules/@react-aria/overlays/dist/hr-HR.mjs
9236var $553439c3ffb3e492$exports = {};
9237$553439c3ffb3e492$exports = {
9238  dismiss: "Odbaci"
9239};
9240
vendor: 158 bytes, lines 9241-9246
9241// ../../node_modules/@react-aria/overlays/dist/hu-HU.mjs
9242var $74cf411061b983a2$exports = {};
9243$74cf411061b983a2$exports = {
9244  dismiss: "Elutas\xEDt\xE1s"
9245};
9246
vendor: 148 bytes, lines 9247-9252
9247// ../../node_modules/@react-aria/overlays/dist/it-IT.mjs
9248var $e933f298574dc435$exports = {};
9249$e933f298574dc435$exports = {
9250  dismiss: "Ignora"
9251};
9252
vendor: 160 bytes, lines 9253-9258
9253// ../../node_modules/@react-aria/overlays/dist/ja-JP.mjs
9254var $ac91fc9fe02f71f6$exports = {};
9255$ac91fc9fe02f71f6$exports = {
9256  dismiss: "\u9589\u3058\u308B"
9257};
9258
vendor: 154 bytes, lines 9259-9264
9259// ../../node_modules/@react-aria/overlays/dist/ko-KR.mjs
9260var $52b96f86422025af$exports = {};
9261$52b96f86422025af$exports = {
9262  dismiss: "\uBB34\uC2DC"
9263};
9264
vendor: 149 bytes, lines 9265-9270
9265// ../../node_modules/@react-aria/overlays/dist/lt-LT.mjs
9266var $c0d724c3e51dafa6$exports = {};
9267$c0d724c3e51dafa6$exports = {
9268  dismiss: "Atmesti"
9269};
9270
vendor: 159 bytes, lines 9271-9276
9271// ../../node_modules/@react-aria/overlays/dist/lv-LV.mjs
9272var $c92899672a3fe72e$exports = {};
9273$c92899672a3fe72e$exports = {
9274  dismiss: "Ner\u0101d\u012Bt"
9275};
9276
vendor: 146 bytes, lines 9277-9282
9277// ../../node_modules/@react-aria/overlays/dist/nb-NO.mjs
9278var $9f576b39d8e7a9d6$exports = {};
9279$9f576b39d8e7a9d6$exports = {
9280  dismiss: "Lukk"
9281};
9282
vendor: 149 bytes, lines 9283-9288
9283// ../../node_modules/@react-aria/overlays/dist/nl-NL.mjs
9284var $9d025808aeec81a7$exports = {};
9285$9d025808aeec81a7$exports = {
9286  dismiss: "Negeren"
9287};
9288
vendor: 150 bytes, lines 9289-9294
9289// ../../node_modules/@react-aria/overlays/dist/pl-PL.mjs
9290var $fce709921e2c0fa6$exports = {};
9291$fce709921e2c0fa6$exports = {
9292  dismiss: "Zignoruj"
9293};
9294
vendor: 151 bytes, lines 9295-9300
9295// ../../node_modules/@react-aria/overlays/dist/pt-BR.mjs
9296var $2599cf0c4ab37f59$exports = {};
9297$2599cf0c4ab37f59$exports = {
9298  dismiss: "Descartar"
9299};
9300
vendor: 151 bytes, lines 9301-9306
9301// ../../node_modules/@react-aria/overlays/dist/pt-PT.mjs
9302var $3c220ae7ef8a35fd$exports = {};
9303$3c220ae7ef8a35fd$exports = {
9304  dismiss: "Dispensar"
9305};
9306
vendor: 150 bytes, lines 9307-9312
9307// ../../node_modules/@react-aria/overlays/dist/ro-RO.mjs
9308var $93562b5094072f54$exports = {};
9309$93562b5094072f54$exports = {
9310  dismiss: "Revocare"
9311};
9312
vendor: 202 bytes, lines 9313-9318
9313// ../../node_modules/@react-aria/overlays/dist/ru-RU.mjs
9314var $cd9e2abd0d06c7b4$exports = {};
9315$cd9e2abd0d06c7b4$exports = {
9316  dismiss: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C"
9317};
9318
vendor: 158 bytes, lines 9319-9324
9319// ../../node_modules/@react-aria/overlays/dist/sk-SK.mjs
9320var $45375701f409adf1$exports = {};
9321$45375701f409adf1$exports = {
9322  dismiss: "Zru\u0161i\u0165"
9323};
9324
vendor: 148 bytes, lines 9325-9330
9325// ../../node_modules/@react-aria/overlays/dist/sl-SI.mjs
9326var $27fab53a576de9dd$exports = {};
9327$27fab53a576de9dd$exports = {
9328  dismiss: "Opusti"
9329};
9330
vendor: 148 bytes, lines 9331-9336
9331// ../../node_modules/@react-aria/overlays/dist/sr-SP.mjs
9332var $4438748d9952e7c7$exports = {};
9333$4438748d9952e7c7$exports = {
9334  dismiss: "Odbaci"
9335};
9336
vendor: 148 bytes, lines 9337-9342
9337// ../../node_modules/@react-aria/overlays/dist/sv-SE.mjs
9338var $0936d7347ef4da4c$exports = {};
9339$0936d7347ef4da4c$exports = {
9340  dismiss: "Avvisa"
9341};
9342
vendor: 147 bytes, lines 9343-9348
9343// ../../node_modules/@react-aria/overlays/dist/tr-TR.mjs
9344var $29700c92185d38f8$exports = {};
9345$29700c92185d38f8$exports = {
9346  dismiss: "Kapat"
9347};
9348
vendor: 196 bytes, lines 9349-9354
9349// ../../node_modules/@react-aria/overlays/dist/uk-UA.mjs
9350var $662ccaf2be4c25b3$exports = {};
9351$662ccaf2be4c25b3$exports = {
9352  dismiss: "\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438"
9353};
9354
vendor: 154 bytes, lines 9355-9360
9355// ../../node_modules/@react-aria/overlays/dist/zh-CN.mjs
9356var $d80a27deda7cdb3c$exports = {};
9357$d80a27deda7cdb3c$exports = {
9358  dismiss: "\u53D6\u6D88"
9359};
9360
vendor: 154 bytes, lines 9361-9366
9361// ../../node_modules/@react-aria/overlays/dist/zh-TW.mjs
9362var $2b2734393847c884$exports = {};
9363$2b2734393847c884$exports = {
9364  dismiss: "\u95DC\u9589"
9365};
9366
vendor: 1,425 bytes, lines 9367-9405
9367// ../../node_modules/@react-aria/overlays/dist/intlStrings.mjs
9368var $a2f21f5f14f60553$exports = {};
9369$a2f21f5f14f60553$exports = {
9370  "ar-AE": $773d5888b972f1cf$exports,
9371  "bg-BG": $d11f19852b941573$exports,
9372  "cs-CZ": $b983974c2ee1efb3$exports,
9373  "da-DK": $5809cc9d4e92de73$exports,
9374  "de-DE": $c68c2e4fc74398d1$exports,
9375  "el-GR": $0898b4c153db2b77$exports,
9376  "en-US": $6d74810286a15183$exports,
9377  "es-ES": $309d73dc65f78055$exports,
9378  "et-EE": $44ad94f7205cf593$exports,
9379  "fi-FI": $7c28f5687f0779a9$exports,
9380  "fr-FR": $e6d75df4b68bd73a$exports,
9381  "he-IL": $87505c9dab186d0f$exports,
9382  "hr-HR": $553439c3ffb3e492$exports,
9383  "hu-HU": $74cf411061b983a2$exports,
9384  "it-IT": $e933f298574dc435$exports,
9385  "ja-JP": $ac91fc9fe02f71f6$exports,
9386  "ko-KR": $52b96f86422025af$exports,
9387  "lt-LT": $c0d724c3e51dafa6$exports,
9388  "lv-LV": $c92899672a3fe72e$exports,
9389  "nb-NO": $9f576b39d8e7a9d6$exports,
9390  "nl-NL": $9d025808aeec81a7$exports,
9391  "pl-PL": $fce709921e2c0fa6$exports,
9392  "pt-BR": $2599cf0c4ab37f59$exports,
9393  "pt-PT": $3c220ae7ef8a35fd$exports,
9394  "ro-RO": $93562b5094072f54$exports,
9395  "ru-RU": $cd9e2abd0d06c7b4$exports,
9396  "sk-SK": $45375701f409adf1$exports,
9397  "sl-SI": $27fab53a576de9dd$exports,
9398  "sr-SP": $4438748d9952e7c7$exports,
9399  "sv-SE": $0936d7347ef4da4c$exports,
9400  "tr-TR": $29700c92185d38f8$exports,
9401  "uk-UA": $662ccaf2be4c25b3$exports,
9402  "zh-CN": $d80a27deda7cdb3c$exports,
9403  "zh-TW": $2b2734393847c884$exports
9404};
9405
vendor: 81 bytes, lines 9406-9408
9406// ../../node_modules/@react-aria/overlays/dist/DismissButton.mjs
9407init_react();
9408
vendor: 89 bytes, lines 9409-9411
9409// ../../node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.mjs
9410init_react();
9411
vendor: 173 bytes, lines 9412-9414
9412// ../../node_modules/@react-aria/overlays/dist/ariaHideOutside.mjs
9413var $5e3802645cc19319$var$supportsInert = typeof HTMLElement < "u" && "inert" in HTMLElement.prototype;
9414
vendor: 78 bytes, lines 9415-9417
9415// ../../node_modules/@react-aria/overlays/dist/usePopover.mjs
9416init_react();
9417
vendor: 158 bytes, lines 9418-9421
9418// ../../node_modules/@react-aria/overlays/dist/Overlay.mjs
9419init_react();
9420var $337b884510726a0d$export$a2200b96afd16271 = react_default.createContext(null);
9421
vendor: 83 bytes, lines 9422-9424
9422// ../../node_modules/@react-aria/overlays/dist/useModalOverlay.mjs
9423init_react();
9424
vendor: 92 bytes, lines 9425-9427
9425// ../../node_modules/@react-stately/tooltip/dist/useTooltipTriggerState.mjs
9426init_react();
9427
vendor: 583 bytes, lines 9428-9453
9428// ../../node_modules/@react-stately/overlays/dist/useOverlayTriggerState.mjs
9429init_react();
9430function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
9431  let [isOpen, setOpen] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(props.isOpen, props.defaultOpen || !1, props.onOpenChange), open = useCallback(() => {
9432    setOpen(!0);
9433  }, [
9434    setOpen
9435  ]), close = useCallback(() => {
9436    setOpen(!1);
9437  }, [
9438    setOpen
9439  ]), toggle = useCallback(() => {
9440    setOpen(!isOpen);
9441  }, [
9442    setOpen,
9443    isOpen
9444  ]);
9445  return {
9446    isOpen,
9447    setOpen,
9448    open,
9449    close,
9450    toggle
9451  };
9452}
9453
vendor: 3,374 bytes, lines 9454-9490
9454// ../../node_modules/@react-stately/tooltip/dist/useTooltipTriggerState.mjs
9455var $8796f90736e175cb$var$TOOLTIP_DELAY = 1500, $8796f90736e175cb$var$TOOLTIP_COOLDOWN = 500, $8796f90736e175cb$var$tooltips = {}, $8796f90736e175cb$var$tooltipId = 0, $8796f90736e175cb$var$globalWarmedUp = !1, $8796f90736e175cb$var$globalWarmUpTimeout = null, $8796f90736e175cb$var$globalCooldownTimeout = null;
9456function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
9457  let { delay: delay2 = $8796f90736e175cb$var$TOOLTIP_DELAY, closeDelay = $8796f90736e175cb$var$TOOLTIP_COOLDOWN } = props, { isOpen, open, close } = $fc909762b330b746$export$61c6a8c84e605fb6(props), id = useMemo(() => `${++$8796f90736e175cb$var$tooltipId}`, []), closeTimeout = useRef(null), closeCallback = useRef(close), ensureTooltipEntry = () => {
9458    $8796f90736e175cb$var$tooltips[id] = hideTooltip;
9459  }, closeOpenTooltips = () => {
9460    for (let hideTooltipId in $8796f90736e175cb$var$tooltips) hideTooltipId !== id && ($8796f90736e175cb$var$tooltips[hideTooltipId](!0), delete $8796f90736e175cb$var$tooltips[hideTooltipId]);
9461  }, showTooltip = () => {
9462    closeTimeout.current && clearTimeout(closeTimeout.current), closeTimeout.current = null, closeOpenTooltips(), ensureTooltipEntry(), $8796f90736e175cb$var$globalWarmedUp = !0, open(), $8796f90736e175cb$var$globalWarmUpTimeout && (clearTimeout($8796f90736e175cb$var$globalWarmUpTimeout), $8796f90736e175cb$var$globalWarmUpTimeout = null), $8796f90736e175cb$var$globalCooldownTimeout && (clearTimeout($8796f90736e175cb$var$globalCooldownTimeout), $8796f90736e175cb$var$globalCooldownTimeout = null);
9463  }, hideTooltip = (immediate) => {
9464    immediate || closeDelay <= 0 ? (closeTimeout.current && clearTimeout(closeTimeout.current), closeTimeout.current = null, closeCallback.current()) : closeTimeout.current || (closeTimeout.current = setTimeout(() => {
9465      closeTimeout.current = null, closeCallback.current();
9466    }, closeDelay)), $8796f90736e175cb$var$globalWarmUpTimeout && (clearTimeout($8796f90736e175cb$var$globalWarmUpTimeout), $8796f90736e175cb$var$globalWarmUpTimeout = null), $8796f90736e175cb$var$globalWarmedUp && ($8796f90736e175cb$var$globalCooldownTimeout && clearTimeout($8796f90736e175cb$var$globalCooldownTimeout), $8796f90736e175cb$var$globalCooldownTimeout = setTimeout(() => {
9467      delete $8796f90736e175cb$var$tooltips[id], $8796f90736e175cb$var$globalCooldownTimeout = null, $8796f90736e175cb$var$globalWarmedUp = !1;
9468    }, Math.max($8796f90736e175cb$var$TOOLTIP_COOLDOWN, closeDelay)));
9469  }, warmupTooltip = () => {
9470    closeOpenTooltips(), ensureTooltipEntry(), !isOpen && !$8796f90736e175cb$var$globalWarmUpTimeout && !$8796f90736e175cb$var$globalWarmedUp ? $8796f90736e175cb$var$globalWarmUpTimeout = setTimeout(() => {
9471      $8796f90736e175cb$var$globalWarmUpTimeout = null, $8796f90736e175cb$var$globalWarmedUp = !0, showTooltip();
9472    }, delay2) : isOpen || showTooltip();
9473  };
9474  return useEffect(() => {
9475    closeCallback.current = close;
9476  }, [
9477    close
9478  ]), useEffect(() => () => {
9479    closeTimeout.current && clearTimeout(closeTimeout.current), $8796f90736e175cb$var$tooltips[id] && delete $8796f90736e175cb$var$tooltips[id];
9480  }, [
9481    id
9482  ]), {
9483    isOpen,
9484    open: (immediate) => {
9485      !immediate && delay2 > 0 && !closeTimeout.current ? warmupTooltip() : showTooltip();
9486    },
9487    close: hideTooltip
9488  };
9489}
9490
vendor: 3,661 bytes, lines 9491-9572
9491// ../../node_modules/react-aria-components/dist/Tooltip.mjs
9492init_react();
9493var $4e3b923658d69c60$export$7a7623236eec67fa = createContext(null), $4e3b923658d69c60$export$39ae08fa83328b12 = createContext(null);
9494function $4e3b923658d69c60$export$8c610744efcf8a1d(props) {
9495  let state = $8796f90736e175cb$export$4d40659c25ecb50b(props), ref = useRef(null), { triggerProps, tooltipProps } = $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref);
9496  return react_default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
9497    values: [
9498      [
9499        $4e3b923658d69c60$export$7a7623236eec67fa,
9500        state
9501      ],
9502      [
9503        $4e3b923658d69c60$export$39ae08fa83328b12,
9504        {
9505          ...tooltipProps,
9506          triggerRef: ref
9507        }
9508      ]
9509    ]
9510  }, react_default.createElement($f645667febf57a63$export$13f3202a3e5ddd5, {
9511    ...triggerProps,
9512    ref
9513  }, props.children));
9514}
9515var $4e3b923658d69c60$export$28c660c63b792dea = forwardRef(function({ UNSTABLE_portalContainer, ...props }, ref) {
9516  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $4e3b923658d69c60$export$39ae08fa83328b12);
9517  let contextState = useContext($4e3b923658d69c60$export$7a7623236eec67fa), localState = $8796f90736e175cb$export$4d40659c25ecb50b(props), state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState, isExiting = $d3f049242431219c$export$45fda7c47f93fd48(ref, state.isOpen) || props.isExiting || !1;
9518  return !state.isOpen && !isExiting ? null : react_default.createElement($f57aed4a881a3485$export$b47c3594eab58386, {
9519    portalContainer: UNSTABLE_portalContainer
9520  }, react_default.createElement($4e3b923658d69c60$var$TooltipInner, {
9521    ...props,
9522    tooltipRef: ref,
9523    isExiting
9524  }));
9525});
9526function $4e3b923658d69c60$var$TooltipInner(props) {
9527  let state = useContext($4e3b923658d69c60$export$7a7623236eec67fa), arrowRef = useRef(null), { overlayProps, arrowProps, placement, triggerAnchorPoint } = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
9528    placement: props.placement || "top",
9529    targetRef: props.triggerRef,
9530    overlayRef: props.tooltipRef,
9531    arrowRef,
9532    offset: props.offset,
9533    crossOffset: props.crossOffset,
9534    isOpen: state.isOpen,
9535    arrowBoundaryOffset: props.arrowBoundaryOffset,
9536    shouldFlip: props.shouldFlip,
9537    containerPadding: props.containerPadding,
9538    onClose: () => state.close(!0)
9539  }), isEntering = $d3f049242431219c$export$6d3443f2c48bfc20(props.tooltipRef, !!placement) || props.isEntering || !1, renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
9540    ...props,
9541    defaultClassName: "react-aria-Tooltip",
9542    values: {
9543      placement,
9544      isEntering,
9545      isExiting: props.isExiting,
9546      state
9547    }
9548  });
9549  props = $3ef42575df84b30b$export$9d1611c77c2fe928(props, overlayProps);
9550  let { tooltipProps } = $326e436e94273fe1$export$1c4b08e0eca38426(props, state), DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
9551    global: !0
9552  });
9553  return react_default.createElement("div", {
9554    ...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, tooltipProps),
9555    ref: props.tooltipRef,
9556    style: {
9557      ...overlayProps.style,
9558      "--trigger-anchor-point": triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : void 0,
9559      ...renderProps.style
9560    },
9561    "data-placement": placement ?? void 0,
9562    "data-entering": isEntering || void 0,
9563    "data-exiting": props.isExiting || void 0
9564  }, react_default.createElement($44f671af83e7d9e0$export$2de4954e8ae13b9f.Provider, {
9565    value: {
9566      ...arrowProps,
9567      placement,
9568      ref: arrowRef
9569    }
9570  }, renderProps.children));
9571}
9572
vendor: 9,114 bytes, lines 9573-9850
9573// src/components/components/shared/overlayHelpers.tsx
9574init_react();
9575var import_memoizerific = __toESM(require_memoizerific(), 1);
9576var convertToReactAriaPlacement2 = (0, import_memoizerific.default)(1e3)((p2) => p2 === "left-end" ? "left bottom" : p2 === "right-end" ? "right bottom" : p2 === "left-start" ? "left top" : p2 === "right-start" ? "right top" : p2.replace("-", " ")), Container5 = styled.div({
9577  width: 500,
9578  height: 500,
9579  paddingTop: 100,
9580  overflowY: "scroll",
9581  background: "#eee",
9582  position: "relative"
9583}), Trigger = forwardRef((props, ref) => react_default.createElement(
9584  "button",
9585  {
9586    ...props,
9587    ref,
9588    style: {
9589      width: 120,
9590      height: 50,
9591      margin: 10
9592    }
9593  }
9594));
9595Trigger.displayName = "Trigger";
9596
9597// src/components/components/tooltip/TooltipProvider.tsx
9598var TooltipProvider2 = ({
9599  triggerOnFocusOnly = !1,
9600  placement: placementProp = "top",
9601  offset: offset2 = 8,
9602  tooltip,
9603  children,
9604  defaultVisible,
9605  startOpen,
9606  delayShow = 400,
9607  delayHide = 200,
9608  visible,
9609  onVisibleChange,
9610  ...props
9611}) => {
9612  let placement = convertToReactAriaPlacement2(placementProp), child = react_default.Children.only(children);
9613  startOpen !== void 0 && deprecate("The `startOpen` prop is deprecated. Please use `defaultVisible` instead.");
9614  let [isOpen, setIsOpen] = useState(defaultVisible ?? startOpen ?? !1), onOpenChange = useCallback(
9615    (isOpen2) => {
9616      setIsOpen(isOpen2), onVisibleChange?.(isOpen2);
9617    },
9618    [onVisibleChange]
9619  );
9620  return react_default.createElement(
9621    $4e3b923658d69c60$export$8c610744efcf8a1d,
9622    {
9623      delay: delayShow,
9624      closeDelay: delayHide,
9625      isOpen: visible ?? isOpen,
9626      onOpenChange,
9627      trigger: triggerOnFocusOnly ? "focus" : void 0,
9628      ...props
9629    },
9630    react_default.createElement($f645667febf57a63$export$35a3bebf7ef2d934, null, react_default.cloneElement(child, { "aria-describedby": null })),
9631    react_default.createElement(
9632      $4e3b923658d69c60$export$28c660c63b792dea,
9633      {
9634        "data-testid": "tooltip",
9635        placement,
9636        offset: offset2,
9637        onOpenChange,
9638        style: { outline: "none" },
9639        ...props
9640      },
9641      tooltip
9642    )
9643  );
9644};
9645
9646// src/manager/components/layout/Drag.tsx
9647var oppositePosition = {
9648  left: "right",
9649  right: "left",
9650  top: "bottom",
9651  bottom: "top"
9652}, Drag = forwardRef(function(props, ref) {
9653  let {
9654    overlapping,
9655    position,
9656    "aria-label": ariaLabel,
9657    "aria-valuenow": ariaValueNow,
9658    "aria-valuemax": ariaValueMax,
9659    ...rest2
9660  } = props, orientation = position === "left" || position === "right" ? "vertical" : "horizontal", tooltipNote = orientation === "vertical" ? "\u2190 \u2192 to resize" : "\u2191 \u2193 to resize";
9661  return react_default.createElement(
9662    TooltipProvider2,
9663    {
9664      triggerOnFocusOnly: !0,
9665      placement: oppositePosition[position],
9666      tooltip: react_default.createElement(TooltipNote2, { note: tooltipNote })
9667    },
9668    react_default.createElement(
9669      DragHandle,
9670      {
9671        ref,
9672        $orientation: orientation,
9673        $overlapping: overlapping,
9674        $position: position,
9675        role: "separator",
9676        tabIndex: 0,
9677        "aria-orientation": orientation,
9678        "aria-label": ariaLabel,
9679        "aria-valuenow": ariaValueNow,
9680        "aria-valuemin": 0,
9681        "aria-valuemax": ariaValueMax,
9682        ...rest2
9683      }
9684    )
9685  );
9686}), DragHandle = styled.div(
9687  ({ theme }) => ({
9688    position: "absolute",
9689    opacity: 0,
9690    transition: "opacity 0.2s ease-in-out",
9691    zIndex: 100,
9692    "&:after": {
9693      content: '""',
9694      display: "block",
9695      backgroundColor: theme.color.secondary
9696    },
9697    "&:hover": {
9698      opacity: 1
9699    }
9700  }),
9701  ({ theme, $orientation = "vertical" }) => ({
9702    "&:focus-visible": {
9703      opacity: 1,
9704      outline: "2px solid transparent",
9705      ...$orientation === "horizontal" ? { height: 7 } : { width: 7 },
9706      boxShadow: `inset 0 0 0 4px ${theme.color.secondary}`,
9707      "@media (forced-colors: active)": {
9708        outline: "2px solid Highlight"
9709      }
9710    }
9711  }),
9712  ({ $orientation = "vertical", $overlapping = !0, $position = "left" }) => $orientation === "vertical" ? {
9713    // This is an old code smell, where 10px matches the sidebar and 13px matches the addon panel.
9714    // It should be tidied up at some point.
9715    width: $overlapping ? $position === "left" ? 10 : 13 : 7,
9716    height: "100%",
9717    top: 0,
9718    right: $position === "left" ? -7 : void 0,
9719    left: $position === "right" ? -7 : void 0,
9720    "&:after": {
9721      width: 1,
9722      height: "100%",
9723      marginLeft: $position === "left" ? 3 : 6
9724    },
9725    "&:hover": {
9726      cursor: "col-resize"
9727    }
9728  } : {
9729    width: "100%",
9730    height: $overlapping ? 13 : 7,
9731    top: $position === "bottom" ? -7 : void 0,
9732    bottom: $position === "top" ? -7 : void 0,
9733    left: 0,
9734    "&:after": {
9735      width: "100%",
9736      height: 1,
9737      marginTop: 6
9738    },
9739    "&:hover": {
9740      cursor: "row-resize"
9741    }
9742  }
9743);
9744
9745// src/manager/components/layout/PanelContainer.tsx
9746var Container6 = styled.div(({ theme, position }) => ({
9747  gridArea: "panel",
9748  position: "relative",
9749  backgroundColor: theme.appContentBg,
9750  borderTop: position === "bottom" ? `1px solid ${theme.appBorderColor}` : void 0,
9751  borderLeft: position === "right" ? `1px solid ${theme.appBorderColor}` : void 0
9752})), PanelSlot = styled.div({
9753  height: "100%"
9754}), PanelContainer = react_default.memo(function(props) {
9755  let { children, bottomPanelHeight, rightPanelWidth, panelMaxSize, panelResizerRef, position } = props, shouldHidePanelContent = position === "bottom" ? bottomPanelHeight === 0 : rightPanelWidth === 0;
9756  return react_default.createElement(Container6, { position }, react_default.createElement(
9757    Drag,
9758    {
9759      ref: panelResizerRef,
9760      position,
9761      overlapping: position === "bottom" ? !!bottomPanelHeight : !!rightPanelWidth,
9762      "aria-label": "Addon panel resize handle",
9763      "aria-valuenow": position === "bottom" ? bottomPanelHeight : rightPanelWidth,
9764      "aria-valuemax": panelMaxSize
9765    }
9766  ), react_default.createElement(
9767    PanelSlot,
9768    {
9769      hidden: shouldHidePanelContent ? !0 : void 0,
9770      "aria-hidden": shouldHidePanelContent ? !0 : void 0
9771    },
9772    children
9773  ));
9774});
9775
9776// src/manager/components/layout/SidebarContainer.tsx
9777init_react();
9778var Container7 = styled.div(({ theme }) => ({
9779  backgroundColor: theme.appBg,
9780  gridArea: "sidebar",
9781  position: "relative",
9782  borderRight: `1px solid ${theme.appBorderColor}`
9783})), SidebarSlot = styled.div({
9784  height: "100%"
9785}), SidebarContainer = react_default.memo(function(props) {
9786  let { children, navSize, sidebarMaxWidth, sidebarResizerRef } = props, shouldHideSidebarContent = navSize === 0;
9787  return react_default.createElement(Container7, null, react_default.createElement(
9788    SidebarSlot,
9789    {
9790      hidden: shouldHideSidebarContent ? !0 : void 0,
9791      "aria-hidden": shouldHideSidebarContent ? !0 : void 0
9792    },
9793    children
9794  ), react_default.createElement(
9795    Drag,
9796    {
9797      ref: sidebarResizerRef,
9798      position: "left",
9799      "aria-label": "Sidebar resize handle",
9800      "aria-valuenow": navSize,
9801      "aria-valuemax": sidebarMaxWidth
9802    }
9803  ));
9804});
9805
9806// src/manager/components/layout/useDragging.ts
9807init_react();
9808var SNAP_THRESHOLD_PX = 30, STIFFNESS = 0.9, KEYBOARD_STEP_PX = 10, KEYBOARD_SHIFT_MULTIPLIER = 5, RESIZE_KEYS = ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"];
9809function clamp(value, min, max) {
9810  return Math.min(Math.max(value, min), max);
9811}
9812function interpolate(relativeValue, min, max) {
9813  return min + (max - min) * relativeValue;
9814}
9815function computeSidebarMaxWidth(panelPosition, rightPanelWidth, showPanel) {
9816  if (typeof window > "u")
9817    return 0;
9818  let panelWidth = showPanel ? panelPosition === "right" ? rightPanelWidth : 360 : 0;
9819  return Math.max(window.innerWidth - 100 - panelWidth, 0);
9820}
9821function computePanelMaxSize(panelPosition, navSize) {
9822  return typeof window > "u" ? 0 : Math.max(panelPosition === "bottom" ? window.innerHeight - 40 : window.innerWidth - 100 - navSize, 0);
9823}
9824function applyResizeKeyboard(state, sizeKey, key, step, minSize, maxSize, increaseKey, decreaseKey) {
9825  let currentSize = state[sizeKey];
9826  switch (key) {
9827    case increaseKey:
9828      return { ...state, [sizeKey]: clamp(currentSize + step, minSize, maxSize) };
9829    case decreaseKey:
9830      let effectivelyComputed = clamp(currentSize - step, 0, maxSize);
9831      return { ...state, [sizeKey]: effectivelyComputed < minSize ? 0 : effectivelyComputed };
9832    case "Home":
9833      return { ...state, [sizeKey]: 0 };
9834    case "End":
9835      return { ...state, [sizeKey]: maxSize };
9836    default:
9837      return state;
9838  }
9839}
9840function useDragging({
9841  setState,
9842  showPanel,
9843  isDesktop,
9844  navSize,
9845  rightPanelWidth,
9846  panelPosition
9847}) {
9848  let panelResizerRef = useRef(null), sidebarResizerRef = useRef(null), sidebarMaxWidth = computeSidebarMaxWidth(panelPosition, rightPanelWidth, showPanel), panelMaxSize = computePanelMaxSize(panelPosition, navSize);
9849  return useEffect(() => {
9850    let panelResizer = panelResizerRef.current, sidebarResizer = sidebarResizerRef.current, 
vendor: 5,068 bytes, lines 9850-9966
9850previewIframe = document.querySelector("#storybook-preview-iframe"), draggedElement = null, onDragStart = (e2) => {
9851      e2.preventDefault(), setState((state) => ({
9852        ...state,
9853        isDragging: !0
9854      })), e2.currentTarget === panelResizer ? draggedElement = panelResizer : e2.currentTarget === sidebarResizer && (draggedElement = sidebarResizer), window.addEventListener("mousemove", onDrag), window.addEventListener("mouseup", onDragEnd), previewIframe && (previewIframe.style.pointerEvents = "none");
9855    }, onDragEnd = () => {
9856      setState((state) => {
9857        if (draggedElement === sidebarResizer && state.navSize < 240 && state.navSize > 0)
9858          return {
9859            ...state,
9860            isDragging: !1,
9861            navSize: 240
9862          };
9863        if (draggedElement === panelResizer) {
9864          if (state.panelPosition === "right" && state.rightPanelWidth < 270 && state.rightPanelWidth > 0)
9865            return {
9866              ...state,
9867              isDragging: !1,
9868              rightPanelWidth: 270
9869            };
9870          if (state.panelPosition === "bottom" && state.bottomPanelHeight < 40 && state.bottomPanelHeight > 0)
9871            return {
9872              ...state,
9873              isDragging: !1,
9874              bottomPanelHeight: 40
9875            };
9876        }
9877        return {
9878          ...state,
9879          isDragging: !1
9880        };
9881      }), window.removeEventListener("mousemove", onDrag), window.removeEventListener("mouseup", onDragEnd), previewIframe?.removeAttribute("style"), draggedElement = null;
9882    }, onDrag = (e2) => {
9883      if (e2.buttons === 0) {
9884        onDragEnd();
9885        return;
9886      }
9887      setState((state) => {
9888        if (draggedElement === sidebarResizer) {
9889          let sidebarDragX = e2.clientX;
9890          return sidebarDragX === state.navSize ? state : sidebarDragX <= SNAP_THRESHOLD_PX ? {
9891            ...state,
9892            navSize: 0
9893          } : sidebarDragX <= 240 ? {
9894            ...state,
9895            navSize: interpolate(STIFFNESS, sidebarDragX, 240)
9896          } : {
9897            ...state,
9898            navSize: clamp(
9899              sidebarDragX,
9900              0,
9901              computeSidebarMaxWidth(state.panelPosition, state.rightPanelWidth, showPanel)
9902            )
9903          };
9904        }
9905        if (draggedElement === panelResizer) {
9906          let sizeAxisState = state.panelPosition === "bottom" ? "bottomPanelHeight" : "rightPanelWidth", panelDragSize = state.panelPosition === "bottom" ? (
9907            // @ts-expect-error (non strict)
9908            e2.view.innerHeight - e2.clientY
9909          ) : (
9910            // @ts-expect-error (non strict)
9911            e2.view.innerWidth - e2.clientX
9912          ), minimumSize = state.panelPosition === "bottom" ? 40 : 270;
9913          return panelDragSize === state[sizeAxisState] ? state : panelDragSize <= SNAP_THRESHOLD_PX ? {
9914            ...state,
9915            [sizeAxisState]: 0
9916          } : panelDragSize <= minimumSize ? {
9917            ...state,
9918            [sizeAxisState]: interpolate(STIFFNESS, panelDragSize, minimumSize)
9919          } : {
9920            ...state,
9921            [sizeAxisState]: clamp(
9922              panelDragSize,
9923              0,
9924              computePanelMaxSize(state.panelPosition, state.navSize)
9925            )
9926          };
9927        }
9928        return state;
9929      });
9930    }, onSidebarKeyDown = (e2) => {
9931      if (!RESIZE_KEYS.includes(e2.key))
9932        return;
9933      e2.preventDefault();
9934      let step = e2.shiftKey ? KEYBOARD_STEP_PX * KEYBOARD_SHIFT_MULTIPLIER : KEYBOARD_STEP_PX;
9935      setState(
9936        (state) => applyResizeKeyboard(
9937          state,
9938          "navSize",
9939          e2.key,
9940          step,
9941          240,
9942          computeSidebarMaxWidth(state.panelPosition, state.rightPanelWidth, showPanel),
9943          "ArrowRight",
9944          "ArrowLeft"
9945        )
9946      );
9947    }, onPanelKeyDown = (e2) => {
9948      if (!RESIZE_KEYS.includes(e2.key))
9949        return;
9950      e2.preventDefault();
9951      let step = e2.shiftKey ? KEYBOARD_STEP_PX * KEYBOARD_SHIFT_MULTIPLIER : KEYBOARD_STEP_PX;
9952      setState(
9953        (state) => applyResizeKeyboard(
9954          state,
9955          state.panelPosition === "bottom" ? "bottomPanelHeight" : "rightPanelWidth",
9956          e2.key,
9957          step,
9958          state.panelPosition === "bottom" ? 40 : 270,
9959          computePanelMaxSize(state.panelPosition, state.navSize),
9960          state.panelPosition === "bottom" ? "ArrowUp" : "ArrowLeft",
9961          state.panelPosition === "bottom" ? "ArrowDown" : "ArrowRight"
9962        )
9963      );
9964    };
9965    return panelResizer?.addEventListener("mousedown", onDragStart), sidebarResizer?.addEventListener("mousedown", onDragStart), panelResizer?.addEventListener("keydown", onPanelKeyDown), sidebarResizer?.addEventListener("keydown", onSidebarKeyDown), () => {
9966      panelResizer?.removeEventListener("mousedown", onDragStart), sidebarResizer?.removeEventListener("mousedown", onDragStart), panelResizer?.removeEventListener("keydown", onPanelKeyDown), sidebarResizer?.removeEventListener("keydown", onSidebarKeyDown), previewIframe?.removeAttribute("style"
vendor: 2,545 bytes, lines 9966-10031
9966);
9967    };
9968  }, [
9969    // we need to rerun this effect when the panel is shown/hidden or when changing between mobile/desktop to re-attach the event listeners
9970    showPanel,
9971    isDesktop,
9972    setState
9973  ]), { panelResizerRef, sidebarResizerRef, sidebarMaxWidth, panelMaxSize };
9974}
9975
9976// src/manager/components/layout/useLandmarkIndicator.ts
9977init_react();
9978function findActiveLandmarkElement() {
9979  let currentElement = document.activeElement, landmarkElement = null;
9980  for (; currentElement; ) {
9981    if (currentElement instanceof HTMLElement && currentElement.hasAttribute("data-sb-landmark")) {
9982      landmarkElement = currentElement;
9983      break;
9984    }
9985    currentElement = currentElement.parentElement;
9986  }
9987  return landmarkElement;
9988}
9989function useRegionFocusAnimation() {
9990  let theme = useTheme(), reducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)"), currentAnimationRef = useRef(null);
9991  return (elementToAnimate) => {
9992    if (elementToAnimate && (currentAnimationRef.current && (currentAnimationRef.current.cancel(), currentAnimationRef.current = null), !reducedMotion)) {
9993      let animation = elementToAnimate.animate(
9994        [{ border: `2px solid ${theme.color.primary}` }, { border: "2px solid transparent" }],
9995        {
9996          duration: 1500,
9997          pseudoElement: "::after"
9998        }
9999      );
10000      currentAnimationRef.current = animation, animation.onfinish = () => {
10001        currentAnimationRef.current = null;
10002      };
10003    }
10004  };
10005}
10006function useLandmarkIndicator() {
10007  let animateLandmark = useRegionFocusAnimation();
10008  useEffect(() => {
10009    let handleKeyDown = (e2) => {
10010      if (e2.key !== "F6")
10011        return;
10012      let landmarkElement = findActiveLandmarkElement();
10013      landmarkElement && animateLandmark(landmarkElement);
10014    };
10015    return document.addEventListener("keydown", handleKeyDown, { capture: !0 }), () => {
10016      document.removeEventListener("keydown", handleKeyDown, { capture: !0 });
10017    };
10018  }, [animateLandmark]);
10019}
10020
10021// src/manager/components/layout/Layout.tsx
10022var layoutStateIsEqual = (state, other) => state.navSize === other.navSize && state.bottomPanelHeight === other.bottomPanelHeight && state.rightPanelWidth === other.rightPanelWidth && state.panelPosition === other.panelPosition, useLayoutSyncingState = ({
10023  api,
10024  managerLayoutState,
10025  setManagerLayoutState,
10026  isDesktop,
10027  hasTab
10028}) => {
10029  let prevManagerLayoutStateRef = react_default.useRef(managerLayoutState), [internalDraggingSizeState, setInternalDraggingSizeState] = useState({
10030    ...managerLayoutState,
10031    isDragging: !1
10031
10032  });
10033  useEffect(() => {
10034    internalDraggingSizeState.isDragging || // don't interrupt user's drag
10035    layoutStateIsEqual(managerLayoutState, prevManagerLayoutStateRef.current) || (prevManagerLayoutStateRef.current = managerLayoutState, setInternalDraggingSizeState((state) => ({ ...state, ...managerLayoutState })));
10036  }, [internalDraggingSizeState.isDragging, managerLayoutState, setInternalDraggingSizeState]), useLayoutEffect(() => {
10037    if (internalDraggingSizeState.isDragging || // wait with syncing managerLayoutState until user is done dragging
10038    layoutStateIsEqual(managerLayoutState, internalDraggingSizeState))
10039      return;
10040    let nextState = {
10041      navSize: internalDraggingSizeState.navSize,
10042      bottomPanelHeight: internalDraggingSizeState.bottomPanelHeight,
10043      rightPanelWidth: internalDraggingSizeState.rightPanelWidth
10044    };
10045    prevManagerLayoutStateRef.current = {
10046      ...prevManagerLayoutStateRef.current,
10047      ...nextState
10048    }, setManagerLayoutState(nextState);
10049  }, [internalDraggingSizeState, setManagerLayoutState]);
10050  let isPagesShown = managerLayoutState.viewMode !== void 0 && managerLayoutState.viewMode !== "story" && managerLayoutState.viewMode !== "docs", isPanelShown = managerLayoutState.viewMode === "story" && !hasTab, { navSize, rightPanelWidth, bottomPanelHeight } = internalDraggingSizeState.isDragging ? internalDraggingSizeState : managerLayoutState, customisedNavSize = api.getNavSizeWithCustomisations?.(navSize) ?? navSize, customisedShowPanel = api.getShowPanelWithCustomisations?.(isPanelShown) ?? isPanelShown, { panelResizerRef, sidebarResizerRef, sidebarMaxWidth, panelMaxSize } = useDragging({
10051    setState: setInternalDraggingSizeState,
10052    isDesktop,
10053    navSize: customisedNavSize,
10054    showPanel: customisedShowPanel,
10055    rightPanelWidth,
10056    panelPosition: managerLayoutState.panelPosition
10057  });
10058  return {
10059    navSize: customisedNavSize,
10060    rightPanelWidth,
10061    bottomPanelHeight,
10062    panelPosition: managerLayoutState.panelPosition,
10063    panelResizerRef,
10064    sidebarResizerRef,
10065    sidebarMaxWidth,
10066    panelMaxSize,
10067    showPages: isPagesShown,
10068    showPanel: customisedShowPanel,
10069    isDragging: internalDraggingSizeState.isDragging
10070  };
10071}, OrderedMobileNavigation = styled(MobileNavigation)({
10072  order: 1
10073}), Layout = ({ managerLayoutState, setManagerLayoutState, hasTab, ...slots }) => {
10074  let { isDesktop, isMobile: isMobile2 } = useLayout(), api = useStorybookApi(), {
10075    navSize,
10076    rightPanelWidth,
10077    bottomPanelHeight,
10078    panelPosition,
10079    panelResizerRef,
10080    sidebarResizerRef,
10081    sidebarMaxWidth,
10082    panelMaxSize,
10083    showPages,
10084    showPanel
10085  } = useLayoutSyncingState({ api, managerLayoutState, setManagerLayoutState, isDesktop, hasTab });
10086  return useLandmarkIndicator(), react_default.createElement(
10087    LayoutContainer,
10088    {
10089      panelPosition: managerLayoutState.panelPosition,
10090      showPanel,
10091      style: {
10092        "--nav-width": `${navSize}px`,
10093        "--right-panel-width": `${rightPanelWidth}px`,
10094        "--bottom-panel-height": `${bottomPanelHeight}px`
10095      }
10096    },
10097    react_default.createElement(react_default.Fragment, null, isDesktop && react_default.createElement(
10098      SidebarContainer,
10099      {
10100        navSize,
10101        sidebarMaxWidth,
10102        sidebarResizerRef
10103      },
10104      slots.slotSidebar
10105    ), isMobile2 && react_default.createElement(
10106      OrderedMobileNavigation,
10107      {
10108        menu: slots.slotSidebar,
10109        panel: slots.slotPanel,
10110        showPanel
10111      }
10112    ), react_default.createElement(
10113      MainAreaContainer,
10114      {
10115        showPages,
10116        slotMain: slots.slotMain,
10117        slotPages: slots.slotPages
10118      }
10119    ), isDesktop && showPanel && react_default.createElement(
10120      PanelContainer,
10121      {
10122        bottomPanelHeight,
10123        rightPanelWidth,
10124        panelMaxSize,
10125        panelResizerRef,
10126        position: panelPosition
10127      },
10128      slots.slotPanel
10129    ), isMobile2 && react_default.createElement(Notifications, null))
10130  );
10131}, LayoutContainer = styled.div(({ panelPosition, showPanel }) => ({
10132  width: "100%",
10133  height: ["100vh", "100dvh"],
10134  overflow: "hidden",
10135  display: "flex",
10136  flexDirection: "column",
10137  colorScheme: "light dark",
10138  [MEDIA_DESKTOP_BREAKPOINT]: {
10139    display: "grid",
10140    gap: 0,
10141    // This uses CSS variables to prevent Emotion from generating a new CSS className for every possible value
10142    gridTemplateColumns: `minmax(0, var(--nav-width)) minmax(${100}px, 1fr) minmax(0, var(--right-panel-width))`,
10143    gridTemplateRows: "1fr minmax(0, var(--bottom-panel-height))",
10144    gridTemplateAreas: showPanel ? panelPosition === "right" ? `"sidebar content panel"
10145                  "sidebar content panel"` : `"sidebar content content"
10146                "sidebar panel   panel"` : `"sidebar content content"
10147                  "sidebar content content"`
10148  }
10149}));
10150
10151// src/manager/container/Panel.tsx
10152init_react();
10153
10154// global-externals:storybook/internal/types
10155var types_default = __STORYBOOK_TYPES__, { Addon_TypesEnum, CHANGE_DETECTION_STATUS_TYPE_ID, CoreWebpackCompiler, Feature, SupportedBuilder, SupportedFramework, SupportedLanguage, SupportedRenderer } = __STORYBOOK_TYPES__
vendor: 6,566 bytes, lines 10155-10229
10155;
10156
10157// src/core-events/index.ts
10158var events = /* @__PURE__ */ ((events2) => (events2.CHANNEL_WS_DISCONNECT = "channelWSDisconnect", events2.CHANNEL_CREATED = "channelCreated", events2.CONFIG_ERROR = "configError", events2.STORY_INDEX_INVALIDATED = "storyIndexInvalidated", events2.STORY_SPECIFIED = "storySpecified", events2.SET_CONFIG = "setConfig", events2.SET_STORIES = "setStories", events2.SET_INDEX = "setIndex", events2.SET_CURRENT_STORY = "setCurrentStory", events2.CURRENT_STORY_WAS_SET = "currentStoryWasSet", events2.FORCE_RE_RENDER = "forceReRender", events2.FORCE_REMOUNT = "forceRemount", events2.PRELOAD_ENTRIES = "preloadStories", events2.STORY_PREPARED = "storyPrepared", events2.DOCS_PREPARED = "docsPrepared", events2.STORY_CHANGED = "storyChanged", events2.STORY_UNCHANGED = "storyUnchanged", events2.STORY_RENDERED = "storyRendered", events2.STORY_FINISHED = "storyFinished", events2.STORY_MISSING = "storyMissing", events2.STORY_ERRORED = "storyErrored", events2.STORY_THREW_EXCEPTION = "storyThrewException", events2.STORY_RENDER_PHASE_CHANGED = "storyRenderPhaseChanged", events2.STORY_HOT_UPDATED = "storyHotUpdated", events2.PLAY_FUNCTION_THREW_EXCEPTION = "playFunctionThrewException", events2.UNHANDLED_ERRORS_WHILE_PLAYING = "unhandledErrorsWhilePlaying", events2.UPDATE_STORY_ARGS = "updateStoryArgs", events2.STORY_ARGS_UPDATED = "storyArgsUpdated", events2.RESET_STORY_ARGS = "resetStoryArgs", events2.SET_FILTER = "setFilter", events2.SET_GLOBALS = "setGlobals", events2.UPDATE_GLOBALS = "updateGlobals", events2.GLOBALS_UPDATED = "globalsUpdated", events2.REGISTER_SUBSCRIPTION = "registerSubscription", events2.PREVIEW_INITIALIZED = "previewInitialized", events2.PREVIEW_KEYDOWN = "previewKeydown", events2.PREVIEW_BUILDER_PROGRESS = "preview_builder_progress", events2.SELECT_STORY = "selectStory", events2.STORIES_COLLAPSE_ALL = "storiesCollapseAll", events2.STORIES_EXPAND_ALL = "storiesExpandAll", events2.DOCS_RENDERED = "docsRendered", events2.SHARED_STATE_CHANGED = "sharedStateChanged", events2.SHARED_STATE_SET = "sharedStateSet", events2.NAVIGATE_URL = "navigateUrl", events2.UPDATE_QUERY_PARAMS = "updateQueryParams", events2.REQUEST_WHATS_NEW_DATA = "requestWhatsNewData", events2.RESULT_WHATS_NEW_DATA = "resultWhatsNewData", events2.SET_WHATS_NEW_CACHE = "setWhatsNewCache", events2.TOGGLE_WHATS_NEW_NOTIFICATIONS = "toggleWhatsNewNotifications", events2.TELEMETRY_ERROR = "telemetryError", events2.FILE_COMPONENT_SEARCH_REQUEST = "fileComponentSearchRequest", events2.FILE_COMPONENT_SEARCH_RESPONSE = "fileComponentSearchResponse", events2.SAVE_STORY_REQUEST = "saveStoryRequest", events2.SAVE_STORY_RESPONSE = "saveStoryResponse", events2.ARGTYPES_INFO_REQUEST = "argtypesInfoRequest", events2.ARGTYPES_INFO_RESPONSE = "argtypesInfoResponse", events2.CREATE_NEW_STORYFILE_REQUEST = "createNewStoryfileRequest", events2.CREATE_NEW_STORYFILE_RESPONSE = "createNewStoryfileResponse", events2.GHOST_STORIES_REQUEST = "ghostStoriesRequest", events2.GHOST_STORIES_RESPONSE = "ghostStoriesResponse", events2.AI_SETUP_ANALYTICS_RESPONSE = "aiSetupAnalyticsResponse", events2.AI_SETUP_ANALYTICS_REQUEST = "aiSetupAnalyticsRequest", events2.OPEN_IN_EDITOR_REQUEST = "openInEditorRequest", events2.OPEN_IN_EDITOR_RESPONSE = "openInEditorResponse", events2.MANAGER_INERT_ATTRIBUTE_CHANGED = "managerInertAttributeChanged", events2.SHARE_ISOLATE_MODE = "shareIsolateMode", events2.AI_PROMPT_NUDGE = "aiPromptNudge", events2.SIDEBAR_FILTER_CHANGED = "sidebarFilterChanged", events2))(events || {});
10159var {
10160  CHANNEL_WS_DISCONNECT: CHANNEL_WS_DISCONNECT2,
10161  CHANNEL_CREATED: CHANNEL_CREATED2,
10162  CONFIG_ERROR: CONFIG_ERROR2,
10163  CREATE_NEW_STORYFILE_REQUEST: CREATE_NEW_STORYFILE_REQUEST2,
10164  CREATE_NEW_STORYFILE_RESPONSE: CREATE_NEW_STORYFILE_RESPONSE2,
10165  CURRENT_STORY_WAS_SET: CURRENT_STORY_WAS_SET2,
10166  DOCS_PREPARED: DOCS_PREPARED2,
10167  DOCS_RENDERED: DOCS_RENDERED2,
10168  FILE_COMPONENT_SEARCH_REQUEST: FILE_COMPONENT_SEARCH_REQUEST2,
10169  FILE_COMPONENT_SEARCH_RESPONSE: FILE_COMPONENT_SEARCH_RESPONSE2,
10170  FORCE_RE_RENDER: FORCE_RE_RENDER2,
10171  FORCE_REMOUNT: FORCE_REMOUNT2,
10172  GLOBALS_UPDATED: GLOBALS_UPDATED2,
10173  NAVIGATE_URL: NAVIGATE_URL2,
10174  PLAY_FUNCTION_THREW_EXCEPTION: PLAY_FUNCTION_THREW_EXCEPTION2,
10175  UNHANDLED_ERRORS_WHILE_PLAYING: UNHANDLED_ERRORS_WHILE_PLAYING2,
10176  PRELOAD_ENTRIES: PRELOAD_ENTRIES2,
10177  PREVIEW_INITIALIZED: PREVIEW_INITIALIZED2,
10178  PREVIEW_BUILDER_PROGRESS: PREVIEW_BUILDER_PROGRESS2,
10179  PREVIEW_KEYDOWN: PREVIEW_KEYDOWN2,
10180  REGISTER_SUBSCRIPTION: REGISTER_SUBSCRIPTION2,
10181  RESET_STORY_ARGS: RESET_STORY_ARGS2,
10182  SELECT_STORY: SELECT_STORY2,
10183  SET_CONFIG: SET_CONFIG2,
10184  SET_CURRENT_STORY: SET_CURRENT_STORY2,
10185  SET_FILTER: SET_FILTER2,
10186  SET_GLOBALS: SET_GLOBALS2,
10187  SET_INDEX: SET_INDEX2,
10188  SET_STORIES: SET_STORIES2,
10189  SHARED_STATE_CHANGED: SHARED_STATE_CHANGED2,
10190  SHARED_STATE_SET: SHARED_STATE_SET2,
10191  STORIES_COLLAPSE_ALL: STORIES_COLLAPSE_ALL2,
10192  STORIES_EXPAND_ALL: STORIES_EXPAND_ALL2,
10193  STORY_ARGS_UPDATED: STORY_ARGS_UPDATED2,
10194  STORY_CHANGED: STORY_CHANGED2,
10195  STORY_ERRORED: STORY_ERRORED2,
10196  STORY_INDEX_INVALIDATED: STORY_INDEX_INVALIDATED2,
10197  STORY_MISSING: STORY_MISSING2,
10198  STORY_PREPARED: STORY_PREPARED2,
10199  STORY_RENDER_PHASE_CHANGED: STORY_RENDER_PHASE_CHANGED2,
10200  STORY_RENDERED: STORY_RENDERED2,
10201  STORY_FINISHED: STORY_FINISHED2,
10202  STORY_SPECIFIED: STORY_SPECIFIED2,
10203  STORY_THREW_EXCEPTION: STORY_THREW_EXCEPTION2,
10204  STORY_UNCHANGED: STORY_UNCHANGED2,
10205  STORY_HOT_UPDATED: STORY_HOT_UPDATED2,
10206  UPDATE_GLOBALS: UPDATE_GLOBALS2,
10207  UPDATE_QUERY_PARAMS: UPDATE_QUERY_PARAMS2,
10208  UPDATE_STORY_ARGS: UPDATE_STORY_ARGS2,
10209  REQUEST_WHATS_NEW_DATA: REQUEST_WHATS_NEW_DATA2,
10210  RESULT_WHATS_NEW_DATA: RESULT_WHATS_NEW_DATA2,
10211  SET_WHATS_NEW_CACHE: SET_WHATS_NEW_CACHE2,
10212  TOGGLE_WHATS_NEW_NOTIFICATIONS: TOGGLE_WHATS_NEW_NOTIFICATIONS2,
10213  TELEMETRY_ERROR: TELEMETRY_ERROR2,
10214  SAVE_STORY_REQUEST: SAVE_STORY_REQUEST2,
10215  SAVE_STORY_RESPONSE: SAVE_STORY_RESPONSE2,
10216  ARGTYPES_INFO_REQUEST: ARGTYPES_INFO_REQUEST2,
10217  ARGTYPES_INFO_RESPONSE: ARGTYPES_INFO_RESPONSE2,
10218  GHOST_STORIES_REQUEST: GHOST_STORIES_REQUEST2,
10219  GHOST_STORIES_RESPONSE: GHOST_STORIES_RESPONSE2,
10220  AI_SETUP_ANALYTICS_RESPONSE: AI_SETUP_ANALYTICS_RESPONSE2,
10221  AI_SETUP_ANALYTICS_REQUEST: AI_SETUP_ANALYTICS_REQUEST2,
10222  OPEN_IN_EDITOR_REQUEST: OPEN_IN_EDITOR_REQUEST2,
10223  OPEN_IN_EDITOR_RESPONSE: OPEN_IN_EDITOR_RESPONSE2,
10224  MANAGER_INERT_ATTRIBUTE_CHANGED: MANAGER_INERT_ATTRIBUTE_CHANGED2,
10225  SHARE_ISOLATE_MODE: SHARE_ISOLATE_MODE2,
10226  AI_PROMPT_NUDGE: AI_PROMPT_NUDGE2,
10227  SIDEBAR_FILTER_CHANGED: SIDEBAR_FILTER_CHANGED2
10228} = events;
10229
vendor: 229 bytes, lines 10230-10234
10230// ../../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
10231function getSymbols(object) {
10232  return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
10233}
10234
vendor: 218 bytes, lines 10235-10239
10235// ../../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
10236function getTag(value) {
10237  return value == null ? value === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(value);
10238}
10239
vendor: 1,007 bytes, lines 10240-10242
10240// ../../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
10241var regexpTag = "[object RegExp]", stringTag = "[object String]", numberTag = "[object Number]", booleanTag = "[object Boolean]", argumentsTag = "[object Arguments]", symbolTag = "[object Symbol]", dateTag = "[object Date]", mapTag = "[object Map]", setTag = "[object Set]", arrayTag = "[object Array]", functionTag = "[object Function]", arrayBufferTag = "[object ArrayBuffer]", objectTag = "[object Object]", errorTag = "[object Error]", dataViewTag = "[object DataView]", uint8ArrayTag = "[object Uint8Array]", uint8ClampedArrayTag = "[object Uint8ClampedArray]", uint16ArrayTag = "[object Uint16Array]", uint32ArrayTag = "[object Uint32Array]", bigUint64ArrayTag = "[object BigUint64Array]", int8ArrayTag = "[object Int8Array]", int16ArrayTag = "[object Int16Array]", int32ArrayTag = "[object Int32Array]", bigInt64ArrayTag = "[object BigInt64Array]", float32ArrayTag = "[object Float32Array]", float64ArrayTag = "[object Float64Array]";
10242
vendor: 365 bytes, lines 10243-10250
10243// ../../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
10244function isPlainObject(value) {
10245  if (!value || typeof value != "object")
10246    return !1;
10247  let proto = Object.getPrototypeOf(value);
10248  return proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null ? Object.prototype.toString.call(value) === "[object Object]" : !1;
10249}
10250
vendor: 205 bytes, lines 10251-10253
10251// ../../node_modules/es-toolkit/dist/string/words.mjs
10252var CASE_SPLIT_PATTERN = new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+", "gu");
10253
vendor: 160 bytes, lines 10254-10258
10254// ../../node_modules/es-toolkit/dist/compat/util/eq.mjs
10255function eq(value, other) {
10256  return value === other || Number.isNaN(value) && Number.isNaN(other);
10257}
10258
vendor: 4,424 bytes, lines 10259-10381
10259// ../../node_modules/es-toolkit/dist/predicate/isEqualWith.mjs
10260function isEqualWith(a2, b2, areValuesEqual) {
10261  return isEqualWithImpl(a2, b2, void 0, void 0, void 0, void 0, areValuesEqual);
10262}
10263function isEqualWithImpl(a2, b2, property, aParent, bParent, stack, areValuesEqual) {
10264  let result = areValuesEqual(a2, b2, property, aParent, bParent, stack);
10265  if (result !== void 0)
10266    return result;
10267  if (typeof a2 == typeof b2)
10268    switch (typeof a2) {
10269      case "bigint":
10270      case "string":
10271      case "boolean":
10272      case "symbol":
10273      case "undefined":
10274        return a2 === b2;
10275      case "number":
10276        return a2 === b2 || Object.is(a2, b2);
10277      case "function":
10278        return a2 === b2;
10279      case "object":
10280        return areObjectsEqual(a2, b2, stack, areValuesEqual);
10281    }
10282  return areObjectsEqual(a2, b2, stack, areValuesEqual);
10283}
10284function areObjectsEqual(a2, b2, stack, areValuesEqual) {
10285  if (Object.is(a2, b2))
10286    return !0;
10287  let aTag = getTag(a2), bTag = getTag(b2);
10288  if (aTag === argumentsTag && (aTag = objectTag), bTag === argumentsTag && (bTag = objectTag), aTag !== bTag)
10289    return !1;
10290  switch (aTag) {
10291    case stringTag:
10292      return a2.toString() === b2.toString();
10293    case numberTag: {
10294      let x2 = a2.valueOf(), y2 = b2.valueOf();
10295      return eq(x2, y2);
10296    }
10297    case booleanTag:
10298    case dateTag:
10299    case symbolTag:
10300      return Object.is(a2.valueOf(), b2.valueOf());
10301    case regexpTag:
10302      return a2.source === b2.source && a2.flags === b2.flags;
10303    case functionTag:
10304      return a2 === b2;
10305  }
10306  stack = stack ?? /* @__PURE__ */ new Map();
10307  let aStack = stack.get(a2), bStack = stack.get(b2);
10308  if (aStack != null && bStack != null)
10309    return aStack === b2;
10310  stack.set(a2, b2), stack.set(b2, a2);
10311  try {
10312    switch (aTag) {
10313      case mapTag: {
10314        if (a2.size !== b2.size)
10315          return !1;
10316        for (let [key, value] of a2.entries())
10317          if (!b2.has(key) || !isEqualWithImpl(value, b2.get(key), key, a2, b2, stack, areValuesEqual))
10318            return !1;
10319        return !0;
10320      }
10321      case setTag: {
10322        if (a2.size !== b2.size)
10323          return !1;
10324        let aValues = Array.from(a2.values()), bValues = Array.from(b2.values());
10325        for (let i2 = 0; i2 < aValues.length; i2++) {
10326          let aValue = aValues[i2], index = bValues.findIndex((bValue) => isEqualWithImpl(aValue, bValue, void 0, a2, b2, stack, areValuesEqual));
10327          if (index === -1)
10328            return !1;
10329          bValues.splice(index, 1);
10330        }
10331        return !0;
10332      }
10333      case arrayTag:
10334      case uint8ArrayTag:
10335      case uint8ClampedArrayTag:
10336      case uint16ArrayTag:
10337      case uint32ArrayTag:
10338      case bigUint64ArrayTag:
10339      case int8ArrayTag:
10340      case int16ArrayTag:
10341      case int32ArrayTag:
10342      case bigInt64ArrayTag:
10343      case float32ArrayTag:
10344      case float64ArrayTag: {
10345        if (typeof Buffer < "u" && Buffer.isBuffer(a2) !== Buffer.isBuffer(b2) || a2.length !== b2.length)
10346          return !1;
10347        for (let i2 = 0; i2 < a2.length; i2++)
10348          if (!isEqualWithImpl(a2[i2], b2[i2], i2, a2, b2, stack, areValuesEqual))
10349            return !1;
10350        return !0;
10351      }
10352      case arrayBufferTag:
10353        return a2.byteLength !== b2.byteLength ? !1 : areObjectsEqual(new Uint8Array(a2), new Uint8Array(b2), stack, areValuesEqual);
10354      case dataViewTag:
10355        return a2.byteLength !== b2.byteLength || a2.byteOffset !== b2.byteOffset ? !1 : areObjectsEqual(new Uint8Array(a2), new Uint8Array(b2), stack, areValuesEqual);
10356      case errorTag:
10357        return a2.name === b2.name && a2.message === b2.message;
10358      case objectTag: {
10359        if (!(areObjectsEqual(a2.constructor, b2.constructor, stack, areValuesEqual) || isPlainObject(a2) && isPlainObject(b2)))
10360          return !1;
10361        let aKeys = [...Object.keys(a2), ...getSymbols(a2)], bKeys = [...Object.keys(b2), ...getSymbols(b2)];
10362        if (aKeys.length !== bKeys.length)
10363          return !1;
10364        for (let i2 = 0; i2 < aKeys.length; i2++) {
10365          let propKey = aKeys[i2], aProp = a2[propKey];
10366          if (!Object.hasOwn(b2, propKey))
10367            return !1;
10368          let bProp = b2[propKey];
10369          if (!isEqualWithImpl(aProp, bProp, propKey, a2, b2, stack, areValuesEqual))
10370            return !1;
10371        }
10372        return !0;
10373      }
10374      default:
10375        return !1;
10376    }
10377  } finally {
10378    stack.delete(a2), stack.delete(b2);
10379  }
10380}
10381
vendor: 77 bytes, lines 10382-10385
10382// ../../node_modules/es-toolkit/dist/function/noop.mjs
10383function noop() {
10384}
10385
vendor: 292 bytes, lines 10386-10393
10386// ../../node_modules/es-toolkit/dist/predicate/isEqual.mjs
10387function isEqual(a2, b2) {
10388  return isEqualWith(a2, b2, noop);
10389}
10390
10391// global-externals:storybook/theming/create
10392var create_default = __STORYBOOK_THEMING_CREATE__, { create: create3, themes: themes2 } = __STORYBOOK_THEMING_CREATE__;
10393
10394// src/manager-api/modules/layout.ts
10395var { document: document2 } = scope;
10396var focusableUIElements = {
10397  addonPanel: "storybook-panel-region",
10398  storySearchField: "storybook-explorer-searchfield",
10399  storyListMenu: "storybook-explorer-menu",
10400  storyPanelRoot: "storybook-panel-root",
10401  showAddonPanel: "storybook-show-addon-panel",
10402  sidebarRegion: "storybook-sidebar-region",
10403  showSidebar: "storybook-show-sidebar"
10404}
vendor: 6,422 bytes, lines 10404-10566
10404;
10405
10406// src/manager/components/panel/Panel.tsx
10407init_react();
10408var TabErrorBoundary = class extends Component {
10409  constructor(props) {
10410    super(props), this.state = { hasError: !1 };
10411  }
10412  static getDerivedStateFromError() {
10413    return { hasError: !0 };
10414  }
10415  componentDidCatch(error, info) {
10416    console.error("Error rendering addon panel"), console.error(error), console.error(info.componentStack);
10417  }
10418  render() {
10419    let { hasError } = this.state;
10420    if (hasError)
10421      return react_default.createElement(
10422        EmptyTabContent,
10423        {
10424          title: "This addon has errors",
10425          description: "Check your browser logs and addon code to pinpoint what went wrong. This issue was not caused by Storybook."
10426        }
10427      );
10428    let { children } = this.props;
10429    return children;
10430  }
10431}, Aside = styled.aside({
10432  height: "100%",
10433  display: "flex",
10434  flexDirection: "column"
10435});
10436function renderChild(RenderProp) {
10437  return react_default.createElement(RenderProp, { active: !0 });
10438}
10439var PreRenderAddons = ({ panels }) => Object.entries(panels).map(([k2, v2]) => react_default.createElement(StatelessTabPanel, { key: k2, name: k2, hasScrollbar: !1 }, react_default.createElement(TabErrorBoundary, { key: k2 }, renderChild(v2.render)))), AddonPanel2 = react_default.memo(({ panels, shortcuts, actions, selectedPanel = null, panelPosition = "right" }) => {
10440  let { isDesktop, setMobilePanelOpen } = useLayout(), emptyState = react_default.createElement(
10441    EmptyTabContent,
10442    {
10443      title: "Storybook add-ons",
10444      description: react_default.createElement(react_default.Fragment, null, "Integrate your tools with Storybook to connect workflows and unlock advanced features."),
10445      footer: react_default.createElement(Link, { href: "https://storybook.js.org/addons?ref=ui", target: "_blank", withArrow: !0 }, react_default.createElement(DocumentIcon, null), " Explore integrations catalog")
10446    }
10447  ), tools = useMemo(
10448    () => react_default.createElement(ActionsWrapper, null, isDesktop ? react_default.createElement(react_default.Fragment, null, react_default.createElement(
10449      Button,
10450      {
10451        key: "position",
10452        padding: "small",
10453        variant: "ghost",
10454        onClick: actions.togglePosition,
10455        ariaLabel: panelPosition === "bottom" ? "Move addon panel to right" : "Move addon panel to bottom",
10456        ariaDescription: "Changes the location of the addon panel to the bottom or right of the screen, but does not have any effect on its content.",
10457        shortcut: shortcuts.panelPosition
10458      },
10459      panelPosition === "bottom" ? react_default.createElement(SidebarAltIcon, null) : react_default.createElement(BottomBarIcon, null)
10460    ), react_default.createElement(
10461      Button,
10462      {
10463        key: "visibility",
10464        padding: "small",
10465        variant: "ghost",
10466        onClick: actions.toggleVisibility,
10467        ariaLabel: "Hide addon panel",
10468        shortcut: shortcuts.togglePanel
10469      },
10470      react_default.createElement(CloseIcon, null)
10471    )) : react_default.createElement(
10472      Button,
10473      {
10474        padding: "small",
10475        variant: "ghost",
10476        onClick: () => setMobilePanelOpen(!1),
10477        ariaLabel: "Close addon panel"
10478      },
10479      react_default.createElement(CloseIcon, null)
10480    )),
10481    [actions, isDesktop, panelPosition, setMobilePanelOpen, shortcuts]
10482  ), asideRef = useRef(null), { landmarkProps } = useLandmark(
10483    { "aria-labelledby": "storybook-panel-heading", role: "region" },
10484    asideRef
10485  );
10486  return react_default.createElement(Aside, { ref: asideRef, id: focusableUIElements.addonPanel, ...landmarkProps }, react_default.createElement("h2", { id: "storybook-panel-heading", className: "sb-sr-only" }, "Addon panel"), react_default.createElement(
10487    StatelessTabsView,
10488    {
10489      id: focusableUIElements.storyPanelRoot,
10490      showToolsWhenEmpty: !0,
10491      emptyState,
10492      selected: selectedPanel ?? void 0,
10493      onSelectionChange: (id) => actions.onSelect(id),
10494      tools
10495    },
10496    react_default.createElement(StatelessTabList, { "aria-label": "Available addons" }, Object.entries(panels).map(([k2, v2]) => react_default.createElement(StatelessTab, { key: k2, name: k2 }, typeof v2.title == "function" ? react_default.createElement(v2.title, null) : v2.title))),
10497    Object.keys(panels).length ? react_default.createElement(PreRenderAddons, { panels }) : null
10498  ));
10499});
10500AddonPanel2.displayName = "AddonPanel";
10501var ActionsWrapper = styled.div({
10502  display: "flex",
10503  alignItems: "center",
10504  gap: 6
10505});
10506
10507// src/manager/container/Panel.tsx
10508var Panel = (props) => {
10509  let api = useStorybookApi(), state = useStorybookState(), [story, setStory] = useState(api.getCurrentStoryData());
10510  useChannel(
10511    {
10512      [STORY_PREPARED2]: () => {
10513        setStory(api.getCurrentStoryData());
10514      }
10515    },
10516    []
10517  );
10518  let { parameters, type } = story ?? {}, panelActions = useMemo(
10519    () => ({
10520      onSelect: (panel) => api.setSelectedPanel(panel),
10521      toggleVisibility: async () => {
10522        let wasPanelShown = api.getIsPanelShown();
10523        api.togglePanel(), wasPanelShown && await api.focusOnUIElement(focusableUIElements.showAddonPanel) === !1 && document.body.focus();
10524      },
10525      togglePosition: () => api.togglePanelPosition()
10526    }),
10527    [api]
10528  ), panels = useMemo(() => {
10529    let allPanels = api.getElements(Addon_TypesEnum.PANEL);
10530    if (!allPanels || type !== "story")
10531      return allPanels;
10532    let filteredPanels = {};
10533    return Object.entries(allPanels).forEach(([id, p2]) => {
10534      let { paramKey } = p2;
10535      paramKey && parameters && parameters[paramKey] && parameters[paramKey].disable || p2.disabled === !0 || typeof p2.disabled == "function" && p2.disabled(parameters) || (filteredPanels[id] = p2);
10536    }), filteredPanels;
10537  }, [api, type, parameters]);
10538  return react_default.createElement(
10539    AddonPanel2,
10540    {
10541      panels,
10542      selectedPanel: api.getSelectedPanel(),
10543      panelPosition: state.layout.panelPosition,
10544      actions: panelActions,
10545      shortcuts: api.getShortcutKeys(),
10546      ...props
10547    }
10548  );
10549}, Panel_default = Panel;
10550
10551// src/manager/container/Preview.tsx
10552init_react();
10553var import_memoizerific2 = __toESM(require_memoizerific(), 1);
10554
10555// src/manager/components/preview/Preview.tsx
10556init_react();
10557
10558// src/manager/components/preview/FramesRenderer.tsx
10559init_react();
10560
10561// src/manager/components/preview/Viewport.tsx
10562init_react();
10563
10564// src/viewport/useViewport.ts
10565init_react();
10566
vendor: 153 bytes, lines 10567-10569
10567// src/viewport/constants.ts
10568var ADDON_ID = "storybook/viewport", PARAM_KEY = "viewport", PANEL_ID = `${ADDON_ID}/panel`, TOOL_ID = `${ADDON_ID}/tool`;
10569
vendor: 577 bytes, lines 10570-10606
10570// src/viewport/defaults.ts
10571var MINIMAL_VIEWPORTS = {
10572  mobile1: {
10573    name: "Small mobile",
10574    styles: {
10575      height: "568px",
10576      width: "320px"
10577    },
10578    type: "mobile"
10579  },
10580  mobile2: {
10581    name: "Large mobile",
10582    styles: {
10583      height: "896px",
10584      width: "414px"
10585    },
10586    type: "mobile"
10587  },
10588  tablet: {
10589    name: "Tablet",
10590    styles: {
10591      height: "1112px",
10592      width: "834px"
10593    },
10594    type: "tablet"
10595  },
10596  desktop: {
10597    name: "Desktop",
10598    styles: {
10599      height: "1024px",
10600      width: "1280px"
10601    },
10602    type: "desktop"
10603  }
10604};
10605
10606// src/viewport/
10606useViewport.ts
10607var URL_VALUE_PATTERN = /^([0-9]{1,4})([a-z]{0,4})-([0-9]{1,4})([a-z]{0,4})$/, VIEWPORT_MIN_WIDTH = 40, VIEWPORT_MIN_HEIGHT = 40, cycle = (viewports, current, direction = 1) => {
10608  let keys = Object.keys(viewports), nextIndex = (current ? keys.indexOf(current) : -1) + direction;
10609  return nextIndex < 0 ? keys[keys.length - 1] : nextIndex >= keys.length ? keys[0] : keys[nextIndex];
10610}, normalizeGlobal = (value, defaultIsRotated) => typeof value == "string" ? { value, isRotated: defaultIsRotated } : { value: value?.value, isRotated: value?.isRotated ?? defaultIsRotated }, parseGlobals = (globals, storyGlobals, userGlobals, options2, lastSelectedOption, disable, viewMode) => {
10611  if (viewMode !== "story")
10612    return {
10613      name: "Responsive",
10614      type: "desktop",
10615      width: "100%",
10616      height: "100%",
10617      value: "100pct-100pct",
10618      option: void 0,
10619      isCustom: !1,
10620      isDefault: !0,
10621      isLocked: !0,
10622      isRotated: !1
10623    };
10624  let global2 = normalizeGlobal(globals?.[PARAM_KEY]), userGlobal = normalizeGlobal(userGlobals?.[PARAM_KEY]), storyGlobal = normalizeGlobal(storyGlobals?.[PARAM_KEY]), storyHasViewport = PARAM_KEY in storyGlobals, primaryGlobal = storyHasViewport ? storyGlobal : userGlobal, secondaryGlobal = storyHasViewport ? userGlobal : storyGlobal, value = primaryGlobal?.value ?? secondaryGlobal?.value ?? global2?.value, isRotated = primaryGlobal?.isRotated ?? secondaryGlobal?.isRotated ?? global2?.isRotated ?? !1, keys = Object.keys(options2), isLocked 
10624= disable || PARAM_KEY in storyGlobals || !keys.length, [match, vx, ux, vy, uy] = value?.match(URL_VALUE_PATTERN) || [];
10625  if (match) {
10626    let x2 = ux && ux !== "px" ? vx : Math.max(Number(vx), VIEWPORT_MIN_WIDTH), y2 = uy && uy !== "px" ? vy : Math.max(Number(vy), VIEWPORT_MIN_HEIGHT), width = `${x2}${ux === "pct" ? "%" : ux || "px"}`, height = `${y2}${uy === "pct" ? "%" : uy || "px"}`, selection = lastSelectedOption ? options2[lastSelectedOption] : void 0;
10627    return {
10628      name: selection?.name ?? "Custom",
10629      type: selection?.type ?? "other",
10630      width: isRotated ? height : width,
10631      height: isRotated ? width : height,
10632      value: match,
10633      option: void 0,
10634      isCustom: !0,
10635      isDefault: !1,
10636      isLocked,
10637      isRotated
10638    };
10639  }
10640  if (value && keys.length) {
10641    let { name, styles: styles2, type = "other" } = options2[value] ?? options2[keys[0]];
10642    return {
10643      name,
10644      type,
10645      width: isRotated ? styles2.height : styles2.width,
10646      height: isRotated ? styles2.width : styles2.height,
10647      value,
10648      option: value,
10649      isCustom: !1,
10650      isDefault: !1,
10651      isLocked,
10652      isRotated
10653    };
10654  }
10655  return {
10656    name: "Responsive",
10657    type: "desktop",
10658    width: "100%",
10659    height: "100%",
10660    value: "100pct-100pct",
10661    option: void 0,
10662    isCustom: !1,
10663    isDefault: !0,
10664    isLocked,
10665    isRotated: !1
10666  };
10667}, useViewport = () => {
10668  let api = useStorybookApi(), { viewMode } = api.getUrlState(), lastSelectedOption = useRef(), parameter = useParameter(PARAM_KEY), [globals, updateGlobals, storyGlobals, userGlobals] = useGlobals(), { options: options2 = MINIMAL_VIEWPORTS, disable = !1 } = parameter || {}, { name, type, width, height, value, option, isCustom, isDefault, isLocked, isRotated } = parseGlobals(
10669    globals,
10670    storyGlobals,
10671    userGlobals,
10672    options2,
10673    lastSelectedOption.current,
10674    disable,
10675    viewMode
10676  ), update2 = useCallback(
10677    (input) => updateGlobals({ [PARAM_KEY]: normalizeGlobal
vendor: 18,549 bytes, lines 10677-11214
10677(input, !1) }),
10678    [updateGlobals]
10679  ), resize = useCallback(
10680    (width2, height2) => {
10681      let w2 = width2.replace(/px$/, "").replace(/%$/, "pct"), h2 = height2.replace(/px$/, "").replace(/%$/, "pct"), value2 = isRotated ? `${h2}-${w2}` : `${w2}-${h2}`;
10682      update2({ value: value2, isRotated });
10683    },
10684    [update2, isRotated]
10685  );
10686  return useEffect(() => {
10687    parameter && option && (Object.hasOwn(options2, option) ? lastSelectedOption.current = option : (lastSelectedOption.current = void 0, PARAM_KEY in storyGlobals || update2({ value: void 0, isRotated: !1 })));
10688  }, [parameter, storyGlobals, options2, option, update2]), useEffect(() => {
10689    api.setAddonShortcut(ADDON_ID, {
10690      label: "Next viewport",
10691      defaultShortcut: ["alt", "V"],
10692      actionName: "next",
10693      action: () => update2({ value: cycle(options2, lastSelectedOption.current), isRotated })
10694    }), api.setAddonShortcut(ADDON_ID, {
10695      label: "Previous viewport",
10696      defaultShortcut: ["alt", "shift", "V"],
10697      actionName: "previous",
10698      action: () => update2({ value: cycle(options2, lastSelectedOption.current, -1), isRotated })
10699    }), api.setAddonShortcut(ADDON_ID, {
10700      label: "Reset viewport",
10701      defaultShortcut: ["alt", "control", "V"],
10702      actionName: "reset",
10703      action: () => update2({ value: void 0, isRotated: !1 })
10704    });
10705  }, [api, update2, options2, isRotated]), useMemo(
10706    () => ({
10707      name,
10708      type,
10709      width,
10710      height,
10711      value,
10712      option,
10713      isCustom,
10714      isDefault,
10715      isLocked,
10716      isRotated,
10717      options: options2,
10718      lastSelectedOption: lastSelectedOption.current,
10719      resize,
10720      reset: () => update2({ value: void 0, isRotated: !1 }),
10721      rotate: () => update2({ value, isRotated: !isRotated }),
10722      select: (value2) => update2({ value: value2, isRotated })
10723    }),
10724    [
10725      name,
10726      type,
10727      width,
10728      height,
10729      value,
10730      option,
10731      isCustom,
10732      isDefault,
10733      isRotated,
10734      isLocked,
10735      options2,
10736      resize,
10737      update2
10738    ]
10739  );
10740};
10741
10742// src/manager/components/preview/Iframe.tsx
10743init_react();
10744var StyledIframe = styled.iframe(({ theme }) => ({
10745  backgroundColor: theme.background.preview,
10746  display: "block",
10747  boxSizing: "content-box",
10748  height: "100%",
10749  width: "100%",
10750  border: "none",
10751  transition: "background-position 0s, visibility 0s",
10752  backgroundPosition: "-1px -1px, -1px -1px, -1px -1px, -1px -1px",
10753  margin: "auto"
10754}));
10755function IFrame(props) {
10756  let { active, id, title: title2, src, allowFullScreen, scale, ...rest2 } = props, iFrameRef = react_default.useRef(null);
10757  return react_default.createElement(Zoom.IFrame, { scale, active, iFrameRef }, react_default.createElement(
10758    StyledIframe,
10759    {
10760      "data-is-storybook": active ? "true" : "false",
10761      onLoad: (e2) => e2.currentTarget.setAttribute("data-is-loaded", "true"),
10762      id,
10763      title: title2,
10764      src,
10765      allow: "clipboard-write;",
10766      allowFullScreen,
10767      ref: iFrameRef,
10768      ...rest2
10769    }
10770  ));
10771}
10772
10773// src/manager/components/preview/NumericInput.tsx
10774init_react();
10775var Wrapper = styled.div(
10776  ({ after: after2, before: before2, theme }) => ({
10777    position: "relative",
10778    display: "flex",
10779    alignItems: "center",
10780    width: "100%",
10781    height: 32,
10782    paddingInline: 9,
10783    fontSize: theme.typography.size.s1,
10784    color: theme.textMutedColor,
10785    background: theme.input.background,
10786    boxShadow: `${theme.input.border} 0 0 0 1px inset`,
10787    borderRadius: theme.input.borderRadius,
10788    svg: {
10789      display: "block"
10790    },
10791    input: {
10792      width: "100%",
10793      height: "100%",
10794      minHeight: "100%",
10795      flex: "1 1 auto",
10796      paddingInline: 0,
10797      fontSize: "inherit",
10798      background: "transparent",
10799      border: "none",
10800      boxShadow: "none",
10801      color: theme.input.color,
10802      "&:focus, &:focus-visible": {
10803        boxShadow: "none",
10804        outline: "none"
10805      }
10806    },
10807    "input:disabled": {
10808      background: "transparent"
10809    },
10810    "input + div": {
10811      paddingInline: 0,
10812      fontSize: "inherit"
10813    },
10814    "&:has(input:focus-visible)": {
10815      outline: `2px solid ${theme.color.secondary}`,
10816      outlineOffset: -2
10817    },
10818    "&:has(input:disabled)": {
10819      background: theme.base === "light" ? theme.color.lighter : theme.input.background,
10820      cursor: "not-allowed"
10821    },
10822    ...after2 && { paddingRight: 2 },
10823    ...before2 && { paddingLeft: 2 }
10824  })
10825), NumericInput = forwardRef(function({
10826  label,
10827  before: before2,
10828  after: after2,
10829  value,
10830  setValue,
10831  minValue = -1 / 0,
10832  maxValue = 1 / 0,
10833  step = 1,
10834  unit: fixedUnit,
10835  baseUnit = fixedUnit,
10836  className,
10837  style,
10838  ...props
10839}, forwardedRef) {
10840  let baseUnitRegex = useMemo(() => baseUnit && new RegExp(`${baseUnit}$`), [baseUnit]), inputId = $bdb11010cef70236$export$f680877a34711e37(), inputRef = useRef(null), [inputValue, setInputValue] = useState(
10841    baseUnitRegex ? value.replace(baseUnitRegex, "") : value
10842  ), id = props.id || inputId;
10843  useImperativeHandle(forwardedRef, () => inputRef.current);
10844  let parseValue = useCallback(
10845    (value2) => {
10846      let [, inputValue2, unit = fixedUnit || baseUnit || ""] = value2.match(/(-?\d+(?:\.\d+)?)(\%|[a-z]{1,4})?$/) || [];
10847      return { number: Math.max(minValue, Math.min(parseFloat(inputValue2), maxValue)), unit };
10848    },
10849    [minValue, maxValue, fixedUnit, baseUnit]
10850  ), updateValue = useCallback(
10851    (value2) => {
10852      let { number, unit } = parseValue(value2);
10853      Number.isNaN(number) ? setInputValue(value2) : (setInputValue(`${number}${unit === baseUnit ? "" : unit}`), setValue(`${number}${unit}`));
10854    },
10855    [parseValue, setValue, baseUnit]
10856  ), onChange = useCallback(
10857    (e2) => updateValue(e2.target.value),
10858    [updateValue]
10859  ), setInputSelection = useCallback(() => {
10860    requestAnimationFrame(() => {
10861      let input = inputRef.current, index = input?.value.search(/[^-\d.]/) ?? -1;
10862      input && index >= 0 && input.setSelectionRange(index, index);
10863    });
10864  }, []), updateInputValue = useCallback(
10865    () => setInputValue(baseUnitRegex ? value.replace(baseUnitRegex, "") : value),
10866    [value, baseUnitRegex]
10867  );
10868  return useEffect(() => {
10869    inputRef.current !== document.activeElement && updateInputValue();
10870  }, [updateInputValue]), useEffect(() => {
10871    let handleKeyDown = (e2) => {
10872      if (e2.key !== "ArrowUp" && e2.key !== "ArrowDown")
10873        return;
10874      e2.preventDefault();
10875      let { number, unit } = parseValue(inputValue);
10876      if (!Number.isNaN(number)) {
10877        let delta = e2.shiftKey ? step * 10 : step;
10878        updateValue(`${e2.key === "ArrowUp" ? number + delta : number - delta}${unit}`), setInputSelection();
10879      }
10880    }, input = inputRef.current;
10881    if (input)
10882      return input.addEventListener("keydown", handleKeyDown), () => input.removeEventListener("keydown", handleKeyDown);
10883  }, [inputValue, parseValue, setInputSelection, step, updateValue]), react_default.createElement(Wrapper, { after: after2, before: before2, className, style }, before2 && react_default.createElement("div", null, before2), label && react_default.createElement("label", { htmlFor: id, className: "sb-sr-only" }, label), react_default.createElement(
10884    Form.Input,
10885    {
10886      ...props,
10887      id,
10888      ref: inputRef,
10889      value: inputValue,
10890      suffix: fixedUnit || inputValue && baseUnit,
10891      onChange,
10892      onFocus: setInputSelection,
10893      onBlur: updateInputValue
10894    }
10895  ), after2 && react_default.createElement("div", null, after2));
10896});
10897
10898// src/manager/components/preview/Viewport.tsx
10899var ViewportWrapper = styled.div(({ active, isDefault, theme }) => ({
10900  gridArea: "1 / 1",
10901  alignSelf: "start",
10902  justifySelf: "start",
10903  display: active ? "inline-flex" : "none",
10904  flexDirection: "column",
10905  gap: 6,
10906  width: "100%",
10907  height: "100%",
10908  paddingTop: isDefault ? 0 : 6,
10909  paddingBottom: isDefault ? 0 : 40,
10910  paddingInline: isDefault ? 0 : 40,
10911  '&:has([data-size-input="width"]:focus-visible)': {
10912    "[data-dragging]": {
10913      borderRightColor: theme.color.secondary,
10914      boxShadow: `4px 0 5px -2px ${theme.background.hoverable}`
10915    }
10916  },
10917  '&:has([data-size-input="height"]:focus-visible)': {
10918    "[data-dragging]": {
10919      borderBottomColor: theme.color.secondary,
10920      boxShadow: `0 4px 5px -2px ${theme.background.hoverable}`
10921    }
10922  }
10923})), ViewportControls = styled.div({
10924  display: "flex",
10925  gap: 6
10926}), ViewportDimensions = styled.div({
10927  display: "flex",
10928  gap: 2
10929}), FrameWrapper = styled.div(({ isDefault, "data-dragging": dragging, theme }) => ({
10930  position: "relative",
10931  minWidth: VIEWPORT_MIN_WIDTH,
10932  minHeight: VIEWPORT_MIN_HEIGHT,
10933  boxSizing: "content-box",
10934  // we're sizing the contents, not the box itself
10935  border: `1px solid ${theme.button.border}`,
10936  borderWidth: isDefault ? 0 : 1,
10937  borderRadius: isDefault ? 0 : 4,
10938  transition: "border-color 0.2s, box-shadow 0.2s",
10939  '&:has([data-side="right"]:hover), &[data-dragging="right"]': {
10940    borderRightColor: theme.color.secondary,
10941    boxShadow: `4px 0 5px -2px ${theme.background.hoverable}`,
10942    '[data-side="right"]::after': {
10943      opacity: 1
10944    }
10945  },
10946  '&:has([data-side="bottom"]:hover), &[data-dragging="bottom"]': {
10947    borderBottomColor: theme.color.secondary,
10948    boxShadow: `0 4px 5px -2px ${theme.background.hoverable}`,
10949    '[data-side="bottom"]::after': {
10950      opacity: 1
10951    }
10952  },
10953  '&:has([data-side="both"]:hover), &[data-dragging="both"]': {
10954    boxShadow: `3px 3px 5px -2px ${theme.background.hoverable}`,
10955    "&::after, [data-side]::after": {
10956      opacity: 1
10957    }
10958  },
10959  "&::after": {
10960    content: '""',
10961    display: "block",
10962    position: "absolute",
10963    pointerEvents: "none",
10964    bottom: 1,
10965    right: 1,
10966    width: 12,
10967    height: 12,
10968    opacity: 0,
10969    transition: "opacity 0.2s",
10970    background: `linear-gradient(to top left,
10971      rgba(0,0,0,0) 0%,
10972      rgba(0,0,0,0) calc(25% - 1px),
10973      ${theme.color.secondary} 25%,
10974      rgba(0,0,0,0) calc(25% + 1px),
10975      rgba(0,0,0,0) calc(45% - 1px),
10976      ${theme.color.secondary} 45%,
10977      rgba(0,0,0,0) calc(45% + 1px),
10978      rgba(0,0,0,0) 100%)`
10979  },
10980  iframe: {
10981    pointerEvents: dragging === "none" ? "auto" : "none"
10982  }
10983})), DragHandle2 = styled.div(
10984  { display: "none" },
10985  ({ theme, isDefault }) => !isDefault && {
10986    display: "block",
10987    position: "absolute",
10988    fontSize: 10,
10989    '&[data-side="both"]': {
10990      right: -12,
10991      bottom: -12,
10992      width: 25,
10993      height: 25,
10994      cursor: "nwse-resize"
10995    },
10996    '&[data-side="bottom"]': {
10997      left: 0,
10998      right: 13,
10999      bottom: -12,
11000      height: 20,
11001      cursor: "row-resize",
11002      "&::after": {
11003        content: "attr(data-value)",
11004        position: "absolute",
11005        top: "50%",
11006        left: "50%",
11007        transform: "translate(-50%, -50%)",
11008        borderRadius: 4,
11009        backgroundColor: theme.background.hoverable,
11010        padding: "2px 4px",
11011        opacity: 0,
11012        transition: "opacity 0.2s"
11013      }
11014    },
11015    '&[data-side="right"]': {
11016      top: 0,
11017      right: -12,
11018      bottom: 13,
11019      width: 20,
11020      cursor: "col-resize",
11021      "&::after": {
11022        content: "attr(data-value)",
11023        position: "absolute",
11024        top: "50%",
11025        left: "50%",
11026        transform: "translate(-50%, -50%)",
11027        borderRadius: 4,
11028        backgroundColor: theme.background.hoverable,
11029        padding: "2px 4px",
11030        opacity: 0,
11031        transition: "opacity 0.2s"
11032      }
11033    }
11034  }
11035), ScrollEdge = styled.div({
11036  position: "absolute",
11037  pointerEvents: "none",
11038  width: 0,
11039  height: 0,
11040  '&[data-edge="right"]': {
11041    right: -40,
11042    height: "100%"
11043  },
11044  '&[data-edge="bottom"]': {
11045    bottom: -40,
11046    width: "100%"
11047  },
11048  '&[data-edge="both"]': {
11049    right: -40,
11050    bottom: -40
11051  }
11052}), SizeInput = styled(NumericInput)({
11053  width: 85,
11054  height: 28,
11055  minHeight: 28
11056}), Viewport = ({
11057  active,
11058  id,
11059  src,
11060  scale
11061}) => {
11062  let { width, height, isCustom, isDefault, lastSelectedOption, resize, rotate, select } = useViewport(), [dragging, setDragging] = useState("none"), targetRef = useRef(null), dragRefX = useRef(null), dragRefY = useRef(null), dragRefXY = useRef(null), dragSide = useRef("none"), dragStart = useRef(), dragScrollTarget = useRef(null);
11063  useEffect(() => {
11064    let onDrag = (e2) => {
11065      if (!(!targetRef.current || !dragStart.current)) {
11066        if (dragRefX.current && (dragSide.current === "both" || dragSide.current === "right")) {
11067          let newWidth = Math.max(VIEWPORT_MIN_WIDTH, dragStart.current[0] + e2.clientX);
11068          targetRef.current.style.width = `${newWidth}px`, dragRefX.current.dataset.value = `${Math.round(newWidth / scale)}`;
11069        }
11070        if (dragRefY.current && (dragSide.current === "both" || dragSide.current === "bottom")) {
11071          let newHeight = Math.max(VIEWPORT_MIN_HEIGHT, dragStart.current[1] + e2.clientY);
11072          targetRef.current.style.height = `${newHeight}px`, dragRefY.current.dataset.value = `${Math.round(newHeight / scale)}`;
11073        }
11074        dragScrollTarget.current && dragScrollTarget.current.scrollIntoView({ block: "center", inline: "center" });
11075      }
11076    }, onEnd = () => {
11077      if (window.removeEventListener("mouseup", onEnd), window.removeEventListener("mousemove", onDrag), setDragging("none"), dragStart.current = void 0, targetRef.current) {
11078        let { clientWidth, clientHeight, dataset } = targetRef.current, scale2 = Number(dataset.scale) || 1;
11079        resize(`${Math.round(clientWidth / scale2)}px`, `${Math.round(clientHeight / scale2)}px`);
11080      }
11081    }, onStart = (e2) => {
11082      e2.preventDefault(), window.addEventListener("mouseup", onEnd), window.addEventListener("mousemove", onDrag), dragSide.current = e2.currentTarget.dataset.side, dragStart.current = [
11083        (targetRef.current?.clientWidth ?? 0) - e2.clientX,
11084        (targetRef.current?.clientHeight ?? 0) - e2.clientY
11085      ], dragScrollTarget.current = targetRef.current?.querySelector(
11086        `[data-edge="${dragSide.current}"]`
11087      ), setDragging(dragSide.current);
11088    }, handles = [dragRefX.current, dragRefY.current, dragRefXY.current];
11089    return handles.forEach((el) => el?.addEventListener("mousedown", onStart)), () => handles.forEach((el) => el?.removeEventListener("mousedown", onStart));
11090  }, [resize, scale]);
11091  let dimensions = useMemo(() => {
11092    let [, nx = "", ux = "px"] = width.match(/^(\d+(?:\.\d+)?)(\%|[a-z]{1,4})?$/) || [], [, ny = "", uy = "px"] = height.match(/^(\d+(?:\.\d+)?)(\%|[a-z]{1,4})?$/) || [];
11093    return {
11094      frame: {
11095        width: `calc(${width} * ${scale})`,
11096        height: `calc(${height} * ${scale})`
11097      },
11098      display: {
11099        width: `${nx || width}${ux === "px" ? "" : ux}`,
11100        height: `${ny || height}${uy === "px" ? "" : uy}`
11101      },
11102      locked: {
11103        width: !nx || !ny,
11104        height: !nx || !ny
11105      }
11106    };
11107  }, [width, height, scale]);
11108  return react_default.createElement(ViewportWrapper, { key: id, active, isDefault }, !isDefault && react_default.createElement(ViewportControls, null, react_default.createElement(ViewportDimensions, null, react_default.createElement(
11109    SizeInput,
11110    {
11111      "aria-label": "Viewport width",
11112      "data-size-input": "width",
11113      label: "Viewport width",
11114      before: react_default.createElement(ActionList.Action, { size: "small", readOnly: !0, "aria-hidden": !0 }, "W"),
11115      value: width,
11116      minValue: 0,
11117      setValue: (value) => resize(value, height),
11118      disabled: dimensions.locked.width
11119    }
11120  ), react_default.createElement(
11121    ActionList.Button,
11122    {
11123      key: "viewport-rotate",
11124      size: "small",
11125      padding: "small",
11126      ariaLabel: "Rotate viewport",
11127      onClick: rotate
11128    },
11129    react_default.createElement(TransferIcon, null)
11130  ), react_default.createElement(
11131    SizeInput,
11132    {
11133      "aria-label": "Viewport height",
11134      "data-size-input": "height",
11135      label: "Viewport height",
11136      before: react_default.createElement(ActionList.Action, { size: "small", readOnly: !0, "aria-hidden": !0 }, "H"),
11137      value: height,
11138      minValue: 0,
11139      setValue: (value) => resize(width, value),
11140      disabled: dimensions.locked.height
11141    }
11142  ), isCustom && lastSelectedOption && react_default.createElement(
11143    ActionList.Button,
11144    {
11145      key: "viewport-restore",
11146      size: "small",
11147      padding: "small",
11148      ariaLabel: "Restore viewport",
11149      onClick: () => select(lastSelectedOption)
11150    },
11151    react_default.createElement(UndoIcon, null)
11152  ))), react_default.createElement(
11153    FrameWrapper,
11154    {
11155      isDefault,
11156      "data-dragging": dragging,
11157      "data-scale": scale,
11158      style: isDefault ? { height: "100%", width: "100%" } : dimensions.frame,
11159      ref: targetRef
11160    },
11161    react_default.createElement(
11162      "div",
11163      {
11164        style: {
11165          height: `${1 / scale * 100}%`,
11166          width: `${1 / scale * 100}%`,
11167          transform: scale !== 1 ? `scale(${scale})` : "none",
11168          transformOrigin: "top left"
11169        }
11170      },
11171      react_default.createElement(IFrame, { allowFullScreen: !0, active, key: id, id, title: id, src, scale: 1 }),
11172      !isDefault && react_default.createElement(react_default.Fragment, null, react_default.createElement(ScrollEdge, { "data-edge": "right" }), react_default.createElement(ScrollEdge, { "data-edge": "bottom" }), react_default.createElement(ScrollEdge, { "data-edge": "both" }))
11173    ),
11174    !dimensions.locked.width && react_default.createElement(
11175      DragHandle2,
11176      {
11177        ref: dragRefX,
11178        isDefault,
11179        "data-side": "right",
11180        "data-value": dimensions.display.width
11181      }
11182    ),
11183    !dimensions.locked.height && react_default.createElement(
11184      DragHandle2,
11185      {
11186        ref: dragRefY,
11187        isDefault,
11188        "data-side": "bottom",
11189        "data-value": dimensions.display.height
11190      }
11191    ),
11192    !dimensions.locked.width && !dimensions.locked.height && react_default.createElement(DragHandle2, { ref: dragRefXY, isDefault, "data-side": "both" })
11193  ));
11194};
11195
11196// src/manager/components/preview/FramesRenderer.tsx
11197var getActive = (refId, refs) => refId && refs[refId] ? `storybook-ref-${refId}` : "storybook-preview-iframe", SkipToSidebarLink = styled(Button)(({ theme }) => ({
11198  display: "none",
11199  "@media (min-width: 600px)": {
11200    position: "absolute",
11201    display: "block",
11202    top: 10,
11203    right: 15,
11204    padding: "10px 15px",
11205    fontSize: theme.typography.size.s1,
11206    transform: "translateY(-100px)",
11207    "&:focus": {
11208      transform: "translateY(0)",
11209      zIndex: 1
11210    }
11211  }
11212})), whenSidebarIsVisible = ({ api, state }) => ({
11213  isFullscreen: api.getIsFullscreen(),
11214  isNavShown: api.get
vendor: 2,412 bytes, lines 11214-11263
11214IsNavShown(),
11215  selectedStoryId: state.storyId
11216}), styles = {
11217  '#root [data-is-storybook="false"]': {
11218    display: "none"
11219  },
11220  '#root [data-is-storybook="true"]': {
11221    display: "block"
11222  }
11223}, FramesRenderer = ({
11224  api,
11225  refs,
11226  scale,
11227  viewMode = "story",
11228  refId,
11229  queryParams = {},
11230  storyId = "*"
11231}) => {
11232  let version3 = refs[refId]?.version, active = getActive(refId, refs), { current: frames } = useRef({}), refsToLoad = Object.values(refs).filter((ref) => ref.type === "auto-inject" || ref.id === refId, {});
11233  return frames["storybook-preview-iframe"] || (frames["storybook-preview-iframe"] = api.getStoryHrefs(storyId, {
11234    queryParams: { ...queryParams, ...version3 && { version: version3 } },
11235    refId,
11236    viewMode
11237  }).previewHref), refsToLoad.forEach((ref) => {
11238    let id = `storybook-ref-${ref.id}`;
11239    frames[id]?.startsWith(`${ref.url.replace(/\/?$/, "/")}iframe.html`) || (frames[id] = api.getStoryHrefs(storyId, {
11240      queryParams: { ...queryParams, ...version3 && { version: version3 } },
11241      refId: ref.id,
11242      viewMode
11243    }).previewHref);
11244  }), react_default.createElement(Fragment, null, react_default.createElement(Global, { styles }), react_default.createElement(Consumer, { filter: whenSidebarIsVisible }, ({ isFullscreen, isNavShown, selectedStoryId }) => isFullscreen || !isNavShown || !selectedStoryId ? null : react_default.createElement(SkipToSidebarLink, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: `#${selectedStoryId}`, tabIndex: 0 }, "Skip to sidebar"))), Object.entries(frames).map(([id, src]) => react_default.createElement(Viewport, { key: id, id, src, active: id === active, scale })));
11245};
11246
11247// src/manager/components/preview/Toolbar.tsx
11248init_react();
11249var fullScreenMapper = ({ api, state }) => ({
11250  toggle: api.toggleFullscreen,
11251  isFullscreen: api.getIsFullscreen(),
11252  shortcut: api.getShortcutKeys().fullScreen,
11253  hasPanel: Object.keys(api.getElements(Addon_TypesEnum.PANEL)).length > 0,
11254  singleStory: state.singleStory
11255}), fullScreenTool = {
11256  title: "fullscreen",
11257  id: "fullscreen",
11258  type: types.TOOL,
11259  // @ts-expect-error (non strict)
11260  match: (p2) => ["story", "docs"].includes(p2.viewMode),
11261  render: () => {
11262    let { isMobile: isMobile2 } = useLayout();
11263    return isMobile2 ? null : react_default.createElement(Consumer, { filter: fullScreenMapper }, ({ toggle, isFullscreen, shortcut, hasPanel, singleStory }) =>
vendor: 3,578 bytes, lines 11263-11365
11263 (!singleStory || singleStory && hasPanel) && react_default.createElement(
11264      Button,
11265      {
11266        key: "full",
11267        padding: "small",
11268        variant: "ghost",
11269        onClick: () => toggle(),
11270        ariaLabel: isFullscreen ? "Exit full screen" : "Enter full screen",
11271        shortcut
11272      },
11273      isFullscreen ? react_default.createElement(CloseIcon, null) : react_default.createElement(ExpandIcon, null)
11274    ));
11275  }
11276}, ToolbarComp = react_default.memo(function({
11277  isShown,
11278  tools,
11279  toolsExtra,
11280  tabs,
11281  tabState
11282}) {
11283  let sectionRef = useRef(null), { landmarkProps } = useLandmark(
11284    { "aria-labelledby": "sb-preview-toolbar-title", role: "region" },
11285    sectionRef
11286  );
11287  return isShown && (tabs || tools || toolsExtra) ? react_default.createElement(
11288    StyledSection,
11289    {
11290      className: "sb-bar",
11291      key: "toolbar",
11292      "data-testid": "sb-preview-toolbar",
11293      ref: sectionRef,
11294      ...landmarkProps
11295    },
11296    react_default.createElement("h2", { id: "sb-preview-toolbar-title", className: "sb-sr-only" }, "Toolbar"),
11297    tabs.length > 1 ? react_default.createElement(react_default.Fragment, null, react_default.createElement(TabList, { state: tabState }), react_default.createElement(Separator, null)) : null,
11298    react_default.createElement(StyledToolbar, null, react_default.createElement(Tools, { key: "left", list: tools }), react_default.createElement(Tools, { key: "right", list: toolsExtra }))
11299  ) : null;
11300}), Tools = react_default.memo(function({ list }) {
11301  return react_default.createElement(ToolGroup, null, list.filter(Boolean).map(({ render: Render, id, ...t2 }, index) => (
11302    // @ts-expect-error (Converted from ts-ignore)
11303    react_default.createElement(Render, { key: id || t2.key || `f-${index}` })
11304  )));
11305});
11306function toolbarItemHasBeenExcluded(item, entry) {
11307  let parameters = entry?.type === "story" && entry?.prepared ? entry?.parameters : {}, toolbarItemsFromStoryParameters = "toolbar" in parameters ? parameters.toolbar : void 0, { toolbar: toolbarItemsFromAddonsConfig } = addons.getConfig(), toolbarItems = merge(
11308    toolbarItemsFromAddonsConfig || {},
11309    toolbarItemsFromStoryParameters || {}
11310  );
11311  return toolbarItems ? !!toolbarItems[item?.id]?.hidden : !1;
11312}
11313function filterToolsSide(tools, entry, viewMode, location2, path, tabId) {
11314  let filter = (item) => item && (!item.match || item.match({
11315    storyId: entry?.id,
11316    refId: entry?.refId,
11317    viewMode,
11318    location: location2,
11319    path,
11320    tabId
11321  })) && !toolbarItemHasBeenExcluded(item, entry);
11322  return tools.filter(filter);
11323}
11324var StyledSection = styled.section(({ theme }) => ({
11325  position: "relative",
11326  display: "flex",
11327  alignItems: "center",
11328  color: theme.barTextColor,
11329  width: "100%",
11330  flexShrink: 0,
11331  overflowX: "auto",
11332  overflowY: "hidden",
11333  boxShadow: `${theme.appBorderColor}  0 -1px 0 0 inset`,
11334  background: theme.barBg,
11335  scrollbarColor: `${theme.barTextColor} ${theme.barBg}`,
11336  scrollbarWidth: "thin",
11337  zIndex: 4
11338})), StyledToolbar = styled(AbstractToolbar)({
11339  flex: 1,
11340  display: "flex",
11341  justifyContent: "space-between",
11342  flexWrap: "nowrap",
11343  flexShrink: 0,
11344  height: 40,
11345  marginInline: 10,
11346  gap: 30
11347}), ToolGroup = styled.div({
11348  display: "flex",
11349  whiteSpace: "nowrap",
11350  flexBasis: "auto",
11351  gap: 6,
11352  alignItems: "center"
11353});
11354
11355// src/manager/components/preview/Wrappers.tsx
11356init_react();
11357
11358// src/manager/components/preview/utils/components.ts
11359var PreviewContainer = styled.div({
11360  display: "flex",
11361  flexDirection: "column",
11362  width: "100%",
11363  height: "100%",
11364  overflow: "hidden"
11365}), FrameWrap = styled.main(
11365{
11366  overflow: "auto",
11367  width: "100%",
11368  zIndex: 3,
11369  background: "transparent",
11370  flex: 1
11371}), CanvasWrap = styled.div(
11372  {
11373    alignContent: "center",
11374    alignItems: "center",
11375    justifyContent: "center",
11376    justifyItems: "center",
11377    overflow: "auto",
11378    gridTemplateColumns: "100%",
11379    gridTemplateRows: "100%",
11380    position: "relative",
11381    minWidth: "100%",
11382    minH
vendor: 2,139 bytes, lines 11382-11458
11382eight: "100%"
11383  },
11384  ({ show }) => ({ display: show ? "grid" : "none" })
11385), UnstyledLink = styled(Link2)({
11386  color: "inherit",
11387  textDecoration: "inherit",
11388  display: "inline-block"
11389}), DesktopOnly = styled.span({
11390  // Hides full screen icon at mobile breakpoint defined in app.js
11391  "@media (max-width: 599px)": {
11392    display: "none"
11393  }
11394}), IframeWrapper = styled.div(({ theme }) => ({
11395  alignContent: "center",
11396  alignItems: "center",
11397  justifyContent: "center",
11398  justifyItems: "center",
11399  overflow: "auto",
11400  display: "grid",
11401  gridTemplateColumns: "100%",
11402  gridTemplateRows: "100%",
11403  position: "relative",
11404  width: "100%",
11405  height: "100%"
11406})), LoaderWrapper = styled.div(({ theme }) => ({
11407  position: "absolute",
11408  top: 0,
11409  left: 0,
11410  bottom: 0,
11411  right: 0,
11412  background: theme.background.preview,
11413  zIndex: 1
11414}));
11415
11416// src/manager/components/preview/Wrappers.tsx
11417var ApplyWrappers = ({
11418  wrappers,
11419  id,
11420  storyId,
11421  children
11422}) => react_default.createElement(Fragment, null, wrappers.reduceRight(
11423  (acc, wrapper, index) => react_default.createElement(wrapper.render, { index, children: acc, id, storyId }),
11424  children
11425)), defaultWrappers = [
11426  {
11427    id: "iframe-wrapper",
11428    type: Addon_TypesEnum.PREVIEW,
11429    render: (p2) => react_default.createElement(IframeWrapper, { id: "storybook-preview-wrapper" }, p2.children)
11430  }
11431];
11432
11433// src/manager/components/preview/tools/zoom.tsx
11434init_react();
11435
11436// src/manager/components/Shortcut.tsx
11437init_react();
11438var Wrapper2 = styled.span(({ theme }) => ({
11439  display: "inline-flex",
11440  alignItems: "center",
11441  justifyContent: "center",
11442  height: 16,
11443  fontSize: "11px",
11444  fontWeight: theme.typography.weight.regular,
11445  background: theme.base === "light" ? "rgba(0,0,0,0.05)" : "rgba(255,255,255,0.05)",
11446  color: theme.base === "light" ? theme.color.dark : theme.textMutedColor,
11447  borderRadius: 2,
11448  userSelect: "none",
11449  pointerEvents: "none",
11450  padding: "0 4px"
11451})), Key = styled.kbd(({ theme }) => ({
11452  padding: 0,
11453  fontFamily: theme.typography.fonts.base,
11454  verticalAlign: "middle",
11455  "& + &": {
11456    marginLeft: 6
11457  }
11458})), Shortcut = ({ keys }) => react_default.createElement(Wrapper2, null, 
11458keys
vendor: 7,469 bytes, lines 11458-11627
11458.map((key) => react_default.createElement(Key, { key }, shortcutToHumanString([key]))));
11459
11460// src/manager/components/preview/tools/zoom.tsx
11461var ZOOM_LEVELS = [0.25, 0.5, 0.75, 0.9, 1, 1.1, 1.25, 1.5, 2, 3, 4, 8], INITIAL_ZOOM_LEVEL = 1, ZoomButton = styled(ToggleButton)({
11462  minWidth: 48
11463}), ZoomResetButton = styled(ActionList.Button)(
11464  ({ $isInitialValue }) => ({
11465    visibility: $isInitialValue ? "hidden" : void 0
11466  })
11467), Context = createContext({ value: INITIAL_ZOOM_LEVEL, set: (v2) => {
11468} }), ZoomInput = styled(NumericInput)({
11469  input: {
11470    width: 100
11471  }
11472}), ZoomConsumer = Context.Consumer, ZoomProvider = class extends Component {
11473  constructor() {
11474    super(...arguments);
11475    this.state = {
11476      value: INITIAL_ZOOM_LEVEL
11477    };
11478    this.set = (value) => this.setState({ value });
11479  }
11480  render() {
11481    let { children, shouldScale } = this.props, { set } = this, { value } = this.state;
11482    return react_default.createElement(Context.Provider, { value: { value: shouldScale ? value : INITIAL_ZOOM_LEVEL, set } }, children);
11483  }
11484}, Zoom2 = memo(function({ value, zoomIn, zoomOut, zoomTo, zoomBy }) {
11485  let inputRef = useRef(null);
11486  return react_default.createElement(
11487    PopoverProvider,
11488    {
11489      padding: "none",
11490      onVisibleChange: (isVisible) => {
11491        isVisible && requestAnimationFrame(() => inputRef.current?.select());
11492      },
11493      popover: react_default.createElement(react_default.Fragment, null, react_default.createElement(ActionList, null, react_default.createElement(ActionList.Item, null, react_default.createElement(
11494        ZoomInput,
11495        {
11496          "aria-label": "Zoom percentage",
11497          ref: inputRef,
11498          unit: "%",
11499          before: react_default.createElement(ActionList.Button, { size: "small", padding: "small", readOnly: !0, "aria-hidden": !0 }, react_default.createElement(ZoomIcon, null)),
11500          after: react_default.createElement(
11501            ZoomResetButton,
11502            {
11503              size: "small",
11504              padding: "small",
11505              $isInitialValue: value === INITIAL_ZOOM_LEVEL,
11506              onClick: () => zoomTo(INITIAL_ZOOM_LEVEL),
11507              ariaLabel: "Reset zoom",
11508              "aria-hidden": value === INITIAL_ZOOM_LEVEL
11509            },
11510            react_default.createElement(UndoIcon, null)
11511          ),
11512          value: `${Math.round(value * 100)}%`,
11513          minValue: 1,
11514          maxValue: 800,
11515          setValue: (value2) => {
11516            let zoomLevel = parseInt(value2, 10) / 100;
11517            Number.isNaN(zoomLevel) || zoomTo(zoomLevel);
11518          }
11519        }
11520      ))), react_default.createElement(ActionList, null, react_default.createElement(ActionList.Item, null, react_default.createElement(
11521        ActionList.Action,
11522        {
11523          onClick: zoomIn,
11524          ariaLabel: "Zoom in",
11525          disabled: value >= ZOOM_LEVELS.at(-1)
11526        },
11527        react_default.createElement(ActionList.Text, null, "Zoom in"),
11528        react_default.createElement(Shortcut, { keys: ["alt", "+"] })
11529      )), react_default.createElement(ActionList.Item, null, react_default.createElement(
11530        ActionList.Action,
11531        {
11532          onClick: zoomOut,
11533          ariaLabel: "Zoom out",
11534          disabled: value <= ZOOM_LEVELS.at(0)
11535        },
11536        react_default.createElement(ActionList.Text, null, "Zoom out"),
11537        react_default.createElement(Shortcut, { keys: ["alt", "-"] })
11538      )), react_default.createElement(ActionList.Item, { active: value === 0.5 }, react_default.createElement(ActionList.Action, { onClick: () => zoomTo(0.5), ariaLabel: "Zoom to 50%" }, react_default.createElement(ActionList.Text, null, "50%"))), react_default.createElement(ActionList.Item, { active: value === 1 }, react_default.createElement(ActionList.Action, { onClick: () => zoomTo(1), ariaLabel: "Zoom to 100%" }, react_default.createElement(ActionList.Text, null, "100%"), react_default.createElement(Shortcut, { keys: ["alt", "0"] }))), react_default.createElement(ActionList.Item, { active: value === 2 }, react_default.createElement(ActionList.Action, { onClick: () => zoomTo(2), ariaLabel: "Zoom to 200%" }, "200%"))))
11539    },
11540    react_default.createElement(
11541      ZoomButton,
11542      {
11543        padding: "small",
11544        variant: "ghost",
11545        ariaLabel: "Change zoom level",
11546        pressed: value !== INITIAL_ZOOM_LEVEL,
11547        onKeyDown: (e2) => {
11548          e2.key === "ArrowDown" ? (zoomBy(e2.getModifierState("Shift") ? -0.1 : -0.01), e2.preventDefault()) : e2.key === "ArrowUp" ? (zoomBy(e2.getModifierState("Shift") ? 0.1 : 0.01), e2.preventDefault()) : e2.key === "PageDown" ? (zoomOut(), e2.preventDefault()) : e2.key === "PageUp" ? (zoomIn(), e2.preventDefault()) : e2.key === "Home" ? (zoomTo(ZOOM_LEVELS[ZOOM_LEVELS.length - 1]), e2.preventDefault()) : e2.key === "End" && (zoomTo(ZOOM_LEVELS[0]), e2.preventDefault());
11549        },
11550        onWheel: (e2) => {
11551          e2.deltaY < 0 ? zoomIn() : e2.deltaY > 0 && zoomOut(), e2.preventDefault();
11552        }
11553      },
11554      Math.round(value * 100),
11555      "%"
11556    )
11557  );
11558}), ZoomWrapper = memo(function({ set, value }) {
11559  let api = useStorybookApi(), zoomIn = useCallback(() => {
11560    let higherZoomLevel = ZOOM_LEVELS.find((level) => level > value);
11561    higherZoomLevel && set(higherZoomLevel);
11562  }, [set, value]), zoomOut = useCallback(() => {
11563    let lowerZoomLevel = ZOOM_LEVELS.findLast((level) => level < value);
11564    lowerZoomLevel && set(lowerZoomLevel);
11565  }, [set, value]), zoomBy = useCallback(
11566    (delta) => {
11567      let min = ZOOM_LEVELS[0], max = ZOOM_LEVELS[ZOOM_LEVELS.length - 1];
11568      set(Math.max(min, Math.min(max, value + delta)));
11569    },
11570    [set, value]
11571  ), zoomTo = useCallback(
11572    (value2) => {
11573      set(value2);
11574    },
11575    [set]
11576  );
11577  return useEffect(() => {
11578    api.setAddonShortcut("zoom", {
11579      label: "Zoom to 100%",
11580      defaultShortcut: ["alt", "0"],
11581      actionName: "zoomReset",
11582      action: () => zoomTo(1)
11583    }), api.setAddonShortcut("zoom", {
11584      label: "Zoom in",
11585      defaultShortcut: ["alt", "="],
11586      actionName: "zoomIn",
11587      action: zoomIn
11588    }), api.setAddonShortcut("zoom", {
11589      label: "Zoom in",
11590      defaultShortcut: ["alt", "+"],
11591      actionName: "zoomPlus",
11592      action: zoomIn
11593    }), api.setAddonShortcut("zoom", {
11594      label: "Zoom out",
11595      defaultShortcut: ["alt", "-"],
11596      actionName: "zoomOut",
11597      action: zoomOut
11598    });
11599  }, [api, zoomIn, zoomOut, zoomTo]), react_default.createElement(Zoom2, { key: "zoom", value, zoomIn, zoomOut, zoomTo, zoomBy });
11600}), zoomTool = {
11601  title: "zoom",
11602  id: "zoom",
11603  type: types.TOOL,
11604  match: ({ viewMode, tabId }) => viewMode === "story" && !tabId,
11605  render: () => react_default.createElement(ZoomConsumer, null, (zoomContext) => react_default.createElement(ZoomWrapper, { ...zoomContext }))
11606};
11607
11608// src/manager/components/preview/Preview.tsx
11609var canvasMapper = ({ state, api }) => ({
11610  api,
11611  storyId: state.storyId,
11612  refId: state.refId,
11613  viewMode: state.viewMode,
11614  customCanvas: api.renderPreview,
11615  queryParams: state.customQueryParams,
11616  getElements: api.getElements,
11617  entry: api.getData(state.storyId, state.refId),
11618  previewInitialized: state.previewInitialized,
11619  refs: state.refs
11620}), createCanvasTab = () => ({
11621  id: "canvas",
11622  type: types.TAB,
11623  title: "Canvas",
11624  route: ({ storyId, refId }) => refId ? `/story/${refId}_${storyId}` : `/story/${storyId}`,
11625  match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
11626  render: () => null
11627}), Preview
vendor: 1,819 bytes, lines 11627-11675
11627 = react_default.memo(function(props) {
11628  let {
11629    api,
11630    id: previewId,
11631    options: options2,
11632    viewMode,
11633    storyId,
11634    entry = void 0,
11635    description,
11636    baseUrl,
11637    withLoader = !0,
11638    tools,
11639    toolsExtra,
11640    tabs,
11641    wrappers,
11642    tabId
11643  } = props, tabState = useTabsState({
11644    selected: tabId ?? "canvas",
11645    onSelectionChange: (key) => {
11646      api.applyQueryParams({ tab: key === "canvas" ? void 0 : key });
11647    },
11648    tabs: tabs.map((tab, index) => ({
11649      id: tab.id ?? `tab-${index}`,
11650      title: tab.title,
11651      isDisabled: !!tab.disabled,
11652      children: () => tab.render({ active: !0 })
11653    }))
11654  });
11655  tabs.length > 1 && deprecate("Addon tabs are deprecated and will be removed in Storybook 11.");
11656  let tabContent = tabs.find((tab) => tab.id === tabId)?.render, shouldScale = viewMode === "story", { showToolbar } = options2, customisedShowToolbar = api.getShowToolbarWithCustomisations(showToolbar), previousStoryId = useRef(storyId);
11657  useEffect(() => {
11658    if (entry && viewMode) {
11659      if (storyId === previousStoryId.current)
11660        return;
11661      if (previousStoryId.current = storyId, viewMode.match(/docs|story/)) {
11662        let { refId, id } = entry;
11663        api.emit(SET_CURRENT_STORY, {
11664          storyId: id,
11665          viewMode,
11666          options: { target: refId }
11667        });
11668      }
11669    }
11670  }, [entry, viewMode, storyId, api]);
11671  let mainRef = useRef(null), { landmarkProps } = useLandmark(
11672    { "aria-labelledby": "main-preview-heading", role: "main" },
11673    mainRef
11674  );
11675  return react_default.createElement(Fragment, null, previewId === "main" && react_default.createElement(W, { key: "description" }, react_default.createElement("title", null, description)), react_default.createElement(ZoomProvider, { shouldScale }, react_default.createElement(PreviewContainer,
vendor: 4,631 bytes, lines 11675-11787
11675 null, react_default.createElement(
11676    ToolbarComp,
11677    {
11678      key: "tools",
11679      isShown: customisedShowToolbar,
11680      tabs,
11681      tabState,
11682      tools,
11683      toolsExtra
11684    }
11685  ), react_default.createElement(FrameWrap, { ref: mainRef, ...landmarkProps }, react_default.createElement("h2", { id: "main-preview-heading", className: "sb-sr-only" }, "Main preview area"), tabContent && react_default.createElement(IframeWrapper, null, tabContent({ active: !0 })), react_default.createElement(CanvasWrap, { show: !tabId || tabId === "canvas" }, react_default.createElement(Canvas, { withLoader, baseUrl, wrappers }))))));
11686});
11687var Canvas = ({ baseUrl, withLoader, wrappers }) => react_default.createElement(Consumer, { filter: canvasMapper }, ({
11688  api,
11689  entry,
11690  refs,
11691  customCanvas,
11692  storyId,
11693  refId,
11694  viewMode,
11695  queryParams,
11696  previewInitialized
11697}) => {
11698  let id = "canvas", [progress, setProgress] = useState(void 0);
11699  useEffect(() => {
11700    if (scope.CONFIG_TYPE === "DEVELOPMENT")
11701      try {
11702        addons.getChannel().on(PREVIEW_BUILDER_PROGRESS, (options2) => {
11703          setProgress(options2);
11704        });
11705      } catch {
11706      }
11707  }, []);
11708  let refLoading = !!refs[refId] && !refs[refId].previewInitialized, isBuilding = !(progress?.value === 1 || progress === void 0), rootLoading = !refId && (!previewInitialized || isBuilding), isLoading = entry && refLoading || rootLoading;
11709  return react_default.createElement(ZoomConsumer, null, ({ value: scale }) => react_default.createElement(react_default.Fragment, null, withLoader && isLoading && react_default.createElement(LoaderWrapper, null, react_default.createElement(Loader, { id: "preview-loader", role: "progressbar", progress })), react_default.createElement(ApplyWrappers, { id, storyId, viewMode, wrappers }, customCanvas ? customCanvas(storyId, viewMode, id, baseUrl, scale, queryParams) : react_default.createElement(
11710    FramesRenderer,
11711    {
11712      api,
11713      refs,
11714      scale,
11715      entry,
11716      viewMode,
11717      refId,
11718      queryParams,
11719      storyId
11720    }
11721  ))));
11722});
11723function filterTabs(panels, parameters) {
11724  let { previewTabs } = addons.getConfig(), parametersTabs = parameters ? parameters.previewTabs : void 0;
11725  if (previewTabs || parametersTabs) {
11726    let tabs = merge(previewTabs || {}, parametersTabs || {}), arrTabs = Object.keys(tabs).map((key, index) => ({
11727      index,
11728      ...typeof tabs[key] == "string" ? { title: tabs[key] } : tabs[key],
11729      id: key
11730    }));
11731    return panels.filter((panel) => {
11732      let t2 = arrTabs.find((tab) => tab.id === panel.id);
11733      return t2 === void 0 || t2.id === "canvas" || !t2.hidden;
11734    }).map((panel, index) => ({ ...panel, index })).sort((p1, p2) => {
11735      let tab_1 = arrTabs.find((tab) => tab.id === p1.id), index_1 = tab_1 ? tab_1.index : arrTabs.length + p1.index, tab_2 = arrTabs.find((tab) => tab.id === p2.id), index_2 = tab_2 ? tab_2.index : arrTabs.length + p2.index;
11736      return index_1 - index_2;
11737    }).map((panel) => {
11738      let t2 = arrTabs.find((tab) => tab.id === panel.id);
11739      return t2 ? {
11740        ...panel,
11741        title: t2.title || panel.title,
11742        disabled: t2.disabled,
11743        hidden: t2.hidden
11744      } : panel;
11745    });
11746  }
11747  return panels;
11748}
11749
11750// src/manager/components/preview/tools/addons.tsx
11751init_react();
11752var SHOW_ADDON_PANEL_BUTTON_ID = "storybook-show-addon-panel", menuMapper = ({ api, state }) => ({
11753  isVisible: api.getIsPanelShown(),
11754  singleStory: state.singleStory,
11755  panelPosition: state.layout.panelPosition,
11756  showPanel: async (forceFocus) => {
11757    api.togglePanel(!0), api.focusOnUIElement(focusableUIElements.addonPanel, {
11758      forceFocus,
11759      poll: !0
11760    });
11761  }
11762}), addonsTool = {
11763  title: "addons",
11764  id: "addons",
11765  type: types.TOOL,
11766  match: ({ viewMode, tabId }) => viewMode === "story" && !tabId,
11767  render: () => react_default.createElement(Consumer, { filter: menuMapper }, ({ isVisible, showPanel, singleStory, panelPosition }) => !singleStory && !isVisible && react_default.createElement(react_default.Fragment, null, react_default.createElement(
11768    Button,
11769    {
11770      padding: "small",
11771      variant: "ghost",
11772      ariaLabel: "Show addon panel",
11773      id: SHOW_ADDON_PANEL_BUTTON_ID,
11774      key: "addons",
11775      onClick: () => showPanel(!1),
11776      onKeyDown: (e2) => {
11777        (e2.key === "Enter" || e2.key === " ") && (e2.preventDefault(), showPanel(!0));
11778      }
11779    },
11780    panelPosition === "bottom" ? react_default.createElement(BottomBarIcon, null) : react_default.createElement(SidebarAltIcon, null)
11781  )))
11782};
11783
11784// src/manager/components/preview/tools/menu.tsx
11785init_react();
11786var menuMapper2 = ({ api, state }) => ({
11787  
vendor: 577 bytes, lines 11787-11802
11787isVisible: api.getIsNavShown(),
11788  singleStory: state.singleStory,
11789  viewMode: state.viewMode,
11790  showSidebar: async (forceFocus) => {
11791    api.toggleNav(!0), api.focusOnUIElement(focusableUIElements.sidebarRegion, {
11792      forceFocus,
11793      poll: !0
11794    });
11795  }
11796}), menuTool = {
11797  title: "menu",
11798  id: "menu",
11799  type: types.TOOL,
11800  // @ts-expect-error (non strict)
11801  match: ({ viewMode }) => ["story", "docs"].includes(viewMode),
11802  render: () => react_default.createElement(Consumer, { filter: menuMapper2 }, ({ isVisible, showSidebar, singleStory }) => !singleStory && !isVisible
vendor: 3,016 bytes, lines 11802-11896
11802 && react_default.createElement(react_default.Fragment, null, react_default.createElement(
11803    Button,
11804    {
11805      padding: "small",
11806      variant: "ghost",
11807      ariaLabel: "Show sidebar",
11808      id: focusableUIElements.showSidebar,
11809      key: "menu",
11810      onClick: () => showSidebar(!1),
11811      onKeyDown: (e2) => {
11812        (e2.key === "Enter" || e2.key === " ") && (e2.preventDefault(), showSidebar(!0));
11813      }
11814    },
11815    react_default.createElement(MenuIcon, null)
11816  ), react_default.createElement(Separator, null)))
11817};
11818
11819// src/manager/components/preview/tools/open-in-editor.tsx
11820init_react();
11821var mapper2 = ({ state, api }) => {
11822  let { storyId, refId } = state, entry = api.getData(storyId, refId);
11823  return {
11824    storyId,
11825    isCompositionStory: !!refId,
11826    importPath: entry?.importPath
11827  };
11828}, openInEditorTool = {
11829  title: "open-in-editor",
11830  id: "open-in-editor",
11831  type: types.TOOL,
11832  match: ({ viewMode, tabId }) => scope.CONFIG_TYPE === "DEVELOPMENT" && (viewMode === "story" || viewMode === "docs") && !tabId,
11833  render: () => react_default.createElement(Consumer, { filter: mapper2 }, ({ importPath, isCompositionStory }) => {
11834    let api = useStorybookApi();
11835    return isCompositionStory || !importPath ? null : react_default.createElement(
11836      Button,
11837      {
11838        key: "open-in-editor",
11839        onClick: () => api.openInEditor({
11840          file: importPath
11841        }),
11842        ariaLabel: "Open in editor",
11843        padding: "small",
11844        variant: "ghost"
11845      },
11846      react_default.createElement(EditorIcon, null)
11847    );
11848  })
11849};
11850
11851// src/manager/components/preview/tools/remount.tsx
11852init_react();
11853var StyledAnimatedButton = styled(Button)(({ theme, animating, disabled }) => ({
11854  opacity: disabled ? 0.5 : 1,
11855  svg: {
11856    animation: animating ? `${theme.animation.rotate360} 1000ms ease-out` : void 0
11857  }
11858})), menuMapper3 = ({ api, state }) => {
11859  let { storyId } = state;
11860  return {
11861    storyId,
11862    remount: () => api.emit(FORCE_REMOUNT, { storyId: state.storyId }),
11863    api
11864  };
11865}, remountTool = {
11866  title: "remount",
11867  id: "remount",
11868  type: types.TOOL,
11869  match: ({ viewMode, tabId }) => viewMode === "story" && !tabId,
11870  render: () => react_default.createElement(Consumer, { filter: menuMapper3 }, ({ remount, storyId, api }) => {
11871    let [isAnimating, setIsAnimating] = useState(!1), remountComponent = () => {
11872      storyId && remount();
11873    };
11874    return useEffect(() => {
11875      let handler = () => setIsAnimating(!0);
11876      return api.on(FORCE_REMOUNT, handler), () => api.off?.(FORCE_REMOUNT, handler);
11877    }, [api]), react_default.createElement(
11878      StyledAnimatedButton,
11879      {
11880        key: "remount",
11881        padding: "small",
11882        variant: "ghost",
11883        ariaLabel: "Reload story",
11884        onClick: remountComponent,
11885        onAnimationEnd: () => setIsAnimating(!1),
11886        animating: isAnimating,
11887        disabled: !storyId
11888      },
11889      react_default.createElement(SyncIcon, null)
11890    );
11891  })
11892};
11893
11894// src/manager/components/preview/tools/share.tsx
11895init_react();
11896
vendor: 40,952 bytes, lines 11897-12720
11897// ../../node_modules/qrcode.react/lib/esm/index.js
11898init_react();
11899var __defProp2 = Object.defineProperty, __getOwnPropSymbols = Object.getOwnPropertySymbols, __hasOwnProp2 = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a2, b2) => {
11900  for (var prop in b2 || (b2 = {}))
11901    __hasOwnProp2.call(b2, prop) && __defNormalProp(a2, prop, b2[prop]);
11902  if (__getOwnPropSymbols)
11903    for (var prop of __getOwnPropSymbols(b2))
11904      __propIsEnum.call(b2, prop) && __defNormalProp(a2, prop, b2[prop]);
11905  return a2;
11906}, __objRest = (source, exclude) => {
11907  var target = {};
11908  for (var prop in source)
11909    __hasOwnProp2.call(source, prop) && exclude.indexOf(prop) < 0 && (target[prop] = source[prop]);
11910  if (source != null && __getOwnPropSymbols)
11911    for (var prop of __getOwnPropSymbols(source))
11912      exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop) && (target[prop] = source[prop]);
11913  return target;
11914};
11915var qrcodegen;
11916((qrcodegen2) => {
11917  let _QrCode = class _QrCode2 {
11918    /*-- Constructor (low level) and fields --*/
11919    // Creates a new QR Code with the given version number,
11920    // error correction level, data codeword bytes, and mask number.
11921    // This is a low-level API that most users should not use directly.
11922    // A mid-level API is the encodeSegments() function.
11923    constructor(version3, errorCorrectionLevel, dataCodewords, msk) {
11924      if (this.version = version3, this.errorCorrectionLevel = errorCorrectionLevel, this.modules = [], this.isFunction = [], version3 < _QrCode2.MIN_VERSION || version3 > _QrCode2.MAX_VERSION)
11925        throw new RangeError("Version value out of range");
11926      if (msk < -1 || msk > 7)
11927        throw new RangeError("Mask value out of range");
11928      this.size = version3 * 4 + 17;
11929      let row = [];
11930      for (let i2 = 0; i2 < this.size; i2++)
11931        row.push(!1);
11932      for (let i2 = 0; i2 < this.size; i2++)
11933        this.modules.push(row.slice()), this.isFunction.push(row.slice());
11934      this.drawFunctionPatterns();
11935      let allCodewords = this.addEccAndInterleave(dataCodewords);
11936      if (this.drawCodewords(allCodewords), msk == -1) {
11937        let minPenalty = 1e9;
11938        for (let i2 = 0; i2 < 8; i2++) {
11939          this.applyMask(i2), this.drawFormatBits(i2);
11940          let penalty = this.getPenaltyScore();
11941          penalty < minPenalty && (msk = i2, minPenalty = penalty), this.applyMask(i2);
11942        }
11943      }
11944      assert(0 <= msk && msk <= 7), this.mask = msk, this.applyMask(msk), this.drawFormatBits(msk), this.isFunction = [];
11945    }
11946    /*-- Static factory functions (high level) --*/
11947    // Returns a QR Code representing the given Unicode text string at the given error correction level.
11948    // As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
11949    // Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
11950    // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
11951    // ecl argument if it can be done without increasing the version.
11952    static encodeText(text, ecl) {
11953      let segs = qrcodegen2.QrSegment.makeSegments(text);
11954      return _QrCode2.encodeSegments(segs, ecl);
11955    }
11956    // Returns a QR Code representing the given binary data at the given error correction level.
11957    // This function always encodes using the binary segment mode, not any text mode. The maximum number of
11958    // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
11959    // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
11960    static encodeBinary(data, ecl) {
11961      let seg = qrcodegen2.QrSegment.makeBytes(data);
11962      return _QrCode2.encodeSegments([seg], ecl);
11963    }
11964    /*-- Static factory functions (mid level) --*/
11965    // Returns a QR Code representing the given segments with the given encoding parameters.
11966    // The smallest possible QR Code version within the given range is automatically
11967    // chosen for the output. Iff boostEcl is true, then the ECC level of the result
11968    // may be higher than the ecl argument if it can be done without increasing the
11969    // version. The mask number is either between 0 to 7 (inclusive) to force that
11970    // mask, or -1 to automatically choose an appropriate mask (which may be slow).
11971    // This function allows the user to create a custom sequence of segments that switches
11972    // between modes (such as alphanumeric and byte) to encode text in less space.
11973    // This is a mid-level API; the high-level API is encodeText() and encodeBinary().
11974    static encodeSegments(segs, ecl, minVersion = 1, maxVersion = 40, mask = -1, boostEcl = !0) {
11975      if (!(_QrCode2.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= _QrCode2.MAX_VERSION) || mask < -1 || mask > 7)
11976        throw new RangeError("Invalid value");
11977      let version3, dataUsedBits;
11978      for (version3 = minVersion; ; version3++) {
11979        let dataCapacityBits2 = _QrCode2.getNumDataCodewords(version3, ecl) * 8, usedBits = QrSegment.getTotalBits(segs, version3);
11980        if (usedBits <= dataCapacityBits2) {
11981          dataUsedBits = usedBits;
11982          break;
11983        }
11984        if (version3 >= maxVersion)
11985          throw new RangeError("Data too long");
11986      }
11987      for (let newEcl of [_QrCode2.Ecc.MEDIUM, _QrCode2.Ecc.QUARTILE, _QrCode2.Ecc.HIGH])
11988        boostEcl && dataUsedBits <= _QrCode2.getNumDataCodewords(version3, newEcl) * 8 && (ecl = newEcl);
11989      let bb = [];
11990      for (let seg of segs) {
11991        appendBits(seg.mode.modeBits, 4, bb), appendBits(seg.numChars, seg.mode.numCharCountBits(version3), bb);
11992        for (let b2 of seg.getData())
11993          bb.push(b2);
11994      }
11995      assert(bb.length == dataUsedBits);
11996      let dataCapacityBits = _QrCode2.getNumDataCodewords(version3, ecl) * 8;
11997      assert(bb.length <= dataCapacityBits), appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb), appendBits(0, (8 - bb.length % 8) % 8, bb), assert(bb.length % 8 == 0);
11998      for (let padByte = 236; bb.length < dataCapacityBits; padByte ^= 253)
11999        appendBits(padByte, 8, bb);
12000      let dataCodewords = [];
12001      for (; dataCodewords.length * 8 < bb.length; )
12002        dataCodewords.push(0);
12003      return bb.forEach((b2, i2) => dataCodewords[i2 >>> 3] |= b2 << 7 - (i2 & 7)), new _QrCode2(version3, ecl, dataCodewords, mask);
12004    }
12005    /*-- Accessor methods --*/
12006    // Returns the color of the module (pixel) at the given coordinates, which is false
12007    // for light or true for dark. The top left corner has the coordinates (x=0, y=0).
12008    // If the given coordinates are out of bounds, then false (light) is returned.
12009    getModule(x2, y2) {
12010      return 0 <= x2 && x2 < this.size && 0 <= y2 && y2 < this.size && this.modules[y2][x2];
12011    }
12012    // Modified to expose modules for easy access
12013    getModules() {
12014      return this.modules;
12015    }
12016    /*-- Private helper methods for constructor: Drawing function modules --*/
12017    // Reads this object's version field, and draws and marks all function modules.
12018    drawFunctionPatterns() {
12019      for (let i2 = 0; i2 < this.size; i2++)
12020        this.setFunctionModule(6, i2, i2 % 2 == 0), this.setFunctionModule(i2, 6, i2 % 2 == 0);
12021      this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
12022      let alignPatPos = this.getAlignmentPatternPositions(), numAlign = alignPatPos.length;
12023      for (let i2 = 0; i2 < numAlign; i2++)
12024        for (let j2 = 0; j2 < numAlign; j2++)
12025          i2 == 0 && j2 == 0 || i2 == 0 && j2 == numAlign - 1 || i2 == numAlign - 1 && j2 == 0 || this.drawAlignmentPattern(alignPatPos[i2], alignPatPos[j2]);
12026      this.drawFormatBits(0), this.drawVersion();
12027    }
12028    // Draws two copies of the format bits (with its own error correction code)
12029    // based on the given mask and this object's error correction level field.
12030    drawFormatBits(mask) {
12031      let data = this.errorCorrectionLevel.formatBits << 3 | mask, rem2 = data;
12032      for (let i2 = 0; i2 < 10; i2++)
12033        rem2 = rem2 << 1 ^ (rem2 >>> 9) * 1335;
12034      let bits = (data << 10 | rem2) ^ 21522;
12035      assert(bits >>> 15 == 0);
12036      for (let i2 = 0; i2 <= 5; i2++)
12037        this.setFunctionModule(8, i2, getBit(bits, i2));
12038      this.setFunctionModule(8, 7, getBit(bits, 6)), this.setFunctionModule(8, 8, getBit(bits, 7)), this.setFunctionModule(7, 8, getBit(bits, 8));
12039      for (let i2 = 9; i2 < 15; i2++)
12040        this.setFunctionModule(14 - i2, 8, getBit(bits, i2));
12041      for (let i2 = 0; i2 < 8; i2++)
12042        this.setFunctionModule(this.size - 1 - i2, 8, getBit(bits, i2));
12043      for (let i2 = 8; i2 < 15; i2++)
12044        this.setFunctionModule(8, this.size - 15 + i2, getBit(bits, i2));
12045      this.setFunctionModule(8, this.size - 8, !0);
12046    }
12047    // Draws two copies of the version bits (with its own error correction code),
12048    // based on this object's version field, iff 7 <= version <= 40.
12049    drawVersion() {
12050      if (this.version < 7)
12051        return;
12052      let rem2 = this.version;
12053      for (let i2 = 0; i2 < 12; i2++)
12054        rem2 = rem2 << 1 ^ (rem2 >>> 11) * 7973;
12055      let bits = this.version << 12 | rem2;
12056      assert(bits >>> 18 == 0);
12057      for (let i2 = 0; i2 < 18; i2++) {
12058        let color2 = getBit(bits, i2), a2 = this.size - 11 + i2 % 3, b2 = Math.floor(i2 / 3);
12059        this.setFunctionModule(a2, b2, color2), this.setFunctionModule(b2, a2, color2);
12060      }
12061    }
12062    // Draws a 9*9 finder pattern including the border separator,
12063    // with the center module at (x, y). Modules can be out of bounds.
12064    drawFinderPattern(x2, y2) {
12065      for (let dy = -4; dy <= 4; dy++)
12066        for (let dx = -4; dx <= 4; dx++) {
12067          let dist = Math.max(Math.abs(dx), Math.abs(dy)), xx = x2 + dx, yy = y2 + dy;
12068          0 <= xx && xx < this.size && 0 <= yy && yy < this.size && this.setFunctionModule(xx, yy, dist != 2 && dist != 4);
12069        }
12070    }
12071    // Draws a 5*5 alignment pattern, with the center module
12072    // at (x, y). All modules must be in bounds.
12073    drawAlignmentPattern(x2, y2) {
12074      for (let dy = -2; dy <= 2; dy++)
12075        for (let dx = -2; dx <= 2; dx++)
12076          this.setFunctionModule(x2 + dx, y2 + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);
12077    }
12078    // Sets the color of a module and marks it as a function module.
12079    // Only used by the constructor. Coordinates must be in bounds.
12080    setFunctionModule(x2, y2, isDark) {
12081      this.modules[y2][x2] = isDark, this.isFunction[y2][x2] = !0;
12082    }
12083    /*-- Private helper methods for constructor: Codewords and masking --*/
12084    // Returns a new byte string representing the given data with the appropriate error correction
12085    // codewords appended to it, based on this object's version and error correction level.
12086    addEccAndInterleave(data) {
12087      let ver = this.version, ecl = this.errorCorrectionLevel;
12088      if (data.length != _QrCode2.getNumDataCodewords(ver, ecl))
12089        throw new RangeError("Invalid argument");
12090      let numBlocks = _QrCode2.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver], blockEccLen = _QrCode2.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver], rawCodewords = Math.floor(_QrCode2.getNumRawDataModules(ver) / 8), numShortBlocks = numBlocks - rawCodewords % numBlocks, shortBlockLen = Math.floor(rawCodewords / numBlocks), blocks = [], rsDiv = _QrCode2.reedSolomonComputeDivisor(blockEccLen);
12091      for (let i2 = 0, k2 = 0; i2 < numBlocks; i2++) {
12092        let dat = data.slice(k2, k2 + shortBlockLen - blockEccLen + (i2 < numShortBlocks ? 0 : 1));
12093        k2 += dat.length;
12094        let ecc = _QrCode2.reedSolomonComputeRemainder(dat, rsDiv);
12095        i2 < numShortBlocks && dat.push(0), blocks.push(dat.concat(ecc));
12096      }
12097      let result = [];
12098      for (let i2 = 0; i2 < blocks[0].length; i2++)
12099        blocks.forEach((block, j2) => {
12100          (i2 != shortBlockLen - blockEccLen || j2 >= numShortBlocks) && result.push(block[i2]);
12101        });
12102      return assert(result.length == rawCodewords), result;
12103    }
12104    // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
12105    // data area of this QR Code. Function modules need to be marked off before this is called.
12106    drawCodewords(data) {
12107      if (data.length != Math.floor(_QrCode2.getNumRawDataModules(this.version) / 8))
12108        throw new RangeError("Invalid argument");
12109      let i2 = 0;
12110      for (let right = this.size - 1; right >= 1; right -= 2) {
12111        right == 6 && (right = 5);
12112        for (let vert = 0; vert < this.size; vert++)
12113          for (let j2 = 0; j2 < 2; j2++) {
12114            let x2 = right - j2, y2 = (right + 1 & 2) == 0 ? this.size - 1 - vert : vert;
12115            !this.isFunction[y2][x2] && i2 < data.length * 8 && (this.modules[y2][x2] = getBit(data[i2 >>> 3], 7 - (i2 & 7)), i2++);
12116          }
12117      }
12118      assert(i2 == data.length * 8);
12119    }
12120    // XORs the codeword modules in this QR Code with the given mask pattern.
12121    // The function modules must be marked and the codeword bits must be drawn
12122    // before masking. Due to the arithmetic of XOR, calling applyMask() with
12123    // the same mask value a second time will undo the mask. A final well-formed
12124    // QR Code needs exactly one (not zero, two, etc.) mask applied.
12125    applyMask(mask) {
12126      if (mask < 0 || mask > 7)
12127        throw new RangeError("Mask value out of range");
12128      for (let y2 = 0; y2 < this.size; y2++)
12129        for (let x2 = 0; x2 < this.size; x2++) {
12130          let invert2;
12131          switch (mask) {
12132            case 0:
12133              invert2 = (x2 + y2) % 2 == 0;
12134              break;
12135            case 1:
12136              invert2 = y2 % 2 == 0;
12137              break;
12138            case 2:
12139              invert2 = x2 % 3 == 0;
12140              break;
12141            case 3:
12142              invert2 = (x2 + y2) % 3 == 0;
12143              break;
12144            case 4:
12145              invert2 = (Math.floor(x2 / 3) + Math.floor(y2 / 2)) % 2 == 0;
12146              break;
12147            case 5:
12148              invert2 = x2 * y2 % 2 + x2 * y2 % 3 == 0;
12149              break;
12150            case 6:
12151              invert2 = (x2 * y2 % 2 + x2 * y2 % 3) % 2 == 0;
12152              break;
12153            case 7:
12154              invert2 = ((x2 + y2) % 2 + x2 * y2 % 3) % 2 == 0;
12155              break;
12156            default:
12157              throw new Error("Unreachable");
12158          }
12159          !this.isFunction[y2][x2] && invert2 && (this.modules[y2][x2] = !this.modules[y2][x2]);
12160        }
12161    }
12162    // Calculates and returns the penalty score based on state of this QR Code's current modules.
12163    // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
12164    getPenaltyScore() {
12165      let result = 0;
12166      for (let y2 = 0; y2 < this.size; y2++) {
12167        let runColor = !1, runX = 0, runHistory = [0, 0, 0, 0, 0, 0, 0];
12168        for (let x2 = 0; x2 < this.size; x2++)
12169          this.modules[y2][x2] == runColor ? (runX++, runX == 5 ? result += _QrCode2.PENALTY_N1 : runX > 5 && result++) : (this.finderPenaltyAddHistory(runX, runHistory), runColor || (result += this.finderPenaltyCountPatterns(runHistory) * _QrCode2.PENALTY_N3), runColor = this.modules[y2][x2], runX = 1);
12170        result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * _QrCode2.PENALTY_N3;
12171      }
12172      for (let x2 = 0; x2 < this.size; x2++) {
12173        let runColor = !1, runY = 0, runHistory = [0, 0, 0, 0, 0, 0, 0];
12174        for (let y2 = 0; y2 < this.size; y2++)
12175          this.modules[y2][x2] == runColor ? (runY++, runY == 5 ? result += _QrCode2.PENALTY_N1 : runY > 5 && result++) : (this.finderPenaltyAddHistory(runY, runHistory), runColor || (result += this.finderPenaltyCountPatterns(runHistory) * _QrCode2.PENALTY_N3), runColor = this.modules[y2][x2], runY = 1);
12176        result += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * _QrCode2.PENALTY_N3;
12177      }
12178      for (let y2 = 0; y2 < this.size - 1; y2++)
12179        for (let x2 = 0; x2 < this.size - 1; x2++) {
12180          let color2 = this.modules[y2][x2];
12181          color2 == this.modules[y2][x2 + 1] && color2 == this.modules[y2 + 1][x2] && color2 == this.modules[y2 + 1][x2 + 1] && (result += _QrCode2.PENALTY_N2);
12182        }
12183      let dark = 0;
12184      for (let row of this.modules)
12185        dark = row.reduce((sum, color2) => sum + (color2 ? 1 : 0), dark);
12186      let total = this.size * this.size, k2 = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;
12187      return assert(0 <= k2 && k2 <= 9), result += k2 * _QrCode2.PENALTY_N4, assert(0 <= result && result <= 2568888), result;
12188    }
12189    /*-- Private helper functions --*/
12190    // Returns an ascending list of positions of alignment patterns for this version number.
12191    // Each position is in the range [0,177), and are used on both the x and y axes.
12192    // This could be implemented as lookup table of 40 variable-length lists of integers.
12193    getAlignmentPatternPositions() {
12194      if (this.version == 1)
12195        return [];
12196      {
12197        let numAlign = Math.floor(this.version / 7) + 2, step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2, result = [6];
12198        for (let pos = this.size - 7; result.length < numAlign; pos -= step)
12199          result.splice(1, 0, pos);
12200        return result;
12201      }
12202    }
12203    // Returns the number of data bits that can be stored in a QR Code of the given version number, after
12204    // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
12205    // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
12206    static getNumRawDataModules(ver) {
12207      if (ver < _QrCode2.MIN_VERSION || ver > _QrCode2.MAX_VERSION)
12208        throw new RangeError("Version number out of range");
12209      let result = (16 * ver + 128) * ver + 64;
12210      if (ver >= 2) {
12211        let numAlign = Math.floor(ver / 7) + 2;
12212        result -= (25 * numAlign - 10) * numAlign - 55, ver >= 7 && (result -= 36);
12213      }
12214      return assert(208 <= result && result <= 29648), result;
12215    }
12216    // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
12217    // QR Code of the given version number and error correction level, with remainder bits discarded.
12218    // This stateless pure function could be implemented as a (40*4)-cell lookup table.
12219    static getNumDataCodewords(ver, ecl) {
12220      return Math.floor(_QrCode2.getNumRawDataModules(ver) / 8) - _QrCode2.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * _QrCode2.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
12221    }
12222    // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
12223    // implemented as a lookup table over all possible parameter values, instead of as an algorithm.
12224    static reedSolomonComputeDivisor(degree) {
12225      if (degree < 1 || degree > 255)
12226        throw new RangeError("Degree out of range");
12227      let result = [];
12228      for (let i2 = 0; i2 < degree - 1; i2++)
12229        result.push(0);
12230      result.push(1);
12231      let root2 = 1;
12232      for (let i2 = 0; i2 < degree; i2++) {
12233        for (let j2 = 0; j2 < result.length; j2++)
12234          result[j2] = _QrCode2.reedSolomonMultiply(result[j2], root2), j2 + 1 < result.length && (result[j2] ^= result[j2 + 1]);
12235        root2 = _QrCode2.reedSolomonMultiply(root2, 2);
12236      }
12237      return result;
12238    }
12239    // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
12240    static reedSolomonComputeRemainder(data, divisor) {
12241      let result = divisor.map((_2) => 0);
12242      for (let b2 of data) {
12243        let factor = b2 ^ result.shift();
12244        result.push(0), divisor.forEach((coef, i2) => result[i2] ^= _QrCode2.reedSolomonMultiply(coef, factor));
12245      }
12246      return result;
12247    }
12248    // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
12249    // are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
12250    static reedSolomonMultiply(x2, y2) {
12251      if (x2 >>> 8 || y2 >>> 8)
12252        throw new RangeError("Byte out of range");
12253      let z2 = 0;
12254      for (let i2 = 7; i2 >= 0; i2--)
12255        z2 = z2 << 1 ^ (z2 >>> 7) * 285, z2 ^= (y2 >>> i2 & 1) * x2;
12256      return assert(z2 >>> 8 == 0), z2;
12257    }
12258    // Can only be called immediately after a light run is added, and
12259    // returns either 0, 1, or 2. A helper function for getPenaltyScore().
12260    finderPenaltyCountPatterns(runHistory) {
12261      let n3 = runHistory[1];
12262      assert(n3 <= this.size * 3);
12263      let core = n3 > 0 && runHistory[2] == n3 && runHistory[3] == n3 * 3 && runHistory[4] == n3 && runHistory[5] == n3;
12264      return (core && runHistory[0] >= n3 * 4 && runHistory[6] >= n3 ? 1 : 0) + (core && runHistory[6] >= n3 * 4 && runHistory[0] >= n3 ? 1 : 0);
12265    }
12266    // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
12267    finderPenaltyTerminateAndCount(currentRunColor, currentRunLength, runHistory) {
12268      return currentRunColor && (this.finderPenaltyAddHistory(currentRunLength, runHistory), currentRunLength = 0), currentRunLength += this.size, this.finderPenaltyAddHistory(currentRunLength, runHistory), this.finderPenaltyCountPatterns(runHistory);
12269    }
12270    // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
12271    finderPenaltyAddHistory(currentRunLength, runHistory) {
12272      runHistory[0] == 0 && (currentRunLength += this.size), runHistory.pop(), runHistory.unshift(currentRunLength);
12273    }
12274  };
12275  _QrCode.MIN_VERSION = 1, _QrCode.MAX_VERSION = 40, _QrCode.PENALTY_N1 = 3, _QrCode.PENALTY_N2 = 3, _QrCode.PENALTY_N3 = 40, _QrCode.PENALTY_N4 = 10, _QrCode.ECC_CODEWORDS_PER_BLOCK = [
12276    // Version: (note that index 0 is for padding, and is set to an illegal value)
12277    //0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40    Error correction level
12278    [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
12279    // Low
12280    [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],
12281    // Medium
12282    [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
12283    // Quartile
12284    [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
12285    // High
12286  ], _QrCode.NUM_ERROR_CORRECTION_BLOCKS = [
12287    // Version: (note that index 0 is for padding, and is set to an illegal value)
12288    //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40    Error correction level
12289    [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
12290    // Low
12291    [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],
12292    // Medium
12293    [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],
12294    // Quartile
12295    [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
12296    // High
12297  ];
12298  let QrCode = _QrCode;
12299  qrcodegen2.QrCode = _QrCode;
12300  function appendBits(val, len, bb) {
12301    if (len < 0 || len > 31 || val >>> len)
12302      throw new RangeError("Value out of range");
12303    for (let i2 = len - 1; i2 >= 0; i2--)
12304      bb.push(val >>> i2 & 1);
12305  }
12306  function getBit(x2, i2) {
12307    return (x2 >>> i2 & 1) != 0;
12308  }
12309  function assert(cond) {
12310    if (!cond)
12311      throw new Error("Assertion error");
12312  }
12313  let _QrSegment = class _QrSegment2 {
12314    /*-- Constructor (low level) and fields --*/
12315    // Creates a new QR Code segment with the given attributes and data.
12316    // The character count (numChars) must agree with the mode and the bit buffer length,
12317    // but the constraint isn't checked. The given bit buffer is cloned and stored.
12318    constructor(mode, numChars, bitData) {
12319      if (this.mode = mode, this.numChars = numChars, this.bitData = bitData, numChars < 0)
12320        throw new RangeError("Invalid argument");
12321      this.bitData = bitData.slice();
12322    }
12323    /*-- Static factory functions (mid level) --*/
12324    // Returns a segment representing the given binary data encoded in
12325    // byte mode. All input byte arrays are acceptable. Any text string
12326    // can be converted to UTF-8 bytes and encoded as a byte mode segment.
12327    static makeBytes(data) {
12328      let bb = [];
12329      for (let b2 of data)
12330        appendBits(b2, 8, bb);
12331      return new _QrSegment2(_QrSegment2.Mode.BYTE, data.length, bb);
12332    }
12333    // Returns a segment representing the given string of decimal digits encoded in numeric mode.
12334    static makeNumeric(digits) {
12335      if (!_QrSegment2.isNumeric(digits))
12336        throw new RangeError("String contains non-numeric characters");
12337      let bb = [];
12338      for (let i2 = 0; i2 < digits.length; ) {
12339        let n3 = Math.min(digits.length - i2, 3);
12340        appendBits(parseInt(digits.substring(i2, i2 + n3), 10), n3 * 3 + 1, bb), i2 += n3;
12341      }
12342      return new _QrSegment2(_QrSegment2.Mode.NUMERIC, digits.length, bb);
12343    }
12344    // Returns a segment representing the given text string encoded in alphanumeric mode.
12345    // The characters allowed are: 0 to 9, A to Z (uppercase only), space,
12346    // dollar, percent, asterisk, plus, hyphen, period, slash, colon.
12347    static makeAlphanumeric(text) {
12348      if (!_QrSegment2.isAlphanumeric(text))
12349        throw new RangeError("String contains unencodable characters in alphanumeric mode");
12350      let bb = [], i2;
12351      for (i2 = 0; i2 + 2 <= text.length; i2 += 2) {
12352        let temp = _QrSegment2.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i2)) * 45;
12353        temp += _QrSegment2.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i2 + 1)), appendBits(temp, 11, bb);
12354      }
12355      return i2 < text.length && appendBits(_QrSegment2.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i2)), 6, bb), new _QrSegment2(_QrSegment2.Mode.ALPHANUMERIC, text.length, bb);
12356    }
12357    // Returns a new mutable list of zero or more segments to represent the given Unicode text string.
12358    // The result may use various segment modes and switch modes to optimize the length of the bit stream.
12359    static makeSegments(text) {
12360      return text == "" ? [] : _QrSegment2.isNumeric(text) ? [_QrSegment2.makeNumeric(text)] : _QrSegment2.isAlphanumeric(text) ? [_QrSegment2.makeAlphanumeric(text)] : [_QrSegment2.makeBytes(_QrSegment2.toUtf8ByteArray(text))];
12361    }
12362    // Returns a segment representing an Extended Channel Interpretation
12363    // (ECI) designator with the given assignment value.
12364    static makeEci(assignVal) {
12365      let bb = [];
12366      if (assignVal < 0)
12367        throw new RangeError("ECI assignment value out of range");
12368      if (assignVal < 128)
12369        appendBits(assignVal, 8, bb);
12370      else if (assignVal < 16384)
12371        appendBits(2, 2, bb), appendBits(assignVal, 14, bb);
12372      else if (assignVal < 1e6)
12373        appendBits(6, 3, bb), appendBits(assignVal, 21, bb);
12374      else
12375        throw new RangeError("ECI assignment value out of range");
12376      return new _QrSegment2(_QrSegment2.Mode.ECI, 0, bb);
12377    }
12378    // Tests whether the given string can be encoded as a segment in numeric mode.
12379    // A string is encodable iff each character is in the range 0 to 9.
12380    static isNumeric(text) {
12381      return _QrSegment2.NUMERIC_REGEX.test(text);
12382    }
12383    // Tests whether the given string can be encoded as a segment in alphanumeric mode.
12384    // A string is encodable iff each character is in the following set: 0 to 9, A to Z
12385    // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
12386    static isAlphanumeric(text) {
12387      return _QrSegment2.ALPHANUMERIC_REGEX.test(text);
12388    }
12389    /*-- Methods --*/
12390    // Returns a new copy of the data bits of this segment.
12391    getData() {
12392      return this.bitData.slice();
12393    }
12394    // (Package-private) Calculates and returns the number of bits needed to encode the given segments at
12395    // the given version. The result is infinity if a segment has too many characters to fit its length field.
12396    static getTotalBits(segs, version3) {
12397      let result = 0;
12398      for (let seg of segs) {
12399        let ccbits = seg.mode.numCharCountBits(version3);
12400        if (seg.numChars >= 1 << ccbits)
12401          return 1 / 0;
12402        result += 4 + ccbits + seg.bitData.length;
12403      }
12404      return result;
12405    }
12406    // Returns a new array of bytes representing the given string encoded in UTF-8.
12407    static toUtf8ByteArray(str) {
12408      str = encodeURI(str);
12409      let result = [];
12410      for (let i2 = 0; i2 < str.length; i2++)
12411        str.charAt(i2) != "%" ? result.push(str.charCodeAt(i2)) : (result.push(parseInt(str.substring(i2 + 1, i2 + 3), 16)), i2 += 2);
12412      return result;
12413    }
12414  };
12415  _QrSegment.NUMERIC_REGEX = /^[0-9]*$/, _QrSegment.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, _QrSegment.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
12416  let QrSegment = _QrSegment;
12417  qrcodegen2.QrSegment = _QrSegment;
12418})(qrcodegen || (qrcodegen = {}));
12419((qrcodegen2) => {
12420  let QrCode;
12421  ((QrCode2) => {
12422    let _Ecc = class {
12423      // The QR Code can tolerate about 30% erroneous codewords
12424      /*-- Constructor and fields --*/
12425      constructor(ordinal, formatBits) {
12426        this.ordinal = ordinal, this.formatBits = formatBits;
12427      }
12428    };
12429    _Ecc.LOW = new _Ecc(0, 1), _Ecc.MEDIUM = new _Ecc(1, 0), _Ecc.QUARTILE = new _Ecc(2, 3), _Ecc.HIGH = new _Ecc(3, 2);
12430    let Ecc = _Ecc;
12431    QrCode2.Ecc = _Ecc;
12432  })(QrCode = qrcodegen2.QrCode || (qrcodegen2.QrCode = {}));
12433})(qrcodegen || (qrcodegen = {}));
12434((qrcodegen2) => {
12435  let QrSegment;
12436  ((QrSegment2) => {
12437    let _Mode = class {
12438      /*-- Constructor and fields --*/
12439      constructor(modeBits, numBitsCharCount) {
12440        this.modeBits = modeBits, this.numBitsCharCount = numBitsCharCount;
12441      }
12442      /*-- Method --*/
12443      // (Package-private) Returns the bit width of the character count field for a segment in
12444      // this mode in a QR Code at the given version number. The result is in the range [0, 16].
12445      numCharCountBits(ver) {
12446        return this.numBitsCharCount[Math.floor((ver + 7) / 17)];
12447      }
12448    };
12449    _Mode.NUMERIC = new _Mode(1, [10, 12, 14]), _Mode.ALPHANUMERIC = new _Mode(2, [9, 11, 13]), _Mode.BYTE = new _Mode(4, [8, 16, 16]), _Mode.KANJI = new _Mode(8, [8, 10, 12]), _Mode.ECI = new _Mode(7, [0, 0, 0]);
12450    let Mode = _Mode;
12451    QrSegment2.Mode = _Mode;
12452  })(QrSegment = qrcodegen2.QrSegment || (qrcodegen2.QrSegment = {}));
12453})(qrcodegen || (qrcodegen = {}));
12454var qrcodegen_default = qrcodegen;
12455var ERROR_LEVEL_MAP = {
12456  L: qrcodegen_default.QrCode.Ecc.LOW,
12457  M: qrcodegen_default.QrCode.Ecc.MEDIUM,
12458  Q: qrcodegen_default.QrCode.Ecc.QUARTILE,
12459  H: qrcodegen_default.QrCode.Ecc.HIGH
12460}, DEFAULT_SIZE = 128, DEFAULT_LEVEL = "L", DEFAULT_BGCOLOR = "#FFFFFF", DEFAULT_FGCOLOR = "#000000", DEFAULT_INCLUDEMARGIN = !1, DEFAULT_MINVERSION = 1, SPEC_MARGIN_SIZE = 4, DEFAULT_MARGIN_SIZE = 0, DEFAULT_IMG_SCALE = 0.1;
12461function generatePath(modules, margin = 0) {
12462  let ops = [];
12463  return modules.forEach(function(row, y2) {
12464    let start = null;
12465    row.forEach(function(cell, x2) {
12466      if (!cell && start !== null) {
12467        ops.push(
12468          `M${start + margin} ${y2 + margin}h${x2 - start}v1H${start + margin}z`
12469        ), start = null;
12470        return;
12471      }
12472      if (x2 === row.length - 1) {
12473        if (!cell)
12474          return;
12475        start === null ? ops.push(`M${x2 + margin},${y2 + margin} h1v1H${x2 + margin}z`) : ops.push(
12476          `M${start + margin},${y2 + margin} h${x2 + 1 - start}v1H${start + margin}z`
12477        );
12478        return;
12479      }
12480      cell && start === null && (start = x2);
12481    });
12482  }), ops.join("");
12483}
12484function excavateModules(modules, excavation) {
12485  return modules.slice().map((row, y2) => y2 < excavation.y || y2 >= excavation.y + excavation.h ? row : row.map((cell, x2) => x2 < excavation.x || x2 >= excavation.x + excavation.w ? cell : !1));
12486}
12487function getImageSettings(cells, size, margin, imageSettings) {
12488  if (imageSettings == null)
12489    return null;
12490  let numCells = cells.length + margin * 2, defaultSize = Math.floor(size * DEFAULT_IMG_SCALE), scale = numCells / size, w2 = (imageSettings.width || defaultSize) * scale, h2 = (imageSettings.height || defaultSize) * scale, x2 = imageSettings.x == null ? cells.length / 2 - w2 / 2 : imageSettings.x * scale, y2 = imageSettings.y == null ? cells.length / 2 - h2 / 2 : imageSettings.y * scale, opacity = imageSettings.opacity == null ? 1 : imageSettings.opacity, excavation = null;
12491  if (imageSettings.excavate) {
12492    let floorX = Math.floor(x2), floorY = Math.floor(y2), ceilW = Math.ceil(w2 + x2 - floorX), ceilH = Math.ceil(h2 + y2 - floorY);
12493    excavation = { x: floorX, y: floorY, w: ceilW, h: ceilH };
12494  }
12495  let crossOrigin = imageSettings.crossOrigin;
12496  return { x: x2, y: y2, h: h2, w: w2, excavation, opacity, crossOrigin };
12497}
12498function getMarginSize(includeMargin, marginSize) {
12499  return marginSize != null ? Math.max(Math.floor(marginSize), 0) : includeMargin ? SPEC_MARGIN_SIZE : DEFAULT_MARGIN_SIZE;
12500}
12501function useQRCode({
12502  value,
12503  level,
12504  minVersion,
12505  includeMargin,
12506  marginSize,
12507  imageSettings,
12508  size,
12509  boostLevel
12510}) {
12511  let qrcode = react_default.useMemo(() => {
12512    let segments = (Array.isArray(value) ? value : [value]).reduce((accum, v2) => (accum.push(...qrcodegen_default.QrSegment.makeSegments(v2)), accum), []);
12513    return qrcodegen_default.QrCode.encodeSegments(
12514      segments,
12515      ERROR_LEVEL_MAP[level],
12516      minVersion,
12517      void 0,
12518      void 0,
12519      boostLevel
12520    );
12521  }, [value, level, minVersion, boostLevel]), { cells, margin, numCells, calculatedImageSettings } = react_default.useMemo(() => {
12522    let cells2 = qrcode.getModules(), margin2 = getMarginSize(includeMargin, marginSize), numCells2 = cells2.length + margin2 * 2, calculatedImageSettings2 = getImageSettings(
12523      cells2,
12524      size,
12525      margin2,
12526      imageSettings
12527    );
12528    return {
12529      cells: cells2,
12530      margin: margin2,
12531      numCells: numCells2,
12532      calculatedImageSettings: calculatedImageSettings2
12533    };
12534  }, [qrcode, size, imageSettings, includeMargin, marginSize]);
12535  return {
12536    qrcode,
12537    margin,
12538    cells,
12539    numCells,
12540    calculatedImageSettings
12541  };
12542}
12543var SUPPORTS_PATH2D = (function() {
12544  try {
12545    new Path2D().addPath(new Path2D());
12546  } catch {
12547    return !1;
12548  }
12549  return !0;
12550})(), QRCodeCanvas = react_default.forwardRef(
12551  function(props, forwardedRef) {
12552    let _a2 = props, {
12553      value,
12554      size = DEFAULT_SIZE,
12555      level = DEFAULT_LEVEL,
12556      bgColor = DEFAULT_BGCOLOR,
12557      fgColor = DEFAULT_FGCOLOR,
12558      includeMargin = DEFAULT_INCLUDEMARGIN,
12559      minVersion = DEFAULT_MINVERSION,
12560      boostLevel,
12561      marginSize,
12562      imageSettings
12563    } = _a2, _b = __objRest(_a2, [
12564      "value",
12565      "size",
12566      "level",
12567      "bgColor",
12568      "fgColor",
12569      "includeMargin",
12570      "minVersion",
12571      "boostLevel",
12572      "marginSize",
12573      "imageSettings"
12574    ]), { style } = _b, otherProps = __objRest(_b, ["style"]), imgSrc = imageSettings?.src, _canvas = react_default.useRef(null), _image = react_default.useRef(null), setCanvasRef = react_default.useCallback(
12575      (node) => {
12576        _canvas.current = node, typeof forwardedRef == "function" ? forwardedRef(node) : forwardedRef && (forwardedRef.current = node);
12577      },
12578      [forwardedRef]
12579    ), [isImgLoaded, setIsImageLoaded] = react_default.useState(!1), { margin, cells, numCells, calculatedImageSettings } = useQRCode({
12580      value,
12581      level,
12582      minVersion,
12583      boostLevel,
12584      includeMargin,
12585      marginSize,
12586      imageSettings,
12587      size
12588    });
12589    react_default.useEffect(() => {
12590      if (_canvas.current != null) {
12591        let canvas = _canvas.current, ctx = canvas.getContext("2d");
12592        if (!ctx)
12593          return;
12594        let cellsToDraw = cells, image = _image.current, haveImageToRender = calculatedImageSettings != null && image !== null && image.complete && image.naturalHeight !== 0 && image.naturalWidth !== 0;
12595        haveImageToRender && calculatedImageSettings.excavation != null && (cellsToDraw = excavateModules(
12596          cells,
12597          calculatedImageSettings.excavation
12598        ));
12599        let pixelRatio = window.devicePixelRatio || 1;
12600        canvas.height = canvas.width = size * pixelRatio;
12601        let scale = size / numCells * pixelRatio;
12602        ctx.scale(scale, scale), ctx.fillStyle = bgColor, ctx.fillRect(0, 0, numCells, numCells), ctx.fillStyle = fgColor, SUPPORTS_PATH2D ? ctx.fill(new Path2D(generatePath(cellsToDraw, margin))) : cells.forEach(function(row, rdx) {
12603          row.forEach(function(cell, cdx) {
12604            cell && ctx.fillRect(cdx + margin, rdx + margin, 1, 1);
12605          });
12606        }), calculatedImageSettings && (ctx.globalAlpha = calculatedImageSettings.opacity), haveImageToRender && ctx.drawImage(
12607          image,
12608          calculatedImageSettings.x + margin,
12609          calculatedImageSettings.y + margin,
12610          calculatedImageSettings.w,
12611          calculatedImageSettings.h
12612        );
12613      }
12614    }), react_default.useEffect(() => {
12615      setIsImageLoaded(!1);
12616    }, [imgSrc]);
12617    let canvasStyle = __spreadValues({ height: size, width: size }, style), img = null;
12618    return imgSrc != null && (img = react_default.createElement(
12619      "img",
12620      {
12621        src: imgSrc,
12622        key: imgSrc,
12623        style: { display: "none" },
12624        onLoad: () => {
12625          setIsImageLoaded(!0);
12626        },
12627        ref: _image,
12628        crossOrigin: calculatedImageSettings?.crossOrigin
12629      }
12630    )), react_default.createElement(react_default.Fragment, null, react_default.createElement(
12631      "canvas",
12632      __spreadValues({
12633        style: canvasStyle,
12634        height: size,
12635        width: size,
12636        ref: setCanvasRef,
12637        role: "img"
12638      }, otherProps)
12639    ), img);
12640  }
12641);
12642QRCodeCanvas.displayName = "QRCodeCanvas";
12643var QRCodeSVG = react_default.forwardRef(
12644  function(props, forwardedRef) {
12645    let _a2 = props, {
12646      value,
12647      size = DEFAULT_SIZE,
12648      level = DEFAULT_LEVEL,
12649      bgColor = DEFAULT_BGCOLOR,
12650      fgColor = DEFAULT_FGCOLOR,
12651      includeMargin = DEFAULT_INCLUDEMARGIN,
12652      minVersion = DEFAULT_MINVERSION,
12653      boostLevel,
12654      title: title2,
12655      marginSize,
12656      imageSettings
12657    } = _a2, otherProps = __objRest(_a2, [
12658      "value",
12659      "size",
12660      "level",
12661      "bgColor",
12662      "fgColor",
12663      "includeMargin",
12664      "minVersion",
12665      "boostLevel",
12666      "title",
12667      "marginSize",
12668      "imageSettings"
12669    ]), { margin, cells, numCells, calculatedImageSettings } = useQRCode({
12670      value,
12671      level,
12672      minVersion,
12673      boostLevel,
12674      includeMargin,
12675      marginSize,
12676      imageSettings,
12677      size
12678    }), cellsToDraw = cells, image = null;
12679    imageSettings != null && calculatedImageSettings != null && (calculatedImageSettings.excavation != null && (cellsToDraw = excavateModules(
12680      cells,
12681      calculatedImageSettings.excavation
12682    )), image = react_default.createElement(
12683      "image",
12684      {
12685        href: imageSettings.src,
12686        height: calculatedImageSettings.h,
12687        width: calculatedImageSettings.w,
12688        x: calculatedImageSettings.x + margin,
12689        y: calculatedImageSettings.y + margin,
12690        preserveAspectRatio: "none",
12691        opacity: calculatedImageSettings.opacity,
12692        crossOrigin: calculatedImageSettings.crossOrigin
12693      }
12694    ));
12695    let fgPath = generatePath(cellsToDraw, margin);
12696    return react_default.createElement(
12697      "svg",
12698      __spreadValues({
12699        height: size,
12700        width: size,
12701        viewBox: `0 0 ${numCells} ${numCells}`,
12702        ref: forwardedRef,
12703        role: "img"
12704      }, otherProps),
12705      !!title2 && react_default.createElement("title", null, title2),
12706      react_default.createElement(
12707        "path",
12708        {
12709          fill: bgColor,
12710          d: `M0,0 h${numCells}v${numCells}H0z`,
12711          shapeRendering: "crispEdges"
12712        }
12713      ),
12714      react_default.createElement("path", { fill: fgColor, d: fgPath, shapeRendering: "crispEdges" }),
12715      image
12716    );
12717  }
12718);
12719QRCodeSVG.displayName = "QRCodeSVG";
12720
12721// src/manager/components/preview/tools/share.tsx
12722var mapper3 = ({ api, state }) => {
12723  let { storyId, refId } = state;
12724  return { api, refId, storyId };
12725}, QRContainer = styled.div(
12726  () => ({
12727    display: "flex",
12728    flexDirection: "column",
12729    padding: 8,
12730    width: 300,
12731    maxWidth: 300,
12732    gap: 8
12733  })
12734), QRRow = styled.div(() => ({
12735  display: "flex",
12736  alignItems: "center"
12737})), ShareLinkInput = styled.input(({ theme }) => ({
12738  width: "100%",
12739  border: `1px solid ${theme.appBorderColor}`,
12740  borderRadius: 4,
12741  padding: "6px 8px",
12742  fontSize: theme.typography.size.s1,
12743  color: theme.color.defaultText,
12744  backgroundColor: theme.background.app,
12745  outline: "none",
12746  textOverflow: "ellipsis",
12747  overflow: "hidden",
12748  whiteSpace: "nowrap",
12749  "&:focus": {
12750    borderColor: theme.color.secondary
12751  }
12752})), QRImageContainer = styled.div(() => ({
12753  width: 64,
12754  height: 64,
12755  marginRight: 12,
12756  backgroundColor: "white",
12757  padding: 2
12758}));
12759var QRContent = styled.div(() => ({})), QRTitle = styled.div(({ theme }) => ({
12760  fontWeight: theme.typography.weight.bold,
12761  fontSize: theme.typography.size.s1,
12762  marginBottom: 4
12763})), QRDescription = styled.div(({ theme }) => ({
12764  fontSize: theme.typography.size.s1,
12765  color: theme.textMutedColor
12766})), isolationModeTool = {
12767  title: "isolation mode",
12768  id: "isolationMode",
12769  type: types.TOOLEXTRA,
12770  match: ({ viewMode, tabId }) => viewMode === "story" && !tabId,
12771  render: () => react_default.createElement(Consumer, { filter: mapper3 }, ({ api, storyId, refId }) => {
12772    if (!storyId) return null;
12773    let originHrefs = api.getStoryHrefs(storyId, { base: "origin", refId });
12774    return react_default.createElement(
12775      Button,
12776      {
12777        padding: "small",
12778        variant: "ghost",
12779        ariaLabel: "Open in isolation mode",
12780        tooltip: "Open in isolation mode",
12781        onClick: () => {
12782          window.open(originHrefs.previewHref, "_blank", "noopener,noreferrer"), api.emit(SHARE_ISOLATE_MODE, originHrefs.previewHref);
12783        }
12784      },
12785      react_default.createElement(PopOutIcon, null)
12786    );
12787  })
12788};
12789
vendor: 2,969 bytes, lines 12790-12855
12790// src/manager/container/Preview.tsx
12791var defaultTabs = [createCanvasTab()], defaultTools = [menuTool, remountTool], defaultToolsExtra = [
12792  isolationModeTool,
12793  zoomTool,
12794  addonsTool,
12795  fullScreenTool,
12796  openInEditorTool
12797], emptyTabsList = [], memoizedTabs = (0, import_memoizerific2.default)(1)(
12798  (_2, tabElements, parameters, showTabs) => showTabs ? filterTabs([...defaultTabs, ...Object.values(tabElements)], parameters) : emptyTabsList
12799), memoizedTools = (0, import_memoizerific2.default)(1)(
12800  (_2, toolElements, filterProps) => filterToolsSide([...defaultTools, ...Object.values(toolElements)], ...filterProps)
12801), memoizedExtra = (0, import_memoizerific2.default)(1)(
12802  (_2, extraElements, filterProps) => filterToolsSide([...defaultToolsExtra, ...Object.values(extraElements)], ...filterProps)
12803), memoizedWrapper = (0, import_memoizerific2.default)(1)((_2, previewElements) => [
12804  ...defaultWrappers,
12805  ...Object.values(previewElements)
12806]), { PREVIEW_URL } = scope, splitTitleAddExtraSpace = (input) => input.split("/").join(" / ").replace(/\s\s/, " "), getDescription = (item) => {
12807  if (item?.type === "story" || item?.type === "docs") {
12808    let { title: title2, name } = item;
12809    return title2 && name ? splitTitleAddExtraSpace(`${title2} - ${name} \u22C5 Storybook`) : "Storybook";
12810  }
12811  return item?.name ? `${item.name} \u22C5 Storybook` : "Storybook";
12812}, mapper4 = ({
12813  api,
12814  state
12815  // @ts-expect-error (non strict)
12816}) => {
12817  let { layout, location: location2, customQueryParams, storyId, refs, viewMode, path, refId } = state, entry = api.getData(storyId, refId), tabsList = Object.values(api.getElements(Addon_TypesEnum.TAB)), wrapperList = Object.values(api.getElements(Addon_TypesEnum.PREVIEW)), toolsList = Object.values(api.getElements(Addon_TypesEnum.TOOL)), toolsExtraList = Object.values(api.getElements(Addon_TypesEnum.TOOLEXTRA)), tabId = api.getQueryParam("tab"), tools = memoizedTools(toolsList.length, api.getElements(Addon_TypesEnum.TOOL), [
12818    entry,
12819    viewMode,
12820    location2,
12821    path,
12822    // @ts-expect-error (non strict)
12823    tabId
12824  ]), toolsExtra = memoizedExtra(
12825    toolsExtraList.length,
12826    api.getElements(Addon_TypesEnum.TOOLEXTRA),
12827    // @ts-expect-error (non strict)
12828    [entry, viewMode, location2, path, tabId]
12829  );
12830  return {
12831    api,
12832    entry,
12833    options: layout,
12834    description: getDescription(entry),
12835    viewMode,
12836    refs,
12837    storyId,
12838    baseUrl: PREVIEW_URL || "iframe.html",
12839    queryParams: customQueryParams,
12840    tools,
12841    toolsExtra,
12842    tabs: memoizedTabs(
12843      tabsList.length,
12844      api.getElements(Addon_TypesEnum.TAB),
12845      entry ? entry.parameters : void 0,
12846      layout.showTabs
12847    ),
12848    wrappers: memoizedWrapper(
12849      wrapperList.length,
12850      api.getElements(Addon_TypesEnum.PREVIEW)
12851    ),
12852    tabId
12853  };
12854}, PreviewConnected = react_default.memo(function(props) {
12855  return react_default.createElement(Consumer, { filter: mapper4 }, (fromState) => react_default.createElement(Preview
vendor: 8,322 bytes, lines 12855-13034
12855, { ...props, ...fromState }));
12856}), Preview_default = PreviewConnected;
12857
12858// src/manager/container/Sidebar.tsx
12859init_react();
12860
12861// src/manager/components/sidebar/Sidebar.tsx
12862init_react();
12863
12864// src/manager/components/sidebar/ChecklistWidget.tsx
12865init_react();
12866
12867// src/manager/components/Optional/Optional.tsx
12868init_react();
12869var Wrapper3 = styled.div({
12870  display: "inline-grid",
12871  gridTemplateColumns: "max-content",
12872  overflow: "hidden"
12873}), Content2 = styled.div(({ isHidden }) => ({
12874  display: "inline-block",
12875  gridArea: "1/1",
12876  opacity: isHidden === null ? 0 : 1,
12877  visibility: isHidden ? "hidden" : "visible"
12878})), Optional = ({
12879  content,
12880  fallback
12881}) => {
12882  let contentRef = useRef(null), wrapperRef = useRef(null), [hidden, setHidden] = useState(null), contentWidth = useRef(contentRef.current?.offsetWidth ?? 0), wrapperWidth = useRef(wrapperRef.current?.offsetWidth ?? 0);
12883  return useEffect(() => {
12884    if (contentRef.current && wrapperRef.current) {
12885      let resizeObserver = new ResizeObserver(() => {
12886        wrapperWidth.current = wrapperRef.current?.offsetWidth || wrapperWidth.current, contentWidth.current = contentRef.current?.offsetWidth || contentWidth.current, setHidden(contentWidth.current > wrapperWidth.current);
12887      });
12888      return resizeObserver.observe(wrapperRef.current), () => resizeObserver.disconnect();
12889    }
12890  }, []), react_default.createElement(Wrapper3, { ref: wrapperRef }, react_default.createElement(Content2, { isHidden: hidden, ref: contentRef }, content), fallback && react_default.createElement(Content2, { isHidden: !hidden }, fallback));
12891};
12892
12893// src/manager/components/Particles/Particles.tsx
12894init_react();
12895var Shape = styled.svg(({ color: color2 }) => ({
12896  fill: color2,
12897  position: "absolute",
12898  inset: "0",
12899  margin: "auto",
12900  width: "12px",
12901  height: "12px",
12902  pointerEvents: "none"
12903})), Donut = (props) => react_default.createElement(Shape, { viewBox: "0 0 90 90", xmlns: "http://www.w3.org/2000/svg", color: "red", ...props }, react_default.createElement("path", { d: "M45 0c24.853 0 45 20.147 45 45S69.853 90 45 90 0 69.853 0 45 20.147 0 45 0zm.5 27C35.283 27 27 35.283 27 45.5S35.283 64 45.5 64 64 55.717 64 45.5 55.717 27 45.5 27z" })), L2 = (props) => react_default.createElement(Shape, { viewBox: "0 0 55 89", xmlns: "http://www.w3.org/2000/svg", color: "#66BF3C", ...props }, react_default.createElement("path", { d: "M55 3v83a3 3 0 01-3 3H3a3 3 0 01-3-3V64a3 3 0 013-3h21a3 3 0 003-3V3a3 3 0 013-3h22a3 3 0 013 3z" })), Slice = (props) => react_default.createElement(Shape, { viewBox: "0 0 92 92", xmlns: "http://www.w3.org/2000/svg", color: "#FF4785", ...props }, react_default.createElement("path", { d: "M92 89V3c0-3-2.056-3-3-3C39.294 0 0 39.294 0 89c0 0 0 3 3 3h86a3 3 0 003-3z" })), Square = ({ style, ...props }) => react_default.createElement(
12904  Shape,
12905  {
12906    viewBox: "0 0 90 90",
12907    xmlns: "http://www.w3.org/2000/svg",
12908    color: "#1EA7FD",
12909    ...props,
12910    style: { borderRadius: 5, ...style }
12911  },
12912  react_default.createElement("path", { d: "M0 0h90v90H0z" })
12913), Triangle = (props) => react_default.createElement(Shape, { viewBox: "0 0 96 88", xmlns: "http://www.w3.org/2000/svg", color: "#FFAE00", ...props }, react_default.createElement("path", { d: "M50.63 1.785l44.928 81.77A3 3 0 0192.928 88H3.072a3 3 0 01-2.629-4.445l44.929-81.77a3 3 0 015.258 0z" })), T2 = (props) => react_default.createElement(Shape, { viewBox: "0 0 92 62", xmlns: "http://www.w3.org/2000/svg", color: "#FC521F", ...props }, react_default.createElement("path", { d: "M63 3v25a3 3 0 003 3h23a3 3 0 013 3v25a3 3 0 01-3 3H3a3 3 0 01-3-3V34a3 3 0 013-3h24a3 3 0 003-3V3a3 3 0 013-3h27a3 3 0 013 3z" })), Z = (props) => react_default.createElement(Shape, { viewBox: "0 0 56 90", xmlns: "http://www.w3.org/2000/svg", color: "#6F2CAC", ...props }, react_default.createElement("path", { d: "M28 3v25a3 3 0 003 3h22a3 3 0 013 3v53a3 3 0 01-3 3H31a3 3 0 01-3-3V62a3 3 0 00-3-3H3a3 3 0 01-3-3V3a3 3 0 013-3h22a3 3 0 013 3z" })), fadeToTransparent = keyframes`
12914  to {
12915    opacity: 0;
12916  }
12917`, disperse = keyframes`
12918  to {
12919    transform: translate(
12920      calc(cos(var(--angle)) * var(--distance)),
12921      calc(sin(var(--angle)) * var(--distance))
12922    ) rotate(var(--rotation));
12923  }
12924`, slideDown = keyframes`
12925  to {
12926    transform: translateY(50px);
12927  }
12928`, Container8 = styled.div({
12929  position: "absolute",
12930  display: "flex",
12931  flexDirection: "row",
12932  flexWrap: "wrap",
12933  gap: 10,
12934  "--particle-curve": "cubic-bezier(0.2, 0.56, 0, 1)",
12935  animation: `${slideDown} 1000ms forwards cubic-bezier(0.587, -0.381, 0.583, 0.599)`,
12936  animationDelay: "150ms",
12937  zIndex: 999,
12938  svg: {
12939    width: 15,
12940    height: 15,
12941    animation: `${fadeToTransparent} var(--fade-duration) forwards, ${disperse} 1000ms forwards var(--particle-curve)`
12942  }
12943}), FADE_DURATION = 1200, NUM_OF_PARTICLES = 8, JITTER = 15, random = (min, max) => Math.random() * (max - min) + min, sortRandomly = (array) => array.sort(() => Math.random() - 0.5), Particles = memo(function({
12944  anchor: Anchor
12945}) {
12946  let anchorRef = useRef(null), [left, setLeft] = useState(0), [top, setTop] = useState(0), shapes = sortRandomly([Donut, L2, Slice, Square, Triangle, T2, Z]), colors = sortRandomly([
12947    "#FF0000",
12948    "#FF4787",
12949    "#66BF3C",
12950    "#1EA7FD",
12951    "#FC521F",
12952    "#6F2CAC",
12953    "#FFAE00"
12954  ]);
12955  return useLayoutEffect(() => {
12956    let rect = anchorRef.current?.getBoundingClientRect();
12957    rect && (setLeft(rect.left + rect.width / 2), setTop(rect.top + rect.height / 2));
12958  }, []), react_default.createElement("div", { ref: anchorRef }, react_default.createElement(Anchor, null), createPortal(
12959    react_default.createElement(Container8, { style: { top: top + "px", left: left + "px" } }, shapes.map((Particle, index) => {
12960      let angle = 360 / NUM_OF_PARTICLES * index + random(-JITTER, JITTER), distance = random(50, 80), rotation = random(-360, 360), style = {
12961        "--angle": angle + "deg",
12962        "--distance": distance + "px",
12963        "--rotation": rotation + "deg",
12964        "--fade-duration": FADE_DURATION + "ms"
12965      };
12966      return react_default.createElement(Particle, { key: Particle.name, style, color: colors[index] });
12967    })),
12968    document.getElementById("root") ?? document.body
12969  ));
12970});
12971
12972// src/manager/components/TextFlip.tsx
12973init_react();
12974var slideIn2 = keyframes({
12975  from: {
12976    transform: "translateY(var(--slide-in-from))",
12977    opacity: 0
12978  }
12979}), slideOut = keyframes({
12980  to: {
12981    transform: "translateY(var(--slide-out-to))",
12982    opacity: 0
12983  }
12984}), Container9 = styled.div({
12985  display: "inline-grid",
12986  gridTemplateColumns: "1fr",
12987  justifyContent: "center",
12988  alignItems: "center"
12989}), Placeholder2 = styled.div({
12990  gridArea: "1 / 1",
12991  userSelect: "none",
12992  visibility: "hidden"
12993}), Text2 = styled.span(({ duration, isExiting, isEntering, reverse }) => {
12994  let animation;
12995  return isExiting ? animation = `${slideOut} ${duration}ms forwards` : isEntering && (animation = `${slideIn2} ${duration}ms forwards`), {
12996    gridArea: "1 / 1",
12997    animation,
12998    pointerEvents: isExiting ? "none" : "auto",
12999    userSelect: isExiting ? "none" : "text",
13000    "--slide-in-from": reverse ? "-100%" : "100%",
13001    "--slide-out-to": reverse ? "100%" : "-100%",
13002    "@media (prefers-reduced-motion: reduce)": {
13003      animation: "none",
13004      opacity: isExiting ? 0 : 1,
13005      transform: "translateY(0)"
13006    }
13007  };
13008}), TextFlip = ({
13009  text,
13010  duration = 250,
13011  placeholder,
13012  ...props
13013}) => {
13014  let textRef = useRef(text), [staleValue, setStaleValue] = useState(text), isAnimating = text !== staleValue, reverse = isAnimating && numericCompare(staleValue, text);
13015  return textRef.current = text, react_default.createElement(Container9, { ...props }, isAnimating && react_default.createElement(
13016    Text2,
13017    {
13018      "aria-hidden": !0,
13019      duration,
13020      reverse,
13021      isExiting: !0,
13022      onAnimationEnd: () => setStaleValue(textRef.current)
13023    },
13024    staleValue
13025  ), react_default.createElement(Text2, { duration, reverse, isEntering: isAnimating }, text), placeholder && react_default.createElement(Placeholder2, { "aria-hidden": !0 }, placeholder));
13026};
13027function numericCompare(a2, b2) {
13028  let na = Number(a2), nb = Number(b2);
13029  return Number.isNaN(na) || Number.isNaN(nb) ? a2.localeCompare(b2, void 0, { numeric: !0 }) > 0 : na > nb;
13030}
13031
13032// src/manager/components/sidebar/useChecklist.ts
13033init_react();
13034
vendor: 1,238 bytes, lines 13035-13060
13035// ../../node_modules/es-toolkit/dist/function/debounce.mjs
13036function debounce(func, debounceMs, { signal, edges } = {}) {
13037  let pendingThis, pendingArgs = null, leading = edges != null && edges.includes("leading"), trailing = edges == null || edges.includes("trailing"), invoke = () => {
13038    pendingArgs !== null && (func.apply(pendingThis, pendingArgs), pendingThis = void 0, pendingArgs = null);
13039  }, onTimerEnd = () => {
13040    trailing && invoke(), cancel();
13041  }, timeoutId = null, schedule = () => {
13042    timeoutId != null && clearTimeout(timeoutId), timeoutId = setTimeout(() => {
13043      timeoutId = null, onTimerEnd();
13044    }, debounceMs);
13045  }, cancelTimer = () => {
13046    timeoutId !== null && (clearTimeout(timeoutId), timeoutId = null);
13047  }, cancel = () => {
13048    cancelTimer(), pendingThis = void 0, pendingArgs = null;
13049  }, flush = () => {
13050    invoke();
13051  }, debounced = function(...args) {
13052    if (signal?.aborted)
13053      return;
13054    pendingThis = this, pendingArgs = args;
13055    let isFirstCall = timeoutId == null;
13056    schedule(), leading && isFirstCall && invoke();
13057  };
13058  return debounced.schedule = schedule, debounced.cancel = cancel, debounced.flush = flush, signal?.addEventListener("abort", cancel, { once: !0 }), debounced;
13059}
13060
vendor: 735 bytes, lines 13061-13074
13061// ../../node_modules/es-toolkit/dist/function/partial.mjs
13062function partial(func, ...partialArgs) {
13063  return partialImpl(func, placeholderSymbol, ...partialArgs);
13064}
13065function partialImpl(func, placeholder, ...partialArgs) {
13066  let partialed = function(...providedArgs) {
13067    let providedArgsIndex = 0, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg), remainingArgs = providedArgs.slice(providedArgsIndex);
13068    return func.apply(this, substitutedArgs.concat(remainingArgs));
13069  };
13070  return func.prototype && (partialed.prototype = Object.create(func.prototype)), partialed;
13071}
13072var placeholderSymbol = Symbol("partial.placeholder");
13073partial.placeholder = placeholderSymbol;
13074
vendor: 935 bytes, lines 13075-13088
13075// ../../node_modules/es-toolkit/dist/function/partialRight.mjs
13076function partialRight(func, ...partialArgs) {
13077  return partialRightImpl(func, placeholderSymbol2, ...partialArgs);
13078}
13079function partialRightImpl(func, placeholder, ...partialArgs) {
13080  let partialedRight = function(...providedArgs) {
13081    let placeholderLength = partialArgs.filter((arg) => arg === placeholder).length, rangeLength = Math.max(providedArgs.length - placeholderLength, 0), remainingArgs = providedArgs.slice(0, rangeLength), providedArgsIndex = rangeLength, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg);
13082    return func.apply(this, remainingArgs.concat(substitutedArgs));
13083  };
13084  return func.prototype && (partialedRight.prototype = Object.create(func.prototype)), partialedRight;
13085}
13086var placeholderSymbol2 = Symbol("partialRight.placeholder");
13087partialRight.placeholder = placeholderSymbol2;
13088
vendor: 106 bytes, lines 13089-13091
13089// ../../node_modules/es-toolkit/dist/function/retry.mjs
13090var DEFAULT_RETRIES = Number.POSITIVE_INFINITY;
13091
vendor: 678 bytes, lines 13092-13105
13092// ../../node_modules/es-toolkit/dist/function/throttle.mjs
13093function throttle(func, throttleMs, { signal, edges = ["leading", "trailing"] } = {}) {
13094  let pendingAt = null, debounced = debounce(function(...args) {
13095    pendingAt = Date.now(), func.apply(this, args);
13096  }, throttleMs, { signal, edges }), throttled = function(...args) {
13097    if (pendingAt == null && (pendingAt = Date.now()), Date.now() - pendingAt >= throttleMs) {
13098      pendingAt = Date.now(), func.apply(this, args), debounced.cancel(), debounced.schedule();
13099      return;
13100    }
13101    debounced.apply(this, args);
13102  };
13103  return throttled.cancel = debounced.cancel, throttled.flush = debounced.flush, throttled;
13104}
13105
vendor: 2,364 bytes, lines 13106-13166
13106// src/shared/checklist-store/checklistData.tsx
13107init_react();
13108
13109// ../addons/a11y/src/constants.ts
13110var ADDON_ID2 = "storybook/a11y", PANEL_ID2 = `${ADDON_ID2}/panel`;
13111var UI_STATE_ID = `${ADDON_ID2}/ui`, RESULT = `${ADDON_ID2}/result`, REQUEST = `${ADDON_ID2}/request`, RUNNING = `${ADDON_ID2}/running`, ERROR = `${ADDON_ID2}/error`, MANUAL = `${ADDON_ID2}/manual`, SELECT = `${ADDON_ID2}/select`, DOCUMENTATION_LINK = "writing-tests/accessibility-testing", DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#why-are-my-tests-failing-in-different-environments`;
13112
13113// ../addons/onboarding/src/constants.ts
13114var ADDON_ID3 = "storybook/onboarding", ADDON_ONBOARDING_CHANNEL = `${ADDON_ID3}/channel`;
13115
13116// src/component-testing/constants.ts
13117var ADDON_ID4 = "storybook/interactions", PANEL_ID3 = `${ADDON_ID4}/panel`;
13118var DOCUMENTATION_LINK2 = "writing-tests/integrations/vitest-addon", DOCUMENTATION_DISCREPANCY_LINK2 = `${DOCUMENTATION_LINK2}#what-happens-when-there-are-different-test-results-in-multiple-environments`;
13119
13120// ../addons/vitest/src/constants.ts
13121var ADDON_ID5 = "storybook/test", TEST_PROVIDER_ID = `${ADDON_ID5}/test-provider`, STORYBOOK_ADDON_TEST_CHANNEL = `${ADDON_ID5}/channel`;
13122var DOCUMENTATION_LINK3 = "writing-tests/integrations/vitest-addon", DOCUMENTATION_FATAL_ERROR_LINK = `${DOCUMENTATION_LINK3}#what-happens-if-vitest-itself-has-an-error`;
13123var storeOptions = {
13124  id: ADDON_ID5,
13125  initialState: {
13126    config: {
13127      coverage: !1,
13128      a11y: !1
13129    },
13130    watching: !1,
13131    cancelling: !1,
13132    fatalError: void 0,
13133    index: { entries: {}, v: 5 },
13134    previewAnnotations: [],
13135    currentRun: {
13136      triggeredBy: void 0,
13137      config: {
13138        coverage: !1,
13139        a11y: !1
13140      },
13141      componentTestStatuses: [],
13142      a11yStatuses: [],
13143      a11yReports: {},
13144      reports: {},
13145      componentTestCount: {
13146        success: 0,
13147        error: 0
13148      },
13149      a11yCount: {
13150        success: 0,
13151        warning: 0,
13152        error: 0
13153      },
13154      storyIds: void 0,
13155      totalTestCount: void 0,
13156      startedAt: void 0,
13157      finishedAt: void 0,
13158      unhandledErrors: [],
13159      coverageSummary: void 0
13160    }
13161  }
13162};
13163var STORE_CHANNEL_EVENT_NAME = `UNIVERSAL_STORE:${storeOptions.id}`;
13164var TRIGGER_TEST_RUN_REQUEST = `${ADDON_ID5}/trigger-test-run-request`, TRIGGER_TEST_RUN_RESPONSE = `${ADDON_ID5}/trigger-test-run-response`;
13165
13166// src/s
vendor: 2,896 bytes, lines 13166-13250
13166torybook-error.ts
13167function parseErrorCode({
13168  code,
13169  category
13170}) {
13171  let paddedCode = String(code).padStart(4, "0");
13172  return `SB_${category}_${paddedCode}`;
13173}
13174function appendErrorRef(url) {
13175  if (/^(?!.*storybook\.js\.org)|[?&]ref=error\b/.test(url))
13176    return url;
13177  try {
13178    let urlObj = new URL(url);
13179    return urlObj.searchParams.set("ref", "error"), urlObj.toString();
13180  } catch {
13181    return url;
13182  }
13183}
13184var StorybookError = class _StorybookError extends Error {
13185  constructor(props) {
13186    super(
13187      _StorybookError.getFullMessage(props),
13188      props.cause === void 0 ? void 0 : { cause: props.cause }
13189    );
13190    /**
13191     * Data associated with the error. Used to provide additional information in the error message or
13192     * to be passed to telemetry.
13193     */
13194    this.data = {};
13195    /** Flag used to easily determine if the error originates from Storybook. */
13196    this.fromStorybook = !0;
13197    /**
13198     * Flag used to determine if the error is handled by us and should therefore not be shown to the
13199     * user.
13200     */
13201    this.isHandledError = !1;
13202    /**
13203     * A collection of sub errors which relate to a parent error.
13204     *
13205     * Sub-errors are used to represent multiple related errors that occurred together. When a
13206     * StorybookError with sub-errors is sent to telemetry, both the parent error and each sub-error
13207     * are sent as separate telemetry events. This allows for better error tracking and debugging.
13208     *
13209     * @example
13210     *
13211     * ```ts
13212     * const error1 = new SomeError();
13213     * const error2 = new AnotherError();
13214     * const parentError = new ParentError({
13215     *   // ... other props
13216     *   subErrors: [error1, error2],
13217     * });
13218     * ```
13219     */
13220    this.subErrors = [];
13221    this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.isHandledError = props.isHandledError ?? !1, this.name = props.name, this.subErrors = props.subErrors ?? [];
13222  }
13223  get fullErrorCode() {
13224    return parseErrorCode({ code: this.code, category: this.category });
13225  }
13226  /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
13227  get name() {
13228    let errorName = this._name || this.constructor.name;
13229    return `${this.fullErrorCode} (${errorName})`;
13230  }
13231  set name(name) {
13232    this._name = name;
13233  }
13234  /** Generates the error message along with additional documentation link (if applicable). */
13235  static getFullMessage({
13236    documentation,
13237    code,
13238    category,
13239    message
13240  }) {
13241    let page;
13242    return documentation === !0 ? page = `https://storybook.js.org/error/${parseErrorCode({ code, category })}?ref=error` : typeof documentation == "string" ? page = appendErrorRef(documentation) : Array.isArray(documentation) && (page = `
13243${documentation.map((doc) => `	- ${appendErrorRef(doc)}`).join(`
13244`)}`), `${message}${page != null ? `
13245
13246More info: ${page}
13247` : ""}`;
13248  }
13249};
13250
13251// src/manager-errors.ts
13252var StatusTypeIdMismatchError2 = class extends StorybookError {
13253  constructor(data) {
13254    super({
13255      name: "StatusTypeIdMismatchError",
13256      category: "MANAGER_API" /* MANAGER_API */,
13257      code: 1,
13258      message: `Status has typeId "${data.status.typeId}" but was added to store with typeId "${data.typeId}". Full status: ${JSON.stringify(
13259        data.status,
13260        null,
13261        2
13262      )}`
13263    });
13264    this.data = data;
13265  }
13266};
13267
vendor: 1,402 bytes, lines 13268-13301
13268// ../../node_modules/ts-dedent/esm/index.js
13269function dedent(templ) {
13270  for (var values = [], _i = 1; _i < arguments.length; _i++)
13271    values[_i - 1] = arguments[_i];
13272  var strings = Array.from(typeof templ == "string" ? [templ] : templ);
13273  strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
13274  var indentLengths = strings.reduce(function(arr, str) {
13275    var matches = str.match(/\n([\t ]+|(?!\s).)/g);
13276    return matches ? arr.concat(matches.map(function(match) {
13277      var _a2, _b;
13278      return (_b = (_a2 = match.match(/[\t ]/g)) === null || _a2 === void 0 ? void 0 : _a2.length) !== null && _b !== void 0 ? _b : 0;
13279    })) : arr;
13280  }, []);
13281  if (indentLengths.length) {
13282    var pattern_1 = new RegExp(`
13283[	 ]{` + Math.min.apply(Math, indentLengths) + "}", "g");
13284    strings = strings.map(function(str) {
13285      return str.replace(pattern_1, `
13286`);
13287    });
13288  }
13289  strings[0] = strings[0].replace(/^\r?\n/, "");
13290  var string = strings[0];
13291  return values.forEach(function(value, i2) {
13292    var endentations = string.match(/(?:^|\n)( *)$/), endentation = endentations ? endentations[1] : "", indentedValue = value;
13293    typeof value == "string" && value.includes(`
13294`) && (indentedValue = String(value).split(`
13295`).map(function(str, i3) {
13296      return i3 === 0 ? str : "" + endentation + str;
13297    }).join(`
13298`)), string += indentedValue + strings[i2 + 1];
13299  }), string;
13300}
13301
13302// src/preview-errors.ts
13303var StatusTypeIdMismatchError3 = class extends StorybookError {
13304  constructor(data) {
13305    super({
13306      name: "StatusTypeIdMismatchError",
13307      category: "PREVIEW_API" /* PREVIEW_API */,
13308      code: 16,
13309      message: `Status has typeId "${data.status.typeId}" but was added to store with typeId "${data.typeId}". Full status: ${JSON.stringify(
13310        data.status,
13311        null,
13312        2
13313      )}`
13314    });
13315    this.data = data;
13316  }
13317};
13318
13319// src/server-errors.ts
13320var import_picocolors = __toESM(require_picocolors_browser(), 1);
13321var StatusTypeIdMismatchError4 = class extends StorybookError {
13322  constructor(data) {
13323    super({
13324      name: "StatusTypeIdMismatchError",
13325      category: "CORE-SERVER" /* CORE_SERVER */,
13326      code: 16,
13327      message: `Status has typeId "${data.status.typeId}" but was added to store with typeId "${data.typeId}". Full status: ${JSON.stringify(
13328        data.status,
13329        null,
13330        2
13331      )}`
13332    });
13333    this.data = data;
13334  }
13335};
13336
vendor: 4,596 bytes, lines 13337-13465
13337// src/shared/status-store/index.ts
13338var STATUS_VALUE_PREFIX = "status-value:";
13339var statusValueShortName = (value) => value === "status-value:affected" ? "related" : value.slice(STATUS_VALUE_PREFIX.length), statusValueDescription = (value) => ({
13340  "status-value:pending": "Stories with pending status",
13341  "status-value:success": "Stories with passing tests",
13342  "status-value:new": "Newly added stories",
13343  "status-value:modified": "Stories closely linked to code changes",
13344  "status-value:affected": "Stories likely to be affected by code changes",
13345  "status-value:warning": "Stories with warnings",
13346  "status-value:error": "Stories with failing tests",
13347  "status-value:unknown": "Stories with unknown status"
13348})[value];
13349var UNIVERSAL_STATUS_STORE_OPTIONS = {
13350  id: "storybook/status",
13351  leader: !0,
13352  initialState: {}
13353}, StatusStoreEventType = {
13354  SELECT: "select"
13355};
13356function countStatusesByValue(allStatuses) {
13357  let counts = {};
13358  for (let statusByTypeId of Object.values(allStatuses))
13359    for (let status of Object.values(statusByTypeId))
13360      counts[status.value] = (counts[status.value] ?? 0) + 1;
13361  return counts;
13362}
13363function createStatusStore({
13364  universalStatusStore: universalStatusStore2,
13365  useUniversalStore: useUniversalStore2,
13366  environment
13367}) {
13368  let fullStatusStore2 = {
13369    getAll() {
13370      return universalStatusStore2.getState();
13371    },
13372    set(statuses) {
13373      universalStatusStore2.setState((state) => {
13374        let newState = { ...state };
13375        for (let status of statuses) {
13376          let { storyId, typeId } = status;
13377          newState[storyId] = { ...newState[storyId] ?? {}, [typeId]: status };
13378        }
13379        return newState;
13380      });
13381    },
13382    onAllStatusChange(listener) {
13383      return universalStatusStore2.onStateChange((state, prevState) => {
13384        listener(state, prevState);
13385      });
13386    },
13387    onSelect(listener) {
13388      return universalStatusStore2.subscribe(StatusStoreEventType.SELECT, (event) => {
13389        listener(event.payload);
13390      });
13391    },
13392    selectStatuses: (statuses) => {
13393      universalStatusStore2.send({ type: StatusStoreEventType.SELECT, payload: statuses });
13394    },
13395    unset(storyIds) {
13396      if (!storyIds) {
13397        universalStatusStore2.setState({});
13398        return;
13399      }
13400      universalStatusStore2.setState((state) => {
13401        let newState = { ...state };
13402        for (let storyId of storyIds)
13403          delete newState[storyId];
13404        return newState;
13405      });
13406    },
13407    typeId: void 0
13408  }, getStatusStoreByTypeId2 = (typeId) => ({
13409    getAll: fullStatusStore2.getAll,
13410    set(statuses) {
13411      universalStatusStore2.setState((state) => {
13412        let newState = { ...state };
13413        for (let status of statuses) {
13414          let { storyId } = status;
13415          if (status.typeId !== typeId)
13416            switch (environment) {
13417              case "server":
13418                throw new StatusTypeIdMismatchError4({
13419                  status,
13420                  typeId
13421                });
13422              case "manager":
13423                throw new StatusTypeIdMismatchError2({
13424                  status,
13425                  typeId
13426                });
13427              case "preview":
13428              default:
13429                throw new StatusTypeIdMismatchError3({
13430                  status,
13431                  typeId
13432                });
13433            }
13434          newState[storyId] = { ...newState[storyId] ?? {}, [typeId]: status };
13435        }
13436        return newState;
13437      });
13438    },
13439    onAllStatusChange: fullStatusStore2.onAllStatusChange,
13440    onSelect(listener) {
13441      return universalStatusStore2.subscribe(StatusStoreEventType.SELECT, (event) => {
13442        event.payload.some((status) => status.typeId === typeId) && listener(event.payload);
13443      });
13444    },
13445    unset(storyIds) {
13446      universalStatusStore2.setState((state) => {
13447        let newState = { ...state };
13448        for (let storyId in newState)
13449          if (newState[storyId]?.[typeId] && (!storyIds || storyIds?.includes(storyId))) {
13450            let { [typeId]: omittedStatus, ...storyStatusesWithoutTypeId } = newState[storyId];
13451            newState[storyId] = storyStatusesWithoutTypeId;
13452          }
13453        return newState;
13454      });
13455    },
13456    typeId
13457  });
13458  return useUniversalStore2 ? {
13459    getStatusStoreByTypeId: getStatusStoreByTypeId2,
13460    fullStatusStore: fullStatusStore2,
13461    universalStatusStore: universalStatusStore2,
13462    useStatusStore: (selector) => useUniversalStore2(universalStatusStore2, selector)[0]
13463  } : { getStatusStoreByTypeId: getStatusStoreByTypeId2, fullStatusStore: fullStatusStore2, universalStatusStore: universalStatusStore2 };
13464}
13465
13466// src/cli/AddonVitestService.constants.ts
13467var SUPPORTED_FRAMEWORKS = [
vendor: 623 bytes, lines 13467-13487
13467
13468  "html-vite" /* HTML_VITE */,
13469  "nextjs-vite" /* NEXTJS_VITE */,
13470  "preact-vite" /* PREACT_VITE */,
13471  "react-native-web-vite" /* REACT_NATIVE_WEB_VITE */,
13472  "react-vite" /* REACT_VITE */,
13473  "solid" /* SOLID */,
13474  "svelte-vite" /* SVELTE_VITE */,
13475  "sveltekit" /* SVELTEKIT */,
13476  "vue3-vite" /* VUE3_VITE */,
13477  "web-components-vite" /* WEB_COMPONENTS_VITE */,
13478  "tanstack-react" /* TANSTACK_REACT */
13479];
13480
13481// src/docs-tools/shared.ts
13482var ADDON_ID6 = "storybook/docs", PANEL_ID4 = `${ADDON_ID6}/panel`;
13483var SNIPPET_RENDERED = `${ADDON_ID6}/snippet-rendered`;
13484
13485// src/manager/components/TourGuide/TourGuide.tsx
13486init_react();
13487
vendor: 66 bytes, lines 13488-13490
13488// ../../node_modules/react-joyride/dist/index.mjs
13489init_react();
13490
vendor: 2,897 bytes, lines 13491-13568
13491// ../../node_modules/@gilbarbara/deep-equal/dist/index.mjs
13492function isOfType(type) {
13493  return (value) => typeof value === type;
13494}
13495var isFunction2 = isOfType("function"), isNull2 = (value) => value === null, isRegex = (value) => Object.prototype.toString.call(value).slice(8, -1) === "RegExp", isObject = (value) => !isUndefined2(value) && !isNull2(value) && (isFunction2(value) || typeof value == "object"), isUndefined2 = isOfType("undefined");
13496function equalArray(left, right) {
13497  let { length } = left;
13498  if (length !== right.length)
13499    return !1;
13500  for (let index = length; index-- !== 0; )
13501    if (!equal(left[index], right[index]))
13502      return !1;
13503  return !0;
13504}
13505function equalArrayBuffer(left, right) {
13506  if (left.byteLength !== right.byteLength)
13507    return !1;
13508  let view1 = new DataView(left.buffer), view2 = new DataView(right.buffer), index = left.byteLength;
13509  for (; index--; )
13510    if (view1.getUint8(index) !== view2.getUint8(index))
13511      return !1;
13512  return !0;
13513}
13514function equalMap(left, right) {
13515  if (left.size !== right.size)
13516    return !1;
13517  for (let index of left.entries())
13518    if (!right.has(index[0]))
13519      return !1;
13520  for (let index of left.entries())
13521    if (!equal(index[1], right.get(index[0])))
13522      return !1;
13523  return !0;
13524}
13525function equalSet(left, right) {
13526  if (left.size !== right.size)
13527    return !1;
13528  for (let index of left.entries())
13529    if (!right.has(index[0]))
13530      return !1;
13531  return !0;
13532}
13533function equal(left, right) {
13534  if (left === right)
13535    return !0;
13536  if (left && isObject(left) && right && isObject(right)) {
13537    if (left.constructor !== right.constructor)
13538      return !1;
13539    if (Array.isArray(left) && Array.isArray(right))
13540      return equalArray(left, right);
13541    if (left instanceof Map && right instanceof Map)
13542      return equalMap(left, right);
13543    if (left instanceof Set && right instanceof Set)
13544      return equalSet(left, right);
13545    if (ArrayBuffer.isView(left) && ArrayBuffer.isView(right))
13546      return equalArrayBuffer(left, right);
13547    if (isRegex(left) && isRegex(right))
13548      return left.source === right.source && left.flags === right.flags;
13549    if (left.valueOf !== Object.prototype.valueOf)
13550      return left.valueOf() === right.valueOf();
13551    if (left.toString !== Object.prototype.toString)
13552      return left.toString() === right.toString();
13553    let leftKeys = Object.keys(left), rightKeys = Object.keys(right);
13554    if (leftKeys.length !== rightKeys.length)
13555      return !1;
13556    for (let index = leftKeys.length; index-- !== 0; )
13557      if (!Object.prototype.hasOwnProperty.call(right, leftKeys[index]))
13558        return !1;
13559    for (let index = leftKeys.length; index-- !== 0; ) {
13560      let key = leftKeys[index];
13561      if (!(key === "_owner" && left.$$typeof) && !equal(left[key], right[key]))
13562        return !1;
13563    }
13564    return !0;
13565  }
13566  return Number.isNaN(left) && Number.isNaN(right) ? !0 : left === right;
13567}
13568
vendor: 4,371 bytes, lines 13569-13696
13569// ../../node_modules/is-lite/dist/index.mjs
13570var objectTypes = [
13571  "Array",
13572  "ArrayBuffer",
13573  "AsyncFunction",
13574  "AsyncGenerator",
13575  "AsyncGeneratorFunction",
13576  "Date",
13577  "Error",
13578  "Function",
13579  "Generator",
13580  "GeneratorFunction",
13581  "HTMLElement",
13582  "Map",
13583  "Object",
13584  "Promise",
13585  "RegExp",
13586  "Set",
13587  "WeakMap",
13588  "WeakSet"
13589], primitiveTypes = [
13590  "bigint",
13591  "boolean",
13592  "null",
13593  "number",
13594  "string",
13595  "symbol",
13596  "undefined"
13597];
13598function getObjectType(value) {
13599  let objectTypeName = Object.prototype.toString.call(value).slice(8, -1);
13600  if (/HTML\w+Element/.test(objectTypeName))
13601    return "HTMLElement";
13602  if (isObjectType(objectTypeName))
13603    return objectTypeName;
13604}
13605function isObjectOfType(type) {
13606  return (value) => getObjectType(value) === type;
13607}
13608function isObjectType(name) {
13609  return objectTypes.includes(name);
13610}
13611function isOfType2(type) {
13612  return (value) => typeof value === type;
13613}
13614function isPrimitiveType(name) {
13615  return primitiveTypes.includes(name);
13616}
13617var DOM_PROPERTIES_TO_CHECK = [
13618  "innerHTML",
13619  "ownerDocument",
13620  "style",
13621  "attributes",
13622  "nodeValue"
13623];
13624function is(value) {
13625  if (value === null)
13626    return "null";
13627  switch (typeof value) {
13628    case "bigint":
13629      return "bigint";
13630    case "boolean":
13631      return "boolean";
13632    case "number":
13633      return "number";
13634    case "string":
13635      return "string";
13636    case "symbol":
13637      return "symbol";
13638    case "undefined":
13639      return "undefined";
13640    default:
13641  }
13642  if (is.array(value))
13643    return "Array";
13644  if (is.plainFunction(value))
13645    return "Function";
13646  let tagType = getObjectType(value);
13647  return tagType || "Object";
13648}
13649is.array = Array.isArray;
13650is.arrayOf = (target, predicate) => !is.array(target) && !is.function(predicate) ? !1 : target.every((d2) => predicate(d2));
13651is.asyncGeneratorFunction = (value) => getObjectType(value) === "AsyncGeneratorFunction";
13652is.asyncFunction = isObjectOfType("AsyncFunction");
13653is.bigint = isOfType2("bigint");
13654is.boolean = (value) => value === !0 || value === !1;
13655is.date = isObjectOfType("Date");
13656is.defined = (value) => !is.undefined(value);
13657is.domElement = (value) => is.object(value) && !is.plainObject(value) && value.nodeType === 1 && is.string(value.nodeName) && DOM_PROPERTIES_TO_CHECK.every((property) => property in value);
13658is.empty = (value) => is.string(value) && value.length === 0 || is.array(value) && value.length === 0 || is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0 || is.set(value) && value.size === 0 || is.map(value) && value.size === 0;
13659is.error = isObjectOfType("Error");
13660is.function = isOfType2("function");
13661is.generator = (value) => is.iterable(value) && is.function(value.next) && is.function(value.throw);
13662is.generatorFunction = isObjectOfType("GeneratorFunction");
13663is.instanceOf = (instance, class_) => !instance || !class_ ? !1 : Object.getPrototypeOf(instance) === class_.prototype;
13664is.iterable = (value) => !is.nullOrUndefined(value) && is.function(value[Symbol.iterator]);
13665is.map = isObjectOfType("Map");
13666is.nan = (value) => Number.isNaN(value);
13667is.null = (value) => value === null;
13668is.nullOrUndefined = (value) => is.null(value) || is.undefined(value);
13669is.number = (value) => isOfType2("number")(value) && !is.nan(value);
13670is.numericString = (value) => is.string(value) && value.length > 0 && !Number.isNaN(Number(value));
13671is.object = (value) => !is.nullOrUndefined(value) && (is.function(value) || typeof value == "object");
13672is.oneOf = (target, value) => is.array(target) ? target.indexOf(value) > -1 : !1;
13673is.plainFunction = isObjectOfType("Function");
13674is.plainObject = (value) => {
13675  if (getObjectType(value) !== "Object")
13676    return !1;
13677  let prototype = Object.getPrototypeOf(value);
13678  return prototype === null || prototype === Object.getPrototypeOf({});
13679};
13680is.primitive = (value) => is.null(value) || isPrimitiveType(typeof value);
13681is.promise = isObjectOfType("Promise");
13682is.propertyOf = (target, key, predicate) => {
13683  if (!is.object(target) || !key)
13684    return !1;
13685  let value = target[key];
13686  return is.function(predicate) ? predicate(value) : is.defined(value);
13687};
13688is.regexp = isObjectOfType("RegExp");
13689is.set = isObjectOfType("Set");
13690is.string = isOfType2("string");
13691is.symbol = isOfType2("symbol");
13692is.undefined = isOfType2("undefined");
13693is.weakMap = isObjectOfType("WeakMap");
13694is.weakSet = isObjectOfType("WeakSet");
13695var src_default = is;
13696
vendor: 6,261 bytes, lines 13697-13818
13697// ../../node_modules/react-joyride/node_modules/tree-changes/dist/index.mjs
13698function canHaveLength(...arguments_) {
13699  return arguments_.every((d2) => src_default.string(d2) || src_default.array(d2) || src_default.plainObject(d2));
13700}
13701function checkEquality(left, right, value) {
13702  return isSameType(left, right) ? [left, right].every(src_default.array) ? !left.some(hasValue(value)) && right.some(hasValue(value)) : [left, right].every(src_default.plainObject) ? !Object.entries(left).some(hasEntry(value)) && Object.entries(right).some(hasEntry(value)) : right === value : !1;
13703}
13704function compareNumbers(previousData, data, options2) {
13705  let { actual, key, previous, type } = options2, left = nested(previousData, key), right = nested(data, key), changed = [left, right].every(src_default.number) && (type === "increased" ? left < right : left > right);
13706  return src_default.undefined(actual) || (changed = changed && right === actual), src_default.undefined(previous) || (changed = changed && left === previous), changed;
13707}
13708function compareValues(previousData, data, options2) {
13709  let { key, type, value } = options2, left = nested(previousData, key), right = nested(data, key), primary = type === "added" ? left : right, secondary = type === "added" ? right : left;
13710  if (!src_default.nullOrUndefined(value)) {
13711    if (src_default.defined(primary)) {
13712      if (src_default.array(primary) || src_default.plainObject(primary))
13713        return checkEquality(primary, secondary, value);
13714    } else
13715      return equal(secondary, value);
13716    return !1;
13717  }
13718  return [left, right].every(src_default.array) ? !secondary.every(isEqualPredicate(primary)) : [left, right].every(src_default.plainObject) ? hasExtraKeys(Object.keys(primary), Object.keys(secondary)) : ![left, right].every((d2) => src_default.primitive(d2) && src_default.defined(d2)) && (type === "added" ? !src_default.defined(left) && src_default.defined(right) : src_default.defined(left) && !src_default.defined(right));
13719}
13720function getIterables(previousData, data, { key } = {}) {
13721  let left = nested(previousData, key), right = nested(data, key);
13722  if (!isSameType(left, right))
13723    throw new TypeError("Inputs have different types");
13724  if (!canHaveLength(left, right))
13725    throw new TypeError("Inputs don't have length");
13726  return [left, right].every(src_default.plainObject) && (left = Object.keys(left), right = Object.keys(right)), [left, right];
13727}
13728function hasEntry(input) {
13729  return ([key, value]) => src_default.array(input) ? equal(input, value) || input.some((d2) => equal(d2, value) || src_default.array(value) && isEqualPredicate(value)(d2)) : src_default.plainObject(input) && input[key] ? !!input[key] && equal(input[key], value) : equal(input, value);
13730}
13731function hasExtraKeys(left, right) {
13732  return right.some((d2) => !left.includes(d2));
13733}
13734function hasValue(input) {
13735  return (value) => src_default.array(input) ? input.some((d2) => equal(d2, value) || src_default.array(value) && isEqualPredicate(value)(d2)) : equal(input, value);
13736}
13737function includesOrEqualsTo(previousValue, value) {
13738  return src_default.array(previousValue) ? previousValue.some((d2) => equal(d2, value)) : equal(previousValue, value);
13739}
13740function isEqualPredicate(data) {
13741  return (value) => data.some((d2) => equal(d2, value));
13742}
13743function isSameType(...arguments_) {
13744  return arguments_.every(src_default.array) || arguments_.every(src_default.number) || arguments_.every(src_default.plainObject) || arguments_.every(src_default.string);
13745}
13746function nested(data, property) {
13747  return src_default.plainObject(data) || src_default.array(data) ? src_default.string(property) ? property.split(".").reduce((acc, d2) => acc && acc[d2], data) : src_default.number(property) ? data[property] : data : data;
13748}
13749function treeChanges(previousData, data) {
13750  if ([previousData, data].some(src_default.nullOrUndefined))
13751    throw new Error("Missing required parameters");
13752  if (![previousData, data].every((d2) => src_default.plainObject(d2) || src_default.array(d2)))
13753    throw new Error("Expected plain objects or array");
13754  return { added: (key, value) => {
13755    try {
13756      return compareValues(previousData, data, { key, type: "added", value });
13757    } catch {
13758      return !1;
13759    }
13760  }, changed: (key, actual, previous) => {
13761    try {
13762      let left = nested(previousData, key), right = nested(data, key), hasActual = src_default.defined(actual), hasPrevious = src_default.defined(previous);
13763      if (hasActual || hasPrevious) {
13764        let leftComparator = hasPrevious ? includesOrEqualsTo(previous, left) : !includesOrEqualsTo(actual, left), rightComparator = includesOrEqualsTo(actual, right);
13765        return leftComparator && rightComparator;
13766      }
13767      return [left, right].every(src_default.array) || [left, right].every(src_default.plainObject) ? !equal(left, right) : left !== right;
13768    } catch {
13769      return !1;
13770    }
13771  }, changedFrom: (key, previous, actual) => {
13772    if (!src_default.defined(key))
13773      return !1;
13774    try {
13775      let left = nested(previousData, key), right = nested(data, key), hasActual = src_default.defined(actual);
13776      return includesOrEqualsTo(previous, left) && (hasActual ? includesOrEqualsTo(actual, right) : !hasActual);
13777    } catch {
13778      return !1;
13779    }
13780  }, decreased: (key, actual, previous) => {
13781    if (!src_default.defined(key))
13782      return !1;
13783    try {
13784      return compareNumbers(previousData, data, { key, actual, previous, type: "decreased" });
13785    } catch {
13786      return !1;
13787    }
13788  }, emptied: (key) => {
13789    try {
13790      let [left, right] = getIterables(previousData, data, { key });
13791      return !!left.length && !right.length;
13792    } catch {
13793      return !1;
13794    }
13795  }, filled: (key) => {
13796    try {
13797      let [left, right] = getIterables(previousData, data, { key });
13798      return !left.length && !!right.length;
13799    } catch {
13800      return !1;
13801    }
13802  }, increased: (key, actual, previous) => {
13803    if (!src_default.defined(key))
13804      return !1;
13805    try {
13806      return compareNumbers(previousData, data, { key, actual, previous, type: "increased" });
13807    } catch {
13808      return !1;
13809    }
13810  }, removed: (key, value) => {
13811    try {
13812      return compareValues(previousData, data, { key, type: "removed", value });
13813    } catch {
13814      return !1;
13815    }
13816  } };
13817}
13818
vendor: 400 bytes, lines 13819-13829
13819// ../../node_modules/react-joyride/dist/index.mjs
13820var import_scroll = __toESM(require_scroll(), 1), import_scrollparent = __toESM(require_scrollparent(), 1);
13821init_react();
13822var import_react_innertext = __toESM(require_react_innertext(), 1);
13823var import_deepmerge2 = __toESM(require_cjs(), 1);
13824var import_deepmerge3 = __toESM(require_cjs(), 1);
13825init_react();
13826init_react();
13827init_react();
13828init_react();
13829
vendor: 119 bytes, lines 13830-13833
13830// ../../node_modules/react-floater/es/index.js
13831init_react();
13832var import_prop_types2 = __toESM(require_prop_types());
13833
vendor: 55,056 bytes, lines 13834-14846
13834// ../../node_modules/popper.js/dist/esm/popper.js
13835var isBrowser2 = typeof window < "u" && typeof document < "u" && typeof navigator < "u", timeoutDuration = (function() {
13836  for (var longerTimeoutBrowsers = ["Edge", "Trident", "Firefox"], i2 = 0; i2 < longerTimeoutBrowsers.length; i2 += 1)
13837    if (isBrowser2 && navigator.userAgent.indexOf(longerTimeoutBrowsers[i2]) >= 0)
13838      return 1;
13839  return 0;
13840})();
13841function microtaskDebounce(fn) {
13842  var called = !1;
13843  return function() {
13844    called || (called = !0, window.Promise.resolve().then(function() {
13845      called = !1, fn();
13846    }));
13847  };
13848}
13849function taskDebounce(fn) {
13850  var scheduled = !1;
13851  return function() {
13852    scheduled || (scheduled = !0, setTimeout(function() {
13853      scheduled = !1, fn();
13854    }, timeoutDuration));
13855  };
13856}
13857var supportsMicroTasks = isBrowser2 && window.Promise, debounce2 = supportsMicroTasks ? microtaskDebounce : taskDebounce;
13858function isFunction3(functionToCheck) {
13859  var getType = {};
13860  return functionToCheck && getType.toString.call(functionToCheck) === "[object Function]";
13861}
13862function getStyleComputedProperty(element, property) {
13863  if (element.nodeType !== 1)
13864    return [];
13865  var window2 = element.ownerDocument.defaultView, css2 = window2.getComputedStyle(element, null);
13866  return property ? css2[property] : css2;
13867}
13868function getParentNode(element) {
13869  return element.nodeName === "HTML" ? element : element.parentNode || element.host;
13870}
13871function getScrollParent(element) {
13872  if (!element)
13873    return document.body;
13874  switch (element.nodeName) {
13875    case "HTML":
13876    case "BODY":
13877      return element.ownerDocument.body;
13878    case "#document":
13879      return element.body;
13880  }
13881  var _getStyleComputedProp = getStyleComputedProperty(element), overflow = _getStyleComputedProp.overflow, overflowX = _getStyleComputedProp.overflowX, overflowY = _getStyleComputedProp.overflowY;
13882  return /(auto|scroll|overlay)/.test(overflow + overflowY + overflowX) ? element : getScrollParent(getParentNode(element));
13883}
13884function getReferenceNode(reference) {
13885  return reference && reference.referenceNode ? reference.referenceNode : reference;
13886}
13887var isIE11 = isBrowser2 && !!(window.MSInputMethodContext && document.documentMode), isIE10 = isBrowser2 && /MSIE 10/.test(navigator.userAgent);
13888function isIE(version3) {
13889  return version3 === 11 ? isIE11 : version3 === 10 ? isIE10 : isIE11 || isIE10;
13890}
13891function getOffsetParent(element) {
13892  if (!element)
13893    return document.documentElement;
13894  for (var noOffsetParent = isIE(10) ? document.body : null, offsetParent = element.offsetParent || null; offsetParent === noOffsetParent && element.nextElementSibling; )
13895    offsetParent = (element = element.nextElementSibling).offsetParent;
13896  var nodeName = offsetParent && offsetParent.nodeName;
13897  return !nodeName || nodeName === "BODY" || nodeName === "HTML" ? element ? element.ownerDocument.documentElement : document.documentElement : ["TH", "TD", "TABLE"].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, "position") === "static" ? getOffsetParent(offsetParent) : offsetParent;
13898}
13899function isOffsetContainer(element) {
13900  var nodeName = element.nodeName;
13901  return nodeName === "BODY" ? !1 : nodeName === "HTML" || getOffsetParent(element.firstElementChild) === element;
13902}
13903function getRoot(node) {
13904  return node.parentNode !== null ? getRoot(node.parentNode) : node;
13905}
13906function findCommonOffsetParent(element1, element2) {
13907  if (!element1 || !element1.nodeType || !element2 || !element2.nodeType)
13908    return document.documentElement;
13909  var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING, start = order ? element1 : element2, end = order ? element2 : element1, range = document.createRange();
13910  range.setStart(start, 0), range.setEnd(end, 0);
13911  var commonAncestorContainer = range.commonAncestorContainer;
13912  if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end))
13913    return isOffsetContainer(commonAncestorContainer) ? commonAncestorContainer : getOffsetParent(commonAncestorContainer);
13914  var element1root = getRoot(element1);
13915  return element1root.host ? findCommonOffsetParent(element1root.host, element2) : findCommonOffsetParent(element1, getRoot(element2).host);
13916}
13917function getScroll(element) {
13918  var side = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "top", upperSide = side === "top" ? "scrollTop" : "scrollLeft", nodeName = element.nodeName;
13919  if (nodeName === "BODY" || nodeName === "HTML") {
13920    var html = element.ownerDocument.documentElement, scrollingElement = element.ownerDocument.scrollingElement || html;
13921    return scrollingElement[upperSide];
13922  }
13923  return element[upperSide];
13924}
13925function includeScroll(rect, element) {
13926  var subtract = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, scrollTop = getScroll(element, "top"), scrollLeft = getScroll(element, "left"), modifier = subtract ? -1 : 1;
13927  return rect.top += scrollTop * modifier, rect.bottom += scrollTop * modifier, rect.left += scrollLeft * modifier, rect.right += scrollLeft * modifier, rect;
13928}
13929function getBordersSize(styles2, axis) {
13930  var sideA = axis === "x" ? "Left" : "Top", sideB = sideA === "Left" ? "Right" : "Bottom";
13931  return parseFloat(styles2["border" + sideA + "Width"]) + parseFloat(styles2["border" + sideB + "Width"]);
13932}
13933function getSize(axis, body, html, computedStyle) {
13934  return Math.max(body["offset" + axis], body["scroll" + axis], html["client" + axis], html["offset" + axis], html["scroll" + axis], isIE(10) ? parseInt(html["offset" + axis]) + parseInt(computedStyle["margin" + (axis === "Height" ? "Top" : "Left")]) + parseInt(computedStyle["margin" + (axis === "Height" ? "Bottom" : "Right")]) : 0);
13935}
13936function getWindowSizes(document11) {
13937  var body = document11.body, html = document11.documentElement, computedStyle = isIE(10) && getComputedStyle(html);
13938  return {
13939    height: getSize("Height", body, html, computedStyle),
13940    width: getSize("Width", body, html, computedStyle)
13941  };
13942}
13943var classCallCheck = function(instance, Constructor) {
13944  if (!(instance instanceof Constructor))
13945    throw new TypeError("Cannot call a class as a function");
13946}, createClass = /* @__PURE__ */ (function() {
13947  function defineProperties(target, props) {
13948    for (var i2 = 0; i2 < props.length; i2++) {
13949      var descriptor = props[i2];
13950      descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
13951    }
13952  }
13953  return function(Constructor, protoProps, staticProps) {
13954    return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor;
13955  };
13956})(), defineProperty = function(obj, key, value) {
13957  return key in obj ? Object.defineProperty(obj, key, {
13958    value,
13959    enumerable: !0,
13960    configurable: !0,
13961    writable: !0
13962  }) : obj[key] = value, obj;
13963}, _extends2 = Object.assign || function(target) {
13964  for (var i2 = 1; i2 < arguments.length; i2++) {
13965    var source = arguments[i2];
13966    for (var key in source)
13967      Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
13968  }
13969  return target;
13970};
13971function getClientRect(offsets) {
13972  return _extends2({}, offsets, {
13973    right: offsets.left + offsets.width,
13974    bottom: offsets.top + offsets.height
13975  });
13976}
13977function getBoundingClientRect(element) {
13978  var rect = {};
13979  try {
13980    if (isIE(10)) {
13981      rect = element.getBoundingClientRect();
13982      var scrollTop = getScroll(element, "top"), scrollLeft = getScroll(element, "left");
13983      rect.top += scrollTop, rect.left += scrollLeft, rect.bottom += scrollTop, rect.right += scrollLeft;
13984    } else
13985      rect = element.getBoundingClientRect();
13986  } catch {
13987  }
13988  var result = {
13989    left: rect.left,
13990    top: rect.top,
13991    width: rect.right - rect.left,
13992    height: rect.bottom - rect.top
13993  }, sizes = element.nodeName === "HTML" ? getWindowSizes(element.ownerDocument) : {}, width = sizes.width || element.clientWidth || result.width, height = sizes.height || element.clientHeight || result.height, horizScrollbar = element.offsetWidth - width, vertScrollbar = element.offsetHeight - height;
13994  if (horizScrollbar || vertScrollbar) {
13995    var styles2 = getStyleComputedProperty(element);
13996    horizScrollbar -= getBordersSize(styles2, "x"), vertScrollbar -= getBordersSize(styles2, "y"), result.width -= horizScrollbar, result.height -= vertScrollbar;
13997  }
13998  return getClientRect(result);
13999}
14000function getOffsetRectRelativeToArbitraryNode(children, parent) {
14001  var fixedPosition = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, isIE102 = isIE(10), isHTML = parent.nodeName === "HTML", childrenRect = getBoundingClientRect(children), parentRect = getBoundingClientRect(parent), scrollParent2 = getScrollParent(children), styles2 = getStyleComputedProperty(parent), borderTopWidth = parseFloat(styles2.borderTopWidth), borderLeftWidth = parseFloat(styles2.borderLeftWidth);
14002  fixedPosition && isHTML && (parentRect.top = Math.max(parentRect.top, 0), parentRect.left = Math.max(parentRect.left, 0));
14003  var offsets = getClientRect({
14004    top: childrenRect.top - parentRect.top - borderTopWidth,
14005    left: childrenRect.left - parentRect.left - borderLeftWidth,
14006    width: childrenRect.width,
14007    height: childrenRect.height
14008  });
14009  if (offsets.marginTop = 0, offsets.marginLeft = 0, !isIE102 && isHTML) {
14010    var marginTop = parseFloat(styles2.marginTop), marginLeft = parseFloat(styles2.marginLeft);
14011    offsets.top -= borderTopWidth - marginTop, offsets.bottom -= borderTopWidth - marginTop, offsets.left -= borderLeftWidth - marginLeft, offsets.right -= borderLeftWidth - marginLeft, offsets.marginTop = marginTop, offsets.marginLeft = marginLeft;
14012  }
14013  return (isIE102 && !fixedPosition ? parent.contains(scrollParent2) : parent === scrollParent2 && scrollParent2.nodeName !== "BODY") && (offsets = includeScroll(offsets, parent)), offsets;
14014}
14015function getViewportOffsetRectRelativeToArtbitraryNode(element) {
14016  var excludeScroll = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, html = element.ownerDocument.documentElement, relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html), width = Math.max(html.clientWidth, window.innerWidth || 0), height = Math.max(html.clientHeight, window.innerHeight || 0), scrollTop = excludeScroll ? 0 : getScroll(html), scrollLeft = excludeScroll ? 0 : getScroll(html, "left"), offset2 = {
14017    top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
14018    left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
14019    width,
14020    height
14021  };
14022  return getClientRect(offset2);
14023}
14024function isFixed(element) {
14025  var nodeName = element.nodeName;
14026  if (nodeName === "BODY" || nodeName === "HTML")
14027    return !1;
14028  if (getStyleComputedProperty(element, "position") === "fixed")
14029    return !0;
14030  var parentNode = getParentNode(element);
14031  return parentNode ? isFixed(parentNode) : !1;
14032}
14033function getFixedPositionOffsetParent(element) {
14034  if (!element || !element.parentElement || isIE())
14035    return document.documentElement;
14036  for (var el = element.parentElement; el && getStyleComputedProperty(el, "transform") === "none"; )
14037    el = el.parentElement;
14038  return el || document.documentElement;
14039}
14040function getBoundaries(popper, reference, padding, boundariesElement) {
14041  var fixedPosition = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, boundaries = { top: 0, left: 0 }, offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
14042  if (boundariesElement === "viewport")
14043    boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
14044  else {
14045    var boundariesNode = void 0;
14046    boundariesElement === "scrollParent" ? (boundariesNode = getScrollParent(getParentNode(reference)), boundariesNode.nodeName === "BODY" && (boundariesNode = popper.ownerDocument.documentElement)) : boundariesElement === "window" ? boundariesNode = popper.ownerDocument.documentElement : boundariesNode = boundariesElement;
14047    var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
14048    if (boundariesNode.nodeName === "HTML" && !isFixed(offsetParent)) {
14049      var _getWindowSizes = getWindowSizes(popper.ownerDocument), height = _getWindowSizes.height, width = _getWindowSizes.width;
14050      boundaries.top += offsets.top - offsets.marginTop, boundaries.bottom = height + offsets.top, boundaries.left += offsets.left - offsets.marginLeft, boundaries.right = width + offsets.left;
14051    } else
14052      boundaries = offsets;
14053  }
14054  padding = padding || 0;
14055  var isPaddingNumber = typeof padding == "number";
14056  return boundaries.left += isPaddingNumber ? padding : padding.left || 0, boundaries.top += isPaddingNumber ? padding : padding.top || 0, boundaries.right -= isPaddingNumber ? padding : padding.right || 0, boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0, boundaries;
14057}
14058function getArea(_ref) {
14059  var width = _ref.width, height = _ref.height;
14060  return width * height;
14061}
14062function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
14063  var padding = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 0;
14064  if (placement.indexOf("auto") === -1)
14065    return placement;
14066  var boundaries = getBoundaries(popper, reference, padding, boundariesElement), rects = {
14067    top: {
14068      width: boundaries.width,
14069      height: refRect.top - boundaries.top
14070    },
14071    right: {
14072      width: boundaries.right - refRect.right,
14073      height: boundaries.height
14074    },
14075    bottom: {
14076      width: boundaries.width,
14077      height: boundaries.bottom - refRect.bottom
14078    },
14079    left: {
14080      width: refRect.left - boundaries.left,
14081      height: boundaries.height
14082    }
14083  }, sortedAreas = Object.keys(rects).map(function(key) {
14084    return _extends2({
14085      key
14086    }, rects[key], {
14087      area: getArea(rects[key])
14088    });
14089  }).sort(function(a2, b2) {
14090    return b2.area - a2.area;
14091  }), filteredAreas = sortedAreas.filter(function(_ref2) {
14092    var width = _ref2.width, height = _ref2.height;
14093    return width >= popper.clientWidth && height >= popper.clientHeight;
14094  }), computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key, variation = placement.split("-")[1];
14095  return computedPlacement + (variation ? "-" + variation : "");
14096}
14097function getReferenceOffsets(state, popper, reference) {
14098  var fixedPosition = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
14099  return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
14100}
14101function getOuterSizes(element) {
14102  var window2 = element.ownerDocument.defaultView, styles2 = window2.getComputedStyle(element), x2 = parseFloat(styles2.marginTop || 0) + parseFloat(styles2.marginBottom || 0), y2 = parseFloat(styles2.marginLeft || 0) + parseFloat(styles2.marginRight || 0), result = {
14103    width: element.offsetWidth + y2,
14104    height: element.offsetHeight + x2
14105  };
14106  return result;
14107}
14108function getOppositePlacement(placement) {
14109  var hash = { left: "right", right: "left", bottom: "top", top: "bottom" };
14110  return placement.replace(/left|right|bottom|top/g, function(matched) {
14111    return hash[matched];
14112  });
14113}
14114function getPopperOffsets(popper, referenceOffsets, placement) {
14115  placement = placement.split("-")[0];
14116  var popperRect = getOuterSizes(popper), popperOffsets = {
14117    width: popperRect.width,
14118    height: popperRect.height
14119  }, isHoriz = ["right", "left"].indexOf(placement) !== -1, mainSide = isHoriz ? "top" : "left", secondarySide = isHoriz ? "left" : "top", measurement = isHoriz ? "height" : "width", secondaryMeasurement = isHoriz ? "width" : "height";
14120  return popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2, placement === secondarySide ? popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement] : popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)], popperOffsets;
14121}
14122function find(arr, check) {
14123  return Array.prototype.find ? arr.find(check) : arr.filter(check)[0];
14124}
14125function findIndex(arr, prop, value) {
14126  if (Array.prototype.findIndex)
14127    return arr.findIndex(function(cur) {
14128      return cur[prop] === value;
14129    });
14130  var match = find(arr, function(obj) {
14131    return obj[prop] === value;
14132  });
14133  return arr.indexOf(match);
14134}
14135function runModifiers(modifiers2, data, ends) {
14136  var modifiersToRun = ends === void 0 ? modifiers2 : modifiers2.slice(0, findIndex(modifiers2, "name", ends));
14137  return modifiersToRun.forEach(function(modifier) {
14138    modifier.function && console.warn("`modifier.function` is deprecated, use `modifier.fn`!");
14139    var fn = modifier.function || modifier.fn;
14140    modifier.enabled && isFunction3(fn) && (data.offsets.popper = getClientRect(data.offsets.popper), data.offsets.reference = getClientRect(data.offsets.reference), data = fn(data, modifier));
14141  }), data;
14142}
14143function update() {
14144  if (!this.state.isDestroyed) {
14145    var data = {
14146      instance: this,
14147      styles: {},
14148      arrowStyles: {},
14149      attributes: {},
14150      flipped: !1,
14151      offsets: {}
14152    };
14153    data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed), data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding), data.originalPlacement = data.placement, data.positionFixed = this.options.positionFixed, data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement), data.offsets.popper.position = this.options.positionFixed ? "fixed" : "absolute", data = runModifiers(this.modifiers, data), this.state.isCreated ? this.options.onUpdate(data) : (this.state.isCreated = !0, this.options.onCreate(data));
14154  }
14155}
14156function isModifierEnabled(modifiers2, modifierName) {
14157  return modifiers2.some(function(_ref) {
14158    var name = _ref.name, enabled = _ref.enabled;
14159    return enabled && name === modifierName;
14160  });
14161}
14162function getSupportedPropertyName(property) {
14163  for (var prefixes = [!1, "ms", "Webkit", "Moz", "O"], upperProp = property.charAt(0).toUpperCase() + property.slice(1), i2 = 0; i2 < prefixes.length; i2++) {
14164    var prefix = prefixes[i2], toCheck = prefix ? "" + prefix + upperProp : property;
14165    if (typeof document.body.style[toCheck] < "u")
14166      return toCheck;
14167  }
14168  return null;
14169}
14170function destroy() {
14171  return this.state.isDestroyed = !0, isModifierEnabled(this.modifiers, "applyStyle") && (this.popper.removeAttribute("x-placement"), this.popper.style.position = "", this.popper.style.top = "", this.popper.style.left = "", this.popper.style.right = "", this.popper.style.bottom = "", this.popper.style.willChange = "", this.popper.style[getSupportedPropertyName("transform")] = ""), this.disableEventListeners(), this.options.removeOnDestroy && this.popper.parentNode.removeChild(this.popper), this;
14172}
14173function getWindow(element) {
14174  var ownerDocument = element.ownerDocument;
14175  return ownerDocument ? ownerDocument.defaultView : window;
14176}
14177function attachToScrollParents(scrollParent2, event, callback, scrollParents) {
14178  var isBody = scrollParent2.nodeName === "BODY", target = isBody ? scrollParent2.ownerDocument.defaultView : scrollParent2;
14179  target.addEventListener(event, callback, { passive: !0 }), isBody || attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents), scrollParents.push(target);
14180}
14181function setupEventListeners(reference, options2, state, updateBound) {
14182  state.updateBound = updateBound, getWindow(reference).addEventListener("resize", state.updateBound, { passive: !0 });
14183  var scrollElement = getScrollParent(reference);
14184  return attachToScrollParents(scrollElement, "scroll", state.updateBound, state.scrollParents), state.scrollElement = scrollElement, state.eventsEnabled = !0, state;
14185}
14186function enableEventListeners() {
14187  this.state.eventsEnabled || (this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate));
14188}
14189function removeEventListeners(reference, state) {
14190  return getWindow(reference).removeEventListener("resize", state.updateBound), state.scrollParents.forEach(function(target) {
14191    target.removeEventListener("scroll", state.updateBound);
14192  }), state.updateBound = null, state.scrollParents = [], state.scrollElement = null, state.eventsEnabled = !1, state;
14193}
14194function disableEventListeners() {
14195  this.state.eventsEnabled && (cancelAnimationFrame(this.scheduleUpdate), this.state = removeEventListeners(this.reference, this.state));
14196}
14197function isNumeric(n3) {
14198  return n3 !== "" && !isNaN(parseFloat(n3)) && isFinite(n3);
14199}
14200function setStyles(element, styles2) {
14201  Object.keys(styles2).forEach(function(prop) {
14202    var unit = "";
14203    ["width", "height", "top", "right", "bottom", "left"].indexOf(prop) !== -1 && isNumeric(styles2[prop]) && (unit = "px"), element.style[prop] = styles2[prop] + unit;
14204  });
14205}
14206function setAttributes(element, attributes) {
14207  Object.keys(attributes).forEach(function(prop) {
14208    var value = attributes[prop];
14209    value !== !1 ? element.setAttribute(prop, attributes[prop]) : element.removeAttribute(prop);
14210  });
14211}
14212function applyStyle(data) {
14213  return setStyles(data.instance.popper, data.styles), setAttributes(data.instance.popper, data.attributes), data.arrowElement && Object.keys(data.arrowStyles).length && setStyles(data.arrowElement, data.arrowStyles), data;
14214}
14215function applyStyleOnLoad(reference, popper, options2, modifierOptions, state) {
14216  var referenceOffsets = getReferenceOffsets(state, popper, reference, options2.positionFixed), placement = computeAutoPlacement(options2.placement, referenceOffsets, popper, reference, options2.modifiers.flip.boundariesElement, options2.modifiers.flip.padding);
14217  return popper.setAttribute("x-placement", placement), setStyles(popper, { position: options2.positionFixed ? "fixed" : "absolute" }), options2;
14218}
14219function getRoundedOffsets(data, shouldRound) {
14220  var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, round = Math.round, floor = Math.floor, noRound = function(v2) {
14221    return v2;
14222  }, referenceWidth = round(reference.width), popperWidth = round(popper.width), isVertical = ["left", "right"].indexOf(data.placement) !== -1, isVariation = data.placement.indexOf("-") !== -1, sameWidthParity = referenceWidth % 2 === popperWidth % 2, bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1, horizontalToInteger = shouldRound ? isVertical || isVariation || sameWidthParity ? round : floor : noRound, verticalToInteger = shouldRound ? round : noRound;
14223  return {
14224    left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
14225    top: verticalToInteger(popper.top),
14226    bottom: verticalToInteger(popper.bottom),
14227    right: horizontalToInteger(popper.right)
14228  };
14229}
14230var isFirefox = isBrowser2 && /Firefox/i.test(navigator.userAgent);
14231function computeStyle(data, options2) {
14232  var x2 = options2.x, y2 = options2.y, popper = data.offsets.popper, legacyGpuAccelerationOption = find(data.instance.modifiers, function(modifier) {
14233    return modifier.name === "applyStyle";
14234  }).gpuAcceleration;
14235  legacyGpuAccelerationOption !== void 0 && console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");
14236  var gpuAcceleration = legacyGpuAccelerationOption !== void 0 ? legacyGpuAccelerationOption : options2.gpuAcceleration, offsetParent = getOffsetParent(data.instance.popper), offsetParentRect = getBoundingClientRect(offsetParent), styles2 = {
14237    position: popper.position
14238  }, offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox), sideA = x2 === "bottom" ? "top" : "bottom", sideB = y2 === "right" ? "left" : "right", prefixedProperty = getSupportedPropertyName("transform"), left = void 0, top = void 0;
14239  if (sideA === "bottom" ? offsetParent.nodeName === "HTML" ? top = -offsetParent.clientHeight + offsets.bottom : top = -offsetParentRect.height + offsets.bottom : top = offsets.top, sideB === "right" ? offsetParent.nodeName === "HTML" ? left = -offsetParent.clientWidth + offsets.right : left = -offsetParentRect.width + offsets.right : left = offsets.left, gpuAcceleration && prefixedProperty)
14240    styles2[prefixedProperty] = "translate3d(" + left + "px, " + top + "px, 0)", styles2[sideA] = 0, styles2[sideB] = 0, styles2.willChange = "transform";
14241  else {
14242    var invertTop = sideA === "bottom" ? -1 : 1, invertLeft = sideB === "right" ? -1 : 1;
14243    styles2[sideA] = top * invertTop, styles2[sideB] = left * invertLeft, styles2.willChange = sideA + ", " + sideB;
14244  }
14245  var attributes = {
14246    "x-placement": data.placement
14247  };
14248  return data.attributes = _extends2({}, attributes, data.attributes), data.styles = _extends2({}, styles2, data.styles), data.arrowStyles = _extends2({}, data.offsets.arrow, data.arrowStyles), data;
14249}
14250function isModifierRequired(modifiers2, requestingName, requestedName) {
14251  var requesting = find(modifiers2, function(_ref) {
14252    var name = _ref.name;
14253    return name === requestingName;
14254  }), isRequired = !!requesting && modifiers2.some(function(modifier) {
14255    return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
14256  });
14257  if (!isRequired) {
14258    var _requesting = "`" + requestingName + "`", requested = "`" + requestedName + "`";
14259    console.warn(requested + " modifier is required by " + _requesting + " modifier in order to work, be sure to include it before " + _requesting + "!");
14260  }
14261  return isRequired;
14262}
14263function arrow(data, options2) {
14264  var _data$offsets$arrow;
14265  if (!isModifierRequired(data.instance.modifiers, "arrow", "keepTogether"))
14266    return data;
14267  var arrowElement = options2.element;
14268  if (typeof arrowElement == "string") {
14269    if (arrowElement = data.instance.popper.querySelector(arrowElement), !arrowElement)
14270      return data;
14271  } else if (!data.instance.popper.contains(arrowElement))
14272    return console.warn("WARNING: `arrow.element` must be child of its popper element!"), data;
14273  var placement = data.placement.split("-")[0], _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, isVertical = ["left", "right"].indexOf(placement) !== -1, len = isVertical ? "height" : "width", sideCapitalized = isVertical ? "Top" : "Left", side = sideCapitalized.toLowerCase(), altSide = isVertical ? "left" : "top", opSide = isVertical ? "bottom" : "right", arrowElementSize = getOuterSizes(arrowElement)[len];
14274  reference[opSide] - arrowElementSize < popper[side] && (data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize)), reference[side] + arrowElementSize > popper[opSide] && (data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]), data.offsets.popper = getClientRect(data.offsets.popper);
14275  var center = reference[side] + reference[len] / 2 - arrowElementSize / 2, css2 = getStyleComputedProperty(data.instance.popper), popperMarginSide = parseFloat(css2["margin" + sideCapitalized]), popperBorderSide = parseFloat(css2["border" + sideCapitalized + "Width"]), sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
14276  return sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0), data.arrowElement = arrowElement, data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ""), _data$offsets$arrow), data;
14277}
14278function getOppositeVariation(variation) {
14279  return variation === "end" ? "start" : variation === "start" ? "end" : variation;
14280}
14281var placements = ["auto-start", "auto", "auto-end", "top-start", "top", "top-end", "right-start", "right", "right-end", "bottom-end", "bottom", "bottom-start", "left-end", "left", "left-start"], validPlacements = placements.slice(3);
14282function clockwise(placement) {
14283  var counter = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, index = validPlacements.indexOf(placement), arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
14284  return counter ? arr.reverse() : arr;
14285}
14286var BEHAVIORS = {
14287  FLIP: "flip",
14288  CLOCKWISE: "clockwise",
14289  COUNTERCLOCKWISE: "counterclockwise"
14290};
14291function flip(data, options2) {
14292  if (isModifierEnabled(data.instance.modifiers, "inner") || data.flipped && data.placement === data.originalPlacement)
14293    return data;
14294  var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options2.padding, options2.boundariesElement, data.positionFixed), placement = data.placement.split("-")[0], placementOpposite = getOppositePlacement(placement), variation = data.placement.split("-")[1] || "", flipOrder = [];
14295  switch (options2.behavior) {
14296    case BEHAVIORS.FLIP:
14297      flipOrder = [placement, placementOpposite];
14298      break;
14299    case BEHAVIORS.CLOCKWISE:
14300      flipOrder = clockwise(placement);
14301      break;
14302    case BEHAVIORS.COUNTERCLOCKWISE:
14303      flipOrder = clockwise(placement, !0);
14304      break;
14305    default:
14306      flipOrder = options2.behavior;
14307  }
14308  return flipOrder.forEach(function(step, index) {
14309    if (placement !== step || flipOrder.length === index + 1)
14310      return data;
14311    placement = data.placement.split("-")[0], placementOpposite = getOppositePlacement(placement);
14312    var popperOffsets = data.offsets.popper, refOffsets = data.offsets.reference, floor = Math.floor, overlapsRef = placement === "left" && floor(popperOffsets.right) > floor(refOffsets.left) || placement === "right" && floor(popperOffsets.left) < floor(refOffsets.right) || placement === "top" && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === "bottom" && floor(popperOffsets.top) < floor(refOffsets.bottom), overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left), overflowsRight = floor(popperOffsets.right) > floor(boundaries.right), overflowsTop = floor(popperOffsets.top) < floor(boundaries.top), overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom), overflowsBoundaries = placement === "left" && overflowsLeft || placement === "right" && overflowsRight || placement === "top" && overflowsTop || placement === "bottom" && overflowsBottom, isVertical = ["top", "bottom"].indexOf(placement) !== -1, flippedVariationByRef = !!options2.flipVariations && (isVertical && variation === "start" && overflowsLeft || isVertical && variation === "end" && overflowsRight || !isVertical && variation === "start" && overflowsTop || !isVertical && variation === "end" && overflowsBottom), flippedVariationByContent = !!options2.flipVariationsByContent && (isVertical && variation === "start" && overflowsRight || isVertical && variation === "end" && overflowsLeft || !isVertical && variation === "start" && overflowsBottom || !isVertical && variation === "end" && overflowsTop), flippedVariation = flippedVariationByRef || flippedVariationByContent;
14313    (overlapsRef || overflowsBoundaries || flippedVariation) && (data.flipped = !0, (overlapsRef || overflowsBoundaries) && (placement = flipOrder[index + 1]), flippedVariation && (variation = getOppositeVariation(variation)), data.placement = placement + (variation ? "-" + variation : ""), data.offsets.popper = _extends2({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)), data = runModifiers(data.instance.modifiers, data, "flip"));
14314  }), data;
14315}
14316function keepTogether(data) {
14317  var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, placement = data.placement.split("-")[0], floor = Math.floor, isVertical = ["top", "bottom"].indexOf(placement) !== -1, side = isVertical ? "right" : "bottom", opSide = isVertical ? "left" : "top", measurement = isVertical ? "width" : "height";
14318  return popper[side] < floor(reference[opSide]) && (data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]), popper[opSide] > floor(reference[side]) && (data.offsets.popper[opSide] = floor(reference[side])), data;
14319}
14320function toValue(str, measurement, popperOffsets, referenceOffsets) {
14321  var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/), value = +split[1], unit = split[2];
14322  if (!value)
14323    return str;
14324  if (unit.indexOf("%") === 0) {
14325    var element = void 0;
14326    switch (unit) {
14327      case "%p":
14328        element = popperOffsets;
14329        break;
14330      case "%":
14331      case "%r":
14332      default:
14333        element = referenceOffsets;
14334    }
14335    var rect = getClientRect(element);
14336    return rect[measurement] / 100 * value;
14337  } else if (unit === "vh" || unit === "vw") {
14338    var size = void 0;
14339    return unit === "vh" ? size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) : size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0), size / 100 * value;
14340  } else
14341    return value;
14342}
14343function parseOffset(offset2, popperOffsets, referenceOffsets, basePlacement) {
14344  var offsets = [0, 0], useHeight = ["right", "left"].indexOf(basePlacement) !== -1, fragments = offset2.split(/(\+|\-)/).map(function(frag) {
14345    return frag.trim();
14346  }), divider = fragments.indexOf(find(fragments, function(frag) {
14347    return frag.search(/,|\s/) !== -1;
14348  }));
14349  fragments[divider] && fragments[divider].indexOf(",") === -1 && console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");
14350  var splitRegex = /\s*,\s*|\s+/, ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
14351  return ops = ops.map(function(op, index) {
14352    var measurement = (index === 1 ? !useHeight : useHeight) ? "height" : "width", mergeWithPrevious = !1;
14353    return op.reduce(function(a2, b2) {
14354      return a2[a2.length - 1] === "" && ["+", "-"].indexOf(b2) !== -1 ? (a2[a2.length - 1] = b2, mergeWithPrevious = !0, a2) : mergeWithPrevious ? (a2[a2.length - 1] += b2, mergeWithPrevious = !1, a2) : a2.concat(b2);
14355    }, []).map(function(str) {
14356      return toValue(str, measurement, popperOffsets, referenceOffsets);
14357    });
14358  }), ops.forEach(function(op, index) {
14359    op.forEach(function(frag, index2) {
14360      isNumeric(frag) && (offsets[index] += frag * (op[index2 - 1] === "-" ? -1 : 1));
14361    });
14362  }), offsets;
14363}
14364function offset(data, _ref) {
14365  var offset2 = _ref.offset, placement = data.placement, _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, basePlacement = placement.split("-")[0], offsets = void 0;
14366  return isNumeric(+offset2) ? offsets = [+offset2, 0] : offsets = parseOffset(offset2, popper, reference, basePlacement), basePlacement === "left" ? (popper.top += offsets[0], popper.left -= offsets[1]) : basePlacement === "right" ? (popper.top += offsets[0], popper.left += offsets[1]) : basePlacement === "top" ? (popper.left += offsets[0], popper.top -= offsets[1]) : basePlacement === "bottom" && (popper.left += offsets[0], popper.top += offsets[1]), data.popper = popper, data;
14367}
14368function preventOverflow(data, options2) {
14369  var boundariesElement = options2.boundariesElement || getOffsetParent(data.instance.popper);
14370  data.instance.reference === boundariesElement && (boundariesElement = getOffsetParent(boundariesElement));
14371  var transformProp = getSupportedPropertyName("transform"), popperStyles = data.instance.popper.style, top = popperStyles.top, left = popperStyles.left, transform = popperStyles[transformProp];
14372  popperStyles.top = "", popperStyles.left = "", popperStyles[transformProp] = "";
14373  var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options2.padding, boundariesElement, data.positionFixed);
14374  popperStyles.top = top, popperStyles.left = left, popperStyles[transformProp] = transform, options2.boundaries = boundaries;
14375  var order = options2.priority, popper = data.offsets.popper, check = {
14376    primary: function(placement) {
14377      var value = popper[placement];
14378      return popper[placement] < boundaries[placement] && !options2.escapeWithReference && (value = Math.max(popper[placement], boundaries[placement])), defineProperty({}, placement, value);
14379    },
14380    secondary: function(placement) {
14381      var mainSide = placement === "right" ? "left" : "top", value = popper[mainSide];
14382      return popper[placement] > boundaries[placement] && !options2.escapeWithReference && (value = Math.min(popper[mainSide], boundaries[placement] - (placement === "right" ? popper.width : popper.height))), defineProperty({}, mainSide, value);
14383    }
14384  };
14385  return order.forEach(function(placement) {
14386    var side = ["left", "top"].indexOf(placement) !== -1 ? "primary" : "secondary";
14387    popper = _extends2({}, popper, check[side](placement));
14388  }), data.offsets.popper = popper, data;
14389}
14390function shift(data) {
14391  var placement = data.placement, basePlacement = placement.split("-")[0], shiftvariation = placement.split("-")[1];
14392  if (shiftvariation) {
14393    var _data$offsets = data.offsets, reference = _data$offsets.reference, popper = _data$offsets.popper, isVertical = ["bottom", "top"].indexOf(basePlacement) !== -1, side = isVertical ? "left" : "top", measurement = isVertical ? "width" : "height", shiftOffsets = {
14394      start: defineProperty({}, side, reference[side]),
14395      end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
14396    };
14397    data.offsets.popper = _extends2({}, popper, shiftOffsets[shiftvariation]);
14398  }
14399  return data;
14400}
14401function hide(data) {
14402  if (!isModifierRequired(data.instance.modifiers, "hide", "preventOverflow"))
14403    return data;
14404  var refRect = data.offsets.reference, bound = find(data.instance.modifiers, function(modifier) {
14405    return modifier.name === "preventOverflow";
14406  }).boundaries;
14407  if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
14408    if (data.hide === !0)
14409      return data;
14410    data.hide = !0, data.attributes["x-out-of-boundaries"] = "";
14411  } else {
14412    if (data.hide === !1)
14413      return data;
14414    data.hide = !1, data.attributes["x-out-of-boundaries"] = !1;
14415  }
14416  return data;
14417}
14418function inner(data) {
14419  var placement = data.placement, basePlacement = placement.split("-")[0], _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference, isHoriz = ["left", "right"].indexOf(basePlacement) !== -1, subtractLength = ["top", "left"].indexOf(basePlacement) === -1;
14420  return popper[isHoriz ? "left" : "top"] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? "width" : "height"] : 0), data.placement = getOppositePlacement(placement), data.offsets.popper = getClientRect(popper), data;
14421}
14422var modifiers = {
14423  /**
14424   * Modifier used to shift the popper on the start or end of its reference
14425   * element.<br />
14426   * It will read the variation of the `placement` property.<br />
14427   * It can be one either `-end` or `-start`.
14428   * @memberof modifiers
14429   * @inner
14430   */
14431  shift: {
14432    /** @prop {number} order=100 - Index used to define the order of execution */
14433    order: 100,
14434    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
14435    enabled: !0,
14436    /** @prop {ModifierFn} */
14437    fn: shift
14438  },
14439  /**
14440   * The `offset` modifier can shift your popper on both its axis.
14441   *
14442   * It accepts the following units:
14443   * - `px` or unit-less, interpreted as pixels
14444   * - `%` or `%r`, percentage relative to the length of the reference element
14445   * - `%p`, percentage relative to the length of the popper element
14446   * - `vw`, CSS viewport width unit
14447   * - `vh`, CSS viewport height unit
14448   *
14449   * For length is intended the main axis relative to the placement of the popper.<br />
14450   * This means that if the placement is `top` or `bottom`, the length will be the
14451   * `width`. In case of `left` or `right`, it will be the `height`.
14452   *
14453   * You can provide a single value (as `Number` or `String`), or a pair of values
14454   * as `String` divided by a comma or one (or more) white spaces.<br />
14455   * The latter is a deprecated method because it leads to confusion and will be
14456   * removed in v2.<br />
14457   * Additionally, it accepts additions and subtractions between different units.
14458   * Note that multiplications and divisions aren't supported.
14459   *
14460   * Valid examples are:
14461   * ```
14462   * 10
14463   * '10%'
14464   * '10, 10'
14465   * '10%, 10'
14466   * '10 + 10%'
14467   * '10 - 5vh + 3%'
14468   * '-10px + 5vh, 5px - 6%'
14469   * ```
14470   * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
14471   * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
14472   * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
14473   *
14474   * @memberof modifiers
14475   * @inner
14476   */
14477  offset: {
14478    /** @prop {number} order=200 - Index used to define the order of execution */
14479    order: 200,
14480    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
14481    enabled: !0,
14482    /** @prop {ModifierFn} */
14483    fn: offset,
14484    /** @prop {Number|String} offset=0
14485     * The offset value as described in the modifier description
14486     */
14487    offset: 0
14488  },
14489  /**
14490   * Modifier used to prevent the popper from being positioned outside the boundary.
14491   *
14492   * A scenario exists where the reference itself is not within the boundaries.<br />
14493   * We can say it has "escaped the boundaries" — or just "escaped".<br />
14494   * In this case we need to decide whether the popper should either:
14495   *
14496   * - detach from the reference and remain "trapped" in the boundaries, or
14497   * - if it should ignore the boundary and "escape with its reference"
14498   *
14499   * When `escapeWithReference` is set to`true` and reference is completely
14500   * outside its boundaries, the popper will overflow (or completely leave)
14501   * the boundaries in order to remain attached to the edge of the reference.
14502   *
14503   * @memberof modifiers
14504   * @inner
14505   */
14506  preventOverflow: {
14507    /** @prop {number} order=300 - Index used to define the order of execution */
14508    order: 300,
14509    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
14510    enabled: !0,
14511    /** @prop {ModifierFn} */
14512    fn: preventOverflow,
14513    /**
14514     * @prop {Array} [priority=['left','right','top','bottom']]
14515     * Popper will try to prevent overflow following these priorities by default,
14516     * then, it could overflow on the left and on top of the `boundariesElement`
14517     */
14518    priority: ["left", "right", "top", "bottom"],
14519    /**
14520     * @prop {number} padding=5
14521     * Amount of pixel used to define a minimum distance between the boundaries
14522     * and the popper. This makes sure the popper always has a little padding
14523     * between the edges of its container
14524     */
14525    padding: 5,
14526    /**
14527     * @prop {String|HTMLElement} boundariesElement='scrollParent'
14528     * Boundaries used by the modifier. Can be `scrollParent`, `window`,
14529     * `viewport` or any DOM element.
14530     */
14531    boundariesElement: "scrollParent"
14532  },
14533  /**
14534   * Modifier used to make sure the reference and its popper stay near each other
14535   * without leaving any gap between the two. Especially useful when the arrow is
14536   * enabled and you want to ensure that it points to its reference element.
14537   * It cares only about the first axis. You can still have poppers with margin
14538   * between the popper and its reference element.
14539   * @memberof modifiers
14540   * @inner
14541   */
14542  keepTogether: {
14543    /** @prop {number} order=400 - Index used to define the order of execution */
14544    order: 400,
14545    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
14546    enabled: !0,
14547    /** @prop {ModifierFn} */
14548    fn: keepTogether
14549  },
14550  /**
14551   * This modifier is used to move the `arrowElement` of the popper to make
14552   * sure it is positioned between the reference element and its popper element.
14553   * It will read the outer size of the `arrowElement` node to detect how many
14554   * pixels of conjunction are needed.
14555   *
14556   * It has no effect if no `arrowElement` is provided.
14557   * @memberof modifiers
14558   * @inner
14559   */
14560  arrow: {
14561    /** @prop {number} order=500 - Index used to define the order of execution */
14562    order: 500,
14563    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
14564    enabled: !0,
14565    /** @prop {ModifierFn} */
14566    fn: arrow,
14567    /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
14568    element: "[x-arrow]"
14569  },
14570  /**
14571   * Modifier used to flip the popper's placement when it starts to overlap its
14572   * reference element.
14573   *
14574   * Requires the `preventOverflow` modifier before it in order to work.
14575   *
14576   * **NOTE:** this modifier will interrupt the current update cycle and will
14577   * restart it if it detects the need to flip the placement.
14578   * @memberof modifiers
14579   * @inner
14580   */
14581  flip: {
14582    /** @prop {number} order=600 - Index used to define the order of execution */
14583    order: 600,
14584    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
14585    enabled: !0,
14586    /** @prop {ModifierFn} */
14587    fn: flip,
14588    /**
14589     * @prop {String|Array} behavior='flip'
14590     * The behavior used to change the popper's placement. It can be one of
14591     * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
14592     * placements (with optional variations)
14593     */
14594    behavior: "flip",
14595    /**
14596     * @prop {number} padding=5
14597     * The popper will flip if it hits the edges of the `boundariesElement`
14598     */
14599    padding: 5,
14600    /**
14601     * @prop {String|HTMLElement} boundariesElement='viewport'
14602     * The element which will define the boundaries of the popper position.
14603     * The popper will never be placed outside of the defined boundaries
14604     * (except if `keepTogether` is enabled)
14605     */
14606    boundariesElement: "viewport",
14607    /**
14608     * @prop {Boolean} flipVariations=false
14609     * The popper will switch placement variation between `-start` and `-end` when
14610     * the reference element overlaps its boundaries.
14611     *
14612     * The original placement should have a set variation.
14613     */
14614    flipVariations: !1,
14615    /**
14616     * @prop {Boolean} flipVariationsByContent=false
14617     * The popper will switch placement variation between `-start` and `-end` when
14618     * the popper element overlaps its reference boundaries.
14619     *
14620     * The original placement should have a set variation.
14621     */
14622    flipVariationsByContent: !1
14623  },
14624  /**
14625   * Modifier used to make the popper flow toward the inner of the reference element.
14626   * By default, when this modifier is disabled, the popper will be placed outside
14627   * the reference element.
14628   * @memberof modifiers
14629   * @inner
14630   */
14631  inner: {
14632    /** @prop {number} order=700 - Index used to define the order of execution */
14633    order: 700,
14634    /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
14635    enabled: !1,
14636    /** @prop {ModifierFn} */
14637    fn: inner
14638  },
14639  /**
14640   * Modifier used to hide the popper when its reference element is outside of the
14641   * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
14642   * be used to hide with a CSS selector the popper when its reference is
14643   * out of boundaries.
14644   *
14645   * Requires the `preventOverflow` modifier before it in order to work.
14646   * @memberof modifiers
14647   * @inner
14648   */
14649  hide: {
14650    /** @prop {number} order=800 - Index used to define the order of execution */
14651    order: 800,
14652    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
14653    enabled: !0,
14654    /** @prop {ModifierFn} */
14655    fn: hide
14656  },
14657  /**
14658   * Computes the style that will be applied to the popper element to gets
14659   * properly positioned.
14660   *
14661   * Note that this modifier will not touch the DOM, it just prepares the styles
14662   * so that `applyStyle` modifier can apply it. This separation is useful
14663   * in case you need to replace `applyStyle` with a custom implementation.
14664   *
14665   * This modifier has `850` as `order` value to maintain backward compatibility
14666   * with previous versions of Popper.js. Expect the modifiers ordering method
14667   * to change in future major versions of the library.
14668   *
14669   * @memberof modifiers
14670   * @inner
14671   */
14672  computeStyle: {
14673    /** @prop {number} order=850 - Index used to define the order of execution */
14674    order: 850,
14675    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
14676    enabled: !0,
14677    /** @prop {ModifierFn} */
14678    fn: computeStyle,
14679    /**
14680     * @prop {Boolean} gpuAcceleration=true
14681     * If true, it uses the CSS 3D transformation to position the popper.
14682     * Otherwise, it will use the `top` and `left` properties
14683     */
14684    gpuAcceleration: !0,
14685    /**
14686     * @prop {string} [x='bottom']
14687     * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
14688     * Change this if your popper should grow in a direction different from `bottom`
14689     */
14690    x: "bottom",
14691    /**
14692     * @prop {string} [x='left']
14693     * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
14694     * Change this if your popper should grow in a direction different from `right`
14695     */
14696    y: "right"
14697  },
14698  /**
14699   * Applies the computed styles to the popper element.
14700   *
14701   * All the DOM manipulations are limited to this modifier. This is useful in case
14702   * you want to integrate Popper.js inside a framework or view library and you
14703   * want to delegate all the DOM manipulations to it.
14704   *
14705   * Note that if you disable this modifier, you must make sure the popper element
14706   * has its position set to `absolute` before Popper.js can do its work!
14707   *
14708   * Just disable this modifier and define your own to achieve the desired effect.
14709   *
14710   * @memberof modifiers
14711   * @inner
14712   */
14713  applyStyle: {
14714    /** @prop {number} order=900 - Index used to define the order of execution */
14715    order: 900,
14716    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
14717    enabled: !0,
14718    /** @prop {ModifierFn} */
14719    fn: applyStyle,
14720    /** @prop {Function} */
14721    onLoad: applyStyleOnLoad,
14722    /**
14723     * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
14724     * @prop {Boolean} gpuAcceleration=true
14725     * If true, it uses the CSS 3D transformation to position the popper.
14726     * Otherwise, it will use the `top` and `left` properties
14727     */
14728    gpuAcceleration: void 0
14729  }
14730}, Defaults = {
14731  /**
14732   * Popper's placement.
14733   * @prop {Popper.placements} placement='bottom'
14734   */
14735  placement: "bottom",
14736  /**
14737   * Set this to true if you want popper to position it self in 'fixed' mode
14738   * @prop {Boolean} positionFixed=false
14739   */
14740  positionFixed: !1,
14741  /**
14742   * Whether events (resize, scroll) are initially enabled.
14743   * @prop {Boolean} eventsEnabled=true
14744   */
14745  eventsEnabled: !0,
14746  /**
14747   * Set to true if you want to automatically remove the popper when
14748   * you call the `destroy` method.
14749   * @prop {Boolean} removeOnDestroy=false
14750   */
14751  removeOnDestroy: !1,
14752  /**
14753   * Callback called when the popper is created.<br />
14754   * By default, it is set to no-op.<br />
14755   * Access Popper.js instance with `data.instance`.
14756   * @prop {onCreate}
14757   */
14758  onCreate: function() {
14759  },
14760  /**
14761   * Callback called when the popper is updated. This callback is not called
14762   * on the initialization/creation of the popper, but only on subsequent
14763   * updates.<br />
14764   * By default, it is set to no-op.<br />
14765   * Access Popper.js instance with `data.instance`.
14766   * @prop {onUpdate}
14767   */
14768  onUpdate: function() {
14769  },
14770  /**
14771   * List of modifiers used to modify the offsets before they are applied to the popper.
14772   * They provide most of the functionalities of Popper.js.
14773   * @prop {modifiers}
14774   */
14775  modifiers
14776}, Popper = (function() {
14777  function Popper2(reference, popper) {
14778    var _this = this, options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
14779    classCallCheck(this, Popper2), this.scheduleUpdate = function() {
14780      return requestAnimationFrame(_this.update);
14781    }, this.update = debounce2(this.update.bind(this)), this.options = _extends2({}, Popper2.Defaults, options2), this.state = {
14782      isDestroyed: !1,
14783      isCreated: !1,
14784      scrollParents: []
14785    }, this.reference = reference && reference.jquery ? reference[0] : reference, this.popper = popper && popper.jquery ? popper[0] : popper, this.options.modifiers = {}, Object.keys(_extends2({}, Popper2.Defaults.modifiers, options2.modifiers)).forEach(function(name) {
14786      _this.options.modifiers[name] = _extends2({}, Popper2.Defaults.modifiers[name] || {}, options2.modifiers ? options2.modifiers[name] : {});
14787    }), this.modifiers = Object.keys(this.options.modifiers).map(function(name) {
14788      return _extends2({
14789        name
14790      }, _this.options.modifiers[name]);
14791    }).sort(function(a2, b2) {
14792      return a2.order - b2.order;
14793    }), this.modifiers.forEach(function(modifierOptions) {
14794      modifierOptions.enabled && isFunction3(modifierOptions.onLoad) && modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
14795    }), this.update();
14796    var eventsEnabled = this.options.eventsEnabled;
14797    eventsEnabled && this.enableEventListeners(), this.state.eventsEnabled = eventsEnabled;
14798  }
14799  return createClass(Popper2, [{
14800    key: "update",
14801    value: function() {
14802      return update.call(this);
14803    }
14804  }, {
14805    key: "destroy",
14806    value: function() {
14807      return destroy.call(this);
14808    }
14809  }, {
14810    key: "enableEventListeners",
14811    value: function() {
14812      return enableEventListeners.call(this);
14813    }
14814  }, {
14815    key: "disableEventListeners",
14816    value: function() {
14817      return disableEventListeners.call(this);
14818    }
14819    /**
14820     * Schedules an update. It will run on the next UI update available.
14821     * @method scheduleUpdate
14822     * @memberof Popper
14823     */
14824    /**
14825     * Collection of utilities useful when writing custom modifiers.
14826     * Starting from version 1.7, this method is available only if you
14827     * include `popper-utils.js` before `popper.js`.
14828     *
14829     * **DEPRECATION**: This way to access PopperUtils is deprecated
14830     * and will be removed in v2! Use the PopperUtils module directly instead.
14831     * Due to the high instability of the methods contained in Utils, we can't
14832     * guarantee them to follow semver. Use them at your own risk!
14833     * @static
14834     * @private
14835     * @type {Object}
14836     * @deprecated since version 1.8
14837     * @member Utils
14838     * @memberof Popper
14839     */
14840  }]), Popper2;
14841})();
14842Popper.Utils = (typeof window < "u" ? window : global).PopperUtils;
14843Popper.placements = placements;
14844Popper.Defaults = Defaults;
14845var popper_default = Popper;
14846
vendor: 96 bytes, lines 14847-14849
14847// ../../node_modules/react-floater/es/index.js
14848var import_deepmerge = __toESM(require_cjs());
14849
vendor: 4,913 bytes, lines 14850-15018
14850// ../../node_modules/react-floater/node_modules/is-lite/esm/index.js
14851var DOM_PROPERTIES_TO_CHECK2 = [
14852  "innerHTML",
14853  "ownerDocument",
14854  "style",
14855  "attributes",
14856  "nodeValue"
14857], objectTypes2 = [
14858  "Array",
14859  "ArrayBuffer",
14860  "AsyncFunction",
14861  "AsyncGenerator",
14862  "AsyncGeneratorFunction",
14863  "Date",
14864  "Error",
14865  "Function",
14866  "Generator",
14867  "GeneratorFunction",
14868  "HTMLElement",
14869  "Map",
14870  "Object",
14871  "Promise",
14872  "RegExp",
14873  "Set",
14874  "WeakMap",
14875  "WeakSet"
14876], primitiveTypes2 = [
14877  "bigint",
14878  "boolean",
14879  "null",
14880  "number",
14881  "string",
14882  "symbol",
14883  "undefined"
14884];
14885function getObjectType2(value) {
14886  var objectTypeName = Object.prototype.toString.call(value).slice(8, -1);
14887  if (/HTML\w+Element/.test(objectTypeName))
14888    return "HTMLElement";
14889  if (isObjectType2(objectTypeName))
14890    return objectTypeName;
14891}
14892function isObjectOfType2(type) {
14893  return function(value) {
14894    return getObjectType2(value) === type;
14895  };
14896}
14897function isObjectType2(name) {
14898  return objectTypes2.includes(name);
14899}
14900function isOfType3(type) {
14901  return function(value) {
14902    return typeof value === type;
14903  };
14904}
14905function isPrimitiveType2(name) {
14906  return primitiveTypes2.includes(name);
14907}
14908function is2(value) {
14909  if (value === null)
14910    return "null";
14911  switch (typeof value) {
14912    case "bigint":
14913      return "bigint";
14914    case "boolean":
14915      return "boolean";
14916    case "number":
14917      return "number";
14918    case "string":
14919      return "string";
14920    case "symbol":
14921      return "symbol";
14922    case "undefined":
14923      return "undefined";
14924    default:
14925  }
14926  if (is2.array(value))
14927    return "Array";
14928  if (is2.plainFunction(value))
14929    return "Function";
14930  var tagType = getObjectType2(value);
14931  return tagType || "Object";
14932}
14933is2.array = Array.isArray;
14934is2.arrayOf = function(target, predicate) {
14935  return !is2.array(target) && !is2.function(predicate) ? !1 : target.every(function(d2) {
14936    return predicate(d2);
14937  });
14938};
14939is2.asyncGeneratorFunction = function(value) {
14940  return getObjectType2(value) === "AsyncGeneratorFunction";
14941};
14942is2.asyncFunction = isObjectOfType2("AsyncFunction");
14943is2.bigint = isOfType3("bigint");
14944is2.boolean = function(value) {
14945  return value === !0 || value === !1;
14946};
14947is2.date = isObjectOfType2("Date");
14948is2.defined = function(value) {
14949  return !is2.undefined(value);
14950};
14951is2.domElement = function(value) {
14952  return is2.object(value) && !is2.plainObject(value) && value.nodeType === 1 && is2.string(value.nodeName) && DOM_PROPERTIES_TO_CHECK2.every(function(property) {
14953    return property in value;
14954  });
14955};
14956is2.empty = function(value) {
14957  return is2.string(value) && value.length === 0 || is2.array(value) && value.length === 0 || is2.object(value) && !is2.map(value) && !is2.set(value) && Object.keys(value).length === 0 || is2.set(value) && value.size === 0 || is2.map(value) && value.size === 0;
14958};
14959is2.error = isObjectOfType2("Error");
14960is2.function = isOfType3("function");
14961is2.generator = function(value) {
14962  return is2.iterable(value) && is2.function(value.next) && is2.function(value.throw);
14963};
14964is2.generatorFunction = isObjectOfType2("GeneratorFunction");
14965is2.instanceOf = function(instance, class_) {
14966  return !instance || !class_ ? !1 : Object.getPrototypeOf(instance) === class_.prototype;
14967};
14968is2.iterable = function(value) {
14969  return !is2.nullOrUndefined(value) && is2.function(value[Symbol.iterator]);
14970};
14971is2.map = isObjectOfType2("Map");
14972is2.nan = function(value) {
14973  return Number.isNaN(value);
14974};
14975is2.null = function(value) {
14976  return value === null;
14977};
14978is2.nullOrUndefined = function(value) {
14979  return is2.null(value) || is2.undefined(value);
14980};
14981is2.number = function(value) {
14982  return isOfType3("number")(value) && !is2.nan(value);
14983};
14984is2.numericString = function(value) {
14985  return is2.string(value) && value.length > 0 && !Number.isNaN(Number(value));
14986};
14987is2.object = function(value) {
14988  return !is2.nullOrUndefined(value) && (is2.function(value) || typeof value == "object");
14989};
14990is2.oneOf = function(target, value) {
14991  return is2.array(target) ? target.indexOf(value) > -1 : !1;
14992};
14993is2.plainFunction = isObjectOfType2("Function");
14994is2.plainObject = function(value) {
14995  if (getObjectType2(value) !== "Object")
14996    return !1;
14997  var prototype = Object.getPrototypeOf(value);
14998  return prototype === null || prototype === Object.getPrototypeOf({});
14999};
15000is2.primitive = function(value) {
15001  return is2.null(value) || isPrimitiveType2(typeof value);
15002};
15003is2.promise = isObjectOfType2("Promise");
15004is2.propertyOf = function(target, key, predicate) {
15005  if (!is2.object(target) || !key)
15006    return !1;
15007  var value = target[key];
15008  return is2.function(predicate) ? predicate(value) : is2.defined(value);
15009};
15010is2.regexp = isObjectOfType2("RegExp");
15011is2.set = isObjectOfType2("Set");
15012is2.string = isOfType3("string");
15013is2.symbol = isOfType3("symbol");
15014is2.undefined = isOfType3("undefined");
15015is2.weakMap = isObjectOfType2("WeakMap");
15016is2.weakSet = isObjectOfType2("WeakSet");
15017var esm_default = is2;
15018
vendor: 559 bytes, lines 15019-15032
15019// ../../node_modules/tree-changes/node_modules/@gilbarbara/deep-equal/esm/helpers.js
15020function isOfType4(type) {
15021  return function(value) {
15022    return typeof value === type;
15023  };
15024}
15025var isFunction4 = isOfType4("function"), isNull3 = function(value) {
15026  return value === null;
15027}, isRegex2 = function(value) {
15028  return Object.prototype.toString.call(value).slice(8, -1) === "RegExp";
15029}, isObject2 = function(value) {
15030  return !isUndefined3(value) && !isNull3(value) && (isFunction4(value) || typeof value == "object");
15031}, isUndefined3 = isOfType4("undefined");
15032
vendor: 3,865 bytes, lines 15033-15153
15033// ../../node_modules/tree-changes/node_modules/@gilbarbara/deep-equal/esm/index.js
15034var __values = function(o3) {
15035  var s2 = typeof Symbol == "function" && Symbol.iterator, m2 = s2 && o3[s2], i2 = 0;
15036  if (m2) return m2.call(o3);
15037  if (o3 && typeof o3.length == "number") return {
15038    next: function() {
15039      return o3 && i2 >= o3.length && (o3 = void 0), { value: o3 && o3[i2++], done: !o3 };
15040    }
15041  };
15042  throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined.");
15043};
15044function equalArray2(left, right) {
15045  var length = left.length;
15046  if (length !== right.length)
15047    return !1;
15048  for (var index = length; index-- !== 0; )
15049    if (!equal2(left[index], right[index]))
15050      return !1;
15051  return !0;
15052}
15053function equalArrayBuffer2(left, right) {
15054  if (left.byteLength !== right.byteLength)
15055    return !1;
15056  for (var view1 = new DataView(left.buffer), view2 = new DataView(right.buffer), index = left.byteLength; index--; )
15057    if (view1.getUint8(index) !== view2.getUint8(index))
15058      return !1;
15059  return !0;
15060}
15061function equalMap2(left, right) {
15062  var e_1, _a2, e_2, _b;
15063  if (left.size !== right.size)
15064    return !1;
15065  try {
15066    for (var _c = __values(left.entries()), _d = _c.next(); !_d.done; _d = _c.next()) {
15067      var index = _d.value;
15068      if (!right.has(index[0]))
15069        return !1;
15070    }
15071  } catch (e_1_1) {
15072    e_1 = { error: e_1_1 };
15073  } finally {
15074    try {
15075      _d && !_d.done && (_a2 = _c.return) && _a2.call(_c);
15076    } finally {
15077      if (e_1) throw e_1.error;
15078    }
15079  }
15080  try {
15081    for (var _e = __values(left.entries()), _f = _e.next(); !_f.done; _f = _e.next()) {
15082      var index = _f.value;
15083      if (!equal2(index[1], right.get(index[0])))
15084        return !1;
15085    }
15086  } catch (e_2_1) {
15087    e_2 = { error: e_2_1 };
15088  } finally {
15089    try {
15090      _f && !_f.done && (_b = _e.return) && _b.call(_e);
15091    } finally {
15092      if (e_2) throw e_2.error;
15093    }
15094  }
15095  return !0;
15096}
15097function equalSet2(left, right) {
15098  var e_3, _a2;
15099  if (left.size !== right.size)
15100    return !1;
15101  try {
15102    for (var _b = __values(left.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
15103      var index = _c.value;
15104      if (!right.has(index[0]))
15105        return !1;
15106    }
15107  } catch (e_3_1) {
15108    e_3 = { error: e_3_1 };
15109  } finally {
15110    try {
15111      _c && !_c.done && (_a2 = _b.return) && _a2.call(_b);
15112    } finally {
15113      if (e_3) throw e_3.error;
15114    }
15115  }
15116  return !0;
15117}
15118function equal2(left, right) {
15119  if (left === right)
15120    return !0;
15121  if (left && isObject2(left) && right && isObject2(right)) {
15122    if (left.constructor !== right.constructor)
15123      return !1;
15124    if (Array.isArray(left) && Array.isArray(right))
15125      return equalArray2(left, right);
15126    if (left instanceof Map && right instanceof Map)
15127      return equalMap2(left, right);
15128    if (left instanceof Set && right instanceof Set)
15129      return equalSet2(left, right);
15130    if (ArrayBuffer.isView(left) && ArrayBuffer.isView(right))
15131      return equalArrayBuffer2(left, right);
15132    if (isRegex2(left) && isRegex2(right))
15133      return left.source === right.source && left.flags === right.flags;
15134    if (left.valueOf !== Object.prototype.valueOf)
15135      return left.valueOf() === right.valueOf();
15136    if (left.toString !== Object.prototype.toString)
15137      return left.toString() === right.toString();
15138    var leftKeys = Object.keys(left), rightKeys = Object.keys(right);
15139    if (leftKeys.length !== rightKeys.length)
15140      return !1;
15141    for (var index = leftKeys.length; index-- !== 0; )
15142      if (!Object.prototype.hasOwnProperty.call(right, leftKeys[index]))
15143        return !1;
15144    for (var index = leftKeys.length; index-- !== 0; ) {
15145      var key = leftKeys[index];
15146      if (!(key === "_owner" && left.$$typeof) && !equal2(left[key], right[key]))
15147        return !1;
15148    }
15149    return !0;
15150  }
15151  return Number.isNaN(left) && Number.isNaN(right) ? !0 : left === right;
15152}
15153
vendor: 4,913 bytes, lines 15154-15322
15154// ../../node_modules/tree-changes/node_modules/is-lite/esm/index.js
15155var DOM_PROPERTIES_TO_CHECK3 = [
15156  "innerHTML",
15157  "ownerDocument",
15158  "style",
15159  "attributes",
15160  "nodeValue"
15161], objectTypes3 = [
15162  "Array",
15163  "ArrayBuffer",
15164  "AsyncFunction",
15165  "AsyncGenerator",
15166  "AsyncGeneratorFunction",
15167  "Date",
15168  "Error",
15169  "Function",
15170  "Generator",
15171  "GeneratorFunction",
15172  "HTMLElement",
15173  "Map",
15174  "Object",
15175  "Promise",
15176  "RegExp",
15177  "Set",
15178  "WeakMap",
15179  "WeakSet"
15180], primitiveTypes3 = [
15181  "bigint",
15182  "boolean",
15183  "null",
15184  "number",
15185  "string",
15186  "symbol",
15187  "undefined"
15188];
15189function getObjectType3(value) {
15190  var objectTypeName = Object.prototype.toString.call(value).slice(8, -1);
15191  if (/HTML\w+Element/.test(objectTypeName))
15192    return "HTMLElement";
15193  if (isObjectType3(objectTypeName))
15194    return objectTypeName;
15195}
15196function isObjectOfType3(type) {
15197  return function(value) {
15198    return getObjectType3(value) === type;
15199  };
15200}
15201function isObjectType3(name) {
15202  return objectTypes3.includes(name);
15203}
15204function isOfType5(type) {
15205  return function(value) {
15206    return typeof value === type;
15207  };
15208}
15209function isPrimitiveType3(name) {
15210  return primitiveTypes3.includes(name);
15211}
15212function is3(value) {
15213  if (value === null)
15214    return "null";
15215  switch (typeof value) {
15216    case "bigint":
15217      return "bigint";
15218    case "boolean":
15219      return "boolean";
15220    case "number":
15221      return "number";
15222    case "string":
15223      return "string";
15224    case "symbol":
15225      return "symbol";
15226    case "undefined":
15227      return "undefined";
15228    default:
15229  }
15230  if (is3.array(value))
15231    return "Array";
15232  if (is3.plainFunction(value))
15233    return "Function";
15234  var tagType = getObjectType3(value);
15235  return tagType || "Object";
15236}
15237is3.array = Array.isArray;
15238is3.arrayOf = function(target, predicate) {
15239  return !is3.array(target) && !is3.function(predicate) ? !1 : target.every(function(d2) {
15240    return predicate(d2);
15241  });
15242};
15243is3.asyncGeneratorFunction = function(value) {
15244  return getObjectType3(value) === "AsyncGeneratorFunction";
15245};
15246is3.asyncFunction = isObjectOfType3("AsyncFunction");
15247is3.bigint = isOfType5("bigint");
15248is3.boolean = function(value) {
15249  return value === !0 || value === !1;
15250};
15251is3.date = isObjectOfType3("Date");
15252is3.defined = function(value) {
15253  return !is3.undefined(value);
15254};
15255is3.domElement = function(value) {
15256  return is3.object(value) && !is3.plainObject(value) && value.nodeType === 1 && is3.string(value.nodeName) && DOM_PROPERTIES_TO_CHECK3.every(function(property) {
15257    return property in value;
15258  });
15259};
15260is3.empty = function(value) {
15261  return is3.string(value) && value.length === 0 || is3.array(value) && value.length === 0 || is3.object(value) && !is3.map(value) && !is3.set(value) && Object.keys(value).length === 0 || is3.set(value) && value.size === 0 || is3.map(value) && value.size === 0;
15262};
15263is3.error = isObjectOfType3("Error");
15264is3.function = isOfType5("function");
15265is3.generator = function(value) {
15266  return is3.iterable(value) && is3.function(value.next) && is3.function(value.throw);
15267};
15268is3.generatorFunction = isObjectOfType3("GeneratorFunction");
15269is3.instanceOf = function(instance, class_) {
15270  return !instance || !class_ ? !1 : Object.getPrototypeOf(instance) === class_.prototype;
15271};
15272is3.iterable = function(value) {
15273  return !is3.nullOrUndefined(value) && is3.function(value[Symbol.iterator]);
15274};
15275is3.map = isObjectOfType3("Map");
15276is3.nan = function(value) {
15277  return Number.isNaN(value);
15278};
15279is3.null = function(value) {
15280  return value === null;
15281};
15282is3.nullOrUndefined = function(value) {
15283  return is3.null(value) || is3.undefined(value);
15284};
15285is3.number = function(value) {
15286  return isOfType5("number")(value) && !is3.nan(value);
15287};
15288is3.numericString = function(value) {
15289  return is3.string(value) && value.length > 0 && !Number.isNaN(Number(value));
15290};
15291is3.object = function(value) {
15292  return !is3.nullOrUndefined(value) && (is3.function(value) || typeof value == "object");
15293};
15294is3.oneOf = function(target, value) {
15295  return is3.array(target) ? target.indexOf(value) > -1 : !1;
15296};
15297is3.plainFunction = isObjectOfType3("Function");
15298is3.plainObject = function(value) {
15299  if (getObjectType3(value) !== "Object")
15300    return !1;
15301  var prototype = Object.getPrototypeOf(value);
15302  return prototype === null || prototype === Object.getPrototypeOf({});
15303};
15304is3.primitive = function(value) {
15305  return is3.null(value) || isPrimitiveType3(typeof value);
15306};
15307is3.promise = isObjectOfType3("Promise");
15308is3.propertyOf = function(target, key, predicate) {
15309  if (!is3.object(target) || !key)
15310    return !1;
15311  var value = target[key];
15312  return is3.function(predicate) ? predicate(value) : is3.defined(value);
15313};
15314is3.regexp = isObjectOfType3("RegExp");
15315is3.set = isObjectOfType3("Set");
15316is3.string = isOfType5("string");
15317is3.symbol = isOfType5("symbol");
15318is3.undefined = isOfType5("undefined");
15319is3.weakMap = isObjectOfType3("WeakMap");
15320is3.weakSet = isObjectOfType3("WeakSet");
15321var esm_default2 = is3;
15322
vendor: 4,472 bytes, lines 15323-15409
15323// ../../node_modules/tree-changes/esm/helpers.js
15324function canHaveLength2() {
15325  for (var arguments_ = [], _i = 0; _i < arguments.length; _i++)
15326    arguments_[_i] = arguments[_i];
15327  return arguments_.every(function(d2) {
15328    return esm_default2.string(d2) || esm_default2.array(d2) || esm_default2.plainObject(d2);
15329  });
15330}
15331function checkEquality2(left, right, value) {
15332  return isSameType2(left, right) ? [left, right].every(esm_default2.array) ? !left.some(hasValue2(value)) && right.some(hasValue2(value)) : [left, right].every(esm_default2.plainObject) ? !Object.entries(left).some(hasEntry2(value)) && Object.entries(right).some(hasEntry2(value)) : right === value : !1;
15333}
15334function compareNumbers2(previousData, data, options2) {
15335  var actual = options2.actual, key = options2.key, previous = options2.previous, type = options2.type, left = nested2(previousData, key), right = nested2(data, key), changed = [left, right].every(esm_default2.number) && (type === "increased" ? left < right : left > right);
15336  return esm_default2.undefined(actual) || (changed = changed && right === actual), esm_default2.undefined(previous) || (changed = changed && left === previous), changed;
15337}
15338function compareValues2(previousData, data, options2) {
15339  var key = options2.key, type = options2.type, value = options2.value, left = nested2(previousData, key), right = nested2(data, key), primary = type === "added" ? left : right, secondary = type === "added" ? right : left;
15340  if (!esm_default2.nullOrUndefined(value)) {
15341    if (esm_default2.defined(primary)) {
15342      if (esm_default2.array(primary) || esm_default2.plainObject(primary))
15343        return checkEquality2(primary, secondary, value);
15344    } else
15345      return equal2(secondary, value);
15346    return !1;
15347  }
15348  return [left, right].every(esm_default2.array) ? !secondary.every(isEqualPredicate2(primary)) : [left, right].every(esm_default2.plainObject) ? hasExtraKeys2(Object.keys(primary), Object.keys(secondary)) : ![left, right].every(function(d2) {
15349    return esm_default2.primitive(d2) && esm_default2.defined(d2);
15350  }) && (type === "added" ? !esm_default2.defined(left) && esm_default2.defined(right) : esm_default2.defined(left) && !esm_default2.defined(right));
15351}
15352function getIterables2(previousData, data, _a2) {
15353  var _b = _a2 === void 0 ? {} : _a2, key = _b.key, left = nested2(previousData, key), right = nested2(data, key);
15354  if (!isSameType2(left, right))
15355    throw new TypeError("Inputs have different types");
15356  if (!canHaveLength2(left, right))
15357    throw new TypeError("Inputs don't have length");
15358  return [left, right].every(esm_default2.plainObject) && (left = Object.keys(left), right = Object.keys(right)), [left, right];
15359}
15360function hasEntry2(input) {
15361  return function(_a2) {
15362    var key = _a2[0], value = _a2[1];
15363    return esm_default2.array(input) ? equal2(input, value) || input.some(function(d2) {
15364      return equal2(d2, value) || esm_default2.array(value) && isEqualPredicate2(value)(d2);
15365    }) : esm_default2.plainObject(input) && input[key] ? !!input[key] && equal2(input[key], value) : equal2(input, value);
15366  };
15367}
15368function hasExtraKeys2(left, right) {
15369  return right.some(function(d2) {
15370    return !left.includes(d2);
15371  });
15372}
15373function hasValue2(input) {
15374  return function(value) {
15375    return esm_default2.array(input) ? input.some(function(d2) {
15376      return equal2(d2, value) || esm_default2.array(value) && isEqualPredicate2(value)(d2);
15377    }) : equal2(input, value);
15378  };
15379}
15380function includesOrEqualsTo2(previousValue, value) {
15381  return esm_default2.array(previousValue) ? previousValue.some(function(d2) {
15382    return equal2(d2, value);
15383  }) : equal2(previousValue, value);
15384}
15385function isEqualPredicate2(data) {
15386  return function(value) {
15387    return data.some(function(d2) {
15388      return equal2(d2, value);
15389    });
15390  };
15391}
15392function isSameType2() {
15393  for (var arguments_ = [], _i = 0; _i < arguments.length; _i++)
15394    arguments_[_i] = arguments[_i];
15395  return arguments_.every(esm_default2.array) || arguments_.every(esm_default2.number) || arguments_.every(esm_default2.plainObject) || arguments_.every(esm_default2.string);
15396}
15397function nested2(data, property) {
15398  if (esm_default2.plainObject(data) || esm_default2.array(data)) {
15399    if (esm_default2.string(property)) {
15400      var props = property.split(".");
15401      return props.reduce(function(acc, d2) {
15402        return acc && acc[d2];
15403      }, data);
15404    }
15405    return esm_default2.number(property) ? data[property] : data;
15406  }
15407  return data;
15408}
15409
vendor: 2,903 bytes, lines 15410-15485
15410// ../../node_modules/tree-changes/esm/index.js
15411function treeChanges2(previousData, data) {
15412  if ([previousData, data].some(esm_default2.nullOrUndefined))
15413    throw new Error("Missing required parameters");
15414  if (![previousData, data].every(function(d2) {
15415    return esm_default2.plainObject(d2) || esm_default2.array(d2);
15416  }))
15417    throw new Error("Expected plain objects or array");
15418  var added = function(key, value) {
15419    try {
15420      return compareValues2(previousData, data, { key, type: "added", value });
15421    } catch {
15422      return !1;
15423    }
15424  }, changed = function(key, actual, previous) {
15425    try {
15426      var left = nested2(previousData, key), right = nested2(data, key), hasActual = esm_default2.defined(actual), hasPrevious = esm_default2.defined(previous);
15427      if (hasActual || hasPrevious) {
15428        var leftComparator = hasPrevious ? includesOrEqualsTo2(previous, left) : !includesOrEqualsTo2(actual, left), rightComparator = includesOrEqualsTo2(actual, right);
15429        return leftComparator && rightComparator;
15430      }
15431      return [left, right].every(esm_default2.array) || [left, right].every(esm_default2.plainObject) ? !equal2(left, right) : left !== right;
15432    } catch {
15433      return !1;
15434    }
15435  }, changedFrom = function(key, previous, actual) {
15436    if (!esm_default2.defined(key))
15437      return !1;
15438    try {
15439      var left = nested2(previousData, key), right = nested2(data, key), hasActual = esm_default2.defined(actual);
15440      return includesOrEqualsTo2(previous, left) && (hasActual ? includesOrEqualsTo2(actual, right) : !hasActual);
15441    } catch {
15442      return !1;
15443    }
15444  }, changedTo = function(key, actual) {
15445    return esm_default2.defined(key) ? changed(key, actual) : !1;
15446  }, decreased = function(key, actual, previous) {
15447    if (!esm_default2.defined(key))
15448      return !1;
15449    try {
15450      return compareNumbers2(previousData, data, { key, actual, previous, type: "decreased" });
15451    } catch {
15452      return !1;
15453    }
15454  }, emptied = function(key) {
15455    try {
15456      var _a2 = getIterables2(previousData, data, { key }), left = _a2[0], right = _a2[1];
15457      return !!left.length && !right.length;
15458    } catch {
15459      return !1;
15460    }
15461  }, filled = function(key) {
15462    try {
15463      var _a2 = getIterables2(previousData, data, { key }), left = _a2[0], right = _a2[1];
15464      return !left.length && !!right.length;
15465    } catch {
15466      return !1;
15467    }
15468  }, increased = function(key, actual, previous) {
15469    if (!esm_default2.defined(key))
15470      return !1;
15471    try {
15472      return compareNumbers2(previousData, data, { key, actual, previous, type: "increased" });
15473    } catch {
15474      return !1;
15475    }
15476  }, removed = function(key, value) {
15477    try {
15478      return compareValues2(previousData, data, { key, type: "removed", value });
15479    } catch {
15480      return !1;
15481    }
15482  };
15483  return { added, changed, changedFrom, changedTo, decreased, emptied, filled, increased, removed };
15484}
15485
vendor: 40,392 bytes, lines 15486-15906
15486// ../../node_modules/react-floater/es/index.js
15487function ownKeys(e2, r4) {
15488  var t2 = Object.keys(e2);
15489  if (Object.getOwnPropertySymbols) {
15490    var o3 = Object.getOwnPropertySymbols(e2);
15491    r4 && (o3 = o3.filter(function(r5) {
15492      return Object.getOwnPropertyDescriptor(e2, r5).enumerable;
15493    })), t2.push.apply(t2, o3);
15494  }
15495  return t2;
15496}
15497function _objectSpread2(e2) {
15498  for (var r4 = 1; r4 < arguments.length; r4++) {
15499    var t2 = arguments[r4] != null ? arguments[r4] : {};
15500    r4 % 2 ? ownKeys(Object(t2), !0).forEach(function(r5) {
15501      _defineProperty(e2, r5, t2[r5]);
15502    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r5) {
15503      Object.defineProperty(e2, r5, Object.getOwnPropertyDescriptor(t2, r5));
15504    });
15505  }
15506  return e2;
15507}
15508function _classCallCheck(instance, Constructor) {
15509  if (!(instance instanceof Constructor))
15510    throw new TypeError("Cannot call a class as a function");
15511}
15512function _defineProperties(target, props) {
15513  for (var i2 = 0; i2 < props.length; i2++) {
15514    var descriptor = props[i2];
15515    descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
15516  }
15517}
15518function _createClass(Constructor, protoProps, staticProps) {
15519  return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Object.defineProperty(Constructor, "prototype", {
15520    writable: !1
15521  }), Constructor;
15522}
15523function _defineProperty(obj, key, value) {
15524  return key = _toPropertyKey(key), key in obj ? Object.defineProperty(obj, key, {
15525    value,
15526    enumerable: !0,
15527    configurable: !0,
15528    writable: !0
15529  }) : obj[key] = value, obj;
15530}
15531function _inherits(subClass, superClass) {
15532  if (typeof superClass != "function" && superClass !== null)
15533    throw new TypeError("Super expression must either be null or a function");
15534  subClass.prototype = Object.create(superClass && superClass.prototype, {
15535    constructor: {
15536      value: subClass,
15537      writable: !0,
15538      configurable: !0
15539    }
15540  }), Object.defineProperty(subClass, "prototype", {
15541    writable: !1
15542  }), superClass && _setPrototypeOf2(subClass, superClass);
15543}
15544function _getPrototypeOf2(o3) {
15545  return _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(o4) {
15546    return o4.__proto__ || Object.getPrototypeOf(o4);
15547  }, _getPrototypeOf2(o3);
15548}
15549function _setPrototypeOf2(o3, p2) {
15550  return _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o4, p3) {
15551    return o4.__proto__ = p3, o4;
15552  }, _setPrototypeOf2(o3, p2);
15553}
15554function _isNativeReflectConstruct2() {
15555  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
15556  if (typeof Proxy == "function") return !0;
15557  try {
15558    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
15559    })), !0;
15560  } catch {
15561    return !1;
15562  }
15563}
15564function _objectWithoutPropertiesLoose(source, excluded) {
15565  if (source == null) return {};
15566  var target = {}, sourceKeys = Object.keys(source), key, i2;
15567  for (i2 = 0; i2 < sourceKeys.length; i2++)
15568    key = sourceKeys[i2], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
15569  return target;
15570}
15571function _objectWithoutProperties(source, excluded) {
15572  if (source == null) return {};
15573  var target = _objectWithoutPropertiesLoose(source, excluded), key, i2;
15574  if (Object.getOwnPropertySymbols) {
15575    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
15576    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++)
15577      key = sourceSymbolKeys[i2], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
15578  }
15579  return target;
15580}
15581function _assertThisInitialized2(self2) {
15582  if (self2 === void 0)
15583    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
15584  return self2;
15585}
15586function _possibleConstructorReturn(self2, call) {
15587  if (call && (typeof call == "object" || typeof call == "function"))
15588    return call;
15589  if (call !== void 0)
15590    throw new TypeError("Derived constructors may only return object or undefined");
15591  return _assertThisInitialized2(self2);
15592}
15593function _createSuper(Derived) {
15594  var hasNativeReflectConstruct = _isNativeReflectConstruct2();
15595  return function() {
15596    var Super = _getPrototypeOf2(Derived), result;
15597    if (hasNativeReflectConstruct) {
15598      var NewTarget = _getPrototypeOf2(this).constructor;
15599      result = Reflect.construct(Super, arguments, NewTarget);
15600    } else
15601      result = Super.apply(this, arguments);
15602    return _possibleConstructorReturn(this, result);
15603  };
15604}
15605function _toPrimitive(input, hint) {
15606  if (typeof input != "object" || input === null) return input;
15607  var prim = input[Symbol.toPrimitive];
15608  if (prim !== void 0) {
15609    var res = prim.call(input, hint || "default");
15610    if (typeof res != "object") return res;
15611    throw new TypeError("@@toPrimitive must return a primitive value.");
15612  }
15613  return (hint === "string" ? String : Number)(input);
15614}
15615function _toPropertyKey(arg) {
15616  var key = _toPrimitive(arg, "string");
15617  return typeof key == "symbol" ? key : String(key);
15618}
15619var DEFAULTS = { flip: { padding: 20 }, preventOverflow: { padding: 10 } }, VALIDATOR_ARG_ERROR_MESSAGE = "The typeValidator argument must be a function with the signature function(props, propName, componentName).", MESSAGE_ARG_ERROR_MESSAGE = "The error message is optional, but must be a string if provided.";
15620function propIsRequired(condition, props, propName, componentName) {
15621  return typeof condition == "boolean" ? condition : typeof condition == "function" ? condition(props, propName, componentName) : condition ? !!condition : !1;
15622}
15623function propExists(props, propName) {
15624  return Object.hasOwnProperty.call(props, propName);
15625}
15626function missingPropError(props, propName, componentName, message) {
15627  return message ? new Error(message) : new Error("Required ".concat(props[propName], " `").concat(propName, "` was not specified in `").concat(componentName, "`."));
15628}
15629function guardAgainstInvalidArgTypes(typeValidator, message) {
15630  if (typeof typeValidator != "function")
15631    throw new TypeError(VALIDATOR_ARG_ERROR_MESSAGE);
15632  if (message && typeof message != "string")
15633    throw new TypeError(MESSAGE_ARG_ERROR_MESSAGE);
15634}
15635function isRequiredIf(typeValidator, condition, message) {
15636  return guardAgainstInvalidArgTypes(typeValidator, message), function(props, propName, componentName) {
15637    for (var _len = arguments.length, rest2 = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)
15638      rest2[_key - 3] = arguments[_key];
15639    return propIsRequired(condition, props, propName, componentName) ? propExists(props, propName) ? typeValidator.apply(void 0, [props, propName, componentName].concat(rest2)) : missingPropError(props, propName, componentName, message) : typeValidator.apply(void 0, [props, propName, componentName].concat(rest2));
15640  };
15641}
15642var STATUS2 = { INIT: "init", IDLE: "idle", OPENING: "opening", OPEN: "open", CLOSING: "closing", ERROR: "error" }, isReact16 = react_dom_default.createPortal !== void 0;
15643function canUseDOM() {
15644  return !!(typeof window < "u" && window.document && window.document.createElement);
15645}
15646function isMobile() {
15647  return "ontouchstart" in window && /Mobi/.test(navigator.userAgent);
15648}
15649function log(_ref) {
15650  var title2 = _ref.title, data = _ref.data, _ref$warn = _ref.warn, warn = _ref$warn === void 0 ? !1 : _ref$warn, _ref$debug = _ref.debug, debug = _ref$debug === void 0 ? !1 : _ref$debug, logFn = warn ? console.warn || console.error : console.log;
15651  debug && title2 && data && (console.groupCollapsed("%creact-floater: ".concat(title2), "color: #9b00ff; font-weight: bold; font-size: 12px;"), Array.isArray(data) ? data.forEach(function(d2) {
15652    esm_default.plainObject(d2) && d2.key ? logFn.apply(console, [d2.key, d2.value]) : logFn.apply(console, [d2]);
15653  }) : logFn.apply(console, [data]), console.groupEnd());
15654}
15655function on(element, event, cb) {
15656  var capture = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
15657  element.addEventListener(event, cb, capture);
15658}
15659function off(element, event, cb) {
15660  var capture = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
15661  element.removeEventListener(event, cb, capture);
15662}
15663function once3(element, event, cb) {
15664  var capture = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, _nextCB;
15665  _nextCB = function(e2) {
15666    cb(e2), off(element, event, _nextCB);
15667  }, on(element, event, _nextCB, capture);
15668}
15669function noop2() {
15670}
15671var ReactFloaterPortal = (function(_React$Component) {
15672  _inherits(ReactFloaterPortal2, _React$Component);
15673  var _super = _createSuper(ReactFloaterPortal2);
15674  function ReactFloaterPortal2() {
15675    return _classCallCheck(this, ReactFloaterPortal2), _super.apply(this, arguments);
15676  }
15677  return _createClass(ReactFloaterPortal2, [{ key: "componentDidMount", value: function() {
15678    canUseDOM() && (this.node || this.appendNode(), isReact16 || this.renderPortal());
15679  } }, { key: "componentDidUpdate", value: function() {
15680    canUseDOM() && (isReact16 || this.renderPortal());
15681  } }, { key: "componentWillUnmount", value: function() {
15682    !canUseDOM() || !this.node || (isReact16 || react_dom_default.unmountComponentAtNode(this.node), this.node && this.node.parentNode === document.body && (document.body.removeChild(this.node), this.node = void 0));
15683  } }, { key: "appendNode", value: function() {
15684    var _this$props = this.props, id = _this$props.id, zIndex = _this$props.zIndex;
15685    this.node || (this.node = document.createElement("div"), id && (this.node.id = id), zIndex && (this.node.style.zIndex = zIndex), document.body.appendChild(this.node));
15686  } }, { key: "renderPortal", value: function() {
15687    if (!canUseDOM()) return null;
15688    var _this$props2 = this.props, children = _this$props2.children, setRef = _this$props2.setRef;
15689    if (this.node || this.appendNode(), isReact16)
15690      return react_dom_default.createPortal(children, this.node);
15691    var portal = react_dom_default.unstable_renderSubtreeIntoContainer(this, children.length > 1 ? react_default.createElement("div", null, children) : children[0], this.node);
15692    return setRef(portal), null;
15693  } }, { key: "renderReact16", value: function() {
15694    var _this$props3 = this.props, hasChildren = _this$props3.hasChildren, placement = _this$props3.placement, target = _this$props3.target;
15695    return hasChildren ? this.renderPortal() : target || placement === "center" ? this.renderPortal() : null;
15696  } }, { key: "render", value: function() {
15697    return isReact16 ? this.renderReact16() : null;
15698  } }]), ReactFloaterPortal2;
15699})(react_default.Component);
15700_defineProperty(ReactFloaterPortal, "propTypes", { children: import_prop_types2.default.oneOfType([import_prop_types2.default.element, import_prop_types2.default.array]), hasChildren: import_prop_types2.default.bool, id: import_prop_types2.default.oneOfType([import_prop_types2.default.string, import_prop_types2.default.number]), placement: import_prop_types2.default.string, setRef: import_prop_types2.default.func.isRequired, target: import_prop_types2.default.oneOfType([import_prop_types2.default.object, import_prop_types2.default.string]), zIndex: import_prop_types2.default.number });
15701var FloaterArrow = (function(_React$Component) {
15702  _inherits(FloaterArrow2, _React$Component);
15703  var _super = _createSuper(FloaterArrow2);
15704  function FloaterArrow2() {
15705    return _classCallCheck(this, FloaterArrow2), _super.apply(this, arguments);
15706  }
15707  return _createClass(FloaterArrow2, [{ key: "parentStyle", get: function() {
15708    var _this$props = this.props, placement = _this$props.placement, styles2 = _this$props.styles, length = styles2.arrow.length, arrow2 = { pointerEvents: "none", position: "absolute", width: "100%" };
15709    return placement.startsWith("top") ? (arrow2.bottom = 0, arrow2.left = 0, arrow2.right = 0, arrow2.height = length) : placement.startsWith("bottom") ? (arrow2.left = 0, arrow2.right = 0, arrow2.top = 0, arrow2.height = length) : placement.startsWith("left") ? (arrow2.right = 0, arrow2.top = 0, arrow2.bottom = 0) : placement.startsWith("right") && (arrow2.left = 0, arrow2.top = 0), arrow2;
15710  } }, { key: "render", value: function() {
15711    var _this$props2 = this.props, placement = _this$props2.placement, setArrowRef = _this$props2.setArrowRef, styles2 = _this$props2.styles, _styles$arrow = styles2.arrow, color2 = _styles$arrow.color, display = _styles$arrow.display, length = _styles$arrow.length, margin = _styles$arrow.margin, position = _styles$arrow.position, spread2 = _styles$arrow.spread, arrowStyles = { display, position }, points, x2 = spread2, y2 = length;
15712    return placement.startsWith("top") ? (points = "0,0 ".concat(x2 / 2, ",").concat(y2, " ").concat(x2, ",0"), arrowStyles.bottom = 0, arrowStyles.marginLeft = margin, arrowStyles.marginRight = margin) : placement.startsWith("bottom") ? (points = "".concat(x2, ",").concat(y2, " ").concat(x2 / 2, ",0 0,").concat(y2), arrowStyles.top = 0, arrowStyles.marginLeft = margin, arrowStyles.marginRight = margin) : placement.startsWith("left") ? (y2 = spread2, x2 = length, points = "0,0 ".concat(x2, ",").concat(y2 / 2, " 0,").concat(y2), arrowStyles.right = 0, arrowStyles.marginTop = margin, arrowStyles.marginBottom = margin) : placement.startsWith("right") && (y2 = spread2, x2 = length, points = "".concat(x2, ",").concat(y2, " ").concat(x2, ",0 0,").concat(y2 / 2), arrowStyles.left = 0, arrowStyles.marginTop = margin, arrowStyles.marginBottom = margin), react_default.createElement("div", { className: "__floater__arrow", style: this.parentStyle }, react_default.createElement("span", { ref: setArrowRef, style: arrowStyles }, react_default.createElement("svg", { width: x2, height: y2, version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, react_default.createElement("polygon", { points, fill: color2 }))));
15713  } }]), FloaterArrow2;
15714})(react_default.Component);
15715_defineProperty(FloaterArrow, "propTypes", { placement: import_prop_types2.default.string.isRequired, setArrowRef: import_prop_types2.default.func.isRequired, styles: import_prop_types2.default.object.isRequired });
15716var _excluded$1 = ["color", "height", "width"];
15717function FloaterCloseBtn(_ref) {
15718  var handleClick = _ref.handleClick, styles2 = _ref.styles, color2 = styles2.color, height = styles2.height, width = styles2.width, style = _objectWithoutProperties(styles2, _excluded$1);
15719  return react_default.createElement("button", { "aria-label": "close", onClick: handleClick, style, type: "button" }, react_default.createElement("svg", { width: "".concat(width, "px"), height: "".concat(height, "px"), viewBox: "0 0 18 18", version: "1.1", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid" }, react_default.createElement("g", null, react_default.createElement("path", { d: "M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z", fill: color2 }))));
15720}
15721FloaterCloseBtn.propTypes = { handleClick: import_prop_types2.default.func.isRequired, styles: import_prop_types2.default.object.isRequired };
15722function FloaterContainer(_ref) {
15723  var content = _ref.content, footer = _ref.footer, handleClick = _ref.handleClick, open = _ref.open, positionWrapper = _ref.positionWrapper, showCloseButton = _ref.showCloseButton, title2 = _ref.title, styles2 = _ref.styles, output = { content: react_default.isValidElement(content) ? content : react_default.createElement("div", { className: "__floater__content", style: styles2.content }, content) };
15724  return title2 && (output.title = react_default.isValidElement(title2) ? title2 : react_default.createElement("div", { className: "__floater__title", style: styles2.title }, title2)), footer && (output.footer = react_default.isValidElement(footer) ? footer : react_default.createElement("div", { className: "__floater__footer", style: styles2.footer }, footer)), (showCloseButton || positionWrapper) && !esm_default.boolean(open) && (output.close = react_default.createElement(FloaterCloseBtn, { styles: styles2.close, handleClick })), react_default.createElement("div", { className: "__floater__container", style: styles2.container }, output.close, output.title, output.content, output.footer);
15725}
15726FloaterContainer.propTypes = { content: import_prop_types2.default.node.isRequired, footer: import_prop_types2.default.node, handleClick: import_prop_types2.default.func.isRequired, open: import_prop_types2.default.bool, positionWrapper: import_prop_types2.default.bool.isRequired, showCloseButton: import_prop_types2.default.bool.isRequired, styles: import_prop_types2.default.object.isRequired, title: import_prop_types2.default.node };
15727var Floater = (function(_React$Component) {
15728  _inherits(Floater2, _React$Component);
15729  var _super = _createSuper(Floater2);
15730  function Floater2() {
15731    return _classCallCheck(this, Floater2), _super.apply(this, arguments);
15732  }
15733  return _createClass(Floater2, [{ key: "style", get: function() {
15734    var _this$props = this.props, disableAnimation = _this$props.disableAnimation, component = _this$props.component, placement = _this$props.placement, hideArrow = _this$props.hideArrow, status = _this$props.status, styles2 = _this$props.styles, length = styles2.arrow.length, floater = styles2.floater, floaterCentered = styles2.floaterCentered, floaterClosing = styles2.floaterClosing, floaterOpening = styles2.floaterOpening, floaterWithAnimation = styles2.floaterWithAnimation, floaterWithComponent = styles2.floaterWithComponent, element = {};
15735    return hideArrow || (placement.startsWith("top") ? element.padding = "0 0 ".concat(length, "px") : placement.startsWith("bottom") ? element.padding = "".concat(length, "px 0 0") : placement.startsWith("left") ? element.padding = "0 ".concat(length, "px 0 0") : placement.startsWith("right") && (element.padding = "0 0 0 ".concat(length, "px"))), [STATUS2.OPENING, STATUS2.OPEN].indexOf(status) !== -1 && (element = _objectSpread2(_objectSpread2({}, element), floaterOpening)), status === STATUS2.CLOSING && (element = _objectSpread2(_objectSpread2({}, element), floaterClosing)), status === STATUS2.OPEN && !disableAnimation && (element = _objectSpread2(_objectSpread2({}, element), floaterWithAnimation)), placement === "center" && (element = _objectSpread2(_objectSpread2({}, element), floaterCentered)), component && (element = _objectSpread2(_objectSpread2({}, element), floaterWithComponent)), _objectSpread2(_objectSpread2({}, floater), element);
15736  } }, { key: "render", value: function() {
15737    var _this$props2 = this.props, component = _this$props2.component, closeFn = _this$props2.handleClick, hideArrow = _this$props2.hideArrow, setFloaterRef = _this$props2.setFloaterRef, status = _this$props2.status, output = {}, classes = ["__floater"];
15738    return component ? react_default.isValidElement(component) ? output.content = react_default.cloneElement(component, { closeFn }) : output.content = component({ closeFn }) : output.content = react_default.createElement(FloaterContainer, this.props), status === STATUS2.OPEN && classes.push("__floater__open"), hideArrow || (output.arrow = react_default.createElement(FloaterArrow, this.props)), react_default.createElement("div", { ref: setFloaterRef, className: classes.join(" "), style: this.style }, react_default.createElement("div", { className: "__floater__body" }, output.content, output.arrow));
15739  } }]), Floater2;
15740})(react_default.Component);
15741_defineProperty(Floater, "propTypes", { component: import_prop_types2.default.oneOfType([import_prop_types2.default.func, import_prop_types2.default.element]), content: import_prop_types2.default.node, disableAnimation: import_prop_types2.default.bool.isRequired, footer: import_prop_types2.default.node, handleClick: import_prop_types2.default.func.isRequired, hideArrow: import_prop_types2.default.bool.isRequired, open: import_prop_types2.default.bool, placement: import_prop_types2.default.string.isRequired, positionWrapper: import_prop_types2.default.bool.isRequired, setArrowRef: import_prop_types2.default.func.isRequired, setFloaterRef: import_prop_types2.default.func.isRequired, showCloseButton: import_prop_types2.default.bool, status: import_prop_types2.default.string.isRequired, styles: import_prop_types2.default.object.isRequired, title: import_prop_types2.default.node });
15742var ReactFloaterWrapper = (function(_React$Component) {
15743  _inherits(ReactFloaterWrapper2, _React$Component);
15744  var _super = _createSuper(ReactFloaterWrapper2);
15745  function ReactFloaterWrapper2() {
15746    return _classCallCheck(this, ReactFloaterWrapper2), _super.apply(this, arguments);
15747  }
15748  return _createClass(ReactFloaterWrapper2, [{ key: "render", value: function() {
15749    var _this$props = this.props, children = _this$props.children, handleClick = _this$props.handleClick, handleMouseEnter = _this$props.handleMouseEnter, handleMouseLeave = _this$props.handleMouseLeave, setChildRef = _this$props.setChildRef, setWrapperRef = _this$props.setWrapperRef, style = _this$props.style, styles2 = _this$props.styles, element;
15750    if (children)
15751      if (react_default.Children.count(children) === 1)
15752        if (!react_default.isValidElement(children))
15753          element = react_default.createElement("span", null, children);
15754        else {
15755          var refProp = esm_default.function(children.type) ? "innerRef" : "ref";
15756          element = react_default.cloneElement(react_default.Children.only(children), _defineProperty({}, refProp, setChildRef));
15757        }
15758      else
15759        element = children;
15760    return element ? react_default.createElement("span", { ref: setWrapperRef, style: _objectSpread2(_objectSpread2({}, styles2), style), onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, element) : null;
15761  } }]), ReactFloaterWrapper2;
15762})(react_default.Component);
15763_defineProperty(ReactFloaterWrapper, "propTypes", { children: import_prop_types2.default.node, handleClick: import_prop_types2.default.func.isRequired, handleMouseEnter: import_prop_types2.default.func.isRequired, handleMouseLeave: import_prop_types2.default.func.isRequired, setChildRef: import_prop_types2.default.func.isRequired, setWrapperRef: import_prop_types2.default.func.isRequired, style: import_prop_types2.default.object, styles: import_prop_types2.default.object.isRequired });
15764var defaultOptions = { zIndex: 100 };
15765function getStyles(styles2) {
15766  var options2 = (0, import_deepmerge.default)(defaultOptions, styles2.options || {});
15767  return { wrapper: { cursor: "help", display: "inline-flex", flexDirection: "column", zIndex: options2.zIndex }, wrapperPosition: { left: -1e3, position: "absolute", top: -1e3, visibility: "hidden" }, floater: { display: "inline-block", filter: "drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))", maxWidth: 300, opacity: 0, position: "relative", transition: "opacity 0.3s", visibility: "hidden", zIndex: options2.zIndex }, floaterOpening: { opacity: 1, visibility: "visible" }, floaterWithAnimation: { opacity: 1, transition: "opacity 0.3s, transform 0.2s", visibility: "visible" }, floaterWithComponent: { maxWidth: "100%" }, floaterClosing: { opacity: 0, visibility: "visible" }, floaterCentered: { left: "50%", position: "fixed", top: "50%", transform: "translate(-50%, -50%)" }, container: { backgroundColor: "#fff", color: "#666", minHeight: 60, minWidth: 200, padding: 20, position: "relative", zIndex: 10 }, title: { borderBottom: "1px solid #555", color: "#555", fontSize: 18, marginBottom: 5, paddingBottom: 6, paddingRight: 18 }, content: { fontSize: 15 }, close: { backgroundColor: "transparent", border: 0, borderRadius: 0, color: "#555", fontSize: 0, height: 15, outline: "none", padding: 10, position: "absolute", right: 0, top: 0, width: 15, WebkitAppearance: "none" }, footer: { borderTop: "1px solid #ccc", fontSize: 13, marginTop: 10, paddingTop: 5 }, arrow: { color: "#fff", display: "inline-flex", length: 16, margin: 8, position: "absolute", spread: 32 }, options: options2 };
15768}
15769var _excluded = ["arrow", "flip", "offset"], POSITIONING_PROPS = ["position", "top", "right", "bottom", "left"], ReactFloater = (function(_React$Component) {
15770  _inherits(ReactFloater2, _React$Component);
15771  var _super = _createSuper(ReactFloater2);
15772  function ReactFloater2(props) {
15773    var _this;
15774    return _classCallCheck(this, ReactFloater2), _this = _super.call(this, props), _defineProperty(_assertThisInitialized2(_this), "setArrowRef", function(ref) {
15775      _this.arrowRef = ref;
15776    }), _defineProperty(_assertThisInitialized2(_this), "setChildRef", function(ref) {
15777      _this.childRef = ref;
15778    }), _defineProperty(_assertThisInitialized2(_this), "setFloaterRef", function(ref) {
15779      _this.floaterRef = ref;
15780    }), _defineProperty(_assertThisInitialized2(_this), "setWrapperRef", function(ref) {
15781      _this.wrapperRef = ref;
15782    }), _defineProperty(_assertThisInitialized2(_this), "handleTransitionEnd", function() {
15783      var status = _this.state.status, callback = _this.props.callback;
15784      _this.wrapperPopper && _this.wrapperPopper.instance.update(), _this.setState({ status: status === STATUS2.OPENING ? STATUS2.OPEN : STATUS2.IDLE }, function() {
15785        var newStatus = _this.state.status;
15786        callback(newStatus === STATUS2.OPEN ? "open" : "close", _this.props);
15787      });
15788    }), _defineProperty(_assertThisInitialized2(_this), "handleClick", function() {
15789      var _this$props = _this.props, event = _this$props.event, open = _this$props.open;
15790      if (!esm_default.boolean(open)) {
15791        var _this$state = _this.state, positionWrapper = _this$state.positionWrapper, status = _this$state.status;
15792        (_this.event === "click" || _this.event === "hover" && positionWrapper) && (log({ title: "click", data: [{ event, status: status === STATUS2.OPEN ? "closing" : "opening" }], debug: _this.debug }), _this.toggle());
15793      }
15794    }), _defineProperty(_assertThisInitialized2(_this), "handleMouseEnter", function() {
15795      var _this$props2 = _this.props, event = _this$props2.event, open = _this$props2.open;
15796      if (!(esm_default.boolean(open) || isMobile())) {
15797        var status = _this.state.status;
15798        _this.event === "hover" && status === STATUS2.IDLE && (log({ title: "mouseEnter", data: [{ key: "originalEvent", value: event }], debug: _this.debug }), clearTimeout(_this.eventDelayTimeout), _this.toggle());
15799      }
15800    }), _defineProperty(_assertThisInitialized2(_this), "handleMouseLeave", function() {
15801      var _this$props3 = _this.props, event = _this$props3.event, eventDelay = _this$props3.eventDelay, open = _this$props3.open;
15802      if (!(esm_default.boolean(open) || isMobile())) {
15803        var _this$state2 = _this.state, status = _this$state2.status, positionWrapper = _this$state2.positionWrapper;
15804        _this.event === "hover" && (log({ title: "mouseLeave", data: [{ key: "originalEvent", value: event }], debug: _this.debug }), eventDelay ? [STATUS2.OPENING, STATUS2.OPEN].indexOf(status) !== -1 && !positionWrapper && !_this.eventDelayTimeout && (_this.eventDelayTimeout = setTimeout(function() {
15805          delete _this.eventDelayTimeout, _this.toggle();
15806        }, eventDelay * 1e3)) : _this.toggle(STATUS2.IDLE));
15807      }
15808    }), _this.state = { currentPlacement: props.placement, needsUpdate: !1, positionWrapper: props.wrapperOptions.position && !!props.target, status: STATUS2.INIT, statusWrapper: STATUS2.INIT }, _this._isMounted = !1, _this.hasMounted = !1, canUseDOM() && window.addEventListener("load", function() {
15809      _this.popper && _this.popper.instance.update(), _this.wrapperPopper && _this.wrapperPopper.instance.update();
15810    }), _this;
15811  }
15812  return _createClass(ReactFloater2, [{ key: "componentDidMount", value: function() {
15813    if (canUseDOM()) {
15814      var positionWrapper = this.state.positionWrapper, _this$props5 = this.props, children = _this$props5.children, open = _this$props5.open, target = _this$props5.target;
15815      this._isMounted = !0, log({ title: "init", data: { hasChildren: !!children, hasTarget: !!target, isControlled: esm_default.boolean(open), positionWrapper, target: this.target, floater: this.floaterRef }, debug: this.debug }), this.hasMounted || (this.initPopper(), this.hasMounted = !0), !children && target && esm_default.boolean(open);
15816    }
15817  } }, { key: "componentDidUpdate", value: function(prevProps, prevState) {
15818    if (canUseDOM()) {
15819      var _this$props6 = this.props, autoOpen = _this$props6.autoOpen, open = _this$props6.open, target = _this$props6.target, wrapperOptions = _this$props6.wrapperOptions, _treeChanges = treeChanges2(prevState, this.state), changedFrom = _treeChanges.changedFrom, changed = _treeChanges.changed;
15820      if (prevProps.open !== open) {
15821        var forceStatus;
15822        esm_default.boolean(open) && (forceStatus = open ? STATUS2.OPENING : STATUS2.CLOSING), this.toggle(forceStatus);
15823      }
15824      (prevProps.wrapperOptions.position !== wrapperOptions.position || prevProps.target !== target) && this.changeWrapperPosition(this.props), changed("status", STATUS2.IDLE) && open ? this.toggle(STATUS2.OPEN) : changedFrom("status", STATUS2.INIT, STATUS2.IDLE) && autoOpen && this.toggle(STATUS2.OPEN), this.popper && changed("status", STATUS2.OPENING) && this.popper.instance.update(), this.floaterRef && (changed("status", STATUS2.OPENING) || changed("status", STATUS2.CLOSING)) && once3(this.floaterRef, "transitionend", this.handleTransitionEnd), changed("needsUpdate", !0) && this.rebuildPopper();
15825    }
15826  } }, { key: "componentWillUnmount", value: function() {
15827    canUseDOM() && (this._isMounted = !1, this.popper && this.popper.instance.destroy(), this.wrapperPopper && this.wrapperPopper.instance.destroy());
15828  } }, { key: "initPopper", value: function() {
15829    var _this2 = this, target = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.target, positionWrapper = this.state.positionWrapper, _this$props7 = this.props, disableFlip = _this$props7.disableFlip, getPopper = _this$props7.getPopper, hideArrow = _this$props7.hideArrow, offset2 = _this$props7.offset, placement = _this$props7.placement, wrapperOptions = _this$props7.wrapperOptions, flipBehavior = placement === "top" || placement === "bottom" ? "flip" : ["right", "bottom-end", "top-end", "left", "top-start", "bottom-start"];
15830    if (placement === "center")
15831      this.setState({ status: STATUS2.IDLE });
15832    else if (target && this.floaterRef) {
15833      var _this$options = this.options, arrow2 = _this$options.arrow, flip2 = _this$options.flip, offsetOptions = _this$options.offset, rest2 = _objectWithoutProperties(_this$options, _excluded);
15834      new popper_default(target, this.floaterRef, { placement, modifiers: _objectSpread2({ arrow: _objectSpread2({ enabled: !hideArrow, element: this.arrowRef }, arrow2), flip: _objectSpread2({ enabled: !disableFlip, behavior: flipBehavior }, flip2), offset: _objectSpread2({ offset: "0, ".concat(offset2, "px") }, offsetOptions) }, rest2), onCreate: function(data) {
15835        var _this2$floaterRef;
15836        if (_this2.popper = data, !((_this2$floaterRef = _this2.floaterRef) !== null && _this2$floaterRef !== void 0 && _this2$floaterRef.isConnected)) {
15837          _this2.setState({ needsUpdate: !0 });
15838          return;
15839        }
15840        getPopper(data, "floater"), _this2._isMounted && _this2.setState({ currentPlacement: data.placement, status: STATUS2.IDLE }), placement !== data.placement && setTimeout(function() {
15841          data.instance.update();
15842        }, 1);
15843      }, onUpdate: function(data) {
15844        _this2.popper = data;
15845        var currentPlacement = _this2.state.currentPlacement;
15846        _this2._isMounted && data.placement !== currentPlacement && _this2.setState({ currentPlacement: data.placement });
15847      } });
15848    }
15849    if (positionWrapper) {
15850      var wrapperOffset = esm_default.undefined(wrapperOptions.offset) ? 0 : wrapperOptions.offset;
15851      new popper_default(this.target, this.wrapperRef, { placement: wrapperOptions.placement || placement, modifiers: { arrow: { enabled: !1 }, offset: { offset: "0, ".concat(wrapperOffset, "px") }, flip: { enabled: !1 } }, onCreate: function(data) {
15852        _this2.wrapperPopper = data, _this2._isMounted && _this2.setState({ statusWrapper: STATUS2.IDLE }), getPopper(data, "wrapper"), placement !== data.placement && setTimeout(function() {
15853          data.instance.update();
15854        }, 1);
15855      } });
15856    }
15857  } }, { key: "rebuildPopper", value: function() {
15858    var _this3 = this;
15859    this.floaterRefInterval = setInterval(function() {
15860      var _this3$floaterRef;
15861      (_this3$floaterRef = _this3.floaterRef) !== null && _this3$floaterRef !== void 0 && _this3$floaterRef.isConnected && (clearInterval(_this3.floaterRefInterval), _this3.setState({ needsUpdate: !1 }), _this3.initPopper());
15862    }, 50);
15863  } }, { key: "changeWrapperPosition", value: function(_ref) {
15864    var target = _ref.target, wrapperOptions = _ref.wrapperOptions;
15865    this.setState({ positionWrapper: wrapperOptions.position && !!target });
15866  } }, { key: "toggle", value: function(forceStatus) {
15867    var status = this.state.status, nextStatus = status === STATUS2.OPEN ? STATUS2.CLOSING : STATUS2.OPENING;
15868    esm_default.undefined(forceStatus) || (nextStatus = forceStatus), this.setState({ status: nextStatus });
15869  } }, { key: "debug", get: function() {
15870    var debug = this.props.debug;
15871    return debug || canUseDOM() && "ReactFloaterDebug" in window && !!window.ReactFloaterDebug;
15872  } }, { key: "event", get: function() {
15873    var _this$props8 = this.props, disableHoverToClick = _this$props8.disableHoverToClick, event = _this$props8.event;
15874    return event === "hover" && isMobile() && !disableHoverToClick ? "click" : event;
15875  } }, { key: "options", get: function() {
15876    var options2 = this.props.options;
15877    return (0, import_deepmerge.default)(DEFAULTS, options2 || {});
15878  } }, { key: "styles", get: function() {
15879    var _this4 = this, _this$state3 = this.state, status = _this$state3.status, positionWrapper = _this$state3.positionWrapper, statusWrapper = _this$state3.statusWrapper, styles2 = this.props.styles, nextStyles = (0, import_deepmerge.default)(getStyles(styles2), styles2);
15880    if (positionWrapper) {
15881      var wrapperStyles;
15882      [STATUS2.IDLE].indexOf(status) === -1 || [STATUS2.IDLE].indexOf(statusWrapper) === -1 ? wrapperStyles = nextStyles.wrapperPosition : wrapperStyles = this.wrapperPopper.styles, nextStyles.wrapper = _objectSpread2(_objectSpread2({}, nextStyles.wrapper), wrapperStyles);
15883    }
15884    if (this.target) {
15885      var targetStyles = window.getComputedStyle(this.target);
15886      this.wrapperStyles ? nextStyles.wrapper = _objectSpread2(_objectSpread2({}, nextStyles.wrapper), this.wrapperStyles) : ["relative", "static"].indexOf(targetStyles.position) === -1 && (this.wrapperStyles = {}, positionWrapper || (POSITIONING_PROPS.forEach(function(d2) {
15887        _this4.wrapperStyles[d2] = targetStyles[d2];
15888      }), nextStyles.wrapper = _objectSpread2(_objectSpread2({}, nextStyles.wrapper), this.wrapperStyles), this.target.style.position = "relative", this.target.style.top = "auto", this.target.style.right = "auto", this.target.style.bottom = "auto", this.target.style.left = "auto"));
15889    }
15890    return nextStyles;
15891  } }, { key: "target", get: function() {
15892    if (!canUseDOM()) return null;
15893    var target = this.props.target;
15894    return target ? esm_default.domElement(target) ? target : document.querySelector(target) : this.childRef || this.wrapperRef;
15895  } }, { key: "render", value: function() {
15896    var _this$state4 = this.state, currentPlacement = _this$state4.currentPlacement, positionWrapper = _this$state4.positionWrapper, status = _this$state4.status, _this$props9 = this.props, children = _this$props9.children, component = _this$props9.component, content = _this$props9.content, disableAnimation = _this$props9.disableAnimation, footer = _this$props9.footer, hideArrow = _this$props9.hideArrow, id = _this$props9.id, open = _this$props9.open, showCloseButton = _this$props9.showCloseButton, style = _this$props9.style, target = _this$props9.target, title2 = _this$props9.title, wrapper = react_default.createElement(ReactFloaterWrapper, { handleClick: this.handleClick, handleMouseEnter: this.handleMouseEnter, handleMouseLeave: this.handleMouseLeave, setChildRef: this.setChildRef, setWrapperRef: this.setWrapperRef, style, styles: this.styles.wrapper }, children), output = {};
15897    return positionWrapper ? output.wrapperInPortal = wrapper : output.wrapperAsChildren = wrapper, react_default.createElement("span", null, react_default.createElement(ReactFloaterPortal, { hasChildren: !!children, id, placement: currentPlacement, setRef: this.setFloaterRef, target, zIndex: this.styles.options.zIndex }, react_default.createElement(Floater, { component, content, disableAnimation, footer, handleClick: this.handleClick, hideArrow: hideArrow || currentPlacement === "center", open, placement: currentPlacement, positionWrapper, setArrowRef: this.setArrowRef, setFloaterRef: this.setFloaterRef, showCloseButton, status, styles: this.styles, title: title2 }), output.wrapperInPortal), output.wrapperAsChildren);
15898  } }]), ReactFloater2;
15899})(react_default.Component);
15900_defineProperty(ReactFloater, "propTypes", { autoOpen: import_prop_types2.default.bool, callback: import_prop_types2.default.func, children: import_prop_types2.default.node, component: isRequiredIf(import_prop_types2.default.oneOfType([import_prop_types2.default.func, import_prop_types2.default.element]), function(props) {
15901  return !props.content;
15902}), content: isRequiredIf(import_prop_types2.default.node, function(props) {
15903  return !props.component;
15904}), debug: import_prop_types2.default.bool, disableAnimation: import_prop_types2.default.bool, disableFlip: import_prop_types2.default.bool, disableHoverToClick: import_prop_types2.default.bool, event: import_prop_types2.default.oneOf(["hover", "click"]), eventDelay: import_prop_types2.default.number, footer: import_prop_types2.default.node, getPopper: import_prop_types2.default.func, hideArrow: import_prop_types2.default.bool, id: import_prop_types2.default.oneOfType([import_prop_types2.default.string, import_prop_types2.default.number]), offset: import_prop_types2.default.number, open: import_prop_types2.default.bool, options: import_prop_types2.default.object, placement: import_prop_types2.default.oneOf(["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "right", "right-start", "right-end", "auto", "center"]), showCloseButton: import_prop_types2.default.bool, style: import_prop_types2.default.object, styles: import_prop_types2.default.object, target: import_prop_types2.default.oneOfType([import_prop_types2.default.object, import_prop_types2.default.string]), title: import_prop_types2.default.node, wrapperOptions: import_prop_types2.default.shape({ offset: import_prop_types2.default.number, placement: import_prop_types2.default.oneOf(["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end", "right", "right-start", "right-end", "auto"]), position: import_prop_types2.default.bool }) });
15905_defineProperty(ReactFloater, "defaultProps", { autoOpen: !1, callback: noop2, debug: !1, disableAnimation: !1, disableFlip: !1, disableHoverToClick: !1, event: "click", eventDelay: 0.4, getPopper: noop2, hideArrow: !1, offset: 15, placement: "bottom", showCloseButton: !1, styles: {}, target: null, wrapperOptions: { position: !1 } });
15906
vendor: 58,264 bytes, lines 15907-17359
15907// ../../node_modules/react-joyride/dist/index.mjs
15908init_react();
15909init_react();
15910init_react();
15911init_react();
15912var __defProp3 = Object.defineProperty, __defNormalProp2 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __publicField = (obj, key, value) => __defNormalProp2(obj, typeof key != "symbol" ? key + "" : key, value), ACTIONS = {
15913  INIT: "init",
15914  START: "start",
15915  STOP: "stop",
15916  RESET: "reset",
15917  PREV: "prev",
15918  NEXT: "next",
15919  GO: "go",
15920  CLOSE: "close",
15921  SKIP: "skip",
15922  UPDATE: "update"
15923}, EVENTS = {
15924  TOUR_START: "tour:start",
15925  STEP_BEFORE: "step:before",
15926  BEACON: "beacon",
15927  TOOLTIP: "tooltip",
15928  STEP_AFTER: "step:after",
15929  TOUR_END: "tour:end",
15930  TOUR_STATUS: "tour:status",
15931  TARGET_NOT_FOUND: "error:target_not_found",
15932  ERROR: "error"
15933}, LIFECYCLE = {
15934  INIT: "init",
15935  READY: "ready",
15936  BEACON: "beacon",
15937  TOOLTIP: "tooltip",
15938  COMPLETE: "complete",
15939  ERROR: "error"
15940};
15941var STATUS3 = {
15942  IDLE: "idle",
15943  READY: "ready",
15944  WAITING: "waiting",
15945  RUNNING: "running",
15946  PAUSED: "paused",
15947  SKIPPED: "skipped",
15948  FINISHED: "finished",
15949  ERROR: "error"
15950};
15951function canUseDOM2() {
15952  var _a2;
15953  return !!(typeof window < "u" && ((_a2 = window.document) != null && _a2.createElement));
15954}
15955function getClientRect2(element) {
15956  return element ? element.getBoundingClientRect() : null;
15957}
15958function getDocumentHeight(median = !1) {
15959  let { body, documentElement } = document;
15960  if (!body || !documentElement)
15961    return 0;
15962  if (median) {
15963    let heights = [
15964      body.scrollHeight,
15965      body.offsetHeight,
15966      documentElement.clientHeight,
15967      documentElement.scrollHeight,
15968      documentElement.offsetHeight
15969    ].sort((a2, b2) => a2 - b2), middle = Math.floor(heights.length / 2);
15970    return heights.length % 2 === 0 ? (heights[middle - 1] + heights[middle]) / 2 : heights[middle];
15971  }
15972  return Math.max(
15973    body.scrollHeight,
15974    body.offsetHeight,
15975    documentElement.clientHeight,
15976    documentElement.scrollHeight,
15977    documentElement.offsetHeight
15978  );
15979}
15980function getElement(element) {
15981  if (typeof element == "string")
15982    try {
15983      return document.querySelector(element);
15984    } catch {
15985      return null;
15986    }
15987  return element;
15988}
15989function getStyleComputedProperty2(el) {
15990  return !el || el.nodeType !== 1 ? null : getComputedStyle(el);
15991}
15992function getScrollParent2(element, skipFix, forListener) {
15993  if (!element)
15994    return scrollDocument();
15995  let parent = (0, import_scrollparent.default)(element);
15996  if (parent) {
15997    if (parent.isSameNode(scrollDocument()))
15998      return forListener ? document : scrollDocument();
15999    if (!(parent.scrollHeight > parent.offsetHeight) && !skipFix)
16000      return parent.style.overflow = "initial", scrollDocument();
16001  }
16002  return parent;
16003}
16004function hasCustomScrollParent(element, skipFix) {
16005  if (!element)
16006    return !1;
16007  let parent = getScrollParent2(element, skipFix);
16008  return parent ? !parent.isSameNode(scrollDocument()) : !1;
16009}
16010function hasCustomOffsetParent(element) {
16011  return element.offsetParent !== document.body;
16012}
16013function hasPosition(el, type = "fixed") {
16014  if (!el || !(el instanceof HTMLElement))
16015    return !1;
16016  let { nodeName } = el, styles2 = getStyleComputedProperty2(el);
16017  return nodeName === "BODY" || nodeName === "HTML" ? !1 : styles2 && styles2.position === type ? !0 : el.parentNode ? hasPosition(el.parentNode, type) : !1;
16018}
16019function isElementVisible(element) {
16020  var _a2;
16021  if (!element)
16022    return !1;
16023  let parentElement = element;
16024  for (; parentElement && parentElement !== document.body; ) {
16025    if (parentElement instanceof HTMLElement) {
16026      let { display, visibility } = getComputedStyle(parentElement);
16027      if (display === "none" || visibility === "hidden")
16028        return !1;
16029    }
16030    parentElement = (_a2 = parentElement.parentElement) != null ? _a2 : null;
16031  }
16032  return !0;
16033}
16034function getElementPosition(element, offset2, skipFix) {
16035  var _a2, _b, _c;
16036  let elementRect = getClientRect2(element), parent = getScrollParent2(element, skipFix), hasScrollParent = hasCustomScrollParent(element, skipFix), isFixedTarget = hasPosition(element), parentTop = 0, top = (_a2 = elementRect?.top) != null ? _a2 : 0;
16037  if (hasScrollParent && isFixedTarget) {
16038    let offsetTop = (_b = element?.offsetTop) != null ? _b : 0, parentScrollTop = (_c = parent?.scrollTop) != null ? _c : 0;
16039    top = offsetTop - parentScrollTop;
16040  } else parent instanceof HTMLElement && (parentTop = parent.scrollTop, !hasScrollParent && !hasPosition(element) && (top += parentTop), parent.isSameNode(scrollDocument()) || (top += scrollDocument().scrollTop));
16041  return Math.floor(top - offset2);
16042}
16043function getScrollTo(element, offset2, skipFix) {
16044  var _a2;
16045  if (!element)
16046    return 0;
16047  let { offsetTop = 0, scrollTop = 0 } = (_a2 = (0, import_scrollparent.default)(element)) != null ? _a2 : {}, top = element.getBoundingClientRect().top + scrollTop;
16048  offsetTop && (hasCustomScrollParent(element, skipFix) || hasCustomOffsetParent(element)) && (top -= offsetTop);
16049  let output = Math.floor(top - offset2);
16050  return output < 0 ? 0 : output;
16051}
16052function scrollDocument() {
16053  var _a2;
16054  return (_a2 = document.scrollingElement) != null ? _a2 : document.documentElement;
16055}
16056function scrollTo(value, options2) {
16057  let { duration, element } = options2;
16058  return new Promise((resolve, reject) => {
16059    let { scrollTop } = element, limit = value > scrollTop ? value - scrollTop : scrollTop - value;
16060    import_scroll.default.top(element, value, { duration: limit < 100 ? 50 : duration }, (error) => error && error.message !== "Element already at target scroll position" ? reject(error) : resolve());
16061  });
16062}
16063var isReact162 = createPortal !== void 0;
16064function getBrowser(userAgent = navigator.userAgent) {
16065  let browser = userAgent;
16066  return typeof window > "u" ? browser = "node" : document.documentMode ? browser = "ie" : /Edge/.test(userAgent) ? browser = "edge" : window.opera || userAgent.includes(" OPR/") ? browser = "opera" : typeof window.InstallTrigger < "u" ? browser = "firefox" : window.chrome ? browser = "chrome" : /(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(userAgent) && (browser = "safari"), browser;
16067}
16068function getObjectType4(value) {
16069  return Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
16070}
16071function getReactNodeText(input, options2 = {}) {
16072  let { defaultValue, step, steps } = options2, text = (0, import_react_innertext.default)(input);
16073  if (text)
16074    (text.includes("{step}") || text.includes("{steps}")) && step && steps && (text = text.replace("{step}", step.toString()).replace("{steps}", steps.toString()));
16075  else if (isValidElement(input) && !Object.values(input.props).length && getObjectType4(input.type) === "function") {
16076    let component = input.type({});
16077    text = getReactNodeText(component, options2);
16078  } else
16079    text = (0, import_react_innertext.default)(defaultValue);
16080  return text;
16081}
16082function hasValidKeys(object, keys) {
16083  return !src_default.plainObject(object) || !src_default.array(keys) ? !1 : Object.keys(object).every((d2) => keys.includes(d2));
16084}
16085function hexToRGB(hex) {
16086  let shorthandRegex = /^#?([\da-f])([\da-f])([\da-f])$/i, properHex = hex.replace(shorthandRegex, (_m, r4, g2, b2) => r4 + r4 + g2 + g2 + b2 + b2), result = /^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(properHex);
16087  return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : [];
16088}
16089function hideBeacon(step) {
16090  return step.disableBeacon || step.placement === "center";
16091}
16092function isLegacy() {
16093  return !["chrome", "safari", "firefox", "opera"].includes(getBrowser());
16094}
16095function log2({ data, debug = !1, title: title2, warn = !1 }) {
16096  let logFn = warn ? console.warn || console.error : console.log;
16097  debug && (title2 && data ? (console.groupCollapsed(
16098    `%creact-joyride: ${title2}`,
16099    "color: #ff0044; font-weight: bold; font-size: 12px;"
16100  ), Array.isArray(data) ? data.forEach((d2) => {
16101    src_default.plainObject(d2) && d2.key ? logFn.apply(console, [d2.key, d2.value]) : logFn.apply(console, [d2]);
16102  }) : logFn.apply(console, [data]), console.groupEnd()) : console.error("Missing title or data props"));
16103}
16104function objectKeys(input) {
16105  return Object.keys(input);
16106}
16107function omit2(input, ...filter) {
16108  if (!src_default.plainObject(input))
16109    throw new TypeError("Expected an object");
16110  let output = {};
16111  for (let key in input)
16112    ({}).hasOwnProperty.call(input, key) && (filter.includes(key) || (output[key] = input[key]));
16113  return output;
16114}
16115function pick2(input, ...filter) {
16116  if (!src_default.plainObject(input))
16117    throw new TypeError("Expected an object");
16118  if (!filter.length)
16119    return input;
16120  let output = {};
16121  for (let key in input)
16122    ({}).hasOwnProperty.call(input, key) && filter.includes(key) && (output[key] = input[key]);
16123  return output;
16124}
16125function replaceLocaleContent(input, step, steps) {
16126  let replacer = (text) => text.replace("{step}", String(step)).replace("{steps}", String(steps));
16127  if (getObjectType4(input) === "string")
16128    return replacer(input);
16129  if (!isValidElement(input))
16130    return input;
16131  let { children } = input.props;
16132  if (getObjectType4(children) === "string" && children.includes("{step}"))
16133    return cloneElement(input, {
16134      children: replacer(children)
16135    });
16136  if (Array.isArray(children))
16137    return cloneElement(input, {
16138      children: children.map((child) => typeof child == "string" ? replacer(child) : replaceLocaleContent(child, step, steps))
16139    });
16140  if (getObjectType4(input.type) === "function" && !Object.values(input.props).length) {
16141    let component = input.type({});
16142    return replaceLocaleContent(component, step, steps);
16143  }
16144  return input;
16145}
16146function shouldScroll(options2) {
16147  let { isFirstStep, lifecycle, previousLifecycle, scrollToFirstStep, step, target } = options2;
16148  return !step.disableScrolling && (!isFirstStep || scrollToFirstStep || lifecycle === LIFECYCLE.TOOLTIP) && step.placement !== "center" && (!step.isFixed || !hasPosition(target)) && // fixed steps don't need to scroll
16149  previousLifecycle !== lifecycle && [LIFECYCLE.BEACON, LIFECYCLE.TOOLTIP].includes(lifecycle);
16150}
16151var defaultFloaterProps = {
16152  options: {
16153    preventOverflow: {
16154      boundariesElement: "scrollParent"
16155    }
16156  },
16157  wrapperOptions: {
16158    offset: -18,
16159    position: !0
16160  }
16161}, defaultLocale = {
16162  back: "Back",
16163  close: "Close",
16164  last: "Last",
16165  next: "Next",
16166  nextLabelWithProgress: "Next (Step {step} of {steps})",
16167  open: "Open the dialog",
16168  skip: "Skip"
16169}, defaultStep = {
16170  event: "click",
16171  placement: "bottom",
16172  offset: 10,
16173  disableBeacon: !1,
16174  disableCloseOnEsc: !1,
16175  disableOverlay: !1,
16176  disableOverlayClose: !1,
16177  disableScrollParentFix: !1,
16178  disableScrolling: !1,
16179  hideBackButton: !1,
16180  hideCloseButton: !1,
16181  hideFooter: !1,
16182  isFixed: !1,
16183  locale: defaultLocale,
16184  showProgress: !1,
16185  showSkipButton: !1,
16186  spotlightClicks: !1,
16187  spotlightPadding: 10
16188}, defaultProps = {
16189  continuous: !1,
16190  debug: !1,
16191  disableCloseOnEsc: !1,
16192  disableOverlay: !1,
16193  disableOverlayClose: !1,
16194  disableScrolling: !1,
16195  disableScrollParentFix: !1,
16196  getHelpers: void 0,
16197  hideBackButton: !1,
16198  run: !0,
16199  scrollOffset: 20,
16200  scrollDuration: 300,
16201  scrollToFirstStep: !1,
16202  showSkipButton: !1,
16203  showProgress: !1,
16204  spotlightClicks: !1,
16205  spotlightPadding: 10,
16206  steps: []
16207}, defaultOptions2 = {
16208  arrowColor: "#fff",
16209  backgroundColor: "#fff",
16210  beaconSize: 36,
16211  overlayColor: "rgba(0, 0, 0, 0.5)",
16212  primaryColor: "#f04",
16213  spotlightShadow: "0 0 15px rgba(0, 0, 0, 0.5)",
16214  textColor: "#333",
16215  width: 380,
16216  zIndex: 100
16217}, buttonBase = {
16218  backgroundColor: "transparent",
16219  border: 0,
16220  borderRadius: 0,
16221  color: "#555",
16222  cursor: "pointer",
16223  fontSize: 16,
16224  lineHeight: 1,
16225  padding: 8,
16226  WebkitAppearance: "none"
16227}, spotlight = {
16228  borderRadius: 4,
16229  position: "absolute"
16230};
16231function getStyles2(props, step) {
16232  var _a2, _b, _c, _d, _e;
16233  let { floaterProps, styles: styles2 } = props, mergedFloaterProps = (0, import_deepmerge3.default)((_a2 = step.floaterProps) != null ? _a2 : {}, floaterProps ?? {}), mergedStyles = (0, import_deepmerge3.default)(styles2 ?? {}, (_b = step.styles) != null ? _b : {}), options2 = (0, import_deepmerge3.default)(defaultOptions2, mergedStyles.options || {}), hideBeacon2 = step.placement === "center" || step.disableBeacon, { width } = options2;
16234  window.innerWidth > 480 && (width = 380), "width" in options2 && (width = typeof options2.width == "number" && window.innerWidth < options2.width ? window.innerWidth - 30 : options2.width);
16235  let overlay = {
16236    bottom: 0,
16237    left: 0,
16238    overflow: "hidden",
16239    position: "absolute",
16240    right: 0,
16241    top: 0,
16242    zIndex: options2.zIndex
16243  }, defaultStyles = {
16244    beacon: {
16245      ...buttonBase,
16246      display: hideBeacon2 ? "none" : "inline-block",
16247      height: options2.beaconSize,
16248      position: "relative",
16249      width: options2.beaconSize,
16250      zIndex: options2.zIndex
16251    },
16252    beaconInner: {
16253      animation: "joyride-beacon-inner 1.2s infinite ease-in-out",
16254      backgroundColor: options2.primaryColor,
16255      borderRadius: "50%",
16256      display: "block",
16257      height: "50%",
16258      left: "50%",
16259      opacity: 0.7,
16260      position: "absolute",
16261      top: "50%",
16262      transform: "translate(-50%, -50%)",
16263      width: "50%"
16264    },
16265    beaconOuter: {
16266      animation: "joyride-beacon-outer 1.2s infinite ease-in-out",
16267      backgroundColor: `rgba(${hexToRGB(options2.primaryColor).join(",")}, 0.2)`,
16268      border: `2px solid ${options2.primaryColor}`,
16269      borderRadius: "50%",
16270      boxSizing: "border-box",
16271      display: "block",
16272      height: "100%",
16273      left: 0,
16274      opacity: 0.9,
16275      position: "absolute",
16276      top: 0,
16277      transformOrigin: "center",
16278      width: "100%"
16279    },
16280    tooltip: {
16281      backgroundColor: options2.backgroundColor,
16282      borderRadius: 5,
16283      boxSizing: "border-box",
16284      color: options2.textColor,
16285      fontSize: 16,
16286      maxWidth: "100%",
16287      padding: 15,
16288      position: "relative",
16289      width
16290    },
16291    tooltipContainer: {
16292      lineHeight: 1.4,
16293      textAlign: "center"
16294    },
16295    tooltipTitle: {
16296      fontSize: 18,
16297      margin: 0
16298    },
16299    tooltipContent: {
16300      padding: "20px 10px"
16301    },
16302    tooltipFooter: {
16303      alignItems: "center",
16304      display: "flex",
16305      justifyContent: "flex-end",
16306      marginTop: 15
16307    },
16308    tooltipFooterSpacer: {
16309      flex: 1
16310    },
16311    buttonNext: {
16312      ...buttonBase,
16313      backgroundColor: options2.primaryColor,
16314      borderRadius: 4,
16315      color: "#fff"
16316    },
16317    buttonBack: {
16318      ...buttonBase,
16319      color: options2.primaryColor,
16320      marginLeft: "auto",
16321      marginRight: 5
16322    },
16323    buttonClose: {
16324      ...buttonBase,
16325      color: options2.textColor,
16326      height: 14,
16327      padding: 15,
16328      position: "absolute",
16329      right: 0,
16330      top: 0,
16331      width: 14
16332    },
16333    buttonSkip: {
16334      ...buttonBase,
16335      color: options2.textColor,
16336      fontSize: 14
16337    },
16338    overlay: {
16339      ...overlay,
16340      backgroundColor: options2.overlayColor,
16341      mixBlendMode: "hard-light"
16342    },
16343    overlayLegacy: {
16344      ...overlay
16345    },
16346    overlayLegacyCenter: {
16347      ...overlay,
16348      backgroundColor: options2.overlayColor
16349    },
16350    spotlight: {
16351      ...spotlight,
16352      backgroundColor: "gray"
16353    },
16354    spotlightLegacy: {
16355      ...spotlight,
16356      boxShadow: `0 0 0 9999px ${options2.overlayColor}, ${options2.spotlightShadow}`
16357    },
16358    floaterStyles: {
16359      arrow: {
16360        color: (_e = (_d = (_c = mergedFloaterProps?.styles) == null ? void 0 : _c.arrow) == null ? void 0 : _d.color) != null ? _e : options2.arrowColor
16361      },
16362      options: {
16363        zIndex: options2.zIndex + 100
16364      }
16365    },
16366    options: options2
16367  };
16368  return (0, import_deepmerge3.default)(defaultStyles, mergedStyles);
16369}
16370function getTourProps(props) {
16371  return pick2(
16372    props,
16373    "beaconComponent",
16374    "disableCloseOnEsc",
16375    "disableOverlay",
16376    "disableOverlayClose",
16377    "disableScrolling",
16378    "disableScrollParentFix",
16379    "floaterProps",
16380    "hideBackButton",
16381    "hideCloseButton",
16382    "locale",
16383    "showProgress",
16384    "showSkipButton",
16385    "spotlightClicks",
16386    "spotlightPadding",
16387    "styles",
16388    "tooltipComponent"
16389  );
16390}
16391function getMergedStep(props, currentStep) {
16392  var _a2, _b, _c, _d, _e, _f;
16393  let step = currentStep ?? {}, mergedStep = import_deepmerge2.default.all([defaultStep, getTourProps(props), step], {
16394    isMergeableObject: src_default.plainObject
16395  }), mergedStyles = getStyles2(props, mergedStep), scrollParent2 = hasCustomScrollParent(
16396    getElement(mergedStep.target),
16397    mergedStep.disableScrollParentFix
16398  ), floaterProps = import_deepmerge2.default.all([
16399    defaultFloaterProps,
16400    (_a2 = props.floaterProps) != null ? _a2 : {},
16401    (_b = mergedStep.floaterProps) != null ? _b : {}
16402  ]);
16403  return floaterProps.offset = mergedStep.offset, floaterProps.styles = (0, import_deepmerge2.default)((_c = floaterProps.styles) != null ? _c : {}, mergedStyles.floaterStyles), floaterProps.offset += (_e = (_d = props.spotlightPadding) != null ? _d : mergedStep.spotlightPadding) != null ? _e : 0, mergedStep.placementBeacon && floaterProps.wrapperOptions && (floaterProps.wrapperOptions.placement = mergedStep.placementBeacon), scrollParent2 && floaterProps.options.preventOverflow && (floaterProps.options.preventOverflow.boundariesElement = "window"), {
16404    ...mergedStep,
16405    locale: import_deepmerge2.default.all([defaultLocale, (_f = props.locale) != null ? _f : {}, mergedStep.locale || {}]),
16406    floaterProps,
16407    styles: omit2(mergedStyles, "floaterStyles")
16408  };
16409}
16410function validateStep(step, debug = !1) {
16411  return src_default.plainObject(step) ? step.target ? !0 : (log2({
16412    title: "validateStep",
16413    data: "target is missing from the step",
16414    warn: !0,
16415    debug
16416  }), !1) : (log2({
16417    title: "validateStep",
16418    data: "step must be an object",
16419    warn: !0,
16420    debug
16421  }), !1);
16422}
16423function validateSteps(steps, debug = !1) {
16424  return src_default.array(steps) ? steps.every((d2) => validateStep(d2, debug)) : (log2({
16425    title: "validateSteps",
16426    data: "steps must be an array",
16427    warn: !0,
16428    debug
16429  }), !1);
16430}
16431var defaultState = {
16432  action: "init",
16433  controlled: !1,
16434  index: 0,
16435  lifecycle: LIFECYCLE.INIT,
16436  origin: null,
16437  size: 0,
16438  status: STATUS3.IDLE
16439}, validKeys = objectKeys(omit2(defaultState, "controlled", "size")), Store = class {
16440  constructor(options2) {
16441    __publicField(this, "beaconPopper"), __publicField(this, "tooltipPopper"), __publicField(this, "data", /* @__PURE__ */ new Map()), __publicField(this, "listener"), __publicField(this, "store", /* @__PURE__ */ new Map()), __publicField(this, "addListener", (listener) => {
16442      this.listener = listener;
16443    }), __publicField(this, "setSteps", (steps2) => {
16444      let { size, status } = this.getState(), state = {
16445        size: steps2.length,
16446        status
16447      };
16448      this.data.set("steps", steps2), status === STATUS3.WAITING && !size && steps2.length && (state.status = STATUS3.RUNNING), this.setState(state);
16449    }), __publicField(this, "getPopper", (name) => name === "beacon" ? this.beaconPopper : this.tooltipPopper), __publicField(this, "setPopper", (name, popper) => {
16450      name === "beacon" ? this.beaconPopper = popper : this.tooltipPopper = popper;
16451    }), __publicField(this, "cleanupPoppers", () => {
16452      this.beaconPopper = null, this.tooltipPopper = null;
16453    }), __publicField(this, "close", (origin = null) => {
16454      let { index, status } = this.getState();
16455      status === STATUS3.RUNNING && this.setState({
16456        ...this.getNextState({ action: ACTIONS.CLOSE, index: index + 1, origin })
16457      });
16458    }), __publicField(this, "go", (nextIndex) => {
16459      let { controlled, status } = this.getState();
16460      if (controlled || status !== STATUS3.RUNNING)
16461        return;
16462      let step = this.getSteps()[nextIndex];
16463      this.setState({
16464        ...this.getNextState({ action: ACTIONS.GO, index: nextIndex }),
16465        status: step ? status : STATUS3.FINISHED
16466      });
16467    }), __publicField(this, "info", () => this.getState()), __publicField(this, "next", () => {
16468      let { index, status } = this.getState();
16469      status === STATUS3.RUNNING && this.setState(this.getNextState({ action: ACTIONS.NEXT, index: index + 1 }));
16470    }), __publicField(this, "open", () => {
16471      let { status } = this.getState();
16472      status === STATUS3.RUNNING && this.setState({
16473        ...this.getNextState({ action: ACTIONS.UPDATE, lifecycle: LIFECYCLE.TOOLTIP })
16474      });
16475    }), __publicField(this, "prev", () => {
16476      let { index, status } = this.getState();
16477      status === STATUS3.RUNNING && this.setState({
16478        ...this.getNextState({ action: ACTIONS.PREV, index: index - 1 })
16479      });
16480    }), __publicField(this, "reset", (restart = !1) => {
16481      let { controlled } = this.getState();
16482      controlled || this.setState({
16483        ...this.getNextState({ action: ACTIONS.RESET, index: 0 }),
16484        status: restart ? STATUS3.RUNNING : STATUS3.READY
16485      });
16486    }), __publicField(this, "skip", () => {
16487      let { status } = this.getState();
16488      status === STATUS3.RUNNING && this.setState({
16489        action: ACTIONS.SKIP,
16490        lifecycle: LIFECYCLE.INIT,
16491        status: STATUS3.SKIPPED
16492      });
16493    }), __publicField(this, "start", (nextIndex) => {
16494      let { index, size } = this.getState();
16495      this.setState({
16496        ...this.getNextState(
16497          {
16498            action: ACTIONS.START,
16499            index: src_default.number(nextIndex) ? nextIndex : index
16500          },
16501          !0
16502        ),
16503        status: size ? STATUS3.RUNNING : STATUS3.WAITING
16504      });
16505    }), __publicField(this, "stop", (advance = !1) => {
16506      let { index, status } = this.getState();
16507      [STATUS3.FINISHED, STATUS3.SKIPPED].includes(status) || this.setState({
16508        ...this.getNextState({ action: ACTIONS.STOP, index: index + (advance ? 1 : 0) }),
16509        status: STATUS3.PAUSED
16510      });
16511    }), __publicField(this, "update", (state) => {
16512      var _a2, _b;
16513      if (!hasValidKeys(state, validKeys))
16514        throw new Error(`State is not valid. Valid keys: ${validKeys.join(", ")}`);
16515      this.setState({
16516        ...this.getNextState(
16517          {
16518            ...this.getState(),
16519            ...state,
16520            action: (_a2 = state.action) != null ? _a2 : ACTIONS.UPDATE,
16521            origin: (_b = state.origin) != null ? _b : null
16522          },
16523          !0
16524        )
16525      });
16526    });
16527    let { continuous = !1, stepIndex, steps = [] } = options2 ?? {};
16528    this.setState(
16529      {
16530        action: ACTIONS.INIT,
16531        controlled: src_default.number(stepIndex),
16532        continuous,
16533        index: src_default.number(stepIndex) ? stepIndex : 0,
16534        lifecycle: LIFECYCLE.INIT,
16535        origin: null,
16536        status: steps.length ? STATUS3.READY : STATUS3.IDLE
16537      },
16538      !0
16539    ), this.beaconPopper = null, this.tooltipPopper = null, this.listener = null, this.setSteps(steps);
16540  }
16541  getState() {
16542    return this.store.size ? {
16543      action: this.store.get("action") || "",
16544      controlled: this.store.get("controlled") || !1,
16545      index: parseInt(this.store.get("index"), 10),
16546      lifecycle: this.store.get("lifecycle") || "",
16547      origin: this.store.get("origin") || null,
16548      size: this.store.get("size") || 0,
16549      status: this.store.get("status") || ""
16550    } : { ...defaultState };
16551  }
16552  getNextState(state, force = !1) {
16553    var _a2, _b, _c, _d, _e;
16554    let { action, controlled, index, size, status } = this.getState(), newIndex = src_default.number(state.index) ? state.index : index, nextIndex = controlled && !force ? index : Math.min(Math.max(newIndex, 0), size);
16555    return {
16556      action: (_a2 = state.action) != null ? _a2 : action,
16557      controlled,
16558      index: nextIndex,
16559      lifecycle: (_b = state.lifecycle) != null ? _b : LIFECYCLE.INIT,
16560      origin: (_c = state.origin) != null ? _c : null,
16561      size: (_d = state.size) != null ? _d : size,
16562      status: nextIndex === size ? STATUS3.FINISHED : (_e = state.status) != null ? _e : status
16563    };
16564  }
16565  getSteps() {
16566    let steps = this.data.get("steps");
16567    return Array.isArray(steps) ? steps : [];
16568  }
16569  hasUpdatedState(oldState) {
16570    let before2 = JSON.stringify(oldState), after2 = JSON.stringify(this.getState());
16571    return before2 !== after2;
16572  }
16573  setState(nextState, initial = !1) {
16574    let state = this.getState(), {
16575      action,
16576      index,
16577      lifecycle,
16578      origin = null,
16579      size,
16580      status
16581    } = {
16582      ...state,
16583      ...nextState
16584    };
16585    this.store.set("action", action), this.store.set("index", index), this.store.set("lifecycle", lifecycle), this.store.set("origin", origin), this.store.set("size", size), this.store.set("status", status), initial && (this.store.set("controlled", nextState.controlled), this.store.set("continuous", nextState.continuous)), this.listener && this.hasUpdatedState(state) && this.listener(this.getState());
16586  }
16587  getHelpers() {
16588    return {
16589      close: this.close,
16590      go: this.go,
16591      info: this.info,
16592      next: this.next,
16593      open: this.open,
16594      prev: this.prev,
16595      reset: this.reset,
16596      skip: this.skip
16597    };
16598  }
16599};
16600function createStore(options2) {
16601  return new Store(options2);
16602}
16603function JoyrideSpotlight({ styles: styles2 }) {
16604  return createElement(
16605    "div",
16606    {
16607      key: "JoyrideSpotlight",
16608      className: "react-joyride__spotlight",
16609      "data-test-id": "spotlight",
16610      style: styles2
16611    }
16612  );
16613}
16614var Spotlight_default = JoyrideSpotlight, JoyrideOverlay = class extends Component {
16615  constructor() {
16616    super(...arguments), __publicField(this, "isActive", !1), __publicField(this, "resizeTimeout"), __publicField(this, "scrollTimeout"), __publicField(this, "scrollParent"), __publicField(this, "state", {
16617      isScrolling: !1,
16618      mouseOverSpotlight: !1,
16619      showSpotlight: !0
16620    }), __publicField(this, "hideSpotlight", () => {
16621      let { continuous, disableOverlay, lifecycle } = this.props, hiddenLifecycles = [
16622        LIFECYCLE.INIT,
16623        LIFECYCLE.BEACON,
16624        LIFECYCLE.COMPLETE,
16625        LIFECYCLE.ERROR
16626      ];
16627      return disableOverlay || (continuous ? hiddenLifecycles.includes(lifecycle) : lifecycle !== LIFECYCLE.TOOLTIP);
16628    }), __publicField(this, "handleMouseMove", (event) => {
16629      let { mouseOverSpotlight } = this.state, { height, left, position, top, width } = this.spotlightStyles, offsetY = position === "fixed" ? event.clientY : event.pageY, offsetX = position === "fixed" ? event.clientX : event.pageX, inSpotlightHeight = offsetY >= top && offsetY <= top + height, inSpotlight = offsetX >= left && offsetX <= left + width && inSpotlightHeight;
16630      inSpotlight !== mouseOverSpotlight && this.updateState({ mouseOverSpotlight: inSpotlight });
16631    }), __publicField(this, "handleScroll", () => {
16632      let { target } = this.props, element = getElement(target);
16633      if (this.scrollParent !== document) {
16634        let { isScrolling } = this.state;
16635        isScrolling || this.updateState({ isScrolling: !0, showSpotlight: !1 }), clearTimeout(this.scrollTimeout), this.scrollTimeout = window.setTimeout(() => {
16636          this.updateState({ isScrolling: !1, showSpotlight: !0 });
16637        }, 50);
16638      } else hasPosition(element, "sticky") && this.updateState({});
16639    }), __publicField(this, "handleResize", () => {
16640      clearTimeout(this.resizeTimeout), this.resizeTimeout = window.setTimeout(() => {
16641        this.isActive && this.forceUpdate();
16642      }, 100);
16643    });
16644  }
16645  componentDidMount() {
16646    let { debug, disableScrolling, disableScrollParentFix = !1, target } = this.props, element = getElement(target);
16647    this.scrollParent = getScrollParent2(element ?? document.body, disableScrollParentFix, !0), this.isActive = !0, window.addEventListener("resize", this.handleResize);
16648  }
16649  componentDidUpdate(previousProps) {
16650    var _a2;
16651    let { disableScrollParentFix, lifecycle, spotlightClicks, target } = this.props, { changed } = treeChanges(previousProps, this.props);
16652    if (changed("target") || changed("disableScrollParentFix")) {
16653      let element = getElement(target);
16654      this.scrollParent = getScrollParent2(element ?? document.body, disableScrollParentFix, !0);
16655    }
16656    changed("lifecycle", LIFECYCLE.TOOLTIP) && ((_a2 = this.scrollParent) == null || _a2.addEventListener("scroll", this.handleScroll, { passive: !0 }), setTimeout(() => {
16657      let { isScrolling } = this.state;
16658      isScrolling || this.updateState({ showSpotlight: !0 });
16659    }, 100)), (changed("spotlightClicks") || changed("disableOverlay") || changed("lifecycle")) && (spotlightClicks && lifecycle === LIFECYCLE.TOOLTIP ? window.addEventListener("mousemove", this.handleMouseMove, !1) : lifecycle !== LIFECYCLE.TOOLTIP && window.removeEventListener("mousemove", this.handleMouseMove));
16660  }
16661  componentWillUnmount() {
16662    var _a2;
16663    this.isActive = !1, window.removeEventListener("mousemove", this.handleMouseMove), window.removeEventListener("resize", this.handleResize), clearTimeout(this.resizeTimeout), clearTimeout(this.scrollTimeout), (_a2 = this.scrollParent) == null || _a2.removeEventListener("scroll", this.handleScroll);
16664  }
16665  get overlayStyles() {
16666    let { mouseOverSpotlight } = this.state, { disableOverlayClose, placement, styles: styles2 } = this.props, baseStyles = styles2.overlay;
16667    return isLegacy() && (baseStyles = placement === "center" ? styles2.overlayLegacyCenter : styles2.overlayLegacy), {
16668      cursor: disableOverlayClose ? "default" : "pointer",
16669      height: getDocumentHeight(),
16670      pointerEvents: mouseOverSpotlight ? "none" : "auto",
16671      ...baseStyles
16672    };
16673  }
16674  get spotlightStyles() {
16675    var _a2, _b, _c;
16676    let { showSpotlight } = this.state, {
16677      disableScrollParentFix = !1,
16678      spotlightClicks,
16679      spotlightPadding = 0,
16680      styles: styles2,
16681      target
16682    } = this.props, element = getElement(target), elementRect = getClientRect2(element), isFixedTarget = hasPosition(element), top = getElementPosition(element, spotlightPadding, disableScrollParentFix);
16683    return {
16684      ...isLegacy() ? styles2.spotlightLegacy : styles2.spotlight,
16685      height: Math.round(((_a2 = elementRect?.height) != null ? _a2 : 0) + spotlightPadding * 2),
16686      left: Math.round(((_b = elementRect?.left) != null ? _b : 0) - spotlightPadding),
16687      opacity: showSpotlight ? 1 : 0,
16688      pointerEvents: spotlightClicks ? "none" : "auto",
16689      position: isFixedTarget ? "fixed" : "absolute",
16690      top,
16691      transition: "opacity 0.2s",
16692      width: Math.round(((_c = elementRect?.width) != null ? _c : 0) + spotlightPadding * 2)
16693    };
16694  }
16695  updateState(state) {
16696    this.isActive && this.setState((previousState) => ({ ...previousState, ...state }));
16697  }
16698  render() {
16699    let { showSpotlight } = this.state, { onClickOverlay, placement } = this.props, { hideSpotlight, overlayStyles, spotlightStyles } = this;
16700    if (hideSpotlight())
16701      return null;
16702    let spotlight2 = placement !== "center" && showSpotlight && createElement(Spotlight_default, { styles: spotlightStyles });
16703    if (getBrowser() === "safari") {
16704      let { mixBlendMode, zIndex, ...safariOverlay } = overlayStyles;
16705      spotlight2 = createElement("div", { style: { ...safariOverlay } }, spotlight2), delete overlayStyles.backgroundColor;
16706    }
16707    return createElement(
16708      "div",
16709      {
16710        className: "react-joyride__overlay",
16711        "data-test-id": "overlay",
16712        onClick: onClickOverlay,
16713        role: "presentation",
16714        style: overlayStyles
16715      },
16716      spotlight2
16717    );
16718  }
16719}, JoyridePortal = class extends Component {
16720  constructor() {
16721    super(...arguments), __publicField(this, "node", null);
16722  }
16723  componentDidMount() {
16724    let { id } = this.props;
16725    canUseDOM2() && (this.node = document.createElement("div"), this.node.id = id, document.body.appendChild(this.node), isReact162 || this.renderReact15());
16726  }
16727  componentDidUpdate() {
16728    canUseDOM2() && (isReact162 || this.renderReact15());
16729  }
16730  componentWillUnmount() {
16731    !canUseDOM2() || !this.node || (isReact162 || unmountComponentAtNode(this.node), this.node.parentNode === document.body && (document.body.removeChild(this.node), this.node = null));
16732  }
16733  renderReact15() {
16734    if (!canUseDOM2())
16735      return;
16736    let { children } = this.props;
16737    this.node && unstable_renderSubtreeIntoContainer(this, children, this.node);
16738  }
16739  renderReact16() {
16740    if (!canUseDOM2() || !isReact162)
16741      return null;
16742    let { children } = this.props;
16743    return this.node ? createPortal(children, this.node) : null;
16744  }
16745  render() {
16746    return isReact162 ? this.renderReact16() : null;
16747  }
16748}, Scope = class {
16749  constructor(element, options2) {
16750    if (__publicField(this, "element"), __publicField(this, "options"), __publicField(this, "canBeTabbed", (element2) => {
16751      let { tabIndex } = element2;
16752      return tabIndex === null || tabIndex < 0 ? !1 : this.canHaveFocus(element2);
16753    }), __publicField(this, "canHaveFocus", (element2) => {
16754      let validTabNodes = /input|select|textarea|button|object/, nodeName = element2.nodeName.toLowerCase();
16755      return (validTabNodes.test(nodeName) && !element2.getAttribute("disabled") || nodeName === "a" && !!element2.getAttribute("href")) && this.isVisible(element2);
16756    }), __publicField(this, "findValidTabElements", () => [].slice.call(this.element.querySelectorAll("*"), 0).filter(this.canBeTabbed)), __publicField(this, "handleKeyDown", (event) => {
16757      let { code = "Tab" } = this.options;
16758      event.code === code && this.interceptTab(event);
16759    }), __publicField(this, "interceptTab", (event) => {
16760      event.preventDefault();
16761      let elements = this.findValidTabElements(), { shiftKey } = event;
16762      if (!elements.length)
16763        return;
16764      let x2 = document.activeElement ? elements.indexOf(document.activeElement) : 0;
16765      x2 === -1 || !shiftKey && x2 + 1 === elements.length ? x2 = 0 : shiftKey && x2 === 0 ? x2 = elements.length - 1 : x2 += shiftKey ? -1 : 1, elements[x2].focus();
16766    }), __publicField(this, "isHidden", (element2) => {
16767      let noSize = element2.offsetWidth <= 0 && element2.offsetHeight <= 0, style = window.getComputedStyle(element2);
16768      return noSize && !element2.innerHTML ? !0 : noSize && style.getPropertyValue("overflow") !== "visible" || style.getPropertyValue("display") === "none";
16769    }), __publicField(this, "isVisible", (element2) => {
16770      let parentElement = element2;
16771      for (; parentElement; )
16772        if (parentElement instanceof HTMLElement) {
16773          if (parentElement === document.body)
16774            break;
16775          if (this.isHidden(parentElement))
16776            return !1;
16777          parentElement = parentElement.parentNode;
16778        }
16779      return !0;
16780    }), __publicField(this, "removeScope", () => {
16781      window.removeEventListener("keydown", this.handleKeyDown);
16782    }), __publicField(this, "checkFocus", (target) => {
16783      document.activeElement !== target && (target.focus(), window.requestAnimationFrame(() => this.checkFocus(target)));
16784    }), __publicField(this, "setFocus", () => {
16785      let { selector } = this.options;
16786      if (!selector)
16787        return;
16788      let target = this.element.querySelector(selector);
16789      target && window.requestAnimationFrame(() => this.checkFocus(target));
16790    }), !(element instanceof HTMLElement))
16791      throw new TypeError("Invalid parameter: element must be an HTMLElement");
16792    this.element = element, this.options = options2, window.addEventListener("keydown", this.handleKeyDown, !1), this.setFocus();
16793  }
16794}, JoyrideBeacon = class extends Component {
16795  constructor(props) {
16796    if (super(props), __publicField(this, "beacon", null), __publicField(this, "setBeaconRef", (c2) => {
16797      this.beacon = c2;
16798    }), props.beaconComponent)
16799      return;
16800    let head = document.head || document.getElementsByTagName("head")[0], style = document.createElement("style");
16801    style.id = "joyride-beacon-animation", props.nonce && style.setAttribute("nonce", props.nonce), style.appendChild(document.createTextNode(`
16802        @keyframes joyride-beacon-inner {
16803          20% {
16804            opacity: 0.9;
16805          }
16806        
16807          90% {
16808            opacity: 0.7;
16809          }
16810        }
16811        
16812        @keyframes joyride-beacon-outer {
16813          0% {
16814            transform: scale(1);
16815          }
16816        
16817          45% {
16818            opacity: 0.7;
16819            transform: scale(0.75);
16820          }
16821        
16822          100% {
16823            opacity: 0.9;
16824            transform: scale(1);
16825          }
16826        }
16827      `)), head.appendChild(style);
16828  }
16829  componentDidMount() {
16830    let { shouldFocus } = this.props;
16831    setTimeout(() => {
16832      src_default.domElement(this.beacon) && shouldFocus && this.beacon.focus();
16833    }, 0);
16834  }
16835  componentWillUnmount() {
16836    let style = document.getElementById("joyride-beacon-animation");
16837    style?.parentNode && style.parentNode.removeChild(style);
16838  }
16839  render() {
16840    let {
16841      beaconComponent,
16842      continuous,
16843      index,
16844      isLastStep,
16845      locale,
16846      onClickOrHover,
16847      size,
16848      step,
16849      styles: styles2
16850    } = this.props, title2 = getReactNodeText(locale.open), sharedProps = {
16851      "aria-label": title2,
16852      onClick: onClickOrHover,
16853      onMouseEnter: onClickOrHover,
16854      ref: this.setBeaconRef,
16855      title: title2
16856    }, component;
16857    return beaconComponent ? component = createElement(
16858      beaconComponent,
16859      {
16860        continuous,
16861        index,
16862        isLastStep,
16863        size,
16864        step,
16865        ...sharedProps
16866      }
16867    ) : component = createElement(
16868      "button",
16869      {
16870        key: "JoyrideBeacon",
16871        className: "react-joyride__beacon",
16872        "data-test-id": "button-beacon",
16873        style: styles2.beacon,
16874        type: "button",
16875        ...sharedProps
16876      },
16877      createElement("span", { style: styles2.beaconInner }),
16878      createElement("span", { style: styles2.beaconOuter })
16879    ), component;
16880  }
16881};
16882function JoyrideTooltipCloseButton({ styles: styles2, ...props }) {
16883  let { color: color2, height, width, ...style } = styles2;
16884  return react_default.createElement("button", { style, type: "button", ...props }, react_default.createElement(
16885    "svg",
16886    {
16887      height: typeof height == "number" ? `${height}px` : height,
16888      preserveAspectRatio: "xMidYMid",
16889      version: "1.1",
16890      viewBox: "0 0 18 18",
16891      width: typeof width == "number" ? `${width}px` : width,
16892      xmlns: "http://www.w3.org/2000/svg"
16893    },
16894    react_default.createElement("g", null, react_default.createElement(
16895      "path",
16896      {
16897        d: "M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z",
16898        fill: color2
16899      }
16900    ))
16901  ));
16902}
16903var CloseButton_default = JoyrideTooltipCloseButton;
16904function JoyrideTooltipContainer(props) {
16905  let { backProps, closeProps, index, isLastStep, primaryProps, skipProps, step, tooltipProps } = props, { content, hideBackButton, hideCloseButton, hideFooter, showSkipButton, styles: styles2, title: title2 } = step, output = {};
16906  return output.primary = createElement(
16907    "button",
16908    {
16909      "data-test-id": "button-primary",
16910      style: styles2.buttonNext,
16911      type: "button",
16912      ...primaryProps
16913    }
16914  ), showSkipButton && !isLastStep && (output.skip = createElement(
16915    "button",
16916    {
16917      "aria-live": "off",
16918      "data-test-id": "button-skip",
16919      style: styles2.buttonSkip,
16920      type: "button",
16921      ...skipProps
16922    }
16923  )), !hideBackButton && index > 0 && (output.back = createElement("button", { "data-test-id": "button-back", style: styles2.buttonBack, type: "button", ...backProps })), output.close = !hideCloseButton && createElement(CloseButton_default, { "data-test-id": "button-close", styles: styles2.buttonClose, ...closeProps }), createElement(
16924    "div",
16925    {
16926      key: "JoyrideTooltip",
16927      "aria-label": getReactNodeText(title2 ?? content),
16928      className: "react-joyride__tooltip",
16929      style: styles2.tooltip,
16930      ...tooltipProps
16931    },
16932    createElement("div", { style: styles2.tooltipContainer }, title2 && createElement("h1", { "aria-label": getReactNodeText(title2), style: styles2.tooltipTitle }, title2), createElement("div", { style: styles2.tooltipContent }, content)),
16933    !hideFooter && createElement("div", { style: styles2.tooltipFooter }, createElement("div", { style: styles2.tooltipFooterSpacer }, output.skip), output.back, output.primary),
16934    output.close
16935  );
16936}
16937var Container_default = JoyrideTooltipContainer, JoyrideTooltip = class extends Component {
16938  constructor() {
16939    super(...arguments), __publicField(this, "handleClickBack", (event) => {
16940      event.preventDefault();
16941      let { helpers } = this.props;
16942      helpers.prev();
16943    }), __publicField(this, "handleClickClose", (event) => {
16944      event.preventDefault();
16945      let { helpers } = this.props;
16946      helpers.close("button_close");
16947    }), __publicField(this, "handleClickPrimary", (event) => {
16948      event.preventDefault();
16949      let { continuous, helpers } = this.props;
16950      if (!continuous) {
16951        helpers.close("button_primary");
16952        return;
16953      }
16954      helpers.next();
16955    }), __publicField(this, "handleClickSkip", (event) => {
16956      event.preventDefault();
16957      let { helpers } = this.props;
16958      helpers.skip();
16959    }), __publicField(this, "getElementsProps", () => {
16960      let { continuous, index, isLastStep, setTooltipRef, size, step } = this.props, { back, close, last, next, nextLabelWithProgress, skip } = step.locale, backText = getReactNodeText(back), closeText = getReactNodeText(close), lastText = getReactNodeText(last), nextText = getReactNodeText(next), skipText = getReactNodeText(skip), primary = close, primaryText = closeText;
16961      if (continuous) {
16962        if (primary = next, primaryText = nextText, step.showProgress && !isLastStep) {
16963          let labelWithProgress = getReactNodeText(nextLabelWithProgress, {
16964            step: index + 1,
16965            steps: size
16966          });
16967          primary = replaceLocaleContent(nextLabelWithProgress, index + 1, size), primaryText = labelWithProgress;
16968        }
16969        isLastStep && (primary = last, primaryText = lastText);
16970      }
16971      return {
16972        backProps: {
16973          "aria-label": backText,
16974          children: back,
16975          "data-action": "back",
16976          onClick: this.handleClickBack,
16977          role: "button",
16978          title: backText
16979        },
16980        closeProps: {
16981          "aria-label": closeText,
16982          children: close,
16983          "data-action": "close",
16984          onClick: this.handleClickClose,
16985          role: "button",
16986          title: closeText
16987        },
16988        primaryProps: {
16989          "aria-label": primaryText,
16990          children: primary,
16991          "data-action": "primary",
16992          onClick: this.handleClickPrimary,
16993          role: "button",
16994          title: primaryText
16995        },
16996        skipProps: {
16997          "aria-label": skipText,
16998          children: skip,
16999          "data-action": "skip",
17000          onClick: this.handleClickSkip,
17001          role: "button",
17002          title: skipText
17003        },
17004        tooltipProps: {
17005          "aria-modal": !0,
17006          ref: setTooltipRef,
17007          role: "alertdialog"
17008        }
17009      };
17010    });
17011  }
17012  render() {
17013    let { continuous, index, isLastStep, setTooltipRef, size, step } = this.props, { beaconComponent, tooltipComponent, ...cleanStep } = step, component;
17014    if (tooltipComponent) {
17015      let renderProps = {
17016        ...this.getElementsProps(),
17017        continuous,
17018        index,
17019        isLastStep,
17020        size,
17021        step: cleanStep,
17022        setTooltipRef
17023      };
17024      component = createElement(tooltipComponent, { ...renderProps });
17025    } else
17026      component = createElement(
17027        Container_default,
17028        {
17029          ...this.getElementsProps(),
17030          continuous,
17031          index,
17032          isLastStep,
17033          size,
17034          step
17035        }
17036      );
17037    return component;
17038  }
17039}, JoyrideStep = class extends Component {
17040  constructor() {
17041    super(...arguments), __publicField(this, "scope", null), __publicField(this, "tooltip", null), __publicField(this, "handleClickHoverBeacon", (event) => {
17042      let { step, store: store2 } = this.props;
17043      event.type === "mouseenter" && step.event !== "hover" || store2.update({ lifecycle: LIFECYCLE.TOOLTIP });
17044    }), __publicField(this, "setTooltipRef", (element) => {
17045      this.tooltip = element;
17046    }), __publicField(this, "setPopper", (popper, type) => {
17047      var _a2;
17048      let { action, lifecycle, step, store: store2 } = this.props;
17049      type === "wrapper" ? store2.setPopper("beacon", popper) : store2.setPopper("tooltip", popper), store2.getPopper("beacon") && (store2.getPopper("tooltip") || step.placement === "center") && lifecycle === LIFECYCLE.INIT && store2.update({
17050        action,
17051        lifecycle: LIFECYCLE.READY
17052      }), (_a2 = step.floaterProps) != null && _a2.getPopper && step.floaterProps.getPopper(popper, type);
17053    }), __publicField(this, "renderTooltip", (renderProps) => {
17054      let { continuous, helpers, index, size, step } = this.props;
17055      return createElement(
17056        JoyrideTooltip,
17057        {
17058          continuous,
17059          helpers,
17060          index,
17061          isLastStep: index + 1 === size,
17062          setTooltipRef: this.setTooltipRef,
17063          size,
17064          step,
17065          ...renderProps
17066        }
17067      );
17068    });
17069  }
17070  componentDidMount() {
17071    let { debug, index } = this.props;
17072    log2({
17073      title: `step:${index}`,
17074      data: [{ key: "props", value: this.props }],
17075      debug
17076    });
17077  }
17078  componentDidUpdate(previousProps) {
17079    var _a2;
17080    let {
17081      action,
17082      callback,
17083      continuous,
17084      controlled,
17085      debug,
17086      helpers,
17087      index,
17088      lifecycle,
17089      shouldScroll: shouldScroll2,
17090      status,
17091      step,
17092      store: store2
17093    } = this.props, { changed, changedFrom } = treeChanges(previousProps, this.props), state = helpers.info(), skipBeacon = continuous && action !== ACTIONS.CLOSE && (index > 0 || action === ACTIONS.PREV), hasStoreChanged = changed("action") || changed("index") || changed("lifecycle") || changed("status"), isInitial = changedFrom("lifecycle", [LIFECYCLE.TOOLTIP, LIFECYCLE.INIT], LIFECYCLE.INIT), isAfterAction = changed("action", [
17094      ACTIONS.NEXT,
17095      ACTIONS.PREV,
17096      ACTIONS.SKIP,
17097      ACTIONS.CLOSE
17098    ]), isControlled = controlled && index === previousProps.index;
17099    if (isAfterAction && (isInitial || isControlled) && callback({
17100      ...state,
17101      index: previousProps.index,
17102      lifecycle: LIFECYCLE.COMPLETE,
17103      step: previousProps.step,
17104      type: EVENTS.STEP_AFTER
17105    }), step.placement === "center" && status === STATUS3.RUNNING && changed("index") && action !== ACTIONS.START && lifecycle === LIFECYCLE.INIT && store2.update({ lifecycle: LIFECYCLE.READY }), hasStoreChanged) {
17106      let element = getElement(step.target), elementExists = !!element;
17107      elementExists && isElementVisible(element) ? (changedFrom("status", STATUS3.READY, STATUS3.RUNNING) || changedFrom("lifecycle", LIFECYCLE.INIT, LIFECYCLE.READY)) && callback({
17108        ...state,
17109        step,
17110        type: EVENTS.STEP_BEFORE
17111      }) : (console.warn(elementExists ? "Target not visible" : "Target not mounted", step), callback({
17112        ...state,
17113        type: EVENTS.TARGET_NOT_FOUND,
17114        step
17115      }), controlled || store2.update({ index: index + (action === ACTIONS.PREV ? -1 : 1) }));
17116    }
17117    changedFrom("lifecycle", LIFECYCLE.INIT, LIFECYCLE.READY) && store2.update({
17118      lifecycle: hideBeacon(step) || skipBeacon ? LIFECYCLE.TOOLTIP : LIFECYCLE.BEACON
17119    }), changed("index") && log2({
17120      title: `step:${lifecycle}`,
17121      data: [{ key: "props", value: this.props }],
17122      debug
17123    }), changed("lifecycle", LIFECYCLE.BEACON) && callback({
17124      ...state,
17125      step,
17126      type: EVENTS.BEACON
17127    }), changed("lifecycle", LIFECYCLE.TOOLTIP) && (callback({
17128      ...state,
17129      step,
17130      type: EVENTS.TOOLTIP
17131    }), shouldScroll2 && this.tooltip && (this.scope = new Scope(this.tooltip, { selector: "[data-action=primary]" }), this.scope.setFocus())), changedFrom("lifecycle", [LIFECYCLE.TOOLTIP, LIFECYCLE.INIT], LIFECYCLE.INIT) && ((_a2 = this.scope) == null || _a2.removeScope(), store2.cleanupPoppers());
17132  }
17133  componentWillUnmount() {
17134    var _a2;
17135    (_a2 = this.scope) == null || _a2.removeScope();
17136  }
17137  get open() {
17138    let { lifecycle, step } = this.props;
17139    return hideBeacon(step) || lifecycle === LIFECYCLE.TOOLTIP;
17140  }
17141  render() {
17142    let { continuous, debug, index, nonce, shouldScroll: shouldScroll2, size, step } = this.props, target = getElement(step.target);
17143    return !validateStep(step) || !src_default.domElement(target) ? null : createElement("div", { key: `JoyrideStep-${index}`, className: "react-joyride__step" }, createElement(
17144      ReactFloater,
17145      {
17146        ...step.floaterProps,
17147        component: this.renderTooltip,
17148        debug,
17149        getPopper: this.setPopper,
17150        id: `react-joyride-step-${index}`,
17151        open: this.open,
17152        placement: step.placement,
17153        target: step.target
17154      },
17155      createElement(
17156        JoyrideBeacon,
17157        {
17158          beaconComponent: step.beaconComponent,
17159          continuous,
17160          index,
17161          isLastStep: index + 1 === size,
17162          locale: step.locale,
17163          nonce,
17164          onClickOrHover: this.handleClickHoverBeacon,
17165          shouldFocus: shouldScroll2,
17166          size,
17167          step,
17168          styles: step.styles
17169        }
17170      )
17171    ));
17172  }
17173}, Joyride = class extends Component {
17174  constructor(props) {
17175    super(props), __publicField(this, "helpers"), __publicField(this, "store"), __publicField(this, "callback", (data) => {
17176      let { callback } = this.props;
17177      src_default.function(callback) && callback(data);
17178    }), __publicField(this, "handleKeyboard", (event) => {
17179      let { index, lifecycle } = this.state, { steps } = this.props, step = steps[index];
17180      lifecycle === LIFECYCLE.TOOLTIP && event.code === "Escape" && step && !step.disableCloseOnEsc && this.store.close("keyboard");
17181    }), __publicField(this, "handleClickOverlay", () => {
17182      let { index } = this.state, { steps } = this.props;
17183      getMergedStep(this.props, steps[index]).disableOverlayClose || this.helpers.close("overlay");
17184    }), __publicField(this, "syncState", (state) => {
17185      this.setState(state);
17186    });
17187    let { debug, getHelpers, run = !0, stepIndex } = props;
17188    this.store = createStore({
17189      ...props,
17190      controlled: run && src_default.number(stepIndex)
17191    }), this.helpers = this.store.getHelpers();
17192    let { addListener } = this.store;
17193    log2({
17194      title: "init",
17195      data: [
17196        { key: "props", value: this.props },
17197        { key: "state", value: this.state }
17198      ],
17199      debug
17200    }), addListener(this.syncState), getHelpers && getHelpers(this.helpers), this.state = this.store.getState();
17201  }
17202  componentDidMount() {
17203    if (!canUseDOM2())
17204      return;
17205    let { debug, disableCloseOnEsc, run, steps } = this.props, { start } = this.store;
17206    validateSteps(steps, debug) && run && start(), disableCloseOnEsc || document.body.addEventListener("keydown", this.handleKeyboard, { passive: !0 });
17207  }
17208  componentDidUpdate(previousProps, previousState) {
17209    if (!canUseDOM2())
17210      return;
17211    let { action, controlled, index, status } = this.state, { debug, run, stepIndex, steps } = this.props, { stepIndex: previousStepIndex, steps: previousSteps } = previousProps, { reset, setSteps, start, stop, update: update2 } = this.store, { changed: changedProps } = treeChanges(previousProps, this.props), { changed, changedFrom } = treeChanges(previousState, this.state), step = getMergedStep(this.props, steps[index]), stepsChanged = !equal(previousSteps, steps), stepIndexChanged = src_default.number(stepIndex) && changedProps("stepIndex"), target = getElement(step.target);
17212    if (stepsChanged && (validateSteps(steps, debug) ? setSteps(steps) : console.warn("Steps are not valid", steps)), changedProps("run") && (run ? start(stepIndex) : stop()), stepIndexChanged) {
17213      let nextAction = src_default.number(previousStepIndex) && previousStepIndex < stepIndex ? ACTIONS.NEXT : ACTIONS.PREV;
17214      action === ACTIONS.STOP && (nextAction = ACTIONS.START), [STATUS3.FINISHED, STATUS3.SKIPPED].includes(status) || update2({
17215        action: action === ACTIONS.CLOSE ? ACTIONS.CLOSE : nextAction,
17216        index: stepIndex,
17217        lifecycle: LIFECYCLE.INIT
17218      });
17219    }
17220    !controlled && status === STATUS3.RUNNING && index === 0 && !target && (this.store.update({ index: index + 1 }), this.callback({
17221      ...this.state,
17222      type: EVENTS.TARGET_NOT_FOUND,
17223      step
17224    }));
17225    let callbackData = {
17226      ...this.state,
17227      index,
17228      step
17229    };
17230    if (changed("action", [
17231      ACTIONS.NEXT,
17232      ACTIONS.PREV,
17233      ACTIONS.SKIP,
17234      ACTIONS.CLOSE
17235    ]) && changed("status", STATUS3.PAUSED)) {
17236      let previousStep = getMergedStep(this.props, steps[previousState.index]);
17237      this.callback({
17238        ...callbackData,
17239        index: previousState.index,
17240        lifecycle: LIFECYCLE.COMPLETE,
17241        step: previousStep,
17242        type: EVENTS.STEP_AFTER
17243      });
17244    }
17245    if (changed("status", [STATUS3.FINISHED, STATUS3.SKIPPED])) {
17246      let previousStep = getMergedStep(this.props, steps[previousState.index]);
17247      controlled || this.callback({
17248        ...callbackData,
17249        index: previousState.index,
17250        lifecycle: LIFECYCLE.COMPLETE,
17251        step: previousStep,
17252        type: EVENTS.STEP_AFTER
17253      }), this.callback({
17254        ...callbackData,
17255        type: EVENTS.TOUR_END,
17256        // Return the last step when the tour is finished
17257        step: previousStep,
17258        index: previousState.index
17259      }), reset();
17260    } else changedFrom("status", [STATUS3.IDLE, STATUS3.READY], STATUS3.RUNNING) ? this.callback({
17261      ...callbackData,
17262      type: EVENTS.TOUR_START
17263    }) : (changed("status") || changed("action", ACTIONS.RESET)) && this.callback({
17264      ...callbackData,
17265      type: EVENTS.TOUR_STATUS
17266    });
17267    this.scrollToStep(previousState);
17268  }
17269  componentWillUnmount() {
17270    let { disableCloseOnEsc } = this.props;
17271    disableCloseOnEsc || document.body.removeEventListener("keydown", this.handleKeyboard);
17272  }
17273  scrollToStep(previousState) {
17274    let { index, lifecycle, status } = this.state, {
17275      debug,
17276      disableScrollParentFix = !1,
17277      scrollDuration,
17278      scrollOffset = 20,
17279      scrollToFirstStep = !1,
17280      steps
17281    } = this.props, step = getMergedStep(this.props, steps[index]), target = getElement(step.target), shouldScrollToStep = shouldScroll({
17282      isFirstStep: index === 0,
17283      lifecycle,
17284      previousLifecycle: previousState.lifecycle,
17285      scrollToFirstStep,
17286      step,
17287      target
17288    });
17289    if (status === STATUS3.RUNNING && shouldScrollToStep) {
17290      let hasCustomScroll = hasCustomScrollParent(target, disableScrollParentFix), scrollParent2 = getScrollParent2(target, disableScrollParentFix), scrollY = Math.floor(getScrollTo(target, scrollOffset, disableScrollParentFix)) || 0;
17291      log2({
17292        title: "scrollToStep",
17293        data: [
17294          { key: "index", value: index },
17295          { key: "lifecycle", value: lifecycle },
17296          { key: "status", value: status }
17297        ],
17298        debug
17299      });
17300      let beaconPopper = this.store.getPopper("beacon"), tooltipPopper = this.store.getPopper("tooltip");
17301      if (lifecycle === LIFECYCLE.BEACON && beaconPopper) {
17302        let { offsets, placement } = beaconPopper;
17303        !["bottom"].includes(placement) && !hasCustomScroll && (scrollY = Math.floor(offsets.popper.top - scrollOffset));
17304      } else if (lifecycle === LIFECYCLE.TOOLTIP && tooltipPopper) {
17305        let { flipped, offsets, placement } = tooltipPopper;
17306        ["top", "right", "left"].includes(placement) && !flipped && !hasCustomScroll ? scrollY = Math.floor(offsets.popper.top - scrollOffset) : scrollY -= step.spotlightPadding;
17307      }
17308      scrollY = scrollY >= 0 ? scrollY : 0, status === STATUS3.RUNNING && scrollTo(scrollY, { element: scrollParent2, duration: scrollDuration }).then(
17309        () => {
17310          setTimeout(() => {
17311            var _a2;
17312            (_a2 = this.store.getPopper("tooltip")) == null || _a2.instance.update();
17313          }, 10);
17314        }
17315      );
17316    }
17317  }
17318  render() {
17319    if (!canUseDOM2())
17320      return null;
17321    let { index, lifecycle, status } = this.state, {
17322      continuous = !1,
17323      debug = !1,
17324      nonce,
17325      scrollToFirstStep = !1,
17326      steps
17327    } = this.props, isRunning = status === STATUS3.RUNNING, content = {};
17328    if (isRunning && steps[index]) {
17329      let step = getMergedStep(this.props, steps[index]);
17330      content.step = createElement(
17331        JoyrideStep,
17332        {
17333          ...this.state,
17334          callback: this.callback,
17335          continuous,
17336          debug,
17337          helpers: this.helpers,
17338          nonce,
17339          shouldScroll: !step.disableScrolling && (index !== 0 || scrollToFirstStep),
17340          step,
17341          store: this.store
17342        }
17343      ), content.overlay = createElement(JoyridePortal, { id: "react-joyride-portal" }, createElement(
17344        JoyrideOverlay,
17345        {
17346          ...step,
17347          continuous,
17348          debug,
17349          lifecycle,
17350          onClickOverlay: this.handleClickOverlay
17351        }
17352      ));
17353    }
17354    return createElement("div", { className: "react-joyride" }, content.step, content.overlay);
17355  }
17356};
17357__publicField(Joyride, "defaultProps", defaultProps);
17358var components_default2 = Joyride;
17359
vendor: 11,847 bytes, lines 17360-17628
17360// src/manager/components/TourGuide/HighlightElement.tsx
17361init_react();
17362var HIGHLIGHT_KEYFRAMES_ID = "storybook-highlight-element-keyframes", keyframes2 = `
17363  @keyframes sb-highlight-pulsate {
17364    0% {
17365      box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 0 rgba(2, 156, 253, 0.7), 0 0 0 0 rgba(2, 156, 253, 0.4);
17366    }
17367    50% {
17368      box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 20px rgba(2, 156, 253, 0), 0 0 0 40px rgba(2, 156, 253, 0);
17369    }
17370    100% {
17371      box-shadow: rgba(2,156,253,1) 0 0 2px 1px, 0 0 0 0 rgba(2, 156, 253, 0), 0 0 0 0 rgba(2, 156, 253, 0);
17372    }
17373  }
17374`, createOverlay = (element) => {
17375  let overlay = document.createElement("div");
17376  return overlay.id = "storybook-highlight-element", overlay.style.position = "fixed", overlay.style.pointerEvents = "none", overlay.style.zIndex = "2147483647", overlay.style.transition = "opacity 0.2s ease-in-out", requestAnimationFrame(() => {
17377    updateOverlayStyles(element, overlay), element.scrollIntoView({ behavior: "smooth", block: "center" });
17378  }), overlay;
17379}, updateOverlayStyles = (element, overlay) => {
17380  let rect = element.getBoundingClientRect(), computedStyle = window.getComputedStyle(element);
17381  overlay.style.top = `${rect.top}px`, overlay.style.left = `${rect.left}px`, overlay.style.width = `${rect.width}px`, overlay.style.height = `${rect.height}px`, overlay.style.borderRadius = computedStyle.borderRadius;
17382}, findScrollableAncestors = (element) => {
17383  let scrollableAncestors = [window], parent = element.parentElement;
17384  for (; parent; ) {
17385    let style = window.getComputedStyle(parent);
17386    (style.overflow === "auto" || style.overflow === "scroll" || style.overflowX === "auto" || style.overflowX === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll") && scrollableAncestors.push(parent), parent = parent.parentElement;
17387  }
17388  return scrollableAncestors;
17389};
17390function HighlightElement({
17391  targetSelector,
17392  pulsating = !1
17393}) {
17394  return useEffect(() => {
17395    let element = document.querySelector(targetSelector);
17396    if (!element || !element.parentElement)
17397      return;
17398    let overlay = document.body.appendChild(createOverlay(element));
17399    if (pulsating) {
17400      if (!document.getElementById(HIGHLIGHT_KEYFRAMES_ID)) {
17401        let style = document.createElement("style");
17402        style.id = HIGHLIGHT_KEYFRAMES_ID, style.innerHTML = keyframes2, document.head.appendChild(style);
17403      }
17404      overlay.style.animation = "sb-highlight-pulsate 3s infinite", overlay.style.transformOrigin = "center", overlay.style.animationTimingFunction = "ease-in-out";
17405    } else
17406      overlay.style.boxShadow = "rgba(2,156,253,1) 0 0 2px 1px";
17407    let scrollTimeout = null, handleScroll = () => {
17408      overlay.parentElement && overlay.remove(), scrollTimeout !== null && clearTimeout(scrollTimeout), scrollTimeout = window.setTimeout(() => {
17409        element && (updateOverlayStyles(element, overlay), overlay.style.opacity = "0", document.body.appendChild(overlay), requestAnimationFrame(() => overlay.style.opacity = "1"));
17410      }, 150);
17411    }, resizeObserver = new ResizeObserver(
17412      () => overlay.parentElement && updateOverlayStyles(element, overlay)
17413    );
17414    resizeObserver.observe(window.document.body), resizeObserver.observe(element);
17415    let scrollContainers = findScrollableAncestors(element);
17416    return scrollContainers.forEach(
17417      (el) => el.addEventListener("scroll", handleScroll, { passive: !0 })
17418    ), scrollContainers.filter((el) => el !== window).forEach((el) => resizeObserver.observe(el)), () => {
17419      scrollTimeout !== null && clearTimeout(scrollTimeout), overlay.parentElement && overlay.remove(), scrollContainers.forEach((el) => el.removeEventListener("scroll", handleScroll)), resizeObserver.disconnect();
17420    };
17421  }, [targetSelector, pulsating]), null;
17422}
17423
17424// src/manager/components/TourGuide/TourTooltip.tsx
17425init_react();
17426var ONBOARDING_ARROW_STYLE_ID = "storybook-onboarding-arrow-style", TooltipBody = styled.div`
17427  padding: 15px;
17428  border-radius: 5px;
17429`, Wrapper4 = styled.div`
17430  display: flex;
17431  flex-direction: column;
17432  align-items: flex-start;
17433`, TooltipHeader = styled.div`
17434  display: flex;
17435  align-items: center;
17436  align-self: stretch;
17437  justify-content: space-between;
17438  margin: -5px -5px 5px 0;
17439`, TooltipTitle = styled.div`
17440  line-height: 18px;
17441  font-weight: 700;
17442  font-size: 14px;
17443  margin: 5px 5px 5px 0;
17444`, TooltipContent = styled.p`
17445  font-size: 14px;
17446  line-height: 18px;
17447  text-align: start;
17448  text-wrap: balance;
17449  margin: 0;
17450  margin-top: 5px;
17451`, TooltipFooter = styled.div`
17452  display: flex;
17453  align-items: center;
17454  justify-content: space-between;
17455  margin-top: 15px;
17456`, Count = styled.span`
17457  font-size: 13px;
17458`, NextButton = styled(Button)(({ theme }) => ({
17459  background: theme.color.lightest,
17460  border: "none",
17461  boxShadow: "none",
17462  color: theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary),
17463  "&:hover, &:focus": {
17464    background: curriedTransparentize$1(0.1, theme.color.lightest),
17465    color: theme.base === "light" ? curriedLighten$1(0.1, theme.color.secondary) : curriedDarken$1(0.3, theme.color.secondary)
17466  }
17467})), TourTooltip = ({
17468  index,
17469  size,
17470  step,
17471  closeProps,
17472  primaryProps,
17473  tooltipProps
17474}) => (useEffect(() => {
17475  let style = document.createElement("style");
17476  return style.id = ONBOARDING_ARROW_STYLE_ID, style.innerHTML = `
17477      .__floater__arrow { container-type: size; }
17478      .__floater__arrow span { background: ${color.secondary}; }
17479      .__floater__arrow span::before, .__floater__arrow span::after {
17480        content: '';
17481        display: block;
17482        width: 2px;
17483        height: 2px;
17484        background: ${color.secondary};
17485        box-shadow: 0 0 0 2px ${color.secondary};
17486        border-radius: 3px;
17487        flex: 0 0 2px;
17488      }
17489      @container (min-height: 1px) {
17490        .__floater__arrow span { flex-direction: column; }
17491      }
17492    `, document.head.appendChild(style), () => document.getElementById(ONBOARDING_ARROW_STYLE_ID)?.remove();
17493}, []), react_default.createElement(TooltipBody, { ...tooltipProps, style: step.styles?.tooltip }, react_default.createElement(Wrapper4, null, react_default.createElement(TooltipHeader, null, step.title && react_default.createElement(TooltipTitle, null, step.title), react_default.createElement(
17494  Button,
17495  {
17496    ...closeProps,
17497    onClick: closeProps.onClick,
17498    variant: "solid",
17499    padding: "small",
17500    ariaLabel: "Close"
17501  },
17502  react_default.createElement(CloseAltIcon, null)
17503)), react_default.createElement(TooltipContent, null, step.content)), react_default.createElement(TooltipFooter, { id: "buttonNext" }, react_default.createElement(Count, null, index + 1, " of ", size), !step.hideNextButton && react_default.createElement(NextButton, { ...primaryProps }, index + 1 === size ? "Done" : "Next"))));
17504
17505// src/manager/components/TourGuide/TourGuide.tsx
17506var TourGuide = ({
17507  step,
17508  steps,
17509  onNext,
17510  onComplete,
17511  onDismiss
17512}) => {
17513  let [stepIndex, setStepIndex] = useState(step ? null : 0), theme = useTheme(), timeoutRef = useRef(void 0), updateStepIndex = useCallback((index) => {
17514    clearTimeout(timeoutRef.current), setStepIndex((current) => index === -1 ? null : current === null || current === index ? index : (timeoutRef.current = setTimeout(setStepIndex, 300, index), null));
17515  }, []);
17516  useEffect(
17517    () => step ? updateStepIndex(steps.findIndex(({ key }) => key === step)) : void 0,
17518    [step, steps, updateStepIndex]
17519  );
17520  let mappedSteps = useMemo(() => steps.map((step2, index) => {
17521    let next = () => updateStepIndex(index + 1);
17522    return {
17523      disableBeacon: !0,
17524      disableOverlay: !0,
17525      spotlightClicks: !0,
17526      offset: 0,
17527      ...step2,
17528      content: react_default.createElement(react_default.Fragment, null, step2.content, step2.highlight && react_default.createElement(HighlightElement, { targetSelector: step2.highlight, pulsating: !0 })),
17529      onNext: step2.onNext ? () => step2.onNext?.({ next }) : onNext && (() => onNext?.({ next }))
17530    };
17531  }), [steps, onNext, updateStepIndex]), callback = useCallback(
17532    (data) => {
17533      data.action === ACTIONS.NEXT && data.lifecycle === "complete" && (data.index === data.size - 1 ? onComplete?.() : data.step?.onNext ? data.step.onNext() : updateStepIndex(data.index + 1)), data.action === ACTIONS.CLOSE && onDismiss?.();
17534    },
17535    [onComplete, onDismiss, updateStepIndex]
17536  );
17537  return stepIndex === null ? null : react_default.createElement(
17538    components_default2,
17539    {
17540      continuous: !0,
17541      steps: mappedSteps,
17542      stepIndex,
17543      spotlightPadding: 0,
17544      disableCloseOnEsc: !0,
17545      disableOverlayClose: !0,
17546      disableScrolling: !0,
17547      callback,
17548      tooltipComponent: TourTooltip,
17549      floaterProps: {
17550        disableAnimation: !0,
17551        styles: {
17552          arrow: {
17553            length: 20,
17554            spread: 2
17555          },
17556          floater: {
17557            filter: theme.base === "light" ? "drop-shadow(0px 5px 5px rgba(0,0,0,0.05)) drop-shadow(0 1px 3px rgba(0,0,0,0.1))" : "drop-shadow(#fff5 0px 0px 0.5px) drop-shadow(#fff5 0px 0px 0.5px)"
17558          }
17559        }
17560      },
17561      styles: {
17562        overlay: {
17563          mixBlendMode: "unset",
17564          backgroundColor: steps[stepIndex]?.target === "body" ? "rgba(27, 28, 29, 0.2)" : "none"
17565        },
17566        spotlight: {
17567          backgroundColor: "none",
17568          border: `solid 2px ${theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary)}`,
17569          boxShadow: "0px 0px 0px 9999px rgba(27, 28, 29, 0.2)"
17570        },
17571        tooltip: {
17572          width: 280,
17573          color: theme.color.lightest,
17574          background: theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary)
17575        },
17576        options: {
17577          zIndex: 9998,
17578          primaryColor: theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary),
17579          arrowColor: theme.base === "light" ? theme.color.secondary : curriedDarken$1(0.18, theme.color.secondary)
17580        }
17581      }
17582    }
17583  );
17584}, root = null;
17585TourGuide.render = (props) => {
17586  let container = document.getElementById("storybook-tour");
17587  container || (container = document.createElement("div"), container.id = "storybook-tour", document.body.appendChild(container)), root = root ?? createRoot(container), root.render(
17588    props ? react_default.createElement(ThemeProvider, { theme: convert(themes.light) }, react_default.createElement(
17589      TourGuide,
17590      {
17591        ...props,
17592        onComplete: () => {
17593          props.onComplete?.(), root?.render(null), root = null;
17594        },
17595        onDismiss: () => {
17596          props.onDismiss?.(), root?.render(null), root = null;
17597        }
17598      }
17599    )) : null
17600  );
17601};
17602
17603// src/manager/hooks/useLocation.ts
17604init_react();
17605var LocationMonitor = {
17606  _currentHref: globalThis.window?.location.href ?? "",
17607  _intervalId: null,
17608  _listeners: /* @__PURE__ */ new Set(),
17609  start() {
17610    this._intervalId === null && (this._intervalId = setInterval(() => {
17611      let newLocation = globalThis.window.location;
17612      newLocation.href !== this._currentHref && (this._currentHref = newLocation.href, this._listeners.forEach((listener) => listener(newLocation)));
17613    }, 100));
17614  },
17615  stop() {
17616    this._intervalId !== null && (clearInterval(this._intervalId), this._intervalId = null);
17617  },
17618  subscribe(...listeners) {
17619    return listeners.forEach((listener) => this._listeners.add(listener)), this.start(), () => {
17620      listeners.forEach((listener) => this._listeners.delete(listener)), this._listeners.size === 0 && this.stop();
17621    };
17622  }
17623}, useLocationHash = () => {
17624  let [hash, setHash] = useState(globalThis.window?.location.hash ?? "");
17625  return useEffect(() => LocationMonitor.subscribe((location2) => setHash(location2.hash)), []), hash.slice(1);
17626};
17627
17628// src/shared/utils/ai-prompts.ts
17629function getAiSetupPrompt(executor = "npx storybook"
vendor: 48,372 bytes, lines 17629-18544
17629) {
17630  return `Run \`${executor} ai setup\` and follow its instructions precisely.`;
17631}
17632
17633// src/shared/checklist-store/checklistData.tsx
17634var CodeWrapper = styled.div(({ theme }) => ({
17635  alignSelf: "stretch",
17636  background: theme.background.content,
17637  borderRadius: theme.appBorderRadius,
17638  margin: "5px 0",
17639  padding: 10,
17640  fontSize: theme.typography.size.s1,
17641  ".linenumber": {
17642    opacity: 0.5
17643  }
17644})), CodeSnippet = (props) => react_default.createElement(ThemeProvider, { theme: convert(themes.dark) }, react_default.createElement(CodeWrapper, null, react_default.createElement(SyntaxHighlighter, { ...props }))), isExample = (id) => id.startsWith("example-") || id.startsWith("configure-your-project--"), subscribeToIndex = (condition) => ({ api, done }) => {
17645  let check = () => condition(
17646    Object.entries(api.getIndex()?.entries || {}).reduce(
17647      (acc, [id, entry]) => isExample(entry.id) ? acc : Object.assign(acc, { [id]: entry }),
17648      {}
17649    )
17650  );
17651  if (check())
17652    done();
17653  else
17654    return api.once(PREVIEW_INITIALIZED, () => check() && done()), api.on(STORY_INDEX_INVALIDATED, () => check() && done());
17655}, checklistData = {
17656  sections: [
17657    {
17658      id: "basics",
17659      title: "Storybook basics",
17660      items: [
17661        {
17662          id: "aiSetup",
17663          label: "Set up with AI",
17664          icon: WandIcon,
17665          available: ({ storeState }) => !!storeState.aiOptIn && storeState.items.aiSetup?.status !== "done",
17666          criteria: "ai setup command has not been run yet",
17667          showOnGuidePage: !1,
17668          action: {
17669            label: "Copy prompt",
17670            copyContent: getAiSetupPrompt(),
17671            onClick: ({ api }) => {
17672              api.emit(AI_PROMPT_NUDGE, { id: "setup", origin: "onboarding-checklist-side" });
17673            }
17674          }
17675        },
17676        {
17677          id: "guidedTour",
17678          label: "Take the guided tour",
17679          available: ({ index }) => !!index && "example-button--primary" in index && !!globalThis?.FEATURES?.controls && addons.experimental_getRegisteredAddons().includes(ADDON_ID3),
17680          criteria: "Guided tour is completed",
17681          subscribe: ({ api, accept }) => api.on(ADDON_ONBOARDING_CHANNEL, ({ step, type }) => {
17682            type !== "dismiss" && ["6:IntentSurvey", "7:FinishedOnboarding"].includes(step) && accept();
17683          }),
17684          action: {
17685            label: "Start",
17686            onClick: ({ api }) => {
17687              api.toggleNav(!0);
17688              let path = api.getUrlState().path || "";
17689              path.startsWith("/story/") ? document.location.href = `/?path=${path}&onboarding=true` : document.location.href = "/?onboarding=true";
17690            }
17691          }
17692        },
17693        {
17694          id: "onboardingSurvey",
17695          label: "Complete the onboarding survey",
17696          available: () => addons.experimental_getRegisteredAddons().includes(ADDON_ID3),
17697          afterCompletion: "immutable",
17698          criteria: "Onboarding survey is completed",
17699          subscribe: ({ api, accept }) => api.on(ADDON_ONBOARDING_CHANNEL, ({ type }) => type === "survey" && accept()),
17700          action: {
17701            label: "Open",
17702            onClick: ({ api }) => {
17703              let path = api.getUrlState().path || "";
17704              document.location.href = `/?path=${path}&onboarding=survey`;
17705            }
17706          }
17707        },
17708        {
17709          id: "renderComponent",
17710          label: "Render your first component",
17711          criteria: "A story finished rendering successfully",
17712          subscribe: ({ api, done }) => api.on(
17713            STORY_FINISHED,
17714            ({ storyId, status }) => status === "success" && !isExample(storyId) && done()
17715          ),
17716          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Storybook renders your components in isolation, using stories. That allows you to work on the bit of UI you need, without worrying about the rest of the app."), react_default.createElement("p", null, "Rendering your components can often require", " ", react_default.createElement(
17717            Link,
17718            {
17719              href: api.getDocsUrl({
17720                subpath: "writing-stories/decorators",
17721                renderer: !0,
17722                ref: "guide"
17723              }),
17724              target: "_blank"
17725            },
17726            "setting up surrounding context in decorators"
17727          ), " ", "or", " ", react_default.createElement(
17728            Link,
17729            {
17730              href: api.getDocsUrl({
17731                subpath: "configure/styling-and-css",
17732                renderer: !0,
17733                ref: "guide"
17734              }),
17735              target: "_blank"
17736            },
17737            "applying global styles"
17738          ), ". Once you've got it working for one component, you're ready to make Storybook the home for all of your UI."), react_default.createElement("p", null, "Stories are written in CSF, a format specifically designed to help with UI development. Here's an example:"), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.ts
17739// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, nextjs-vite, etc.
17740import type { Meta, StoryObj } from '@storybook/your-framework';
17741 
17742import { Button } from './Button';
17743 
17744const meta = {
17745  // \u{1F447} The component you're working on
17746  component: Button,
17747} satisfies Meta<typeof Button>;
17748 
17749export default meta;
17750// \u{1F447} Type helper to reduce boilerplate 
17751type Story = StoryObj<typeof meta>;
17752
17753// \u{1F447} A story named Primary that renders \`<Button primary label="Button" />\`
17754export const Primary: Story = {
17755  args: {
17756    primary: true,
17757    label: 'Button',
17758  },
17759};`), react_default.createElement("p", null, react_default.createElement(
17760            Link,
17761            {
17762              href: api.getDocsUrl({
17763                subpath: "writing-stories",
17764                renderer: !0,
17765                ref: "guide"
17766              }),
17767              target: "_blank",
17768              withArrow: !0
17769            },
17770            "Learn more about stories"
17771          )))
17772        },
17773        {
17774          id: "moreComponents",
17775          label: "Add 5 components",
17776          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Storybook gets better as you add more components. Start with the easy ones, like Button or Avatar, and work your way up to more complex components, like Select, Autocomplete, or even full pages."), react_default.createElement(
17777            "img",
17778            {
17779              src: api.getDocsUrl({
17780                asset: "onboarding/sidebar-components.png",
17781                ref: "guide"
17782              }),
17783              alt: "Components in the sidebar"
17784            }
17785          ), react_default.createElement("p", null, react_default.createElement(
17786            Link,
17787            {
17788              href: api.getDocsUrl({
17789                subpath: "get-started/whats-a-story#create-a-new-story",
17790                renderer: !0,
17791                ref: "guide"
17792              }),
17793              target: "_blank",
17794              withArrow: !0
17795            },
17796            "Learn how to add components without writing any code"
17797          ))),
17798          criteria: "At least 5 components exist in the index",
17799          subscribe: subscribeToIndex((entries) => {
17800            let stories = Object.values(entries).filter(
17801              (entry) => entry.type === "story"
17802            );
17803            return new Set(stories.map(({ title: title2 }) => title2)).size >= 5;
17804          })
17805        },
17806        {
17807          id: "moreStories",
17808          label: "Add 20 stories",
17809          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "More stories for your components means better documentation and more test coverage."), react_default.createElement(
17810            "img",
17811            {
17812              src: api.getDocsUrl({
17813                asset: "onboarding/sidebar-many-stories.png",
17814                ref: "guide"
17815              }),
17816              alt: "Stories in the sidebar"
17817            }
17818          ), react_default.createElement("p", null, react_default.createElement(
17819            Link,
17820            {
17821              href: api.getDocsUrl({
17822                subpath: "essentials/controls#creating-and-editing-stories-from-controls",
17823                renderer: !0,
17824                ref: "guide"
17825              }),
17826              target: "_blank",
17827              withArrow: !0
17828            },
17829            "Learn how to use Controls to add stories without writing any code"
17830          ))),
17831          criteria: "At least 20 stories exist in the index",
17832          subscribe: subscribeToIndex((entries) => Object.values(entries).filter(
17833            (entry) => entry.type === "story"
17834          ).length >= 20)
17835        },
17836        {
17837          id: "whatsNewStorybook10",
17838          label: "See what's new",
17839          criteria: "What's New page is opened",
17840          action: {
17841            label: "Go",
17842            onClick: ({ api }) => api.navigate("/settings/whats-new")
17843          },
17844          subscribe: ({ accept }) => LocationMonitor.subscribe((l3) => l3.search.endsWith("/settings/whats-new") && accept())
17845        }
17846      ]
17847    },
17848    {
17849      id: "development",
17850      title: "Development",
17851      items: [
17852        {
17853          id: "controls",
17854          label: "Change a story with Controls",
17855          available: () => !!globalThis?.FEATURES?.controls,
17856          criteria: "Story args are updated",
17857          subscribe: ({ api, done }) => api.on(STORY_ARGS_UPDATED, done),
17858          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "When you change the value of one of the inputs in the Controls table, the story automatically updates to reflect that change. It's a great way to explore how a component handles various inputs."), react_default.createElement(
17859            "img",
17860            {
17861              src: api.getDocsUrl({
17862                asset: "api/doc-block-controls.png",
17863                ref: "guide"
17864              }),
17865              alt: "Screenshot of Controls block"
17866            }
17867          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
17868            Link,
17869            {
17870              href: api.getDocsUrl({
17871                subpath: "essentials/controls",
17872                renderer: !0,
17873                ref: "guide"
17874              }),
17875              target: "_blank"
17876            },
17877            "Controls documentation"
17878          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to use the Controls panel to edit or save a new story"), react_default.createElement("li", null, "How to configure the table")))
17879        },
17880        {
17881          id: "viewports",
17882          label: "Check responsiveness with Viewports",
17883          available: () => !!globalThis?.FEATURES?.viewport,
17884          criteria: "Viewport global is updated",
17885          subscribe: ({ api, done }) => api.on(UPDATE_GLOBALS, ({ globals }) => globals?.viewport && done()),
17886          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Many UI components need to be responsive to the viewport size. Storybook has built-in support for previewing stories in various device sizes."), react_default.createElement(
17887            "img",
17888            {
17889              src: api.getDocsUrl({
17890                asset: "onboarding/viewports-menu.png",
17891                ref: "guide"
17892              }),
17893              alt: "Screenshot of Viewports menu"
17894            }
17895          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
17896            Link,
17897            {
17898              href: api.getDocsUrl({
17899                subpath: "essentials/viewport",
17900                renderer: !0,
17901                ref: "guide"
17902              }),
17903              target: "_blank"
17904            },
17905            "Viewports documentation"
17906          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to configure which viewports are available"), react_default.createElement("li", null, "How to force a story to ", react_default.createElement("em", null, "always"), " render in a specific viewport")))
17907        },
17908        {
17909          id: "organizeStories",
17910          label: "Group your components",
17911          criteria: "A root node exists in the index",
17912          subscribe: subscribeToIndex(
17913            (entries) => Object.values(entries).some(({ title: title2 }) => title2.includes("/"))
17914          ),
17915          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "It's helpful for projects to organize their sidebar into groups. We're big fans of Atomic Design (atoms, molecules, organisms, pages), but we've also seen organization by domain (profile, billing, dashboard, etc). Being organized helps everyone use your Storybook more effectively."), react_default.createElement("p", null, "You can create a section like so:"), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.js
17916
17917export default {
17918  component: Button,
17919-  title: 'Button', // You may not have this
17920+  title: 'Atoms/Button',
17921}`), react_default.createElement("p", null, "Which would look like:"), react_default.createElement(
17922            "img",
17923            {
17924              src: api.getDocsUrl({
17925                asset: "onboarding/sidebar-with-groups.png",
17926                ref: "guide"
17927              }),
17928              alt: "Grouped components in the sidebar"
17929            }
17930          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
17931            Link,
17932            {
17933              href: api.getDocsUrl({
17934                subpath: "writing-stories/naming-components-and-hierarchy",
17935                renderer: !0,
17936                ref: "guide"
17937              }),
17938              target: "_blank"
17939            },
17940            "story organization documentation"
17941          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "The full hierarchy available"), react_default.createElement("li", null, "How to configure the sorting of your stories")))
17942        }
17943      ]
17944    },
17945    {
17946      id: "share",
17947      title: "Share",
17948      items: [
17949        {
17950          id: "shareStorybook",
17951          label: "Share your Storybook for feedback",
17952          available: () => addons.experimental_getRegisteredAddons(Addon_TypesEnum.TOOLEXTRA).includes("chromaui/addon-visual-tests/share-tool"),
17953          criteria: "User has shared their Storybook",
17954          subscribe: ({ api, done }) => {
17955            let SHARE_PROGRESS_KEY = "chromaui/addon-visual-tests/shareProgress";
17956            return api.on("experimental_useSharedState_setValue", (key, value) => {
17957              key === SHARE_PROGRESS_KEY && value?.status === "complete" && done();
17958            });
17959          },
17960          action: {
17961            label: "Share",
17962            onClick: () => document.getElementById("chromatic-share-button")?.click()
17963          },
17964          content: () => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Share your Storybook with your team in one click using Chromatic. Click the", " ", react_default.createElement("strong", null, "Share"), " button in the toolbar to publish and get a shareable link."), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(Link, { href: "https://www.chromatic.com/docs/sharing", target: "_blank", withArrow: !0 }, "sharing documentation")))
17965        },
17966        {
17967          id: "publishStorybook",
17968          label: "Publish your Storybook for feedback",
17969          available: () => !addons.experimental_getRegisteredAddons(Addon_TypesEnum.TOOLEXTRA).includes("chromaui/addon-visual-tests/share-tool"),
17970          criteria: "User has published their Storybook",
17971          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Publishing your Storybook is easy and unlocks super clear review cycles and other collaborative workflows."), react_default.createElement("p", null, "Run ", react_default.createElement("code", null, "npx storybook build"), " in CI and deploy it using services like", " ", react_default.createElement(Link, { href: "https://chromatic.com", target: "_blank" }, "Chromatic"), ",", " ", react_default.createElement(Link, { href: "https://vercel.com", target: "_blank", rel: "noopener noreferrer" }, "Vercel"), ", or", " ", react_default.createElement(Link, { href: "https://www.netlify.com", target: "_blank", rel: "noopener noreferrer" }, "Netlify"), "."), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
17972            Link,
17973            {
17974              href: api.getDocsUrl({
17975                subpath: "sharing/publish-storybook",
17976                renderer: !0,
17977                ref: "guide"
17978              }),
17979              target: "_blank",
17980              withArrow: !0
17981            },
17982            "publishing documentation"
17983          )))
17984        }
17985      ]
17986    },
17987    {
17988      id: "testing",
17989      title: "Testing",
17990      items: [
17991        {
17992          id: "installVitest",
17993          label: "Install Vitest addon",
17994          afterCompletion: "unavailable",
17995          available: () => !!globalThis.STORYBOOK_FRAMEWORK && SUPPORTED_FRAMEWORKS.includes(globalThis.STORYBOOK_FRAMEWORK),
17996          criteria: "@storybook/addon-vitest registered in .storybook/main.js|ts",
17997          subscribe: ({ done }) => {
17998            addons.experimental_getRegisteredAddons().includes(ADDON_ID5) && done();
17999          },
18000          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Run this command to install the Vitest addon, enabling you to run component tests on your stories inside Storybook\u2019s UI:"), react_default.createElement(CodeSnippet, { language: "bash" }, "npx storybook add @storybook/addon-vitest"), react_default.createElement("p", null, react_default.createElement("em", null, "Restart your Storybook after installing the addon.")), react_default.createElement(
18001            "img",
18002            {
18003              src: api.getDocsUrl({
18004                asset: "writing-tests/testing-ui-overview.png",
18005                ref: "guide"
18006              }),
18007              alt: "Storybook app with story status indicators, testing widget, and addon panel annotated"
18008            }
18009          ), react_default.createElement("p", null, react_default.createElement(
18010            Link,
18011            {
18012              href: api.getDocsUrl({
18013                subpath: "writing-tests/integrations/vitest-addon",
18014                renderer: !0,
18015                ref: "guide"
18016              }),
18017              target: "_blank",
18018              withArrow: !0
18019            },
18020            "Learn more about the Vitest addon"
18021          )))
18022        },
18023        {
18024          id: "runTests",
18025          after: ["installVitest"],
18026          label: "Test your components",
18027          criteria: "Component tests are run from the test widget in the sidebar",
18028          subscribe: ({ done }) => internal_universalTestProviderStore.onStateChange((state) => {
18029            state["storybook/test"] === "test-provider-state:running" && (TourGuide.render(null), done());
18030          }),
18031          action: {
18032            label: "Start",
18033            onClick: ({ api }) => {
18034              api.toggleNav(!0), TourGuide.render({
18035                // eslint-disable-next-line @typescript-eslint/ban-ts-comment
18036                // @ts-ignore Circular reference in Step type
18037                steps: [
18038                  {
18039                    title: "Testing widget",
18040                    content: "Run tests right from your Storybook sidebar using the testing widget.",
18041                    placement: "right-end",
18042                    target: "#storybook-testing-module",
18043                    highlight: "#storybook-testing-module",
18044                    onNext: ({ next }) => {
18045                      let toggle = document.getElementById("testing-module-collapse-toggle");
18046                      toggle?.getAttribute("aria-label") === "Expand testing module" ? (toggle.click(), setTimeout(next, 300)) : next();
18047                    }
18048                  },
18049                  {
18050                    title: "Start a test run",
18051                    content: "Start a test run at the click of a button using Vitest.",
18052                    placement: "right",
18053                    target: '[data-module-id="storybook/test/test-provider"] button[aria-label="Start test run"]',
18054                    highlight: '[data-module-id="storybook/test/test-provider"] button[aria-label="Start test run"]',
18055                    hideNextButton: !0
18056                  }
18057                ]
18058              });
18059            }
18060          },
18061          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Stories make great test cases. You can quickly test all of your stories directly from the test widget, at the bottom of the sidebar."), react_default.createElement(
18062            "img",
18063            {
18064              src: api.getDocsUrl({
18065                asset: "onboarding/test-widget-with-failures.png",
18066                ref: "guide"
18067              }),
18068              alt: "Test widget showing test failures"
18069            }
18070          ), react_default.createElement("p", null, "Use the menu on a story or component to see details about a test failure or run tests for just that selection."), react_default.createElement(
18071            "img",
18072            {
18073              src: api.getDocsUrl({
18074                asset: "writing-tests/context-menu.png",
18075                ref: "guide"
18076              }),
18077              alt: "Screenshot of story sidebar item with open menu"
18078            }
18079          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
18080            Link,
18081            {
18082              href: api.getDocsUrl({
18083                subpath: "writing-tests#component-tests",
18084                renderer: !0,
18085                ref: "guide"
18086              }),
18087              target: "_blank"
18088            },
18089            "component testing documentation"
18090          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "About helpful features, like watch mode and sidebar filtering"), react_default.createElement("li", null, "How to run tests via CLI and in CI"), react_default.createElement("li", null, "About other capabilities, like accessibility checks and code coverage reporting")))
18091        },
18092        {
18093          id: "writeInteractions",
18094          label: "Test functionality with interactions",
18095          available: () => !!globalThis?.FEATURES?.interactions,
18096          criteria: "At least one story with a play or test function",
18097          subscribe: subscribeToIndex(
18098            (entries) => Object.values(entries).some(
18099              (entry) => entry.tags?.includes(Tag.PLAY_FN) || entry.tags?.includes(Tag.TEST_FN)
18100            )
18101          ),
18102          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "When you need to test non-visual or particularly complex behavior of a component, add a play function."), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.ts
18103// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, nextjs-vite, etc.
18104import type { Meta, StoryObj } from '@storybook/your-framework';
18105import { expect, fn } from 'storybook/test';
18106 
18107import { Button } from './Button';
18108 
18109const meta = {
18110  component: Button,
18111  args: {
18112    // \u{1F447} Provide a mock function to spy on
18113    onClick: fn(),
18114  },
18115} satisfies Meta<typeof Button>;
18116 
18117export default meta;
18118type Story = StoryObj<typeof meta>;
18119
18120export const Disabled: Story = {
18121  args: {
18122    disabled: true,
18123    label: 'Button',
18124  },
18125  play: async function({ args, canvas, userEvent }) {
18126    const button = canvas.getByRole('button', { name: /button/i });
18127		
18128    // \u{1F447} Simulate behavior
18129    await userEvent.click(button);
18130    
18131    // \u{1F447} Make assertions
18132    await expect(button).toHaveAttribute('aria-disabled', 'true');
18133    await expect(args.onClick).not.toHaveBeenCalled();
18134  }
18135};`), react_default.createElement("p", null, "You can interact with and debug each step defined in a play function within the Interactions panel."), react_default.createElement(
18136            "img",
18137            {
18138              src: api.getDocsUrl({
18139                asset: "writing-tests/interaction-test-pass.png",
18140                ref: "guide"
18141              }),
18142              alt: "Storybook with a LoginForm component and passing interactions in the Interactions panel"
18143            }
18144          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
18145            Link,
18146            {
18147              href: api.getDocsUrl({
18148                subpath: "writing-tests/interaction-testing",
18149                renderer: !0,
18150                ref: "guide"
18151              }),
18152              target: "_blank"
18153            },
18154            "interaction testing documentation"
18155          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "The full ", react_default.createElement("code", null, "play"), " function API"), react_default.createElement("li", null, "How to run code before and after tests"), react_default.createElement("li", null, "How to group interactions into steps")))
18156        },
18157        {
18158          id: "installA11y",
18159          label: "Install Accessibility addon",
18160          afterCompletion: "unavailable",
18161          criteria: "@storybook/addon-a11y registered in .storybook/main.js|ts",
18162          subscribe: ({ done }) => {
18163            addons.experimental_getRegisteredAddons().includes(ADDON_ID2) && done();
18164          },
18165          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Accessibility tests help ensure your UI is usable by everyone, no matter their ability."), react_default.createElement("p", null, "If you are not yet using the accessibility addon, run this command to install and set it up, enabling you to run accessibility checks alongside your component tests:"), react_default.createElement(CodeSnippet, { language: "bash" }, "npx storybook add @storybook/addon-a11y"), react_default.createElement("p", null, react_default.createElement("em", null, "Restart your Storybook after installing the addon.")), react_default.createElement("p", null, react_default.createElement(
18166            Link,
18167            {
18168              href: api.getDocsUrl({
18169                subpath: "writing-tests/accessibility-testing",
18170                renderer: !0,
18171                ref: "guide"
18172              }),
18173              target: "_blank",
18174              withArrow: !0
18175            },
18176            "Learn more about the Accessibility addon"
18177          )))
18178        },
18179        {
18180          id: "accessibilityTests",
18181          after: ["installA11y"],
18182          label: "Run accessibility tests",
18183          criteria: "Accessibility tests are run from the test widget in the sidebar",
18184          subscribe: ({ api, done }) => api.on(
18185            STORYBOOK_ADDON_TEST_CHANNEL,
18186            ({ type, payload }) => type === "test-run-completed" && payload.config.a11y && done()
18187          ),
18188          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Expand the test widget, check the Accessibility checkbox, and click the Run component tests button."), react_default.createElement(
18189            "img",
18190            {
18191              src: api.getDocsUrl({
18192                asset: "writing-tests/test-widget-a11y-enabled.png",
18193                ref: "guide"
18194              }),
18195              alt: "Testing widget with accessibility activated"
18196            }
18197          ), react_default.createElement("p", null, "If there are any failures, you can use the Accessibility panel to debug any violations."), react_default.createElement(
18198            "img",
18199            {
18200              src: api.getDocsUrl({
18201                asset: "writing-tests/addon-a11y-debug-violations.png",
18202                ref: "guide"
18203              }),
18204              alt: "Storybook app with accessibility panel open, showing violations and an interactive popover on the violating elements in the preview"
18205            }
18206          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
18207            Link,
18208            {
18209              href: api.getDocsUrl({
18210                subpath: "writing-tests/accessibility-testing",
18211                renderer: !0,
18212                ref: "guide"
18213              }),
18214              target: "_blank"
18215            },
18216            "accessibility testing documentation"
18217          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "The recommended workflow"), react_default.createElement("li", null, "How to run accessibility tests via CLI and in CI"), react_default.createElement("li", null, "How to configure accessibility checks")))
18218        },
18219        {
18220          id: "installChromatic",
18221          label: "Install Visual Tests addon",
18222          afterCompletion: "unavailable",
18223          available: () => !0,
18224          // TODO check for compatibility with the project (not React Native)
18225          criteria: "@chromatic-com/storybook registered in .storybook/main.js|ts",
18226          subscribe: ({ done }) => {
18227            addons.experimental_getRegisteredAddons().includes("chromaui/addon-visual-tests") && done();
18228          },
18229          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Visual tests verify the appearance of your UI components."), react_default.createElement("p", null, "If you are not yet using the visual tests addon, run this command to install and set it up, enabling you to run visual tests on your stories (this requires a free Chromatic account):"), react_default.createElement(CodeSnippet, { language: "bash" }, "npx storybook add @chromatic-com/storybook"), react_default.createElement("p", null, react_default.createElement("em", null, "Restart your Storybook after installing the addon.")), react_default.createElement("p", null, react_default.createElement(
18230            Link,
18231            {
18232              href: api.getDocsUrl({
18233                subpath: "writing-tests/visual-testing",
18234                renderer: !0,
18235                ref: "guide"
18236              }),
18237              target: "_blank",
18238              withArrow: !0
18239            },
18240            "Learn more about the Visual Tests addon"
18241          )))
18242        },
18243        {
18244          id: "visualTests",
18245          after: ["installChromatic"],
18246          label: "Run visual tests",
18247          criteria: "Visual tests are run from the test widget in the sidebar or the Visual Tests panel",
18248          subscribe: ({ api, done }) => api.on("chromaui/addon-visual-tests/startBuild", done),
18249          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Expand the test widget and click the Run visual tests button."), react_default.createElement(
18250            "img",
18251            {
18252              src: api.getDocsUrl({
18253                asset: "writing-tests/test-widget-expanded-with-vta.png",
18254                ref: "guide"
18255              }),
18256              alt: "Expanded testing widget, showing the Visual tests section"
18257            }
18258          ), react_default.createElement("p", null, "You can use the Visual tests panel to verify the resulting diffs as either an unexpected change which needs fixed or an expected change which can then be accepted and become the new baseline."), react_default.createElement(
18259            "img",
18260            {
18261              src: api.getDocsUrl({
18262                asset: "writing-tests/vta-run-from-panel.png",
18263                ref: "guide"
18264              }),
18265              alt: "Visual tests addon panel showing a diff from the baseline"
18266            }
18267          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
18268            Link,
18269            {
18270              href: api.getDocsUrl({
18271                subpath: "writing-tests/visual-testing",
18272                renderer: !0,
18273                ref: "guide"
18274              }),
18275              target: "_blank"
18276            },
18277            "visual testing documentation"
18278          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to automate your visual tests in CI")))
18279        },
18280        {
18281          id: "coverage",
18282          after: ["installVitest"],
18283          label: "Generate a coverage report",
18284          criteria: "Generate a coverage report",
18285          subscribe: ({ api, done }) => api.on(
18286            STORYBOOK_ADDON_TEST_CHANNEL,
18287            ({ type, payload }) => type === "test-run-completed" && payload.config.coverage && done()
18288          ),
18289          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Coverage reports show you which code is\u2014and, more importantly\u2014isn't executed while running your component tests. You use it to be sure you're testing the right things."), react_default.createElement("p", null, "To generate a coverage report, expand the test widget in the sidebar and check the Coverage checkbox. The next time you run component tests, it will generate an interactive report, which you can view by clicking the results summary in the test widget."), react_default.createElement(
18290            "img",
18291            {
18292              src: api.getDocsUrl({
18293                asset: "writing-tests/test-widget-coverage-summary.png",
18294                ref: "guide"
18295              }),
18296              alt: "Test widget with coverage summary"
18297            }
18298          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
18299            Link,
18300            {
18301              href: api.getDocsUrl({
18302                subpath: "writing-tests/test-coverage",
18303                renderer: !0,
18304                ref: "guide"
18305              }),
18306              target: "_blank"
18307            },
18308            "test coverage documentation"
18309          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to automate reporting in CI"), react_default.createElement("li", null, "How to configure the coverage results")))
18310        },
18311        {
18312          id: "ciTests",
18313          label: "Automate tests in CI",
18314          criteria: "Have a CI workflow that runs component tests, either with Vitest or Chromatic",
18315          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Automating component tests in CI is the best tool ensuring the quality and reliability of your project."), react_default.createElement("p", null, "You can automate all of Storybook's tests by using Chromatic or by running the", react_default.createElement("code", null, "vitest --project storybook"), " command in your CI scripts."), react_default.createElement(
18316            "img",
18317            {
18318              src: api.getDocsUrl({
18319                asset: "writing-tests/test-ci-workflow-pr-status-checks.png",
18320                ref: "guide"
18321              }),
18322              alt: 'GitHub pull request status checks, with a failing "UI Tests / test" check'
18323            }
18324          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
18325            Link,
18326            {
18327              href: api.getDocsUrl({
18328                subpath: "writing-tests/in-ci",
18329                renderer: !0,
18330                ref: "guide"
18331              }),
18332              target: "_blank"
18333            },
18334            "testing in CI documentation"
18335          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to test in your CI platform (GitHub Actions, Circle CI, etc.)"), react_default.createElement("li", null, "How to debug test failures in a published Storybook"), react_default.createElement("li", null, "How to run your other Vitest tests alongside your Storybook tests")))
18336        }
18337      ]
18338    },
18339    {
18340      id: "document",
18341      title: "Document",
18342      items: [
18343        {
18344          id: "installDocs",
18345          label: "Install Docs addon",
18346          afterCompletion: "unavailable",
18347          criteria: "@storybook/addon-docs registered in .storybook/main.js|ts",
18348          subscribe: ({ done }) => {
18349            addons.experimental_getRegisteredAddons().includes(ADDON_ID6) && done();
18350          },
18351          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Storybook Docs transforms your Storybook stories into component documentation. Add the Docs addon to your Storybook project to get started:"), react_default.createElement(CodeSnippet, { language: "bash" }, "npx storybook add @storybook/addon-docs"), react_default.createElement("p", null, react_default.createElement("em", null, "Restart your Storybook after installing the addon.")), react_default.createElement("p", null, react_default.createElement(
18352            Link,
18353            {
18354              href: api.getDocsUrl({
18355                subpath: "writing-docs",
18356                renderer: !0,
18357                ref: "guide"
18358              }),
18359              target: "_blank",
18360              withArrow: !0
18361            },
18362            "Learn more about Storybook Docs"
18363          )))
18364        },
18365        {
18366          id: "autodocs",
18367          after: ["installDocs"],
18368          label: "Automatically document your components",
18369          criteria: "At least one component with the autodocs tag applied",
18370          subscribe: subscribeToIndex(
18371            (entries) => Object.values(entries).some((entry) => entry.tags?.includes(Tag.AUTODOCS))
18372          ),
18373          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "Add the autodocs tag to a component's meta to automatically generate documentation for that component, complete with examples, source code, an API table, and a description."), react_default.createElement(CodeSnippet, { language: "typescript" }, `// Button.stories.js
18374
18375const meta = {
18376  component: Button,
18377  tags: ['autodocs'], // \u{1F448} Add this tag
18378}
18379  
18380export default meta;`), react_default.createElement("p", null, "That tag can also be applied in ", react_default.createElement("code", null, ".storybook/preview.ts"), ", to generate documentation for ", react_default.createElement("em", null, "all"), " components."), react_default.createElement(
18381            "img",
18382            {
18383              src: api.getDocsUrl({
18384                asset: "writing-docs/autodocs.png",
18385                ref: "guide"
18386              }),
18387              alt: "Storybook autodocs page, showing a title, description, primary story, controls table, and additional stories"
18388            }
18389          ), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
18390            Link,
18391            {
18392              href: api.getDocsUrl({
18393                subpath: "writing-docs/autodocs",
18394                renderer: !0,
18395                ref: "guide"
18396              }),
18397              target: "_blank"
18398            },
18399            "autodocs documentation"
18400          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to generate a table of contents"), react_default.createElement("li", null, "How to enhance your component documentation with JSDoc comments"), react_default.createElement("li", null, "How to customize the generated page")))
18401        },
18402        {
18403          id: "mdxDocs",
18404          after: ["installDocs"],
18405          label: "Custom content with MDX",
18406          criteria: "At least one MDX page",
18407          subscribe: subscribeToIndex(
18408            (entries) => Object.values(entries).some((entry) => entry.type === "docs")
18409          ),
18410          content: ({ api }) => react_default.createElement(react_default.Fragment, null, react_default.createElement("p", null, "You can use MDX (markdown + React components) to provide an introduction to your project, document things like design tokens, or go beyond the automatic documentation for your components."), react_default.createElement("p", null, "For a start, create an ", react_default.createElement("code", null, "introduction.mdx"), " file and (using markdown and Storybook's", " ", react_default.createElement(
18411            Link,
18412            {
18413              href: api.getDocsUrl({
18414                subpath: "writing-docs/doc-blocks",
18415                renderer: !0,
18416                ref: "guide"
18417              }),
18418              target: "_blank"
18419            },
18420            "doc blocks"
18421          ), ") write a usage guide for your project."), react_default.createElement(CodeSnippet, { language: "jsx" }, `{ /* introduction.mdx */ }
18422import { Meta, Title, Subtitle } from '@storybook/addon-docs/blocks';
18423
18424<Meta title="Get started" />
18425 
18426<Title>Get started with My Awesome Project</Title>
18427
18428<Subtitle>It's really awesome</Subtitle>
18429
18430My Awesome Project is designed to work with Your Awesome Project seamlessly.
18431Follow this guide and you'll be ready in no time.
18432
18433## Install
18434
18435\`\`\`sh
18436npm install @my/awesome-project
18437\`\`\``), react_default.createElement("strong", null, "Take it further"), react_default.createElement("p", null, "Read the", " ", react_default.createElement(
18438            Link,
18439            {
18440              href: api.getDocsUrl({
18441                subpath: "writing-docs/mdx",
18442                renderer: !0,
18443                ref: "guide"
18444              }),
18445              target: "_blank"
18446            },
18447            "MDX documentation"
18448          ), " ", "to learn:"), react_default.createElement("ul", null, react_default.createElement("li", null, "How to reference stories in your content"), react_default.createElement("li", null, "How to import and display markdown files, such as READMEs")))
18449        }
18450      ]
18451    }
18452  ]
18453};
18454
18455// src/manager/components/sidebar/useChecklist.ts
18456var subscriptions = /* @__PURE__ */ new Map(), useStoryIndex = () => {
18457  let state = useStorybookState(), [index, setIndex] = useState(() => state.index), updateIndex = useMemo(() => throttle(setIndex, 500), []);
18458  return useEffect(() => updateIndex(state.index), [state.index, updateIndex]), useEffect(() => () => updateIndex.cancel?.(), [updateIndex]), index;
18459}, checkAvailable = (item, itemsById, context) => {
18460  if (item.available && !item.available(context))
18461    return !1;
18462  for (let afterId of item.after ?? [])
18463    if (itemsById[afterId] && !checkAvailable(itemsById[afterId], itemsById, context))
18464      return !1;
18465  return !0;
18466}, checkSkipped = (item, itemsById, state) => {
18467  if (state[item.id].status === "skipped")
18468    return !0;
18469  for (let afterId of item.after ?? [])
18470    if (itemsById[afterId] && checkSkipped(itemsById[afterId], itemsById, state))
18471      return !0;
18472  return !1;
18473}, getAncestorIds = (item, itemsById) => !item.after || item.after.length === 0 ? [] : item.after.flatMap((afterId) => {
18474  let afterItem = itemsById[afterId];
18475  return afterItem ? [...getAncestorIds(afterItem, itemsById), afterId] : [];
18476}), checkLockedBy = (item, itemsById, state) => getAncestorIds(item, itemsById).find(
18477  (id) => state[id].status !== "accepted" && state[id].status !== "done"
18478), useChecklist = () => {
18479  let api = useStorybookApi(), index = useStoryIndex(), [checklistState] = experimental_useUniversalStore(internal_universalChecklistStore), { loaded, items, widget } = checklistState, { status } = internal_universalChecklistStore, [initialized, setInitialized] = useState(!1), [ready, setReady] = useState(!1), debounceReady = useMemo(() => debounce(() => setReady(!0), 500), []), itemsById = useMemo(() => Object.fromEntries(
18480    checklistData.sections.flatMap(
18481      ({ items: items2, id: sectionId, title: sectionTitle }, sectionIndex) => items2.map(({ id, ...item }, itemIndex) => [id, { id, itemIndex, sectionId, sectionIndex, sectionTitle, ...item }])
18482    )
18483  ), []), allItems = useMemo(() => Object.values(itemsById).map((item) => {
18484    let { status: status2, mutedAt } = items[item.id], isOpen = status2 === "open", isAccepted = status2 === "accepted", isDone = status2 === "done", isCompleted = isAccepted || isDone, isSkipped = !isCompleted && checkSkipped(item, itemsById, items), isMuted = !!mutedAt || !!widget.disable, isAvailable = isCompleted ? item.afterCompletion !== "unavailable" : checkAvailable(item, itemsById, { api, index, item, storeState: checklistState }), isLockedBy = checkLockedBy(item, itemsById, items), isImmutable = isCompleted && item.afterCompletion === "immutable";
18485    return {
18486      ...item,
18487      isAvailable,
18488      isOpen,
18489      isLockedBy,
18490      isImmutable,
18491      isReady: isOpen && isAvailable && !isMuted && !isLockedBy,
18492      isCompleted,
18493      isAccepted,
18494      isDone,
18495      isSkipped,
18496      isMuted
18497    };
18498  }), [itemsById, items, widget, api, index, checklistState]), itemCollections = useMemo(() => {
18499    let availableItems = allItems.filter((item) => item.isAvailable), openItems = availableItems.filter((item) => item.isOpen), readyItems = openItems.filter((item) => item.isReady), nextItems = Object.values(
18500      readyItems.reduce((acc, item) => (acc[item.sectionId] ??= [], acc[item.sectionId].push({ ...item, itemIndex: acc[item.sectionId].length }), acc), {})
18501    ).flat().sort((a2, b2) => a2.itemIndex - b2.itemIndex).slice(0, 3).sort((a2, b2) => a2.sectionIndex - b2.sectionIndex), progress = availableItems.length ? Math.round((availableItems.length - openItems.length) / availableItems.length * 100) : 100;
18502    return { availableItems, openItems, readyItems, nextItems, progress };
18503  }, [allItems]);
18504  return useEffect(() => {
18505    if (!(!loaded || status !== experimental_UniversalStore.Status.READY))
18506      for (let item of allItems) {
18507        if (!item.subscribe)
18508          continue;
18509        let subscribed = subscriptions.has(item.id);
18510        if (item.isOpen && item.isAvailable && !subscribed)
18511          subscriptions.set(
18512            item.id,
18513            item.subscribe({
18514              api,
18515              item,
18516              accept: () => internal_checklistStore.accept(item.id),
18517              done: () => internal_checklistStore.done(item.id),
18518              skip: () => internal_checklistStore.skip(item.id)
18519            })
18520          );
18521        else if (subscribed && !(item.isOpen && item.isAvailable)) {
18522          let unsubscribe = subscriptions.get(item.id);
18523          subscriptions.delete(item.id), typeof unsubscribe == "function" && unsubscribe();
18524        }
18525      }
18526  }, [api, loaded, status, allItems]), useEffect(() => {
18527    let initialize = () => setInitialized(!0), timeout = setTimeout(initialize, 1e3);
18528    return api.once(PREVIEW_INITIALIZED, initialize), () => {
18529      clearTimeout(timeout), api.off(PREVIEW_INITIALIZED, initialize);
18530    };
18531  }, [api]), useEffect(() => {
18532    initialized && items && status === experimental_UniversalStore.Status.READY && debounceReady();
18533  }, [initialized, items, status, debounceReady]), {
18534    ready,
18535    allItems,
18536    ...itemCollections,
18537    ...internal_checklistStore,
18538    ...checklistState
18539  };
18540};
18541
18542// src/shared/useCopyButton.ts
18543init_react();
18544
vendor: 3,099 bytes, lines 18545-18593
18545// ../../node_modules/@react-aria/live-announcer/dist/LiveAnnouncer.mjs
18546var $319e236875307eab$var$liveAnnouncer = null;
18547function $319e236875307eab$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = 7e3) {
18548  $319e236875307eab$var$liveAnnouncer ? $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout) : ($319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer(), (typeof IS_REACT_ACT_ENVIRONMENT == "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest < "u") ? $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout) : setTimeout(() => {
18549    $319e236875307eab$var$liveAnnouncer?.isAttached() && $319e236875307eab$var$liveAnnouncer?.announce(message, assertiveness, timeout);
18550  }, 100));
18551}
18552function $319e236875307eab$export$d10ae4f68404609a(assertiveness) {
18553  $319e236875307eab$var$liveAnnouncer && $319e236875307eab$var$liveAnnouncer.clear(assertiveness);
18554}
18555var $319e236875307eab$var$LiveAnnouncer = class {
18556  isAttached() {
18557    var _this_node;
18558    return (_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.isConnected;
18559  }
18560  createLog(ariaLive) {
18561    let node = document.createElement("div");
18562    return node.setAttribute("role", "log"), node.setAttribute("aria-live", ariaLive), node.setAttribute("aria-relevant", "additions"), node;
18563  }
18564  destroy() {
18565    this.node && (document.body.removeChild(this.node), this.node = null);
18566  }
18567  announce(message, assertiveness = "assertive", timeout = 7e3) {
18568    var _this_assertiveLog, _this_politeLog;
18569    if (!this.node) return;
18570    let node = document.createElement("div");
18571    typeof message == "object" ? (node.setAttribute("role", "img"), node.setAttribute("aria-labelledby", message["aria-labelledby"])) : node.textContent = message, assertiveness === "assertive" ? (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog === void 0 || _this_assertiveLog.appendChild(node) : (_this_politeLog = this.politeLog) === null || _this_politeLog === void 0 || _this_politeLog.appendChild(node), message !== "" && setTimeout(() => {
18572      node.remove();
18573    }, timeout);
18574  }
18575  clear(assertiveness) {
18576    this.node && ((!assertiveness || assertiveness === "assertive") && this.assertiveLog && (this.assertiveLog.innerHTML = ""), (!assertiveness || assertiveness === "polite") && this.politeLog && (this.politeLog.innerHTML = ""));
18577  }
18578  constructor() {
18579    this.node = null, this.assertiveLog = null, this.politeLog = null, typeof document < "u" && (this.node = document.createElement("div"), this.node.dataset.liveAnnouncer = "true", Object.assign(this.node.style, {
18580      border: 0,
18581      clip: "rect(0 0 0 0)",
18582      clipPath: "inset(50%)",
18583      height: "1px",
18584      margin: "-1px",
18585      overflow: "hidden",
18586      padding: 0,
18587      position: "absolute",
18588      width: "1px",
18589      whiteSpace: "nowrap"
18590    }), this.assertiveLog = this.createLog("assertive"), this.node.appendChild(this.assertiveLog), this.politeLog = this.createLog("polite"), this.node.appendChild(this.politeLog), document.body.prepend(this.node));
18591  }
18592};
18593
vendor: 1,343 bytes, lines 18594-18635
18594// src/shared/useCopyButton.ts
18595function useCopyButton({
18596  children = "Copy",
18597  childrenOnCopy = "Copied!",
18598  content,
18599  onCopy,
18600  ariaLabel = !1,
18601  ariaLabelOnCopy = !1,
18602  duration = 3e3
18603}) {
18604  let [copied, setCopied] = useState(!1), timerRef = useRef(null);
18605  useEffect(
18606    () => () => {
18607      timerRef.current && clearTimeout(timerRef.current);
18608    },
18609    []
18610  );
18611  let handleClick = useCallback(
18612    (e2) => {
18613      timerRef.current && clearTimeout(timerRef.current);
18614      let announcement = typeof ariaLabelOnCopy == "string" ? ariaLabelOnCopy : "Copied to clipboard";
18615      navigator.clipboard?.writeText(content).then(() => {
18616        onCopy?.(e2), setCopied(!0), $319e236875307eab$export$a9b970dcc4ae71a9(announcement, "polite"), timerRef.current = setTimeout(() => {
18617          setCopied(!1), $319e236875307eab$export$d10ae4f68404609a("polite"), timerRef.current = null;
18618        }, duration);
18619      });
18620    },
18621    [content, onCopy, ariaLabelOnCopy, duration]
18622  );
18623  return {
18624    // @ts-expect-error - TypeScript is not realising T is constrained identically in both interfaces.
18625    children: copied ? childrenOnCopy : children,
18626    buttonProps: useMemo(
18627      () => ({
18628        onClick: handleClick,
18629        ariaLabel: copied ? ariaLabelOnCopy : ariaLabel
18630      }),
18631      [handleClick, copied, ariaLabelOnCopy, ariaLabel]
18632    )
18633  };
18634}
18635
vendor: 8,689 bytes, lines 18636-18851
18636// src/manager/components/sidebar/ChecklistWidget.tsx
18637var fadeScaleIn = keyframes`
18638  from {
18639    opacity: 0;
18640    transform: scale(0.7);
18641  }
18642  to {
18643    opacity: 1;
18644    transform: scale(1);
18645  }
18646`, expand = keyframes`
18647  from {
18648    transform: scaleX(0);
18649  }
18650  to {
18651    transform: scaleX(1);
18652  }
18653`, useTransitionArray = (array, subset, options2) => {
18654  let keyFnRef = useRef(options2.keyFn), { setItem, toggle, stateMap } = useTransitionMap({
18655    allowMultiple: !0,
18656    mountOnEnter: !0,
18657    unmountOnExit: !0,
18658    preEnter: !0,
18659    ...options2
18660  });
18661  return useEffect(() => {
18662    let keyFn = keyFnRef.current;
18663    array.forEach((task) => setItem(keyFn(task)));
18664  }, [array, setItem]), useEffect(() => {
18665    let keyFn = keyFnRef.current;
18666    array.forEach((task) => toggle(keyFn(task), subset.map(keyFn).includes(keyFn(task))));
18667  }, [array, subset, toggle]), Array.from(stateMap).map(
18668    ([key, value]) => [array.find((item) => keyFnRef.current(item) === key), value]
18669  );
18670}, CollapsibleWithMargin = styled(Collapsible)(({ collapsed }) => ({
18671  marginTop: collapsed ? 0 : 16
18672})), HoverCard = styled(Card)({
18673  "&:hover #checklist-module-collapse-toggle": {
18674    opacity: 1
18675  }
18676}), CollapseToggle2 = styled(ActionList.Button)({
18677  opacity: 0,
18678  transition: "opacity var(--transition-duration, 0.2s)",
18679  "&:focus, &:hover": {
18680    opacity: 1
18681  }
18682}), ProgressCircle = styled(ProgressSpinner)(({ theme }) => ({
18683  color: theme.color.secondary
18684})), Checked = styled(StatusPassIcon)(({ theme }) => ({
18685  padding: 1,
18686  borderRadius: "50%",
18687  background: theme.color.positive,
18688  color: theme.background.content,
18689  animation: `${fadeScaleIn} 500ms forwards`
18690})), ItemLabel = styled.span(
18691  ({ theme, isCompleted, isSkipped }) => ({
18692    position: "relative",
18693    margin: "0 -2px",
18694    padding: "0 2px",
18695    color: isSkipped ? theme.color.mediumdark : isCompleted ? theme.base === "dark" ? theme.color.positive : theme.color.positiveText : theme.color.defaultText,
18696    transition: "color 500ms"
18697  }),
18698  ({ theme, isSkipped }) => isSkipped && {
18699    alignSelf: "flex-start",
18700    "&:after": {
18701      content: '""',
18702      position: "absolute",
18703      top: "50%",
18704      left: 0,
18705      width: "100%",
18706      height: 1,
18707      background: theme.color.mediumdark,
18708      animation: `${expand} 500ms forwards`,
18709      transformOrigin: "left"
18710    }
18711  }
18712), title = (progress) => {
18713  switch (!0) {
18714    case progress < 50:
18715      return "Get started";
18716    case progress < 75:
18717      return "Level up";
18718    default:
18719      return "Become an expert";
18720  }
18721}, OpenGuideButton = ({
18722  children,
18723  afterClick
18724}) => {
18725  let api = useStorybookApi();
18726  return react_default.createElement(
18727    ActionList.Action,
18728    {
18729      ariaLabel: "Open onboarding guide",
18730      onClick: (e2) => {
18731        e2.stopPropagation(), api.navigate("/settings/guide"), afterClick?.();
18732      }
18733    },
18734    react_default.createElement(ActionList.Icon, null, react_default.createElement(ListUnorderedIcon, null)),
18735    children
18736  );
18737}, CopyButton = ({
18738  label,
18739  copyContent,
18740  onClick,
18741  ...props
18742}) => {
18743  let { children: copyChildren, buttonProps: copyButtonProps } = useCopyButton({
18744    children: label,
18745    childrenOnCopy: react_default.createElement(react_default.Fragment, null, react_default.createElement(CheckIcon, null), " Copied!"),
18746    onCopy: onClick,
18747    content: copyContent
18748  });
18749  return react_default.createElement(ActionList.Button, { ...props, ...copyButtonProps }, copyChildren);
18750}, ChecklistWidget = () => {
18751  let api = useStorybookApi(), { loaded, ready, allItems, nextItems, progress, accept, mute, items } = useChecklist(), [renderItems, setRenderItems] = useState(nextItems), [animated, setAnimated] = useState(!1);
18752  useEffect(() => {
18753    if (ready) {
18754      let timeout = setTimeout(setAnimated, 1e3, !0);
18755      return () => clearTimeout(timeout);
18756    }
18757  }, [ready]), useEffect(() => {
18758    if (!animated) {
18759      setRenderItems(nextItems);
18760      return;
18761    }
18762    setRenderItems((current) => {
18763      let animateOut = !1, prevItems = current.map((item) => {
18764        let { status } = items[item.id], isAccepted = status === "accepted", isDone = status === "done", isSkipped = status === "skipped";
18765        return animateOut = animateOut || isAccepted || isDone || isSkipped, { ...item, isCompleted: isAccepted || isDone, isAccepted, isDone, isSkipped };
18766      });
18767      return animateOut ? prevItems : nextItems;
18768    });
18769    let timeout = setTimeout(setRenderItems, 2e3, nextItems);
18770    return () => clearTimeout(timeout);
18771  }, [animated, nextItems, items]);
18772  let hasItems = renderItems.length > 0, transitionItems = useTransitionArray(allItems, renderItems, {
18773    keyFn: (item) => item.id,
18774    timeout: animated ? 300 : 0
18775  });
18776  return api.getIsNavShown() ? react_default.createElement(CollapsibleWithMargin, { collapsed: !hasItems || !loaded }, react_default.createElement(HoverCard, { id: "storybook-checklist-widget", outlineAnimation: "rainbow" }, react_default.createElement(
18777    Collapsible,
18778    {
18779      storageKey: "checklist-widget",
18780      initialCollapsed: !hasItems,
18781      disabled: !hasItems,
18782      summary: ({ isCollapsed, toggleCollapsed, toggleProps }) => react_default.createElement(ActionList, { as: "div", onClick: toggleCollapsed }, react_default.createElement(ActionList.Item, { as: "div" }, react_default.createElement(ActionList.Item, { as: "div", style: { flexShrink: 1 } }, loaded && react_default.createElement(
18783        Optional,
18784        {
18785          content: react_default.createElement(OpenGuideButton, null, react_default.createElement("strong", null, title(progress))),
18786          fallback: react_default.createElement(OpenGuideButton, null)
18787        }
18788      )), react_default.createElement(ActionList.Item, { as: "div" }, react_default.createElement(
18789        CollapseToggle2,
18790        {
18791          ...toggleProps,
18792          id: "checklist-module-collapse-toggle",
18793          ariaLabel: `${isCollapsed ? "Expand" : "Collapse"} onboarding guide`
18794        },
18795        react_default.createElement(
18796          ChevronSmallUpIcon,
18797          {
18798            style: {
18799              transform: isCollapsed ? "rotate(180deg)" : "none",
18800              transition: "transform 250ms",
18801              willChange: "auto"
18802            }
18803          }
18804        )
18805      ), loaded && react_default.createElement(
18806        PopoverProvider,
18807        {
18808          ariaLabel: "Onboarding guide menu",
18809          padding: 0,
18810          popover: ({ onHide }) => react_default.createElement(ActionList, null, react_default.createElement(ActionList.Item, null, react_default.createElement(OpenGuideButton, { afterClick: onHide }, react_default.createElement(ActionList.Text, null, "Open full guide"))), react_default.createElement(ActionList.Item, null, react_default.createElement(
18811            ActionList.Action,
18812            {
18813              ariaLabel: !1,
18814              onClick: (e2) => {
18815                e2.stopPropagation(), mute(allItems.map(({ id }) => id)), onHide();
18816              }
18817            },
18818            react_default.createElement(ActionList.Icon, null, react_default.createElement(EyeCloseIcon, null)),
18819            react_default.createElement(ActionList.Text, null, "Remove from sidebar")
18820          )))
18821        },
18822        react_default.createElement(
18823          ActionList.Button,
18824          {
18825            ariaLabel: `${progress}% completed`,
18826            onClick: (e2) => e2.stopPropagation()
18827          },
18828          react_default.createElement(
18829            ProgressCircle,
18830            {
18831              percentage: progress,
18832              running: !1,
18833              size: 16,
18834              width: 1.5
18835            }
18836          ),
18837          react_default.createElement(TextFlip, { text: `${progress}%`, placeholder: "00%" })
18838        )
18839      ))))
18840    },
18841    react_default.createElement(ActionList, null, transitionItems.map(
18842      ([item, { status, isMounted }]) => isMounted && react_default.createElement(ActionList.HoverItem, { key: item.id, targetId: item.id, transitionStatus: status }, react_default.createElement(
18843        ActionList.Action,
18844        {
18845          ariaLabel: `Open onboarding guide for ${item.label}`,
18846          onClick: () => api.navigate(`/settings/guide#${item.id}`)
18847        },
18848        react_default.createElement(ActionList.Icon, null, item.isCompleted && animated ? react_default.createElement(Particles, { anchor: Checked, key: item.id }) : item.icon ? react_default.createElement(item.icon, null) : react_default.createElement(CircleHollowIcon, null)),
18849        react_default.createElement(ActionList.Text, null, react_default.createElement(ItemLabel, { isCompleted: item.isCompleted, isSkipped: item.isSkipped }, item.label))
18850      ), item.action && (item.action.copyContent ? react_default.createElement(
18851        CopyButton
vendor: 2,022 bytes, lines 18851-18923
18851,
18852        {
18853          "data-target-id": item.id,
18854          label: item.action.label,
18855          copyContent: item.action.copyContent,
18856          onClick: (e2) => {
18857            e2.stopPropagation(), item.action?.onClick({
18858              api,
18859              accept: () => accept(item.id)
18860            });
18861          }
18862        }
18863      ) : react_default.createElement(
18864        ActionList.Button,
18865        {
18866          "data-target-id": item.id,
18867          ariaLabel: !1,
18868          onClick: (e2) => {
18869            e2.stopPropagation(), item.action?.onClick({
18870              api,
18871              accept: () => accept(item.id)
18872            });
18873          }
18874        },
18875        item.action.label
18876      )))
18877    ))
18878  ))) : null;
18879};
18880
18881// src/manager/components/sidebar/CreateNewStoryFileModal.tsx
18882init_react();
18883
18884// src/manager/hooks/useDebounce.ts
18885init_react();
18886function useDebounce(value, delay2) {
18887  let [debouncedValue, setDebouncedValue] = useState(value);
18888  return useEffect(() => {
18889    let handler = setTimeout(() => {
18890      setDebouncedValue(value);
18891    }, delay2);
18892    return () => {
18893      clearTimeout(handler);
18894    };
18895  }, [value, delay2]), debouncedValue;
18896}
18897
18898// src/manager/components/sidebar/FileSearchModal.tsx
18899init_react();
18900
18901// src/manager/hooks/useMeasure.tsx
18902init_react();
18903function useMeasure() {
18904  let [dimensions, setDimensions] = react_default.useState({
18905    width: null,
18906    height: null
18907  }), prevObserver = react_default.useRef(null);
18908  return [react_default.useCallback((node) => {
18909    if (prevObserver.current && (prevObserver.current.disconnect(), prevObserver.current = null), node?.nodeType === Node.ELEMENT_NODE) {
18910      let observer = new ResizeObserver(([entry]) => {
18911        if (entry && entry.borderBoxSize) {
18912          let { inlineSize: width, blockSize: height } = entry.borderBoxSize[0];
18913          setDimensions({ width, height });
18914        }
18915      });
18916      observer.observe(node), prevObserver.current = observer;
18917    }
18918  }, []), dimensions];
18919}
18920
18921// src/manager/components/sidebar/FileSearchList.tsx
18922init_react();
18923
vendor: 79 bytes, lines 18924-18926
18924// ../../node_modules/@tanstack/react-virtual/dist/esm/index.js
18925init_react();
18926
vendor: 1,898 bytes, lines 18927-18974
18927// ../../node_modules/@tanstack/virtual-core/dist/esm/utils.js
18928function memo2(getDeps, fn, opts) {
18929  let deps = opts.initialDeps ?? [], result;
18930  function memoizedFunction() {
18931    var _a2, _b, _c, _d;
18932    let depTime;
18933    opts.key && ((_a2 = opts.debug) != null && _a2.call(opts)) && (depTime = Date.now());
18934    let newDeps = getDeps();
18935    if (!(newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep)))
18936      return result;
18937    deps = newDeps;
18938    let resultTime;
18939    if (opts.key && ((_b = opts.debug) != null && _b.call(opts)) && (resultTime = Date.now()), result = fn(...newDeps), opts.key && ((_c = opts.debug) != null && _c.call(opts))) {
18940      let depEndTime = Math.round((Date.now() - depTime) * 100) / 100, resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100, resultFpsPercentage = resultEndTime / 16, pad = (str, num) => {
18941        for (str = String(str); str.length < num; )
18942          str = " " + str;
18943        return str;
18944      };
18945      console.info(
18946        `%c\u23F1 ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
18947        `
18948            font-size: .6rem;
18949            font-weight: bold;
18950            color: hsl(${Math.max(
18951          0,
18952          Math.min(120 - 120 * resultFpsPercentage, 120)
18953        )}deg 100% 31%);`,
18954        opts?.key
18955      );
18956    }
18957    return (_d = opts?.onChange) == null || _d.call(opts, result), result;
18958  }
18959  return memoizedFunction.updateDeps = (newDeps) => {
18960    deps = newDeps;
18961  }, memoizedFunction;
18962}
18963function notUndefined(value, msg) {
18964  if (value === void 0)
18965    throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`);
18966  return value;
18967}
18968var approxEqual = (a2, b2) => Math.abs(a2 - b2) < 1.01, debounce3 = (targetWindow, fn, ms) => {
18969  let timeoutId;
18970  return function(...args) {
18971    targetWindow.clearTimeout(timeoutId), timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
18972  };
18973};
18974
vendor: 21,201 bytes, lines 18975-19454
18975// ../../node_modules/@tanstack/virtual-core/dist/esm/index.js
18976var getRect = (element) => {
18977  let { offsetWidth, offsetHeight } = element;
18978  return { width: offsetWidth, height: offsetHeight };
18979}, defaultKeyExtractor = (index) => index, defaultRangeExtractor = (range) => {
18980  let start = Math.max(range.startIndex - range.overscan, 0), end = Math.min(range.endIndex + range.overscan, range.count - 1), arr = [];
18981  for (let i2 = start; i2 <= end; i2++)
18982    arr.push(i2);
18983  return arr;
18984}, observeElementRect = (instance, cb) => {
18985  let element = instance.scrollElement;
18986  if (!element)
18987    return;
18988  let targetWindow = instance.targetWindow;
18989  if (!targetWindow)
18990    return;
18991  let handler = (rect) => {
18992    let { width, height } = rect;
18993    cb({ width: Math.round(width), height: Math.round(height) });
18994  };
18995  if (handler(getRect(element)), !targetWindow.ResizeObserver)
18996    return () => {
18997    };
18998  let observer = new targetWindow.ResizeObserver((entries) => {
18999    let run = () => {
19000      let entry = entries[0];
19001      if (entry?.borderBoxSize) {
19002        let box = entry.borderBoxSize[0];
19003        if (box) {
19004          handler({ width: box.inlineSize, height: box.blockSize });
19005          return;
19006        }
19007      }
19008      handler(getRect(element));
19009    };
19010    instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
19011  });
19012  return observer.observe(element, { box: "border-box" }), () => {
19013    observer.unobserve(element);
19014  };
19015}, addEventListenerOptions = {
19016  passive: !0
19017};
19018var supportsScrollend = typeof window > "u" ? !0 : "onscrollend" in window, observeElementOffset = (instance, cb) => {
19019  let element = instance.scrollElement;
19020  if (!element)
19021    return;
19022  let targetWindow = instance.targetWindow;
19023  if (!targetWindow)
19024    return;
19025  let offset2 = 0, fallback = instance.options.useScrollendEvent && supportsScrollend ? () => {
19026  } : debounce3(
19027    targetWindow,
19028    () => {
19029      cb(offset2, !1);
19030    },
19031    instance.options.isScrollingResetDelay
19032  ), createHandler = (isScrolling) => () => {
19033    let { horizontal, isRtl } = instance.options;
19034    offset2 = horizontal ? element.scrollLeft * (isRtl && -1 || 1) : element.scrollTop, fallback(), cb(offset2, isScrolling);
19035  }, handler = createHandler(!0), endHandler = createHandler(!1);
19036  endHandler(), element.addEventListener("scroll", handler, addEventListenerOptions);
19037  let registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
19038  return registerScrollendEvent && element.addEventListener("scrollend", endHandler, addEventListenerOptions), () => {
19039    element.removeEventListener("scroll", handler), registerScrollendEvent && element.removeEventListener("scrollend", endHandler);
19040  };
19041};
19042var measureElement = (element, entry, instance) => {
19043  if (entry?.borderBoxSize) {
19044    let box = entry.borderBoxSize[0];
19045    if (box)
19046      return Math.round(
19047        box[instance.options.horizontal ? "inlineSize" : "blockSize"]
19048      );
19049  }
19050  return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"];
19051};
19052var elementScroll = (offset2, {
19053  adjustments = 0,
19054  behavior
19055}, instance) => {
19056  var _a2, _b;
19057  let toOffset = offset2 + adjustments;
19058  (_b = (_a2 = instance.scrollElement) == null ? void 0 : _a2.scrollTo) == null || _b.call(_a2, {
19059    [instance.options.horizontal ? "left" : "top"]: toOffset,
19060    behavior
19061  });
19062}, Virtualizer = class {
19063  constructor(opts) {
19064    this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
19065      let _ro = null, get2 = () => _ro || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : _ro = new this.targetWindow.ResizeObserver((entries) => {
19066        entries.forEach((entry) => {
19067          let run = () => {
19068            this._measureElement(entry.target, entry);
19069          };
19070          this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
19071        });
19072      }));
19073      return {
19074        disconnect: () => {
19075          var _a2;
19076          (_a2 = get2()) == null || _a2.disconnect(), _ro = null;
19077        },
19078        observe: (target) => {
19079          var _a2;
19080          return (_a2 = get2()) == null ? void 0 : _a2.observe(target, { box: "border-box" });
19081        },
19082        unobserve: (target) => {
19083          var _a2;
19084          return (_a2 = get2()) == null ? void 0 : _a2.unobserve(target);
19085        }
19086      };
19087    })(), this.range = null, this.setOptions = (opts2) => {
19088      Object.entries(opts2).forEach(([key, value]) => {
19089        typeof value > "u" && delete opts2[key];
19090      }), this.options = {
19091        debug: !1,
19092        initialOffset: 0,
19093        overscan: 1,
19094        paddingStart: 0,
19095        paddingEnd: 0,
19096        scrollPaddingStart: 0,
19097        scrollPaddingEnd: 0,
19098        horizontal: !1,
19099        getItemKey: defaultKeyExtractor,
19100        rangeExtractor: defaultRangeExtractor,
19101        onChange: () => {
19102        },
19103        measureElement,
19104        initialRect: { width: 0, height: 0 },
19105        scrollMargin: 0,
19106        gap: 0,
19107        indexAttribute: "data-index",
19108        initialMeasurementsCache: [],
19109        lanes: 1,
19110        isScrollingResetDelay: 150,
19111        enabled: !0,
19112        isRtl: !1,
19113        useScrollendEvent: !1,
19114        useAnimationFrameWithResizeObserver: !1,
19115        ...opts2
19116      };
19117    }, this.notify = (sync) => {
19118      var _a2, _b;
19119      (_b = (_a2 = this.options).onChange) == null || _b.call(_a2, this, sync);
19120    }, this.maybeNotify = memo2(
19121      () => (this.calculateRange(), [
19122        this.isScrolling,
19123        this.range ? this.range.startIndex : null,
19124        this.range ? this.range.endIndex : null
19125      ]),
19126      (isScrolling) => {
19127        this.notify(isScrolling);
19128      },
19129      {
19130        key: !1,
19131        debug: () => this.options.debug,
19132        initialDeps: [
19133          this.isScrolling,
19134          this.range ? this.range.startIndex : null,
19135          this.range ? this.range.endIndex : null
19136        ]
19137      }
19138    ), this.cleanup = () => {
19139      this.unsubs.filter(Boolean).forEach((d2) => d2()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
19140    }, this._didMount = () => () => {
19141      this.cleanup();
19142    }, this._willUpdate = () => {
19143      var _a2;
19144      let scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
19145      if (this.scrollElement !== scrollElement) {
19146        if (this.cleanup(), !scrollElement) {
19147          this.maybeNotify();
19148          return;
19149        }
19150        this.scrollElement = scrollElement, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((_a2 = this.scrollElement) == null ? void 0 : _a2.window) ?? null, this.elementsCache.forEach((cached) => {
19151          this.observer.observe(cached);
19152        }), this._scrollToOffset(this.getScrollOffset(), {
19153          adjustments: void 0,
19154          behavior: void 0
19155        }), this.unsubs.push(
19156          this.options.observeElementRect(this, (rect) => {
19157            this.scrollRect = rect, this.maybeNotify();
19158          })
19159        ), this.unsubs.push(
19160          this.options.observeElementOffset(this, (offset2, isScrolling) => {
19161            this.scrollAdjustments = 0, this.scrollDirection = isScrolling ? this.getScrollOffset() < offset2 ? "forward" : "backward" : null, this.scrollOffset = offset2, this.isScrolling = isScrolling, this.maybeNotify();
19162          })
19163        );
19164      }
19165    }, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (measurements, index) => {
19166      let furthestMeasurementsFound = /* @__PURE__ */ new Map(), furthestMeasurements = /* @__PURE__ */ new Map();
19167      for (let m2 = index - 1; m2 >= 0; m2--) {
19168        let measurement = measurements[m2];
19169        if (furthestMeasurementsFound.has(measurement.lane))
19170          continue;
19171        let previousFurthestMeasurement = furthestMeasurements.get(
19172          measurement.lane
19173        );
19174        if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end ? furthestMeasurements.set(measurement.lane, measurement) : measurement.end < previousFurthestMeasurement.end && furthestMeasurementsFound.set(measurement.lane, !0), furthestMeasurementsFound.size === this.options.lanes)
19175          break;
19176      }
19177      return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a2, b2) => a2.end === b2.end ? a2.index - b2.index : a2.end - b2.end)[0] : void 0;
19178    }, this.getMeasurementOptions = memo2(
19179      () => [
19180        this.options.count,
19181        this.options.paddingStart,
19182        this.options.scrollMargin,
19183        this.options.getItemKey,
19184        this.options.enabled
19185      ],
19186      (count, paddingStart, scrollMargin, getItemKey, enabled) => (this.pendingMeasuredCacheIndexes = [], {
19187        count,
19188        paddingStart,
19189        scrollMargin,
19190        getItemKey,
19191        enabled
19192      }),
19193      {
19194        key: !1
19195      }
19196    ), this.getMeasurements = memo2(
19197      () => [this.getMeasurementOptions(), this.itemSizeCache],
19198      ({ count, paddingStart, scrollMargin, getItemKey, enabled }, itemSizeCache) => {
19199        if (!enabled)
19200          return this.measurementsCache = [], this.itemSizeCache.clear(), [];
19201        this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((item) => {
19202          this.itemSizeCache.set(item.key, item.size);
19203        }));
19204        let min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
19205        this.pendingMeasuredCacheIndexes = [];
19206        let measurements = this.measurementsCache.slice(0, min);
19207        for (let i2 = min; i2 < count; i2++) {
19208          let key = getItemKey(i2), furthestMeasurement = this.options.lanes === 1 ? measurements[i2 - 1] : this.getFurthestMeasurement(measurements, i2), start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin, measuredSize = itemSizeCache.get(key), size = typeof measuredSize == "number" ? measuredSize : this.options.estimateSize(i2), end = start + size, lane = furthestMeasurement ? furthestMeasurement.lane : i2 % this.options.lanes;
19209          measurements[i2] = {
19210            index: i2,
19211            start,
19212            size,
19213            end,
19214            key,
19215            lane
19216          };
19217        }
19218        return this.measurementsCache = measurements, measurements;
19219      },
19220      {
19221        key: !1,
19222        debug: () => this.options.debug
19223      }
19224    ), this.calculateRange = memo2(
19225      () => [
19226        this.getMeasurements(),
19227        this.getSize(),
19228        this.getScrollOffset(),
19229        this.options.lanes
19230      ],
19231      (measurements, outerSize, scrollOffset, lanes) => this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
19232        measurements,
19233        outerSize,
19234        scrollOffset,
19235        lanes
19236      }) : null,
19237      {
19238        key: !1,
19239        debug: () => this.options.debug
19240      }
19241    ), this.getVirtualIndexes = memo2(
19242      () => {
19243        let startIndex = null, endIndex = null, range = this.calculateRange();
19244        return range && (startIndex = range.startIndex, endIndex = range.endIndex), this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]), [
19245          this.options.rangeExtractor,
19246          this.options.overscan,
19247          this.options.count,
19248          startIndex,
19249          endIndex
19250        ];
19251      },
19252      (rangeExtractor, overscan, count, startIndex, endIndex) => startIndex === null || endIndex === null ? [] : rangeExtractor({
19253        startIndex,
19254        endIndex,
19255        overscan,
19256        count
19257      }),
19258      {
19259        key: !1,
19260        debug: () => this.options.debug
19261      }
19262    ), this.indexFromElement = (node) => {
19263      let attributeName = this.options.indexAttribute, indexStr = node.getAttribute(attributeName);
19264      return indexStr ? parseInt(indexStr, 10) : (console.warn(
19265        `Missing attribute name '${attributeName}={index}' on measured element.`
19266      ), -1);
19267    }, this._measureElement = (node, entry) => {
19268      let index = this.indexFromElement(node), item = this.measurementsCache[index];
19269      if (!item)
19270        return;
19271      let key = item.key, prevNode = this.elementsCache.get(key);
19272      prevNode !== node && (prevNode && this.observer.unobserve(prevNode), this.observer.observe(node), this.elementsCache.set(key, node)), node.isConnected && this.resizeItem(index, this.options.measureElement(node, entry, this));
19273    }, this.resizeItem = (index, size) => {
19274      let item = this.measurementsCache[index];
19275      if (!item)
19276        return;
19277      let itemSize = this.itemSizeCache.get(item.key) ?? item.size, delta = size - itemSize;
19278      delta !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.getScrollOffset() + this.scrollAdjustments) && this._scrollToOffset(this.getScrollOffset(), {
19279        adjustments: this.scrollAdjustments += delta,
19280        behavior: void 0
19281      }), this.pendingMeasuredCacheIndexes.push(item.index), this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size)), this.notify(!1));
19282    }, this.measureElement = (node) => {
19283      if (!node) {
19284        this.elementsCache.forEach((cached, key) => {
19285          cached.isConnected || (this.observer.unobserve(cached), this.elementsCache.delete(key));
19286        });
19287        return;
19288      }
19289      this._measureElement(node, void 0);
19290    }, this.getVirtualItems = memo2(
19291      () => [this.getVirtualIndexes(), this.getMeasurements()],
19292      (indexes, measurements) => {
19293        let virtualItems = [];
19294        for (let k2 = 0, len = indexes.length; k2 < len; k2++) {
19295          let i2 = indexes[k2], measurement = measurements[i2];
19296          virtualItems.push(measurement);
19297        }
19298        return virtualItems;
19299      },
19300      {
19301        key: !1,
19302        debug: () => this.options.debug
19303      }
19304    ), this.getVirtualItemForOffset = (offset2) => {
19305      let measurements = this.getMeasurements();
19306      if (measurements.length !== 0)
19307        return notUndefined(
19308          measurements[findNearestBinarySearch(
19309            0,
19310            measurements.length - 1,
19311            (index) => notUndefined(measurements[index]).start,
19312            offset2
19313          )]
19314        );
19315    }, this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
19316      let size = this.getSize(), scrollOffset = this.getScrollOffset();
19317      align === "auto" && (align = toOffset >= scrollOffset + size ? "end" : "start"), align === "center" ? toOffset += (itemSize - size) / 2 : align === "end" && (toOffset -= size);
19318      let maxOffset = this.getTotalSize() + this.options.scrollMargin - size;
19319      return Math.max(Math.min(maxOffset, toOffset), 0);
19320    }, this.getOffsetForIndex = (index, align = "auto") => {
19321      index = Math.max(0, Math.min(index, this.options.count - 1));
19322      let item = this.measurementsCache[index];
19323      if (!item)
19324        return;
19325      let size = this.getSize(), scrollOffset = this.getScrollOffset();
19326      if (align === "auto")
19327        if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd)
19328          align = "end";
19329        else if (item.start <= scrollOffset + this.options.scrollPaddingStart)
19330          align = "start";
19331        else
19332          return [scrollOffset, align];
19333      let toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
19334      return [
19335        this.getOffsetForAlignment(toOffset, align, item.size),
19336        align
19337      ];
19338    }, this.isDynamicMode = () => this.elementsCache.size > 0, this.scrollToOffset = (toOffset, { align = "start", behavior } = {}) => {
19339      behavior === "smooth" && this.isDynamicMode() && console.warn(
19340        "The `smooth` scroll behavior is not fully supported with dynamic size."
19341      ), this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), {
19342        adjustments: void 0,
19343        behavior
19344      });
19345    }, this.scrollToIndex = (index, { align: initialAlign = "auto", behavior } = {}) => {
19346      behavior === "smooth" && this.isDynamicMode() && console.warn(
19347        "The `smooth` scroll behavior is not fully supported with dynamic size."
19348      ), index = Math.max(0, Math.min(index, this.options.count - 1));
19349      let attempts = 0, maxAttempts = 10, tryScroll = (currentAlign) => {
19350        if (!this.targetWindow) return;
19351        let offsetInfo = this.getOffsetForIndex(index, currentAlign);
19352        if (!offsetInfo) {
19353          console.warn("Failed to get offset for index:", index);
19354          return;
19355        }
19356        let [offset2, align] = offsetInfo;
19357        this._scrollToOffset(offset2, { adjustments: void 0, behavior }), this.targetWindow.requestAnimationFrame(() => {
19358          let currentOffset = this.getScrollOffset(), afterInfo = this.getOffsetForIndex(index, align);
19359          if (!afterInfo) {
19360            console.warn("Failed to get offset for index:", index);
19361            return;
19362          }
19363          approxEqual(afterInfo[0], currentOffset) || scheduleRetry(align);
19364        });
19365      }, scheduleRetry = (align) => {
19366        this.targetWindow && (attempts++, attempts < maxAttempts ? this.targetWindow.requestAnimationFrame(() => tryScroll(align)) : console.warn(
19367          `Failed to scroll to index ${index} after ${maxAttempts} attempts.`
19368        ));
19369      };
19370      tryScroll(initialAlign);
19371    }, this.scrollBy = (delta, { behavior } = {}) => {
19372      behavior === "smooth" && this.isDynamicMode() && console.warn(
19373        "The `smooth` scroll behavior is not fully supported with dynamic size."
19374      ), this._scrollToOffset(this.getScrollOffset() + delta, {
19375        adjustments: void 0,
19376        behavior
19377      });
19378    }, this.getTotalSize = () => {
19379      var _a2;
19380      let measurements = this.getMeasurements(), end;
19381      if (measurements.length === 0)
19382        end = this.options.paddingStart;
19383      else if (this.options.lanes === 1)
19384        end = ((_a2 = measurements[measurements.length - 1]) == null ? void 0 : _a2.end) ?? 0;
19385      else {
19386        let endByLane = Array(this.options.lanes).fill(null), endIndex = measurements.length - 1;
19387        for (; endIndex >= 0 && endByLane.some((val) => val === null); ) {
19388          let item = measurements[endIndex];
19389          endByLane[item.lane] === null && (endByLane[item.lane] = item.end), endIndex--;
19390        }
19391        end = Math.max(...endByLane.filter((val) => val !== null));
19392      }
19393      return Math.max(
19394        end - this.options.scrollMargin + this.options.paddingEnd,
19395        0
19396      );
19397    }, this._scrollToOffset = (offset2, {
19398      adjustments,
19399      behavior
19400    }) => {
19401      this.options.scrollToFn(offset2, { behavior, adjustments }, this);
19402    }, this.measure = () => {
19403      this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
19404    }, this.setOptions(opts);
19405  }
19406}, findNearestBinarySearch = (low, high, getCurrentValue, value) => {
19407  for (; low <= high; ) {
19408    let middle = (low + high) / 2 | 0, currentValue = getCurrentValue(middle);
19409    if (currentValue < value)
19410      low = middle + 1;
19411    else if (currentValue > value)
19412      high = middle - 1;
19413    else
19414      return middle;
19415  }
19416  return low > 0 ? low - 1 : 0;
19417};
19418function calculateRange({
19419  measurements,
19420  outerSize,
19421  scrollOffset,
19422  lanes
19423}) {
19424  let lastIndex = measurements.length - 1, getOffset = (index) => measurements[index].start;
19425  if (measurements.length <= lanes)
19426    return {
19427      startIndex: 0,
19428      endIndex: lastIndex
19429    };
19430  let startIndex = findNearestBinarySearch(
19431    0,
19432    lastIndex,
19433    getOffset,
19434    scrollOffset
19435  ), endIndex = startIndex;
19436  if (lanes === 1)
19437    for (; endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize; )
19438      endIndex++;
19439  else if (lanes > 1) {
19440    let endPerLane = Array(lanes).fill(0);
19441    for (; endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize); ) {
19442      let item = measurements[endIndex];
19443      endPerLane[item.lane] = item.end, endIndex++;
19444    }
19445    let startPerLane = Array(lanes).fill(scrollOffset + outerSize);
19446    for (; startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset); ) {
19447      let item = measurements[startIndex];
19448      startPerLane[item.lane] = item.start, startIndex--;
19449    }
19450    startIndex = Math.max(0, startIndex - startIndex % lanes), endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
19451  }
19452  return { startIndex, endIndex };
19453}
19454
vendor: 876 bytes, lines 19455-19477
19455// ../../node_modules/@tanstack/react-virtual/dist/esm/index.js
19456var useIsomorphicLayoutEffect = typeof document < "u" ? useLayoutEffect : useEffect;
19457function useVirtualizerBase(options2) {
19458  let rerender = useReducer(() => ({}), {})[1], resolvedOptions = {
19459    ...options2,
19460    onChange: (instance2, sync) => {
19461      var _a2;
19462      sync ? flushSync(rerender) : rerender(), (_a2 = options2.onChange) == null || _a2.call(options2, instance2, sync);
19463    }
19464  }, [instance] = useState(
19465    () => new Virtualizer(resolvedOptions)
19466  );
19467  return instance.setOptions(resolvedOptions), useIsomorphicLayoutEffect(() => instance._didMount(), []), useIsomorphicLayoutEffect(() => instance._willUpdate()), instance;
19468}
19469function useVirtualizer(options2) {
19470  return useVirtualizerBase({
19471    observeElementRect,
19472    observeElementOffset,
19473    scrollToFn: elementScroll,
19474    ...options2
19475  });
19476}
19477
vendor: 21,481 bytes, lines 19478-20050
19478// src/manager/components/sidebar/FIleSearchList.utils.tsx
19479init_react();
19480var useArrowKeyNavigation = ({
19481  parentRef,
19482  rowVirtualizer,
19483  selectedItem
19484}) => {
19485  useEffect(() => {
19486    let handleArrowKeys = (event) => {
19487      if (!parentRef.current)
19488        return;
19489      let maxIndex = rowVirtualizer.options.count, activeElement = document.activeElement, rowIndex = parseInt(activeElement.getAttribute("data-index") || "-1", 10), isActiveElementInput = activeElement.tagName === "INPUT", getFirstElement = () => document.querySelector('[data-index="0"]'), getLastElement = () => document.querySelector(`[data-index="${maxIndex - 1}"]`);
19490      if (event.code === "ArrowDown" && activeElement) {
19491        if (event.stopPropagation(), isActiveElementInput) {
19492          getFirstElement()?.focus();
19493          return;
19494        }
19495        if (rowIndex === maxIndex - 1) {
19496          flushSync(() => {
19497            rowVirtualizer.scrollToIndex(0, { align: "start" });
19498          }), setTimeout(() => {
19499            getFirstElement()?.focus();
19500          }, 100);
19501          return;
19502        }
19503        if (selectedItem === rowIndex) {
19504          document.querySelector(
19505            `[data-index-position="${selectedItem}_first"]`
19506          )?.focus();
19507          return;
19508        }
19509        if (selectedItem !== null && activeElement.getAttribute("data-index-position")?.includes("last")) {
19510          document.querySelector(
19511            `[data-index="${selectedItem + 1}"]`
19512          )?.focus();
19513          return;
19514        }
19515        activeElement.nextElementSibling?.focus();
19516      }
19517      if (event.code === "ArrowUp" && activeElement) {
19518        if (isActiveElementInput) {
19519          flushSync(() => {
19520            rowVirtualizer.scrollToIndex(maxIndex - 1, { align: "start" });
19521          }), setTimeout(() => {
19522            getLastElement()?.focus();
19523          }, 100);
19524          return;
19525        }
19526        if (selectedItem !== null && activeElement.getAttribute("data-index-position")?.includes("first")) {
19527          document.querySelector(
19528            `[data-index="${selectedItem}"]`
19529          )?.focus();
19530          return;
19531        }
19532        activeElement.previousElementSibling?.focus();
19533      }
19534    };
19535    return document.addEventListener("keydown", handleArrowKeys, { capture: !0 }), () => {
19536      document.removeEventListener("keydown", handleArrowKeys, { capture: !0 });
19537    };
19538  }, [rowVirtualizer, selectedItem, parentRef]);
19539};
19540
19541// src/manager/components/sidebar/FileList.tsx
19542var FileListWrapper = styled("div")(({ theme }) => ({
19543  marginTop: "-16px",
19544  // after element which fades out the list
19545  "&::after": {
19546    content: '""',
19547    position: "fixed",
19548    pointerEvents: "none",
19549    bottom: 0,
19550    left: 0,
19551    right: 0,
19552    height: "80px",
19553    background: `linear-gradient(${rgba(theme.barBg, 0)} 10%, ${theme.barBg} 80%)`
19554  }
19555})), FileList = styled("div")({
19556  height: "280px",
19557  overflow: "auto",
19558  msOverflowStyle: "none",
19559  scrollbarWidth: "none",
19560  position: "relative",
19561  "::-webkit-scrollbar": {
19562    display: "none"
19563  }
19564}), FileListLi = styled("li")(({ theme }) => ({
19565  ":focus-visible": {
19566    outline: "none",
19567    ".file-list-item": {
19568      borderRadius: "4px",
19569      background: theme.base === "dark" ? "rgba(255,255,255,.1)" : theme.color.mediumlight,
19570      "> svg": {
19571        display: "flex"
19572      }
19573    }
19574  }
19575})), FileListItem = styled("div")({
19576  display: "flex",
19577  flexDirection: "column",
19578  position: "relative"
19579}), FileListItemContentWrapper = styled.div(({ theme, selected, disabled, error }) => ({
19580  display: "flex",
19581  alignItems: "flex-start",
19582  gap: "8px",
19583  alignSelf: "stretch",
19584  padding: "8px 16px",
19585  cursor: "pointer",
19586  borderRadius: "4px",
19587  ...selected && {
19588    borderRadius: "4px",
19589    background: theme.base === "dark" ? "rgba(255,255,255,.1)" : theme.color.mediumlight,
19590    "> svg": {
19591      display: "flex"
19592    }
19593  },
19594  ...disabled && {
19595    cursor: "not-allowed",
19596    div: {
19597      color: `${theme.textMutedColor} !important`
19598    }
19599  },
19600  ...error && {
19601    background: theme.base === "light" ? "#00000011" : "#00000033"
19602  },
19603  "&:hover": {
19604    background: error ? "#00000022" : theme.base === "dark" ? "rgba(255,255,255,.1)" : theme.color.mediumlight,
19605    "> svg": {
19606      display: "flex"
19607    }
19608  }
19609})), FileListUl = styled("ul")({
19610  margin: 0,
19611  padding: "0 0 0 0",
19612  width: "100%",
19613  position: "relative"
19614}), FileListItemContent = styled("div")({
19615  display: "flex",
19616  flexDirection: "column",
19617  alignItems: "flex-start",
19618  width: "calc(100% - 50px)"
19619}), FileListIconWrapper = styled("div")(({ theme, error }) => ({
19620  color: error ? theme.color.negativeText : theme.color.secondary
19621})), FileListItemLabel = styled("div")(({ theme, error }) => ({
19622  color: error ? theme.color.negativeText : theme.base === "dark" ? theme.color.lighter : theme.color.darkest,
19623  fontSize: "14px",
19624  whiteSpace: "nowrap",
19625  textOverflow: "ellipsis",
19626  overflow: "hidden",
19627  maxWidth: "100%"
19628})), FileListItemPath = styled("div")(({ theme }) => ({
19629  color: theme.textMutedColor,
19630  fontSize: "14px",
19631  whiteSpace: "nowrap",
19632  textOverflow: "ellipsis",
19633  overflow: "hidden",
19634  maxWidth: "100%"
19635})), FileListExport = styled("ul")({
19636  margin: 0,
19637  padding: 0
19638}), FileListItemExport = styled("li")(({ theme, error }) => ({
19639  padding: "8px 16px 8px 58px",
19640  display: "flex",
19641  gap: "8px",
19642  alignItems: "center",
19643  justifyContent: "space-between",
19644  fontSize: "14px",
19645  cursor: "pointer",
19646  borderRadius: "4px",
19647  ":focus-visible": {
19648    outline: "none"
19649  },
19650  ...error && {
19651    background: "#F9ECEC",
19652    color: theme.color.negativeText
19653  },
19654  "&:hover,:focus-visible": {
19655    background: error ? "#F9ECEC" : theme.base === "dark" ? "rgba(255, 255, 255, 0.1)" : theme.color.mediumlight,
19656    "> svg": {
19657      display: "flex"
19658    }
19659  },
19660  "> div > svg": {
19661    color: error ? theme.color.negativeText : theme.color.secondary
19662  }
19663})), FileListItemExportName = styled("div")({
19664  display: "flex",
19665  alignItems: "center",
19666  gap: "8px",
19667  width: "calc(100% - 20px)"
19668}), FileListItemExportNameContent = styled("span")(({ theme }) => ({
19669  whiteSpace: "nowrap",
19670  textOverflow: "ellipsis",
19671  overflow: "hidden",
19672  display: "inline-block",
19673  color: theme.base === "dark" ? theme.color.lightest : theme.color.darkest
19674})), FileListItemExportNameContentWithExport = styled(FileListItemExportNameContent)({
19675  maxWidth: "calc(100% - 120px)"
19676}), DefaultExport = styled("span")(({ theme }) => ({
19677  display: "inline-block",
19678  padding: `1px ${theme.appBorderRadius}px`,
19679  borderRadius: "2px",
19680  fontSize: "10px",
19681  color: theme.color.defaultText,
19682  backgroundColor: theme.base === "dark" ? "rgba(255, 255, 255, 0.1)" : "#F2F4F5"
19683})), NoResults = styled("div")(({ theme }) => ({
19684  textAlign: "center",
19685  maxWidth: "334px",
19686  margin: "16px auto 50px auto",
19687  fontSize: "14px",
19688  color: theme.base === "dark" ? theme.color.lightest : "#000"
19689})), NoResultsDescription = styled("p")(({ theme }) => ({
19690  margin: 0,
19691  color: theme.textMutedColor
19692}));
19693
19694// src/manager/components/sidebar/FileSearchListSkeleton.tsx
19695init_react();
19696var FileListItemContentWrapperSkeleton = styled("div")(({ theme }) => ({
19697  display: "flex",
19698  alignItems: "flex-start",
19699  gap: "8px",
19700  alignSelf: "stretch",
19701  padding: "8px 16px"
19702})), FileListItemContentSkeleton = styled("div")({
19703  display: "flex",
19704  flexDirection: "column",
19705  alignItems: "flex-start",
19706  width: "100%",
19707  borderRadius: "3px"
19708}), FileListIconWrapperSkeleton = styled.div(({ theme }) => ({
19709  width: "14px",
19710  height: "14px",
19711  borderRadius: "3px",
19712  marginTop: "1px",
19713  background: theme.base === "dark" ? "rgba(255,255,255,.1)" : "rgba(0,0,0,.1)",
19714  animation: `${theme.animation.glow} 1.5s ease-in-out infinite`
19715})), FileListItemSkeleton = styled.div(({ theme }) => ({
19716  height: "16px",
19717  borderRadius: "3px",
19718  background: theme.base === "dark" ? "rgba(255,255,255,.1)" : "rgba(0,0,0,.1)",
19719  animation: `${theme.animation.glow} 1.5s ease-in-out infinite`,
19720  width: "100%",
19721  maxWidth: "100%",
19722  "+ div": {
19723    marginTop: "6px"
19724  }
19725})), FileSearchListLoadingSkeleton = () => react_default.createElement(FileList, null, [1, 2, 3].map((result) => react_default.createElement(FileListItem, { key: result }, react_default.createElement(FileListItemContentWrapperSkeleton, null, react_default.createElement(FileListIconWrapperSkeleton, null), react_default.createElement(FileListItemContentSkeleton, null, react_default.createElement(FileListItemSkeleton, { style: { width: "90px" } }), react_default.createElement(FileListItemSkeleton, { style: { width: "300px" } }))))));
19726
19727// src/manager/components/sidebar/FileSearchList.tsx
19728var TreeExpandIconStyled = styled(ChevronSmallRightIcon)(({ theme }) => ({
19729  color: theme.textMutedColor,
19730  marginTop: 2
19731})), TreeCollapseIconStyled = styled(ChevronSmallDownIcon)(({ theme }) => ({
19732  color: theme.textMutedColor,
19733  marginTop: 2
19734})), FileSearchList = memo(function({
19735  isLoading,
19736  searchResults,
19737  onNewStory,
19738  errorItemId
19739}) {
19740  let [selectedItem, setSelectedItem] = useState(null), parentRef = react_default.useRef(), sortedSearchResults = useMemo(() => [...searchResults ?? []].sort((a2, b2) => {
19741    let isALowPriority = a2.exportedComponents === null || a2.exportedComponents?.length === 0, hasAStory = a2.storyFileExists, isBLowPriority = b2.exportedComponents === null || b2.exportedComponents?.length === 0, hasBStory = b2.storyFileExists;
19742    return hasAStory && !hasBStory ? -1 : hasBStory && !hasAStory || isALowPriority && !isBLowPriority ? 1 : !isALowPriority && isBLowPriority ? -1 : 0;
19743  }), [searchResults]), count = searchResults?.length || 0, rowVirtualizer = useVirtualizer({
19744    count,
19745    // @ts-expect-error (non strict)
19746    getScrollElement: () => parentRef.current,
19747    paddingStart: 16,
19748    paddingEnd: 40,
19749    estimateSize: () => 54,
19750    overscan: 2
19751  });
19752  useArrowKeyNavigation({ rowVirtualizer, parentRef, selectedItem });
19753  let handleFileItemSelection = useCallback(
19754    ({ virtualItem, searchResult, itemId }) => {
19755      searchResult?.exportedComponents?.length > 1 ? setSelectedItem((sItem) => sItem === virtualItem.index ? null : virtualItem.index) : searchResult?.exportedComponents?.length === 1 && onNewStory({
19756        componentExportName: searchResult.exportedComponents[0].name,
19757        componentFilePath: searchResult.filepath,
19758        componentIsDefaultExport: searchResult.exportedComponents[0].default,
19759        selectedItemId: itemId,
19760        componentExportCount: 1
19761      });
19762    },
19763    [onNewStory]
19764  ), handleFileItemComponentSelection = useCallback(
19765    ({ searchResult, component, id }) => {
19766      onNewStory({
19767        componentExportName: component.name,
19768        componentFilePath: searchResult.filepath,
19769        componentIsDefaultExport: component.default,
19770        selectedItemId: id,
19771        // @ts-expect-error (non strict)
19772        componentExportCount: searchResult.exportedComponents.length
19773      });
19774    },
19775    [onNewStory]
19776  ), ListItem2 = useCallback(
19777    ({
19778      virtualItem,
19779      selected,
19780      searchResult,
19781      noExports
19782    }) => {
19783      let itemError = errorItemId === searchResult.filepath, itemSelected = selected === virtualItem.index, tooltip = noExports ? "We can't evaluate exports for this file. Automatic story creation is disabled." : void 0;
19784      return react_default.createElement(
19785        FileListItem,
19786        {
19787          "aria-expanded": itemSelected,
19788          "aria-controls": `file-list-export-${virtualItem.index}`,
19789          id: `file-list-item-wrapper-${virtualItem.index}`
19790        },
19791        react_default.createElement(
19792          TooltipProvider,
19793          {
19794            tooltip: tooltip ? react_default.createElement(TooltipNote, { note: tooltip }) : void 0,
19795            placement: "top-start",
19796            delayHide: 100,
19797            delayShow: 200
19798          },
19799          react_default.createElement(
19800            FileListItemContentWrapper,
19801            {
19802              className: "file-list-item",
19803              selected: itemSelected,
19804              error: itemError,
19805              disabled: noExports
19806            },
19807            itemSelected ? react_default.createElement(TreeCollapseIconStyled, { size: 14 }) : react_default.createElement(TreeExpandIconStyled, { size: 14 }),
19808            react_default.createElement(FileListIconWrapper, { error: itemError }, react_default.createElement(ComponentIcon, null)),
19809            react_default.createElement(FileListItemContent, null, react_default.createElement(FileListItemLabel, { error: itemError }, searchResult.filepath.split("/").at(-1)), react_default.createElement(FileListItemPath, null, searchResult.filepath))
19810          )
19811        ),
19812        searchResult?.exportedComponents?.length > 1 && itemSelected && react_default.createElement(
19813          FileListExport,
19814          {
19815            role: "region",
19816            id: `file-list-export-${virtualItem.index}`,
19817            "aria-labelledby": `file-list-item-wrapper-${virtualItem.index}`,
19818            onClick: (e2) => {
19819              e2.stopPropagation();
19820            },
19821            onKeyUp: (e2) => {
19822              e2.key === "Enter" && e2.stopPropagation();
19823            }
19824          },
19825          searchResult.exportedComponents?.map((component, itemExportId) => {
19826            let itemExportError = errorItemId === `${searchResult.filepath}_${itemExportId}`, position = itemExportId === 0 ? "first" : (
19827              // @ts-expect-error (non strict)
19828              itemExportId === searchResult.exportedComponents.length - 1 ? "last" : "middle"
19829            );
19830            return react_default.createElement(
19831              FileListItemExport,
19832              {
19833                tabIndex: 0,
19834                "data-index-position": `${virtualItem.index}_${position}`,
19835                key: component.name,
19836                error: itemExportError,
19837                onClick: () => {
19838                  handleFileItemComponentSelection({
19839                    searchResult,
19840                    component,
19841                    id: `${searchResult.filepath}_${itemExportId}`
19842                  });
19843                },
19844                onKeyUp: (event) => {
19845                  event.key === "Enter" && handleFileItemComponentSelection({
19846                    searchResult,
19847                    component,
19848                    id: `${searchResult.filepath}_${itemExportId}`
19849                  });
19850                }
19851              },
19852              react_default.createElement(FileListItemExportName, null, react_default.createElement(BookmarkHollowIcon, null), component.default ? react_default.createElement(react_default.Fragment, null, react_default.createElement(FileListItemExportNameContentWithExport, null, searchResult.filepath.split("/").at(-1)?.split(".")?.at(0)), react_default.createElement(DefaultExport, null, "Default export")) : react_default.createElement(FileListItemExportNameContent, null, component.name))
19853            );
19854          })
19855        )
19856      );
19857    },
19858    [handleFileItemComponentSelection, errorItemId]
19859  );
19860  return isLoading && (searchResults === null || searchResults?.length === 0) ? react_default.createElement(FileSearchListLoadingSkeleton, null) : searchResults?.length === 0 ? react_default.createElement(NoResults, null, react_default.createElement("p", null, "We could not find any file with that name"), react_default.createElement(NoResultsDescription, null, "You may want to try using different keywords, check for typos, and adjust your filters")) : sortedSearchResults?.length > 0 ? react_default.createElement(FileListWrapper, null, react_default.createElement(FileList, { ref: parentRef }, react_default.createElement(
19861    FileListUl,
19862    {
19863      style: {
19864        height: `${rowVirtualizer.getTotalSize()}px`
19865      }
19866    },
19867    rowVirtualizer.getVirtualItems().map((virtualItem) => {
19868      let searchResult = sortedSearchResults[virtualItem.index], noExports = searchResult.exportedComponents === null || searchResult.exportedComponents?.length === 0, itemProps = {};
19869      return react_default.createElement(
19870        FileListLi,
19871        {
19872          key: virtualItem.key,
19873          "data-index": virtualItem.index,
19874          ref: rowVirtualizer.measureElement,
19875          onClick: () => {
19876            handleFileItemSelection({
19877              virtualItem,
19878              itemId: searchResult.filepath,
19879              searchResult
19880            });
19881          },
19882          onKeyUp: (event) => {
19883            event.key === "Enter" && handleFileItemSelection({
19884              virtualItem,
19885              itemId: searchResult.filepath,
19886              searchResult
19887            });
19888          },
19889          style: {
19890            position: "absolute",
19891            top: 0,
19892            left: 0,
19893            width: "100%",
19894            transform: `translateY(${virtualItem.start}px)`
19895          },
19896          tabIndex: 0
19897        },
19898        react_default.createElement(
19899          ListItem2,
19900          {
19901            ...itemProps,
19902            key: virtualItem.index,
19903            searchResult,
19904            selected: selectedItem,
19905            virtualItem,
19906            noExports
19907          }
19908        )
19909      );
19910    })
19911  ))) : null;
19912});
19913
19914// src/manager/components/sidebar/FileSearchModal.tsx
19915var MODAL_HEIGHT = 418, ModalStyled = styled(Modal)(() => ({
19916  boxShadow: "none",
19917  background: "transparent",
19918  overflow: "visible"
19919})), ModalChild = styled.div(({ theme, height }) => ({
19920  backgroundColor: theme.background.bar,
19921  borderRadius: 6,
19922  boxShadow: "rgba(255, 255, 255, 0.05) 0 0 0 1px inset, rgba(14, 18, 22, 0.35) 0px 10px 18px -10px",
19923  padding: "16px",
19924  transition: "height 0.3s",
19925  height: height ? `${height + 32}px` : "auto",
19926  overflow: "hidden"
19927})), ModalContent = styled(Modal.Content)(({ theme }) => ({
19928  margin: 0,
19929  color: theme.color.defaultText
19930})), ModalInput = styled(Form.Input)(({ theme }) => ({
19931  paddingLeft: 40,
19932  paddingRight: 28,
19933  fontSize: 14,
19934  height: 40,
19935  ...theme.base === "light" && {
19936    color: theme.color.darkest
19937  },
19938  "::placeholder": {
19939    color: theme.color.mediumdark
19940  },
19941  "&:invalid:not(:placeholder-shown)": {
19942    boxShadow: `${theme.color.negative} 0 0 0 1px inset`
19943  },
19944  "&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration": {
19945    display: "none"
19946  }
19947})), SearchField = styled.div({
19948  display: "flex",
19949  flexDirection: "column",
19950  flexGrow: 1,
19951  position: "relative"
19952}), SearchIconWrapper = styled.div(({ theme }) => ({
19953  position: "absolute",
19954  top: 0,
19955  left: 16,
19956  zIndex: 1,
19957  pointerEvents: "none",
19958  color: theme.darkest,
19959  display: "flex",
19960  alignItems: "center",
19961  height: "100%"
19962})), LoadingIcon = styled.div(({ theme }) => ({
19963  position: "absolute",
19964  top: 0,
19965  right: 16,
19966  zIndex: 1,
19967  color: theme.darkest,
19968  display: "flex",
19969  alignItems: "center",
19970  height: "100%",
19971  "@keyframes spin": {
19972    from: { transform: "rotate(0deg)" },
19973    to: { transform: "rotate(360deg)" }
19974  },
19975  animation: "spin 1s linear infinite"
19976})), ModalError = styled(Modal.Error)({
19977  position: "absolute",
19978  padding: "8px 40px 8px 16px",
19979  bottom: 0,
19980  maxHeight: "initial",
19981  width: "100%",
19982  div: {
19983    wordBreak: "break-word"
19984  },
19985  "> div": {
19986    padding: 0
19987  }
19988}), ModalErrorCloseIcon = styled(CloseAltIcon)({
19989  position: "absolute",
19990  top: 4,
19991  right: -24,
19992  cursor: "pointer"
19993}), FileSearchModal = ({
19994  open,
19995  onOpenChange,
19996  fileSearchQuery,
19997  setFileSearchQuery,
19998  isLoading,
19999  error,
20000  searchResults,
20001  onCreateNewStory,
20002  setError
20003}) => {
20004  let [modalContentRef, modalContentDimensions] = useMeasure(), [modalMaxHeight, setModalMaxHeight] = useState(modalContentDimensions.height), [, startTransition2] = useTransition(), [searchInputValue, setSearchInputValue] = useState(fileSearchQuery);
20005  return useEffect(() => {
20006    modalMaxHeight < modalContentDimensions.height && setModalMaxHeight(modalContentDimensions.height);
20007  }, [modalContentDimensions.height, modalMaxHeight]), react_default.createElement(
20008    ModalStyled,
20009    {
20010      ariaLabel: "Add a new story",
20011      height: MODAL_HEIGHT,
20012      width: 440,
20013      open,
20014      onOpenChange
20015    },
20016    react_default.createElement(ModalChild, { height: fileSearchQuery === "" ? modalContentDimensions.height : modalMaxHeight }, react_default.createElement(ModalContent, { ref: modalContentRef }, react_default.createElement(Modal.Header, null, react_default.createElement(Modal.Title, null, "Add a new story"), react_default.createElement(Modal.Description, null, "We will create a new story for your component")), react_default.createElement(SearchField, null, react_default.createElement(SearchIconWrapper, null, react_default.createElement(SearchIcon, null)), react_default.createElement(
20017      ModalInput,
20018      {
20019        placeholder: "./components/**/*.tsx",
20020        type: "search",
20021        required: !0,
20022        autoFocus: !0,
20023        value: searchInputValue,
20024        onChange: (e2) => {
20025          let newValue = e2.target.value;
20026          setSearchInputValue(newValue), startTransition2(() => {
20027            setFileSearchQuery(newValue);
20028          });
20029        }
20030      }
20031    ), isLoading && react_default.createElement(LoadingIcon, null, react_default.createElement(SyncIcon, null))), react_default.createElement(
20032      FileSearchList,
20033      {
20034        errorItemId: error?.selectedItemId,
20035        isLoading,
20036        searchResults,
20037        onNewStory: onCreateNewStory
20038      }
20039    ))),
20040    error && fileSearchQuery !== "" && react_default.createElement(ModalError, null, react_default.createElement("div", null, error.error), react_default.createElement(
20041      ModalErrorCloseIcon,
20042      {
20043        onClick: () => {
20044          setError(null);
20045        }
20046      }
20047    ))
20048  );
20049};
20050
vendor: 383 bytes, lines 20051-20062
20051// src/manager/utils/trySelectStory.ts
20052async function trySelectStory(selectStory, storyId, attempt = 1) {
20053  if (attempt > 10)
20054    throw new Error("We could not select the new story. Please try again.");
20055  try {
20056    selectStory(storyId);
20057  } catch {
20058    return await new Promise((resolve) => setTimeout(resolve, 500)), trySelectStory(selectStory, storyId, attempt + 1);
20059  }
20060}
20061
20062// src/
vendor: 1,641 bytes, lines 20062-20092
20062manager/components/sidebar/CreateNewStoryFileModal.tsx
20063var isRendererReact = scope.STORYBOOK_RENDERER === "react", CreateNewStoryFileModal = ({ open, onOpenChange }) => {
20064  let [isLoading, setLoading] = useState(!1), [fileSearchQuery, setFileSearchQuery] = useState(""), fileSearchQueryDebounced = useDebounce(fileSearchQuery, 600), fileSearchQueryDeferred = useDeferredValue(fileSearchQueryDebounced), emittedValue = useRef(null), [error, setError] = useState(
20065    null
20066  ), api = useStorybookApi(), hasRunGhostStoriesFlow = useRef(!1), [searchResults, setSearchResults] = useState(null), handleSuccessfullyCreatedStory = useCallback(
20067    (componentExportName) => {
20068      api.addNotification({
20069        id: "create-new-story-file-success",
20070        content: {
20071          headline: "Story file created",
20072          subHeadline: `${componentExportName} was created`
20073        },
20074        duration: 8e3,
20075        icon: react_default.createElement(CheckIcon, null)
20076      }), onOpenChange(!1);
20077    },
20078    [api, onOpenChange]
20079  ), handleStoryAlreadyExists = useCallback(() => {
20080    api.addNotification({
20081      id: "create-new-story-file-error",
20082      content: {
20083        headline: "Story already exists",
20084        subHeadline: "Successfully navigated to existing story"
20085      },
20086      duration: 8e3,
20087      icon: react_default.createElement(CheckIcon, null)
20088    }), onOpenChange(!1);
20089  }, [api, onOpenChange]), handleFileSearch = useCallback(() => {
20090    setLoading(!0);
20091    let channel = addons.getChannel(), set = (data) => {
20092      data.id === fileSearchQueryDeferred && (data.success ? setSearchResults(data.payload.files) : setError({ error: data.error }
20092), channel.off(FILE_COMPONENT_SEARCH_RESPONSE, set), setLoading(!1), emittedValue.current = null);
20093    };
20094    return channel.on(FILE_COMPONENT_SEARCH_RESPONSE, set), fileSearchQueryDeferred !== "" && emittedValue.current !== fileSearchQueryDeferred ? (emittedValue.current = fileSearchQueryDeferred, channel.emit(FILE_COMPONENT_SEARCH_REQUEST, {
20095      id: fileSearchQueryDeferred,
20096      payload: {}
20097    })) : (setSearchResults(null), setLoading(!1)), () => {
20098      channel.off(FILE_COMPONENT_SEARCH_RESPONSE, set);
20099    };
20100  }, [fileSearchQueryDeferred]), handleCreateNewStory = useCallback(
20101    async ({
20102      componentExportName,
20103      componentFilePath,
20104      componentIsDefaultExport,
20105      componentExportCount,
20106      selectedItemId
20107    }) => {
20108      try {
20109        let channel = addons.getChannel(), createNewStoryResult = await experimental_requestResponse(channel, CREATE_NEW_STORYFILE_REQUEST, CREATE_NEW_STORYFILE_RESPONSE, {
20110          componentExportName,
20111          componentFilePath,
20112          componentIsDefaultExport,
20113          componentExportCount
20114        });
20115        setError(null);
20116        let storyId = createNewStoryResult.storyId;
20117        await trySelectStory(api.selectStory, storyId), handleSuccessfullyCreatedStory(componentExportName), handleFileSearch();
20118      } catch (e2) {
20119        switch (e2?.payload?.type) {
20120          case "STORY_FILE_EXISTS":
20121            let err = e2;
20122            await trySelectStory(api.selectStory, err.payload.kind), handleStoryAlreadyExists();
20123            break;
20124          default:
20125            setError({ selectedItemId, error: e2?.message });
20126            break;
20127        }
vendor: 5,010 bytes, lines 20127-20243
20127
20128      }
20129    },
20130    [api?.selectStory, handleSuccessfullyCreatedStory, handleFileSearch, handleStoryAlreadyExists]
20131  );
20132  useEffect(() => {
20133    setError(null);
20134  }, [fileSearchQueryDeferred]), useEffect(() => handleFileSearch(), [handleFileSearch]);
20135  let executeGhostStoriesFlow = useCallback(async () => {
20136    addons.getChannel().emit(GHOST_STORIES_REQUEST);
20137  }, []);
20138  return useEffect(() => {
20139    open && isRendererReact && !hasRunGhostStoriesFlow.current && (hasRunGhostStoriesFlow.current = !0, executeGhostStoriesFlow());
20140  }, [open, executeGhostStoriesFlow]), react_default.createElement(
20141    FileSearchModal,
20142    {
20143      error,
20144      fileSearchQuery,
20145      fileSearchQueryDeferred,
20146      onCreateNewStory: handleCreateNewStory,
20147      isLoading,
20148      onOpenChange,
20149      open,
20150      searchResults,
20151      setError,
20152      setFileSearchQuery
20153    }
20154  );
20155};
20156
20157// src/manager/components/sidebar/Explorer.tsx
20158init_react();
20159
20160// src/manager/components/sidebar/HighlightStyles.tsx
20161init_react();
20162var HighlightStyles = ({ refId, itemId }) => react_default.createElement(
20163  Global,
20164  {
20165    styles: ({ color: color2 }) => {
20166      let background2 = curriedTransparentize$1(0.85, color2.secondary);
20167      return {
20168        [`[data-ref-id="${refId}"][data-item-id="${itemId}"]:not([data-selected="true"])`]: {
20169          '&[data-nodetype="component"], &[data-nodetype="group"]': {
20170            background: background2,
20171            "&:hover, &:focus": { background: background2 }
20172          },
20173          '&[data-nodetype="story"], &[data-nodetype="document"], &[data-nodetype="test"]': {
20174            color: color2.defaultText,
20175            background: background2,
20176            "&:hover, &:focus": { background: background2 }
20177          }
20178        }
20179      };
20180    }
20181  }
20182);
20183
20184// src/manager/components/sidebar/Refs.tsx
20185init_react();
20186
20187// src/shared/utils/story-index-filters.ts
20188var getActiveFilterCount = ({
20189  includedTagFilters,
20190  excludedTagFilters,
20191  includedStatusFilters,
20192  excludedStatusFilters
20193}) => (includedTagFilters?.length ?? 0) + (excludedTagFilters?.length ?? 0) + (includedStatusFilters?.length ?? 0) + (excludedStatusFilters?.length ?? 0);
20194
20195// src/manager/utils/tree.ts
20196var import_memoizerific3 = __toESM(require_memoizerific(), 1);
20197var { document: document3, window: globalWindow } = scope, createId = (itemId, refId) => !refId || refId === DEFAULT_REF_ID ? itemId : `${refId}_${itemId}`, getLink = (item, refId) => `${document3.location.pathname}?path=/${item.type}/${createId(item.id, refId)}`;
20198var get = (0, import_memoizerific3.default)(1e3)((id, dataset) => dataset[id]), getParent = (0, import_memoizerific3.default)(1e3)((id, dataset) => {
20199  let item = get(id, dataset);
20200  return item && item.type !== "root" ? get(item.parent, dataset) : void 0;
20201}), getParents = (0, import_memoizerific3.default)(1e3)((id, dataset) => {
20202  let parent = getParent(id, dataset);
20203  return parent ? [parent, ...getParents(parent.id, dataset)] : [];
20204}), getAncestorIds2 = (0, import_memoizerific3.default)(1e3)(
20205  (data, id) => getParents(id, data).map((item) => item.id)
20206), getDescendantIds = (0, import_memoizerific3.default)(1e3)((data, id, skipLeafs) => {
20207  let entry = data[id];
20208  return !entry || !("children" in entry) || !entry.children ? [] : entry.children.reduce((acc, childId) => {
20209    let child = data[childId];
20210    return !child || skipLeafs && (child.type === "story" || child.type === "docs") || acc.push(childId, ...getDescendantIds(data, childId, skipLeafs)), acc;
20211  }, []);
20212});
20213function getPath(item, ref) {
20214  let parent = item.type !== "root" && item.parent ? ref.index[item.parent] : null;
20215  return parent ? [...getPath(parent, ref), parent.name] : ref.id === DEFAULT_REF_ID ? [] : [ref.title || ref.id];
20216}
20217var searchItem = (item, ref) => ({ ...item, refId: ref.id, path: getPath(item, ref) });
20218function cycle2(array, index, delta) {
20219  let next = index + delta % array.length;
20220  return next < 0 && (next = array.length + next), next >= array.length && (next -= array.length), next;
20221}
20222var scrollIntoView = (element, center = !1) => {
20223  if (!element)
20224    return;
20225  let { top, bottom } = element.getBoundingClientRect();
20226  if (!top || !bottom)
20227    return;
20228  let bottomOffset = document3?.querySelector("#sidebar-bottom-wrapper")?.getBoundingClientRect().top || globalWindow.innerHeight || document3.documentElement.clientHeight;
20229  bottom > bottomOffset && element.scrollIntoView({ block: center ? "center" : "nearest" });
20230}, getStateType = (isLoading, isAuthRequired, isError2, isEmpty) => {
20231  switch (!0) {
20232    case isAuthRequired:
20233      return "auth";
20234    case isError2:
20235      return "error";
20236    case isLoading:
20237      return "loading";
20238    case isEmpty:
20239      return "empty";
20240    default:
20241      return "ready";
20242  }
20243}, isAncestor = (element, maybeAncestor) => !element || !maybeAncestor ? !1 : element === maybeAncestor ? !0 : isAncestor(element.parentElement || void 0, maybeAncestor), removeNoiseFromName = (storyName) => storyName.replaceAll(/(\s|-|_)/gi, ""), isStoryHoistable = (storyName, componentName
20243) => removeNoiseFromName(storyName) === removeNoiseFromName(componentName
vendor: 7,997 bytes, lines 20243-20450
20243);
20244
20245// src/manager/components/sidebar/RefBlocks.tsx
20246init_react();
20247
20248// src/manager/components/sidebar/Loader.tsx
20249init_react();
20250var LOADER_SEQUENCE = [0, 0, 1, 1, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3], Loadingitem = styled.div(
20251  {
20252    cursor: "progress",
20253    fontSize: 13,
20254    height: "16px",
20255    marginTop: 4,
20256    marginBottom: 4,
20257    alignItems: "center",
20258    overflow: "hidden"
20259  },
20260  ({ depth = 0 }) => ({
20261    marginLeft: depth * 15,
20262    maxWidth: 85 - depth * 5
20263  }),
20264  ({ theme }) => theme.animation.inlineGlow,
20265  ({ theme }) => ({
20266    background: theme.appBorderColor
20267  })
20268), Contained = styled.div({
20269  display: "flex",
20270  flexDirection: "column",
20271  paddingLeft: 20,
20272  paddingRight: 20
20273}), Loader2 = ({ size }) => {
20274  let repeats = Math.ceil(size / LOADER_SEQUENCE.length), sequence = Array.from(Array(repeats)).fill(LOADER_SEQUENCE).flat().slice(0, size);
20275  return react_default.createElement(Fragment, null, sequence.map((depth, index) => react_default.createElement(Loadingitem, { depth, key: index })));
20276};
20277
20278// src/manager/components/sidebar/NoResults.tsx
20279var NoResults2 = styled.div(({ theme }) => ({
20280  display: "flex",
20281  flexDirection: "column",
20282  textAlign: "center",
20283  textWrap: "balance",
20284  gap: 4,
20285  padding: "20px 0",
20286  lineHeight: "18px",
20287  fontSize: `${theme.typography.size.s2}px`,
20288  color: theme.color.defaultText,
20289  small: {
20290    color: theme.textMutedColor,
20291    fontSize: `${theme.typography.size.s1}px`
20292  },
20293  button: {
20294    marginTop: 8,
20295    alignSelf: "center"
20296  }
20297}));
20298
20299// src/manager/components/sidebar/RefBlocks.tsx
20300var { window: globalWindow2 } = scope, TextStyle = styled.div(({ theme }) => ({
20301  fontSize: theme.typography.size.s2,
20302  lineHeight: "20px",
20303  margin: 0
20304})), Text3 = styled.div(({ theme }) => ({
20305  fontSize: theme.typography.size.s2,
20306  lineHeight: "20px",
20307  margin: 0,
20308  code: {
20309    fontSize: theme.typography.size.s1
20310  },
20311  ul: {
20312    paddingLeft: 20,
20313    marginTop: 8,
20314    marginBottom: 8
20315  }
20316})), ErrorDisplay = styled.pre(
20317  {
20318    boxSizing: "border-box",
20319    borderRadius: 8,
20320    overflow: "auto",
20321    whiteSpace: "pre"
20322  },
20323  ({ isMobile: isMobile2 }) => isMobile2 ? {
20324    maxWidth: "calc(100vw - 40px)"
20325  } : {
20326    minWidth: 420,
20327    maxWidth: 640
20328  },
20329  ({ theme }) => ({
20330    color: theme.color.dark
20331  })
20332), AuthBlock = ({ loginUrl, id }) => {
20333  let [isAuthAttempted, setAuthAttempted] = useState(!1), refresh = useCallback(() => {
20334    globalWindow2.document.location.reload();
20335  }, []), open = useCallback((e2) => {
20336    e2.preventDefault();
20337    let childWindow = globalWindow2.open(loginUrl, `storybook_auth_${id}`, "resizable,scrollbars"), timer = setInterval(() => {
20338      childWindow ? childWindow.closed && (clearInterval(timer), setAuthAttempted(!0)) : (logger.error("unable to access loginUrl window"), clearInterval(timer));
20339    }, 1e3);
20340  }, []);
20341  return react_default.createElement(Contained, null, react_default.createElement(Spaced, null, isAuthAttempted ? react_default.createElement(Fragment, null, react_default.createElement(Text3, null, "Authentication on ", react_default.createElement("strong", null, loginUrl), " concluded. Refresh the page to fetch this Storybook."), react_default.createElement("div", null, react_default.createElement(Button, { ariaLabel: !1, size: "small", variant: "outline", onClick: refresh }, react_default.createElement(SyncIcon, null), "Refresh now"))) : react_default.createElement(Fragment, null, react_default.createElement(Text3, null, "Sign in to browse this Storybook."), react_default.createElement("div", null, react_default.createElement(Button, { size: "small", variant: "outline", onClick: open }, react_default.createElement(LockIcon, null), "Sign in")))));
20342}, ErrorBlock = ({ error }) => {
20343  let { isMobile: isMobile2 } = useLayout();
20344  return react_default.createElement(Contained, null, react_default.createElement(Spaced, null, react_default.createElement(TextStyle, null, "Oh no! Something went wrong loading this Storybook.", react_default.createElement("br", null), react_default.createElement(
20345    PopoverProvider,
20346    {
20347      ariaLabel: "Error details",
20348      hasCloseButton: !0,
20349      offset: isMobile2 ? 0 : 8,
20350      placement: isMobile2 ? "bottom-end" : "bottom-start",
20351      popover: react_default.createElement(ErrorDisplay, { isMobile: isMobile2 }, react_default.createElement(ErrorFormatter, { error }))
20352    },
20353    react_default.createElement(Link, null, "View error ", react_default.createElement(ChevronDownIcon, null))
20354  ), " ", react_default.createElement(Link, { href: "https://storybook.js.org/docs?ref=ui", cancel: !1, target: "_blank" }, "View docs"))));
20355}, FlexSpaced = styled(Spaced)({
20356  display: "flex"
20357}), WideSpaced = styled(Spaced)({
20358  flex: 1
20359}), EmptyBlock = ({
20360  isMain,
20361  hasEntries,
20362  activeFilterCount
20363}) => {
20364  let api = useStorybookApi();
20365  return react_default.createElement(Contained, null, react_default.createElement(FlexSpaced, { col: 1 }, react_default.createElement(WideSpaced, null, hasEntries ? react_default.createElement(NoResults2, null, react_default.createElement("strong", null, "No stories found"), activeFilterCount > 0 ? react_default.createElement("small", null, "Your selected filters did not match any stories.") : react_default.createElement("small", null, "Try adding some stories!"), activeFilterCount > 0 ? react_default.createElement(
20366    Button,
20367    {
20368      ariaLabel: !1,
20369      size: "small",
20370      variant: "outline",
20371      onClick: async () => {
20372        await api.setAllTagFilters([], []), await api.resetStatusFilters();
20373      }
20374    },
20375    react_default.createElement(SweepIcon, null),
20376    "Clear filters"
20377  ) : null) : isMain ? react_default.createElement(Text3, null, "Oh no! Your Storybook is empty. This can happen when:", react_default.createElement("ul", null, react_default.createElement("li", null, "Your", " ", react_default.createElement(
20378    Link,
20379    {
20380      href: "https://storybook.js.org/docs/api/main-config/main-config-stories?ref=ui",
20381      cancel: !1,
20382      target: "_blank"
20383    },
20384    "stories glob configuration"
20385  ), " ", "does not match any files.", " "), react_default.createElement("li", null, "You have", " ", react_default.createElement(
20386    Link,
20387    {
20388      href: "https://storybook.js.org/docs/writing-stories?ref=ui",
20389      cancel: !1,
20390      target: "_blank"
20391    },
20392    "no stories defined"
20393  ), " ", "in your story files.", " "))) : react_default.createElement(Text3, null, "This composed Storybook is empty. Perhaps no stories match your selected filters."))));
20394}, LoaderBlock = ({ isMain }) => react_default.createElement(Contained, null, react_default.createElement(Loader2, { size: isMain ? 17 : 5 }));
20395
20396// src/manager/components/sidebar/RefIndicator.tsx
20397init_react();
20398var { document: document4, window: globalWindow3 } = scope, IndicatorPlacement = styled.div(({ theme }) => ({
20399  height: 16,
20400  display: "flex",
20401  alignItems: "center",
20402  "& > * + *": {
20403    marginLeft: theme.layoutMargin
20404  }
20405})), IndicatorClickTarget = styled(Button)(({ theme }) => ({
20406  color: theme.textMutedColor,
20407  svg: {
20408    height: 14,
20409    width: 14,
20410    padding: 2,
20411    transition: "all 150ms ease-out",
20412    color: "inherit"
20413  }
20414})), MessageTitle = styled.span(({ theme }) => ({
20415  fontWeight: theme.typography.weight.bold
20416})), StyledMessage = styled.a(({ theme }) => ({
20417  textDecoration: "none",
20418  lineHeight: "16px",
20419  padding: 15,
20420  display: "flex",
20421  flexDirection: "row",
20422  alignItems: "flex-start",
20423  color: theme.color.defaultText,
20424  "&:not(:last-child)": {
20425    borderBottom: `1px solid ${theme.appBorderColor}`
20426  },
20427  "&:hover": {
20428    background: theme.background.hoverable,
20429    color: theme.color.defaultText
20430  },
20431  "&:link, &:active, &:focus": {
20432    color: theme.color.defaultText
20433  },
20434  "&:focus-visible": {
20435    background: theme.background.hoverable,
20436    borderRadius: 8,
20437    boxShadow: `inset 0 0 0 2px ${theme.color.secondary}`,
20438    outline: "none"
20439  },
20440  "& > *": {
20441    flex: 1
20442  },
20443  "& > svg": {
20444    marginTop: 3,
20445    width: 16,
20446    height: 16,
20447    marginRight: 10,
20448    flex: "unset"
20449  }
20450})), Message
vendor: 6,536 bytes, lines 20450-20551
20450 = ({ href, blank = !0, children, onClick }) => react_default.createElement(StyledMessage, { href, target: blank ? "_blank" : void 0, onClick }, children), MessageWrapper = styled.div(
20451  ({ isMobile: isMobile2 }) => ({
20452    width: isMobile2 ? "calc(100vw - 20px)" : 280,
20453    boxSizing: "border-box",
20454    borderRadius: 8,
20455    overflow: "hidden"
20456  }),
20457  ({ theme }) => ({
20458    color: theme.color.dark
20459  })
20460), SubtleSelect = styled(Select)(({ theme }) => ({
20461  background: "transparent",
20462  color: theme.color.defaultText,
20463  fontSize: theme.typography.size.s1,
20464  fontWeight: theme.typography.weight.regular
20465})), RefIndicator = react_default.memo(
20466  forwardRef(
20467    ({ state, ...ref }, forwardedRef) => {
20468      let api = useStorybookApi(), { isMobile: isMobile2 } = useLayout(), list = useMemo(() => Object.values(ref.index || {}), [ref.index]), componentCount = useMemo(
20469        () => list.filter((v2) => v2.type === "component").length,
20470        [list]
20471      ), leafCount = useMemo(
20472        () => list.filter((v2) => v2.type === "docs" || v2.type === "story").length,
20473        [list]
20474      ), currentVersion = useMemo(() => {
20475        if (ref.versions)
20476          return Object.entries(ref.versions).find(([, v2]) => v2 === ref.url)?.[0];
20477      }, [ref.versions, ref.url]);
20478      return react_default.createElement(IndicatorPlacement, { ref: forwardedRef }, react_default.createElement(
20479        PopoverProvider,
20480        {
20481          ariaLabel: "Composed Storybook status",
20482          placement: isMobile2 ? "bottom" : "bottom-start",
20483          padding: 0,
20484          popover: () => react_default.createElement(MessageWrapper, { isMobile: isMobile2 }, react_default.createElement(Spaced, { row: 0 }, state === "loading" && react_default.createElement(LoadingMessage, { url: ref.url }), (state === "error" || state === "empty") && react_default.createElement(ErrorOccurredMessage, { url: ref.url }), state === "ready" && react_default.createElement(react_default.Fragment, null, react_default.createElement(ReadyMessage, { url: ref.url, componentCount, leafCount }), ref.sourceUrl && react_default.createElement(SourceCodeMessage, { url: ref.sourceUrl })), state === "auth" && react_default.createElement(LoginRequiredMessage, { ...ref }), ref.type === "auto-inject" && state !== "error" && react_default.createElement(PerformanceDegradedMessage, null), state !== "loading" && react_default.createElement(ReadDocsMessage, null)))
20485        },
20486        react_default.createElement(
20487          IndicatorClickTarget,
20488          {
20489            variant: "ghost",
20490            padding: "small",
20491            size: "small",
20492            "data-action": "toggle-indicator",
20493            ariaLabel: "Extra actions"
20494          },
20495          react_default.createElement(GlobeIcon, null)
20496        )
20497      ), ref.versions && Object.keys(ref.versions).length ? react_default.createElement(react_default.Fragment, null, react_default.createElement(
20498        SubtleSelect,
20499        {
20500          padding: "small",
20501          size: "small",
20502          ariaLabel: "Version",
20503          tooltip: "Choose version",
20504          defaultOptions: currentVersion,
20505          onSelect: (item) => {
20506            let href = ref.versions?.[item];
20507            href && api.changeRefVersion(ref.id, href);
20508          },
20509          options: Object.entries(ref.versions).map(([id, href]) => ({
20510            value: id,
20511            title: id,
20512            href
20513          }))
20514        },
20515        "version"
20516      )) : null);
20517    }
20518  )
20519), ReadyMessage = ({ url, componentCount, leafCount }) => {
20520  let theme = useTheme();
20521  return react_default.createElement(Message, { href: url.replace(/\/?$/, "/index.html") }, react_default.createElement(GlobeIcon, { color: theme.color.secondary }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "View external Storybook"), react_default.createElement("div", null, "Explore ", componentCount, " components and ", leafCount, " stories in a new browser tab.")));
20522}, SourceCodeMessage = ({ url }) => {
20523  let theme = useTheme();
20524  return react_default.createElement(Message, { href: url }, react_default.createElement(MarkupIcon, { color: theme.color.secondary }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "View source code")));
20525}, LoginRequiredMessage = ({ loginUrl, id }) => {
20526  let theme = useTheme(), open = useCallback(
20527    (e2) => {
20528      e2.preventDefault();
20529      let childWindow = globalWindow3.open(
20530        loginUrl,
20531        `storybook_auth_${id}`,
20532        "resizable,scrollbars"
20533      ), timer = setInterval(() => {
20534        childWindow ? childWindow.closed && (clearInterval(timer), document4.location.reload()) : clearInterval(timer);
20535      }, 1e3);
20536    },
20537    [id, loginUrl]
20538  );
20539  return react_default.createElement(Message, { onClick: open, blank: !1 }, react_default.createElement(LockIcon, { color: theme.color.gold }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Log in required"), react_default.createElement("div", null, "You need to authenticate to view this Storybook's components.")));
20540}, ReadDocsMessage = () => {
20541  let theme = useTheme();
20542  return react_default.createElement(Message, { href: "https://storybook.js.org/docs/sharing/storybook-composition?ref=ui" }, react_default.createElement(DocumentIcon, { color: theme.color.green }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Read Composition docs"), react_default.createElement("div", null, "Learn how to combine multiple Storybooks into one.")));
20543}, ErrorOccurredMessage = ({ url }) => {
20544  let theme = useTheme();
20545  return react_default.createElement(Message, { href: url.replace(/\/?$/, "/index.html") }, react_default.createElement(AlertIcon, { color: theme.color.negative }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Something went wrong"), react_default.createElement("div", null, "This external Storybook didn't load. Debug it in a new tab now.")));
20546}, LoadingMessage = ({ url }) => {
20547  let theme = useTheme();
20548  return react_default.createElement(Message, { href: url.replace(/\/?$/, "/index.html") }, react_default.createElement(TimeIcon, { color: theme.color.secondary }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Please wait"), react_default.createElement("div", null, "This Storybook is loading.")));
20549}, PerformanceDegradedMessage = () => {
20550  let theme = useTheme();
20551  return react_default.createElement(Message
vendor: 1,077 bytes, lines 20551-20570
20551, { href: "https://storybook.js.org/docs/sharing/storybook-composition?ref=ui" }, react_default.createElement(LightningIcon, { color: theme.color.gold }), react_default.createElement("div", null, react_default.createElement(MessageTitle, null, "Reduce lag"), react_default.createElement("div", null, "Learn how to speed up Composition performance.")));
20552};
20553
20554// src/manager/components/sidebar/Tree.tsx
20555init_react();
20556
20557// src/manager/utils/status.tsx
20558init_react();
20559var import_memoizerific4 = __toESM(require_memoizerific(), 1);
20560
20561// src/manager/components/sidebar/IconSymbols.tsx
20562init_react();
20563var Svg2 = styled.svg`
20564  position: absolute;
20565  width: 0;
20566  height: 0;
20567  display: inline-block;
20568  shape-rendering: inherit;
20569  vertical-align: middle;
20570`, GROUP_ID = "icon--group", COMPONENT_ID = "icon--component", DOCUMENT_ID = "icon--document", STORY_ID = "icon--story", TEST_ID = "icon--test", SUCCESS_ID = "icon--success", ERROR_ID = "icon--error", WARNING_ID = "icon--warning", DOT_ID = "icon--dot", NEW_ID = "icon--new", MODIFIED_ID = "icon--modified", AFFECTED_ID = "icon--affected", 
20570IconSymbols = () => react_default.createElement(Svg2, { "data-chromatic": "ignore" }, react_default.createElement("symbol", { id: GROUP_ID }, react_default.createElement(
20571  "path",
20572  {
20573    fillRule: "evenodd",
20574    clipRule: "evenodd",
20575    d: "M6.586 3.504l-1.5-1.5H1v9h12v-7.5H6.586zm.414-1L5.793 1.297a1 1 0 00-.707-.293H.5a.5.5 0 00-.5.5v10a.5.5 0 00.5.5h13a.5.5 0 00.5-.5v-8.5a.5.5 0 00-.5-.5H7z",
20576    fill: "currentColor"
20577  }
20578)), react_default.createElement("symbol", { id: COMPONENT_ID }, react_default.createElement(
20579  "path",
20580  {
20581    fillRule: "evenodd",
20582    clipRule: "evenodd",
20583    d: "M3.5 1.004a2.5 2.5 0 00-2.5 2.5v7a2.5 2.5 0 002.5 2.5h7a2.5 2.5 0 002.5-2.5v-7a2.5 2.5 0 00-2.5-2.5h-7zm8.5 5.5H7.5v-4.5h3a1.5 1.5 0 011.5 1.5v3zm0 1v3a1.5 1.5 0 01-1.5 1.5h-3v-4.5H12zm-5.5 4.5v-4.5H2v3a1.5 1.5 0 001.5 1.5h3zM2 6.504h4.5v-4.5h-3a1.5 1.5 0 00-1.5 1.5v3z",
20584    fill: "currentColor"
20585  }
20586)), react_default.createElement("symbol", { id: DOCUMENT_ID }, react_default.createElement(
20587  "path",
20588  {
20589    d: "M4 5.5a.5.5 0 01.5-.5h5a.5.5 0 010 1h-5a.5.5 0 01-.5-.5zM4.5 7.5a.5.5 0 000 1h5a.5.5 0 000-1h-5zM4 10.5a.5.5 0 01.5-.5h5a.5.5 0 010 1h-5a.5.5 0 01-.5-.5z",
20590    fill: "currentColor"
20591  }
20592), react_default.createElement(
20593  "path",
20594  {
20595    fillRule: "evenodd",
20596    clipRule: "evenodd",
20597    d: "M1.5 0a.5.5 0 00-.5.5v13a.5.5 0 00.5.5h11a.5.5 0 00.5-.5V3.207a.5.5 0 00-.146-.353L10.146.146A.5.5 0 009.793 0H1.5zM2 1h7.5v2a.5.5 0 00.5.5h2V13H2V1z",
20598    fill: "currentColor"
20599  }
20600)), react_default.createElement("symbol", { id: STORY_ID }, react_default.createElement(
20601  "path",
20602  {
20603    fillRule: "evenodd",
20604    clipRule: "evenodd",
20605    d: "M3.5 0h7a.5.5 0 01.5.5v13a.5.5 0 01-.454.498.462.462 0 01-.371-.118L7 11.159l-3.175 2.72a.46.46 0 01-.379.118A.5.5 0 013 13.5V.5a.5.5 0 01.5-.5zM4 12.413l2.664-2.284a.454.454 0 01.377-.128.498.498 0 01.284.12L10 12.412V1H4v11.413z",
20606    fill: "currentColor"
20607  }
20608)), react_default.createElement("symbol", { id: TEST_ID }, react_default.createElement(
20609  "path",
20610  {
20611    fillRule: "evenodd",
20612    clipRule: "evenodd",
20613    d: "M4.5 2h.75v3.866l-3.034 5.26A1.25 1.25 0 003.299 13H10.7a1.25 1.25 0 001.083-1.875L8.75 5.866V2h.75a.5.5 0 100-1h-5a.5.5 0 000 1zm1.75 4V2h1.5v4.134l.067.116L8.827 8H5.173l1.01-1.75.067-.116V6zM4.597 9l-1.515 2.625A.25.25 0 003.3 12H10.7a.25.25 0 00.217-.375L9.404 9H4.597z",
20614    fill: "currentColor"
20615  }
20616)), react_default.createElement("symbol", { id: SUCCESS_ID }, react_default.createElement(
20617  "path",
20618  {
20619    fillRule: "evenodd",
20620    clipRule: "evenodd",
20621    d: "M10.854 4.146a.5.5 0 010 .708l-5 5a.5.5 0 01-.708 0l-2-2a.5.5 0 11.708-.708L5.5 8.793l4.646-4.647a.5.5 0 01.708 0z",
20622    fill: "currentColor"
20623  }
20624)), react_default.createElement("symbol", { id: ERROR_ID }, react_default.createElement(
20625  "path",
20626  {
20627    fillRule: "evenodd",
20628    clipRule: "evenodd",
20629    d: "M7 4a3 3 0 100 6 3 3 0 000-6zM3 7a4 4 0 118 0 4 4 0 01-8 0z",
20630    fill: "currentColor"
20631  }
20632)), react_default.createElement("symbol", { id: WARNING_ID }, react_default.createElement(
20633  "path",
20634  {
20635    fillRule: "evenodd",
20636    clipRule: "evenodd",
20637    d: "M7.206 3.044a.498.498 0 01.23.212l3.492 5.985a.494.494 0 01.006.507.497.497 0 01-.443.252H3.51a.499.499 0 01-.437-.76l3.492-5.984a.497.497 0 01.642-.212zM7 4.492L4.37 9h5.26L7 4.492z",
20638    fill: "currentColor"
20639  }
20640)), react_default.createElement("symbol", { id: DOT_ID }, react_default.createElement("circle", { cx: "3", cy: "3", r: "3", fill: "currentColor" })), react_default.createElement("symbol", { id: NEW_ID }, react_default.createElement(
20641  "path",
20642  {
20643    d: "M7 3.5L6.96971 3.68173C6.68873 5.36762 5.36762 6.68873 3.68173 6.96971L3.5 7",
20644    stroke: "currentColor",
20645    strokeLinecap: "round",
20646    fill: "none"
20647  }
20648), react_default.createElement(
20649  "path",
20650  {
20651    d: "M7 3.5L7.03029 3.68173C7.31127 5.36762 8.63238 6.68873 10.3183 6.96971L10.5 7",
20652    stroke: "currentColor",
20653    strokeLinecap: "round",
20654    fill: "none"
20655  }
20656), react_default.createElement(
20657  "path",
20658  {
20659    d: "M7 10.5L6.96971 10.3183C6.68873 8.63238 5.36762 7.31127 3.68173 7.03029L3.5 7",
20660    stroke: "currentColor",
20661    strokeLinecap: "round",
20662    fill: "none"
20663  }
20664), react_default.createElement(
20665  "path",
20666  {
20667    d: "M7 10.5L7.03029 10.3183C7.31127 8.63238 8.63238 7.31127 10.3183 7.03029L10.5 7",
20668    stroke: "currentColor",
20669    strokeLinecap: "round",
20670    fill: "none"
20671  }
20672), react_default.createElement("path", { d: "M7 4.5L4.5 7L7 9.5L9.5 7L7 4.5Z", fill: "currentColor" })), react_default.createElement("symbol", { id: MODIFIED_ID }, react_default.createElement("circle", { cx: "7", cy: "7", r: "3", fill: "currentColor" })), react_default.createElement("symbol", { id: AFFECTED_ID }, react_default.createElement("circle", { cx: "7", cy: "7", r: "3", fill: "currentColor" }))), UseSymbol = ({ type }) => type === "group" ? react_default.createElement("use", { xlinkHref: `#${GROUP_ID}` }) : type === "component" ? react_default.createElement("use", { xlinkHref: `#${COMPONENT_ID}` }) : type === "document" ? react_default.createElement("use", { xlinkHref: `#${DOCUMENT_ID}` }) : type === "story" ? react_default.createElement("use", { xlinkHref: `#${STORY_ID}` }) : type === "test" ? react_default.createElement("use", { xlinkHref: `#${TEST_ID}` }) : type === "success" ? react_default.createElement("use", { xlinkHref: `#${SUCCESS_ID}` }) : type === "error" ? react_default.createElement("use", { xlinkHref: `#${ERROR_ID}` }) : type === "warning" ? react_default.createElement("use", { xlinkHref: `#${WARNING_ID}` }) : type === "dot" ? react_default.createElement("use", { xlinkHref: `#${DOT_ID}` }) : type === "new" ? react_default.createElement("use", { xlinkHref: `#${NEW_ID}` }) : type === "modified" ? react_default.createElement("use", { xlinkHref: `#${MODIFIED_ID}` }) : type === "affected" ? react_default.createElement("use", { xlinkHref: `#${AFFECTED_ID}` }) : null;
20673
vendor: 4,634 bytes, lines 20674-20766
20674// src/manager/utils/status.tsx
20675var SmallIcons = styled(CircleIcon)({
20676  // specificity hack
20677  "&&&": {
20678    width: 6,
20679    height: 6
20680  }
20681}), LoadingIcons = styled(SmallIcons)(({ theme: { animation } }) => ({
20682  // specificity hack
20683  animation: `${animation.glow} 1.5s ease-in-out infinite`
20684})), statusPriority = [
20685  "status-value:unknown",
20686  "status-value:pending",
20687  "status-value:success",
20688  "status-value:affected",
20689  "status-value:modified",
20690  "status-value:new",
20691  "status-value:warning",
20692  "status-value:error"
20693], getStatus = (0, import_memoizerific4.default)(10)((theme, status) => {
20694  let defaultIconColor = theme.base === "light" ? curriedTransparentize$1(0.3, theme.color.defaultText) : curriedTransparentize$1(0.6, theme.color.defaultText);
20695  return {
20696    "status-value:unknown": {
20697      icon: null,
20698      iconColor: defaultIconColor,
20699      textColor: null
20700    },
20701    "status-value:pending": {
20702      icon: react_default.createElement(LoadingIcons, { key: "icon" }),
20703      iconColor: defaultIconColor,
20704      textColor: "currentColor"
20705    },
20706    "status-value:success": {
20707      icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "success" })),
20708      iconColor: theme.color.positive,
20709      textColor: "currentColor"
20710    },
20711    "status-value:new": {
20712      icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "new" })),
20713      iconColor: theme.fgColor.accent,
20714      textColor: null
20715    },
20716    "status-value:modified": {
20717      icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "modified" })),
20718      iconColor: theme.fgColor.accent,
20719      textColor: null
20720    },
20721    "status-value:affected": {
20722      icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "affected" })),
20723      iconColor: theme.fgColor.accent,
20724      textColor: null
20725    },
20726    "status-value:warning": {
20727      icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "warning" })),
20728      iconColor: theme.color.warning,
20729      textColor: theme.fgColor.warning
20730    },
20731    "status-value:error": {
20732      icon: react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "error" })),
20733      iconColor: theme.color.negative,
20734      textColor: theme.fgColor.negative
20735    }
20736  }[status];
20737});
20738function getChangeDetectionStatus(statuses) {
20739  let changeValues = Object.values(statuses).filter((status) => status.typeId === CHANGE_DETECTION_STATUS_TYPE_ID).map((status) => status.value), testValues = Object.values(statuses).filter((status) => status.typeId !== CHANGE_DETECTION_STATUS_TYPE_ID).map((status) => status.value);
20740  return {
20741    changeStatus: getMostCriticalStatusValue(changeValues),
20742    testStatus: getMostCriticalStatusValue(testValues)
20743  };
20744}
20745var getMostCriticalStatusValue = (statusValues) => statusPriority.reduce(
20746  (acc, value) => statusValues.includes(value) ? value : acc,
20747  "status-value:unknown"
20748);
20749function getGroupStatus(collapsedData, allStatuses) {
20750  return Object.values(collapsedData).reduce((acc, item) => {
20751    if (item.type === "group" || item.type === "component" || item.type === "story") {
20752      let leafs = getDescendantIds(collapsedData, item.id, !1).map((id) => collapsedData[id]).filter((i2) => i2.type === "story"), combinedStatus = getMostCriticalStatusValue(
20753        // @ts-expect-error (non strict)
20754        leafs.flatMap((story) => Object.values(allStatuses[story.id] || {})).map((s2) => s2.value)
20755      );
20756      combinedStatus && (acc[item.id] = combinedStatus);
20757    }
20758    return acc;
20759  }, {});
20760}
20761function getGroupDualStatus(collapsedData, allStatuses) {
20762  return Object.values(collapsedData).reduce((acc, item) => {
20763    if (item.type === "group" || item.type === "component" || item.type === "story") {
20764      let allDescendantStatuses = getDescendantIds(collapsedData, item.id, !1).map((id) => collapsedData[id]).filter((i2) => i2.type === "story").flatMap(
20765        (story) => Object.values(allStatuses[story.id] || {})
20766      ), changeValues = allDescendantStatuses.filter((s2) => s2.typeId === CHANGE_DETECTION_STATUS_TYPE_ID).map((s2) => s2.value), testValues = allDescendantStatuses.filter((s2) => s2.typeId !== CHANGE_DETECTION_STATUS_TYPE_ID
vendor: 2,073 bytes, lines 20766-20827
20766).map((s2) => s2.value);
20767      acc[item.id] = {
20768        change: getMostCriticalStatusValue(changeValues),
20769        test: getMostCriticalStatusValue(testValues)
20770      };
20771    }
20772    return acc;
20773  }, {});
20774}
20775
20776// src/manager/components/sidebar/ContextMenu.tsx
20777init_react();
20778
20779// src/manager/components/sidebar/StatusButton.tsx
20780init_react();
20781var withStatusColor = ({ theme, status }) => ({
20782  color: getStatus(theme, status).iconColor ?? void 0
20783}), StatusLabel = styled.div(withStatusColor, {
20784  margin: 3
20785}), StyledButton = styled(Button)(
20786  withStatusColor,
20787  ({ theme, height, width }) => ({
20788    transition: "none",
20789    display: "inline-flex",
20790    alignItems: "center",
20791    justifyContent: "center",
20792    width: width || 28,
20793    height: height || 28,
20794    "&:hover": {
20795      color: theme.color.secondary,
20796      background: theme.base === "dark" ? curriedDarken$1(0.3, theme.color.secondary) : curriedLighten$1(0.4, theme.color.secondary)
20797    },
20798    '[data-selected="true"] &': {
20799      background: theme.base === "dark" ? curriedDarken$1(0.18, theme.color.secondary) : theme.color.secondary,
20800      boxShadow: `0 0 5px 5px ${theme.base === "dark" ? curriedDarken$1(0.18, theme.color.secondary) : theme.color.secondary}`,
20801      "&:hover": {
20802        background: theme.base === "dark" ? curriedDarken$1(0.1, theme.color.secondary) : theme.color.secondary
20803      }
20804    },
20805    "&:focus": {
20806      color: theme.color.secondary,
20807      borderColor: theme.color.secondary,
20808      outlineOffset: -2,
20809      "&:not(:focus-visible)": {
20810        borderColor: "transparent"
20811      }
20812    }
20813  }),
20814  ({ theme, selectedItem }) => selectedItem && {
20815    "&:hover": {
20816      boxShadow: `inset 0 0 0 2px ${theme.color.secondary}`,
20817      background: "rgba(255, 255, 255, 0.2)"
20818    }
20819  }
20820), StatusButton = forwardRef((props, ref) => react_default.createElement(StyledButton, { variant: "ghost", padding: "small", ...props, ref }));
20821StatusButton.displayName = "StatusButton";
20822
20823// src/manager/components/sidebar/StatusContext.tsx
20824init_react();
20825var StatusContext = createContext({});
20826
20827// src/manager/components/sidebar/
20827ContextMenu.tsx
20828var empty = {
20829  onMouseEnter: () => {
20830  },
20831  node: null
20832}, FloatingStatusButton = styled(StatusButton)({
20833  background: "var(--tree-node-background-hover)",
20834  boxShadow: "0 0 5px 5px var(--tree-node-background-hover)",
20835  position: "absolute",
20836  right: 0,
20837  zIndex: 1,
20838  "&:focus-visible": {
20839    outlineOffset: -2
20840  }
20841}), useContextMenu = (context, links, api) => {
20842  let [hoverCount, setHoverCount] = useState(0), [isOpen, setIsOpen] = useState(!1), { allStatuses, groupStatus } = useContext(StatusContext), exportName = context && "exportName" in context ? context.exportName ?? "" : "", { children: copyText, buttonProps: copyButtonProps } = useCopyButton({
20843    children: "Copy story name",
20844    content: exportName
20845  }), shortcutKeys = api.getShortcutKeys(), enableShortcuts = !!shortcutKeys, topLinks = useMemo(() => {
20846    let defaultLinks = [];
20847    return context && "importPath" in context && context.importPath && defaultLinks.push({
20848      id: "open-in-editor",
20849      title: "Open in editor",
20850      icon: react_default.createElement(EditorIcon, null),
20851      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.openInEditor }) : null,
20852      onClick: (e2) => {
20853        context.importPath && (e2.preventDefault(), api.openInEditor({ file: context.importPath }));
20854      }
20855    }), context.type === "story" && defaultLinks.push({
20856      id: "copy-story-name",
20857      title: copyText,
20858      icon: react_default.createElement(CopyIcon, null),
20859      // TODO: bring this back once we want to add shortcuts for this
20860      // right:
20861      //   enableShortcuts && shortcutKeys.copyStoryName ? (
20862      //     <Shortcut keys={shortcutKeys.copyStoryName} />
20863      //   ) : null,
20864      onClick: (e2) => {
20865        e2.preventDefault(), copyButtonProps.onClick(e2);
20866      }
20867    }), defaultLinks;
20868  }, [api, context, copyText, copyButtonProps, enableShortcuts, shortcutKeys]), handlers = useMemo(() => ({
20869    onMouseEnter: () => {
20870      setHoverCount((c2) => c2 + 1);
20871    },
20872    onOpen: (event) => {
20873      event.stopPropagation(), setIsOpen(!0);
20874    },
20875    onClose: () => {
20876      setIsOpen(!1);
20877    }
20878  }), []), providerLinks = useMemo(() => {
20879    let registeredTestProviders = api.getElements(Addon_TypesEnum.experimental_TEST_PROVIDER);
20880    return hoverCount ? generateTestProviderLinks(registeredTestProviders, context) : [];
20881  }, [api, context, hoverCount]), shouldRender = !context.refId && (providerLinks.length > 0 || links.length > 0 || topLinks.length > 0), isLeafNode = context.type === "story" || context.type === "docs", itemStatus = useMemo(() => {
20882    let status = "status-value:unknown";
20883    if (!context)
20884      return status;
20885    if (isLeafNode) {
20886      let values = Object.values(allStatuses?.[context.id] || {}).map((s2) => s2.value);
20887      status = getMostCriticalStatusValue(values);
20888    }
20889    if (!isLeafNode) {
20890      let groupValue = groupStatus && groupStatus[context.id];
20891      status = groupValue === "status-value:success" || groupValue === void 0 ? "status-value:unknown" : groupValue;
20892    }
20893    return status;
20894  }, [allStatuses, groupStatus, context, isLeafNode]), MenuIcon2 = useMemo(() => context.type !== "story" && context.type !== "docs" ? itemStatus !== "status-value:success" && itemStatus !== "status-value:unknown" ? react_default.createElement("svg", { key: "icon", viewBox: "0 0 6 6", width: "6", height: "6" }, react_default.createElement(UseSymbol, { type: "dot" })) : react_default.createElement(EllipsisIcon, null) : itemStatus === "status-value:error" ? react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "error" })) : itemStatus === "status-value:warning" ? react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "warning" })) : itemStatus === "status-value:success" ? react_default.createElement("svg", { key: "icon", viewBox: "0 0 14 14", width: "14", height: "14" }, react_default.createElement(UseSymbol, { type: "success" })) : react_default.createElement(EllipsisIcon, null), [itemStatus, context.type]);
20895  return useMemo(() => globalThis.CONFIG_TYPE !== "DEVELOPMENT" ? empty : {
20896    onMouseEnter: handlers.onMouseEnter,
20897    node: shouldRender ? react_default.createElement(
20898      PopoverProvider,
20899      {
20900        ariaLabel: "Context menu",
20901        placement: "bottom-end",
20902        defaultVisible: !1,
20903        visible: isOpen,
20904        onVisibleChange: setIsOpen,
20905        popover: react_default.createElement(LiveContextMenu, { c
vendor: 1,318 bytes, lines 20905-20943
20905ontext, links: [...topLinks, ...links] }),
20906        hasChrome: !0,
20907        padding: 0
20908      },
20909      react_default.createElement(
20910        FloatingStatusButton,
20911        {
20912          "data-displayed": isOpen ? "on" : "off",
20913          "data-testid": "context-menu",
20914          ariaLabel: "Open context menu",
20915          type: "button",
20916          status: itemStatus,
20917          onClick: handlers.onOpen
20918        },
20919        MenuIcon2
20920      )
20921    ) : null
20922  }, [context, handlers, isOpen, shouldRender, links, topLinks, itemStatus, MenuIcon2]);
20923}, LiveContextMenu = ({
20924  context,
20925  links,
20926  ...rest2
20927}) => {
20928  let registeredTestProviders = useStorybookApi().getElements(
20929    Addon_TypesEnum.experimental_TEST_PROVIDER
20930  ), providerLinks = generateTestProviderLinks(registeredTestProviders, context), all = (Array.isArray(links[0]) || links.length === 0 ? links : [links]).concat([providerLinks]);
20931  return react_default.createElement(TooltipLinkList, { ...rest2, links: all });
20932};
20933function generateTestProviderLinks(registeredTestProviders, context) {
20934  return Object.entries(registeredTestProviders).map(([testProviderId, state]) => {
20935    if (!state)
20936      return null;
20937    let content = state.sidebarContextMenu?.({ context });
20938    return content ? {
20939      id: testProviderId,
20940      content
20941    } : null;
20942  }).filter(Boolean);
20943}
vendor: 957 bytes, lines 20943-20970
20943
20944
20945// src/manager/components/sidebar/TreeNode.tsx
20946init_react();
20947
20948// src/manager/components/sidebar/components/CollapseIcon.tsx
20949init_react();
20950var CollapseIconWrapper = styled.div(({ theme, isExpanded }) => ({
20951  width: 8,
20952  height: 8,
20953  display: "flex",
20954  justifyContent: "center",
20955  alignItems: "center",
20956  transform: isExpanded ? "rotateZ(90deg)" : "none",
20957  transition: "transform .1s ease-out",
20958  color: theme.textMutedColor
20959})), CollapseIcon2 = (props) => react_default.createElement(CollapseIconWrapper, { ...props }, react_default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "8", height: "8", fill: "none" }, react_default.createElement(
20960  "path",
20961  {
20962    fill: "currentColor",
20963    fillRule: "evenodd",
20964    clipRule: "evenodd",
20965    d: "M1.896 7.146a.5.5 0 1 0 .708.708l3.5-3.5a.5.5 0 0 0 0-.708l-3.5-3.5a.5.5 0 1 0-.708.708L5.043 4 1.896 7.146Z"
20966  }
20967)));
20968
20969// src/manager/components/sidebar/TreeNode.tsx
20970var TypeIcon2 = styled.svg(
20970
20971  ({ theme, type }) => ({
20972    width: 14,
20973    height: 14,
20974    flex: "0 0 auto",
20975    color: type === "group" ? theme.base === "dark" ? theme.color.primary : theme.color.ultraviolet : type === "component" ? theme.color.secondary : type === "document" ? theme.base === "dark" ? theme.color.gold : "#ff8300" : type === "story" ? theme.color.seafoam : type === "test" ? theme.color.green : "currentColor"
20976  })
vendor: 5,338 bytes, lines 20977-21097
20977), commonNodeStyles = ({
20978  theme,
20979  depth = 0,
20980  isExpandable = !1
20981}) => ({
20982  flex: 1,
20983  width: "100%",
20984  cursor: "pointer",
20985  display: "flex",
20986  alignItems: "start",
20987  textAlign: "left",
20988  textDecoration: "none",
20989  border: "none",
20990  color: "inherit",
20991  fontSize: `${theme.typography.size.s2}px`,
20992  fontWeight: "inherit",
20993  background: "transparent",
20994  minHeight: 28,
20995  borderRadius: 4,
20996  gap: 6,
20997  paddingLeft: `${(isExpandable ? 8 : 22) + depth * 18}px`,
20998  paddingTop: 5,
20999  paddingBottom: 4,
21000  paddingRight: 6,
21001  overflowWrap: "break-word",
21002  wordWrap: "break-word",
21003  wordBreak: "break-word"
21004}), BranchNode = styled.button(commonNodeStyles), LeafNode = styled.a(commonNodeStyles), RootNode = styled.div({
21005  display: "flex",
21006  alignItems: "center",
21007  justifyContent: "space-between",
21008  marginTop: 16,
21009  marginBottom: 4,
21010  "&:first-of-type": {
21011    marginTop: 0
21012  }
21013}), Wrapper5 = styled.div({
21014  display: "flex",
21015  alignItems: "center",
21016  gap: 6,
21017  marginTop: 2
21018}), GroupNode = react_default.memo(function({
21019  children,
21020  isExpanded = !1,
21021  isExpandable = !1,
21022  ...props
21023}) {
21024  return react_default.createElement(BranchNode, { isExpandable, tabIndex: -1, ...props }, react_default.createElement(Wrapper5, null, isExpandable && react_default.createElement(CollapseIcon2, { isExpanded }), react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "14", height: "14", type: "group" }, react_default.createElement(UseSymbol, { type: "group" }))), children);
21025}), ComponentNode = react_default.memo(
21026  function({
21027    theme,
21028    children,
21029    isExpanded = !1,
21030    isExpandable = !1,
21031    isSelected,
21032    ...props
21033  }) {
21034    return react_default.createElement(BranchNode, { isExpandable, tabIndex: -1, ...props }, react_default.createElement(Wrapper5, null, isExpandable && react_default.createElement(CollapseIcon2, { isExpanded }), react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "component" }, react_default.createElement(UseSymbol, { type: "component" }))), children);
21035  }
21036), DocumentNode = react_default.memo(function({ theme, children, docsMode, ...props }) {
21037  return react_default.createElement(LeafNode, { tabIndex: -1, rel: "canonical", ...props }, react_default.createElement(Wrapper5, null, react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "document" }, react_default.createElement(UseSymbol, { type: "document" }))), children);
21038}), StoryBranchNode = react_default.memo(
21039  function({
21040    theme,
21041    children,
21042    isExpandable = !1,
21043    isExpanded = !1,
21044    isSelected,
21045    ...props
21046  }) {
21047    return react_default.createElement(BranchNode, { isExpandable, tabIndex: -1, ...props }, react_default.createElement(Wrapper5, null, isExpandable && react_default.createElement(CollapseIcon2, { isExpanded }), react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "story" }, react_default.createElement(UseSymbol, { type: "story" }))), children);
21048  }
21049), StoryLeafNode = react_default.memo(function({
21050  theme,
21051  children,
21052  ...props
21053}) {
21054  return react_default.createElement(LeafNode, { tabIndex: -1, rel: "canonical", ...props }, react_default.createElement(Wrapper5, null, react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "story" }, react_default.createElement(UseSymbol, { type: "story" }))), children);
21055}), TestNode = react_default.memo(function({
21056  theme,
21057  children,
21058  ...props
21059}) {
21060  return react_default.createElement(LeafNode, { tabIndex: -1, rel: "canonical", ...props }, react_default.createElement(Wrapper5, null, react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "12", height: "12", type: "test" }, react_default.createElement(UseSymbol, { type: "test" }))), children);
21061});
21062
21063// src/manager/components/sidebar/useExpanded.ts
21064init_react();
21065
21066// src/manager/keybinding.ts
21067var codeToKeyMap = {
21068  // event.code => event.key
21069  Space: " ",
21070  Slash: "/",
21071  ArrowLeft: "ArrowLeft",
21072  ArrowUp: "ArrowUp",
21073  ArrowRight: "ArrowRight",
21074  ArrowDown: "ArrowDown",
21075  Escape: "Escape",
21076  Enter: "Enter"
21077}, allFalse = { alt: !1, ctrl: !1, meta: !1, shift: !1 }, matchesModifiers = (modifiers2, event) => {
21078  let { alt, ctrl, meta, shift: shift2 } = modifiers2 === !1 ? allFalse : modifiers2;
21079  return !(typeof alt == "boolean" && alt !== event.altKey || typeof ctrl == "boolean" && ctrl !== event.ctrlKey || typeof meta == "boolean" && meta !== event.metaKey || typeof shift2 == "boolean" && shift2 !== event.shiftKey);
21080}, matchesKeyCode = (code, event) => event.code ? event.code === code : event.key === codeToKeyMap[code];
21081
21082// src/manager/components/sidebar/useExpanded.ts
21083var { document: document5 } = scope, initializeExpanded = ({
21084  refId,
21085  data,
21086  initialExpanded,
21087  highlightedRef,
21088  rootIds,
21089  selectedStoryId
21090}) => {
21091  let selectedStory = selectedStoryId && data[selectedStoryId], candidates = [...rootIds];
21092  return highlightedRef.current?.refId === refId && candidates.push(...getAncestorIds2(data, highlightedRef.current?.itemId)), selectedStory && "children" in selectedStory && selectedStory.children?.length && candidates.push(selectedStoryId), candidates.reduce(
21093    // @ts-expect-error (non strict)
21094    (acc, id) => Object.assign(acc, { [id]: id in initialExpanded ? initialExpanded[id] : !0 }),
21095    {}
21096  );
21097}, noop
vendor: 1,816 bytes, lines 21097-21145
210973 = () => {
21098}, useExpanded = ({
21099  containerRef,
21100  isBrowsing,
21101  refId,
21102  data,
21103  initialExpanded,
21104  rootIds,
21105  highlightedRef,
21106  setHighlightedItemId,
21107  selectedStoryId,
21108  onSelectStoryId
21109}) => {
21110  let api = useStorybookApi(), [expanded, setExpanded] = useReducer(
21111    (state, { ids, value }) => ids.reduce((acc, id) => Object.assign(acc, { [id]: value }), { ...state }),
21112    // @ts-expect-error (non strict)
21113    { refId, data, highlightedRef, rootIds, initialExpanded, selectedStoryId },
21114    initializeExpanded
21115  ), getElementByDataItemId = useCallback(
21116    (id) => containerRef.current?.querySelector(`[data-item-id="${id}"]`),
21117    [containerRef]
21118  ), highlightElement = useCallback(
21119    (element) => {
21120      setHighlightedItemId(element.getAttribute("data-item-id")), scrollIntoView(element);
21121    },
21122    [setHighlightedItemId]
21123  ), updateExpanded = useCallback(
21124    ({ ids, value }) => {
21125      if (setExpanded({ ids, value }), ids.length === 1) {
21126        let element = containerRef.current?.querySelector(
21127          `[data-item-id="${ids[0]}"][data-ref-id="${refId}"]`
21128        );
21129        element && highlightElement(element);
21130      }
21131    },
21132    [containerRef, highlightElement, refId]
21133  );
21134  useEffect(() => {
21135    setExpanded({ ids: getAncestorIds2(data, selectedStoryId), value: !0 });
21136  }, [data, selectedStoryId]);
21137  let collapseAll = useCallback(() => {
21138    let ids = Object.keys(data).filter((id) => !rootIds.includes(id));
21139    setExpanded({ ids, value: !1 });
21140  }, [data, rootIds]), expandAll = useCallback(() => {
21141    setExpanded({ ids: Object.keys(data), value: !0 });
21142  }, [data]);
21143  return useEffect(() => api ? (api.on(STORIES_COLLAPSE_ALL, collapseAll), api.on(STORIES_EXPAND_ALL, expandAll), () => {
21144    api.off(STORIES_COLLAPSE_ALL, collapseAll), api.off(STORIES_EXPAND_ALL, expandAll);
21145  }) : noop3
vendor: 5,062 bytes, lines 21145-21283
21145, [api, collapseAll, expandAll]), useEffect(() => {
21146    let menuElement = document5.getElementById("storybook-explorer-menu"), navigateTree = throttle((event) => {
21147      let highlightedItemId = highlightedRef.current?.refId === refId && highlightedRef.current?.itemId;
21148      if (!isBrowsing || !containerRef.current || !highlightedItemId || event.repeat || !matchesModifiers(!1, event))
21149        return;
21150      let isEnter = matchesKeyCode("Enter", event), isSpace = matchesKeyCode("Space", event), isArrowLeft = matchesKeyCode("ArrowLeft", event), isArrowRight = matchesKeyCode("ArrowRight", event);
21151      if (!(isEnter || isSpace || isArrowLeft || isArrowRight))
21152        return;
21153      let highlightedElement = getElementByDataItemId(highlightedItemId);
21154      if (!highlightedElement || highlightedElement.getAttribute("data-ref-id") !== refId)
21155        return;
21156      let target = event.target;
21157      if (!isAncestor(menuElement, target) && !isAncestor(target, menuElement))
21158        return;
21159      if (target.hasAttribute("data-action")) {
21160        if (isEnter || isSpace)
21161          return;
21162        target.blur();
21163      }
21164      let type = highlightedElement.getAttribute("data-nodetype");
21165      type && (isEnter || isSpace) && ["component", "story", "document", "test"].includes(type) && onSelectStoryId(highlightedItemId);
21166      let isExpanded = highlightedElement.getAttribute("aria-expanded");
21167      if (isArrowLeft) {
21168        if (isExpanded === "true") {
21169          setExpanded({ ids: [highlightedItemId], value: !1 });
21170          return;
21171        }
21172        let parentId = highlightedElement.getAttribute("data-parent-id"), parentElement = parentId && getElementByDataItemId(parentId);
21173        if (parentElement && parentElement.getAttribute("data-highlightable") === "true") {
21174          highlightElement(parentElement);
21175          return;
21176        }
21177        setExpanded({ ids: getDescendantIds(data, highlightedItemId, !0), value: !1 });
21178        return;
21179      }
21180      isArrowRight && (isExpanded === "false" ? updateExpanded({ ids: [highlightedItemId], value: !0 }) : isExpanded === "true" && updateExpanded({ ids: getDescendantIds(data, highlightedItemId, !0), value: !0 }));
21181    }, 60);
21182    return document5.addEventListener("keydown", navigateTree), () => document5.removeEventListener("keydown", navigateTree);
21183  }, [
21184    containerRef,
21185    isBrowsing,
21186    refId,
21187    data,
21188    highlightedRef,
21189    setHighlightedItemId,
21190    onSelectStoryId
21191  ]), [expanded, updateExpanded];
21192};
21193
21194// src/manager/components/sidebar/Tree.tsx
21195var CollapseButton = styled(Button)(({ theme }) => ({
21196  fontSize: `${theme.typography.size.s1 - 1}px`,
21197  fontWeight: theme.typography.weight.bold,
21198  letterSpacing: "0.16em",
21199  textTransform: "uppercase",
21200  color: theme.textMutedColor,
21201  padding: "0 8px"
21202})), LeafNodeStyleWrapper = styled.div(({ theme }) => ({
21203  position: "relative",
21204  display: "flex",
21205  justifyContent: "space-between",
21206  alignItems: "flex-start",
21207  color: theme.color.defaultText,
21208  background: "transparent",
21209  minHeight: 28,
21210  borderRadius: 4,
21211  overflow: "hidden",
21212  "--tree-node-background-hover": theme.background.content,
21213  [MEDIA_DESKTOP_BREAKPOINT]: {
21214    "--tree-node-background-hover": theme.background.app
21215  },
21216  "&:hover, &:focus": {
21217    "--tree-node-background-hover": theme.background.hoverable,
21218    background: "var(--tree-node-background-hover)",
21219    outline: "none"
21220  },
21221  '& [data-displayed="off"]': {
21222    visibility: "hidden"
21223  },
21224  '&:hover [data-displayed="off"]': {
21225    visibility: "visible"
21226  },
21227  '& [data-displayed="on"] + *': {
21228    visibility: "hidden"
21229  },
21230  '&:hover [data-displayed="off"] + *': {
21231    visibility: "hidden"
21232  },
21233  '&[data-selected="true"]': {
21234    color: theme.color.lightest,
21235    background: theme.base === "dark" ? curriedDarken$1(0.18, theme.color.secondary) : theme.color.secondary,
21236    fontWeight: theme.typography.weight.bold,
21237    "&&:hover, &&:focus": {
21238      background: theme.base === "dark" ? curriedDarken$1(0.18, theme.color.secondary) : theme.color.secondary
21239    },
21240    svg: { color: theme.color.lightest }
21241  },
21242  a: { color: "currentColor" }
21243})), SkipToContentLink = styled(Button)(({ theme }) => ({
21244  display: "none",
21245  "@media (min-width: 600px)": {
21246    display: "block",
21247    fontSize: "10px",
21248    overflow: "hidden",
21249    width: 1,
21250    height: "20px",
21251    boxSizing: "border-box",
21252    opacity: 0,
21253    padding: 0,
21254    "&:focus": {
21255      opacity: 1,
21256      padding: "5px 10px",
21257      background: "white",
21258      color: theme.color.secondary,
21259      width: "auto"
21260    }
21261  }
21262})), StatusSlots = styled.div({
21263  display: "flex",
21264  alignItems: "center"
21265});
21266var getStatusLabel = (status) => status.split(":")[1].replace(/^./, (char) => char.toUpperCase()), Node2 = react_default.memo(function(props) {
21267  let {
21268    item,
21269    statuses,
21270    groupDualStatus,
21271    refId,
21272    docsMode,
21273    isOrphan,
21274    isDisplayed,
21275    isSelected,
21276    isFullyExpanded,
21277    setFullyExpanded,
21278    isExpanded,
21279    setExpanded,
21280    onSelectStoryId,
21281    api,
21282    isModifiedFilterActive
21283  } = props, theme = useTheme(), { isDesktop, isMobile: isMobile2
21283, setMobileMenuOpen } = useLayout(), statusLinks = useMemo(() => item.type === "story" || item.type === "docs" ? Object.entries(statuses).filter(([, status]) => status.sidebarContextMenu !== !1).sort((a2, b2) => statusPriority.indexOf(a2[1].value) - statusPriority.indexOf(b2[1].value)).map(([typeId, status]) => ({
21284    id: typeId,
21285    title: status.title,
21286    description: status.description,
21287    "aria-label": `Test status for ${status.title}: ${status.value}`,
21288    icon: getStatus(theme, status.value).icon,
21289    onClick: () => {
21290      onSelectStoryId(item.id), internal_fullStatusStore.selectStatuses([status]);
21291    }
21292  })) : [], [item.id, item.type, onSelectStoryId, statuses, theme]), contextMenu = useContextMenu(item, statusLinks, api);
21293  refId !== "storybook_internal" && (contextMenu = { node: null, onMouseEnter: () => {
21294  } });
21295  let id = createId(item.id, refId);
21296  if (item.type === "story" && !("children" in item && item.children) && (!("subtype" in item) || item.subtype !== "test") || item.type === "docs") {
21297    let LeafNode3 = item.type === "docs" ? DocumentNode : StoryLeafNode, { changeStatus, testStatus } = getChangeDetectionStatus(statuses || {}), leafChangeIcon = changeStatus === "status-value:unknown" || changeStatus === "status-value:affected" || changeStatus === "status-value:modified" && !isModifiedFilterActive ? null : getStatus(theme, changeStatus).icon, { icon: testIcon } = getStatus(theme, testStatus), overallStoryStatus = getMostCriticalStatusValue([changeStatus, testStatus]), { textColor } = getStatus(theme, overallStoryStatus);
21298    return react_default.createElement(
21299      LeafNodeStyleWrapper,
21300      {
21301        key: id,
21302        className: "sidebar-item",
21303        "data-selected": isSelected,
21304        "data-ref-id": refId,
21305        "data-item-id": item.id,
21306        "data-parent-id": item.parent,
21307        "data-nodetype": item.type === "docs" ? "document" : "story",
21308        "data-highlightable": isDisplayed,
21309        onMouseEnter: contextMenu.onMouseEnter
21310      },
21311      react_default.createElement(
21312        LeafNode3,
21313        {
21314          style: isSelected ? {} : { color: textColor },
21315          href: getLink(item, refId),
21316          id,
21317          depth: isOrphan ? item.depth : item.depth - 1,
21318          onClick: (event) => {
21319            event.preventDefault(), onSelectStoryId(item.id), isMobile2 && setMobileMenuOpen(!1);
21320          },
21321          ...item.type === "docs" && { docsMode }
21322        },
21323        item.renderLabel?.(item, api) || item.name
21324      ),
21325      isSelected && react_default.createElement(SkipToContentLink, { asChild: !0, ariaLabel: !1 }, react_default.createElement("a", { href: "#storybook-preview-wrapper" }, "Skip to content")),
21326      contextMenu.node,
21327      leafChangeIcon && testIcon ? react_default.createElement(StatusSlots, null, react_default.createElement(
21328        StatusButton,
21329        {
21330          ariaLabel: `Change status: ${getStatusLabel(changeStatus)}`,
21331          "data-testid": "tree-change-status-button",
21332          type: "button",
21333          status: changeStatus,
21334          selectedItem: isSelected
21335        },
21336        leafChangeIcon
21337      ), react_default.createElement(
21338        StatusButton,
21339        {
21340          ariaLabel: `Test status: ${getStatusLabel(testStatus)}`,
21341          "data-testid": "tree-status-button",
21342          type: "button",
21343          status: testStatus,
21344          selectedItem: isSelected
21345        },
21346        testIcon
vendor: 11,837 bytes, lines 21347-21643
21347      )) : leafChangeIcon ? react_default.createElement(
21348        StatusButton,
21349        {
21350          ariaLabel: `Change status: ${getStatusLabel(changeStatus)}`,
21351          "data-testid": "tree-change-status-button",
21352          type: "button",
21353          status: changeStatus,
21354          selectedItem: isSelected
21355        },
21356        leafChangeIcon
21357      ) : testIcon ? react_default.createElement(
21358        StatusButton,
21359        {
21360          ariaLabel: `Test status: ${getStatusLabel(testStatus)}`,
21361          "data-testid": "tree-status-button",
21362          type: "button",
21363          status: testStatus,
21364          selectedItem: isSelected
21365        },
21366        testIcon
21367      ) : null
21368    );
21369  }
21370  if (item.type === "root")
21371    return react_default.createElement(
21372      RootNode,
21373      {
21374        key: id,
21375        id,
21376        className: "sidebar-subheading",
21377        "data-ref-id": refId,
21378        "data-item-id": item.id,
21379        "data-nodetype": "root"
21380      },
21381      react_default.createElement(
21382        CollapseButton,
21383        {
21384          variant: "ghost",
21385          ariaLabel: isExpanded ? "Collapse" : "Expand",
21386          "data-action": "collapse-root",
21387          onClick: (event) => {
21388            event.preventDefault(), setExpanded({ ids: [item.id], value: !isExpanded });
21389          },
21390          "aria-expanded": isExpanded
21391        },
21392        react_default.createElement(CollapseIcon2, { isExpanded }),
21393        item.renderLabel?.(item, api) || item.name
21394      ),
21395      isExpanded && react_default.createElement(
21396        Button,
21397        {
21398          padding: "small",
21399          variant: "ghost",
21400          className: "sidebar-subheading-action",
21401          ariaLabel: isFullyExpanded ? "Collapse all" : "Expand all",
21402          "data-action": "expand-all",
21403          "data-expanded": isFullyExpanded,
21404          onClick: (event) => {
21405            event.preventDefault(), setFullyExpanded();
21406          }
21407        },
21408        isFullyExpanded ? react_default.createElement(CollapseIcon, null) : react_default.createElement(ExpandAltIcon, null)
21409      )
21410    );
21411  if (item.type === "component" || item.type === "group" || item.type === "story" && "children" in item && item.children) {
21412    let { children = [] } = item, BranchNode2 = { component: ComponentNode, group: GroupNode, story: StoryBranchNode }[item.type], { changeStatus: localChange, testStatus: localTest } = getChangeDetectionStatus(
21413      statuses || {}
21414    ), groupDual = groupDualStatus?.[item.id] || {
21415      change: "status-value:unknown",
21416      test: "status-value:unknown"
21417    }, branchChange = getMostCriticalStatusValue([localChange, groupDual.change]), branchTest = getMostCriticalStatusValue([localTest, groupDual.test]), branchChangeIcon = branchChange !== "status-value:unknown" && branchChange !== "status-value:affected" && (branchChange !== "status-value:modified" || isModifiedFilterActive) ? getStatus(theme, branchChange).icon : null, branchTestIcon = getStatus(theme, branchTest).icon, overallStatus = getMostCriticalStatusValue([branchChange, branchTest]), color2 = overallStatus ? getStatus(theme, overallStatus).textColor : null;
21418    return react_default.createElement(
21419      LeafNodeStyleWrapper,
21420      {
21421        key: id,
21422        className: "sidebar-item",
21423        "data-selected": isSelected,
21424        "data-ref-id": refId,
21425        "data-item-id": item.id,
21426        "data-parent-id": item.parent,
21427        "data-nodetype": item.type,
21428        "data-highlightable": isDisplayed,
21429        onMouseEnter: contextMenu.onMouseEnter
21430      },
21431      react_default.createElement(
21432        BranchNode2,
21433        {
21434          id,
21435          style: color2 && !isSelected ? { color: color2 } : {},
21436          "aria-controls": children.join(" "),
21437          "aria-expanded": isExpanded,
21438          depth: isOrphan ? item.depth : item.depth - 1,
21439          isExpandable: children.length > 0,
21440          isExpanded,
21441          onClick: (event) => {
21442            event.preventDefault(), item.type === "story" ? (onSelectStoryId(item.id), (!isExpanded || isSelected) && setExpanded({ ids: [item.id], value: !isExpanded })) : item.type === "component" ? (!isExpanded && isDesktop && onSelectStoryId(item.id), setExpanded({ ids: [item.id], value: !isExpanded })) : setExpanded({ ids: [item.id], value: !isExpanded });
21443          },
21444          onMouseEnter: () => {
21445            (item.type === "component" || item.type === "story") && api.emit(PRELOAD_ENTRIES, {
21446              ids: [children[0]],
21447              options: { target: refId }
21448            });
21449          }
21450        },
21451        item.renderLabel?.(item, api) || item.name
21452      ),
21453      isSelected && react_default.createElement(SkipToContentLink, { asChild: !0, ariaLabel: !1 }, react_default.createElement("a", { href: "#storybook-preview-wrapper" }, "Skip to content")),
21454      contextMenu.node,
21455      branchChangeIcon && branchTestIcon ? react_default.createElement(StatusSlots, null, react_default.createElement(
21456        StatusButton,
21457        {
21458          ariaLabel: `Change status: ${getStatusLabel(branchChange)}`,
21459          "data-testid": "tree-change-status-button",
21460          type: "button",
21461          status: branchChange,
21462          selectedItem: isSelected
21463        },
21464        branchChangeIcon
21465      ), react_default.createElement(
21466        StatusButton,
21467        {
21468          ariaLabel: `Test status: ${getStatusLabel(branchTest)}`,
21469          "data-testid": "tree-status-button",
21470          type: "button",
21471          status: branchTest,
21472          selectedItem: isSelected
21473        },
21474        branchTestIcon
21475      )) : branchChangeIcon ? react_default.createElement(
21476        StatusButton,
21477        {
21478          ariaLabel: `Change status: ${getStatusLabel(branchChange)}`,
21479          "data-testid": "tree-change-status-button",
21480          type: "button",
21481          status: branchChange,
21482          selectedItem: isSelected
21483        },
21484        branchChangeIcon
21485      ) : branchTestIcon ? react_default.createElement(
21486        StatusButton,
21487        {
21488          ariaLabel: `Test status: ${getStatusLabel(branchTest)}`,
21489          "data-testid": "tree-status-button",
21490          type: "button",
21491          status: branchTest,
21492          selectedItem: isSelected
21493        },
21494        branchTestIcon
21495      ) : null
21496    );
21497  }
21498  let isTest = item.type === "story" && item.subtype === "test", LeafNode2 = isTest ? TestNode : { docs: DocumentNode, story: StoryLeafNode }[item.type], nodeType = isTest ? "test" : { docs: "document", story: "story" }[item.type], leafStatuses = Object.fromEntries(
21499    Object.entries(statuses || {}).filter(
21500      ([, status]) => status.typeId !== CHANGE_DETECTION_STATUS_TYPE_ID || status.value === "status-value:new"
21501    )
21502  ), leafStatus = getMostCriticalStatusValue(Object.values(leafStatuses).map((s2) => s2.value)), { icon: leafIcon, textColor: leafColor } = getStatus(theme, leafStatus), leafStatusButton = leafIcon ? react_default.createElement(
21503    StatusButton,
21504    {
21505      ariaLabel: `Status: ${getStatusLabel(leafStatus)}`,
21506      "data-testid": "tree-status-button",
21507      role: "status",
21508      type: "button",
21509      status: leafStatus,
21510      selectedItem: isSelected
21511    },
21512    leafIcon
21513  ) : null;
21514  return react_default.createElement(
21515    LeafNodeStyleWrapper,
21516    {
21517      key: id,
21518      className: "sidebar-item",
21519      "data-selected": isSelected,
21520      "data-ref-id": refId,
21521      "data-item-id": item.id,
21522      "data-parent-id": item.parent,
21523      "data-nodetype": nodeType,
21524      "data-highlightable": isDisplayed,
21525      onMouseEnter: contextMenu.onMouseEnter
21526    },
21527    react_default.createElement(
21528      LeafNode2,
21529      {
21530        style: leafColor && !isSelected ? { color: leafColor } : {},
21531        href: getLink(item, refId),
21532        id,
21533        depth: isOrphan ? item.depth : item.depth - 1,
21534        onClick: (event) => {
21535          event.preventDefault(), onSelectStoryId(item.id), isMobile2 && setMobileMenuOpen(!1);
21536        }
21537      },
21538      item.renderLabel?.(item, api) || item.name
21539    ),
21540    isSelected && react_default.createElement(SkipToContentLink, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: "#storybook-preview-wrapper" }, "Skip to content")),
21541    contextMenu.node,
21542    leafStatusButton
21543  );
21544}), Root = react_default.memo(function({
21545  setExpanded,
21546  isFullyExpanded,
21547  expandableDescendants,
21548  ...props
21549}) {
21550  let setFullyExpanded = useCallback(
21551    () => setExpanded({ ids: expandableDescendants, value: !isFullyExpanded }),
21552    [setExpanded, isFullyExpanded, expandableDescendants]
21553  );
21554  return react_default.createElement(
21555    Node2,
21556    {
21557      ...props,
21558      setExpanded,
21559      isFullyExpanded,
21560      setFullyExpanded
21561    }
21562  );
21563}), Tree = react_default.memo(function({
21564  isBrowsing,
21565  refId,
21566  data,
21567  allStatuses,
21568  docsMode,
21569  highlightedRef,
21570  setHighlightedItemId,
21571  selectedStoryId,
21572  onSelectStoryId
21573}) {
21574  let containerRef = useRef(null), api = useStorybookApi(), isModifiedFilterActive = (useStorybookState().includedStatusFilters ?? []).includes("status-value:modified"), [rootIds, orphanIds, initialExpanded] = useMemo(
21575    () => Object.keys(data).reduce(
21576      (acc, id) => {
21577        let item = data[id];
21578        return item.type === "root" ? acc[0].push(id) : item.parent || acc[1].push(id), item.type === "root" && item.startCollapsed && (acc[2][id] = !1), acc;
21579      },
21580      [[], [], {}]
21581    ),
21582    [data]
21583  ), { expandableDescendants } = useMemo(() => [...orphanIds, ...rootIds].reduce(
21584    (acc, nodeId) => (acc.expandableDescendants[nodeId] = getDescendantIds(data, nodeId, !1).filter(
21585      (d2) => !["story", "docs"].includes(data[d2].type)
21586    ), acc),
21587    { orphansFirst: [], expandableDescendants: {} }
21588  ), [data, rootIds, orphanIds]), singleStoryComponentIds = useMemo(() => Object.keys(data).filter((id) => {
21589    let entry = data[id];
21590    if (entry.type !== "component")
21591      return !1;
21592    let { children = [], name } = entry;
21593    if (children.length !== 1)
21594      return !1;
21595    let onlyChild = data[children[0]];
21596    return onlyChild.type === "docs" ? !0 : onlyChild.type === "story" && onlyChild.subtype === "story" ? isStoryHoistable(onlyChild.name, name) : !1;
21597  }), [data]), collapsedItems = useMemo(
21598    () => Object.keys(data).filter((id) => !singleStoryComponentIds.includes(id)),
21599    [data, singleStoryComponentIds]
21600  ), collapsedData = useMemo(() => singleStoryComponentIds.reduce(
21601    (acc, id) => {
21602      let { children, parent, name } = data[id], [childId] = children;
21603      if (parent) {
21604        let siblings = [...data[parent].children];
21605        siblings[siblings.indexOf(id)] = childId, acc[parent] = { ...data[parent], children: siblings };
21606      }
21607      return acc[childId] = {
21608        ...data[childId],
21609        name,
21610        parent,
21611        depth: data[childId].depth - 1
21612      }, acc;
21613    },
21614    { ...data }
21615  ), [data, singleStoryComponentIds]), ancestry = useMemo(() => collapsedItems.reduce(
21616    (acc, id) => Object.assign(acc, { [id]: getAncestorIds2(collapsedData, id) }),
21617    {}
21618  ), [collapsedItems, collapsedData]), [expanded, setExpanded] = useExpanded({
21619    // @ts-expect-error (non strict)
21620    containerRef,
21621    isBrowsing,
21622    refId,
21623    data: collapsedData,
21624    initialExpanded,
21625    rootIds,
21626    highlightedRef,
21627    setHighlightedItemId,
21628    selectedStoryId,
21629    onSelectStoryId
21630  }), groupStatus = useMemo(
21631    () => getGroupStatus(collapsedData, allStatuses ?? {}),
21632    [collapsedData, allStatuses]
21633  ), groupDualStatus = useMemo(
21634    () => getGroupDualStatus(collapsedData, allStatuses ?? {}),
21635    [collapsedData, allStatuses]
21636  ), treeItems = useMemo(() => collapsedItems.map((itemId) => {
21637    let item = collapsedData[itemId], id = createId(itemId, refId);
21638    if (item.type === "root") {
21639      let descendants = expandableDescendants[item.id], isFullyExpanded = descendants.every((d2) => expanded[d2]);
21640      return (
21641        // @ts-expect-error (TODO)
21642        react_default.createElement(
21643          Root
vendor: 14,812 bytes, lines 21643-22029
21643,
21644          {
21645            api,
21646            key: id,
21647            item,
21648            refId,
21649            collapsedData,
21650            isOrphan: !1,
21651            isDisplayed: !0,
21652            isSelected: selectedStoryId === itemId,
21653            isExpanded: !!expanded[itemId],
21654            setExpanded,
21655            isFullyExpanded,
21656            expandableDescendants: descendants,
21657            onSelectStoryId,
21658            isModifiedFilterActive
21659          }
21660        )
21661      );
21662    }
21663    let isDisplayed = !item.parent || ancestry[itemId].every((a2) => expanded[a2]);
21664    return isDisplayed === !1 ? null : react_default.createElement(
21665      Node2,
21666      {
21667        api,
21668        collapsedData,
21669        key: id,
21670        item,
21671        statuses: allStatuses?.[itemId] ?? {},
21672        groupDualStatus,
21673        refId,
21674        docsMode,
21675        isOrphan: orphanIds.some((oid) => itemId === oid || itemId.startsWith(`${oid}-`)),
21676        isDisplayed,
21677        isSelected: selectedStoryId === itemId,
21678        isExpanded: !!expanded[itemId],
21679        setExpanded,
21680        onSelectStoryId,
21681        isModifiedFilterActive
21682      }
21683    );
21684  }), [
21685    ancestry,
21686    api,
21687    collapsedData,
21688    collapsedItems,
21689    docsMode,
21690    expandableDescendants,
21691    expanded,
21692    groupDualStatus,
21693    isModifiedFilterActive,
21694    onSelectStoryId,
21695    orphanIds,
21696    refId,
21697    selectedStoryId,
21698    setExpanded,
21699    allStatuses
21700  ]);
21701  return react_default.createElement(StatusContext.Provider, { value: { data, allStatuses, groupStatus } }, react_default.createElement("div", { ref: containerRef }, treeItems));
21702});
21703
21704// src/manager/components/sidebar/Refs.tsx
21705var Wrapper6 = styled.div(({ isMain }) => ({
21706  position: "relative",
21707  marginTop: isMain ? void 0 : 0
21708})), RefHead = styled.div(({ theme }) => ({
21709  fontWeight: theme.typography.weight.bold,
21710  fontSize: theme.typography.size.s2,
21711  // Similar to ListItem.tsx
21712  textDecoration: "none",
21713  lineHeight: "16px",
21714  display: "flex",
21715  alignItems: "center",
21716  justifyContent: "space-between",
21717  background: "transparent",
21718  width: "100%",
21719  marginTop: 20,
21720  paddingTop: 16,
21721  paddingBottom: 12,
21722  borderTop: `1px solid ${theme.appBorderColor}`,
21723  color: theme.color.defaultText
21724})), RefTitle = styled.div({
21725  textOverflow: "ellipsis",
21726  whiteSpace: "nowrap",
21727  flex: 1,
21728  overflow: "hidden",
21729  marginLeft: 2
21730}), CollapseButton2 = styled.button(({ theme }) => ({
21731  all: "unset",
21732  display: "flex",
21733  padding: "0px 8px",
21734  gap: 6,
21735  alignItems: "center",
21736  cursor: "pointer",
21737  overflow: "hidden",
21738  "&:focus": {
21739    borderColor: theme.color.secondary,
21740    "span:first-of-type": {
21741      borderLeftColor: theme.color.secondary
21742    }
21743  }
21744})), Ref = react_default.memo(function(props) {
21745  let storybookState = useStorybookState(), api = useStorybookApi(), {
21746    filteredIndex: index,
21747    id: refId,
21748    title: title2 = refId,
21749    isLoading: isLoadingMain,
21750    isBrowsing,
21751    hasEntries,
21752    selectedStoryId,
21753    highlightedRef,
21754    setHighlighted,
21755    loginUrl,
21756    type,
21757    expanded = !0,
21758    indexError,
21759    previewInitialized,
21760    allStatuses
21761  } = props, length = useMemo(() => index ? Object.keys(index).length : 0, [index]), indicatorRef = useRef(null), isMain = refId === DEFAULT_REF_ID, isLoading = isLoadingMain || (type === "auto-inject" && !previewInitialized || type === "server-checked") || type === "unknown", isError2 = !!indexError, isEmpty = !isLoading && length === 0, isAuthRequired = !!loginUrl && length === 0, activeFilterCount = getActiveFilterCount(storybookState), state = getStateType(isLoading, isAuthRequired, isError2, isEmpty), [isExpanded, setExpanded] = useState(expanded);
21762  useEffect(() => {
21763    index && selectedStoryId && index[selectedStoryId] && setExpanded(!0);
21764  }, [index, selectedStoryId]);
21765  let handleClick = useCallback(() => setExpanded((value) => !value), []), setHighlightedItemId = useCallback(
21766    (itemId) => setHighlighted({ itemId, refId }),
21767    [setHighlighted, refId]
21768  ), onSelectStoryId = useCallback(
21769    (storyId) => api?.selectStory(storyId, void 0, { ref: isMain ? void 0 : refId }),
21770    [api, isMain, refId]
21771  );
21772  return react_default.createElement(react_default.Fragment, null, isMain || react_default.createElement(
21773    RefHead,
21774    {
21775      "aria-label": `${isExpanded ? "Hide" : "Show"} ${title2} stories`,
21776      "aria-expanded": isExpanded
21777    },
21778    react_default.createElement(CollapseButton2, { "data-action": "collapse-ref", onClick: handleClick }, react_default.createElement(CollapseIcon2, { isExpanded }), react_default.createElement(RefTitle, { title: title2 }, title2)),
21779    react_default.createElement(RefIndicator, { ...props, state, ref: indicatorRef })
21780  ), isExpanded && react_default.createElement(Wrapper6, { "data-title": title2, isMain }, state === "auth" && react_default.createElement(AuthBlock, { id: refId, loginUrl }), state === "error" && react_default.createElement(ErrorBlock, { error: indexError }), state === "loading" && react_default.createElement(LoaderBlock, { isMain }), state === "empty" && react_default.createElement(
21781    EmptyBlock,
21782    {
21783      isMain,
21784      hasEntries,
21785      activeFilterCount
21786    }
21787  ), state === "ready" && react_default.createElement(
21788    Tree,
21789    {
21790      allStatuses,
21791      isBrowsing,
21792      isMain,
21793      refId,
21794      data: index,
21795      docsMode: storybookState.docsOptions.docsMode,
21796      selectedStoryId,
21797      onSelectStoryId,
21798      highlightedRef,
21799      setHighlightedItemId
21800    }
21801  )));
21802});
21803
21804// src/manager/components/sidebar/useHighlighted.ts
21805init_react();
21806var { document: document6, window: globalWindow4 } = scope, fromSelection = (selection) => selection ? { itemId: selection.storyId, refId: selection.refId } : null, scrollToSelector = (selector, options2 = {}, _attempt = 1) => {
21807  let { containerRef, center = !1, attempts = 3, delay: delay2 = 500 } = options2, element = (containerRef ? containerRef.current : document6)?.querySelector(selector);
21808  element ? scrollIntoView(element, center) : _attempt <= attempts && setTimeout(scrollToSelector, delay2, selector, options2, _attempt + 1);
21809}, useHighlighted = ({
21810  containerRef,
21811  isLoading,
21812  isBrowsing,
21813  selected
21814}) => {
21815  let initialHighlight = fromSelection(selected), highlightedRef = useRef(initialHighlight), [highlighted, setHighlighted] = useState(initialHighlight), api = useStorybookApi(), updateHighlighted = useCallback(
21816    (highlight) => {
21817      highlightedRef.current = highlight, setHighlighted(highlight);
21818    },
21819    [highlightedRef]
21820  ), highlightElement = useCallback(
21821    (element, center = !1) => {
21822      let itemId = element.getAttribute("data-item-id"), refId = element.getAttribute("data-ref-id");
21823      !itemId || !refId || (updateHighlighted({ itemId, refId }), scrollIntoView(element, center));
21824    },
21825    [updateHighlighted]
21826  );
21827  return useEffect(() => {
21828    let highlight = fromSelection(selected);
21829    updateHighlighted(highlight), highlight && scrollToSelector(`[data-item-id="${highlight.itemId}"][data-ref-id="${highlight.refId}"]`, {
21830      containerRef,
21831      center: !0
21832    });
21833  }, [containerRef, selected, updateHighlighted]), useEffect(() => {
21834    let menuElement = document6.getElementById("storybook-explorer-menu"), lastRequestId, navigateTree = (event) => {
21835      if (isLoading || !isBrowsing || !containerRef.current || !matchesModifiers(!1, event))
21836        return;
21837      let isArrowUp = matchesKeyCode("ArrowUp", event), isArrowDown = matchesKeyCode("ArrowDown", event);
21838      if (!(isArrowUp || isArrowDown))
21839        return;
21840      let requestId = globalWindow4.requestAnimationFrame(() => {
21841        globalWindow4.cancelAnimationFrame(lastRequestId), lastRequestId = requestId;
21842        let target = event.target;
21843        if (!isAncestor(menuElement, target) && !isAncestor(target, menuElement))
21844          return;
21845        target.hasAttribute("data-action") && target.blur();
21846        let highlightable = Array.from(
21847          containerRef.current?.querySelectorAll("[data-highlightable=true]") || []
21848        ), currentIndex = highlightable.findIndex(
21849          (el) => el.getAttribute("data-item-id") === highlightedRef.current?.itemId && el.getAttribute("data-ref-id") === highlightedRef.current?.refId
21850        ), nextIndex = cycle2(highlightable, currentIndex, isArrowUp ? -1 : 1), didRunAround = isArrowUp ? nextIndex === highlightable.length - 1 : nextIndex === 0;
21851        if (highlightElement(highlightable[nextIndex], didRunAround), highlightable[nextIndex].getAttribute("data-nodetype") === "component") {
21852          let { itemId, refId } = highlightedRef.current, item = api.resolveStory(itemId, refId === "storybook_internal" ? void 0 : refId);
21853          item?.type === "component" && api.emit(PRELOAD_ENTRIES, {
21854            ids: [item.children[0]],
21855            options: { target: refId }
21856          });
21857        }
21858      });
21859    };
21860    return document6.addEventListener("keydown", navigateTree), () => document6.removeEventListener("keydown", navigateTree);
21861  }, [api, containerRef, isLoading, isBrowsing, highlightedRef, highlightElement]), [highlighted, updateHighlighted, highlightedRef];
21862};
21863
21864// src/manager/components/sidebar/Explorer.tsx
21865var Explorer = react_default.memo(function({
21866  hasEntries,
21867  isLoading,
21868  isBrowsing,
21869  isHidden,
21870  dataset,
21871  selected,
21872  ...restProps
21873}) {
21874  let containerRef = useRef(null), [highlighted, setHighlighted, highlightedRef] = useHighlighted({
21875    containerRef,
21876    isLoading,
21877    isBrowsing,
21878    selected
21879  }), { landmarkProps } = useLandmark(
21880    { "aria-labelledby": "storybook-explorer-tree-heading", role: "navigation" },
21881    containerRef
21882  );
21883  return react_default.createElement(
21884    "nav",
21885    {
21886      hidden: isHidden || void 0,
21887      "aria-hidden": isHidden || void 0,
21888      className: isBrowsing ? void 0 : "sb-sr-only",
21889      ref: containerRef,
21890      id: "storybook-explorer-tree",
21891      "data-highlighted-ref-id": highlighted?.refId,
21892      "data-highlighted-item-id": highlighted?.itemId,
21893      ...landmarkProps,
21894      ...restProps
21895    },
21896    react_default.createElement("h2", { id: "storybook-explorer-tree-heading", className: "sb-sr-only" }, "Stories"),
21897    highlighted && react_default.createElement(HighlightStyles, { ...highlighted }),
21898    dataset.entries.map(([refId, ref]) => react_default.createElement(
21899      Ref,
21900      {
21901        ...ref,
21902        key: refId,
21903        isLoading,
21904        isBrowsing,
21905        hasEntries,
21906        selectedStoryId: selected?.refId === ref.id ? selected.storyId : null,
21907        highlightedRef,
21908        setHighlighted
21909      }
21910    ))
21911  );
21912});
21913
21914// src/manager/components/sidebar/Heading.tsx
21915init_react();
21916
21917// src/manager/components/sidebar/Brand.tsx
21918init_react();
21919var StorybookLogoStyled = styled(StorybookLogo)(({ theme }) => ({
21920  width: "auto",
21921  height: "22px !important",
21922  display: "block",
21923  color: theme.base === "light" ? theme.color.defaultText : theme.color.lightest
21924})), Img2 = styled.img({
21925  display: "block",
21926  maxWidth: "150px !important",
21927  maxHeight: "100px"
21928}), LogoLink = styled.a(({ theme }) => ({
21929  display: "inline-flex",
21930  alignItems: "center",
21931  height: "100%",
21932  margin: "-3px -4px",
21933  padding: "2px 3px",
21934  border: "1px solid transparent",
21935  borderRadius: 3,
21936  color: "inherit",
21937  textDecoration: "none",
21938  "&:focus-visible": {
21939    outline: `2px solid ${theme.color.secondary}`,
21940    outlineOffset: 2
21941  }
21942})), Brand = withTheme(({ theme }) => {
21943  let { title: title2 = "Storybook", url = "./", image, target } = theme.brand, targetValue = target || (url === "./" ? "" : "_blank");
21944  if (image === null)
21945    return title2 === null ? null : url ? react_default.createElement(LogoLink, { href: url, target: targetValue, dangerouslySetInnerHTML: { __html: title2 } }) : react_default.createElement("div", { dangerouslySetInnerHTML: { __html: title2 } });
21946  let logo = image ? react_default.createElement(Img2, { src: image, alt: title2 }) : react_default.createElement(StorybookLogoStyled, { alt: title2 });
21947  return url ? react_default.createElement(LogoLink, { title: title2, href: url, target: targetValue }, logo) : react_default.createElement("div", null, logo);
21948});
21949
21950// src/manager/components/sidebar/Menu.tsx
21951init_react();
21952var buttonStyleAdditions = ({
21953  highlighted,
21954  isMobile: isMobile2,
21955  theme
21956}) => css`
21957  position: relative;
21958  overflow: visible;
21959  margin-top: 0;
21960  z-index: 1;
21961  ${isMobile2 && `
21962    width: 36px;
21963    height: 36px;
21964  `}
21965  ${highlighted && `
21966    &:before,
21967    &:after {
21968      content: '';
21969      position: absolute;
21970      top: 6px;
21971      right: 6px;
21972      width: 5px;
21973      height: 5px;
21974      z-index: 2;
21975      border-radius: 50%;
21976      background: ${theme.background.app};
21977      border: 1px solid ${theme.background.app};
21978      box-shadow: 0 0 0 2px ${theme.background.app};
21979    }
21980    &:after {
21981      background: ${theme.color.positive};
21982      border: 1px solid rgba(0, 0, 0, 0.1);
21983      box-shadow: 0 0 0 2px ${theme.background.app};
21984    }
21985    &:hover:after,
21986    &:focus-visible:after {
21987      box-shadow: 0 0 0 2px ${curriedTransparentize$1(0.88, theme.color.secondary)};
21988    }
21989  `}
21990`, Container10 = styled.div({
21991  minWidth: 250
21992}), SidebarButton = styled(Button)(buttonStyleAdditions), SidebarToggleButton = styled(ToggleButton)(buttonStyleAdditions), MenuButtonGroup = styled.div({
21993  display: "flex",
21994  gap: 6
21995}), SidebarMenuList = ({ menu, onHide }) => react_default.createElement(Container10, null, menu.filter((links) => links.length).flatMap((links) => react_default.createElement(ActionList, { key: links.map((link) => link.id).join("_") }, links.map((link) => {
21996  let linkContent = react_default.createElement(react_default.Fragment, null, (link.icon || link.input) && react_default.createElement(ActionList.Icon, null, link.icon || link.input), (link.title || link.center) && react_default.createElement(ActionList.Text, null, link.title || link.center), link.right);
21997  return react_default.createElement(ActionList.Item, { key: link.id, active: link.active }, react_default.createElement(
21998    ActionList.Action,
21999    {
22000      asChild: !!link.href,
22001      ariaLabel: !1,
22002      id: `list-item-${link.id}`,
22003      disabled: link.disabled,
22004      onClick: (e2) => {
22005        if (link.disabled) {
22006          e2.preventDefault();
22007          return;
22008        }
22009        link.href && link.internal && e2.preventDefault(), link.onClick?.(e2, {
22010          id: link.id,
22011          active: link.active,
22012          disabled: link.disabled,
22013          title: link.title,
22014          href: link.href
22015        }), link.closeOnClick && onHide();
22016      }
22017    },
22018    link.href ? react_default.createElement(
22019      "a",
22020      {
22021        href: link.href,
22022        target: link.internal ? void 0 : "_blank",
22023        rel: link.internal ? "canonical" : "noreferrer"
22024      },
22025      linkContent
22026    ) : linkContent
22027  ));
22028})))), SidebarMenu = ({ menu, isHighlighted, onClick }) => {
22029  let [isTooltipVisible, setIsTooltipVisible] = useState(!1), { isMobile: isMobile2
22029, setMobileMenuOpen } = useLayout();
22030  return isMobile2 ? react_default.createElement(MenuButtonGroup, null, react_default.createElement(
22031    SidebarButton,
22032    {
22033      padding: "small",
22034      variant: "ghost",
22035      ariaLabel: "About Storybook",
22036      highlighted: !!isHighlighted,
22037      onClick: (e2) => {
22038        onClick?.(e2), e2.preventDefault();
22039      },
22040      isMobile: !0,
22041      asChild: !0
22042    },
22043    react_default.createElement("a", { href: "./?path=/settings/about", rel: "canonical" }, react_default.createElement(CogIcon, null))
22044  ), react_default.createElement(
22045    SidebarButton,
22046    {
22047      padding: "small",
22048      variant: "ghost",
22049      ariaLabel: "Close menu",
22050      highlighted: !1,
22051      onClick: () => setMobileMenuOpe
vendor: 2,580 bytes, lines 22051-22145
22051n(!1),
22052      isMobile: !0
22053    },
22054    react_default.createElement(CloseIcon, null)
22055  )) : react_default.createElement(
22056    PopoverProvider,
22057    {
22058      ariaLabel: "Storybook menu",
22059      placement: "bottom-start",
22060      padding: 0,
22061      popover: ({ onHide }) => react_default.createElement(SidebarMenuList, { onHide, menu }),
22062      onVisibleChange: setIsTooltipVisible
22063    },
22064    react_default.createElement(
22065      SidebarToggleButton,
22066      {
22067        ariaLabel: "Settings",
22068        pressed: isTooltipVisible,
22069        highlighted: !!isHighlighted,
22070        padding: "small",
22071        variant: "ghost",
22072        size: "medium",
22073        isMobile: !1
22074      },
22075      react_default.createElement(CogIcon, null)
22076    )
22077  );
22078};
22079
22080// src/manager/components/sidebar/Heading.tsx
22081var BrandArea = styled.div(({ theme }) => ({
22082  fontSize: theme.typography.size.s2,
22083  fontWeight: theme.typography.weight.bold,
22084  color: theme.color.defaultText,
22085  marginRight: 20,
22086  display: "flex",
22087  width: "100%",
22088  alignItems: "center",
22089  minHeight: 22,
22090  "& > * > *": {
22091    maxWidth: "100%"
22092  },
22093  "& > *": {
22094    maxWidth: "100%",
22095    height: "auto",
22096    display: "block",
22097    flex: "1 1 auto"
22098  }
22099})), HeadingWrapper = styled.div({
22100  display: "flex",
22101  alignItems: "center",
22102  justifyContent: "space-between",
22103  position: "relative",
22104  minHeight: 42,
22105  paddingLeft: 8
22106}), SkipToCanvasLink = styled(Button)(({ theme }) => ({
22107  display: "none",
22108  "@media (min-width: 600px)": {
22109    display: "block",
22110    position: "absolute",
22111    fontSize: theme.typography.size.s1,
22112    border: 0,
22113    width: 1,
22114    height: 1,
22115    padding: 0,
22116    margin: -1,
22117    overflow: "hidden",
22118    clip: "rect(0, 0, 0, 0)",
22119    whiteSpace: "nowrap",
22120    wordWrap: "normal",
22121    opacity: 0,
22122    transition: "opacity 150ms ease-out",
22123    "&:focus": {
22124      width: "100%",
22125      height: "inherit",
22126      padding: "10px 15px",
22127      margin: 0,
22128      clip: "unset",
22129      overflow: "unset",
22130      opacity: 1,
22131      zIndex: 3
22132    }
22133  }
22134})), Heading2 = ({
22135  menuHighlighted = !1,
22136  menu,
22137  skipLinkHref,
22138  isLoading,
22139  onMenuClick,
22140  ...props
22141}) => react_default.createElement(HeadingWrapper, { ...props }, skipLinkHref && react_default.createElement(SkipToCanvasLink, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: skipLinkHref, tabIndex: 0 }, "Skip to content")), react_default.createElement(BrandArea, null, react_default.createElement(Brand, null)), react_default.createElement(SidebarMenu, { menu, isHighlighted: menuHighlighted, onClick: onMenuClick }));
22142
22143// src/manager/components/sidebar/Search.tsx
22144init_react();
22145
vendor: 316 bytes, lines 22146-22156
22146// ../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
22147function _objectWithoutPropertiesLoose2(r4, e2) {
22148  if (r4 == null) return {};
22149  var t2 = {};
22150  for (var n3 in r4) if ({}.hasOwnProperty.call(r4, n3)) {
22151    if (e2.indexOf(n3) !== -1) continue;
22152    t2[n3] = r4[n3];
22153  }
22154  return t2;
22155}
22156
vendor: 176 bytes, lines 22157-22161
22157// ../../node_modules/downshift/dist/downshift.esm.js
22158var import_prop_types3 = __toESM(require_prop_types());
22159init_react();
22160var import_react_is = __toESM(require_react_is());
22161
vendor: 4,403 bytes, lines 22162-22213
22162// ../../node_modules/compute-scroll-into-view/dist/index.js
22163var t = (t2) => typeof t2 == "object" && t2 != null && t2.nodeType === 1, e = (t2, e2) => (!e2 || t2 !== "hidden") && t2 !== "visible" && t2 !== "clip", n2 = (t2, n3) => {
22164  if (t2.clientHeight < t2.scrollHeight || t2.clientWidth < t2.scrollWidth) {
22165    let o3 = getComputedStyle(t2, null);
22166    return e(o3.overflowY, n3) || e(o3.overflowX, n3) || ((t3) => {
22167      let e2 = ((t4) => {
22168        if (!t4.ownerDocument || !t4.ownerDocument.defaultView) return null;
22169        try {
22170          return t4.ownerDocument.defaultView.frameElement;
22171        } catch {
22172          return null;
22173        }
22174      })(t3);
22175      return !!e2 && (e2.clientHeight < t3.scrollHeight || e2.clientWidth < t3.scrollWidth);
22176    })(t2);
22177  }
22178  return !1;
22179}, o2 = (t2, e2, n3, o3, l3, r4, i2, s2) => r4 < t2 && i2 > e2 || r4 > t2 && i2 < e2 ? 0 : r4 <= t2 && s2 <= n3 || i2 >= e2 && s2 >= n3 ? r4 - t2 - o3 : i2 > e2 && s2 < n3 || r4 < t2 && s2 > n3 ? i2 - e2 + l3 : 0, l2 = (t2) => {
22180  let e2 = t2.parentElement;
22181  return e2 ?? (t2.getRootNode().host || null);
22182}, r3 = (e2, r4) => {
22183  var i2, s2, d2, h2;
22184  if (typeof document > "u") return [];
22185  let { scrollMode: c2, block: f2, inline: u2, boundary: a2, skipOverflowHiddenElements: g2 } = r4, p2 = typeof a2 == "function" ? a2 : (t2) => t2 !== a2;
22186  if (!t(e2)) throw new TypeError("Invalid target");
22187  let m2 = document.scrollingElement || document.documentElement, w2 = [], W2 = e2;
22188  for (; t(W2) && p2(W2); ) {
22189    if (W2 = l2(W2), W2 === m2) {
22190      w2.push(W2);
22191      break;
22192    }
22193    W2 != null && W2 === document.body && n2(W2) && !n2(document.documentElement) || W2 != null && n2(W2, g2) && w2.push(W2);
22194  }
22195  let b2 = (s2 = (i2 = window.visualViewport) == null ? void 0 : i2.width) != null ? s2 : innerWidth, H7 = (h2 = (d2 = window.visualViewport) == null ? void 0 : d2.height) != null ? h2 : innerHeight, { scrollX: y2, scrollY: M2 } = window, { height: v2, width: E2, top: x2, right: C2, bottom: I2, left: R2 } = e2.getBoundingClientRect(), { top: T3, right: B2, bottom: F2, left: V } = ((t2) => {
22196    let e3 = window.getComputedStyle(t2);
22197    return { top: parseFloat(e3.scrollMarginTop) || 0, right: parseFloat(e3.scrollMarginRight) || 0, bottom: parseFloat(e3.scrollMarginBottom) || 0, left: parseFloat(e3.scrollMarginLeft) || 0 };
22198  })(e2), k2 = f2 === "start" || f2 === "nearest" ? x2 - T3 : f2 === "end" ? I2 + F2 : x2 + v2 / 2 - T3 + F2, D2 = u2 === "center" ? R2 + E2 / 2 - V + B2 : u2 === "end" ? C2 + B2 : R2 - V, L3 = [];
22199  for (let t2 = 0; t2 < w2.length; t2++) {
22200    let e3 = w2[t2], { height: l3, width: r5, top: i3, right: s3, bottom: d3, left: h3 } = e3.getBoundingClientRect();
22201    if (c2 === "if-needed" && x2 >= 0 && R2 >= 0 && I2 <= H7 && C2 <= b2 && (e3 === m2 && !n2(e3) || x2 >= i3 && I2 <= d3 && R2 >= h3 && C2 <= s3)) return L3;
22202    let a3 = getComputedStyle(e3), g3 = parseInt(a3.borderLeftWidth, 10), p3 = parseInt(a3.borderTopWidth, 10), W3 = parseInt(a3.borderRightWidth, 10), T4 = parseInt(a3.borderBottomWidth, 10), B3 = 0, F3 = 0, V2 = "offsetWidth" in e3 ? e3.offsetWidth - e3.clientWidth - g3 - W3 : 0, S2 = "offsetHeight" in e3 ? e3.offsetHeight - e3.clientHeight - p3 - T4 : 0, X = "offsetWidth" in e3 ? e3.offsetWidth === 0 ? 0 : r5 / e3.offsetWidth : 0, Y2 = "offsetHeight" in e3 ? e3.offsetHeight === 0 ? 0 : l3 / e3.offsetHeight : 0;
22203    if (m2 === e3) B3 = f2 === "start" ? k2 : f2 === "end" ? k2 - H7 : f2 === "nearest" ? o2(M2, M2 + H7, H7, p3, T4, M2 + k2, M2 + k2 + v2, v2) : k2 - H7 / 2, F3 = u2 === "start" ? D2 : u2 === "center" ? D2 - b2 / 2 : u2 === "end" ? D2 - b2 : o2(y2, y2 + b2, b2, g3, W3, y2 + D2, y2 + D2 + E2, E2), B3 = Math.max(0, B3 + M2), F3 = Math.max(0, F3 + y2);
22204    else {
22205      B3 = f2 === "start" ? k2 - i3 - p3 : f2 === "end" ? k2 - d3 + T4 + S2 : f2 === "nearest" ? o2(i3, d3, l3, p3, T4 + S2, k2, k2 + v2, v2) : k2 - (i3 + l3 / 2) + S2 / 2, F3 = u2 === "start" ? D2 - h3 - g3 : u2 === "center" ? D2 - (h3 + r5 / 2) + V2 / 2 : u2 === "end" ? D2 - s3 + W3 + V2 : o2(h3, s3, r5, g3, W3 + V2, D2, D2 + E2, E2);
22206      let { scrollLeft: t3, scrollTop: n3 } = e3;
22207      B3 = Y2 === 0 ? 0 : Math.max(0, Math.min(n3 + B3 / Y2, e3.scrollHeight - l3 / Y2 + S2)), F3 = X === 0 ? 0 : Math.max(0, Math.min(t3 + F3 / X, e3.scrollWidth - r5 / X + V2)), k2 += n3 - B3, D2 += t3 - F3;
22208    }
22209    L3.push({ el: e3, top: B3, left: F3 });
22210  }
22211  return L3;
22212};
22213
vendor: 101,124 bytes, lines 22214-24202
22214// ../../node_modules/downshift/dist/downshift.esm.js
22215var idCounter = 0;
22216function cbToCb(cb) {
22217  return typeof cb == "function" ? cb : noop4;
22218}
22219function noop4() {
22220}
22221function scrollIntoView2(node, menuNode) {
22222  if (node) {
22223    var actions = r3(node, {
22224      boundary: menuNode,
22225      block: "nearest",
22226      scrollMode: "if-needed"
22227    });
22228    actions.forEach(function(_ref) {
22229      var el = _ref.el, top = _ref.top, left = _ref.left;
22230      el.scrollTop = top, el.scrollLeft = left;
22231    });
22232  }
22233}
22234function isOrContainsNode(parent, child, environment) {
22235  var result = parent === child || child instanceof environment.Node && parent.contains && parent.contains(child);
22236  return result;
22237}
22238function debounce4(fn, time) {
22239  var timeoutId;
22240  function cancel() {
22241    timeoutId && clearTimeout(timeoutId);
22242  }
22243  function wrapper() {
22244    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
22245      args[_key] = arguments[_key];
22246    cancel(), timeoutId = setTimeout(function() {
22247      timeoutId = null, fn.apply(void 0, args);
22248    }, time);
22249  }
22250  return wrapper.cancel = cancel, wrapper;
22251}
22252function callAllEventHandlers() {
22253  for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++)
22254    fns[_key2] = arguments[_key2];
22255  return function(event) {
22256    for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++)
22257      args[_key3 - 1] = arguments[_key3];
22258    return fns.some(function(fn) {
22259      return fn && fn.apply(void 0, [event].concat(args)), event.preventDownshiftDefault || event.hasOwnProperty("nativeEvent") && event.nativeEvent.preventDownshiftDefault;
22260    });
22261  };
22262}
22263function handleRefs() {
22264  for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++)
22265    refs[_key4] = arguments[_key4];
22266  return function(node) {
22267    refs.forEach(function(ref) {
22268      typeof ref == "function" ? ref(node) : ref && (ref.current = node);
22269    });
22270  };
22271}
22272function generateId() {
22273  return String(idCounter++);
22274}
22275function getA11yStatusMessage(_ref2) {
22276  var isOpen = _ref2.isOpen, resultCount = _ref2.resultCount, previousResultCount = _ref2.previousResultCount;
22277  return isOpen ? resultCount ? resultCount !== previousResultCount ? resultCount + " result" + (resultCount === 1 ? " is" : "s are") + " available, use up and down arrow keys to navigate. Press Enter key to select." : "" : "No results are available." : "";
22278}
22279function unwrapArray(arg, defaultValue) {
22280  return arg = Array.isArray(arg) ? (
22281    /* istanbul ignore next (preact) */
22282    arg[0]
22283  ) : arg, !arg && defaultValue ? defaultValue : arg;
22284}
22285function isDOMElement(element) {
22286  return typeof element.type == "string";
22287}
22288function getElementProps(element) {
22289  return element.props;
22290}
22291var stateKeys = ["highlightedIndex", "inputValue", "isOpen", "selectedItem", "type"];
22292function pickState(state) {
22293  state === void 0 && (state = {});
22294  var result = {};
22295  return stateKeys.forEach(function(k2) {
22296    state.hasOwnProperty(k2) && (result[k2] = state[k2]);
22297  }), result;
22298}
22299function getState2(state, props) {
22300  return !state || !props ? state : Object.keys(state).reduce(function(prevState, key) {
22301    return prevState[key] = isControlledProp(props, key) ? props[key] : state[key], prevState;
22302  }, {});
22303}
22304function isControlledProp(props, key) {
22305  return props[key] !== void 0;
22306}
22307function normalizeArrowKey(event) {
22308  var key = event.key, keyCode = event.keyCode;
22309  return keyCode >= 37 && keyCode <= 40 && key.indexOf("Arrow") !== 0 ? "Arrow" + key : key;
22310}
22311function getHighlightedIndex(start, offset2, items, isItemDisabled2, circular) {
22312  circular === void 0 && (circular = !1);
22313  var count = items.length;
22314  if (count === 0)
22315    return -1;
22316  var itemsLastIndex = count - 1;
22317  (typeof start != "number" || start < 0 || start > itemsLastIndex) && (start = offset2 > 0 ? -1 : itemsLastIndex + 1);
22318  var current = start + offset2;
22319  current < 0 ? current = circular ? itemsLastIndex : 0 : current > itemsLastIndex && (current = circular ? 0 : itemsLastIndex);
22320  var highlightedIndex = getNonDisabledIndex(current, offset2 < 0, items, isItemDisabled2, circular);
22321  return highlightedIndex === -1 ? start >= count ? -1 : start : highlightedIndex;
22322}
22323function getNonDisabledIndex(start, backwards, items, isItemDisabled2, circular) {
22324  circular === void 0 && (circular = !1);
22325  var count = items.length;
22326  if (backwards) {
22327    for (var index = start; index >= 0; index--)
22328      if (!isItemDisabled2(items[index], index))
22329        return index;
22330  } else
22331    for (var _index = start; _index < count; _index++)
22332      if (!isItemDisabled2(items[_index], _index))
22333        return _index;
22334  return circular ? getNonDisabledIndex(backwards ? count - 1 : 0, backwards, items, isItemDisabled2) : -1;
22335}
22336function targetWithinDownshift(target, downshiftElements, environment, checkActiveElement) {
22337  return checkActiveElement === void 0 && (checkActiveElement = !0), environment && downshiftElements.some(function(contextNode) {
22338    return contextNode && (isOrContainsNode(contextNode, target, environment) || checkActiveElement && isOrContainsNode(contextNode, environment.document.activeElement, environment));
22339  });
22340}
22341var cleanupStatus = debounce4(function(documentProp) {
22342  getStatusDiv(documentProp).textContent = "";
22343}, 500);
22344function getStatusDiv(documentProp) {
22345  var statusDiv = documentProp.getElementById("a11y-status-message");
22346  return statusDiv || (statusDiv = documentProp.createElement("div"), statusDiv.setAttribute("id", "a11y-status-message"), statusDiv.setAttribute("role", "status"), statusDiv.setAttribute("aria-live", "polite"), statusDiv.setAttribute("aria-relevant", "additions text"), Object.assign(statusDiv.style, {
22347    border: "0",
22348    clip: "rect(0 0 0 0)",
22349    height: "1px",
22350    margin: "-1px",
22351    overflow: "hidden",
22352    padding: "0",
22353    position: "absolute",
22354    width: "1px"
22355  }), documentProp.body.appendChild(statusDiv), statusDiv);
22356}
22357function setStatus(status, documentProp) {
22358  if (!(!status || !documentProp)) {
22359    var div = getStatusDiv(documentProp);
22360    div.textContent = status, cleanupStatus(documentProp);
22361  }
22362}
22363function cleanupStatusDiv(documentProp) {
22364  var statusDiv = documentProp?.getElementById("a11y-status-message");
22365  statusDiv && statusDiv.remove();
22366}
22367var unknown = 0, mouseUp = 1, itemMouseEnter = 2, keyDownArrowUp = 3, keyDownArrowDown = 4, keyDownEscape = 5, keyDownEnter = 6, keyDownHome = 7, keyDownEnd = 8, clickItem = 9, blurInput = 10, changeInput = 11, keyDownSpaceButton = 12, clickButton = 13, blurButton = 14, controlledPropUpdatedSelectedItem = 15, touchEnd = 16, stateChangeTypes$3 = Object.freeze({
22368  __proto__: null,
22369  blurButton,
22370  blurInput,
22371  changeInput,
22372  clickButton,
22373  clickItem,
22374  controlledPropUpdatedSelectedItem,
22375  itemMouseEnter,
22376  keyDownArrowDown,
22377  keyDownArrowUp,
22378  keyDownEnd,
22379  keyDownEnter,
22380  keyDownEscape,
22381  keyDownHome,
22382  keyDownSpaceButton,
22383  mouseUp,
22384  touchEnd,
22385  unknown
22386}), _excluded$3 = ["refKey", "ref"], _excluded2$3 = ["onClick", "onPress", "onKeyDown", "onKeyUp", "onBlur"], _excluded3$2 = ["onKeyDown", "onBlur", "onChange", "onInput", "onChangeText"], _excluded4$2 = ["refKey", "ref"], _excluded5 = ["onMouseMove", "onMouseDown", "onClick", "onPress", "index", "item"], Downshift = (function() {
22387  var Downshift2 = (function(_Component) {
22388    function Downshift3(_props) {
22389      var _this;
22390      _this = _Component.call(this, _props) || this, _this.id = _this.props.id || "downshift-" + generateId(), _this.menuId = _this.props.menuId || _this.id + "-menu", _this.labelId = _this.props.labelId || _this.id + "-label", _this.inputId = _this.props.inputId || _this.id + "-input", _this.getItemId = _this.props.getItemId || function(index) {
22391        return _this.id + "-item-" + index;
22392      }, _this.items = [], _this.itemCount = null, _this.previousResultCount = 0, _this.timeoutIds = [], _this.internalSetTimeout = function(fn, time) {
22393        var id = setTimeout(function() {
22394          _this.timeoutIds = _this.timeoutIds.filter(function(i2) {
22395            return i2 !== id;
22396          }), fn();
22397        }, time);
22398        _this.timeoutIds.push(id);
22399      }, _this.setItemCount = function(count) {
22400        _this.itemCount = count;
22401      }, _this.unsetItemCount = function() {
22402        _this.itemCount = null;
22403      }, _this.isItemDisabled = function(_item, index) {
22404        var currentElementNode = _this.getItemNodeFromIndex(index);
22405        return currentElementNode && currentElementNode.hasAttribute("disabled");
22406      }, _this.setHighlightedIndex = function(highlightedIndex, otherStateToSet) {
22407        highlightedIndex === void 0 && (highlightedIndex = _this.props.defaultHighlightedIndex), otherStateToSet === void 0 && (otherStateToSet = {}), otherStateToSet = pickState(otherStateToSet), _this.internalSetState(_extends({
22408          highlightedIndex
22409        }, otherStateToSet));
22410      }, _this.clearSelection = function(cb) {
22411        _this.internalSetState({
22412          selectedItem: null,
22413          inputValue: "",
22414          highlightedIndex: _this.props.defaultHighlightedIndex,
22415          isOpen: _this.props.defaultIsOpen
22416        }, cb);
22417      }, _this.selectItem = function(item, otherStateToSet, cb) {
22418        otherStateToSet = pickState(otherStateToSet), _this.internalSetState(_extends({
22419          isOpen: _this.props.defaultIsOpen,
22420          highlightedIndex: _this.props.defaultHighlightedIndex,
22421          selectedItem: item,
22422          inputValue: _this.props.itemToString(item)
22423        }, otherStateToSet), cb);
22424      }, _this.selectItemAtIndex = function(itemIndex, otherStateToSet, cb) {
22425        var item = _this.items[itemIndex];
22426        item != null && _this.selectItem(item, otherStateToSet, cb);
22427      }, _this.selectHighlightedItem = function(otherStateToSet, cb) {
22428        return _this.selectItemAtIndex(_this.getState().highlightedIndex, otherStateToSet, cb);
22429      }, _this.internalSetState = function(stateToSet, cb) {
22430        var isItemSelected, onChangeArg, onStateChangeArg = {}, isStateToSetFunction = typeof stateToSet == "function";
22431        return !isStateToSetFunction && stateToSet.hasOwnProperty("inputValue") && _this.props.onInputValueChange(stateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), stateToSet)), _this.setState(function(state) {
22432          var _newStateToSet;
22433          state = _this.getState(state);
22434          var newStateToSet = isStateToSetFunction ? stateToSet(state) : stateToSet;
22435          newStateToSet = _this.props.stateReducer(state, newStateToSet), isItemSelected = newStateToSet.hasOwnProperty("selectedItem");
22436          var nextState = {};
22437          return isItemSelected && newStateToSet.selectedItem !== state.selectedItem && (onChangeArg = newStateToSet.selectedItem), (_newStateToSet = newStateToSet).type || (_newStateToSet.type = unknown), Object.keys(newStateToSet).forEach(function(key) {
22438            state[key] !== newStateToSet[key] && (onStateChangeArg[key] = newStateToSet[key]), key !== "type" && (newStateToSet[key], isControlledProp(_this.props, key) || (nextState[key] = newStateToSet[key]));
22439          }), isStateToSetFunction && newStateToSet.hasOwnProperty("inputValue") && _this.props.onInputValueChange(newStateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), newStateToSet)), nextState;
22440        }, function() {
22441          cbToCb(cb)();
22442          var hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1;
22443          hasMoreStateThanType && _this.props.onStateChange(onStateChangeArg, _this.getStateAndHelpers()), isItemSelected && _this.props.onSelect(stateToSet.selectedItem, _this.getStateAndHelpers()), onChangeArg !== void 0 && _this.props.onChange(onChangeArg, _this.getStateAndHelpers()), _this.props.onUserAction(onStateChangeArg, _this.getStateAndHelpers());
22444        });
22445      }, _this.rootRef = function(node) {
22446        return _this._rootNode = node;
22447      }, _this.getRootProps = function(_temp, _temp2) {
22448        var _extends22, _ref = _temp === void 0 ? {} : _temp, _ref$refKey = _ref.refKey, refKey = _ref$refKey === void 0 ? "ref" : _ref$refKey, ref = _ref.ref, rest2 = _objectWithoutPropertiesLoose2(_ref, _excluded$3), _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$suppressRefErro = _ref2.suppressRefError, suppressRefError = _ref2$suppressRefErro === void 0 ? !1 : _ref2$suppressRefErro;
22449        _this.getRootProps.called = !0, _this.getRootProps.refKey = refKey, _this.getRootProps.suppressRefError = suppressRefError;
22450        var _this$getState = _this.getState(), isOpen = _this$getState.isOpen;
22451        return _extends((_extends22 = {}, _extends22[refKey] = handleRefs(ref, _this.rootRef), _extends22.role = "combobox", _extends22["aria-expanded"] = isOpen, _extends22["aria-haspopup"] = "listbox", _extends22["aria-owns"] = isOpen ? _this.menuId : void 0, _extends22["aria-labelledby"] = _this.labelId, _extends22), rest2);
22452      }, _this.keyDownHandlers = {
22453        ArrowDown: function(event) {
22454          var _this2 = this;
22455          if (event.preventDefault(), this.getState().isOpen) {
22456            var amount = event.shiftKey ? 5 : 1;
22457            this.moveHighlightedIndex(amount, {
22458              type: keyDownArrowDown
22459            });
22460          } else
22461            this.internalSetState({
22462              isOpen: !0,
22463              type: keyDownArrowDown
22464            }, function() {
22465              var itemCount = _this2.getItemCount();
22466              if (itemCount > 0) {
22467                var _this2$getState = _this2.getState(), highlightedIndex = _this2$getState.highlightedIndex, nextHighlightedIndex = getHighlightedIndex(highlightedIndex, 1, {
22468                  length: itemCount
22469                }, _this2.isItemDisabled, !0);
22470                _this2.setHighlightedIndex(nextHighlightedIndex, {
22471                  type: keyDownArrowDown
22472                });
22473              }
22474            });
22475        },
22476        ArrowUp: function(event) {
22477          var _this3 = this;
22478          if (event.preventDefault(), this.getState().isOpen) {
22479            var amount = event.shiftKey ? -5 : -1;
22480            this.moveHighlightedIndex(amount, {
22481              type: keyDownArrowUp
22482            });
22483          } else
22484            this.internalSetState({
22485              isOpen: !0,
22486              type: keyDownArrowUp
22487            }, function() {
22488              var itemCount = _this3.getItemCount();
22489              if (itemCount > 0) {
22490                var _this3$getState = _this3.getState(), highlightedIndex = _this3$getState.highlightedIndex, nextHighlightedIndex = getHighlightedIndex(highlightedIndex, -1, {
22491                  length: itemCount
22492                }, _this3.isItemDisabled, !0);
22493                _this3.setHighlightedIndex(nextHighlightedIndex, {
22494                  type: keyDownArrowUp
22495                });
22496              }
22497            });
22498        },
22499        Enter: function(event) {
22500          if (event.which !== 229) {
22501            var _this$getState2 = this.getState(), isOpen = _this$getState2.isOpen, highlightedIndex = _this$getState2.highlightedIndex;
22502            if (isOpen && highlightedIndex != null) {
22503              event.preventDefault();
22504              var item = this.items[highlightedIndex], itemNode = this.getItemNodeFromIndex(highlightedIndex);
22505              if (item == null || itemNode && itemNode.hasAttribute("disabled"))
22506                return;
22507              this.selectHighlightedItem({
22508                type: keyDownEnter
22509              });
22510            }
22511          }
22512        },
22513        Escape: function(event) {
22514          event.preventDefault(), this.reset(_extends({
22515            type: keyDownEscape
22516          }, !this.state.isOpen && {
22517            selectedItem: null,
22518            inputValue: ""
22519          }));
22520        }
22521      }, _this.buttonKeyDownHandlers = _extends({}, _this.keyDownHandlers, {
22522        " ": function(event) {
22523          event.preventDefault(), this.toggleMenu({
22524            type: keyDownSpaceButton
22525          });
22526        }
22527      }), _this.inputKeyDownHandlers = _extends({}, _this.keyDownHandlers, {
22528        Home: function(event) {
22529          var _this$getState3 = this.getState(), isOpen = _this$getState3.isOpen;
22530          if (isOpen) {
22531            event.preventDefault();
22532            var itemCount = this.getItemCount();
22533            if (!(itemCount <= 0 || !isOpen)) {
22534              var newHighlightedIndex = getNonDisabledIndex(0, !1, {
22535                length: itemCount
22536              }, this.isItemDisabled);
22537              this.setHighlightedIndex(newHighlightedIndex, {
22538                type: keyDownHome
22539              });
22540            }
22541          }
22542        },
22543        End: function(event) {
22544          var _this$getState4 = this.getState(), isOpen = _this$getState4.isOpen;
22545          if (isOpen) {
22546            event.preventDefault();
22547            var itemCount = this.getItemCount();
22548            if (!(itemCount <= 0 || !isOpen)) {
22549              var newHighlightedIndex = getNonDisabledIndex(itemCount - 1, !0, {
22550                length: itemCount
22551              }, this.isItemDisabled);
22552              this.setHighlightedIndex(newHighlightedIndex, {
22553                type: keyDownEnd
22554              });
22555            }
22556          }
22557        }
22558      }), _this.getToggleButtonProps = function(_temp3) {
22559        var _ref3 = _temp3 === void 0 ? {} : _temp3, onClick = _ref3.onClick;
22560        _ref3.onPress;
22561        var onKeyDown = _ref3.onKeyDown, onKeyUp = _ref3.onKeyUp, onBlur = _ref3.onBlur, rest2 = _objectWithoutPropertiesLoose2(_ref3, _excluded2$3), _this$getState5 = _this.getState(), isOpen = _this$getState5.isOpen, enabledEventHandlers = {
22562          onClick: callAllEventHandlers(onClick, _this.buttonHandleClick),
22563          onKeyDown: callAllEventHandlers(onKeyDown, _this.buttonHandleKeyDown),
22564          onKeyUp: callAllEventHandlers(onKeyUp, _this.buttonHandleKeyUp),
22565          onBlur: callAllEventHandlers(onBlur, _this.buttonHandleBlur)
22566        }, eventHandlers = rest2.disabled ? {} : enabledEventHandlers;
22567        return _extends({
22568          type: "button",
22569          role: "button",
22570          "aria-label": isOpen ? "close menu" : "open menu",
22571          "aria-haspopup": !0,
22572          "data-toggle": !0
22573        }, eventHandlers, rest2);
22574      }, _this.buttonHandleKeyUp = function(event) {
22575        event.preventDefault();
22576      }, _this.buttonHandleKeyDown = function(event) {
22577        var key = normalizeArrowKey(event);
22578        _this.buttonKeyDownHandlers[key] && _this.buttonKeyDownHandlers[key].call(_this, event);
22579      }, _this.buttonHandleClick = function(event) {
22580        if (event.preventDefault(), _this.props.environment) {
22581          var _this$props$environme = _this.props.environment.document, body = _this$props$environme.body, activeElement = _this$props$environme.activeElement;
22582          body && body === activeElement && event.target.focus();
22583        }
22584        _this.internalSetTimeout(function() {
22585          return _this.toggleMenu({
22586            type: clickButton
22587          });
22588        });
22589      }, _this.buttonHandleBlur = function(event) {
22590        var blurTarget = event.target;
22591        _this.internalSetTimeout(function() {
22592          if (!(_this.isMouseDown || !_this.props.environment)) {
22593            var activeElement = _this.props.environment.document.activeElement;
22594            (activeElement == null || activeElement.id !== _this.inputId) && activeElement !== blurTarget && _this.reset({
22595              type: blurButton
22596            });
22597          }
22598        });
22599      }, _this.getLabelProps = function(props) {
22600        return _extends({
22601          htmlFor: _this.inputId,
22602          id: _this.labelId
22603        }, props);
22604      }, _this.getInputProps = function(_temp4) {
22605        var _ref4 = _temp4 === void 0 ? {} : _temp4, onKeyDown = _ref4.onKeyDown, onBlur = _ref4.onBlur, onChange = _ref4.onChange, onInput = _ref4.onInput;
22606        _ref4.onChangeText;
22607        var rest2 = _objectWithoutPropertiesLoose2(_ref4, _excluded3$2), onChangeKey, eventHandlers = {};
22608        onChangeKey = "onChange";
22609        var _this$getState6 = _this.getState(), inputValue = _this$getState6.inputValue, isOpen = _this$getState6.isOpen, highlightedIndex = _this$getState6.highlightedIndex;
22610        if (!rest2.disabled) {
22611          var _eventHandlers;
22612          eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, _this.inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, _this.inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, _this.inputHandleBlur), _eventHandlers);
22613        }
22614        return _extends({
22615          "aria-autocomplete": "list",
22616          "aria-activedescendant": isOpen && typeof highlightedIndex == "number" && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : void 0,
22617          "aria-controls": isOpen ? _this.menuId : void 0,
22618          "aria-labelledby": rest2 && rest2["aria-label"] ? void 0 : _this.labelId,
22619          // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
22620          // revert back since autocomplete="nope" is ignored on latest Chrome and Opera
22621          autoComplete: "off",
22622          value: inputValue,
22623          id: _this.inputId
22624        }, eventHandlers, rest2);
22625      }, _this.inputHandleKeyDown = function(event) {
22626        var key = normalizeArrowKey(event);
22627        key && _this.inputKeyDownHandlers[key] && _this.inputKeyDownHandlers[key].call(_this, event);
22628      }, _this.inputHandleChange = function(event) {
22629        _this.internalSetState({
22630          type: changeInput,
22631          isOpen: !0,
22632          inputValue: event.target.value,
22633          highlightedIndex: _this.props.defaultHighlightedIndex
22634        });
22635      }, _this.inputHandleBlur = function() {
22636        _this.internalSetTimeout(function() {
22637          var _activeElement$datase;
22638          if (!(_this.isMouseDown || !_this.props.environment)) {
22639            var activeElement = _this.props.environment.document.activeElement, downshiftButtonIsActive = (activeElement == null || (_activeElement$datase = activeElement.dataset) == null ? void 0 : _activeElement$datase.toggle) && _this._rootNode && _this._rootNode.contains(activeElement);
22640            downshiftButtonIsActive || _this.reset({
22641              type: blurInput
22642            });
22643          }
22644        });
22645      }, _this.menuRef = function(node) {
22646        _this._menuNode = node;
22647      }, _this.getMenuProps = function(_temp5, _temp6) {
22648        var _extends3, _ref5 = _temp5 === void 0 ? {} : _temp5, _ref5$refKey = _ref5.refKey, refKey = _ref5$refKey === void 0 ? "ref" : _ref5$refKey, ref = _ref5.ref, props = _objectWithoutPropertiesLoose2(_ref5, _excluded4$2), _ref6 = _temp6 === void 0 ? {} : _temp6, _ref6$suppressRefErro = _ref6.suppressRefError, suppressRefError = _ref6$suppressRefErro === void 0 ? !1 : _ref6$suppressRefErro;
22649        return _this.getMenuProps.called = !0, _this.getMenuProps.refKey = refKey, _this.getMenuProps.suppressRefError = suppressRefError, _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, _this.menuRef), _extends3.role = "listbox", _extends3["aria-labelledby"] = props && props["aria-label"] ? void 0 : _this.labelId, _extends3.id = _this.menuId, _extends3), props);
22650      }, _this.getItemProps = function(_temp7) {
22651        var _enabledEventHandlers, _ref7 = _temp7 === void 0 ? {} : _temp7, onMouseMove = _ref7.onMouseMove, onMouseDown = _ref7.onMouseDown, onClick = _ref7.onClick;
22652        _ref7.onPress;
22653        var index = _ref7.index, _ref7$item = _ref7.item, item = _ref7$item === void 0 ? (
22654          /* istanbul ignore next */
22655          void 0
22656        ) : _ref7$item, rest2 = _objectWithoutPropertiesLoose2(_ref7, _excluded5);
22657        index === void 0 ? (_this.items.push(item), index = _this.items.indexOf(item)) : _this.items[index] = item;
22658        var onSelectKey = "onClick", customClickHandler = onClick, enabledEventHandlers = (_enabledEventHandlers = {
22659          // onMouseMove is used over onMouseEnter here. onMouseMove
22660          // is only triggered on actual mouse movement while onMouseEnter
22661          // can fire on DOM changes, interrupting keyboard navigation
22662          onMouseMove: callAllEventHandlers(onMouseMove, function() {
22663            index !== _this.getState().highlightedIndex && (_this.setHighlightedIndex(index, {
22664              type: itemMouseEnter
22665            }), _this.avoidScrolling = !0, _this.internalSetTimeout(function() {
22666              return _this.avoidScrolling = !1;
22667            }, 250));
22668          }),
22669          onMouseDown: callAllEventHandlers(onMouseDown, function(event) {
22670            event.preventDefault();
22671          })
22672        }, _enabledEventHandlers[onSelectKey] = callAllEventHandlers(customClickHandler, function() {
22673          _this.selectItemAtIndex(index, {
22674            type: clickItem
22675          });
22676        }), _enabledEventHandlers), eventHandlers = rest2.disabled ? {
22677          onMouseDown: enabledEventHandlers.onMouseDown
22678        } : enabledEventHandlers;
22679        return _extends({
22680          id: _this.getItemId(index),
22681          role: "option",
22682          "aria-selected": _this.getState().highlightedIndex === index
22683        }, eventHandlers, rest2);
22684      }, _this.clearItems = function() {
22685        _this.items = [];
22686      }, _this.reset = function(otherStateToSet, cb) {
22687        otherStateToSet === void 0 && (otherStateToSet = {}), otherStateToSet = pickState(otherStateToSet), _this.internalSetState(function(_ref8) {
22688          var selectedItem = _ref8.selectedItem;
22689          return _extends({
22690            isOpen: _this.props.defaultIsOpen,
22691            highlightedIndex: _this.props.defaultHighlightedIndex,
22692            inputValue: _this.props.itemToString(selectedItem)
22693          }, otherStateToSet);
22694        }, cb);
22695      }, _this.toggleMenu = function(otherStateToSet, cb) {
22696        otherStateToSet === void 0 && (otherStateToSet = {}), otherStateToSet = pickState(otherStateToSet), _this.internalSetState(function(_ref9) {
22697          var isOpen = _ref9.isOpen;
22698          return _extends({
22699            isOpen: !isOpen
22700          }, isOpen && {
22701            highlightedIndex: _this.props.defaultHighlightedIndex
22702          }, otherStateToSet);
22703        }, function() {
22704          var _this$getState7 = _this.getState(), isOpen = _this$getState7.isOpen, highlightedIndex = _this$getState7.highlightedIndex;
22705          isOpen && _this.getItemCount() > 0 && typeof highlightedIndex == "number" && _this.setHighlightedIndex(highlightedIndex, otherStateToSet), cbToCb(cb)();
22706        });
22707      }, _this.openMenu = function(cb) {
22708        _this.internalSetState({
22709          isOpen: !0
22710        }, cb);
22711      }, _this.closeMenu = function(cb) {
22712        _this.internalSetState({
22713          isOpen: !1
22714        }, cb);
22715      }, _this.updateStatus = debounce4(function() {
22716        var _this$props;
22717        if ((_this$props = _this.props) != null && (_this$props = _this$props.environment) != null && _this$props.document) {
22718          var state = _this.getState(), item = _this.items[state.highlightedIndex], resultCount = _this.getItemCount(), status = _this.props.getA11yStatusMessage(_extends({
22719            itemToString: _this.props.itemToString,
22720            previousResultCount: _this.previousResultCount,
22721            resultCount,
22722            highlightedItem: item
22723          }, state));
22724          _this.previousResultCount = resultCount, setStatus(status, _this.props.environment.document);
22725        }
22726      }, 200);
22727      var _this$props2 = _this.props, defaultHighlightedIndex = _this$props2.defaultHighlightedIndex, _this$props2$initialH = _this$props2.initialHighlightedIndex, _highlightedIndex = _this$props2$initialH === void 0 ? defaultHighlightedIndex : _this$props2$initialH, defaultIsOpen = _this$props2.defaultIsOpen, _this$props2$initialI = _this$props2.initialIsOpen, _isOpen = _this$props2$initialI === void 0 ? defaultIsOpen : _this$props2$initialI, _this$props2$initialI2 = _this$props2.initialInputValue, _inputValue = _this$props2$initialI2 === void 0 ? "" : _this$props2$initialI2, _this$props2$initialS = _this$props2.initialSelectedItem, _selectedItem = _this$props2$initialS === void 0 ? null : _this$props2$initialS, _state = _this.getState({
22728        highlightedIndex: _highlightedIndex,
22729        isOpen: _isOpen,
22730        inputValue: _inputValue,
22731        selectedItem: _selectedItem
22732      });
22733      return _state.selectedItem != null && _this.props.initialInputValue === void 0 && (_state.inputValue = _this.props.itemToString(_state.selectedItem)), _this.state = _state, _this;
22734    }
22735    _inheritsLoose(Downshift3, _Component);
22736    var _proto = Downshift3.prototype;
22737    return _proto.internalClearTimeouts = function() {
22738      this.timeoutIds.forEach(function(id) {
22739        clearTimeout(id);
22740      }), this.timeoutIds = [];
22741    }, _proto.getState = function(stateToMerge) {
22742      return stateToMerge === void 0 && (stateToMerge = this.state), getState2(stateToMerge, this.props);
22743    }, _proto.getItemCount = function() {
22744      var itemCount = this.items.length;
22745      return this.itemCount != null ? itemCount = this.itemCount : this.props.itemCount !== void 0 && (itemCount = this.props.itemCount), itemCount;
22746    }, _proto.getItemNodeFromIndex = function(index) {
22747      return this.props.environment ? this.props.environment.document.getElementById(this.getItemId(index)) : null;
22748    }, _proto.scrollHighlightedItemIntoView = function() {
22749      {
22750        var node = this.getItemNodeFromIndex(this.getState().highlightedIndex);
22751        this.props.scrollIntoView(node, this._menuNode);
22752      }
22753    }, _proto.moveHighlightedIndex = function(amount, otherStateToSet) {
22754      var itemCount = this.getItemCount(), _this$getState8 = this.getState(), highlightedIndex = _this$getState8.highlightedIndex;
22755      if (itemCount > 0) {
22756        var nextHighlightedIndex = getHighlightedIndex(highlightedIndex, amount, {
22757          length: itemCount
22758        }, this.isItemDisabled, !0);
22759        this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet);
22760      }
22761    }, _proto.getStateAndHelpers = function() {
22762      var _this$getState9 = this.getState(), highlightedIndex = _this$getState9.highlightedIndex, inputValue = _this$getState9.inputValue, selectedItem = _this$getState9.selectedItem, isOpen = _this$getState9.isOpen, itemToString2 = this.props.itemToString, id = this.id, getRootProps = this.getRootProps, getToggleButtonProps = this.getToggleButtonProps, getLabelProps = this.getLabelProps, getMenuProps = this.getMenuProps, getInputProps = this.getInputProps, getItemProps = this.getItemProps, openMenu = this.openMenu, closeMenu = this.closeMenu, toggleMenu = this.toggleMenu, selectItem = this.selectItem, selectItemAtIndex = this.selectItemAtIndex, selectHighlightedItem = this.selectHighlightedItem, setHighlightedIndex = this.setHighlightedIndex, clearSelection = this.clearSelection, clearItems = this.clearItems, reset = this.reset, setItemCount = this.setItemCount, unsetItemCount = this.unsetItemCount, setState = this.internalSetState;
22763      return {
22764        // prop getters
22765        getRootProps,
22766        getToggleButtonProps,
22767        getLabelProps,
22768        getMenuProps,
22769        getInputProps,
22770        getItemProps,
22771        // actions
22772        reset,
22773        openMenu,
22774        closeMenu,
22775        toggleMenu,
22776        selectItem,
22777        selectItemAtIndex,
22778        selectHighlightedItem,
22779        setHighlightedIndex,
22780        clearSelection,
22781        clearItems,
22782        setItemCount,
22783        unsetItemCount,
22784        setState,
22785        // props
22786        itemToString: itemToString2,
22787        // derived
22788        id,
22789        // state
22790        highlightedIndex,
22791        inputValue,
22792        isOpen,
22793        selectedItem
22794      };
22795    }, _proto.componentDidMount = function() {
22796      var _this4 = this;
22797      if (!this.props.environment)
22798        this.cleanup = function() {
22799          _this4.internalClearTimeouts();
22800        };
22801      else {
22802        var onMouseDown = function() {
22803          _this4.isMouseDown = !0;
22804        }, onMouseUp = function(event) {
22805          _this4.isMouseDown = !1;
22806          var contextWithinDownshift = targetWithinDownshift(event.target, [_this4._rootNode, _this4._menuNode], _this4.props.environment);
22807          !contextWithinDownshift && _this4.getState().isOpen && _this4.reset({
22808            type: mouseUp
22809          }, function() {
22810            return _this4.props.onOuterClick(_this4.getStateAndHelpers());
22811          });
22812        }, onTouchStart = function() {
22813          _this4.isTouchMove = !1;
22814        }, onTouchMove = function() {
22815          _this4.isTouchMove = !0;
22816        }, onTouchEnd = function(event) {
22817          var contextWithinDownshift = targetWithinDownshift(event.target, [_this4._rootNode, _this4._menuNode], _this4.props.environment, !1);
22818          !_this4.isTouchMove && !contextWithinDownshift && _this4.getState().isOpen && _this4.reset({
22819            type: touchEnd
22820          }, function() {
22821            return _this4.props.onOuterClick(_this4.getStateAndHelpers());
22822          });
22823        }, environment = this.props.environment;
22824        environment.addEventListener("mousedown", onMouseDown), environment.addEventListener("mouseup", onMouseUp), environment.addEventListener("touchstart", onTouchStart), environment.addEventListener("touchmove", onTouchMove), environment.addEventListener("touchend", onTouchEnd), this.cleanup = function() {
22825          _this4.internalClearTimeouts(), _this4.updateStatus.cancel(), environment.removeEventListener("mousedown", onMouseDown), environment.removeEventListener("mouseup", onMouseUp), environment.removeEventListener("touchstart", onTouchStart), environment.removeEventListener("touchmove", onTouchMove), environment.removeEventListener("touchend", onTouchEnd);
22826        };
22827      }
22828    }, _proto.shouldScroll = function(prevState, prevProps) {
22829      var _ref0 = this.props.highlightedIndex === void 0 ? this.getState() : this.props, currentHighlightedIndex = _ref0.highlightedIndex, _ref1 = prevProps.highlightedIndex === void 0 ? prevState : prevProps, prevHighlightedIndex = _ref1.highlightedIndex, scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen, scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;
22830      return scrollWhenOpen || scrollWhenNavigating;
22831    }, _proto.componentDidUpdate = function(prevProps, prevState) {
22832      isControlledProp(this.props, "selectedItem") && this.props.selectedItemChanged(prevProps.selectedItem, this.props.selectedItem) && this.internalSetState({
22833        type: controlledPropUpdatedSelectedItem,
22834        inputValue: this.props.itemToString(this.props.selectedItem)
22835      }), !this.avoidScrolling && this.shouldScroll(prevState, prevProps) && this.scrollHighlightedItemIntoView(), this.updateStatus();
22836    }, _proto.componentWillUnmount = function() {
22837      this.cleanup();
22838    }, _proto.render = function() {
22839      var children = unwrapArray(this.props.children, noop4);
22840      this.clearItems(), this.getRootProps.called = !1, this.getRootProps.refKey = void 0, this.getRootProps.suppressRefError = void 0, this.getMenuProps.called = !1, this.getMenuProps.refKey = void 0, this.getMenuProps.suppressRefError = void 0, this.getLabelProps.called = !1, this.getInputProps.called = !1;
22841      var element = unwrapArray(children(this.getStateAndHelpers()));
22842      if (!element)
22843        return null;
22844      if (this.getRootProps.called || this.props.suppressRefError)
22845        return element;
22846      if (isDOMElement(element))
22847        return cloneElement(element, this.getRootProps(getElementProps(element)));
22848    }, Downshift3;
22849  })(Component);
22850  return Downshift2.defaultProps = {
22851    defaultHighlightedIndex: null,
22852    defaultIsOpen: !1,
22853    getA11yStatusMessage,
22854    itemToString: function(i2) {
22855      return i2 == null ? "" : String(i2);
22856    },
22857    onStateChange: noop4,
22858    onInputValueChange: noop4,
22859    onUserAction: noop4,
22860    onChange: noop4,
22861    onSelect: noop4,
22862    onOuterClick: noop4,
22863    selectedItemChanged: function(prevItem, item) {
22864      return prevItem !== item;
22865    },
22866    environment: (
22867      /* istanbul ignore next (ssr) */
22868      typeof window > "u" ? void 0 : window
22869    ),
22870    stateReducer: function(state, stateToSet) {
22871      return stateToSet;
22872    },
22873    suppressRefError: !1,
22874    scrollIntoView: scrollIntoView2
22875  }, Downshift2.stateChangeTypes = stateChangeTypes$3, Downshift2;
22876})();
22877var dropdownDefaultStateValues = {
22878  highlightedIndex: -1,
22879  isOpen: !1,
22880  selectedItem: null,
22881  inputValue: ""
22882};
22883function callOnChangeProps(action, state, newState) {
22884  var props = action.props, type = action.type, changes = {};
22885  Object.keys(state).forEach(function(key) {
22886    invokeOnChangeHandler(key, action, state, newState), newState[key] !== state[key] && (changes[key] = newState[key]);
22887  }), props.onStateChange && Object.keys(changes).length && props.onStateChange(_extends({
22888    type
22889  }, changes));
22890}
22891function invokeOnChangeHandler(key, action, state, newState) {
22892  var props = action.props, type = action.type, handler = "on" + capitalizeString(key) + "Change";
22893  props[handler] && newState[key] !== void 0 && newState[key] !== state[key] && props[handler](_extends({
22894    type
22895  }, newState));
22896}
22897function stateReducer(s2, a2) {
22898  return a2.changes;
22899}
22900var updateA11yStatus = debounce4(function(status, document11) {
22901  setStatus(status, document11);
22902}, 200), useIsomorphicLayoutEffect2 = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? useLayoutEffect : useEffect, useElementIds = "useId" in react_default ? function(_ref) {
22903  var id = _ref.id, labelId = _ref.labelId, menuId = _ref.menuId, getItemId = _ref.getItemId, toggleButtonId = _ref.toggleButtonId, inputId = _ref.inputId, reactId = "downshift-" + react_default.useId();
22904  id || (id = reactId);
22905  var elementIdsRef = useRef({
22906    labelId: labelId || id + "-label",
22907    menuId: menuId || id + "-menu",
22908    getItemId: getItemId || function(index) {
22909      return id + "-item-" + index;
22910    },
22911    toggleButtonId: toggleButtonId || id + "-toggle-button",
22912    inputId: inputId || id + "-input"
22913  });
22914  return elementIdsRef.current;
22915} : function(_ref2) {
22916  var _ref2$id = _ref2.id, id = _ref2$id === void 0 ? "downshift-" + generateId() : _ref2$id, labelId = _ref2.labelId, menuId = _ref2.menuId, getItemId = _ref2.getItemId, toggleButtonId = _ref2.toggleButtonId, inputId = _ref2.inputId, elementIdsRef = useRef({
22917    labelId: labelId || id + "-label",
22918    menuId: menuId || id + "-menu",
22919    getItemId: getItemId || function(index) {
22920      return id + "-item-" + index;
22921    },
22922    toggleButtonId: toggleButtonId || id + "-toggle-button",
22923    inputId: inputId || id + "-input"
22924  });
22925  return elementIdsRef.current;
22926};
22927function getItemAndIndex(itemProp, indexProp, items, errorMessage) {
22928  var item, index;
22929  if (itemProp === void 0) {
22930    if (indexProp === void 0)
22931      throw new Error(errorMessage);
22932    item = items[indexProp], index = indexProp;
22933  } else
22934    index = indexProp === void 0 ? items.indexOf(itemProp) : indexProp, item = itemProp;
22935  return [item, index];
22936}
22937function isAcceptedCharacterKey(key) {
22938  return /^\S{1}$/.test(key);
22939}
22940function capitalizeString(string) {
22941  return "" + string.slice(0, 1).toUpperCase() + string.slice(1);
22942}
22943function useLatestRef(val) {
22944  var ref = useRef(val);
22945  return ref.current = val, ref;
22946}
22947function useEnhancedReducer(reducer, props, createInitialState, isStateEqual2) {
22948  var prevStateRef = useRef(), actionRef = useRef(), enhancedReducer = useCallback(function(state2, action2) {
22949    actionRef.current = action2, state2 = getState2(state2, action2.props);
22950    var changes = reducer(state2, action2), newState = action2.props.stateReducer(state2, _extends({}, action2, {
22951      changes
22952    }));
22953    return newState;
22954  }, [reducer]), _useReducer = useReducer(enhancedReducer, props, createInitialState), state = _useReducer[0], dispatch = _useReducer[1], propsRef = useLatestRef(props), dispatchWithProps = useCallback(function(action2) {
22955    return dispatch(_extends({
22956      props: propsRef.current
22957    }, action2));
22958  }, [propsRef]), action = actionRef.current;
22959  return useEffect(function() {
22960    var prevState = getState2(prevStateRef.current, action?.props), shouldCallOnChangeProps = action && prevStateRef.current && !isStateEqual2(prevState, state);
22961    shouldCallOnChangeProps && callOnChangeProps(action, prevState, state), prevStateRef.current = state;
22962  }, [state, action, isStateEqual2]), [state, dispatchWithProps];
22963}
22964function useControlledReducer$1(reducer, props, createInitialState, isStateEqual2) {
22965  var _useEnhancedReducer = useEnhancedReducer(reducer, props, createInitialState, isStateEqual2), state = _useEnhancedReducer[0], dispatch = _useEnhancedReducer[1];
22966  return [getState2(state, props), dispatch];
22967}
22968var defaultProps$3 = {
22969  itemToString: function(item) {
22970    return item ? String(item) : "";
22971  },
22972  itemToKey: function(item) {
22973    return item;
22974  },
22975  stateReducer,
22976  scrollIntoView: scrollIntoView2,
22977  environment: (
22978    /* istanbul ignore next (ssr) */
22979    typeof window > "u" ? void 0 : window
22980  )
22981};
22982function getDefaultValue$1(props, propKey, defaultStateValues2) {
22983  defaultStateValues2 === void 0 && (defaultStateValues2 = dropdownDefaultStateValues);
22984  var defaultValue = props["default" + capitalizeString(propKey)];
22985  return defaultValue !== void 0 ? defaultValue : defaultStateValues2[propKey];
22986}
22987function getInitialValue$1(props, propKey, defaultStateValues2) {
22988  defaultStateValues2 === void 0 && (defaultStateValues2 = dropdownDefaultStateValues);
22989  var value = props[propKey];
22990  if (value !== void 0)
22991    return value;
22992  var initialValue = props["initial" + capitalizeString(propKey)];
22993  return initialValue !== void 0 ? initialValue : getDefaultValue$1(props, propKey, defaultStateValues2);
22994}
22995function getInitialState$2(props) {
22996  var selectedItem = getInitialValue$1(props, "selectedItem"), isOpen = getInitialValue$1(props, "isOpen"), highlightedIndex = getInitialHighlightedIndex(props), inputValue = getInitialValue$1(props, "inputValue");
22997  return {
22998    highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.findIndex(function(item) {
22999      return props.itemToKey(item) === props.itemToKey(selectedItem);
23000    }) : highlightedIndex,
23001    isOpen,
23002    selectedItem,
23003    inputValue
23004  };
23005}
23006function getHighlightedIndexOnOpen(props, state, offset2) {
23007  var items = props.items, initialHighlightedIndex = props.initialHighlightedIndex, defaultHighlightedIndex = props.defaultHighlightedIndex, isItemDisabled2 = props.isItemDisabled, itemToKey2 = props.itemToKey, selectedItem = state.selectedItem, highlightedIndex = state.highlightedIndex;
23008  return items.length === 0 ? -1 : initialHighlightedIndex !== void 0 && highlightedIndex === initialHighlightedIndex && !isItemDisabled2(items[initialHighlightedIndex], initialHighlightedIndex) ? initialHighlightedIndex : defaultHighlightedIndex !== void 0 && !isItemDisabled2(items[defaultHighlightedIndex], defaultHighlightedIndex) ? defaultHighlightedIndex : selectedItem ? items.findIndex(function(item) {
23009    return itemToKey2(selectedItem) === itemToKey2(item);
23010  }) : offset2 < 0 && !isItemDisabled2(items[items.length - 1], items.length - 1) ? items.length - 1 : offset2 > 0 && !isItemDisabled2(items[0], 0) ? 0 : -1;
23011}
23012function useMouseAndTouchTracker(environment, handleBlur, downshiftElementsRefs) {
23013  var mouseAndTouchTrackersRef = useRef({
23014    isMouseDown: !1,
23015    isTouchMove: !1,
23016    isTouchEnd: !1
23017  });
23018  return useEffect(function() {
23019    if (!environment)
23020      return noop4;
23021    var downshiftElements = downshiftElementsRefs.map(function(ref) {
23022      return ref.current;
23023    });
23024    function onMouseDown() {
23025      mouseAndTouchTrackersRef.current.isTouchEnd = !1, mouseAndTouchTrackersRef.current.isMouseDown = !0;
23026    }
23027    function onMouseUp(event) {
23028      mouseAndTouchTrackersRef.current.isMouseDown = !1, targetWithinDownshift(event.target, downshiftElements, environment) || handleBlur();
23029    }
23030    function onTouchStart() {
23031      mouseAndTouchTrackersRef.current.isTouchEnd = !1, mouseAndTouchTrackersRef.current.isTouchMove = !1;
23032    }
23033    function onTouchMove() {
23034      mouseAndTouchTrackersRef.current.isTouchMove = !0;
23035    }
23036    function onTouchEnd(event) {
23037      mouseAndTouchTrackersRef.current.isTouchEnd = !0, !mouseAndTouchTrackersRef.current.isTouchMove && !targetWithinDownshift(event.target, downshiftElements, environment, !1) && handleBlur();
23038    }
23039    return environment.addEventListener("mousedown", onMouseDown), environment.addEventListener("mouseup", onMouseUp), environment.addEventListener("touchstart", onTouchStart), environment.addEventListener("touchmove", onTouchMove), environment.addEventListener("touchend", onTouchEnd), function() {
23040      environment.removeEventListener("mousedown", onMouseDown), environment.removeEventListener("mouseup", onMouseUp), environment.removeEventListener("touchstart", onTouchStart), environment.removeEventListener("touchmove", onTouchMove), environment.removeEventListener("touchend", onTouchEnd);
23041    };
23042  }, [downshiftElementsRefs, environment, handleBlur]), mouseAndTouchTrackersRef.current;
23043}
23044var useGetterPropsCalledChecker = function() {
23045  return noop4;
23046};
23047function useA11yMessageStatus(getA11yStatusMessage2, options2, dependencyArray, environment) {
23048  environment === void 0 && (environment = {});
23049  var document11 = environment.document, isInitialMount = useIsInitialMount();
23050  useEffect(function() {
23051    if (!(!getA11yStatusMessage2 || isInitialMount || !document11)) {
23052      var status = getA11yStatusMessage2(options2);
23053      updateA11yStatus(status, document11);
23054    }
23055  }, dependencyArray), useEffect(function() {
23056    return function() {
23057      updateA11yStatus.cancel(), cleanupStatusDiv(document11);
23058    };
23059  }, [document11]);
23060}
23061function useScrollIntoView(_ref3) {
23062  var highlightedIndex = _ref3.highlightedIndex, isOpen = _ref3.isOpen, itemRefs = _ref3.itemRefs, getItemNodeFromIndex = _ref3.getItemNodeFromIndex, menuElement = _ref3.menuElement, scrollIntoViewProp = _ref3.scrollIntoView, shouldScrollRef = useRef(!0);
23063  return useIsomorphicLayoutEffect2(function() {
23064    highlightedIndex < 0 || !isOpen || !Object.keys(itemRefs.current).length || (shouldScrollRef.current === !1 ? shouldScrollRef.current = !0 : scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex), menuElement));
23065  }, [highlightedIndex]), shouldScrollRef;
23066}
23067var useControlPropsValidator = noop4;
23068function getChangesOnSelection(props, highlightedIndex, inputValue) {
23069  var _props$items;
23070  inputValue === void 0 && (inputValue = !0);
23071  var shouldSelect = ((_props$items = props.items) == null ? void 0 : _props$items.length) && highlightedIndex >= 0;
23072  return _extends({
23073    isOpen: !1,
23074    highlightedIndex: -1
23075  }, shouldSelect && _extends({
23076    selectedItem: props.items[highlightedIndex],
23077    isOpen: getDefaultValue$1(props, "isOpen"),
23078    highlightedIndex: getDefaultValue$1(props, "highlightedIndex")
23079  }, inputValue && {
23080    inputValue: props.itemToString(props.items[highlightedIndex])
23081  }));
23082}
23083function isDropdownsStateEqual(prevState, newState) {
23084  return prevState.isOpen === newState.isOpen && prevState.inputValue === newState.inputValue && prevState.highlightedIndex === newState.highlightedIndex && prevState.selectedItem === newState.selectedItem;
23085}
23086function useIsInitialMount() {
23087  var isInitialMountRef = react_default.useRef(!0);
23088  return react_default.useEffect(function() {
23089    return isInitialMountRef.current = !1, function() {
23090      isInitialMountRef.current = !0;
23091    };
23092  }, []), isInitialMountRef.current;
23093}
23094function getDefaultHighlightedIndex(props) {
23095  var highlightedIndex = getDefaultValue$1(props, "highlightedIndex");
23096  return highlightedIndex > -1 && props.isItemDisabled(props.items[highlightedIndex], highlightedIndex) ? -1 : highlightedIndex;
23097}
23098function getInitialHighlightedIndex(props) {
23099  var highlightedIndex = getInitialValue$1(props, "highlightedIndex");
23100  return highlightedIndex > -1 && props.isItemDisabled(props.items[highlightedIndex], highlightedIndex) ? -1 : highlightedIndex;
23101}
23102var commonPropTypes = {
23103  environment: import_prop_types3.default.shape({
23104    addEventListener: import_prop_types3.default.func.isRequired,
23105    removeEventListener: import_prop_types3.default.func.isRequired,
23106    document: import_prop_types3.default.shape({
23107      createElement: import_prop_types3.default.func.isRequired,
23108      getElementById: import_prop_types3.default.func.isRequired,
23109      activeElement: import_prop_types3.default.any.isRequired,
23110      body: import_prop_types3.default.any.isRequired
23111    }).isRequired,
23112    Node: import_prop_types3.default.func.isRequired
23113  }),
23114  itemToString: import_prop_types3.default.func,
23115  itemToKey: import_prop_types3.default.func,
23116  stateReducer: import_prop_types3.default.func
23117}, commonDropdownPropTypes = _extends({}, commonPropTypes, {
23118  getA11yStatusMessage: import_prop_types3.default.func,
23119  highlightedIndex: import_prop_types3.default.number,
23120  defaultHighlightedIndex: import_prop_types3.default.number,
23121  initialHighlightedIndex: import_prop_types3.default.number,
23122  isOpen: import_prop_types3.default.bool,
23123  defaultIsOpen: import_prop_types3.default.bool,
23124  initialIsOpen: import_prop_types3.default.bool,
23125  selectedItem: import_prop_types3.default.any,
23126  initialSelectedItem: import_prop_types3.default.any,
23127  defaultSelectedItem: import_prop_types3.default.any,
23128  id: import_prop_types3.default.string,
23129  labelId: import_prop_types3.default.string,
23130  menuId: import_prop_types3.default.string,
23131  getItemId: import_prop_types3.default.func,
23132  toggleButtonId: import_prop_types3.default.string,
23133  onSelectedItemChange: import_prop_types3.default.func,
23134  onHighlightedIndexChange: import_prop_types3.default.func,
23135  onStateChange: import_prop_types3.default.func,
23136  onIsOpenChange: import_prop_types3.default.func,
23137  scrollIntoView: import_prop_types3.default.func
23138});
23139function downshiftCommonReducer(state, action, stateChangeTypes2) {
23140  var type = action.type, props = action.props, changes;
23141  switch (type) {
23142    case stateChangeTypes2.ItemMouseMove:
23143      changes = {
23144        highlightedIndex: action.disabled ? -1 : action.index
23145      };
23146      break;
23147    case stateChangeTypes2.MenuMouseLeave:
23148      changes = {
23149        highlightedIndex: -1
23150      };
23151      break;
23152    case stateChangeTypes2.ToggleButtonClick:
23153    case stateChangeTypes2.FunctionToggleMenu:
23154      changes = {
23155        isOpen: !state.isOpen,
23156        highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0)
23157      };
23158      break;
23159    case stateChangeTypes2.FunctionOpenMenu:
23160      changes = {
23161        isOpen: !0,
23162        highlightedIndex: getHighlightedIndexOnOpen(props, state, 0)
23163      };
23164      break;
23165    case stateChangeTypes2.FunctionCloseMenu:
23166      changes = {
23167        isOpen: !1
23168      };
23169      break;
23170    case stateChangeTypes2.FunctionSetHighlightedIndex:
23171      changes = {
23172        highlightedIndex: props.isItemDisabled(props.items[action.highlightedIndex], action.highlightedIndex) ? -1 : action.highlightedIndex
23173      };
23174      break;
23175    case stateChangeTypes2.FunctionSetInputValue:
23176      changes = {
23177        inputValue: action.inputValue
23178      };
23179      break;
23180    case stateChangeTypes2.FunctionReset:
23181      changes = {
23182        highlightedIndex: getDefaultHighlightedIndex(props),
23183        isOpen: getDefaultValue$1(props, "isOpen"),
23184        selectedItem: getDefaultValue$1(props, "selectedItem"),
23185        inputValue: getDefaultValue$1(props, "inputValue")
23186      };
23187      break;
23188    default:
23189      throw new Error("Reducer called without proper action type.");
23190  }
23191  return _extends({}, state, changes);
23192}
23193function getItemIndexByCharacterKey(_a2) {
23194  for (var keysSoFar = _a2.keysSoFar, highlightedIndex = _a2.highlightedIndex, items = _a2.items, itemToString2 = _a2.itemToString, isItemDisabled2 = _a2.isItemDisabled, lowerCasedKeysSoFar = keysSoFar.toLowerCase(), index = 0; index < items.length; index++) {
23195    var offsetIndex = (index + highlightedIndex + (keysSoFar.length < 2 ? 1 : 0)) % items.length, item = items[offsetIndex];
23196    if (item !== void 0 && itemToString2(item).toLowerCase().startsWith(lowerCasedKeysSoFar) && !isItemDisabled2(item, offsetIndex))
23197      return offsetIndex;
23198  }
23199  return highlightedIndex;
23200}
23201var propTypes$2 = __assign(__assign({}, commonDropdownPropTypes), { items: import_prop_types3.default.array.isRequired, isItemDisabled: import_prop_types3.default.func }), defaultProps$2 = __assign(__assign({}, defaultProps$3), { isItemDisabled: function() {
23202  return !1;
23203} }), validatePropTypes$2 = noop4, ToggleButtonClick$1 = 0, ToggleButtonKeyDownArrowDown = 1, ToggleButtonKeyDownArrowUp = 2, ToggleButtonKeyDownCharacter = 3, ToggleButtonKeyDownEscape = 4, ToggleButtonKeyDownHome = 5, ToggleButtonKeyDownEnd = 6, ToggleButtonKeyDownEnter = 7, ToggleButtonKeyDownSpaceButton = 8, ToggleButtonKeyDownPageUp = 9, ToggleButtonKeyDownPageDown = 10, ToggleButtonBlur = 11, MenuMouseLeave$1 = 12, ItemMouseMove$1 = 13, ItemClick$1 = 14, FunctionToggleMenu$1 = 15, FunctionOpenMenu$1 = 16, FunctionCloseMenu$1 = 17, FunctionSetHighlightedIndex$1 = 18, FunctionSelectItem$1 = 19, FunctionSetInputValue$1 = 20, FunctionReset$2 = 21, stateChangeTypes$2 = Object.freeze({
23204  __proto__: null,
23205  FunctionCloseMenu: FunctionCloseMenu$1,
23206  FunctionOpenMenu: FunctionOpenMenu$1,
23207  FunctionReset: FunctionReset$2,
23208  FunctionSelectItem: FunctionSelectItem$1,
23209  FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,
23210  FunctionSetInputValue: FunctionSetInputValue$1,
23211  FunctionToggleMenu: FunctionToggleMenu$1,
23212  ItemClick: ItemClick$1,
23213  ItemMouseMove: ItemMouseMove$1,
23214  MenuMouseLeave: MenuMouseLeave$1,
23215  ToggleButtonBlur,
23216  ToggleButtonClick: ToggleButtonClick$1,
23217  ToggleButtonKeyDownArrowDown,
23218  ToggleButtonKeyDownArrowUp,
23219  ToggleButtonKeyDownCharacter,
23220  ToggleButtonKeyDownEnd,
23221  ToggleButtonKeyDownEnter,
23222  ToggleButtonKeyDownEscape,
23223  ToggleButtonKeyDownHome,
23224  ToggleButtonKeyDownPageDown,
23225  ToggleButtonKeyDownPageUp,
23226  ToggleButtonKeyDownSpaceButton
23227});
23228function downshiftSelectReducer(state, action) {
23229  var _props$items, type = action.type, props = action.props, altKey = action.altKey, changes;
23230  switch (type) {
23231    case ItemClick$1:
23232      changes = {
23233        isOpen: getDefaultValue$1(props, "isOpen"),
23234        highlightedIndex: getDefaultHighlightedIndex(props),
23235        selectedItem: props.items[action.index]
23236      };
23237      break;
23238    case ToggleButtonKeyDownCharacter:
23239      {
23240        var lowercasedKey = action.key, inputValue = "" + state.inputValue + lowercasedKey, prevHighlightedIndex = !state.isOpen && state.selectedItem ? props.items.findIndex(function(item) {
23241          return props.itemToKey(item) === props.itemToKey(state.selectedItem);
23242        }) : state.highlightedIndex, highlightedIndex = getItemIndexByCharacterKey({
23243          keysSoFar: inputValue,
23244          highlightedIndex: prevHighlightedIndex,
23245          items: props.items,
23246          itemToString: props.itemToString,
23247          isItemDisabled: props.isItemDisabled
23248        });
23249        changes = {
23250          inputValue,
23251          highlightedIndex,
23252          isOpen: !0
23253        };
23254      }
23255      break;
23256    case ToggleButtonKeyDownArrowDown:
23257      {
23258        var _highlightedIndex = state.isOpen ? getHighlightedIndex(state.highlightedIndex, 1, props.items, props.isItemDisabled) : altKey && state.selectedItem == null ? -1 : getHighlightedIndexOnOpen(props, state, 1);
23259        changes = {
23260          highlightedIndex: _highlightedIndex,
23261          isOpen: !0
23262        };
23263      }
23264      break;
23265    case ToggleButtonKeyDownArrowUp:
23266      if (state.isOpen && altKey)
23267        changes = getChangesOnSelection(props, state.highlightedIndex, !1);
23268      else {
23269        var _highlightedIndex2 = state.isOpen ? getHighlightedIndex(state.highlightedIndex, -1, props.items, props.isItemDisabled) : getHighlightedIndexOnOpen(props, state, -1);
23270        changes = {
23271          highlightedIndex: _highlightedIndex2,
23272          isOpen: !0
23273        };
23274      }
23275      break;
23276    // only triggered when menu is open.
23277    case ToggleButtonKeyDownEnter:
23278    case ToggleButtonKeyDownSpaceButton:
23279      changes = getChangesOnSelection(props, state.highlightedIndex, !1);
23280      break;
23281    case ToggleButtonKeyDownHome:
23282      changes = {
23283        highlightedIndex: getNonDisabledIndex(0, !1, props.items, props.isItemDisabled),
23284        isOpen: !0
23285      };
23286      break;
23287    case ToggleButtonKeyDownEnd:
23288      changes = {
23289        highlightedIndex: getNonDisabledIndex(props.items.length - 1, !0, props.items, props.isItemDisabled),
23290        isOpen: !0
23291      };
23292      break;
23293    case ToggleButtonKeyDownPageUp:
23294      changes = {
23295        highlightedIndex: getHighlightedIndex(state.highlightedIndex, -10, props.items, props.isItemDisabled)
23296      };
23297      break;
23298    case ToggleButtonKeyDownPageDown:
23299      changes = {
23300        highlightedIndex: getHighlightedIndex(state.highlightedIndex, 10, props.items, props.isItemDisabled)
23301      };
23302      break;
23303    case ToggleButtonKeyDownEscape:
23304      changes = {
23305        isOpen: !1,
23306        highlightedIndex: -1
23307      };
23308      break;
23309    case ToggleButtonBlur:
23310      changes = _extends({
23311        isOpen: !1,
23312        highlightedIndex: -1
23313      }, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && {
23314        selectedItem: props.items[state.highlightedIndex]
23315      });
23316      break;
23317    case FunctionSelectItem$1:
23318      changes = {
23319        selectedItem: action.selectedItem
23320      };
23321      break;
23322    default:
23323      return downshiftCommonReducer(state, action, stateChangeTypes$2);
23324  }
23325  return _extends({}, state, changes);
23326}
23327var _excluded$2 = ["onClick"], _excluded2$2 = ["onMouseLeave", "refKey", "ref"], _excluded3$1 = ["onBlur", "onClick", "onPress", "onKeyDown", "refKey", "ref"], _excluded4$1 = ["item", "index", "onMouseMove", "onClick", "onMouseDown", "onPress", "refKey", "disabled", "ref"];
23328useSelect.stateChangeTypes = stateChangeTypes$2;
23329function useSelect(userProps) {
23330  userProps === void 0 && (userProps = {}), validatePropTypes$2(userProps, useSelect);
23331  var props = _extends({}, defaultProps$2, userProps), scrollIntoView3 = props.scrollIntoView, environment = props.environment, getA11yStatusMessage2 = props.getA11yStatusMessage, _useControlledReducer = useControlledReducer$1(downshiftSelectReducer, props, getInitialState$2, isDropdownsStateEqual), state = _useControlledReducer[0], dispatch = _useControlledReducer[1], isOpen = state.isOpen, highlightedIndex = state.highlightedIndex, selectedItem = state.selectedItem, inputValue = state.inputValue, toggleButtonRef = useRef(null), menuRef = useRef(null), itemRefs = useRef({}), clearTimeoutRef = useRef(null), elementIds = useElementIds(props), latest = useLatestRef({
23332    state,
23333    props
23334  }), getItemNodeFromIndex = useCallback(function(index) {
23335    return itemRefs.current[elementIds.getItemId(index)];
23336  }, [elementIds]);
23337  useA11yMessageStatus(getA11yStatusMessage2, state, [isOpen, highlightedIndex, selectedItem, inputValue], environment);
23338  var shouldScrollRef = useScrollIntoView({
23339    menuElement: menuRef.current,
23340    highlightedIndex,
23341    isOpen,
23342    itemRefs,
23343    scrollIntoView: scrollIntoView3,
23344    getItemNodeFromIndex
23345  });
23346  useEffect(function() {
23347    return clearTimeoutRef.current = debounce4(function(outerDispatch) {
23348      outerDispatch({
23349        type: FunctionSetInputValue$1,
23350        inputValue: ""
23351      });
23352    }, 500), function() {
23353      clearTimeoutRef.current.cancel();
23354    };
23355  }, []), useEffect(function() {
23356    inputValue && clearTimeoutRef.current(dispatch);
23357  }, [dispatch, inputValue]), useControlPropsValidator({
23358    props,
23359    state
23360  }), useEffect(function() {
23361    var focusOnOpen = getInitialValue$1(props, "isOpen");
23362    focusOnOpen && toggleButtonRef.current && toggleButtonRef.current.focus();
23363  }, []);
23364  var mouseAndTouchTrackers = useMouseAndTouchTracker(environment, useCallback(function() {
23365    latest.current.state.isOpen && dispatch({
23366      type: ToggleButtonBlur
23367    });
23368  }, [dispatch, latest]), useMemo(function() {
23369    return [menuRef, toggleButtonRef];
23370  }, [menuRef.current, toggleButtonRef.current])), setGetterPropCallInfo = useGetterPropsCalledChecker("getMenuProps", "getToggleButtonProps");
23371  useEffect(function() {
23372    isOpen || (itemRefs.current = {});
23373  }, [isOpen]);
23374  var toggleButtonKeyDownHandlers = useMemo(function() {
23375    return {
23376      ArrowDown: function(event) {
23377        event.preventDefault(), dispatch({
23378          type: ToggleButtonKeyDownArrowDown,
23379          altKey: event.altKey
23380        });
23381      },
23382      ArrowUp: function(event) {
23383        event.preventDefault(), dispatch({
23384          type: ToggleButtonKeyDownArrowUp,
23385          altKey: event.altKey
23386        });
23387      },
23388      Home: function(event) {
23389        event.preventDefault(), dispatch({
23390          type: ToggleButtonKeyDownHome
23391        });
23392      },
23393      End: function(event) {
23394        event.preventDefault(), dispatch({
23395          type: ToggleButtonKeyDownEnd
23396        });
23397      },
23398      Escape: function() {
23399        latest.current.state.isOpen && dispatch({
23400          type: ToggleButtonKeyDownEscape
23401        });
23402      },
23403      Enter: function(event) {
23404        event.preventDefault(), dispatch({
23405          type: latest.current.state.isOpen ? ToggleButtonKeyDownEnter : ToggleButtonClick$1
23406        });
23407      },
23408      PageUp: function(event) {
23409        latest.current.state.isOpen && (event.preventDefault(), dispatch({
23410          type: ToggleButtonKeyDownPageUp
23411        }));
23412      },
23413      PageDown: function(event) {
23414        latest.current.state.isOpen && (event.preventDefault(), dispatch({
23415          type: ToggleButtonKeyDownPageDown
23416        }));
23417      },
23418      " ": function(event) {
23419        event.preventDefault();
23420        var currentState = latest.current.state;
23421        if (!currentState.isOpen) {
23422          dispatch({
23423            type: ToggleButtonClick$1
23424          });
23425          return;
23426        }
23427        currentState.inputValue ? dispatch({
23428          type: ToggleButtonKeyDownCharacter,
23429          key: " "
23430        }) : dispatch({
23431          type: ToggleButtonKeyDownSpaceButton
23432        });
23433      }
23434    };
23435  }, [dispatch, latest]), toggleMenu = useCallback(function() {
23436    dispatch({
23437      type: FunctionToggleMenu$1
23438    });
23439  }, [dispatch]), closeMenu = useCallback(function() {
23440    dispatch({
23441      type: FunctionCloseMenu$1
23442    });
23443  }, [dispatch]), openMenu = useCallback(function() {
23444    dispatch({
23445      type: FunctionOpenMenu$1
23446    });
23447  }, [dispatch]), setHighlightedIndex = useCallback(function(newHighlightedIndex) {
23448    dispatch({
23449      type: FunctionSetHighlightedIndex$1,
23450      highlightedIndex: newHighlightedIndex
23451    });
23452  }, [dispatch]), selectItem = useCallback(function(newSelectedItem) {
23453    dispatch({
23454      type: FunctionSelectItem$1,
23455      selectedItem: newSelectedItem
23456    });
23457  }, [dispatch]), reset = useCallback(function() {
23458    dispatch({
23459      type: FunctionReset$2
23460    });
23461  }, [dispatch]), setInputValue = useCallback(function(newInputValue) {
23462    dispatch({
23463      type: FunctionSetInputValue$1,
23464      inputValue: newInputValue
23465    });
23466  }, [dispatch]), getLabelProps = useCallback(function(_temp) {
23467    var _ref = _temp === void 0 ? {} : _temp, onClick = _ref.onClick, labelProps = _objectWithoutPropertiesLoose2(_ref, _excluded$2), labelHandleClick = function() {
23468      var _toggleButtonRef$curr;
23469      (_toggleButtonRef$curr = toggleButtonRef.current) == null || _toggleButtonRef$curr.focus();
23470    };
23471    return _extends({
23472      id: elementIds.labelId,
23473      htmlFor: elementIds.toggleButtonId,
23474      onClick: callAllEventHandlers(onClick, labelHandleClick)
23475    }, labelProps);
23476  }, [elementIds]), getMenuProps = useCallback(function(_temp2, _temp3) {
23477    var _extends22, _ref2 = _temp2 === void 0 ? {} : _temp2, onMouseLeave = _ref2.onMouseLeave, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, ref = _ref2.ref, rest2 = _objectWithoutPropertiesLoose2(_ref2, _excluded2$2), _ref3 = _temp3 === void 0 ? {} : _temp3, _ref3$suppressRefErro = _ref3.suppressRefError, suppressRefError = _ref3$suppressRefErro === void 0 ? !1 : _ref3$suppressRefErro, menuHandleMouseLeave = function() {
23478      dispatch({
23479        type: MenuMouseLeave$1
23480      });
23481    };
23482    return setGetterPropCallInfo("getMenuProps", suppressRefError, refKey, menuRef), _extends((_extends22 = {}, _extends22[refKey] = handleRefs(ref, function(menuNode) {
23483      menuRef.current = menuNode;
23484    }), _extends22.id = elementIds.menuId, _extends22.role = "listbox", _extends22["aria-labelledby"] = rest2 && rest2["aria-label"] ? void 0 : "" + elementIds.labelId, _extends22.onMouseLeave = callAllEventHandlers(onMouseLeave, menuHandleMouseLeave), _extends22), rest2);
23485  }, [dispatch, setGetterPropCallInfo, elementIds]), getToggleButtonProps = useCallback(function(_temp4, _temp5) {
23486    var _extends3, _ref4 = _temp4 === void 0 ? {} : _temp4, onBlur = _ref4.onBlur, onClick = _ref4.onClick;
23487    _ref4.onPress;
23488    var onKeyDown = _ref4.onKeyDown, _ref4$refKey = _ref4.refKey, refKey = _ref4$refKey === void 0 ? "ref" : _ref4$refKey, ref = _ref4.ref, rest2 = _objectWithoutPropertiesLoose2(_ref4, _excluded3$1), _ref5 = _temp5 === void 0 ? {} : _temp5, _ref5$suppressRefErro = _ref5.suppressRefError, suppressRefError = _ref5$suppressRefErro === void 0 ? !1 : _ref5$suppressRefErro, latestState = latest.current.state, toggleButtonHandleClick = function() {
23489      dispatch({
23490        type: ToggleButtonClick$1
23491      });
23492    }, toggleButtonHandleBlur = function() {
23493      latestState.isOpen && !mouseAndTouchTrackers.isMouseDown && dispatch({
23494        type: ToggleButtonBlur
23495      });
23496    }, toggleButtonHandleKeyDown = function(event) {
23497      var key = normalizeArrowKey(event);
23498      key && toggleButtonKeyDownHandlers[key] ? toggleButtonKeyDownHandlers[key](event) : isAcceptedCharacterKey(key) && dispatch({
23499        type: ToggleButtonKeyDownCharacter,
23500        key
23501      });
23502    }, toggleProps = _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function(toggleButtonNode) {
23503      toggleButtonRef.current = toggleButtonNode;
23504    }), _extends3["aria-activedescendant"] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : "", _extends3["aria-controls"] = elementIds.menuId, _extends3["aria-expanded"] = latest.current.state.isOpen, _extends3["aria-haspopup"] = "listbox", _extends3["aria-labelledby"] = rest2 && rest2["aria-label"] ? void 0 : "" + elementIds.labelId, _extends3.id = elementIds.toggleButtonId, _extends3.role = "combobox", _extends3.tabIndex = 0, _extends3.onBlur = callAllEventHandlers(onBlur, toggleButtonHandleBlur), _extends3), rest2);
23505    return rest2.disabled || (toggleProps.onClick = callAllEventHandlers(onClick, toggleButtonHandleClick), toggleProps.onKeyDown = callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown)), setGetterPropCallInfo("getToggleButtonProps", suppressRefError, refKey, toggleButtonRef), toggleProps;
23506  }, [dispatch, elementIds, latest, mouseAndTouchTrackers, setGetterPropCallInfo, toggleButtonKeyDownHandlers]), getItemProps = useCallback(function(_temp6) {
23507    var _extends4, _ref6 = _temp6 === void 0 ? {} : _temp6, itemProp = _ref6.item, indexProp = _ref6.index, onMouseMove = _ref6.onMouseMove, onClick = _ref6.onClick, onMouseDown = _ref6.onMouseDown;
23508    _ref6.onPress;
23509    var _ref6$refKey = _ref6.refKey, refKey = _ref6$refKey === void 0 ? "ref" : _ref6$refKey, disabledProp = _ref6.disabled, ref = _ref6.ref, rest2 = _objectWithoutPropertiesLoose2(_ref6, _excluded4$1);
23510    disabledProp !== void 0 && console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');
23511    var _latest$current = latest.current, latestState = _latest$current.state, latestProps = _latest$current.props, _getItemAndIndex = getItemAndIndex(itemProp, indexProp, latestProps.items, "Pass either item or index to getItemProps!"), item = _getItemAndIndex[0], index = _getItemAndIndex[1], disabled = latestProps.isItemDisabled(item, index), itemHandleMouseMove = function() {
23512      mouseAndTouchTrackers.isTouchEnd || index === latestState.highlightedIndex || (shouldScrollRef.current = !1, dispatch({
23513        type: ItemMouseMove$1,
23514        index,
23515        disabled
23516      }));
23517    }, itemHandleClick = function() {
23518      dispatch({
23519        type: ItemClick$1,
23520        index
23521      });
23522    }, itemHandleMouseDown = function(e2) {
23523      return e2.preventDefault();
23524    }, itemProps = _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function(itemNode) {
23525      itemNode && (itemRefs.current[elementIds.getItemId(index)] = itemNode);
23526    }), _extends4["aria-disabled"] = disabled, _extends4["aria-selected"] = item === latestState.selectedItem, _extends4.id = elementIds.getItemId(index), _extends4.role = "option", _extends4), rest2);
23527    return disabled || (itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick)), itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove), itemProps.onMouseDown = callAllEventHandlers(onMouseDown, itemHandleMouseDown), itemProps;
23528  }, [latest, elementIds, mouseAndTouchTrackers, shouldScrollRef, dispatch]);
23529  return {
23530    // prop getters.
23531    getToggleButtonProps,
23532    getLabelProps,
23533    getMenuProps,
23534    getItemProps,
23535    // actions.
23536    toggleMenu,
23537    openMenu,
23538    closeMenu,
23539    setHighlightedIndex,
23540    selectItem,
23541    reset,
23542    setInputValue,
23543    // state.
23544    highlightedIndex,
23545    isOpen,
23546    selectedItem,
23547    inputValue
23548  };
23549}
23550var InputKeyDownArrowDown = 0, InputKeyDownArrowUp = 1, InputKeyDownEscape = 2, InputKeyDownHome = 3, InputKeyDownEnd = 4, InputKeyDownPageUp = 5, InputKeyDownPageDown = 6, InputKeyDownEnter = 7, InputChange = 8, InputBlur = 9, InputClick = 10, MenuMouseLeave = 11, ItemMouseMove = 12, ItemClick = 13, ToggleButtonClick = 14, FunctionToggleMenu = 15, FunctionOpenMenu = 16, FunctionCloseMenu = 17, FunctionSetHighlightedIndex = 18, FunctionSelectItem = 19, FunctionSetInputValue = 20, FunctionReset$1 = 21, ControlledPropUpdatedSelectedItem = 22, stateChangeTypes$1 = Object.freeze({
23551  __proto__: null,
23552  ControlledPropUpdatedSelectedItem,
23553  FunctionCloseMenu,
23554  FunctionOpenMenu,
23555  FunctionReset: FunctionReset$1,
23556  FunctionSelectItem,
23557  FunctionSetHighlightedIndex,
23558  FunctionSetInputValue,
23559  FunctionToggleMenu,
23560  InputBlur,
23561  InputChange,
23562  InputClick,
23563  InputKeyDownArrowDown,
23564  InputKeyDownArrowUp,
23565  InputKeyDownEnd,
23566  InputKeyDownEnter,
23567  InputKeyDownEscape,
23568  InputKeyDownHome,
23569  InputKeyDownPageDown,
23570  InputKeyDownPageUp,
23571  ItemClick,
23572  ItemMouseMove,
23573  MenuMouseLeave,
23574  ToggleButtonClick
23575});
23576function getInitialState$1(props) {
23577  var initialState = getInitialState$2(props), selectedItem = initialState.selectedItem, inputValue = initialState.inputValue;
23578  return inputValue === "" && selectedItem && props.defaultInputValue === void 0 && props.initialInputValue === void 0 && props.inputValue === void 0 && (inputValue = props.itemToString(selectedItem)), _extends({}, initialState, {
23579    inputValue
23580  });
23581}
23582var propTypes$1 = _extends({}, commonDropdownPropTypes, {
23583  items: import_prop_types3.default.array.isRequired,
23584  isItemDisabled: import_prop_types3.default.func,
23585  inputValue: import_prop_types3.default.string,
23586  defaultInputValue: import_prop_types3.default.string,
23587  initialInputValue: import_prop_types3.default.string,
23588  inputId: import_prop_types3.default.string,
23589  onInputValueChange: import_prop_types3.default.func
23590});
23591function useControlledReducer(reducer, props, createInitialState, isStateEqual2) {
23592  var previousSelectedItemRef = useRef(), _useEnhancedReducer = useEnhancedReducer(reducer, props, createInitialState, isStateEqual2), state = _useEnhancedReducer[0], dispatch = _useEnhancedReducer[1], isInitialMount = useIsInitialMount();
23593  return useEffect(function() {
23594    if (isControlledProp(props, "selectedItem")) {
23595      if (!isInitialMount) {
23596        var shouldCallDispatch = props.itemToKey(props.selectedItem) !== props.itemToKey(previousSelectedItemRef.current);
23597        shouldCallDispatch && dispatch({
23598          type: ControlledPropUpdatedSelectedItem,
23599          inputValue: props.itemToString(props.selectedItem)
23600        });
23601      }
23602      previousSelectedItemRef.current = state.selectedItem === previousSelectedItemRef.current ? props.selectedItem : state.selectedItem;
23603    }
23604  }, [state.selectedItem, props.selectedItem]), [getState2(state, props), dispatch];
23605}
23606var validatePropTypes$1 = noop4, defaultProps$1 = _extends({}, defaultProps$3, {
23607  isItemDisabled: function() {
23608    return !1;
23609  }
23610});
23611function downshiftUseComboboxReducer(state, action) {
23612  var _props$items, type = action.type, props = action.props, altKey = action.altKey, changes;
23613  switch (type) {
23614    case ItemClick:
23615      changes = {
23616        isOpen: getDefaultValue$1(props, "isOpen"),
23617        highlightedIndex: getDefaultHighlightedIndex(props),
23618        selectedItem: props.items[action.index],
23619        inputValue: props.itemToString(props.items[action.index])
23620      };
23621      break;
23622    case InputKeyDownArrowDown:
23623      state.isOpen ? changes = {
23624        highlightedIndex: getHighlightedIndex(state.highlightedIndex, 1, props.items, props.isItemDisabled, !0)
23625      } : changes = {
23626        highlightedIndex: altKey && state.selectedItem == null ? -1 : getHighlightedIndexOnOpen(props, state, 1),
23627        isOpen: props.items.length >= 0
23628      };
23629      break;
23630    case InputKeyDownArrowUp:
23631      state.isOpen ? altKey ? changes = getChangesOnSelection(props, state.highlightedIndex) : changes = {
23632        highlightedIndex: getHighlightedIndex(state.highlightedIndex, -1, props.items, props.isItemDisabled, !0)
23633      } : changes = {
23634        highlightedIndex: getHighlightedIndexOnOpen(props, state, -1),
23635        isOpen: props.items.length >= 0
23636      };
23637      break;
23638    case InputKeyDownEnter:
23639      changes = getChangesOnSelection(props, state.highlightedIndex);
23640      break;
23641    case InputKeyDownEscape:
23642      changes = _extends({
23643        isOpen: !1,
23644        highlightedIndex: -1
23645      }, !state.isOpen && {
23646        selectedItem: null,
23647        inputValue: ""
23648      });
23649      break;
23650    case InputKeyDownPageUp:
23651      changes = {
23652        highlightedIndex: getHighlightedIndex(state.highlightedIndex, -10, props.items, props.isItemDisabled, !0)
23653      };
23654      break;
23655    case InputKeyDownPageDown:
23656      changes = {
23657        highlightedIndex: getHighlightedIndex(state.highlightedIndex, 10, props.items, props.isItemDisabled, !0)
23658      };
23659      break;
23660    case InputKeyDownHome:
23661      changes = {
23662        highlightedIndex: getNonDisabledIndex(0, !1, props.items, props.isItemDisabled)
23663      };
23664      break;
23665    case InputKeyDownEnd:
23666      changes = {
23667        highlightedIndex: getNonDisabledIndex(props.items.length - 1, !0, props.items, props.isItemDisabled)
23668      };
23669      break;
23670    case InputBlur:
23671      changes = _extends({
23672        isOpen: !1,
23673        highlightedIndex: -1
23674      }, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && action.selectItem && {
23675        selectedItem: props.items[state.highlightedIndex],
23676        inputValue: props.itemToString(props.items[state.highlightedIndex])
23677      });
23678      break;
23679    case InputChange:
23680      changes = {
23681        isOpen: !0,
23682        highlightedIndex: getDefaultHighlightedIndex(props),
23683        inputValue: action.inputValue
23684      };
23685      break;
23686    case InputClick:
23687      changes = {
23688        isOpen: !state.isOpen,
23689        highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0)
23690      };
23691      break;
23692    case FunctionSelectItem:
23693      changes = {
23694        selectedItem: action.selectedItem,
23695        inputValue: props.itemToString(action.selectedItem)
23696      };
23697      break;
23698    case ControlledPropUpdatedSelectedItem:
23699      changes = {
23700        inputValue: action.inputValue
23701      };
23702      break;
23703    default:
23704      return downshiftCommonReducer(state, action, stateChangeTypes$1);
23705  }
23706  return _extends({}, state, changes);
23707}
23708var _excluded$12 = ["onMouseLeave", "refKey", "ref"], _excluded2$1 = ["item", "index", "refKey", "ref", "onMouseMove", "onMouseDown", "onClick", "onPress", "disabled"], _excluded3 = ["onClick", "onPress", "refKey", "ref"], _excluded4 = ["onKeyDown", "onChange", "onInput", "onBlur", "onChangeText", "onClick", "refKey", "ref"];
23709useCombobox.stateChangeTypes = stateChangeTypes$1;
23710function useCombobox(userProps) {
23711  userProps === void 0 && (userProps = {}), validatePropTypes$1(userProps, useCombobox);
23712  var props = _extends({}, defaultProps$1, userProps), items = props.items, scrollIntoView3 = props.scrollIntoView, environment = props.environment, getA11yStatusMessage2 = props.getA11yStatusMessage, _useControlledReducer = useControlledReducer(downshiftUseComboboxReducer, props, getInitialState$1, isDropdownsStateEqual), state = _useControlledReducer[0], dispatch = _useControlledReducer[1], isOpen = state.isOpen, highlightedIndex = state.highlightedIndex, selectedItem = state.selectedItem, inputValue = state.inputValue, menuRef = useRef(null), itemRefs = useRef({}), inputRef = useRef(null), toggleButtonRef = useRef(null), isInitialMount = useIsInitialMount(), elementIds = useElementIds(props), previousResultCountRef = useRef(), latest = useLatestRef({
23713    state,
23714    props
23715  }), getItemNodeFromIndex = useCallback(function(index) {
23716    return itemRefs.current[elementIds.getItemId(index)];
23717  }, [elementIds]);
23718  useA11yMessageStatus(getA11yStatusMessage2, state, [isOpen, highlightedIndex, selectedItem, inputValue], environment);
23719  var shouldScrollRef = useScrollIntoView({
23720    menuElement: menuRef.current,
23721    highlightedIndex,
23722    isOpen,
23723    itemRefs,
23724    scrollIntoView: scrollIntoView3,
23725    getItemNodeFromIndex
23726  });
23727  useControlPropsValidator({
23728    props,
23729    state
23730  }), useEffect(function() {
23731    var focusOnOpen = getInitialValue$1(props, "isOpen");
23732    focusOnOpen && inputRef.current && inputRef.current.focus();
23733  }, []), useEffect(function() {
23734    isInitialMount || (previousResultCountRef.current = items.length);
23735  });
23736  var mouseAndTouchTrackers = useMouseAndTouchTracker(environment, useCallback(function() {
23737    latest.current.state.isOpen && dispatch({
23738      type: InputBlur,
23739      selectItem: !1
23740    });
23741  }, [dispatch, latest]), useMemo(function() {
23742    return [menuRef, toggleButtonRef, inputRef];
23743  }, [menuRef.current, toggleButtonRef.current, inputRef.current])), setGetterPropCallInfo = useGetterPropsCalledChecker("getInputProps", "getMenuProps");
23744  useEffect(function() {
23745    isOpen || (itemRefs.current = {});
23746  }, [isOpen]), useEffect(function() {
23747    var _inputRef$current;
23748    !isOpen || !(environment != null && environment.document) || !(inputRef != null && (_inputRef$current = inputRef.current) != null && _inputRef$current.focus) || environment.document.activeElement !== inputRef.current && inputRef.current.focus();
23749  }, [isOpen, environment]);
23750  var inputKeyDownHandlers = useMemo(function() {
23751    return {
23752      ArrowDown: function(event) {
23753        event.preventDefault(), dispatch({
23754          type: InputKeyDownArrowDown,
23755          altKey: event.altKey
23756        });
23757      },
23758      ArrowUp: function(event) {
23759        event.preventDefault(), dispatch({
23760          type: InputKeyDownArrowUp,
23761          altKey: event.altKey
23762        });
23763      },
23764      Home: function(event) {
23765        latest.current.state.isOpen && (event.preventDefault(), dispatch({
23766          type: InputKeyDownHome
23767        }));
23768      },
23769      End: function(event) {
23770        latest.current.state.isOpen && (event.preventDefault(), dispatch({
23771          type: InputKeyDownEnd
23772        }));
23773      },
23774      Escape: function(event) {
23775        var latestState = latest.current.state;
23776        (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) && (event.preventDefault(), dispatch({
23777          type: InputKeyDownEscape
23778        }));
23779      },
23780      Enter: function(event) {
23781        var latestState = latest.current.state;
23782        !latestState.isOpen || event.which === 229 || (event.preventDefault(), dispatch({
23783          type: InputKeyDownEnter
23784        }));
23785      },
23786      PageUp: function(event) {
23787        latest.current.state.isOpen && (event.preventDefault(), dispatch({
23788          type: InputKeyDownPageUp
23789        }));
23790      },
23791      PageDown: function(event) {
23792        latest.current.state.isOpen && (event.preventDefault(), dispatch({
23793          type: InputKeyDownPageDown
23794        }));
23795      }
23796    };
23797  }, [dispatch, latest]), getLabelProps = useCallback(function(labelProps) {
23798    return _extends({
23799      id: elementIds.labelId,
23800      htmlFor: elementIds.inputId
23801    }, labelProps);
23802  }, [elementIds]), getMenuProps = useCallback(function(_temp, _temp2) {
23803    var _extends22, _ref = _temp === void 0 ? {} : _temp, onMouseLeave = _ref.onMouseLeave, _ref$refKey = _ref.refKey, refKey = _ref$refKey === void 0 ? "ref" : _ref$refKey, ref = _ref.ref, rest2 = _objectWithoutPropertiesLoose2(_ref, _excluded$12), _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$suppressRefErro = _ref2.suppressRefError, suppressRefError = _ref2$suppressRefErro === void 0 ? !1 : _ref2$suppressRefErro;
23804    return setGetterPropCallInfo("getMenuProps", suppressRefError, refKey, menuRef), _extends((_extends22 = {}, _extends22[refKey] = handleRefs(ref, function(menuNode) {
23805      menuRef.current = menuNode;
23806    }), _extends22.id = elementIds.menuId, _extends22.role = "listbox", _extends22["aria-labelledby"] = rest2 && rest2["aria-label"] ? void 0 : "" + elementIds.labelId, _extends22.onMouseLeave = callAllEventHandlers(onMouseLeave, function() {
23807      dispatch({
23808        type: MenuMouseLeave
23809      });
23810    }), _extends22), rest2);
23811  }, [dispatch, setGetterPropCallInfo, elementIds]), getItemProps = useCallback(function(_temp3) {
23812    var _extends3, _ref4, _ref3 = _temp3 === void 0 ? {} : _temp3, itemProp = _ref3.item, indexProp = _ref3.index, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, ref = _ref3.ref, onMouseMove = _ref3.onMouseMove, onMouseDown = _ref3.onMouseDown, onClick = _ref3.onClick;
23813    _ref3.onPress;
23814    var disabledProp = _ref3.disabled, rest2 = _objectWithoutPropertiesLoose2(_ref3, _excluded2$1);
23815    disabledProp !== void 0 && console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');
23816    var _latest$current = latest.current, latestProps = _latest$current.props, latestState = _latest$current.state, _getItemAndIndex = getItemAndIndex(itemProp, indexProp, latestProps.items, "Pass either item or index to getItemProps!"), item = _getItemAndIndex[0], index = _getItemAndIndex[1], disabled = latestProps.isItemDisabled(item, index), onSelectKey = "onClick", customClickHandler = onClick, itemHandleMouseMove = function() {
23817      mouseAndTouchTrackers.isTouchEnd || index === latestState.highlightedIndex || (shouldScrollRef.current = !1, dispatch({
23818        type: ItemMouseMove,
23819        index,
23820        disabled
23821      }));
23822    }, itemHandleClick = function() {
23823      dispatch({
23824        type: ItemClick,
23825        index
23826      });
23827    }, itemHandleMouseDown = function(e2) {
23828      return e2.preventDefault();
23829    };
23830    return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function(itemNode) {
23831      itemNode && (itemRefs.current[elementIds.getItemId(index)] = itemNode);
23832    }), _extends3["aria-disabled"] = disabled, _extends3["aria-selected"] = index === latestState.highlightedIndex, _extends3.id = elementIds.getItemId(index), _extends3.role = "option", _extends3), !disabled && (_ref4 = {}, _ref4[onSelectKey] = callAllEventHandlers(customClickHandler, itemHandleClick), _ref4), {
23833      onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),
23834      onMouseDown: callAllEventHandlers(onMouseDown, itemHandleMouseDown)
23835    }, rest2);
23836  }, [dispatch, elementIds, latest, mouseAndTouchTrackers, shouldScrollRef]), getToggleButtonProps = useCallback(function(_temp4) {
23837    var _extends4, _ref5 = _temp4 === void 0 ? {} : _temp4, onClick = _ref5.onClick;
23838    _ref5.onPress;
23839    var _ref5$refKey = _ref5.refKey, refKey = _ref5$refKey === void 0 ? "ref" : _ref5$refKey, ref = _ref5.ref, rest2 = _objectWithoutPropertiesLoose2(_ref5, _excluded3), latestState = latest.current.state, toggleButtonHandleClick = function() {
23840      dispatch({
23841        type: ToggleButtonClick
23842      });
23843    };
23844    return _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function(toggleButtonNode) {
23845      toggleButtonRef.current = toggleButtonNode;
23846    }), _extends4["aria-controls"] = elementIds.menuId, _extends4["aria-expanded"] = latestState.isOpen, _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest2.disabled && _extends({}, {
23847      onClick: callAllEventHandlers(onClick, toggleButtonHandleClick)
23848    }), rest2);
23849  }, [dispatch, latest, elementIds]), getInputProps = useCallback(function(_temp5, _temp6) {
23850    var _extends5, _ref6 = _temp5 === void 0 ? {} : _temp5, onKeyDown = _ref6.onKeyDown, onChange = _ref6.onChange, onInput = _ref6.onInput, onBlur = _ref6.onBlur;
23851    _ref6.onChangeText;
23852    var onClick = _ref6.onClick, _ref6$refKey = _ref6.refKey, refKey = _ref6$refKey === void 0 ? "ref" : _ref6$refKey, ref = _ref6.ref, rest2 = _objectWithoutPropertiesLoose2(_ref6, _excluded4), _ref7 = _temp6 === void 0 ? {} : _temp6, _ref7$suppressRefErro = _ref7.suppressRefError, suppressRefError = _ref7$suppressRefErro === void 0 ? !1 : _ref7$suppressRefErro;
23853    setGetterPropCallInfo("getInputProps", suppressRefError, refKey, inputRef);
23854    var latestState = latest.current.state, inputHandleKeyDown = function(event) {
23855      var key = normalizeArrowKey(event);
23856      key && inputKeyDownHandlers[key] && inputKeyDownHandlers[key](event);
23857    }, inputHandleChange = function(event) {
23858      dispatch({
23859        type: InputChange,
23860        inputValue: event.target.value
23861      });
23862    }, inputHandleBlur = function(event) {
23863      if (environment != null && environment.document && latestState.isOpen && !mouseAndTouchTrackers.isMouseDown) {
23864        var isBlurByTabChange = event.relatedTarget === null && environment.document.activeElement !== environment.document.body;
23865        dispatch({
23866          type: InputBlur,
23867          selectItem: !isBlurByTabChange
23868        });
23869      }
23870    }, inputHandleClick = function() {
23871      dispatch({
23872        type: InputClick
23873      });
23874    }, onChangeKey = "onChange", eventHandlers = {};
23875    if (!rest2.disabled) {
23876      var _eventHandlers;
23877      eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, inputHandleBlur), _eventHandlers.onClick = callAllEventHandlers(onClick, inputHandleClick), _eventHandlers);
23878    }
23879    return _extends((_extends5 = {}, _extends5[refKey] = handleRefs(ref, function(inputNode) {
23880      inputRef.current = inputNode;
23881    }), _extends5["aria-activedescendant"] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : "", _extends5["aria-autocomplete"] = "list", _extends5["aria-controls"] = elementIds.menuId, _extends5["aria-expanded"] = latestState.isOpen, _extends5["aria-labelledby"] = rest2 && rest2["aria-label"] ? void 0 : elementIds.labelId, _extends5.autoComplete = "off", _extends5.id = elementIds.inputId, _extends5.role = "combobox", _extends5.value = latestState.inputValue, _extends5), eventHandlers, rest2);
23882  }, [dispatch, elementIds, environment, inputKeyDownHandlers, latest, mouseAndTouchTrackers, setGetterPropCallInfo]), toggleMenu = useCallback(function() {
23883    dispatch({
23884      type: FunctionToggleMenu
23885    });
23886  }, [dispatch]), closeMenu = useCallback(function() {
23887    dispatch({
23888      type: FunctionCloseMenu
23889    });
23890  }, [dispatch]), openMenu = useCallback(function() {
23891    dispatch({
23892      type: FunctionOpenMenu
23893    });
23894  }, [dispatch]), setHighlightedIndex = useCallback(function(newHighlightedIndex) {
23895    dispatch({
23896      type: FunctionSetHighlightedIndex,
23897      highlightedIndex: newHighlightedIndex
23898    });
23899  }, [dispatch]), selectItem = useCallback(function(newSelectedItem) {
23900    dispatch({
23901      type: FunctionSelectItem,
23902      selectedItem: newSelectedItem
23903    });
23904  }, [dispatch]), setInputValue = useCallback(function(newInputValue) {
23905    dispatch({
23906      type: FunctionSetInputValue,
23907      inputValue: newInputValue
23908    });
23909  }, [dispatch]), reset = useCallback(function() {
23910    dispatch({
23911      type: FunctionReset$1
23912    });
23913  }, [dispatch]);
23914  return {
23915    // prop getters.
23916    getItemProps,
23917    getLabelProps,
23918    getMenuProps,
23919    getInputProps,
23920    getToggleButtonProps,
23921    // actions.
23922    toggleMenu,
23923    openMenu,
23924    closeMenu,
23925    setHighlightedIndex,
23926    setInputValue,
23927    selectItem,
23928    reset,
23929    // state.
23930    highlightedIndex,
23931    isOpen,
23932    selectedItem,
23933    inputValue
23934  };
23935}
23936var defaultStateValues = {
23937  activeIndex: -1,
23938  selectedItems: []
23939};
23940function getInitialValue(props, propKey) {
23941  return getInitialValue$1(props, propKey, defaultStateValues);
23942}
23943function getDefaultValue(props, propKey) {
23944  return getDefaultValue$1(props, propKey, defaultStateValues);
23945}
23946function getInitialState(props) {
23947  var activeIndex = getInitialValue(props, "activeIndex"), selectedItems = getInitialValue(props, "selectedItems");
23948  return {
23949    activeIndex,
23950    selectedItems
23951  };
23952}
23953function isKeyDownOperationPermitted(event) {
23954  if (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey)
23955    return !1;
23956  var element = event.target;
23957  return !(element instanceof HTMLInputElement && // if element is a text input
23958  element.value !== "" && // and we have text in it
23959  // and cursor is either not at the start or is currently highlighting text.
23960  (element.selectionStart !== 0 || element.selectionEnd !== 0));
23961}
23962function isStateEqual(prevState, newState) {
23963  return prevState.selectedItems === newState.selectedItems && prevState.activeIndex === newState.activeIndex;
23964}
23965var propTypes = {
23966  stateReducer: commonPropTypes.stateReducer,
23967  itemToKey: commonPropTypes.itemToKey,
23968  environment: commonPropTypes.environment,
23969  selectedItems: import_prop_types3.default.array,
23970  initialSelectedItems: import_prop_types3.default.array,
23971  defaultSelectedItems: import_prop_types3.default.array,
23972  getA11yStatusMessage: import_prop_types3.default.func,
23973  activeIndex: import_prop_types3.default.number,
23974  initialActiveIndex: import_prop_types3.default.number,
23975  defaultActiveIndex: import_prop_types3.default.number,
23976  onActiveIndexChange: import_prop_types3.default.func,
23977  onSelectedItemsChange: import_prop_types3.default.func,
23978  keyNavigationNext: import_prop_types3.default.string,
23979  keyNavigationPrevious: import_prop_types3.default.string
23980}, defaultProps2 = {
23981  itemToKey: defaultProps$3.itemToKey,
23982  stateReducer: defaultProps$3.stateReducer,
23983  environment: defaultProps$3.environment,
23984  keyNavigationNext: "ArrowRight",
23985  keyNavigationPrevious: "ArrowLeft"
23986}, validatePropTypes = noop4, SelectedItemClick = 0, SelectedItemKeyDownDelete = 1, SelectedItemKeyDownBackspace = 2, SelectedItemKeyDownNavigationNext = 3, SelectedItemKeyDownNavigationPrevious = 4, DropdownKeyDownNavigationPrevious = 5, DropdownKeyDownBackspace = 6, DropdownClick = 7, FunctionAddSelectedItem = 8, FunctionRemoveSelectedItem = 9, FunctionSetSelectedItems = 10, FunctionSetActiveIndex = 11, FunctionReset = 12, stateChangeTypes = Object.freeze({
23987  __proto__: null,
23988  DropdownClick,
23989  DropdownKeyDownBackspace,
23990  DropdownKeyDownNavigationPrevious,
23991  FunctionAddSelectedItem,
23992  FunctionRemoveSelectedItem,
23993  FunctionReset,
23994  FunctionSetActiveIndex,
23995  FunctionSetSelectedItems,
23996  SelectedItemClick,
23997  SelectedItemKeyDownBackspace,
23998  SelectedItemKeyDownDelete,
23999  SelectedItemKeyDownNavigationNext,
24000  SelectedItemKeyDownNavigationPrevious
24001});
24002function downshiftMultipleSelectionReducer(state, action) {
24003  var type = action.type, index = action.index, props = action.props, selectedItem = action.selectedItem, activeIndex = state.activeIndex, selectedItems = state.selectedItems, changes;
24004  switch (type) {
24005    case SelectedItemClick:
24006      changes = {
24007        activeIndex: index
24008      };
24009      break;
24010    case SelectedItemKeyDownNavigationPrevious:
24011      changes = {
24012        activeIndex: activeIndex - 1 < 0 ? 0 : activeIndex - 1
24013      };
24014      break;
24015    case SelectedItemKeyDownNavigationNext:
24016      changes = {
24017        activeIndex: activeIndex + 1 >= selectedItems.length ? -1 : activeIndex + 1
24018      };
24019      break;
24020    case SelectedItemKeyDownBackspace:
24021    case SelectedItemKeyDownDelete: {
24022      if (activeIndex < 0)
24023        break;
24024      var newActiveIndex = activeIndex;
24025      selectedItems.length === 1 ? newActiveIndex = -1 : activeIndex === selectedItems.length - 1 && (newActiveIndex = selectedItems.length - 2), changes = _extends({
24026        selectedItems: [].concat(selectedItems.slice(0, activeIndex), selectedItems.slice(activeIndex + 1))
24027      }, {
24028        activeIndex: newActiveIndex
24029      });
24030      break;
24031    }
24032    case DropdownKeyDownNavigationPrevious:
24033      changes = {
24034        activeIndex: selectedItems.length - 1
24035      };
24036      break;
24037    case DropdownKeyDownBackspace:
24038      changes = {
24039        selectedItems: selectedItems.slice(0, selectedItems.length - 1)
24040      };
24041      break;
24042    case FunctionAddSelectedItem:
24043      changes = {
24044        selectedItems: [].concat(selectedItems, [selectedItem])
24045      };
24046      break;
24047    case DropdownClick:
24048      changes = {
24049        activeIndex: -1
24050      };
24051      break;
24052    case FunctionRemoveSelectedItem: {
24053      var _newActiveIndex = activeIndex, selectedItemIndex = selectedItems.findIndex(function(item) {
24054        return props.itemToKey(item) === props.itemToKey(selectedItem);
24055      });
24056      if (selectedItemIndex < 0)
24057        break;
24058      selectedItems.length === 1 ? _newActiveIndex = -1 : selectedItemIndex === selectedItems.length - 1 && (_newActiveIndex = selectedItems.length - 2), changes = {
24059        selectedItems: [].concat(selectedItems.slice(0, selectedItemIndex), selectedItems.slice(selectedItemIndex + 1)),
24060        activeIndex: _newActiveIndex
24061      };
24062      break;
24063    }
24064    case FunctionSetSelectedItems: {
24065      var newSelectedItems = action.selectedItems;
24066      changes = {
24067        selectedItems: newSelectedItems
24068      };
24069      break;
24070    }
24071    case FunctionSetActiveIndex: {
24072      var _newActiveIndex2 = action.activeIndex;
24073      changes = {
24074        activeIndex: _newActiveIndex2
24075      };
24076      break;
24077    }
24078    case FunctionReset:
24079      changes = {
24080        activeIndex: getDefaultValue(props, "activeIndex"),
24081        selectedItems: getDefaultValue(props, "selectedItems")
24082      };
24083      break;
24084    default:
24085      throw new Error("Reducer called without proper action type.");
24086  }
24087  return _extends({}, state, changes);
24088}
24089var _excluded2 = ["refKey", "ref", "onClick", "onKeyDown", "selectedItem", "index"], _excluded22 = ["refKey", "ref", "onKeyDown", "onClick", "preventKeyAction"];
24090useMultipleSelection.stateChangeTypes = stateChangeTypes;
24091function useMultipleSelection(userProps) {
24092  userProps === void 0 && (userProps = {}), validatePropTypes(userProps, useMultipleSelection);
24093  var props = _extends({}, defaultProps2, userProps), getA11yStatusMessage2 = props.getA11yStatusMessage, environment = props.environment, keyNavigationNext = props.keyNavigationNext, keyNavigationPrevious = props.keyNavigationPrevious, _useControlledReducer = useControlledReducer$1(downshiftMultipleSelectionReducer, props, getInitialState, isStateEqual), state = _useControlledReducer[0], dispatch = _useControlledReducer[1], activeIndex = state.activeIndex, selectedItems = state.selectedItems, isInitialMount = useIsInitialMount(), dropdownRef = useRef(null), selectedItemRefs = useRef();
24094  selectedItemRefs.current = [];
24095  var latest = useLatestRef({
24096    state,
24097    props
24098  });
24099  useA11yMessageStatus(getA11yStatusMessage2, state, [activeIndex, selectedItems], environment), useEffect(function() {
24100    isInitialMount || (activeIndex === -1 && dropdownRef.current ? dropdownRef.current.focus() : selectedItemRefs.current[activeIndex] && selectedItemRefs.current[activeIndex].focus());
24101  }, [activeIndex]), useControlPropsValidator({
24102    props,
24103    state
24104  });
24105  var setGetterPropCallInfo = useGetterPropsCalledChecker("getDropdownProps"), selectedItemKeyDownHandlers = useMemo(function() {
24106    var _ref;
24107    return _ref = {}, _ref[keyNavigationPrevious] = function() {
24108      dispatch({
24109        type: SelectedItemKeyDownNavigationPrevious
24110      });
24111    }, _ref[keyNavigationNext] = function() {
24112      dispatch({
24113        type: SelectedItemKeyDownNavigationNext
24114      });
24115    }, _ref.Delete = function() {
24116      dispatch({
24117        type: SelectedItemKeyDownDelete
24118      });
24119    }, _ref.Backspace = function() {
24120      dispatch({
24121        type: SelectedItemKeyDownBackspace
24122      });
24123    }, _ref;
24124  }, [dispatch, keyNavigationNext, keyNavigationPrevious]), dropdownKeyDownHandlers = useMemo(function() {
24125    var _ref2;
24126    return _ref2 = {}, _ref2[keyNavigationPrevious] = function(event) {
24127      isKeyDownOperationPermitted(event) && dispatch({
24128        type: DropdownKeyDownNavigationPrevious
24129      });
24130    }, _ref2.Backspace = function(event) {
24131      isKeyDownOperationPermitted(event) && dispatch({
24132        type: DropdownKeyDownBackspace
24133      });
24134    }, _ref2;
24135  }, [dispatch, keyNavigationPrevious]), getSelectedItemProps = useCallback(function(_temp) {
24136    var _extends22, _ref3 = _temp === void 0 ? {} : _temp, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, ref = _ref3.ref, onClick = _ref3.onClick, onKeyDown = _ref3.onKeyDown, selectedItemProp = _ref3.selectedItem, indexProp = _ref3.index, rest2 = _objectWithoutPropertiesLoose2(_ref3, _excluded2), latestState = latest.current.state, _getItemAndIndex = getItemAndIndex(selectedItemProp, indexProp, latestState.selectedItems, "Pass either item or index to getSelectedItemProps!"), index = _getItemAndIndex[1], isFocusable = index > -1 && index === latestState.activeIndex, selectedItemHandleClick = function() {
24137      dispatch({
24138        type: SelectedItemClick,
24139        index
24140      });
24141    }, selectedItemHandleKeyDown = function(event) {
24142      var key = normalizeArrowKey(event);
24143      key && selectedItemKeyDownHandlers[key] && selectedItemKeyDownHandlers[key](event);
24144    };
24145    return _extends((_extends22 = {}, _extends22[refKey] = handleRefs(ref, function(selectedItemNode) {
24146      selectedItemNode && selectedItemRefs.current.push(selectedItemNode);
24147    }), _extends22.tabIndex = isFocusable ? 0 : -1, _extends22.onClick = callAllEventHandlers(onClick, selectedItemHandleClick), _extends22.onKeyDown = callAllEventHandlers(onKeyDown, selectedItemHandleKeyDown), _extends22), rest2);
24148  }, [dispatch, latest, selectedItemKeyDownHandlers]), getDropdownProps = useCallback(function(_temp2, _temp3) {
24149    var _extends3, _ref4 = _temp2 === void 0 ? {} : _temp2, _ref4$refKey = _ref4.refKey, refKey = _ref4$refKey === void 0 ? "ref" : _ref4$refKey, ref = _ref4.ref, onKeyDown = _ref4.onKeyDown, onClick = _ref4.onClick, _ref4$preventKeyActio = _ref4.preventKeyAction, preventKeyAction = _ref4$preventKeyActio === void 0 ? !1 : _ref4$preventKeyActio, rest2 = _objectWithoutPropertiesLoose2(_ref4, _excluded22), _ref5 = _temp3 === void 0 ? {} : _temp3, _ref5$suppressRefErro = _ref5.suppressRefError, suppressRefError = _ref5$suppressRefErro === void 0 ? !1 : _ref5$suppressRefErro;
24150    setGetterPropCallInfo("getDropdownProps", suppressRefError, refKey, dropdownRef);
24151    var dropdownHandleKeyDown = function(event) {
24152      var key = normalizeArrowKey(event);
24153      key && dropdownKeyDownHandlers[key] && dropdownKeyDownHandlers[key](event);
24154    }, dropdownHandleClick = function() {
24155      dispatch({
24156        type: DropdownClick
24157      });
24158    };
24159    return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function(dropdownNode) {
24160      dropdownNode && (dropdownRef.current = dropdownNode);
24161    }), _extends3), !preventKeyAction && {
24162      onKeyDown: callAllEventHandlers(onKeyDown, dropdownHandleKeyDown),
24163      onClick: callAllEventHandlers(onClick, dropdownHandleClick)
24164    }, rest2);
24165  }, [dispatch, dropdownKeyDownHandlers, setGetterPropCallInfo]), addSelectedItem = useCallback(function(selectedItem) {
24166    dispatch({
24167      type: FunctionAddSelectedItem,
24168      selectedItem
24169    });
24170  }, [dispatch]), removeSelectedItem = useCallback(function(selectedItem) {
24171    dispatch({
24172      type: FunctionRemoveSelectedItem,
24173      selectedItem
24174    });
24175  }, [dispatch]), setSelectedItems = useCallback(function(newSelectedItems) {
24176    dispatch({
24177      type: FunctionSetSelectedItems,
24178      selectedItems: newSelectedItems
24179    });
24180  }, [dispatch]), setActiveIndex = useCallback(function(newActiveIndex) {
24181    dispatch({
24182      type: FunctionSetActiveIndex,
24183      activeIndex: newActiveIndex
24184    });
24185  }, [dispatch]), reset = useCallback(function() {
24186    dispatch({
24187      type: FunctionReset
24188    });
24189  }, [dispatch]);
24190  return {
24191    getSelectedItemProps,
24192    getDropdownProps,
24193    addSelectedItem,
24194    removeSelectedItem,
24195    setSelectedItems,
24196    setActiveIndex,
24197    reset,
24198    selectedItems,
24199    activeIndex
24200  };
24201}
24202
vendor: 621 bytes, lines 24203-24227
24203// src/manager/components/sidebar/Search.tsx
24204var import_fuse = __toESM(require_fuse(), 1);
24205
24206// src/manager/components/sidebar/types.ts
24207function isExpandType(x2) {
24208  return !!(x2 && x2.showAll);
24209}
24210function isSearchResult(x2) {
24211  return !!(x2 && x2.item);
24212}
24213
24214// src/manager/components/sidebar/Search.tsx
24215var { document: document7 } = scope, DEFAULT_MAX_SEARCH_RESULTS = 50, options = {
24216  shouldSort: !0,
24217  tokenize: !0,
24218  findAllMatches: !0,
24219  includeScore: !0,
24220  includeMatches: !0,
24221  threshold: 0.2,
24222  location: 0,
24223  distance: 100,
24224  maxPatternLength: 32,
24225  minMatchCharLength: 1,
24226  keys: [
24227    { name: "name", weight: 0.
242277 },
24228    { name: "path", weight: 0.3 }
24229  ]
24230}, SearchBar = styled.div({
24231  display: "flex",
24232  flexDirection: "row",
24233  columnGap: 6
24234}), ScreenReaderLabel = styled.label({
24235  position: "absolute",
24236  left: -1e4,
24237  top: "auto",
24238  width: 1,
24239  height: 1,
24240  overflow: "hidden"
24241}), SearchField2 = styled.div(({ theme, isMobile: isMobile2 }) => ({
24242  display: "flex",
24243  flexDirection: "row",
24244  alignItems: "center",
24245  padding: isMobile2 ? 4 : 2,
24246  flexGrow: 1,
24247  height: isMobile2 ? 36 : 32,
24248  width: "100%",
24249  boxShadow: `${theme.button.border} 0 0 0 1px inset`,
24250  borderRadius: theme.appBorderRadius + 2,
24251  "&:has(input:focus), &:has(input:active)": {
24252    background: theme.background.app,
24253    outline: `2px solid ${theme.color.secondary}`,
24254    outlineOffset: 2
24255  }
24256})), IconWrapper = styled.div(({ theme, onClick }) => ({
24257  cursor: onClick ? "pointer" : "default",
24258  flex: "0 0 28px",
24259  height: "100%",
24260  pointerEvents: onClick ? "auto" : "none",
24261  color: theme.textMutedColor,
24262  display: "flex",
24263  alignItems: "center",
24264  justifyContent: "center"
24265})), Input = styled.input(({ theme, isMobile: isMobile2 }) => ({
24266  appearance: "none",
24267  height: 28,
24268  width: "100%",
24269  padding: 0,
24270  border: 0,
24271  background: "transparent",
24272  fontSize: isMobile2 ? "16px" : `${theme.typography.size.s1 + 1}px`,
24273  fontFamily: "inherit",
24274  transition: "all 150ms",
24275  color: theme.color.defaultText,
24276  outline: 0,
24277  "&::placeholder": {
24278    color: theme.textMutedColor,
24279    opacity: 1
24280  },
24281  "&:valid ~ code, &:focus ~ code": {
24282    display: "none"
24283  },
24284  "&:invalid ~ svg": {
24285    display: "none"
24286  },
24287  "&:valid ~ svg": {
24288    display: "block"
24289  },
24290  "&::-ms-clear": {
24291    display: "none"
24292  },
24293  "&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration": {
24294    display: "none"
24295  }
24296})), FocusKey = styled.code(({ theme }) => ({
24297  margin: 5,
24298  marginTop: 6,
24299  height: 16,
24300  fontFamily: theme.typography.fonts.base,
24301  lineHeight: "16px",
24302  textAlign: "center",
24303  fontSize: "11px",
24304  color: theme.base === "light" ? theme.color.dark : theme.textMutedColor,
24305  userSelect: "none",
24306  pointerEvents: "none",
24307  display: "flex",
24308  alignItems: "center",
24309  gap: 4,
24310  flexShrink: 0
24311})), FocusKeyCmd = styled.span({
24312  fontSize: "14px"
24313}), Actions = styled.div({
24314  display: "flex",
24315  alignItems: "center",
24316  gap: 2
24317}), FocusContainer = styled.div({ outline: 0 }), Search = react_default.memo(function({
24318  children,
24319  dataset,
24320  enableShortcuts = !0,
24321  getLastViewed,
24322  initialQuery = "",
24323  searchBarContent,
24324  searchFieldContent,
24325  belowSearchContent
24326}) {
24327  let api = useStorybookApi(), inputRef = useRef(null), [inputPlaceholder, setPlaceholder] = useState("Find components"), [allComponents, showAllComponents] = useState(!1), searchShortcut = api ? shortcutToHumanString(api.getShortcutKeys().search) : "/", makeFuse = useCallback(() => {
24328    let list = dataset.entries.reduce((acc, [refId, { index, allStatuses }]) => {
24329      let groupStatus = getGroupStatus(index || {}, allStatuses ?? {});
24330      return index && acc.push(
24331        ...Object.values(index).map((item) => {
24332          let storyStatuses = allStatuses?.[item.id], mostCriticalStatusValue = storyStatuses ? getMostCriticalStatusValue(Object.values(storyStatuses).map((s2) => s2.value)) : null;
24333          return {
24334            ...searchItem(item, dataset.hash[refId]),
24335            status: mostCriticalStatusValue ?? groupStatus[item.id] ?? null
24336          };
24337        })
24338      ), acc;
24339    }, []);
24340    return new import_fuse.default(list, options);
24341  }, [dataset]), getResults = useCallback(
24342    (input) => {
24343      let fuse = makeFuse();
24344      if (!input)
24345        return [];
24346      let results = [], resultIds = /* @__PURE__ */ new Set(), distinctResults = fuse.search(input).filter(({ item }) => !(item.type === "component" || item.type === "docs" || item.type === "story") || // @ts-expect-error (non strict)
24347      resultIds.has(item.parent) ? !1 : (resultIds.add(item.id), !0));
24348      return distinctResults.length && (results = distinctResults.slice(0, allComponents ? 1e3 : DEFAULT_MAX_SEARCH_RESULTS), distinctResults.length > DEFAULT_MAX_SEARCH_RESULTS && !allComponents && results.push({
24349        showAll: () => showAllComponents(!0),
24350        totalCount: distinctResults.length,
24351        moreCount: distinctResults.length - DEFAULT_MAX_SEARCH_RESULTS
24352      })), results;
24353    },
24354    [allComponents, makeFuse]
24355  ), onSelect = useCallback(
24356    (selectedItem) => {
24357      if (isSearchResult(selectedItem)) {
24358        let { id, refId } = selectedItem.item;
24359        api?.selectStory(id, void 0, { ref: refId !== DEFAULT_REF_ID && refId }), inputRef.current.blur(), showAllComponents(!1);
24360        return;
24361      }
24362      isExpandType(selectedItem) && selectedItem.showAll();
24363    },
24364    [api]
24365  ), onInputValueChange = useCallback((inputValue, stateAndHelpers) => {
24366    showAllComponents(!1);
24367  }, []), stateReducer2 = useCallback(
24368    (state, changes) => {
24369      switch (changes.type) {
24370        case Downshift.stateChangeTypes.blurInput:
24371          return {
24372            ...changes,
24373            // Prevent clearing the input on blur
24374            inputValue: state.inputValue,
24375            // Return to the tree view after selecting an item
24376            isOpen: state.inputValue && !state.selectedItem
24377          };
24378        case Downshift.stateChangeTypes.mouseUp:
24379          return state;
24380        case Downshift.stateChangeTypes.keyDownEscape:
24381          return state.inputValue ? { ...changes, inputValue: "", isOpen: !0, selectedItem: null } : { ...changes, isOpen: !1, selectedItem: null };
24382        case Downshift.stateChangeTypes.clickItem:
24383        case Downshift.stateChangeTypes.keyDownEnter:
24384          return isSearchResult(changes.selectedItem) ? { ...changes, inputValue: state.inputValue } : isExpandType(changes.selectedItem) ? state : changes;
24385        default:
24386          return changes;
24387      }
24388    },
24389    []
24390  ), { isMobile: isMobile2 }
24390 = useLayout(), searchLandmarkRef = useRef(null), { landmarkProps } = useLandmark({ role: "search" }, searchLandmarkRef);
24391  return (
24392    // @ts-expect-error (non strict)
24393    react_default.createElement(
24394      Downshift,
24395      {
24396        initialInputValue: initialQuery,
24397        stateReducer: stateReducer2,
24398        itemToString: (result) => result?.item?.name || "",
24399        scrollIntoView: (e2) => scrollIntoView(e2),
24400        onSelect,
24401        onInputValueChange
24402      },
24403      ({
24404        isOpen,
24405        openMenu,
24406        closeMenu,
24407        inputValue,
24408        getInputProps,
24409        getItemProps,
24410        getLabelProps,
24411        getMenuProps,
24412        getRootProps,
24413        highlightedIndex,
24414        reset
24415      }) => {
24416        let input = inputValue ? inputValue.trim() : "", results = input ? getResults(input) : [], lastViewed = !input && getLastViewed();
24417        lastViewed && lastViewed.length && (results = lastViewed.reduce((acc, { storyId, refId }) => {
24418          let data = dataset.hash[refId];
24419          if (data && data.index && data.index[storyId]) {
24420            let story = data.index[storyId], item = story.type === "story" ? data.index[story.parent] : story;
24421            acc.some((res) => res.item.refId === refId && res.item.id === item.id) || acc.push({ item: searchItem(item, dataset.hash[refId]), matches: [], score: 0 });
24422          }
24423          return acc;
24424        }, []));
24425        let inputId = "storybook-explorer-searchfield", inputProps = getInputProps({
24426          id: inputId,
24427          ref: inputRef,
24428          required: !0,
24429          type: "search",
24430          placeholder: inputPlaceholder,
24431          onFocus: () => {
24432            openMenu(), setPlaceholder("Type to find...");
24433          },
24434          onBlur: () => setPlaceholder("Find components"),
24435          onKeyDown: (e2) => {
24436            e2.key === "Escape" && inputValue.length === 0 && inputRef.current.blur();
24437          }
24438        }), labelProps = getLabelProps({
24439          htmlFor: inputId
24440        });
24441        return react_default.createElement(react_default.Fragment, null, react_default.createElement(ScreenReaderLabel, { ...labelProps }, "Search for components"), react_default.createElement(SearchBar, { ref: searchLandmarkRef, ...landmarkProps }, react_default.createElement(
24442          SearchField2,
24443          {
24444            ...getRootProps({ refKey: "" }, { suppressRefError: !0 }),
24445            isMobile: isMobile2,
24446            className: "search-field"
24447          },
24448          react_default.createElement(IconWrapper, null, react_default.createElement(SearchIcon, null)),
24449          react_default.createElement(Input, { ...inputProps, isMobile: isMobile2 }),
24450          !isMobile2 && enableShortcuts && !isOpen && react_default.createElement(FocusKey, null, searchShortcut === "\u2318 K" ? react_default.createElement(react_default.Fragment, null, react_default.createElement(FocusKeyCmd, null, "\u2318"), "K") : searchShortcut),
24451          react_default.createElement(Actions, null, input && react_default.createElement(
24452            Button,
24453            {
24454              padding: "small",
24455              variant: "ghost",
24456              ariaLabel: "Clear search",
24457              onClick: () => {
24458                reset({ inputValue: "" }), closeMenu(), inputRef.current?.focus();
24459              }
24460            },
24461            react_default.createElement(CloseIcon, null)
24462          ), searchFieldContent)
24463        ), searchBarContent), !isOpen && belowSearchContent, react_default.createElement(FocusContainer, { tabIndex: 0, id: "storybook-explorer-menu" }, children({
24464          query: input,
24465          results,
24466          isNavVisible: !isOpen && document7.activeElement !== inputRef.current,
24467          isNavReachable: !isOpen || input.length === 0,
24468          isSearchResultRendered: isOpen,
24469          closeMenu,
24470          getMenuProps,
24471          getItemProps,
24472          highlightedIndex
24473        })));
24474      }
24475    )
24476  );
24477});
24478
vendor: 4,520 bytes, lines 24479-24591
24479// src/manager/components/sidebar/SearchResults.tsx
24480init_react();
24481var { document: document8 } = scope, ResultsList = styled.ol({
24482  listStyle: "none",
24483  margin: 0,
24484  padding: 0
24485}), ResultRow = styled.li(({ theme, isHighlighted }) => ({
24486  width: "100%",
24487  border: "none",
24488  cursor: "pointer",
24489  display: "flex",
24490  alignItems: "start",
24491  justifyContent: "space-between",
24492  textAlign: "left",
24493  color: "inherit",
24494  fontSize: `${theme.typography.size.s2}px`,
24495  background: isHighlighted ? theme.background.hoverable : "transparent",
24496  minHeight: 28,
24497  borderRadius: 4,
24498  gap: 6,
24499  paddingTop: 7,
24500  paddingBottom: 7,
24501  paddingLeft: 8,
24502  paddingRight: 8,
24503  "&:hover, &:focus": {
24504    background: curriedTransparentize$1(0.93, theme.color.secondary),
24505    outline: "none"
24506  }
24507})), IconWrapper2 = styled.div({
24508  marginTop: 2
24509}), ResultRowContent = styled.div({
24510  flex: 1,
24511  display: "flex",
24512  flexDirection: "column"
24513}), Mark = styled.mark(({ theme }) => ({
24514  background: "transparent",
24515  color: theme.color.secondary,
24516  "@media (forced-colors: active)": {
24517    color: "HighlightText",
24518    background: "Highlight"
24519  }
24520})), MoreWrapper = styled.div({
24521  marginTop: 8
24522}), RecentlyOpenedTitle = styled.div(({ theme }) => ({
24523  display: "flex",
24524  justifyContent: "space-between",
24525  fontSize: `${theme.typography.size.s1 - 1}px`,
24526  fontWeight: theme.typography.weight.bold,
24527  minHeight: 28,
24528  letterSpacing: "0.16em",
24529  textTransform: "uppercase",
24530  color: theme.textMutedColor,
24531  marginBottom: 4,
24532  alignItems: "center",
24533  ".search-result-recentlyOpened-clear": {
24534    visibility: "hidden"
24535  },
24536  "&:hover": {
24537    ".search-result-recentlyOpened-clear": {
24538      visibility: "visible"
24539    }
24540  }
24541})), Highlight = react_default.memo(function({
24542  children,
24543  match
24544}) {
24545  if (!match)
24546    return children;
24547  let { value, indices } = match, { nodes: result } = indices.reduce(
24548    ({ cursor, nodes }, [start, end], index, { length }) => (nodes.push(react_default.createElement("span", { key: `${index}-1` }, value.slice(cursor, start))), nodes.push(react_default.createElement(Mark, { key: `${index}-2` }, value.slice(start, end + 1))), index === length - 1 && nodes.push(react_default.createElement("span", { key: `${index}-3` }, value.slice(end + 1))), { cursor: end + 1, nodes }),
24549    { cursor: 0, nodes: [] }
24550  );
24551  return react_default.createElement("span", null, result);
24552}), Title = styled.div({
24553  display: "grid",
24554  justifyContent: "start",
24555  gridAutoColumns: "auto",
24556  gridAutoFlow: "column",
24557  "& > span": {
24558    display: "block",
24559    whiteSpace: "nowrap",
24560    overflow: "hidden",
24561    textOverflow: "ellipsis"
24562  }
24563}), Path = styled.div(({ theme }) => ({
24564  display: "grid",
24565  justifyContent: "start",
24566  gridAutoColumns: "auto",
24567  gridAutoFlow: "column",
24568  fontSize: `${theme.typography.size.s1 - 1}px`,
24569  "& > span": {
24570    display: "block",
24571    whiteSpace: "nowrap",
24572    overflow: "hidden",
24573    textOverflow: "ellipsis"
24574  },
24575  "& > span + span": {
24576    "&:before": {
24577      content: "' / '"
24578    }
24579  }
24580})), Result = react_default.memo(function({ item, matches, onClick, ...props }) {
24581  let theme = useTheme(), click = useCallback(
24582    (event) => {
24583      event.preventDefault(), onClick?.(event);
24584    },
24585    [onClick]
24586  ), api = useStorybookApi();
24587  useEffect(() => {
24588    api && props.isHighlighted && item.type === "component" && api.emit(PRELOAD_ENTRIES, { ids: [item.children[0]] }, { options: { target: item.refId } });
24589  }, [api, props.isHighlighted, item]);
24590  let nameMatch = matches.find((match) => match.key === "name"), pathMatches = matches.filter((match) => match.key === "path"), icon = item.status ? getStatus(theme, item.status).icon : null;
24591  return react_default.createElement(ResultRow, { ...props, onClick: click }, react_default.createElement(IconWrapper2, null, item.type === "component" && react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "14", height: "14", type: "component" }, react_default.createElement(UseSymbol, { type: "component" })), item.type === "story" && react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "14", height: "14", type: item.subtype }, react_default.createElement(UseSymbol, { type: item.subtype })), !(item.type === "component" || item.type === "story") && react_default.createElement(TypeIcon2, { viewBox: "0 0 14 14", width: "14", height: "14", type: "document" }, react_default.createElement(UseSymbol, { type: "document" }))), react_default.createElement(ResultRowContent, { className: "search-result-item--label" }, react_default.createElement(Title
vendor: 5,185 bytes, lines 24591-24704
24591, null, react_default.createElement(Highlight, { match: nameMatch }, item.name)), react_default.createElement(Path, null, item.path.map((group, index) => react_default.createElement("span", { key: index }, react_default.createElement(Highlight, { match: pathMatches.find((match) => match.arrayIndex === index) }, group))))), item.status ? react_default.createElement(StatusLabel, { status: item.status }, icon) : null);
24592}), SearchResults = react_default.memo(function({
24593  query,
24594  results,
24595  closeMenu,
24596  getMenuProps,
24597  getItemProps,
24598  highlightedIndex,
24599  isLoading = !1,
24600  enableShortcuts = !0,
24601  clearLastViewed
24602}) {
24603  let api = useStorybookApi();
24604  useEffect(() => {
24605    let handleEscape = (event) => {
24606      if (!(!enableShortcuts || isLoading || event.repeat) && matchesModifiers(!1, event) && matchesKeyCode("Escape", event)) {
24607        if (event.target?.id === "storybook-explorer-searchfield")
24608          return;
24609        event.preventDefault(), closeMenu();
24610      }
24611    };
24612    return document8.addEventListener("keydown", handleEscape), () => document8.removeEventListener("keydown", handleEscape);
24613  }, [closeMenu, enableShortcuts, isLoading]);
24614  let mouseOverHandler = useCallback((event) => {
24615    if (!api)
24616      return;
24617    let currentTarget = event.currentTarget, storyId = currentTarget.getAttribute("data-id"), refId = currentTarget.getAttribute("data-refid"), item = api.resolveStory(storyId, refId === "storybook_internal" ? void 0 : refId);
24618    item?.type === "component" && api.emit(PRELOAD_ENTRIES, {
24619      // @ts-expect-error (TODO)
24620      ids: [item.isLeaf ? item.id : item.children[0]],
24621      options: { target: refId }
24622    });
24623  }, []), handleClearLastViewed = () => {
24624    clearLastViewed(), closeMenu();
24625  };
24626  return react_default.createElement(ResultsList, { ...getMenuProps(), key: "results-list" }, results.length > 0 && !query && react_default.createElement(RecentlyOpenedTitle, { className: "search-result-recentlyOpened" }, "Recently opened", react_default.createElement(
24627    Button,
24628    {
24629      padding: "small",
24630      variant: "ghost",
24631      className: "search-result-recentlyOpened-clear",
24632      onClick: handleClearLastViewed,
24633      ariaLabel: "Clear recently opened items"
24634    },
24635    react_default.createElement(TrashIcon, null)
24636  )), results.length === 0 && query && react_default.createElement("li", null, react_default.createElement(NoResults2, null, react_default.createElement("strong", null, "No components found"), react_default.createElement("small", null, "Find components by name or path."))), results.map((result, index) => {
24637    if (isExpandType(result)) {
24638      let props = { ...results, ...getItemProps({ key: index, index, item: result }) }, { key: key2, ...rest2 } = props;
24639      return react_default.createElement(MoreWrapper, { key: "search-result-expand" }, react_default.createElement(Button, { key: key2, ...rest2, size: "small" }, "Show ", result.moreCount, " more results"));
24640    }
24641    let { item } = result, key = `${item.refId}::${item.id}`;
24642    return react_default.createElement(
24643      Result,
24644      {
24645        ...result,
24646        ...getItemProps({ key, index, item: result }),
24647        isHighlighted: highlightedIndex === index,
24648        key,
24649        "data-id": result.item.id,
24650        "data-refid": result.item.refId,
24651        onMouseOver: mouseOverHandler,
24652        className: "search-result-item"
24653      }
24654    );
24655  }));
24656});
24657
24658// src/manager/components/sidebar/SidebarBottom.tsx
24659init_react();
24660
24661// src/manager/components/sidebar/TestingWidget.tsx
24662init_react();
24663
24664// src/manager/components/sidebar/useDynamicFavicon.ts
24665init_react();
24666var STATUSES = ["active", "critical", "negative", "positive", "warning"], initialIcon, getFaviconUrl = (initialHref = "./favicon.svg", status) => {
24667  initialIcon ??= initialHref;
24668  let href = initialIcon + (status && STATUSES.includes(status) ? `?status=${status}` : "");
24669  return new Promise((resolve) => {
24670    let img = new Image();
24671    img.onload = () => resolve({ href, status }), img.onerror = () => resolve({ href: initialIcon, status }), img.src = href;
24672  });
24673}, useDynamicFavicon = (status) => {
24674  let links = useRef(document.head.querySelectorAll("link[rel*='icon']"));
24675  useEffect(() => {
24676    let isMounted = !0, [element, ...others] = links.current;
24677    if (element && !others.length)
24678      return getFaviconUrl(element.href, status).then(
24679        (result) => {
24680          isMounted && result.status === status && element.dataset.status !== status && (element.href = result.href, result.status ? element.dataset.status = result.status : delete element.dataset.status);
24681        },
24682        () => {
24683          isMounted && (element.href = initialIcon);
24684        }
24685      ), () => {
24686        isMounted = !1, element.href = initialIcon;
24687      };
24688  }, [status]);
24689};
24690
24691// src/manager/components/sidebar/TestingWidget.tsx
24692var DEFAULT_HEIGHT = 500, HoverCard2 = styled(Card)({
24693  display: "flex",
24694  flexDirection: "column-reverse",
24695  "&:hover #testing-module-collapse-toggle": {
24696    opacity: 1
24697  }
24698}), Collapsible2 = styled.div(({ theme }) => ({
24699  overflow: "hidden",
24700  boxShadow: `inset 0 -1px 0 ${theme.appBorderColor}`
24701})), Content3 = styled.div({
24702  display: "flex",
24703  flexDirection: "column"
24704}), Bar
vendor: 4,969 bytes, lines 24704-24839
247042 = styled.div(({ onClick }) => ({
24705  display: "flex",
24706  width: "100%",
24707  cursor: onClick ? "pointer" : "default",
24708  userSelect: "none",
24709  alignItems: "center",
24710  justifyContent: "space-between",
24711  overflow: "hidden",
24712  padding: 4,
24713  gap: 4
24714})), Action = styled.div({
24715  display: "flex",
24716  flexBasis: "100%",
24717  containerType: "inline-size"
24718}), Filters = styled.div({
24719  display: "flex",
24720  justifyContent: "flex-end",
24721  gap: 4
24722}), CollapseToggle3 = styled(ActionList.Button)({
24723  opacity: 0,
24724  transition: "opacity 250ms",
24725  "&:focus, &:hover": {
24726    opacity: 1
24727  }
24728}), RunButton = ({
24729  children,
24730  isRunning,
24731  onRunAll,
24732  ...props
24733}) => react_default.createElement(
24734  ActionList.Button,
24735  {
24736    ariaLabel: isRunning ? "Running..." : "Run tests",
24737    tooltip: isRunning ? "Running tests..." : "Start all tests",
24738    disabled: isRunning,
24739    onClick: (e2) => {
24740      e2.stopPropagation(), onRunAll();
24741    },
24742    ...props
24743  },
24744  react_default.createElement(ActionList.Icon, null, react_default.createElement(PlayAllHollowIcon, null)),
24745  children
24746), StatusButton2 = styled(ActionList.Toggle)(
24747  { minWidth: 28, outlineOffset: -2 },
24748  ({ pressed, status, theme }) => !pressed && (theme.base === "light" ? {
24749    background: {
24750      negative: theme.background.negative,
24751      warning: theme.background.warning
24752    }[status],
24753    color: {
24754      negative: theme.color.negativeText,
24755      warning: theme.color.warningText
24756    }[status]
24757  } : {
24758    background: {
24759      negative: `${theme.color.negative}22`,
24760      warning: `${theme.color.warning}22`
24761    }[status],
24762    color: {
24763      negative: theme.color.negative,
24764      warning: theme.color.warning
24765    }[status]
24766  })
24767), TestProvider = styled.div(({ theme }) => ({
24768  padding: 4,
24769  "&:not(:last-child)": {
24770    boxShadow: `inset 0 -1px 0 ${theme.appBorderColor}`
24771  }
24772})), TestingWidget = ({
24773  registeredTestProviders,
24774  testProviderStates,
24775  hasStatuses,
24776  clearStatuses,
24777  onRunAll,
24778  errorCount,
24779  errorsActive,
24780  setErrorsActive,
24781  warningCount,
24782  warningsActive,
24783  setWarningsActive,
24784  successCount
24785}) => {
24786  let timeoutRef = useRef(null), contentRef = useRef(null), [maxHeight, setMaxHeight] = useState(DEFAULT_HEIGHT), [isCollapsed, setCollapsed] = useState(!0), [isChangingCollapse, setChangingCollapse] = useState(!1), [isUpdated, setIsUpdated] = useState(!1), settingsUpdatedTimeoutRef = useRef();
24787  useEffect(() => {
24788    let unsubscribe = internal_fullTestProviderStore.onSettingsChanged(() => {
24789      setIsUpdated(!0), clearTimeout(settingsUpdatedTimeoutRef.current), settingsUpdatedTimeoutRef.current = setTimeout(() => {
24790        setIsUpdated(!1);
24791      }, 1e3);
24792    });
24793    return () => {
24794      unsubscribe(), clearTimeout(settingsUpdatedTimeoutRef.current);
24795    };
24796  }, []), useEffect(() => {
24797    if (contentRef.current) {
24798      setMaxHeight(contentRef.current?.getBoundingClientRect().height || DEFAULT_HEIGHT);
24799      let resizeObserver = new ResizeObserver(() => {
24800        requestAnimationFrame(() => {
24801          if (contentRef.current && !isCollapsed) {
24802            let height = contentRef.current?.getBoundingClientRect().height || DEFAULT_HEIGHT;
24803            setMaxHeight(height);
24804          }
24805        });
24806      });
24807      return resizeObserver.observe(contentRef.current), () => resizeObserver.disconnect();
24808    }
24809  }, [isCollapsed]);
24810  let toggleCollapsed = useCallback((event, value) => {
24811    event?.stopPropagation(), setChangingCollapse(!0), setCollapsed((s2) => value ?? !s2), timeoutRef.current && clearTimeout(timeoutRef.current), timeoutRef.current = setTimeout(() => {
24812      setChangingCollapse(!1);
24813    }, 250);
24814  }, []), isRunning = Object.values(testProviderStates).some(
24815    (testProviderState) => testProviderState === "test-provider-state:running"
24816  ), isCrashed = Object.values(testProviderStates).some(
24817    (testProviderState) => testProviderState === "test-provider-state:crashed"
24818  ), hasTestProviders = Object.values(registeredTestProviders).length > 0;
24819  useEffect(() => {
24820    isCrashed && isCollapsed && toggleCollapsed(void 0, !1);
24821  }, [isCrashed, isCollapsed, toggleCollapsed]), useDynamicFavicon(
24822    isCrashed ? "critical" : errorCount > 0 ? "negative" : warningCount > 0 ? "warning" : isRunning ? "active" : successCount > 0 ? "positive" : void 0
24823  );
24824  let cardRef = useRef(null), { landmarkProps } = useLandmark(
24825    { "aria-labelledby": "storybook-testing-widget-heading", role: "region" },
24826    cardRef
24827  );
24828  return !hasTestProviders && !errorCount && !warningCount ? null : react_default.createElement(
24829    HoverCard2,
24830    {
24831      id: "storybook-testing-module",
24832      "data-updated": isUpdated,
24833      outlineAnimation: isRunning ? "spin" : "none",
24834      outlineColor: isCrashed || isRunning && errorCount > 0 ? "negative" : isUpdated ? "positive" : void 0,
24835      ref: cardRef,
24836      outlineAttrs: landmarkProps
24837    },
24838    react_default.createElement("h2", { id: "storybook-testing-widget-heading", className: "sb-sr-only" }, "Component tests"),
24839    react_default.createElement(Bar2
vendor: 5,986 bytes, lines 24839-24974
24839, { ...hasTestProviders ? { onClick: (e2) => toggleCollapsed(e2) } : {} }, react_default.createElement(Action, null, hasTestProviders && react_default.createElement(
24840      Optional,
24841      {
24842        content: react_default.createElement(RunButton, { isRunning, onRunAll }, isRunning ? "Running..." : "Run tests"),
24843        fallback: react_default.createElement(RunButton, { isRunning, onRunAll })
24844      }
24845    )), react_default.createElement(Filters, null, hasTestProviders && react_default.createElement(
24846      CollapseToggle3,
24847      {
24848        onClick: (e2) => toggleCollapsed(e2),
24849        id: "testing-module-collapse-toggle",
24850        ariaLabel: isCollapsed ? "Expand testing module" : "Collapse testing module"
24851      },
24852      react_default.createElement(
24853        ChevronSmallUpIcon,
24854        {
24855          style: {
24856            transform: isCollapsed ? "none" : "rotate(180deg)",
24857            transition: "transform 250ms"
24858          }
24859        }
24860      )
24861    ), errorCount > 0 && react_default.createElement(
24862      StatusButton2,
24863      {
24864        id: "errors-found-filter",
24865        size: "medium",
24866        variant: "ghost",
24867        padding: errorCount < 10 ? "medium" : "small",
24868        status: "negative",
24869        pressed: errorsActive,
24870        onClick: (e2) => {
24871          e2.stopPropagation(), setErrorsActive(!errorsActive);
24872        },
24873        ariaLabel: `Filter main navigation to show ${errorCount} tests with errors`,
24874        tooltip: errorsActive ? "Clear test error filter" : `Filter sidebar to show ${errorCount} tests with errors`
24875      },
24876      errorCount < 1e3 ? errorCount : "999+"
24877    ), warningCount > 0 && react_default.createElement(
24878      StatusButton2,
24879      {
24880        id: "warnings-found-filter",
24881        size: "medium",
24882        variant: "ghost",
24883        padding: warningCount < 10 ? "medium" : "small",
24884        status: "warning",
24885        pressed: warningsActive,
24886        onClick: (e2) => {
24887          e2.stopPropagation(), setWarningsActive(!warningsActive);
24888        },
24889        ariaLabel: `Filter main navigation to show ${warningCount} tests with warnings`,
24890        tooltip: warningsActive ? "Clear test warning filter" : `Filter sidebar to show ${warningCount} tests with warnings`
24891      },
24892      warningCount < 1e3 ? warningCount : "999+"
24893    ), hasStatuses && react_default.createElement(
24894      ActionList.Button,
24895      {
24896        id: "clear-statuses",
24897        onClick: (e2) => {
24898          e2.stopPropagation(), clearStatuses();
24899        },
24900        disabled: isRunning,
24901        ariaLabel: isRunning ? "Can't clear statuses while tests are running" : "Clear all statuses"
24902      },
24903      react_default.createElement(SweepIcon, null)
24904    ))),
24905    hasTestProviders && react_default.createElement(
24906      Collapsible2,
24907      {
24908        "data-testid": "collapse",
24909        ...isCollapsed && { inert: "" },
24910        style: {
24911          transition: isChangingCollapse ? "max-height 250ms" : "max-height 0ms",
24912          display: hasTestProviders ? "block" : "none",
24913          maxHeight: isCollapsed ? 0 : maxHeight
24914        }
24915      },
24916      react_default.createElement(Content3, { ref: contentRef }, Object.values(registeredTestProviders).map((registeredTestProvider) => {
24917        let { render: Render, id } = registeredTestProvider;
24918        return Render ? react_default.createElement(TestProvider, { key: id, "data-module-id": id }, react_default.createElement(Render, null)) : (once.warn(
24919          `No render function found for test provider with id '${id}', skipping...`
24920        ), null);
24921      }))
24922    )
24923  );
24924};
24925
24926// src/manager/components/sidebar/SidebarBottom.tsx
24927var SIDEBAR_BOTTOM_SPACER_ID = "sidebar-bottom-spacer", SIDEBAR_BOTTOM_WRAPPER_ID = "sidebar-bottom-wrapper", filterNone = () => !0, filterWarn = ({ statuses = {} }) => Object.values(statuses).some(({ value }) => value === "status-value:warning"), filterError = ({ statuses = {} }) => Object.values(statuses).some(({ value }) => value === "status-value:error"), filterBoth = ({ statuses = {} }) => Object.values(statuses).some(
24928  ({ value }) => ["status-value:warning", "status-value:error"].includes(value)
24929), getFilter = (warningsActive = !1, errorsActive = !1) => warningsActive && errorsActive ? filterBoth : warningsActive ? filterWarn : errorsActive ? filterError : filterNone, Spacer = styled.div({
24930  pointerEvents: "none"
24931}), Content4 = styled.div(({ theme }) => ({
24932  position: "absolute",
24933  zIndex: 1,
24934  bottom: 0,
24935  left: 0,
24936  right: 0,
24937  padding: 12,
24938  display: "flex",
24939  flexDirection: "column",
24940  gap: 12,
24941  color: theme.color.defaultText,
24942  fontSize: theme.typography.size.s1,
24943  "&:empty": {
24944    display: "none"
24945  },
24946  "--card-box-shadow": `0 1px 2px 0 rgba(0, 0, 0, 0.05), 0px -5px 20px 10px ${theme.background.app}`,
24947  // Integrators can use these to style their custom additions
24948  "--sb-sidebar-bottom-card-background": theme.background.content,
24949  "--sb-sidebar-bottom-card-border": `1px solid ${theme.appBorderColor}`,
24950  "--sb-sidebar-bottom-card-border-radius": `${theme.appBorderRadius + 1}px`,
24951  "--sb-sidebar-bottom-card-box-shadow": `0 1px 2px 0 rgba(0, 0, 0, 0.05), 0px -5px 20px 10px ${theme.background.app}`
24952})), SidebarBottomBase = ({
24953  api,
24954  notifications = [],
24955  errorCount,
24956  warningCount,
24957  successCount,
24958  hasStatuses,
24959  isDevelopment,
24960  testProviderStates,
24961  registeredTestProviders,
24962  onRunAll
24963}) => {
24964  let spacerRef = useRef(null), wrapperRef = useRef(null), [warningsActive, setWarningsActive] = useState(!1), [errorsActive, setErrorsActive] = useState(!1);
24965  return useEffect(() => {
24966    if (spacerRef.current && wrapperRef.current) {
24967      let resizeObserver = new ResizeObserver(() => {
24968        spacerRef.current && wrapperRef.current && (spacerRef.current.style.height = `${wrapperRef.current.scrollHeight}px`);
24969      });
24970      return resizeObserver.observe(wrapperRef.current), () => resizeObserver.disconnect();
24971    }
24972  }, []), useEffect(() => {
24973    let filter = getFilter(warningCount > 0 && warningsActive, errorCount > 0 && errorsActive);
24974    api.experimental_setFilter
vendor: 2,221 bytes, lines 24974-25020
24974("sidebar-bottom-filter", filter);
24975  }, [api, warningCount, errorCount, warningsActive, errorsActive]), !warningCount && !errorCount && Object.values(registeredTestProviders).length === 0 && notifications.length === 0 ? null : react_default.createElement(Fragment, null, react_default.createElement(Spacer, { id: SIDEBAR_BOTTOM_SPACER_ID, ref: spacerRef }), react_default.createElement(Content4, { id: SIDEBAR_BOTTOM_WRAPPER_ID, ref: wrapperRef }, react_default.createElement(NotificationList, { notifications, clearNotification: api.clearNotification }), isDevelopment && react_default.createElement(
24976    TestingWidget,
24977    {
24978      registeredTestProviders,
24979      testProviderStates,
24980      onRunAll: () => {
24981        onRunAll(), setErrorsActive(!1), setWarningsActive(!1);
24982      },
24983      hasStatuses,
24984      clearStatuses: () => {
24985        api.clearStatuses(), setErrorsActive(!1), setWarningsActive(!1);
24986      },
24987      errorCount,
24988      errorsActive,
24989      setErrorsActive,
24990      warningCount,
24991      warningsActive,
24992      setWarningsActive,
24993      successCount
24994    }
24995  )));
24996}, SidebarBottom = ({ isDevelopment }) => {
24997  let api = useStorybookApi(), registeredTestProviders = api.getElements(Addon_TypesEnum.experimental_TEST_PROVIDER), { notifications } = useStorybookState(), { hasStatuses, errorCount, warningCount, successCount } = experimental_useStatusStore(
24998    (statuses) => Object.values(statuses).reduce(
24999      (result, storyStatuses) => (Object.values(storyStatuses).forEach((status) => {
25000        result.hasStatuses = !0, status.value === "status-value:error" && (result.errorCount += 1), status.value === "status-value:warning" && (result.warningCount += 1), status.value === "status-value:success" && (result.successCount += 1);
25001      }), result),
25002      { errorCount: 0, warningCount: 0, successCount: 0, hasStatuses: !1 }
25003    )
25004  ), testProviderStates = experimental_useTestProviderStore();
25005  return react_default.createElement(
25006    SidebarBottomBase,
25007    {
25008      api,
25009      notifications,
25010      hasStatuses,
25011      errorCount,
25012      warningCount,
25013      successCount,
25014      isDevelopment,
25015      testProviderStates,
25016      registeredTestProviders,
25017      onRunAll: internal_fullTestProviderStore.runAll
25018    }
25019  );
25020}
vendor: 3,223 bytes, lines 25020-25097
25020;
25021
25022// src/manager/components/sidebar/Filter.tsx
25023init_react();
25024
25025// src/manager/components/sidebar/FilterPanel.tsx
25026init_react();
25027
25028// src/manager/components/sidebar/FilterPanelLink.tsx
25029init_react();
25030var MutedText = styled.span(({ theme }) => ({
25031  color: theme.textMutedColor
25032})), StatusIcon2 = styled.span(({ $iconColor }) => ({
25033  display: "contents",
25034  color: $iconColor ?? void 0,
25035  "> svg": {
25036    transform: "scale(1.3)"
25037  }
25038})), createFilterLink = ({
25039  id,
25040  type,
25041  title: title2,
25042  tooltip,
25043  count,
25044  icon,
25045  isIncluded,
25046  isExcluded,
25047  onCheckboxChange,
25048  onInvert
25049}) => {
25050  let isChecked = isIncluded || isExcluded, toggleLabel = `${type} filter: ${isExcluded ? `exclude ${title2}` : title2}`, toggleTooltip = tooltip ?? `${isChecked ? "Remove" : "Add"} ${type} filter: ${title2}`, invertButtonLabel = `${isExcluded ? "Include" : "Exclude"} ${type}: ${title2}`;
25051  return {
25052    id: `filter-${type}-${id}`,
25053    content: react_default.createElement(ActionList.HoverItem, { targetId: `filter-${type}-${id}` }, react_default.createElement(ActionList.Action, { as: "label", ariaLabel: !1, tabIndex: -1, tooltip: toggleTooltip }, react_default.createElement(ActionList.Icon, null, isExcluded ? react_default.createElement(DeleteIcon, null) : isIncluded ? null : icon, react_default.createElement(
25054      Form.Checkbox,
25055      {
25056        checked: isChecked,
25057        onChange: onCheckboxChange,
25058        "data-tag": title2,
25059        "aria-label": toggleLabel
25060      }
25061    )), react_default.createElement(ActionList.Text, null, react_default.createElement("span", null, title2, isExcluded && react_default.createElement(MutedText, null, " (excluded)"))), isExcluded ? react_default.createElement("s", null, count) : react_default.createElement("span", null, count)), react_default.createElement(
25062      ActionList.Button,
25063      {
25064        "data-target-id": `filter-${type}-${id}`,
25065        ariaLabel: invertButtonLabel,
25066        onClick: onInvert
25067      },
25068      react_default.createElement("span", { style: { minWidth: 45 } }, isExcluded ? "Include" : "Exclude")
25069    ))
25070  };
25071};
25072
25073// src/shared/constants/tags.ts
25074var Tag2 = {
25075  /** Indicates that autodocs should be generated for this component */
25076  AUTODOCS: "autodocs",
25077  /** MDX documentation attached to a component's stories file */
25078  ATTACHED_MDX: "attached-mdx",
25079  /** Standalone MDX documentation not attached to stories */
25080  UNATTACHED_MDX: "unattached-mdx",
25081  /** Story has a play function */
25082  PLAY_FN: "play-fn",
25083  /** Story has a test function */
25084  TEST_FN: "test-fn",
25085  /** Development environment tag */
25086  DEV: "dev",
25087  /** Test environment tag */
25088  TEST: "test",
25089  /** Manifest generation tag */
25090  MANIFEST: "manifest"
25091}, BUILT_IN_FILTERS = {
25092  _docs: (entry, excluded) => excluded ? entry.type !== "docs" : entry.type === "docs",
25093  _play: (entry, excluded) => excluded ? entry.type !== "story" || !entry.tags?.includes(Tag2.PLAY_FN) : entry.type === "story" && !!entry.tags?.includes(Tag2.PLAY_FN),
25094  _test: (entry, excluded) => excluded ? entry.type !== "story" || entry.subtype !== "test" : entry.type === "story" && entry.subtype === "test"
25095}, USER_TAG_FILTER = (tag) => (entry, excluded) => excluded ? !entry.tags?.includes(tag) : !!entry.tags?.includes(tag);
25096
25097// src/
25097manager/components/sidebar/FilterPanel.utils.ts
25098var BUILT_IN_TAGS = /* @__PURE__ */ new Set([
25099  "dev",
25100  "test",
25101  "autodocs",
25102  "attached-mdx",
25103  "unattached-mdx",
25104  "play-fn",
25105  "test-fn",
25106  "manifest"
25107]), STATUS_DISPLAY_ORDER = [
25108  "status-value:new",
25109  "status-value:modified",
25110  "status-value:affected"
25111], areFiltersEqual = (left, right) => left.length === right.length && (/* @__PURE__ */ new Set([...left, ...right])).size === left.length, getFilterFunction = (tag) => Object.hasOwn(BUILT_IN_FILTERS, tag) ? BUILT_IN_FILTERS[tag] : USER_TAG_FILTER(tag);
25112
25113// src/manager/components/sidebar/useFilterData.tsx
25114init_react();
25115var BUILT_IN_FILTER_DEFS = [
25116  { id: "_docs", title: "Documentation", icon: react_default.createElement(DocumentIcon, { color: color.gold }), tag: "_docs" },
25117  { id: "_play", title: "Play", icon: react_default.createElement(PlayHollowIcon, { color: color.seafoam }), tag: "_play" },
25118  { id: "_test", title: "Testing", icon: react_default.createElement(BeakerIcon, { color: color.green }), tag: "_test" }
25119];
25120function useTagFilterEntries(indexJson) {
25121  return useMemo(() => {
25122    let entries = Object.values(indexJson.entries), userTagsCounts = entries.reduce((acc, entry) => (entry.tags?.forEach((tag) => {
25123      BUILT_IN_TAGS.has(tag) || (acc[tag] = (acc[tag] || 0) + 1);
25124    }), acc), {}), tagEntries = Object.entries(userTagsCounts).map(([tag, count]) => ({
25125      id: tag,
25126      type: "tag",
25127      title: tag,
25128      count,
25129      icon: null
25130    })), getBuiltInCount = (filterFn) => entries.filter((entry) => filterFn?.(entry)).length;
25131    return { builtInEntries: BUILT_IN_FILTER_DEFS.map((def) => ({
25132      id: def.id,
25133      type: "built-in",
25134      title: def.title,
25135      icon: def.icon,
25136      count: getBuiltInCount(getFilterFunction(def.tag))
25137    })), tagEntries };
25138  }, [indexJson.entries]);
25139}
25140function useStatusFilterEntries(allStatuses) {
25141  return useMemo(() => {
25142    if (!globalThis?.FEATURES?.changeDetection)
25143      return [];
25144    let counts = countStatusesByValue(allStatuses);
25145    return STATUS_DISPLAY_ORDER.map((statusValue) => ({
25146      statusValue,
25147      shortName: statusValueShortName(statusValue),
25148      description: statusValueDescription(statusValue),
25149      count: counts[statusValue] ?? 0
25150    }));
25151  }, [allStatuses]);
25152}
25153
vendor: 5,177 bytes, lines 25154-25264
25154// src/manager/components/sidebar/FilterPanel.tsx
25155var Wrapper7 = styled.div({
25156  minWidth: 240,
25157  maxWidth: 300,
25158  maxHeight: 15.5 * 32 + 8,
25159  // 15.5 items at 32px each + 8px padding
25160  overflow: "hidden",
25161  overflowY: "auto",
25162  scrollbarWidth: "thin"
25163}), FilterPanel = ({
25164  api,
25165  indexJson,
25166  defaultIncludedFilters,
25167  defaultExcludedFilters,
25168  includedFilters,
25169  excludedFilters,
25170  allStatuses,
25171  includedStatusFilters,
25172  excludedStatusFilters
25173}) => {
25174  let theme = useTheme(), { builtInEntries, tagEntries } = useTagFilterEntries(indexJson), statusEntries = useStatusFilterEntries(allStatuses), toTagFilterItem = useCallback(
25175    (entry) => {
25176      if (entry.count === 0 && entry.type === "built-in") return null;
25177      let isIncluded = includedFilters.includes(entry.id), isExcluded = excludedFilters.includes(entry.id), isChecked = isIncluded || isExcluded;
25178      return {
25179        id: entry.id,
25180        type: entry.type,
25181        title: entry.title,
25182        count: entry.count,
25183        icon: entry.icon,
25184        isIncluded,
25185        isExcluded,
25186        onCheckboxChange: () => {
25187          isChecked ? api.removeTagFilters([entry.id]) : api.addTagFilters([entry.id], !1);
25188        },
25189        onInvert: () => api.addTagFilters([entry.id], !isExcluded)
25190      };
25191    },
25192    [api, includedFilters, excludedFilters]
25193  ), toStatusFilterItem = useCallback(
25194    (entry) => {
25195      let shortName = entry.shortName === "affected" ? "related" : entry.shortName, isIncluded = includedStatusFilters.includes(entry.statusValue), isExcluded = excludedStatusFilters.includes(entry.statusValue), isChecked = isIncluded || isExcluded, { icon: statusIconEl, iconColor } = getStatus(theme, entry.statusValue), showIcon = statusIconEl && entry.statusValue !== "status-value:affected";
25196      return {
25197        id: shortName,
25198        type: "status",
25199        title: shortName.charAt(0).toUpperCase() + shortName.slice(1),
25200        tooltip: entry.description,
25201        count: entry.count,
25202        icon: showIcon ? react_default.createElement(StatusIcon2, { $iconColor: iconColor }, statusIconEl) : null,
25203        isIncluded,
25204        isExcluded,
25205        onCheckboxChange: () => {
25206          isChecked ? api.removeStatusFilters([entry.statusValue]) : api.addStatusFilters([entry.statusValue], !1);
25207        },
25208        onInvert: () => api.addStatusFilters([entry.statusValue], !isExcluded)
25209      };
25210    },
25211    [api, includedStatusFilters, excludedStatusFilters, theme]
25212  ), builtInItems = useMemo(
25213    () => builtInEntries.sort((a2, b2) => a2.id.localeCompare(b2.id)).map(toTagFilterItem).filter((f2) => f2 !== null),
25214    [builtInEntries, toTagFilterItem]
25215  ), tagItems = useMemo(
25216    () => tagEntries.sort((a2, b2) => a2.id.localeCompare(b2.id)).map(toTagFilterItem).filter((f2) => f2 !== null),
25217    [tagEntries, toTagFilterItem]
25218  ), statusItems = useMemo(
25219    () => statusEntries.map(toStatusFilterItem),
25220    [statusEntries, toStatusFilterItem]
25221  ), filterIds = useMemo(
25222    () => [...builtInEntries.map((e2) => e2.id), ...tagEntries.map((e2) => e2.id)],
25223    [builtInEntries, tagEntries]
25224  ), setAllFilters = useCallback(
25225    (selected) => api.setAllTagFilters(selected ? filterIds : [], []),
25226    [api, filterIds]
25227  ), isDefaultSelection = areFiltersEqual(includedFilters, defaultIncludedFilters) && areFiltersEqual(excludedFilters, defaultExcludedFilters), hasDefaultSelection = defaultIncludedFilters.length > 0 || defaultExcludedFilters.length > 0, isNothingSelectedYet = includedFilters.length === 0 && excludedFilters.length === 0 && includedStatusFilters.length === 0 && excludedStatusFilters.length === 0, hasItems = builtInItems.length > 0 || tagItems.length > 0;
25228  return react_default.createElement(Wrapper7, null, hasItems && react_default.createElement(ActionList, { as: "div" }, react_default.createElement(ActionList.Item, { as: "div" }, isNothingSelectedYet ? react_default.createElement(
25229    ActionList.Button,
25230    {
25231      ariaLabel: !1,
25232      id: "select-all",
25233      key: "select-all",
25234      onClick: () => setAllFilters(!0)
25235    },
25236    react_default.createElement(BatchAcceptIcon, null),
25237    react_default.createElement(ActionList.Text, null, "Select all")
25238  ) : react_default.createElement(
25239    ActionList.Button,
25240    {
25241      ariaLabel: !1,
25242      id: "deselect-all",
25243      key: "deselect-all",
25244      onClick: async () => {
25245        await setAllFilters(!1), await api.resetStatusFilters();
25246      }
25247    },
25248    react_default.createElement(SweepIcon, null),
25249    react_default.createElement(ActionList.Text, null, "Clear filters")
25250  ), hasDefaultSelection && react_default.createElement(
25251    ActionList.Button,
25252    {
25253      id: "reset-filters",
25254      key: "reset-filters",
25255      onClick: () => api.resetTagFilters(),
25256      ariaLabel: "Reset filters",
25257      tooltip: "Reset to default selection",
25258      disabled: isDefaultSelection
25259    },
25260    react_default.createElement(UndoIcon, null)
25261  ))), builtInItems.length > 0 && react_default.createElement(ActionList, null, builtInItems.map((item) => {
25262    let link = createFilterLink(item);
25263    return react_default.createElement(Fragment, { key: link.id }, link.content);
25264  })), statusItems.length > 0 && react_default.createElement(ActionList, null, s
vendor: 4,381 bytes, lines 25264-25398
25264tatusItems.map((item) => {
25265    let link = createFilterLink(item);
25266    return react_default.createElement(Fragment, { key: link.id }, link.content);
25267  })), tagItems.length > 0 && react_default.createElement(ActionList, null, tagItems.map((item) => {
25268    let link = createFilterLink(item);
25269    return react_default.createElement(Fragment, { key: link.id }, link.content);
25270  })), tagItems.length === 0 && react_default.createElement(ActionList, { as: "div" }, react_default.createElement(ActionList.Item, { as: "div" }, react_default.createElement(
25271    ActionList.Link,
25272    {
25273      ariaLabel: !1,
25274      href: api.getDocsUrl({ subpath: "writing-stories/tags#custom-tags" }),
25275      target: "_blank"
25276    },
25277    react_default.createElement(ActionList.Icon, null, react_default.createElement(DocumentIcon, null)),
25278    react_default.createElement(ActionList.Text, null, react_default.createElement("span", null, "Learn how to add tags")),
25279    react_default.createElement(ActionList.Icon, null, react_default.createElement(ShareAltIcon, null))
25280  ))));
25281};
25282
25283// src/manager/components/sidebar/Filter.tsx
25284var StyledButton2 = styled(Button)(({ $isHighlighted, theme }) => ({
25285  "&:focus-visible": {
25286    outlineOffset: 4
25287  },
25288  ...$isHighlighted && {
25289    background: theme.background.hoverable,
25290    color: theme.color.secondary
25291  }
25292})), TagSelected = styled(Badge)(({ theme }) => ({
25293  position: "absolute",
25294  top: 7,
25295  right: 7,
25296  transform: "translate(50%, -50%)",
25297  display: "flex",
25298  alignItems: "center",
25299  justifyContent: "center",
25300  padding: 3,
25301  height: 6,
25302  minWidth: 6,
25303  lineHeight: "px",
25304  boxShadow: `${theme.barSelectedColor} 0 0 0 1px inset`,
25305  fontSize: theme.typography.size.s1 - 1,
25306  background: theme.barSelectedColor,
25307  color: theme.color.inverseText
25308})), filterMapper = ({ api, state }) => ({
25309  api,
25310  indexJson: state.internal_index,
25311  activeFilterCount: getActiveFilterCount(state),
25312  defaultIncludedFilters: state.defaultIncludedTagFilters,
25313  defaultExcludedFilters: state.defaultExcludedTagFilters,
25314  includedFilters: state.includedTagFilters,
25315  excludedFilters: state.excludedTagFilters,
25316  includedStatusFilters: state.includedStatusFilters ?? [],
25317  excludedStatusFilters: state.excludedStatusFilters ?? []
25318}), FilterInner = ({
25319  api,
25320  indexJson,
25321  activeFilterCount,
25322  defaultIncludedFilters,
25323  defaultExcludedFilters,
25324  includedFilters,
25325  excludedFilters,
25326  includedStatusFilters,
25327  excludedStatusFilters
25328}) => {
25329  let [expanded, setExpanded] = useState(!1), allStatuses = experimental_useStatusStore(), handleToggleExpand = useCallback(
25330    (event) => {
25331      event.preventDefault(), setExpanded(!expanded);
25332    },
25333    [expanded]
25334  );
25335  return react_default.createElement(
25336    PopoverProvider,
25337    {
25338      ariaLabel: "Tag filters",
25339      placement: "bottom",
25340      onVisibleChange: setExpanded,
25341      offset: 8,
25342      padding: 0,
25343      popover: () => react_default.createElement(
25344        FilterPanel,
25345        {
25346          api,
25347          indexJson,
25348          defaultIncludedFilters,
25349          defaultExcludedFilters,
25350          includedFilters,
25351          excludedFilters,
25352          allStatuses,
25353          includedStatusFilters,
25354          excludedStatusFilters
25355        }
25356      )
25357    },
25358    react_default.createElement(
25359      StyledButton2,
25360      {
25361        key: "tags",
25362        ariaLabel: activeFilterCount ? `${activeFilterCount} active tag ${activeFilterCount !== 1 ? "filters" : "filter"}` : "Tag filters",
25363        ariaDescription: "Filter the items shown in a sidebar based on the tags applied to them.",
25364        variant: "ghost",
25365        padding: "small",
25366        $isHighlighted: activeFilterCount > 0,
25367        onClick: handleToggleExpand
25368      },
25369      react_default.createElement(FilterIcon, null),
25370      activeFilterCount > 0 && react_default.createElement(TagSelected, null)
25371    )
25372  );
25373}, Filter = () => react_default.createElement(Consumer, { filter: filterMapper }, ({
25374  api,
25375  indexJson,
25376  activeFilterCount,
25377  defaultIncludedFilters,
25378  defaultExcludedFilters,
25379  includedFilters,
25380  excludedFilters,
25381  includedStatusFilters,
25382  excludedStatusFilters
25383}) => indexJson ? react_default.createElement(
25384  FilterInner,
25385  {
25386    api,
25387    indexJson,
25388    activeFilterCount,
25389    defaultIncludedFilters,
25390    defaultExcludedFilters,
25391    includedFilters,
25392    excludedFilters,
25393    includedStatusFilters,
25394    excludedStatusFilters
25395  }
25396) : null);
25397
25398// src/manager/components/sidebar/
25398ReviewChangesButton.tsx
25399init_react(
vendor: 267 bytes, lines 25399-25409
25399);
25400
25401// src/shared/universal-store/instances.ts
25402var instances = /* @__PURE__ */ new Map();
25403
25404// src/shared/universal-store/index.ts
25405var CHANNEL_EVENT_PREFIX = "UNIVERSAL_STORE:", ProgressState = {
25406  PENDING: "PENDING",
25407  RESOLVED: "RESOLVED",
25408  REJECTED: "REJECTED"
25409}, 
vendor: 11,505 bytes, lines 25409-25662
25409_UniversalStore = class _UniversalStore {
25410  constructor(options2, environmentOverrides) {
25411    /** Enable debug logs for this store */
25412    this.debugging = !1;
25413    // TODO: narrow type of listeners based on event type
25414    this.listeners = /* @__PURE__ */ new Map([["*", /* @__PURE__ */ new Set()]]);
25415    /** Gets the current state */
25416    this.getState = () => (this.debug("getState", { state: this.state }), this.state);
25417    /**
25418     * Subscribes to store events
25419     *
25420     * @returns A function to unsubscribe
25421     */
25422    this.subscribe = (eventTypeOrListener, maybeListener) => {
25423      let subscribesToAllEvents = typeof eventTypeOrListener == "function", eventType = subscribesToAllEvents ? "*" : eventTypeOrListener, listener = subscribesToAllEvents ? eventTypeOrListener : maybeListener;
25424      if (this.debug("subscribe", { eventType, listener }), !listener)
25425        throw new TypeError(
25426          `Missing first subscribe argument, or second if first is the event type, when subscribing to a UniversalStore with id '${this.id}'`
25427        );
25428      return this.listeners.has(eventType) || this.listeners.set(eventType, /* @__PURE__ */ new Set()), this.listeners.get(eventType).add(listener), () => {
25429        this.debug("unsubscribe", { eventType, listener }), this.listeners.has(eventType) && (this.listeners.get(eventType).delete(listener), this.listeners.get(eventType)?.size === 0 && this.listeners.delete(eventType));
25430      };
25431    };
25432    /** Sends a custom event to the other stores */
25433    this.send = (event) => {
25434      if (this.debug("send", { event }), this.status !== _UniversalStore.Status.READY)
25435        throw new TypeError(
25436          dedent`Cannot send event before store is ready. You can get the current status with store.status,
25437        or await store.readyPromise to wait for the store to be ready before sending events.
25438        ${JSON.stringify(
25439            {
25440              event,
25441              id: this.id,
25442              actor: this.actor,
25443              environment: this.environment
25444            },
25445            null,
25446            2
25447          )}`
25448        );
25449      this.emitToListeners(event, { actor: this.actor }), this.emitToChannel(event, { actor: this.actor });
25450    };
25451    if (this.debugging = options2.debug ?? !1, !_UniversalStore.isInternalConstructing)
25452      throw new TypeError(
25453        "UniversalStore is not constructable - use UniversalStore.create() instead"
25454      );
25455    if (_UniversalStore.isInternalConstructing = !1, this.id = options2.id, this.actorId = Date.now().toString(36) + Math.random().toString(36).substring(2), this.actorType = options2.leader ? _UniversalStore.ActorType.LEADER : _UniversalStore.ActorType.FOLLOWER, this.state = options2.initialState, this.channelEventName = `${CHANNEL_EVENT_PREFIX}${this.id}`, this.debug("constructor", {
25456      options: options2,
25457      environmentOverrides,
25458      channelEventName: this.channelEventName
25459    }), this.actor.type === _UniversalStore.ActorType.LEADER)
25460      this.syncing = {
25461        state: ProgressState.RESOLVED,
25462        promise: Promise.resolve()
25463      };
25464    else {
25465      let syncingResolve, syncingReject, syncingPromise = new Promise((resolve, reject) => {
25466        syncingResolve = () => {
25467          this.syncing.state === ProgressState.PENDING && (this.syncing.state = ProgressState.RESOLVED, resolve());
25468        }, syncingReject = (reason) => {
25469          this.syncing.state === ProgressState.PENDING && (this.syncing.state = ProgressState.REJECTED, reject(reason));
25470        };
25471      });
25472      this.syncing = {
25473        state: ProgressState.PENDING,
25474        promise: syncingPromise,
25475        resolve: syncingResolve,
25476        reject: syncingReject
25477      };
25478    }
25479    this.getState = this.getState.bind(this), this.setState = this.setState.bind(this), this.subscribe = this.subscribe.bind(this), this.onStateChange = this.onStateChange.bind(this), this.send = this.send.bind(this), this.emitToChannel = this.emitToChannel.bind(this), this.prepareThis = this.prepareThis.bind(this), this.emitToListeners = this.emitToListeners.bind(this), this.handleChannelEvents = this.handleChannelEvents.bind(this), this.debug = this.debug.bind(this), this.channel = environmentOverrides?.channel ?? _UniversalStore.preparation.channel, this.environment = environmentOverrides?.environment ?? _UniversalStore.preparation.environment, this.channel && this.environment ? (_UniversalStore.preparation.resolve({ channel: this.channel, environment: this.environment }), this.prepareThis({ channel: this.channel, environment: this.environment })) : _UniversalStore.preparation.promise.then(this.prepareThis);
25480  }
25481  static setupPreparationPromise() {
25482    let resolveRef, rejectRef, promise = new Promise(
25483      (resolve, reject) => {
25484        resolveRef = (args) => {
25485          resolve(args);
25486        }, rejectRef = (...args) => {
25487          reject(args);
25488        };
25489      }
25490    );
25491    _UniversalStore.preparation = {
25492      resolve: resolveRef,
25493      reject: rejectRef,
25494      promise
25495    };
25496  }
25497  /** The actor object representing the store instance with a unique ID and a type */
25498  get actor() {
25499    return Object.freeze({
25500      id: this.actorId,
25501      type: this.actorType,
25502      environment: this.environment ?? _UniversalStore.Environment.UNKNOWN
25503    });
25504  }
25505  /**
25506   * The current state of the store, that signals both if the store is prepared by Storybook and
25507   * also - in the case of a follower - if the state has been synced with the leader's state.
25508   */
25509  get status() {
25510    if (!this.channel || !this.environment)
25511      return _UniversalStore.Status.UNPREPARED;
25512    switch (this.syncing?.state) {
25513      case ProgressState.PENDING:
25514      case void 0:
25515        return _UniversalStore.Status.SYNCING;
25516      case ProgressState.REJECTED:
25517        return _UniversalStore.Status.ERROR;
25518      case ProgressState.RESOLVED:
25519      default:
25520        return _UniversalStore.Status.READY;
25521    }
25522  }
25523  /**
25524   * A promise that resolves when the store is fully ready. A leader will be ready when the store
25525   * has been prepared by Storybook, which is almost instantly.
25526   *
25527   * A follower will be ready when the state has been synced with the leader's state, within a few
25528   * hundred milliseconds.
25529   */
25530  untilReady() {
25531    return Promise.all([_UniversalStore.preparation.promise, this.syncing?.promise]);
25532  }
25533  /** Creates a new instance of UniversalStore */
25534  static create(options2) {
25535    if (!options2 || typeof options2?.id != "string")
25536      throw new TypeError("id is required and must be a string, when creating a UniversalStore");
25537    options2.debug && console.debug(
25538      dedent`[UniversalStore]
25539        create`,
25540      { options: options2 }
25541    );
25542    let existing = instances.get(options2.id);
25543    if (existing)
25544      return console.warn(dedent`UniversalStore with id "${options2.id}" already exists in this environment, re-using existing.
25545        You should reuse the existing instance instead of trying to create a new one.`), existing;
25546    _UniversalStore.isInternalConstructing = !0;
25547    let store2 = new _UniversalStore(options2);
25548    return instances.set(options2.id, store2), store2;
25549  }
25550  /**
25551   * Used by Storybook to set the channel for all instances of UniversalStore in the given
25552   * environment.
25553   *
25554   * @internal
25555   */
25556  static __prepare(channel, environment) {
25557    _UniversalStore.preparation.channel = channel, _UniversalStore.preparation.environment = environment, _UniversalStore.preparation.resolve({ channel, environment });
25558  }
25559  /**
25560   * Updates the store's state
25561   *
25562   * Either a new state or a state updater function can be passed to the method.
25563   */
25564  setState(updater) {
25565    let previousState = this.state, newState = typeof updater == "function" ? updater(previousState) : updater;
25566    if (this.debug("setState", { newState, previousState, updater }), this.status !== _UniversalStore.Status.READY)
25567      throw new TypeError(
25568        dedent`Cannot set state before store is ready. You can get the current status with store.status,
25569        or await store.readyPromise to wait for the store to be ready before sending events.
25570        ${JSON.stringify(
25571          {
25572            newState,
25573            id: this.id,
25574            actor: this.actor,
25575            environment: this.environment
25576          },
25577          null,
25578          2
25579        )}`
25580      );
25581    this.state = newState;
25582    let event = {
25583      type: _UniversalStore.InternalEventType.SET_STATE,
25584      payload: {
25585        state: newState,
25586        previousState
25587      }
25588    };
25589    this.emitToChannel(event, { actor: this.actor }), this.emitToListeners(event, { actor: this.actor });
25590  }
25591  /**
25592   * Subscribes to state changes
25593   *
25594   * @returns Unsubscribe function
25595   */
25596  onStateChange(listener) {
25597    return this.debug("onStateChange", { listener }), this.subscribe(
25598      _UniversalStore.InternalEventType.SET_STATE,
25599      ({ payload }, eventInfo) => {
25600        listener(payload.state, payload.previousState, eventInfo);
25601      }
25602    );
25603  }
25604  emitToChannel(event, eventInfo) {
25605    this.debug("emitToChannel", { event, eventInfo, channel: !!this.channel }), this.channel?.emit(this.channelEventName, {
25606      event,
25607      eventInfo
25608    });
25609  }
25610  prepareThis({
25611    channel,
25612    environment
25613  }) {
25614    this.channel = channel, this.environment = environment, this.debug("prepared", { channel: !!channel, environment }), this.channel.on(this.channelEventName, this.handleChannelEvents), this.actor.type === _UniversalStore.ActorType.LEADER ? this.emitToChannel(
25615      { type: _UniversalStore.InternalEventType.LEADER_CREATED },
25616      { actor: this.actor }
25617    ) : (this.emitToChannel(
25618      { type: _UniversalStore.InternalEventType.FOLLOWER_CREATED },
25619      { actor: this.actor }
25620    ), this.emitToChannel(
25621      { type: _UniversalStore.InternalEventType.EXISTING_STATE_REQUEST },
25622      { actor: this.actor }
25623    ), setTimeout(() => {
25624      this.syncing.reject(
25625        new TypeError(
25626          `No existing state found for follower with id: '${this.id}'. Make sure a leader with the same id exists before creating a follower.`
25627        )
25628      );
25629    }, 1e3));
25630  }
25631  emitToListeners(event, eventInfo) {
25632    let eventTypeListeners = this.listeners.get(event.type), everythingListeners = this.listeners.get("*");
25633    this.debug("emitToListeners", {
25634      event,
25635      eventInfo,
25636      eventTypeListeners,
25637      everythingListeners
25638    }), [...eventTypeListeners ?? [], ...everythingListeners ?? []].forEach(
25639      (listener) => listener(event, eventInfo)
25640    );
25641  }
25642  handleChannelEvents(channelEvent) {
25643    let { event, eventInfo } = channelEvent;
25644    if ([eventInfo.actor.id, eventInfo.forwardingActor?.id].includes(this.actor.id)) {
25645      this.debug("handleChannelEvents: Ignoring event from self", { channelEvent });
25646      return;
25647    } else if (this.syncing?.state === ProgressState.PENDING && event.type !== _UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE) {
25648      this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent });
25649      return;
25650    }
25651    if (this.debug("handleChannelEvents", { channelEvent }), this.actor.type === _UniversalStore.ActorType.LEADER) {
25652      let shouldForwardEvent = !0;
25653      switch (event.type) {
25654        case _UniversalStore.InternalEventType.EXISTING_STATE_REQUEST:
25655          shouldForwardEvent = !1;
25656          let responseEvent = {
25657            type: _UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE,
25658            payload: this.state
25659          };
25660          this.debug("handleChannelEvents: responding to existing state request", {
25661            responseEvent
25662          }
25662), this.emitToChannel(responseEvent, { actor: this.actor }), this.emitToListeners(responseEvent, { actor: this.actor });
25663          break;
25664        case _UniversalStore.InternalEventType.LEADER_CREATED:
25665          shouldForwardEvent = !1, this.syncing.state = ProgressState.REJECTED, this.debug("handleChannelEvents: erroring due to second leader being created", {
25666            event
25667          }), console.error(
25668            dedent`Detected multiple UniversalStore leaders created with the same id "${this.id}".
25669            Only one leader can exists at a time, your stores are now in an invalid state.
25670            Leaders detected:
25671            this: ${JSON.stringify(this.actor, null, 2)}
25672            other: ${JSON.stringify(eventInfo.actor, null, 2)}`
25673          );
25674          break;
25675      }
25676      shouldForwardEvent && (this.debug("handleChannelEvents: forwarding event", { channelEvent }), this.emitToChannel(event, { actor: eventInfo.actor, forwardingActor: this.actor }));
25677    }
25678    if (this.actor.type === _UniversalStore.ActorType.FOLLOWER)
25679      switch (event.type) {
25680        case _UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE:
25681          if (this.debug("handleChannelEvents: Setting state from leader's existing state response", {
25682            event
25683          }), this.syncing?.state !== ProgressState.PENDING)
25684            break;
25685          this.syncing.resolve?.();
25686          let setStateEvent = {
25687            type: _UniversalStore.InternalEventType.SET_STATE,
25688            payload: {
25689              state: event.payload,
25690              previousState: this.state
25691            }
25692          };
25693          this.state = event.payload, this.emitToListeners(setStateEvent, eventInfo);
25694          break;
25695      }
25696    switch (event.type) {
25697      case _UniversalStore.InternalEventType.SET_STATE:
25698        this.debug("handleChannelEvents: Setting state", { event }), this.state = event.payload.state;
25699        break;
25700    }
25701    this.emitToListeners(event, { actor: eventInfo.actor });
25702  }
25703  debug(message, data) {
25704    this.debugging && console.debug(
25705      dedent`[UniversalStore::${this.id}::${this.environment ?? _UniversalStore.Environment.UNKNOWN}]
25706        ${message}`,
25707      JSON.stringify(
25708        {
25709          data,
25710          actor: this.actor,
25711          state: this.state,
25712          status: this.status
25713        },
25714        null,
25715        2
25716      )
25717    );
25718  }
25719  /**
25720   * Used to reset the static fields of the UniversalStore class when cleaning up tests
25721   *
25722   * @internal
25723   */
25724  static __reset() {
25725    _UniversalStore.preparation.reject(new Error("reset")), _UniversalStore.setupPreparationPromise(), _UniversalStore.isInternalConstructing = !1;
25726  }
25727};
25728/**
25729 * Defines the possible actor types in the store system
25730 *
25731 * @readonly
25732 */
25733_UniversalStore.ActorType = {
25734  LEADER: "LEADER",
25735  FOLLOWER: "FOLLOWER"
25736}, /**
25737 * Defines the possible environments the store can run in
25738 *
25739 * @readonly
25740 */
25741_UniversalStore.Environment = {
25742  SERVER: "SERVER",
25743  MANAGER: "MANAGER",
25744  PREVIEW: "PREVIEW",
25745  UNKNOWN: "UNKNOWN",
25746  MOCK: "MOCK"
25747}, /**
25748 * Internal event types used for store synchronization
25749 *
25750 * @readonly
25751 */
25752_UniversalStore.InternalEventType = {
25753  EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST",
25754  EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE",
25755  SET_STATE: "__SET_STATE",
25756  LEADER_CREATED: "__LEADER_CREATED",
25757  FOLLOWER_CREATED: "__FOLLOWER_CREATED"
25758}, _UniversalStore.Status = {
25759  UNPREPARED: "UNPREPARED",
25760  SYNCING: "SYNCING",
25761  READY: "READY",
25762  ERROR: "ERROR"
25763}, // This is used to check if constructor was called from the static factory create()
25764_UniversalStore.isInternalConstructing = !1, _UniversalStore.setupPreparationPromise();
25765var UniversalStore = _UniversalStore;
25766
25767// src/shared/universal-store/use-universal-store-manager.ts
25768init_react();
25769var useUniversalStore = (universalStore, selector) => {
25770  let snapshotRef = useRef(
25771    selector ? selector(universalStore.getState()) : universalStore.getState()
25772  ), subscribe = useCallback(
25773    (listener) => universalStore.onStateChange((state2, previousState) => {
25774      if (!selector) {
25775        snapshotRef.current = state2, listener();
25776        return;
25777      }
25778      let selectedState = selector(state2), selectedPreviousState = selector(previousState);
25779      !isEqual(selectedState, selectedPreviousState) && (snapshotRef.current = selectedState, listener());
25780    }),
25781    [universalStore, selector]
25782  ), getSnapshot = useCallback(() => {
25783    let currentState = universalStore.getState(), selectedState = selector ? selector(currentState) : currentState;
25784    return isEqual(selectedState, snapshotRef.current) || (snapshotRef.current = selectedState), snapshotRef.current;
25785  }, [universalStore, selector]);
25786  return [
vendor: 462 bytes, lines 25786-25799
25786useSyncExternalStore(subscribe, getSnapshot), universalStore.setState];
25787};
25788
25789// src/manager-api/stores/status.ts
25790var statusStore = createStatusStore({
25791  universalStatusStore: UniversalStore.create({
25792    ...UNIVERSAL_STATUS_STORE_OPTIONS,
25793    leader: globalThis.CONFIG_TYPE === "PRODUCTION"
25794  }),
25795  useUniversalStore,
25796  environment: "manager"
25797}), { fullStatusStore, getStatusStoreByTypeId, useStatusStore, universalStatusStore } = statusStore;
25798
25799// src/manager-api/
vendor: 636 bytes, lines 25799-25806
25799modules/statuses.ts
25800var computeStatusFilterFn = (includedStatusFilters, excludedStatusFilters) => (entry) => {
25801  if (!includedStatusFilters.length && !excludedStatusFilters.length)
25802    return !0;
25803  let storyStatuses = (fullStatusStore.getAll() ?? {})[entry.id], storyStatusValues = storyStatuses ? Object.values(storyStatuses).map((s2) => s2.value) : [], passesInclude = !includedStatusFilters.length || includedStatusFilters.some((v2) => storyStatusValues.includes(v2)), passesExclude = !excludedStatusFilters.length || excludedStatusFilters.every((v2) => !storyStatusValues.includes(v2));
25804  return passesInclude && passesExclude;
25805};
25806
vendor: 1,207 bytes, lines 25807-25828
25807// src/manager-api/modules/tags.ts
25808var import_memoizerific5 = __toESM(require_memoizerific(), 1);
25809var getDefaultTagsFromPreset = (0, import_memoizerific5.default)(1)((presets) => {
25810  let presetEntries = Object.entries(presets);
25811  return {
25812    included: presetEntries.filter(([, option]) => option.defaultFilterSelection === "include").map(([tag]) => tag),
25813    excluded: presetEntries.filter(([, option]) => option.defaultFilterSelection === "exclude").map(([tag]) => tag)
25814  };
25815});
25816var computeTagsFilterFn = (includedTagFilters, excludedTagFilters) => {
25817  let computeFilterFunctions = (set) => Object.values(
25818    set.reduce(
25819      (acc, tag) => (Object.hasOwn(BUILT_IN_FILTERS, tag) ? acc["built-in"].push(BUILT_IN_FILTERS[tag]) : acc.user.push(USER_TAG_FILTER(tag)), acc),
25820      { "built-in": [], user: [] }
25821    )
25822  ).filter((group) => group.length > 0);
25823  return (item) => {
25824    let included = computeFilterFunctions(includedTagFilters), excluded = computeFilterFunctions(excludedTagFilters);
25825    return (!included.length || included.every((group) => group.some((filterFn) => filterFn(item, !1)))) && (!excluded.length || excluded.every((group) => group.every((filterFn) => filterFn(item, !0))));
25826  };
25827};
25828
25829// src/manager/components/sidebar/ReviewChangesButton.tsx
25830var Wrapper8 = styled.div({
25831  display: "flex",
25832  alignItems: "center",
25833  gap: 4,
25834  marginTop: -8
25835}), StyledCTA = styled(ToggleButton)({
25836  flex: 1,
25837  justifyContent: "flex-start"
25838}), StyledIcon = styled.svg(({ theme }) => ({
25839  color: theme.fgColor.accent
25840})), NEW = "status-value:new", MOD = "status-value:modified", ReviewChangesButton = () => {
25841  let api = useStorybookApi(), {
25842    internal_index: index,
25843    includedStatusFilters: rawIncludedStatusFilters,
25844    excludedStatusFilters: rawExcludedStatusFilters,
25845    includedTagFilters: rawIncludedTagFilters,
25846    excludedTagFilters: rawExcludedTagFilters
25847  } = useStorybookState(), allStatuses = experimental_useStatusStore(), { newCount, modifiedCount } = useMemo(() => {
25848    if (!index)
25849      return { newCount: 0, modifiedCount: 0 };
25850    let includedStatusFilters2 = rawIncludedStatusFilters ?? [], excludedStatusFilters2 = rawExcludedStatusFilters ?? [], includedTagFilters = rawIncludedTagFilters ?? [], excludedTagFilters = rawExcludedTagFilters ?? [], contextualIncludedStatuses = includedStatusFilters2.filter((s2) => s2 !== NEW && s2 !== MOD), contextualExcludedStatuses = excludedStatusFilters2.filter((s2) => s2 !== NEW && s2 !== MOD), tagFilterFn = computeTagsFilterFn(includedTagFilters, excludedTagFilters), statusFilterFn = computeStatusFilterFn(
25851      contextualIncludedStatuses,
25852      contextualExcludedStatuses
25853    ), next = 0, modified = 0, entries = index.entries ?? {};
25854    for (let [storyId, statusesByType] of Object.entries(allStatuses)) {
25855      let entry = entries[storyId];
25856      if (!entry)
25857        continue;
25858      let entryWithStatuses = { ...entry, statuses: statusesByType };
25859      if (!tagFilterFn(entryWithStatuses) || !statusFilterFn(entryWithStatuses))
25860        continue;
25861      let statuses = Object.values(statusesByType);
25862      statuses.some(({ value }) => value === NEW) && (next += 1), statuses.some(({ value }) => value === MOD) && (modified += 1);
25863    }
25864    return { newCount: next, modifiedCount: modified };
25865  }, [
25866    index,
25867    allStatuses,
25868    rawIncludedStatusFilters,
25869    rawExcludedStatusFilters,
25870    rawIncludedTagFilters,
25871    rawExcludedTagFilters
25872  ]), includedStatusFilters = rawIncludedStatusFilters ?? [], excludedStatusFilters = rawExcludedStatusFilters ?? [], isReviewActive = includedStatusFilters.includes(NEW) && includedStatusFilters.includes(MOD);
25873  if (!globalThis.FEATURES?.changeDetection || newCount === 0 && modifiedCount === 0)
25874    return null;
25875  let clearReview = () => {
25876    let nextIncluded = includedStatusFilters.filter((s2) => s2 !== NEW && s2 !== MOD), nextExcluded = excludedStatusFilters.filter((s2) => s2 !== NEW && s2 !== MOD);
25877    api.setAllStatusFilters(nextIncluded, nextExcluded);
25878  }, onClick = () => {
25879    if (isReviewActive)
25880      clearReview();
25881    else {
25882      let nextIncluded = Array.from(/* @__PURE__ */ new Set([...includedStatusFilters, NEW, MOD])), nextExcluded = excludedStatusFilters.filter((s2) => s2 !== NEW && s2 !== MOD);
25883      api.setAllStatusFilters(nextIncluded, nextExcluded);
25884    }
25885  }, onClearClick = (e2) => {
25886    e2.stopPropagation(), clearReview();
25887  }, changeKinds = newCount > 0 && modifiedCount > 0 ? "new and modified" : newCount > 0 ? "new" : "modified", label = `${isReviewActive ? "Reviewing" : "Review"} ${changeKinds} stories`;
25888  return react_default.createElement(Wrapper8, null, react_default.createElement(
25889    StyledCTA,
25890    {
25891      variant: "ghost",
25892      padding: "small",
25893      pressed: isReviewActive,
25894      ariaLabel: label,
25895      onClick
25896    },
25897    react_default.createElement(StyledIcon, { viewBox: "0 0 14 14", width: "14", height: "14", "aria-hidden": !0 }, react_default.createElement(UseSymbol, { type: "new" })),
25898    label
25899  ), isReviewActive && react_default.createElement(
25900    Button,
25901    {
25902      variant: "ghost",
25903      padding: "small",
25904      size: "small",
25905      onClick: onClearClick,
25906      ariaLabel: "Clear",
25907      tooltip: "Clear"
25908    },
25909    react_default.createElement(CloseIcon, null)
25910  ));
25911}, ReviewChangesButton_default = ReviewChangesButton;
25912
vendor: 14,509 bytes, lines 25913-26306
25913// src/manager/components/sidebar/useLastViewed.ts
25914init_react();
25915var import_store2 = __toESM(require_store2(), 1), save = debounce((value) => import_store2.default.set("lastViewedStoryIds", value), 1e3), useLastViewed = (selection) => {
25916  let initialLastViewedStoryIds = useMemo(() => {
25917    let items = import_store2.default.get("lastViewedStoryIds");
25918    return !items || !Array.isArray(items) ? [] : items.some((item) => typeof item == "object" && item.storyId && item.refId) ? items : [];
25919  }, [import_store2.default]), lastViewedRef = useRef(initialLastViewedStoryIds), updateLastViewed = useCallback(
25920    (story) => {
25921      let items = lastViewedRef.current, index = items.findIndex(
25922        ({ storyId, refId }) => storyId === story.storyId && refId === story.refId
25923      );
25924      index !== 0 && (index === -1 ? lastViewedRef.current = [story, ...items] : lastViewedRef.current = [story, ...items.slice(0, index), ...items.slice(index + 1)], save(lastViewedRef.current));
25925    },
25926    [lastViewedRef]
25927  );
25928  return useEffect(() => {
25929    selection && updateLastViewed(selection);
25930  }, [selection]), {
25931    getLastViewed: useCallback(() => lastViewedRef.current, [lastViewedRef]),
25932    clearLastViewed: useCallback(() => {
25933      lastViewedRef.current = lastViewedRef.current.slice(0, 1), save(lastViewedRef.current);
25934    }, [lastViewedRef])
25935  };
25936};
25937
25938// src/manager/components/sidebar/Sidebar.tsx
25939var DEFAULT_REF_ID = "storybook_internal", Container11 = styled.header(({ theme }) => ({
25940  position: "absolute",
25941  zIndex: 1,
25942  left: 0,
25943  top: 0,
25944  bottom: 0,
25945  right: 0,
25946  width: "100%",
25947  height: "100%",
25948  display: "flex",
25949  flexDirection: "column",
25950  background: theme.background.content,
25951  [MEDIA_DESKTOP_BREAKPOINT]: {
25952    background: theme.background.app
25953  }
25954})), Stack = styled.div({
25955  display: "flex",
25956  flexDirection: "column",
25957  gap: 16,
25958  padding: "16px 12px 20px 12px"
25959}), CreateNewStoryButton = styled(Button)(({ theme, isMobile: isMobile2 }) => ({
25960  color: theme.textMutedColor,
25961  width: isMobile2 ? 36 : 32,
25962  height: isMobile2 ? 36 : 32,
25963  borderRadius: theme.appBorderRadius + 2
25964})), useCombination = (index, indexError, previewInitialized, allStatuses, refs) => {
25965  let hash = useMemo(
25966    () => ({
25967      [DEFAULT_REF_ID]: {
25968        index,
25969        filteredIndex: index,
25970        indexError,
25971        previewInitialized,
25972        allStatuses,
25973        title: null,
25974        id: DEFAULT_REF_ID,
25975        url: "iframe.html"
25976      },
25977      ...refs
25978    }),
25979    [refs, index, indexError, previewInitialized, allStatuses]
25980  );
25981  return useMemo(() => ({ hash, entries: Object.entries(hash) }), [hash]);
25982}, isRendererReact2 = scope.STORYBOOK_RENDERER === "react", Sidebar = react_default.memo(function({
25983  // @ts-expect-error (non strict)
25984  storyId = null,
25985  refId = DEFAULT_REF_ID,
25986  index,
25987  indexJson,
25988  indexError,
25989  allStatuses,
25990  previewInitialized,
25991  menu,
25992  menuHighlighted = !1,
25993  enableShortcuts = !0,
25994  isDevelopment = scope.CONFIG_TYPE === "DEVELOPMENT",
25995  refs = {},
25996  onMenuClick,
25997  showCreateStoryButton = isDevelopment && isRendererReact2
25998}) {
25999  let [isFileSearchModalOpen, setIsFileSearchModalOpen] = useState(!1), selected = useMemo(() => storyId && { storyId, refId }, [storyId, refId]), dataset = useCombination(index, indexError, previewInitialized, allStatuses, refs), isLoading = !index && !indexError, hasEntries = Object.keys(indexJson?.entries ?? {}).length > 0, lastViewedProps = useLastViewed(selected), { isMobile: isMobile2 } = useLayout(), api = useStorybookApi(), { viewMode } = api.getUrlState(), headerRef = useRef(null), { landmarkProps } = useLandmark(
26000    { "aria-labelledby": "global-site-h1", role: "banner" },
26001    headerRef
26002  ), skipLinkHref = viewMode !== void 0 && viewMode !== "story" && viewMode !== "docs" ? "#main-content-wrapper" : "#storybook-preview-wrapper";
26003  return react_default.createElement(
26004    Container11,
26005    {
26006      className: "container sidebar-container",
26007      id: focusableUIElements.sidebarRegion,
26008      ref: headerRef,
26009      ...landmarkProps
26010    },
26011    react_default.createElement("h1", { id: "global-site-h1", className: "sb-sr-only" }, "Storybook"),
26012    react_default.createElement(IconSymbols, null),
26013    react_default.createElement(ScrollArea, { vertical: !0, offset: 3, scrollbarSize: 6, scrollPadding: "4rem" }, react_default.createElement(Stack, null, react_default.createElement("div", null, react_default.createElement(
26014      Heading2,
26015      {
26016        className: "sidebar-header",
26017        menuHighlighted,
26018        menu,
26019        skipLinkHref,
26020        isLoading,
26021        onMenuClick
26022      }
26023    ), !isLoading && scope.CONFIG_TYPE === "DEVELOPMENT" && scope.FEATURES?.sidebarOnboardingChecklist !== !1 && react_default.createElement(ChecklistWidget, null)), react_default.createElement(
26024      Search,
26025      {
26026        dataset,
26027        enableShortcuts,
26028        searchBarContent: showCreateStoryButton && react_default.createElement(react_default.Fragment, null, react_default.createElement(
26029          CreateNewStoryButton,
26030          {
26031            isMobile: isMobile2,
26032            onClick: () => {
26033              setIsFileSearchModalOpen(!0);
26034            },
26035            ariaLabel: "Create a new story",
26036            variant: "outline",
26037            padding: "small"
26038          },
26039          react_default.createElement(PlusIcon, null)
26040        ), react_default.createElement(
26041          CreateNewStoryFileModal,
26042          {
26043            open: isFileSearchModalOpen,
26044            onOpenChange: setIsFileSearchModalOpen
26045          }
26046        )),
26047        searchFieldContent: react_default.createElement(Filter, null),
26048        belowSearchContent: react_default.createElement(ReviewChangesButton_default, null),
26049        ...lastViewedProps
26050      },
26051      ({
26052        query,
26053        results,
26054        isNavVisible,
26055        isNavReachable,
26056        isSearchResultRendered,
26057        closeMenu,
26058        getMenuProps,
26059        getItemProps,
26060        highlightedIndex
26061      }) => react_default.createElement(react_default.Fragment, null, react_default.createElement(
26062        Explorer,
26063        {
26064          dataset,
26065          selected,
26066          isLoading,
26067          isBrowsing: isNavVisible,
26068          isHidden: !isNavReachable,
26069          hasEntries
26070        }
26071      ), isSearchResultRendered && react_default.createElement(
26072        SearchResults,
26073        {
26074          query,
26075          results,
26076          closeMenu,
26077          getMenuProps,
26078          getItemProps,
26079          highlightedIndex,
26080          enableShortcuts,
26081          isLoading,
26082          clearLastViewed: lastViewedProps.clearLastViewed
26083        }
26084      ))
26085    )), isMobile2 || isLoading ? null : react_default.createElement(SidebarBottom, { isDevelopment }))
26086  );
26087});
26088
26089// src/manager/container/Menu.tsx
26090init_react();
26091var ProgressCircle2 = styled(ProgressSpinner)(({ theme }) => ({
26092  color: theme.color.secondary
26093})), useMenu = ({
26094  api,
26095  showToolbar,
26096  isPanelShown,
26097  isNavShown,
26098  enableShortcuts
26099}) => {
26100  let shortcutKeys = api.getShortcutKeys(), { progress } = useChecklist(), about = useMemo(
26101    () => ({
26102      id: "about",
26103      title: "About your Storybook",
26104      onClick: () => api.changeSettingsTab("about"),
26105      href: "./?path=/settings/about",
26106      internal: !0,
26107      closeOnClick: !0,
26108      icon: react_default.createElement(InfoIcon, null)
26109    }),
26110    [api]
26111  ), guide = useMemo(
26112    () => ({
26113      id: "guide",
26114      title: "Onboarding guide",
26115      onClick: () => api.changeSettingsTab("guide"),
26116      href: "./?path=/settings/guide",
26117      internal: !0,
26118      closeOnClick: !0,
26119      icon: react_default.createElement(ListUnorderedIcon, null),
26120      right: progress < 100 && react_default.createElement(ActionList.Button, { as: "div", readOnly: !0, padding: "none", ariaLabel: `${progress}% completed` }, react_default.createElement(ProgressCircle2, { percentage: progress, running: !1, size: 16, width: 1.5 }), progress, "%")
26121    }),
26122    [api, progress]
26123  ), shortcuts = useMemo(
26124    () => ({
26125      id: "shortcuts",
26126      title: "Keyboard shortcuts",
26127      onClick: () => api.changeSettingsTab("shortcuts"),
26128      href: "./?path=/settings/shortcuts",
26129      internal: !0,
26130      closeOnClick: !0,
26131      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.shortcutsPage }) : null,
26132      icon: react_default.createElement(CommandIcon, null)
26133    }),
26134    [api, enableShortcuts, shortcutKeys.shortcutsPage]
26135  ), sidebarToggle = useMemo(
26136    () => ({
26137      id: "S",
26138      title: "Show sidebar",
26139      onClick: () => api.toggleNav(),
26140      closeOnClick: !0,
26141      active: isNavShown,
26142      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.toggleNav }) : null,
26143      icon: isNavShown ? react_default.createElement(CheckIcon, null) : react_default.createElement(react_default.Fragment, null)
26144    }),
26145    [api, enableShortcuts, shortcutKeys, isNavShown]
26146  ), toolbarToogle = useMemo(
26147    () => ({
26148      id: "T",
26149      title: "Show toolbar",
26150      onClick: () => api.toggleToolbar(),
26151      active: showToolbar,
26152      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.toolbar }) : null,
26153      icon: showToolbar ? react_default.createElement(CheckIcon, null) : react_default.createElement(react_default.Fragment, null)
26154    }),
26155    [api, enableShortcuts, shortcutKeys, showToolbar]
26156  ), addonsToggle = useMemo(
26157    () => ({
26158      id: "A",
26159      title: "Show addons panel",
26160      onClick: () => api.togglePanel(),
26161      active: isPanelShown,
26162      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.togglePanel }) : null,
26163      icon: isPanelShown ? react_default.createElement(CheckIcon, null) : react_default.createElement(react_default.Fragment, null)
26164    }),
26165    [api, enableShortcuts, shortcutKeys, isPanelShown]
26166  ), up = useMemo(
26167    () => ({
26168      id: "up",
26169      title: "Previous component",
26170      onClick: () => api.jumpToComponent(-1),
26171      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.prevComponent }) : null,
26172      icon: react_default.createElement(react_default.Fragment, null)
26173    }),
26174    [api, enableShortcuts, shortcutKeys]
26175  ), down = useMemo(
26176    () => ({
26177      id: "down",
26178      title: "Next component",
26179      onClick: () => api.jumpToComponent(1),
26180      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.nextComponent }) : null,
26181      icon: react_default.createElement(react_default.Fragment, null)
26182    }),
26183    [api, enableShortcuts, shortcutKeys]
26184  ), prev = useMemo(
26185    () => ({
26186      id: "prev",
26187      title: "Previous story",
26188      onClick: () => api.jumpToStory(-1),
26189      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.prevStory }) : null,
26190      icon: react_default.createElement(react_default.Fragment, null)
26191    }),
26192    [api, enableShortcuts, shortcutKeys]
26193  ), next = useMemo(
26194    () => ({
26195      id: "next",
26196      title: "Next story",
26197      onClick: () => api.jumpToStory(1),
26198      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.nextStory }) : null,
26199      icon: react_default.createElement(react_default.Fragment, null)
26200    }),
26201    [api, enableShortcuts, shortcutKeys]
26202  ), collapse = useMemo(
26203    () => ({
26204      id: "collapse",
26205      title: "Collapse all",
26206      onClick: () => api.emit(STORIES_COLLAPSE_ALL),
26207      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: shortcutKeys.collapseAll }) : null,
26208      icon: react_default.createElement(react_default.Fragment, null)
26209    }),
26210    [api, enableShortcuts, shortcutKeys]
26211  ), documentation = useMemo(() => ({
26212    id: "documentation",
26213    title: "Documentation",
26214    closeOnClick: !0,
26215    href: api.getDocsUrl({ versioned: !0, renderer: !0 }),
26216    right: react_default.createElement(ActionList.Icon, null, react_default.createElement(ShareAltIcon, null)),
26217    icon: react_default.createElement(DocumentIcon, null)
26218  }), [api]), getAddonsShortcuts = useCallback(() => {
26219    let addonsShortcuts = api.getAddonsShortcuts(), keys = shortcutKeys;
26220    return Object.entries(addonsShortcuts).filter(([_2, { showInMenu }]) => showInMenu).map(([actionName, { label, action }]) => ({
26221      id: actionName,
26222      title: label,
26223      onClick: () => action(),
26224      right: enableShortcuts ? react_default.createElement(Shortcut, { keys: keys[actionName] }) : null
26225    }));
26226  }, [api, enableShortcuts, shortcutKeys]);
26227  return useMemo(
26228    () => [
26229      [
26230        about,
26231        ...scope.CONFIG_TYPE === "DEVELOPMENT" ? [guide] : [],
26232        ...enableShortcuts ? [shortcuts] : []
26233      ],
26234      [sidebarToggle, toolbarToogle, addonsToggle, up, down, prev, next, collapse],
26235      getAddonsShortcuts(),
26236      [documentation]
26237    ],
26238    [
26239      about,
26240      guide,
26241      documentation,
26242      shortcuts,
26243      sidebarToggle,
26244      toolbarToogle,
26245      addonsToggle,
26246      up,
26247      down,
26248      prev,
26249      next,
26250      collapse,
26251      getAddonsShortcuts,
26252      enableShortcuts
26253    ]
26254  );
26255};
26256
26257// src/manager/container/Sidebar.tsx
26258var Sidebar3 = react_default.memo(function({ onMenuClick }) {
26259  return react_default.createElement(Consumer, { filter: ({ state, api }) => {
26260    let {
26261      ui: { name, url, enableShortcuts },
26262      viewMode,
26263      storyId,
26264      refId,
26265      layout: { showToolbar },
26266      // FIXME: This is the actual `index.json` index where the `index` below
26267      // is actually the stories hash. We should fix this up and make it consistent.
26268      internal_index,
26269      filteredIndex: index,
26270      indexError,
26271      previewInitialized,
26272      refs
26273    } = state, whatsNewNotificationsEnabled = state.whatsNewData?.status === "SUCCESS" && !state.disableWhatsNewNotifications;
26274    return {
26275      api,
26276      title: name,
26277      url,
26278      indexJson: internal_index,
26279      index,
26280      indexError,
26281      previewInitialized,
26282      refs,
26283      storyId,
26284      refId,
26285      viewMode,
26286      showToolbar,
26287      isPanelShown: api.getIsPanelShown(),
26288      isNavShown: api.getIsNavShown(),
26289      menuHighlighted: whatsNewNotificationsEnabled && api.isWhatsNewUnread(),
26290      enableShortcuts
26291    };
26292  } }, ({ api, showToolbar, isPanelShown, isNavShown, enableShortcuts, ...state }) => {
26293    let menu = useMenu({ api, showToolbar, isPanelShown, isNavShown, enableShortcuts }), allStatuses = experimental_useStatusStore();
26294    return react_default.createElement(
26295      Sidebar,
26296      {
26297        ...state,
26298        menu,
26299        onMenuClick,
26300        allStatuses,
26301        enableShortcuts
26302      }
26303    );
26304  });
26305}), Sidebar_default = Sidebar3;
26306
26307// src/manager/App.tsx
26308var App = ({ managerLayoutState, setManagerLayoutState, pages, hasTab }) => {
26309  let { setMobileAboutOpen } = useLayout(), { enableShortcuts = !0 } = addons.getConfig();
26310  return useEffect(() => {
26311    document.body.setAttribute("data-shortcuts-enabled", enableShortcuts ? "true" : "false");
26312  }, [enableShortcuts]), useEffect(() => {
26313    let rootElement = document.getElementById("root");
26314    if (!rootElement)
26315      return;
26316    let observer = new MutationObserver(() => {
26317      let hasInert = rootElement.hasAttribute("inert");
26318      addons.getChannel().emit(core_events_default.MANAGER_INERT_ATTRIBUTE_CHANGED, hasInert);
26319    });
26320    return observer.observe(rootElement, {
26321      attributes: !0,
26322      attributeFilter: ["inert"]
26323    }), () => observer.disconnect();
26324  }, []), react_default.createElement(react_default.Fragment, null, react_default.createElement(Global, { styles: createGlobal }), react_default.createElement(ManagerErrorBoundary, null, react_default.createElement(
26325    Layout,
26326    {
26327      hasTab,
26328      managerLayoutState,
26329      setManagerLayoutState,
26330      slotMain: react_default.createElement(Preview_default, { id: "main", withLoader: !0 }),
26331      slotSidebar: react_default.createElement(Sidebar_default, { onMenuClick: () => setMobileAboutOpen((state) => !state) }),
26332      slotPanel: react_default.createElement(Panel_default, null),
26333      slotPages: pages.map(({ id, render: Content6 }) => react_default.createElement(Content6, { key: id }))
26334    }
26335  )
vendor: 780 bytes, lines 26335-26373
26335));
26336};
26337
26338// src/manager/provider.ts
26339var Provider2 = class {
26340  getElements(_type) {
26341    throw new Error("Provider.getElements() is not implemented!");
26342  }
26343  handleAPI(_api) {
26344    throw new Error("Provider.handleAPI() is not implemented!");
26345  }
26346  getConfig() {
26347    return console.error("Provider.getConfig() is not implemented!"), {};
26348  }
26349};
26350
26351// src/manager/settings/index.tsx
26352init_react();
26353
26354// src/manager/settings/AboutPage.tsx
26355init_react();
26356
26357// src/manager/settings/About.tsx
26358init_react();
26359var Container12 = styled.div({
26360  display: "flex",
26361  alignItems: "center",
26362  flexDirection: "column",
26363  marginTop: 40
26364}), Header = styled.header({
26365  marginBottom: 32,
26366  alignItems: "center",
26367  display: "flex",
26368  "> svg": {
26369    height: 48,
26370    width: "auto",
26371    marginRight: 8
26372  }
26373}), Footer
vendor: 1,056 bytes, lines 26373-26396
26373 = styled.div(({ theme }) => ({
26374  marginBottom: 24,
26375  display: "flex",
26376  flexDirection: "column",
26377  alignItems: "center",
26378  color: theme.base === "light" ? theme.color.dark : theme.color.lightest,
26379  fontWeight: theme.typography.weight.regular,
26380  fontSize: theme.typography.size.s2
26381})), Actions2 = styled.div({
26382  display: "flex",
26383  flexDirection: "row",
26384  alignItems: "center",
26385  marginBottom: 24,
26386  marginTop: 24,
26387  gap: 16
26388}), StyledLink = styled(Link)(({ theme }) => ({
26389  "&&": {
26390    fontWeight: theme.typography.weight.bold,
26391    color: theme.base === "light" ? theme.color.dark : theme.color.light
26392  },
26393  "&:hover": {
26394    color: theme.base === "light" ? theme.color.darkest : theme.color.lightest
26395  }
26396})), AboutScreen = ({ onNavigateToWhatsNew }) => react_default.createElement(Container12, null, react_default.createElement(Header, null, react_default.createElement(StorybookLogo, { alt: "Storybook" })), react_default.createElement(UpgradeBlock, { onNavigateToWhatsNew }), react_default.createElement(Footer, null, react_default.createElement(Actions2
vendor: 8,217 bytes, lines 26396-26633
26396, null, react_default.createElement(Button, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: "https://github.com/storybookjs/storybook" }, react_default.createElement(GithubIcon, null), "GitHub")), react_default.createElement(Button, { ariaLabel: !1, asChild: !0 }, react_default.createElement("a", { href: "https://storybook.js.org/docs?ref=ui" }, react_default.createElement(DocumentIcon, { style: { display: "inline", marginRight: 5 } }), "Documentation"))), react_default.createElement("div", null, "Open source software maintained by", " ", react_default.createElement(StyledLink, { href: "https://www.chromatic.com/" }, "Chromatic"), " and the", " ", react_default.createElement(StyledLink, { href: "https://github.com/storybookjs/storybook/graphs/contributors" }, "Storybook Community"))));
26397
26398// src/manager/settings/AboutPage.tsx
26399var NotificationClearer = class extends Component {
26400  componentDidMount() {
26401    let { api, notificationId } = this.props;
26402    api.clearNotification(notificationId);
26403  }
26404  render() {
26405    let { children } = this.props;
26406    return children;
26407  }
26408}, AboutPage = () => {
26409  let api = useStorybookApi(), state = useStorybookState(), onNavigateToWhatsNew = useCallback(() => {
26410    api.changeSettingsTab("whats-new");
26411  }, [api]);
26412  return react_default.createElement(NotificationClearer, { api, notificationId: "update" }, react_default.createElement(
26413    AboutScreen,
26414    {
26415      onNavigateToWhatsNew: state.whatsNewData?.status === "SUCCESS" ? onNavigateToWhatsNew : void 0
26416    }
26417  ));
26418};
26419
26420// src/manager/settings/GuidePage.tsx
26421init_react();
26422
26423// src/manager/settings/Checklist/Checklist.tsx
26424init_react();
26425
26426// src/manager/components/Focus/Focus.tsx
26427init_react();
26428var FocusOutline = styled.div(
26429  ({ theme, active = !1, outlineOffset = 0 }) => ({
26430    width: "100%",
26431    borderRadius: "inherit",
26432    transition: "outline-color var(--transition-duration, 0.2s)",
26433    outline: `2px solid ${active ? theme.color.secondary : "transparent"}`,
26434    outlineOffset
26435  })
26436), FocusProxy = styled(FocusOutline)(({ theme, targetId }) => ({
26437  [`&:has([data-target-id="${targetId}"]:focus-visible)`]: {
26438    outlineColor: theme.color.secondary
26439  }
26440})), FocusRing = ({
26441  active = !1,
26442  highlightDuration,
26443  nodeRef,
26444  ...props
26445}) => {
26446  let [visible, setVisible] = useState(active);
26447  return useEffect(() => {
26448    if (highlightDuration) {
26449      setVisible(active);
26450      let timeout = setTimeout(setVisible, highlightDuration, !1);
26451      return () => clearTimeout(timeout);
26452    }
26453  }, [active, highlightDuration]), react_default.createElement(FocusOutline, { ...props, active: highlightDuration ? visible : active, ref: nodeRef });
26454}, FocusTarget = ({
26455  targetHash,
26456  highlightDuration,
26457  ...props
26458}) => {
26459  let nodeRef = useRef(null), locationHash = useLocationHash(), [active, setActive] = useState(locationHash === targetHash);
26460  return useEffect(() => {
26461    let timeouts = [];
26462    return setActive(!1), locationHash === targetHash && (timeouts.push(
26463      setTimeout(() => {
26464        setActive(!0), nodeRef.current?.focus({ preventScroll: !0 }), nodeRef.current?.scrollIntoView({ behavior: "smooth", block: "center" });
26465      }, 0)
26466    ), highlightDuration && timeouts.push(setTimeout(setActive, highlightDuration, !1))), () => timeouts.forEach(clearTimeout);
26467  }, [locationHash, targetHash, highlightDuration]), react_default.createElement(FocusRing, { ...props, active, nodeRef, tabIndex: -1 });
26468}, Focus = {
26469  Outline: FocusOutline,
26470  Proxy: FocusProxy,
26471  Ring: FocusRing,
26472  Target: FocusTarget
26473};
26474
26475// src/manager/settings/Checklist/Checklist.tsx
26476var Sections = styled.ol(({ theme }) => ({
26477  listStyle: "none",
26478  display: "flex",
26479  flexDirection: "column",
26480  gap: 20,
26481  margin: 0,
26482  padding: 0,
26483  "& > li": {
26484    background: theme.background.content,
26485    border: `1px solid ${theme.base === "dark" ? theme.color.darker : theme.color.border}`,
26486    borderRadius: 8
26487  }
26488})), Items = styled.ol(({ theme }) => ({
26489  listStyle: "none",
26490  display: "flex",
26491  flexDirection: "column",
26492  margin: 0,
26493  padding: 0,
26494  "& > li:not(:last-child)": {
26495    boxShadow: `inset 0 -1px 0 ${theme.base === "dark" ? theme.color.darker : theme.color.border}`
26496  },
26497  "& > li:last-child": {
26498    borderBottomLeftRadius: 7,
26499    borderBottomRightRadius: 7
26500  }
26501})), SectionSummary = styled.div(
26502  ({ theme, progress, isCollapsed, onClick }) => ({
26503    position: "relative",
26504    fontWeight: "bold",
26505    display: "flex",
26506    alignItems: "center",
26507    gap: 10,
26508    padding: "10px 10px 10px 15px",
26509    borderBottom: `5px solid ${theme.base === "dark" ? theme.color.darker : theme.color.light}`,
26510    borderBottomLeftRadius: isCollapsed ? 7 : 0,
26511    borderBottomRightRadius: isCollapsed ? 7 : 0,
26512    transition: "border-radius var(--transition-duration, 0.2s)",
26513    cursor: onClick ? "pointer" : "default",
26514    "--toggle-button-rotate": isCollapsed ? "0deg" : "180deg",
26515    "--toggle-button-opacity": 0,
26516    "&:hover, &:focus-visible": {
26517      outline: "none",
26518      "--toggle-button-opacity": 1
26519    },
26520    "&::after": {
26521      pointerEvents: "none",
26522      position: "absolute",
26523      top: 0,
26524      bottom: -5,
26525      left: 0,
26526      right: 0,
26527      content: '""',
26528      display: "block",
26529      width: `${progress}%`,
26530      borderBottom: `5px solid ${theme.color.positive}`,
26531      borderBottomLeftRadius: "inherit",
26532      borderBottomRightRadius: progress === 100 ? "inherit" : 0,
26533      transition: "width var(--transition-duration, 0.2s)"
26534    }
26535  })
26536), SectionHeading = styled.h2(({ theme }) => ({
26537  flex: 1,
26538  margin: 0,
26539  fontSize: theme.typography.size.s3,
26540  fontWeight: theme.typography.weight.bold
26541})), ItemSummary = styled.div(
26542  ({ theme, isCollapsed, onClick }) => ({
26543    fontWeight: theme.typography.weight.regular,
26544    fontSize: theme.typography.size.s2,
26545    display: "flex",
26546    alignItems: "center",
26547    minHeight: 40,
26548    gap: 10,
26549    padding: isCollapsed ? "6px 10px 6px 15px" : "10px 10px 10px 15px",
26550    transition: "padding var(--transition-duration, 0.2s)",
26551    cursor: onClick ? "pointer" : "default",
26552    "--toggle-button-rotate": isCollapsed ? "0deg" : "180deg",
26553    "&:focus-visible": {
26554      outline: "none"
26555    }
26556  })
26557), ItemHeading = styled.h3(({ theme, skipped }) => ({
26558  flex: 1,
26559  margin: 0,
26560  color: skipped ? theme.textMutedColor : theme.color.defaultText,
26561  overflow: "hidden",
26562  textOverflow: "ellipsis",
26563  whiteSpace: "nowrap",
26564  fontSize: theme.typography.size.s2,
26565  fontWeight: theme.typography.weight.bold
26566})), ItemContent2 = styled.div(({ theme }) => ({
26567  display: "flex",
26568  flexDirection: "column",
26569  alignItems: "flex-start",
26570  gap: 8,
26571  padding: "0 15px 15px 41px",
26572  fontSize: theme.typography.size.s2,
26573  code: {
26574    fontSize: "0.9em",
26575    backgroundColor: theme.background.app,
26576    borderRadius: theme.appBorderRadius,
26577    padding: "1px 3px"
26578  },
26579  img: {
26580    maxWidth: "100%",
26581    margin: "15px auto"
26582  },
26583  p: {
26584    margin: 0,
26585    lineHeight: 1.4
26586  },
26587  "ol, ul": {
26588    paddingLeft: 25,
26589    listStyleType: "disc",
26590    "li::marker": {
26591      color: theme.color.mediumdark
26592    }
26593  }
26594})), StatusIcon3 = styled.div(({ theme }) => ({
26595  position: "relative",
26596  flex: "0 0 auto",
26597  minHeight: 16,
26598  minWidth: 16,
26599  margin: 0,
26600  background: theme.base === "dark" ? theme.color.darkest : theme.background.app,
26601  borderRadius: 9,
26602  outline: `1px solid ${theme.base === "dark" ? theme.color.darker : theme.color.border}`,
26603  outlineOffset: -1
26604})), Checked2 = styled(StatusPassIcon)(
26605  ({ theme, "data-visible": visible }) => ({
26606    position: "absolute",
26607    width: "inherit",
26608    height: "inherit",
26609    top: 0,
26610    left: 0,
26611    bottom: 0,
26612    right: 0,
26613    padding: 1,
26614    borderRadius: "50%",
26615    background: theme.color.positive,
26616    color: theme.background.content,
26617    opacity: visible ? 1 : 0,
26618    transform: visible ? "scale(1)" : "scale(0.7)",
26619    transition: "all var(--transition-duration, 0.2s)"
26620  })
26621), Skipped = styled.span(({ theme, visible }) => ({
26622  display: "flex",
26623  alignItems: "center",
26624  color: theme.textMutedColor,
26625  fontSize: "12px",
26626  fontWeight: "bold",
26627  overflow: "hidden",
26628  padding: visible ? "0 10px" : 0,
26629  opacity: visible ? 1 : 0,
26630  width: visible ? "auto" : 0,
26631  height: visible ? 18 : 16,
26632  transition: "all var(--transition-duration, 0.2s)"
26633})), Actions
vendor: 10,551 bytes, lines 26633-26880
266333 = styled.div({
26634  alignSelf: "flex-end",
26635  flexDirection: "row-reverse",
26636  display: "flex",
26637  gap: 4
26638}), ToggleButton2 = styled(Button)({
26639  opacity: "var(--toggle-button-opacity)",
26640  transition: "opacity var(--transition-duration, 0.2s)",
26641  "&:hover, &:focus": {
26642    opacity: 1
26643  },
26644  svg: {
26645    transform: "rotate(var(--toggle-button-rotate))",
26646    transition: "transform var(--transition-duration, 0.2s)"
26647  }
26648}), ChecklistCopyButton = ({
26649  label,
26650  copyContent,
26651  onClick
26652}) => {
26653  let { children: copyChildren, buttonProps: copyButtonProps } = useCopyButton({
26654    children: label,
26655    onCopy: onClick,
26656    content: copyContent
26657  });
26658  return react_default.createElement(Button, { variant: "solid", size: "small", ...copyButtonProps }, copyChildren);
26659}, Checklist = ({
26660  availableItems,
26661  accept,
26662  skip,
26663  reset,
26664  forceCollapsed = !1
26665}) => {
26666  let api = useStorybookApi(), locationHash = useLocationHash(), { itemsById, sectionsById } = useMemo(
26667    () => availableItems.reduce(
26668      (acc, item) => {
26669        acc.itemsById[item.id] = item;
26670        let { sectionId: id, sectionTitle: title2 } = item;
26671        return acc.sectionsById[id] = acc.sectionsById[id] ?? { id, title: title2, itemIds: [] }, acc.sectionsById[id].itemIds.push(item.id), acc;
26672      },
26673      { itemsById: {}, sectionsById: {} }
26674    ),
26675    [availableItems]
26676  ), sections = useMemo(
26677    () => Object.values(sectionsById).map(({ id, title: title2, itemIds }) => {
26678      let items = itemIds.map((id2) => itemsById[id2]).filter(({ showOnGuidePage }) => showOnGuidePage !== !1), progress = items.reduce((acc, item) => item.isOpen ? acc : acc + 1, 0) / items.length * 100;
26679      return { id, title: title2, items, progress };
26680    }),
26681    [itemsById, sectionsById]
26682  );
26683  return react_default.createElement(Sections, null, sections.map(({ id, title: title2, items, progress }) => {
26684    let collapsed = forceCollapsed || progress === 100 && items.every((item) => item.id !== locationHash);
26685    return react_default.createElement("li", { key: id }, react_default.createElement(Focus.Proxy, { targetId: `toggle-${id}` }, react_default.createElement(
26686      Collapsible,
26687      {
26688        collapsed,
26689        summary: ({ isCollapsed, toggleCollapsed, toggleProps }) => react_default.createElement(
26690          SectionSummary,
26691          {
26692            progress,
26693            isCollapsed,
26694            onClick: toggleCollapsed
26695          },
26696          react_default.createElement(StatusIcon3, null, react_default.createElement(Checked2, { "data-visible": progress === 100 })),
26697          react_default.createElement(SectionHeading, null, title2),
26698          react_default.createElement(Actions3, null, react_default.createElement(
26699            ToggleButton2,
26700            {
26701              ...toggleProps,
26702              "data-target-id": `toggle-${id}`,
26703              variant: "ghost",
26704              padding: "small",
26705              "aria-label": title2
26706            },
26707            react_default.createElement(ChevronSmallDownIcon, null)
26708          ))
26709        )
26710      },
26711      react_default.createElement(Items, null, items.map(
26712        ({
26713          content,
26714          isOpen,
26715          isAccepted,
26716          isDone,
26717          isLockedBy,
26718          isImmutable,
26719          isSkipped,
26720          ...item
26721        }) => {
26722          let isChecked = isAccepted || isDone, isCollapsed = item.id !== locationHash, isLocked = !!isLockedBy, itemContent = content?.({ api });
26723          return react_default.createElement(ActionList.Item, { key: item.id }, react_default.createElement(
26724            Focus.Target,
26725            {
26726              targetHash: item.id,
26727              highlightDuration: 2e3,
26728              outlineOffset: -2
26729            },
26730            react_default.createElement(Focus.Proxy, { targetId: `toggle-${item.id}`, outlineOffset: -2 }, react_default.createElement(
26731              Collapsible,
26732              {
26733                collapsed: isCollapsed,
26734                summary: ({ isCollapsed: isCollapsed2, toggleCollapsed, toggleProps }) => react_default.createElement(
26735                  ItemSummary,
26736                  {
26737                    isCollapsed: isCollapsed2 || !itemContent,
26738                    onClick: itemContent ? toggleCollapsed : void 0
26739                  },
26740                  react_default.createElement(StatusIcon3, null, react_default.createElement(Checked2, { "data-visible": isChecked }), react_default.createElement(Skipped, { visible: isSkipped }, "Skipped")),
26741                  react_default.createElement(ItemHeading, { skipped: isSkipped }, item.label),
26742                  react_default.createElement(Actions3, null, itemContent && react_default.createElement(
26743                    ToggleButton2,
26744                    {
26745                      ...toggleProps,
26746                      "data-target-id": `toggle-${item.id}`,
26747                      variant: "ghost",
26748                      padding: "small",
26749                      ariaLabel: `${isCollapsed2 ? "Expand" : "Collapse"} ${item.label}`
26750                    },
26751                    react_default.createElement(ChevronSmallDownIcon, null)
26752                  ), isLocked && react_default.createElement(
26753                    Button,
26754                    {
26755                      variant: "ghost",
26756                      padding: "small",
26757                      ariaLabel: "Locked",
26758                      tooltip: `Complete \u201C${itemsById[isLockedBy].label}\u201D first`,
26759                      disabled: !0,
26760                      readOnly: !0
26761                    },
26762                    react_default.createElement(LockIcon, null)
26763                  ), isOpen && !isLocked && item.action && (item.action.copyContent ? react_default.createElement(
26764                    ChecklistCopyButton,
26765                    {
26766                      label: item.action.label,
26767                      copyContent: item.action.copyContent,
26768                      onClick: () => item.action.onClick({
26769                        api,
26770                        accept: () => accept(item.id)
26771                      })
26772                    }
26773                  ) : react_default.createElement(
26774                    Button,
26775                    {
26776                      ariaLabel: !1,
26777                      variant: "solid",
26778                      size: "small",
26779                      onClick: (e2) => {
26780                        e2.stopPropagation(), item.action?.onClick({
26781                          api,
26782                          accept: () => accept(item.id)
26783                        });
26784                      }
26785                    },
26786                    item.action.label
26787                  )), isOpen && !isLocked && !item.action && !item.subscribe && react_default.createElement(
26788                    Button,
26789                    {
26790                      ariaLabel: !1,
26791                      variant: "outline",
26792                      size: "small",
26793                      onClick: (e2) => {
26794                        e2.stopPropagation(), accept(item.id);
26795                      }
26796                    },
26797                    react_default.createElement(CheckIcon, null),
26798                    "Mark as complete"
26799                  ), isOpen && !isLocked && react_default.createElement(
26800                    Button,
26801                    {
26802                      ariaLabel: !1,
26803                      variant: "ghost",
26804                      size: "small",
26805                      onClick: (e2) => {
26806                        e2.stopPropagation(), skip(item.id);
26807                      }
26808                    },
26809                    "Skip"
26810                  ), (isAccepted && !isImmutable || isSkipped) && !isLocked && react_default.createElement(
26811                    Button,
26812                    {
26813                      ariaLabel: "Undo",
26814                      variant: "ghost",
26815                      padding: "small",
26816                      onClick: (e2) => {
26817                        e2.stopPropagation(), reset(item.id);
26818                      }
26819                    },
26820                    react_default.createElement(UndoIcon, null)
26821                  ))
26822                )
26823              },
26824              itemContent && react_default.createElement(ItemContent2, null, itemContent)
26825            ))
26826          ));
26827        }
26828      ))
26829    )));
26830  }));
26831};
26832
26833// src/manager/settings/Checklist/AiSetupBlock.tsx
26834init_react();
26835var AiCtaCard = styled.div(({ theme }) => ({
26836  display: "flex",
26837  flexDirection: "column",
26838  padding: "10px 10px 10px 15px",
26839  border: `1px solid ${theme.base === "dark" ? theme.color.darker : theme.color.border}`,
26840  borderRadius: 8,
26841  background: theme.background.content
26842})), AiCtaHeadingRow = styled.div({
26843  display: "flex",
26844  alignItems: "center",
26845  gap: 10
26846}), AiCtaHeading = styled.h2(({ theme, $skipped }) => ({
26847  flex: 1,
26848  margin: 0,
26849  color: $skipped ? theme.textMutedColor : theme.color.defaultText,
26850  fontSize: theme.typography.size.s2,
26851  fontWeight: theme.typography.weight.bold,
26852  textWrap: "pretty"
26853})), AiCtaDescription = styled.p(({ theme }) => ({
26854  margin: 0,
26855  color: theme.color.defaultText,
26856  fontSize: theme.typography.size.s2,
26857  fontWeight: theme.typography.weight.regular,
26858  marginTop: 8
26859})), AiCtaActions = styled.div({
26860  display: "flex",
26861  gap: 8,
26862  justifyContent: "flex-end",
26863  marginTop: 12
26864}), CopyButton2 = ({ api }) => {
26865  let { children: buttonChildren, buttonProps } = useCopyButton({
26866    children: "Copy prompt",
26867    childrenOnCopy: react_default.createElement(react_default.Fragment, null, react_default.createElement(CheckIcon, null), " Copied!"),
26868    content: getAiSetupPrompt(),
26869    onCopy: () => {
26870      api.emit(AI_PROMPT_NUDGE, { id: "setup", origin: "onboarding-guide-page" });
26871    }
26872  });
26873  return react_default.createElement(Button, { variant: "solid", size: "medium", ...buttonProps }, buttonChildren);
26874}, AiSetupBlock = ({
26875  item,
26876  reset,
26877  skip
26878}) => {
26879  let api = useStorybookApi();
26880  return !item.isDone && !item.isAccepted && !item.isCompleted ? react_default.createElement(AiCtaCard, null, react_default.createElement(AiCtaHeadingRow, null, item.isSkipped && react_default.createElement(StatusIcon3, null, react_default.createElement(Skipped, { visible: !0 }, "Skipped")), react_default.createElement(AiCtaHeading, { $skipped: item.isSkipped }, "Set up Storybook with AI"), item.isSkipped && react_default.createElement(Button, { ariaLabel: "Undo", variant: "ghost", padding: "small", onClick: () => reset(item.id) }, react_default.createElement(UndoIcon, null))), react_default.createElement(Collapsible.Content, { collapsed: item.isSkipped }, react_default.createElement(AiCtaDescription, null, "Run a prompt in your AI agent to analyze your co
26880debase, configure decorators and mocks, write sample stories for your UI components, and verify everything works."), react_default.createElement(AiCtaActions, null, react_default.createElement(Button, { variant: "ghost", size: "medium", ariaLabel: !1, onClick: () => skip(item.id) }, "Skip"), react_default.createElement(CopyButton2
vendor: 2,118 bytes, lines 26880-26918
26880, { api })))) : null;
26881};
26882
26883// src/manager/settings/GuidePage.tsx
26884var Container13 = styled.div(({ theme }) => ({
26885  display: "flex",
26886  flexDirection: "column",
26887  maxWidth: 600,
26888  margin: "0 auto",
26889  padding: "48px 20px",
26890  gap: 32,
26891  fontSize: theme.typography.size.s2,
26892  "--transition-duration": "0.2s"
26893})), Intro = styled.div(({ theme }) => ({
26894  display: "flex",
26895  flexDirection: "column",
26896  gap: 8,
26897  "& h1": {
26898    fontSize: theme.typography.size.m3,
26899    fontWeight: theme.typography.weight.bold,
26900    margin: 0
26901  },
26902  "& > p": {
26903    margin: 0
26904  }
26905})), GuidePage = () => {
26906  let checklist = useChecklist(), aiSetupItem = checklist.availableItems.find((item) => item.id === "aiSetup");
26907  return react_default.createElement(Container13, null, react_default.createElement(Intro, null, react_default.createElement("h1", null, "Guide"), react_default.createElement("p", null, "Whether you're just getting started or looking for ways to level up, this checklist will help you make the most of your Storybook.")), aiSetupItem && react_default.createElement(AiSetupBlock, { item: aiSetupItem, reset: checklist.reset, skip: checklist.skip }), react_default.createElement(Checklist, { ...checklist, forceCollapsed: aiSetupItem?.isOpen }), scope.FEATURES?.sidebarOnboardingChecklist !== !1 && react_default.createElement(react_default.Fragment, null, checklist.openItems.length === 0 ? react_default.createElement("center", null, "Your work here is done!") : checklist.widget.disable || checklist.openItems.every((item) => item.isMuted) ? react_default.createElement("center", null, "Want to see this in the sidebar?", " ", react_default.createElement(Link, { onClick: () => checklist.disable(!1) }, "Show in sidebar")) : react_default.createElement("center", null, "Don't want to see this in the sidebar?", " ", react_default.createElement(Link, { onClick: () => checklist.mute(checklist.allItems.map(({ id }) => id)) }, "Remove from sidebar"))));
26908};
26909
26910// src/manager/settings/ShortcutsPage.tsx
26911init_react();
26912
26913// src/manager/settings/shortcuts.tsx
26914init_react();
26915
26916// src/manager/settings/SettingsFooter.tsx
26917init_react();
26918var Footer
269182 = styled.div(({ theme }) => ({
26919  display: "flex",
26920  paddingTop: 20,
26921  marginTop: 20,
26922  borderTop: `1px solid ${theme.appBorderColor}`,
26923  fontWeight: theme.typography.weight.bold,
26924  "& > * + *": {
26925    marginLeft: 20
26926  }
26927})), SettingsFooter = (props) => react_default.createElement(Footer2
vendor: 10,043 bytes, lines 26927-27202
26927, { ...props }, react_default.createElement(Link, { secondary: !0, href: "https://storybook.js.org?ref=ui", cancel: !1, target: "_blank" }, "Docs"), react_default.createElement(Link, { secondary: !0, href: "https://github.com/storybookjs/storybook", cancel: !1, target: "_blank" }, "GitHub"), react_default.createElement(
26928  Link,
26929  {
26930    secondary: !0,
26931    href: "https://storybook.js.org/community?ref=ui#support",
26932    cancel: !1,
26933    target: "_blank"
26934  },
26935  "Support"
26936)), SettingsFooter_default = SettingsFooter;
26937
26938// src/manager/settings/shortcuts.tsx
26939var Header2 = styled.header(({ theme }) => ({
26940  marginBottom: 20,
26941  fontSize: theme.typography.size.m3,
26942  fontWeight: theme.typography.weight.bold,
26943  alignItems: "center",
26944  display: "flex"
26945})), HeaderItem = styled.div(({ theme }) => ({
26946  fontWeight: theme.typography.weight.bold
26947})), GridHeaderRow = styled.div({
26948  alignSelf: "flex-end",
26949  display: "grid",
26950  margin: "10px 0",
26951  gridTemplateColumns: "1fr 1fr 12px",
26952  "& > *:last-of-type": {
26953    gridColumn: "2 / 2",
26954    justifySelf: "flex-end",
26955    gridRow: "1"
26956  }
26957}), Row = styled.div(({ theme }) => ({
26958  padding: "6px 0",
26959  borderTop: `1px solid ${theme.appBorderColor}`,
26960  display: "grid",
26961  gridTemplateColumns: "1fr 1fr 0px"
26962})), GridWrapper = styled.div({
26963  display: "grid",
26964  gridTemplateColumns: "1fr",
26965  gridAutoRows: "minmax(auto, auto)",
26966  marginBottom: 20
26967}), Description = styled.div({
26968  alignSelf: "center"
26969}), TextInput = styled(Form.Input)(
26970  ({ valid, theme }) => valid === "error" ? {
26971    animation: `${theme.animation.jiggle} 700ms ease-out`
26972  } : {},
26973  {
26974    display: "flex",
26975    width: 80,
26976    flexDirection: "column",
26977    justifySelf: "flex-end",
26978    paddingLeft: 4,
26979    paddingRight: 4,
26980    textAlign: "center"
26981  }
26982), Fade = keyframes`
269830%,100% { opacity: 0; }
26984  50% { opacity: 1; }
26985`, SuccessIcon = styled(CheckIcon)(
26986  ({ valid, theme }) => valid === "valid" ? {
26987    color: theme.color.positive,
26988    animation: `${Fade} 2s ease forwards`
26989  } : {
26990    opacity: 0
26991  },
26992  {
26993    alignSelf: "center",
26994    display: "flex",
26995    marginLeft: 10,
26996    height: 14,
26997    width: 14
26998  }
26999), Container14 = styled.div(({ theme }) => ({
27000  fontSize: theme.typography.size.s2,
27001  padding: "3rem 20px",
27002  maxWidth: 600,
27003  margin: "0 auto"
27004})), shortcutLabels = {
27005  fullScreen: "Go full screen",
27006  togglePanel: "Toggle addons",
27007  panelPosition: "Toggle addons orientation",
27008  toggleNav: "Toggle sidebar",
27009  toolbar: "Toggle toolbar",
27010  search: "Focus search",
27011  focusNav: "Focus sidebar",
27012  focusIframe: "Focus canvas",
27013  focusPanel: "Focus addons",
27014  prevComponent: "Previous component",
27015  nextComponent: "Next component",
27016  prevStory: "Previous story",
27017  nextStory: "Next story",
27018  shortcutsPage: "Go to shortcuts page",
27019  aboutPage: "Go to about page",
27020  collapseAll: "Collapse all items on sidebar",
27021  expandAll: "Expand all items on sidebar",
27022  remount: "Reload story",
27023  openInEditor: "Open story in editor",
27024  openInIsolation: "Open story in isolation",
27025  copyStoryLink: "Copy story link to clipboard",
27026  goToPreviousLandmark: "Go to previous landmark",
27027  goToNextLandmark: "Go to next landmark"
27028  // TODO: bring this back once we want to add shortcuts for this
27029  // copyStoryName: 'Copy story name to clipboard',
27030}, fixedShortcuts = ["escape"], hardcodedShortcuts = ["goToPreviousLandmark", "goToNextLandmark"];
27031function toShortcutState(shortcutKeys) {
27032  let state = {};
27033  for (let key of Object.keys(shortcutKeys).filter((k2) => !fixedShortcuts.includes(k2)))
27034    state[key] = {
27035      shortcut: shortcutKeys[key],
27036      error: !1,
27037      hardcoded: hardcodedShortcuts.includes(key)
27038    };
27039  return state;
27040}
27041var ShortcutsScreen = class extends Component {
27042  constructor(props) {
27043    super(props);
27044    this.onKeyDown = (e2) => {
27045      let { activeFeature, shortcutKeys } = this.state;
27046      if (e2.key === "Backspace")
27047        return this.restoreDefault();
27048      let shortcut = eventToShortcut(e2);
27049      if (!shortcut)
27050        return !1;
27051      let normalizedShortcut = shortcut.map(
27052        (key) => Array.isArray(key) ? key.at(-1) : key
27053      ), error = !!Object.entries(shortcutKeys).find(
27054        ([feature, { shortcut: existingShortcut }]) => feature !== activeFeature && existingShortcut && shortcutMatchesShortcut(normalizedShortcut, existingShortcut)
27055      );
27056      return this.setState({
27057        shortcutKeys: { ...shortcutKeys, [activeFeature]: { shortcut: normalizedShortcut, error } }
27058      });
27059    };
27060    this.onFocus = (focusedInput) => () => {
27061      let { shortcutKeys } = this.state;
27062      this.setState({
27063        activeFeature: focusedInput,
27064        shortcutKeys: {
27065          ...shortcutKeys,
27066          [focusedInput]: { shortcut: null, error: !1 }
27067        }
27068      });
27069    };
27070    this.onBlur = async () => {
27071      let { shortcutKeys, activeFeature } = this.state;
27072      if (shortcutKeys[activeFeature]) {
27073        let { shortcut, error } = shortcutKeys[activeFeature];
27074        return !shortcut || error ? this.restoreDefault() : this.saveShortcut();
27075      }
27076      return !1;
27077    };
27078    this.saveShortcut = async () => {
27079      let { activeFeature, shortcutKeys } = this.state, { setShortcut } = this.props;
27080      await setShortcut(activeFeature, shortcutKeys[activeFeature].shortcut), this.setState({ successField: activeFeature });
27081    };
27082    this.restoreDefaults = async () => {
27083      let { restoreAllDefaultShortcuts } = this.props, defaultShortcuts = await restoreAllDefaultShortcuts();
27084      return this.setState({ shortcutKeys: toShortcutState(defaultShortcuts) });
27085    };
27086    this.restoreDefault = async () => {
27087      let { activeFeature, shortcutKeys } = this.state, { restoreDefaultShortcut } = this.props, defaultShortcut = await restoreDefaultShortcut(activeFeature);
27088      return this.setState({
27089        shortcutKeys: {
27090          ...shortcutKeys,
27091          ...toShortcutState({ [activeFeature]: defaultShortcut })
27092        }
27093      });
27094    };
27095    this.displaySuccessMessage = (activeElement) => {
27096      let { successField, shortcutKeys } = this.state;
27097      return activeElement === successField && shortcutKeys[activeElement].error === !1 ? "valid" : void 0;
27098    };
27099    this.displayError = (activeElement) => {
27100      let { activeFeature, shortcutKeys } = this.state;
27101      return activeElement === activeFeature && shortcutKeys[activeElement].error === !0 ? "error" : void 0;
27102    };
27103    this.renderKeyInput = () => {
27104      let { shortcutKeys, addonsShortcutLabels } = this.state;
27105      return Object.entries(shortcutKeys).filter(
27106        ([feature]) => shortcutLabels[feature] !== void 0 || addonsShortcutLabels && addonsShortcutLabels[feature]
27107      ).map(
27108        ([feature, { shortcut, hardcoded }]) => react_default.createElement(Row, { key: feature }, react_default.createElement(Description, null, shortcutLabels[feature] || addonsShortcutLabels[feature]), hardcoded ? react_default.createElement(react_default.Fragment, null, react_default.createElement(
27109          TooltipProvider,
27110          {
27111            tooltip: react_default.createElement(Tooltip, { hasChrome: !0 }, "This shortcut cannot be changed."),
27112            placement: "right"
27113          },
27114          react_default.createElement(
27115            TextInput,
27116            {
27117              "aria-disabled": !0,
27118              readOnly: !0,
27119              valid: void 0,
27120              value: shortcut ? shortcutToHumanString(shortcut) : ""
27121            }
27122          )
27123        )) : react_default.createElement(
27124          TextInput,
27125          {
27126            spellCheck: "false",
27127            valid: this.displayError(feature),
27128            className: "modalInput",
27129            onBlur: this.onBlur,
27130            onFocus: this.onFocus(feature),
27131            onKeyDown: this.onKeyDown,
27132            value: shortcut ? shortcutToHumanString(shortcut) : "",
27133            placeholder: "Type keys",
27134            readOnly: !0
27135          }
27136        ), react_default.createElement(SuccessIcon, { valid: this.displaySuccessMessage(feature) }))
27137      );
27138    };
27139    this.renderKeyForm = () => react_default.createElement(GridWrapper, null, react_default.createElement(GridHeaderRow, null, react_default.createElement(HeaderItem, null, "Commands"), react_default.createElement(HeaderItem, null, "Shortcut")), this.renderKeyInput());
27140    this.state = {
27141      // @ts-expect-error (non strict)
27142      activeFeature: void 0,
27143      // @ts-expect-error (non strict)
27144      successField: void 0,
27145      // The initial shortcutKeys that come from props are the defaults/what was saved
27146      // As the user interacts with the page, the state stores the temporary, unsaved shortcuts
27147      // This object also includes the error attached to each shortcut
27148      shortcutKeys: toShortcutState(props.shortcutKeys),
27149      addonsShortcutLabels: props.addonsShortcutLabels
27150    };
27151  }
27152  render() {
27153    let layout = this.renderKeyForm();
27154    return react_default.createElement(Container14, null, react_default.createElement(Header2, null, "Keyboard shortcuts"), layout, react_default.createElement(
27155      Button,
27156      {
27157        ariaLabel: !1,
27158        variant: "outline",
27159        size: "small",
27160        id: "restoreDefaultsHotkeys",
27161        onClick: this.restoreDefaults
27162      },
27163      "Restore defaults"
27164    ), react_default.createElement(SettingsFooter_default, null));
27165  }
27166};
27167
27168// src/manager/settings/ShortcutsPage.tsx
27169var ShortcutsPage = () => react_default.createElement(Consumer, null, ({
27170  api: {
27171    getShortcutKeys,
27172    getAddonsShortcutLabels,
27173    setShortcut,
27174    restoreDefaultShortcut,
27175    restoreAllDefaultShortcuts
27176  }
27177}) => react_default.createElement(
27178  ShortcutsScreen,
27179  {
27180    shortcutKeys: getShortcutKeys(),
27181    addonsShortcutLabels: getAddonsShortcutLabels(),
27182    setShortcut,
27183    restoreDefaultShortcut,
27184    restoreAllDefaultShortcuts
27185  }
27186));
27187
27188// src/manager/settings/whats_new_page.tsx
27189init_react();
27190
27191// src/manager/settings/whats_new.tsx
27192init_react();
27193var Centered = styled.div({
27194  top: "50%",
27195  position: "absolute",
27196  transform: "translateY(-50%)",
27197  width: "100%",
27198  textAlign: "center"
27199}), LoaderWrapper2 = styled.div({
27200  position: "relative",
27201  height: "32px"
27202}), Message
vendor: 2,476 bytes, lines 27202-27251
272022 = styled.div(({ theme }) => ({
27203  paddingTop: "12px",
27204  color: theme.textMutedColor,
27205  maxWidth: "295px",
27206  margin: "0 auto",
27207  fontSize: `${theme.typography.size.s1}px`,
27208  lineHeight: "16px"
27209})), Container15 = styled.div(({ theme }) => ({
27210  position: "absolute",
27211  width: "100%",
27212  height: 40,
27213  bottom: 0,
27214  background: theme.background.bar,
27215  fontSize: theme.typography.size.s2,
27216  borderTop: `1px solid ${theme.color.border}`,
27217  padding: "0 10px 0 15px",
27218  display: "flex",
27219  alignItems: "center",
27220  justifyContent: "space-between"
27221})), WhatsNewFooter = ({
27222  isNotificationsEnabled,
27223  onToggleNotifications,
27224  copyContent
27225}) => {
27226  let theme = useTheme(), { children: copyText, buttonProps: copyButtonProps } = useCopyButton({
27227    children: "Copy Link",
27228    content: copyContent
27229  });
27230  return react_default.createElement(Container15, null, react_default.createElement("div", { style: { display: "flex", alignItems: "center", gap: 10 } }, react_default.createElement(HeartIcon, { color: theme.color.mediumdark }), react_default.createElement("div", null, "Share this with your team."), react_default.createElement(Button, { size: "small", variant: "ghost", ...copyButtonProps }, copyText)), isNotificationsEnabled ? react_default.createElement(Button, { ariaLabel: !1, size: "small", variant: "ghost", onClick: onToggleNotifications }, react_default.createElement(EyeCloseIcon, null), "Hide notifications") : react_default.createElement(Button, { ariaLabel: !1, size: "small", variant: "ghost", onClick: onToggleNotifications }, react_default.createElement(EyeIcon, null), "Show notifications"));
27231}, Iframe = styled.iframe(
27232  {
27233    position: "absolute",
27234    top: 0,
27235    left: 0,
27236    right: 0,
27237    bottom: 0,
27238    border: 0,
27239    margin: 0,
27240    padding: 0,
27241    width: "100%",
27242    height: "calc(100% - 40px)",
27243    background: "white"
27244  },
27245  ({ isLoaded }) => ({ visibility: isLoaded ? "visible" : "hidden" })
27246), AlertIcon2 = styled(((props) => react_default.createElement(AlertIcon, { ...props })))(({ theme }) => ({
27247  color: theme.textMutedColor,
27248  width: 32,
27249  height: 32,
27250  margin: "0 auto"
27251})), WhatsNewLoader = () => react_default.createElement(Centered, null, react_default.createElement(LoaderWrapper2, null, react_default.createElement(Loader, null)), react_default.createElement(Message2, null, "Loading...")), MaxWaitTimeMessaging = () => react_default.createElement(Centered, null, react_default.createElement(AlertIcon2, null), react_default.createElement(Message2
vendor: 3,326 bytes, lines 27251-27323
27251, null, "The page couldn't be loaded. Check your internet connection and try again.")), PureWhatsNewScreen = ({
27252  didHitMaxWaitTime,
27253  isLoaded,
27254  onLoad,
27255  url,
27256  copyContent,
27257  onToggleNotifications,
27258  isNotificationsEnabled
27259}) => react_default.createElement(Fragment, null, !isLoaded && !didHitMaxWaitTime && react_default.createElement(WhatsNewLoader, null), didHitMaxWaitTime ? react_default.createElement(MaxWaitTimeMessaging, null) : react_default.createElement(react_default.Fragment, null, react_default.createElement(Iframe, { isLoaded, onLoad, src: url, title: "What's new?" }), react_default.createElement(
27260  WhatsNewFooter,
27261  {
27262    isNotificationsEnabled,
27263    onToggleNotifications,
27264    copyContent
27265  }
27266))), MAX_WAIT_TIME = 1e4, WhatsNewScreen = () => {
27267  let api = useStorybookApi(), state = useStorybookState(), { whatsNewData } = state, [isLoaded, setLoaded] = useState(!1), [didHitMaxWaitTime, setDidHitMaxWaitTime] = useState(!1);
27268  if (useEffect(() => {
27269    let timer = setTimeout(() => !isLoaded && setDidHitMaxWaitTime(!0), MAX_WAIT_TIME);
27270    return () => clearTimeout(timer);
27271  }, [isLoaded]), whatsNewData?.status !== "SUCCESS")
27272    return null;
27273  let isNotificationsEnabled = !whatsNewData.disableWhatsNewNotifications;
27274  return react_default.createElement(
27275    PureWhatsNewScreen,
27276    {
27277      didHitMaxWaitTime,
27278      isLoaded,
27279      onLoad: () => {
27280        api.whatsNewHasBeenRead(), setLoaded(!0);
27281      },
27282      url: whatsNewData.url,
27283      isNotificationsEnabled,
27284      copyContent: whatsNewData.blogUrl ?? whatsNewData.url,
27285      onToggleNotifications: () => {
27286        isNotificationsEnabled ? scope.confirm("All update notifications will no longer be shown. Are you sure?") && api.toggleWhatsNewNotifications() : api.toggleWhatsNewNotifications();
27287      }
27288    }
27289  );
27290};
27291
27292// src/manager/settings/whats_new_page.tsx
27293var WhatsNewPage = () => react_default.createElement(WhatsNewScreen, null);
27294
27295// src/manager/settings/index.tsx
27296var { document: document9 } = scope, Content5 = styled(ScrollArea)(({ theme }) => ({
27297  background: theme.background.content
27298})), SidebarToggle = styled.div({
27299  // Extra specificity is necessary here
27300  "&&:has(*)": {
27301    order: 0,
27302    display: "flex",
27303    alignItems: "center",
27304    marginLeft: 10,
27305    marginRight: 6,
27306    gap: 6
27307  }
27308}), RouteWrapper = ({ children, path }) => react_default.createElement(Content5, { vertical: !0, horizontal: !1 }, react_default.createElement(Route, { path }, children)), Pages = ({ changeTab, onClose, enableShortcuts = !0, enableWhatsNew }) => {
27309  react_default.useEffect(() => {
27310    let handleEscape = (event) => {
27311      !enableShortcuts || event.repeat || matchesModifiers(!1, event) && matchesKeyCode("Escape", event) && (event.preventDefault(), onClose());
27312    };
27313    return document9.addEventListener("keydown", handleEscape), () => document9.removeEventListener("keydown", handleEscape);
27314  }, [enableShortcuts, onClose]);
27315  let api = useStorybookApi(), toolsExtra = Object.values(api.getElements(Addon_TypesEnum.TOOLEXTRA)), tabs = useMemo(() => {
27316    let tabsToInclude = [
27317      {
27318        id: "about",
27319        title: "About",
27320        children: react_default.createElement(RouteWrapper, { path: "about" }, react_default.createElement(AboutPage, { key: "about" }))
27321      }
27322    ];
27323    return scope.CONFIG_TYPE === "DEVELOPMENT" && 
vendor: 3,713 bytes, lines 27323-27416
27323tabsToInclude.push({
27324      id: "guide",
27325      title: "Guide",
27326      children: react_default.createElement(RouteWrapper, { path: "guide" }, react_default.createElement(GuidePage, { key: "guide" }))
27327    }), tabsToInclude.push({
27328      id: "shortcuts",
27329      title: "Keyboard shortcuts",
27330      children: react_default.createElement(RouteWrapper, { path: "shortcuts" }, react_default.createElement(ShortcutsPage, { key: "shortcuts" }))
27331    }), enableWhatsNew && tabsToInclude.push({
27332      id: "whats-new",
27333      title: "What's new?",
27334      children: react_default.createElement(RouteWrapper, { path: "whats-new" }, react_default.createElement(WhatsNewPage, { key: "whats-new" }))
27335    }), tabsToInclude;
27336  }, [enableWhatsNew]);
27337  return react_default.createElement(Location, null, ({ path }) => {
27338    let selected = tabs.find((tab) => path.includes(`settings/${tab.id}`))?.id;
27339    return react_default.createElement(
27340      TabsView,
27341      {
27342        tabs,
27343        tools: react_default.createElement(react_default.Fragment, null, react_default.createElement(SidebarToggle, null, menuTool.render({})), toolsExtra.map((item) => react_default.createElement(react_default.Fragment, { key: item.id }, item.render({}))), react_default.createElement(
27344          Button,
27345          {
27346            padding: "small",
27347            variant: "ghost",
27348            onClick: (e2) => (e2.preventDefault(), onClose()),
27349            ariaLabel: "Close settings page"
27350          },
27351          react_default.createElement(CloseIcon, null)
27352        )),
27353        selected,
27354        onSelectionChange: changeTab
27355      }
27356    );
27357  });
27358}, SettingsPages = () => {
27359  let api = useStorybookApi(), state = useStorybookState(), changeTab = (tab) => api.changeSettingsTab(tab);
27360  return react_default.createElement(
27361    Pages,
27362    {
27363      enableWhatsNew: state.whatsNewData?.status === "SUCCESS",
27364      enableShortcuts: state.ui.enableShortcuts,
27365      changeTab,
27366      onClose: api.closeSettings
27367    }
27368  );
27369}, settingsPageAddon = {
27370  id: "settings",
27371  url: "/settings/",
27372  title: "Settings",
27373  type: types.experimental_PAGE,
27374  render: () => react_default.createElement(Route, { path: "/settings/", startsWith: !0 }, react_default.createElement(SettingsPages, null))
27375};
27376
27377// src/manager/index.tsx
27378ThemeProvider.displayName = "ThemeProvider";
27379q.displayName = "HelmetProvider";
27380var Root3 = ({ provider }) => react_default.createElement(q, { key: "helmet.Provider" }, react_default.createElement(LocationProvider, { key: "location.provider" }, react_default.createElement(Main, { provider }))), Main = ({ provider }) => {
27381  let navigate = useNavigate();
27382  return react_default.createElement(Location, { key: "location.consumer" }, (locationData) => react_default.createElement(
27383    Provider,
27384    {
27385      key: "manager",
27386      provider,
27387      ...locationData,
27388      navigate,
27389      docsOptions: scope?.DOCS_OPTIONS || {}
27390    },
27391    (combo) => {
27392      let { state, api } = combo, setManagerLayoutState = useCallback(
27393        (sizes) => {
27394          api.setSizes(sizes);
27395        },
27396        [api]
27397      ), pages = useMemo(
27398        () => [settingsPageAddon, ...Object.values(api.getElements(types.experimental_PAGE))],
27399        [Object.keys(api.getElements(types.experimental_PAGE)).join()]
27400      );
27401      return react_default.createElement(ThemeProvider, { key: "theme.provider", theme: ensure(state.theme) }, react_default.createElement(LayoutProvider, null, react_default.createElement(
27402        App,
27403        {
27404          key: "app",
27405          pages,
27406          managerLayoutState: {
27407            ...state.layout,
27408            viewMode: state.viewMode
27409          },
27410          hasTab: !!api.getQueryParam("tab"),
27411          setManagerLayoutState
27412        }
27413      )));
27414    }
27415  ));
27416};
27417function renderStorybookUI(domNode, provider) {
27418  if (!(provider instanceof Provider2))
27419    throw new ProviderDoesNotExtendBaseProviderError();
27420  createRoot(domNode).render(react_default.createElement(Root3, { key: "root", provider }));
27421}
27422
27423// src/manager/runtime.tsx
27424var WS_DISCONNECTED_NOTIFICATION_ID = "CORE/WS_DISCONNECTED";
27425addons.register(
27426  TOOLBAR_ID,
27427  () => addons.add(TOOLBAR_ID, {
27428    title: TOOLBAR_ID,
27429    type: types.TOOL,
27430    match: ({ tabId }) => !tabId,
27431    render: () => react_default.createElement(ToolbarManager, null)
27432  })
27433);
27434var ReactProvider = class extends Provider2 {
27435  constructor() {
27436    super();
27437    this.wsDisconnected = !1;
27438    let channel = createBrowserChannel({ page: "manager" });
27439    addons.setChannel(channel), channel.emit(CHANNEL_CREATED), this.addons = addons, this.channel = channel, scope.__STORYBOOK_ADDONS_CHANNEL__ = channel
vendor: 803 bytes, lines 27439-27463
27439;
27440  }
27441  getElements(type) {
27442    return this.addons.getElements(type);
27443  }
27444  getConfig() {
27445    return this.addons.getConfig();
27446  }
27447  handleAPI(api) {
27448    this.addons.loadAddons(api), this.channel.on(CHANNEL_WS_DISCONNECT, (ev) => {
27449      this.wsDisconnected = !0, api.addNotification({
27450        id: WS_DISCONNECTED_NOTIFICATION_ID,
27451        content: {
27452          headline: ev.code === 3008 ? "Server timed out" : "Connection lost",
27453          subHeadline: "Please restart your Storybook server and reload the page"
27454        },
27455        icon: react_default.createElement(FailedIcon, { color: color.negative }),
27456        link: void 0
27457      });
27458    });
27459  }
27460}, { document: document10 } = scope, rootEl = document10.getElementById("root");
27461setTimeout(() => {
27462  renderStorybookUI(rootEl, new ReactProvider());
27463}, 0);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.